From 38203b745ae1903ba0804ed5532b78d255bea635 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 5 Aug 2018 11:14:39 -0400 Subject: Added timeline polling Because the streaming API will sunset on August 16th, it is essential to implement timeline polling so that the library can still be used to access tweets. This commit breaks the current API even for clients still using the streaming API because the OAuth connection data was pulled from twitter::client into twitter::auth. Other than that, almost everything works the same, and if a client wants to update their libtwitter++ within the next week and a half, they are free to. --- src/notification.h | 58 +++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'src/notification.h') diff --git a/src/notification.h b/src/notification.h index a6dd6f4..ad649c3 100644 --- a/src/notification.h +++ b/src/notification.h @@ -10,9 +10,9 @@ #include "direct_message.h" namespace twitter { - + class client; - + enum class disconnect_code { shutdown, @@ -27,13 +27,13 @@ namespace twitter { load, unknown }; - + class notification { public: enum class type { // Tweet object tweet, - + // User object update_user, block, @@ -41,19 +41,19 @@ namespace twitter { follow, followed, unfollow, - + // User and tweet favorite, favorited, unfavorite, unfavorited, quoted, - + // List list_created, list_destroyed, list_updated, - + // User and list list_add, list_added, @@ -63,16 +63,16 @@ namespace twitter { list_subscribed, list_unsubscribe, list_unsubscribed, - + // Warning stall, follow_limit, unknown_warning, - + // User ID and tweet ID deletion, scrub_location, - + // Special limit, withhold_status, @@ -80,78 +80,78 @@ namespace twitter { disconnect, friends, direct, - + // Nothing unknown, invalid }; - + type getType() const; - + notification() {} - notification(const client& tclient, std::string data); - + notification(const user& currentUser, std::string data); + notification(const notification& other); notification(notification&& other); notification& operator=(notification other); ~notification(); - + friend void swap(notification& first, notification& second); - + const tweet& getTweet() const; tweet& getTweet() { return const_cast(static_cast(*this).getTweet()); } - + const user& getUser() const; user& getUser() { return const_cast(static_cast(*this).getUser()); } - + const list& getList() const; list& getList() { return const_cast(static_cast(*this).getList()); } - + tweet_id getTweetID() const; void setTweetID(tweet_id _arg); - + user_id getUserID() const; void setUserID(user_id _arg); - + const std::vector& getCountries() const; std::vector& getCountries() { return const_cast&>(static_cast(*this).getCountries()); } - + disconnect_code getDisconnectCode() const; void setDisconnectCode(disconnect_code _arg); - + const std::set& getFriends() const; std::set& getFriends() { return const_cast&>(static_cast(*this).getFriends()); } - + const direct_message& getDirectMessage() const; direct_message& getDirectMessage() { return const_cast(static_cast(*this).getDirectMessage()); } - + int getLimit() const; void setLimit(int _arg); - + const std::string& getWarning() const; std::string& getWarning() { return const_cast(static_cast(*this).getWarning()); } - + private: union { tweet _tweet; @@ -186,7 +186,7 @@ namespace twitter { }; type _type = type::invalid; }; - + }; #endif /* end of include guard: NOTIFICATION_H_69AEF4CC */ -- cgit 1.4.1