diff --git a/backends/twitter/TwitterPlugin.h b/backends/twitter/TwitterPlugin.h index 95e03c8724586a22d8c1d6ffcfcad8e251e987f9..0e121d5ae7bfcef667d8c520788299a15c3787ab 100644 --- a/backends/twitter/TwitterPlugin.h +++ b/backends/twitter/TwitterPlugin.h @@ -43,6 +43,7 @@ class TwitterPlugin; extern TwitterPlugin *np; extern Swift::SimpleEventLoop *loop_; // Event Loop + class TwitterPlugin : public NetworkPlugin { public: Swift::BoostNetworkFactories *m_factories; @@ -110,11 +111,11 @@ class TwitterPlugin : public NetworkPlugin { /****************** Twitter Response handlers **************************************/ void statusUpdateResponse(std::string &user, std::string &errMsg); void helpMessageResponse(std::string &user, std::string &msg); - void populateRoster(std::string &user, std::vector &friends, std::string &errMsg); - void displayFriendlist(std::string &user, std::vector &friends, std::string &errMsg); + void populateRoster(std::string &user, std::vector &friends, std::vector &friendAvatars, std::string &errMsg); + void displayFriendlist(std::string &user, std::vector &friends, std::vector &friendAvatars, std::string &errMsg); void displayTweets(std::string &user, std::string &userRequested, std::vector &tweets , std::string &errMsg); void directMessageResponse(std::string &user, std::string &username, std::vector &messages, std::string &errMsg); - void createFriendResponse(std::string &user, User &frnd, std::string &errMsg); + void createFriendResponse(std::string &user, User &frnd, std::string &img, std::string &errMsg); void deleteFriendResponse(std::string &user, User &frnd, std::string &errMsg); void RetweetResponse(std::string &user, std::string &errMsg); void profileImageResponse(std::string &user, std::string &buddy, std::string &img, unsigned int reqID, std::string &errMsg); @@ -139,15 +140,34 @@ class TwitterPlugin : public NetworkPlugin { boost::mutex dblock, userlock; ThreadPool *tp; - std::map sessions; - std::map connectionState; - std::map mostRecentTweetID; - std::map mostRecentDirectMessageID; + //std::map sessions; + //std::map connectionState; + //std::map mostRecentTweetID; + //std::map mostRecentDirectMessageID; std::set onlineUsers; - std::map nickName; - std::map > buddies; - std::map imgURL; - std::map twitterMode; + //std::map nickName; + //std::map > buddies; + //std::map imgURL; + //std::map twitterMode; + + struct UserData + { + User userTwitterObj; + std::string userImg; + twitCurl* sessions; + status connectionState; + std::string mostRecentTweetID; + std::string mostRecentDirectMessageID; + std::string nickName; + std::set buddies; + std::map buddiesInfo; + std::map buddiesImgs; + mode twitterMode; + + UserData() { sessions = NULL; } + }; + + std::map userdb; }; #endif