about summary refs log tree commit diff stats
path: root/src/client.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.h')
-rw-r--r--src/client.h36
1 files changed, 22 insertions, 14 deletions
diff --git a/src/client.h b/src/client.h index 1e1b1ab..5e2ab1c 100644 --- a/src/client.h +++ b/src/client.h
@@ -10,20 +10,14 @@
10#include "auth.h" 10#include "auth.h"
11#include "configuration.h" 11#include "configuration.h"
12#include "util.h" 12#include "util.h"
13 13#include "timeline.h"
14namespace OAuth {
15 class Consumer;
16 class Token;
17 class Client;
18};
19 14
20namespace twitter { 15namespace twitter {
21 16
22 class client { 17 class client {
23 public: 18 public:
24 19
25 client(const auth& _auth); 20 client(const auth& arg);
26 ~client();
27 21
28 tweet updateStatus(std::string msg, std::list<long> media_ids = {}) const; 22 tweet updateStatus(std::string msg, std::list<long> media_ids = {}) const;
29 long uploadMedia(std::string media_type, const char* data, long data_length) const; 23 long uploadMedia(std::string media_type, const char* data, long data_length) const;
@@ -51,18 +45,32 @@ namespace twitter {
51 45
52 const configuration& getConfiguration() const; 46 const configuration& getConfiguration() const;
53 47
54 private: 48 timeline& getHomeTimeline()
49 {
50 return homeTimeline_;
51 }
55 52
56 friend class stream; 53 timeline& getMentionsTimeline()
54 {
55 return mentionsTimeline_;
56 }
57 57
58 std::unique_ptr<OAuth::Consumer> _oauth_consumer; 58 private:
59 std::unique_ptr<OAuth::Token> _oauth_token;
60 std::unique_ptr<OAuth::Client> _oauth_client;
61 59
62 std::unique_ptr<user> _current_user; 60 const auth& auth_;
61
62 user currentUser_;
63 63
64 mutable std::unique_ptr<configuration> _configuration; 64 mutable std::unique_ptr<configuration> _configuration;
65 mutable time_t _last_configuration_update; 65 mutable time_t _last_configuration_update;
66
67 timeline homeTimeline_ {
68 auth_,
69 "https://api.twitter.com/1.1/statuses/home_timeline.json"};
70
71 timeline mentionsTimeline_ {
72 auth_,
73 "https://api.twitter.com/1.1/statuses/mentions_timeline.json"};
66 }; 74 };
67 75
68}; 76};