From 7c44fd17bb6be54a2ea4b60761e91053ca988977 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 29 Nov 2016 16:18:25 -0500 Subject: Made tweets, users, and notifications into copyable objects Notifications are now also mutable. Users and tweets no longer have helper methods for interacting with the client. Fixed a bug (possibly introduced by a change to the Twitter API) that caused non-reply tweets to be marked as unknown notifications. --- src/user.cpp | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'src/user.cpp') 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 @@ namespace twitter { - user::user(const client& tclient, std::string data) try - : _client(tclient) + user::user(std::string data) try + : _valid(true) { auto json = nlohmann::json::parse(data); _id = json["id"].get(); @@ -19,25 +19,5 @@ namespace twitter { { std::throw_with_nested(malformed_object("user", data)); } - - std::set user::getFriends() const - { - return _client.getFriends(_id); - } - - std::set user::getFollowers() const - { - return _client.getFollowers(_id); - } - - void user::follow() const - { - _client.follow(_id); - } - - void user::unfollow() const - { - _client.unfollow(_id); - } }; -- cgit 1.4.1