diff options
Diffstat (limited to 'src/user.cpp')
-rw-r--r-- | src/user.cpp | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/src/user.cpp b/src/user.cpp index 0b6e93a..f9b02a1 100644 --- a/src/user.cpp +++ b/src/user.cpp | |||
@@ -5,8 +5,8 @@ | |||
5 | 5 | ||
6 | namespace twitter { | 6 | namespace twitter { |
7 | 7 | ||
8 | user::user(const client& tclient, std::string data) try | 8 | user::user(std::string data) try |
9 | : _client(tclient) | 9 | : _valid(true) |
10 | { | 10 | { |
11 | auto json = nlohmann::json::parse(data); | 11 | auto json = nlohmann::json::parse(data); |
12 | _id = json["id"].get<user_id>(); | 12 | _id = json["id"].get<user_id>(); |
@@ -19,25 +19,5 @@ namespace twitter { | |||
19 | { | 19 | { |
20 | std::throw_with_nested(malformed_object("user", data)); | 20 | std::throw_with_nested(malformed_object("user", data)); |
21 | } | 21 | } |
22 | |||
23 | std::set<user_id> user::getFriends() const | ||
24 | { | ||
25 | return _client.getFriends(_id); | ||
26 | } | ||
27 | |||
28 | std::set<user_id> user::getFollowers() const | ||
29 | { | ||
30 | return _client.getFollowers(_id); | ||
31 | } | ||
32 | |||
33 | void user::follow() const | ||
34 | { | ||
35 | _client.follow(_id); | ||
36 | } | ||
37 | |||
38 | void user::unfollow() const | ||
39 | { | ||
40 | _client.unfollow(_id); | ||
41 | } | ||
42 | 22 | ||
43 | }; | 23 | }; |