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.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/user.h') diff --git a/src/user.h b/src/user.h index f08840b..ef7d72e 100644 --- a/src/user.h +++ b/src/user.h @@ -3,6 +3,7 @@ #include #include +#include namespace twitter { @@ -13,20 +14,27 @@ namespace twitter { class user { public: - user(const client& tclient, std::string data); + user() {} + user(std::string data); user_id getID() const { + assert(_valid); + return _id; } std::string getScreenName() const { + assert(_valid); + return _screen_name; } std::string getName() const { + assert(_valid); + return _name; } @@ -40,14 +48,9 @@ namespace twitter { return _id != other._id; } - std::set getFriends() const; - std::set getFollowers() const; - void follow() const; - void unfollow() const; - private: - const client& _client; + bool _valid = false; user_id _id; std::string _screen_name; std::string _name; -- cgit 1.4.1