diff options
author | Robert Pösel <robyer@seznam.cz> | 2015-02-07 08:43:50 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2015-02-07 08:43:50 +0000 |
commit | bca544e48bda364d28bf3d732e0b578683870ebf (patch) | |
tree | 64b710b5777cf5c83ab583e277111c26ff9fe381 /protocols/FacebookRM/src/communication.cpp | |
parent | caaf768bfac9eec37f9461c8354cb62a1216f773 (diff) |
Facebook: Correct implementation of idle time reporting, update channel request
git-svn-id: http://svn.miranda-ng.org/main/trunk@12036 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/communication.cpp')
-rw-r--r-- | protocols/FacebookRM/src/communication.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index 0f7ff0e9ec..2399dbfad7 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -3,7 +3,7 @@ Facebook plugin for Miranda Instant Messenger _____________________________________________ -Copyright © 2009-11 Michal Zelinka, 2011-15 Robert Pösel +Copyright � 2009-11 Michal Zelinka, 2011-15 Robert P�sel This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -535,13 +535,13 @@ std::string facebook_client::choose_action(RequestType request_type, std::string action += "&clientid=" + this->chat_clientid_; action += "&cb=" + utils::text::rand_string(4, "0123456789abcdefghijklmnopqrstuvwxyz"); - // FIXME: fix this as I don't know how it works yet (because of quick stable release) - if (!parent->isInvisible()) - action += "&idle=-1&state=active"; - else - action += "&idle=1"; - + int idleSeconds = parent->IdleSeconds(); + action += "&idle=" + utils::conversion::to_string(&idleSeconds, UTILS_CONV_UNSIGNED_NUMBER); action += "&cap=0"; + // action += "&wtc=0,0,0.000,0,0"; // TODO: what's this item? It's numbers grows with every new request... + + action += "&uid=" + self_.user_id; + action += "&viewer_uid=" + self_.user_id; if (!this->chat_sticky_num_.empty()) action += "&sticky_token=" + this->chat_sticky_num_; @@ -552,6 +552,11 @@ std::string facebook_client::choose_action(RequestType request_type, std::string if (!this->chat_traceid_.empty()) action += "&traceid=" + this->chat_traceid_; + if (parent->isInvisible()) + action += "&state=offline"; + else if (idleSeconds < 60) + action += "&state=active"; + return action; } |