diff --git a/backends/twitter/Requests/HelpMessageRequest.cpp b/backends/twitter/Requests/HelpMessageRequest.cpp index 53ee3692..da7dfc76 100644 --- a/backends/twitter/Requests/HelpMessageRequest.cpp +++ b/backends/twitter/Requests/HelpMessageRequest.cpp @@ -3,16 +3,21 @@ DEFINE_LOGGER(logger, "HelpMessageRequest") void HelpMessageRequest::run() { helpMsg = helpMsg - + "\n******************************HELP************************************\n" - + "#status ==> Update your status\n" + + "You will receive tweets of people you follow from this contact." + + "Following commands can be used to manage your Twitter account:" + "#timeline [username] ==> Retrieve 's timeline; Default - own timeline\n" + + "#status ==> Update your status\n" + "@ ==> Send a directed message to the user \n" + "#retweet ==> Retweet the tweet having id \n" + "#follow ==> Follow user \n" + "#unfollow ==> Stop Following user \n" - + "#mode [012] ==> Switch mode to 0(single), 1(multiple) or 2(chatroom)\n" + + "#mode [01] ==> Switch mode to 0(single), 1(multiple). See below\n" + "#help ==> Print this help message\n" - + "************************************************************************\n"; + + "************************************************************************\n" + + "There are 3 ways how to use the gateway:\n" + + "Mode 0 - There is twitter.com contact in your roster and all Twitter messages are forwaded using this contact.\n" + + "Mode 1 - Same as Mode 0, but the people you follow are displayed in your roster. You will receive/send directed messages using those contacts.\n" + + "Joining the #twitter@" + jid + " room - You can join mentioned room and see people you follow there as well as the tweets they post. Private messages in that room are mapped to Twitter direct messages."; } void HelpMessageRequest::finalize() diff --git a/backends/twitter/Requests/HelpMessageRequest.h b/backends/twitter/Requests/HelpMessageRequest.h index 14188eb3..c0d86d2b 100644 --- a/backends/twitter/Requests/HelpMessageRequest.h +++ b/backends/twitter/Requests/HelpMessageRequest.h @@ -14,13 +14,15 @@ using namespace Transport; class HelpMessageRequest : public Thread { std::string user; + std::string jid; std::string helpMsg; boost::function callBack; public: - HelpMessageRequest(const std::string &_user, boost::function cb) { + HelpMessageRequest(const std::string &_user, const std::string &jid, boost::function cb) { user = _user; callBack = cb; + this->jid = jid; } void run(); diff --git a/backends/twitter/Requests/PINExchangeProcess.cpp b/backends/twitter/Requests/PINExchangeProcess.cpp index dc6b756a..51c87aee 100644 --- a/backends/twitter/Requests/PINExchangeProcess.cpp +++ b/backends/twitter/Requests/PINExchangeProcess.cpp @@ -39,6 +39,7 @@ void PINExchangeProcess::finalize() } np->pinExchangeComplete(user, OAuthAccessTokenKey, OAuthAccessTokenSecret); np->handleMessage(user, "twitter.com", "PIN is OK. You are now authorized."); + np->handleMessage(user, "twitter.com", "Send '#help' (without the quotes) to see how to use this transport."); LOG4CXX_INFO(logger, user << ": Sent PIN " << data << " and obtained Access Token"); } } diff --git a/backends/twitter/TwitterPlugin.cpp b/backends/twitter/TwitterPlugin.cpp index 96ca53ea..6d5c5e69 100644 --- a/backends/twitter/TwitterPlugin.cpp +++ b/backends/twitter/TwitterPlugin.cpp @@ -215,7 +215,7 @@ void TwitterPlugin::handleMessageSendRequest(const std::string &user, const std: if(cmd == "#pin") tp->runAsThread(new PINExchangeProcess(np, userdb[user].sessions, user, data)); else if(cmd == "#help") - tp->runAsThread(new HelpMessageRequest(user, boost::bind(&TwitterPlugin::helpMessageResponse, this, _1, _2))); + tp->runAsThread(new HelpMessageRequest(user, CONFIG_STRING(config, "service.jid"), boost::bind(&TwitterPlugin::helpMessageResponse, this, _1, _2))); else if(cmd[0] == '@') { std::string username = cmd.substr(1); tp->runAsThread(new DirectMessageRequest(userdb[user].sessions, user, username, data,