diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-07-29 11:41:43 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-07-29 11:41:43 +0000 |
commit | f2f7c95e542cf5345ca020f100a1e4a3138c0ccf (patch) | |
tree | 6705682cd85ee65ed790ca8cc7d3e52ac75562b3 | |
parent | 0ed8f77f6a6bdba4ed7f2fa23b4cc8d0a899d53b (diff) |
Facebook: attempt to fix accidental "freeze" of channel requests
git-svn-id: http://svn.miranda-ng.org/main/trunk@9981 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/FacebookRM/src/communication.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index d78f88d2b6..58fa61ed51 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -1033,6 +1033,15 @@ bool facebook_client::reconnect() this->chat_conn_num_ = utils::text::source_get_value2(&resp.data, "\"max_conn\":", ",}"); parent->debugLogA(" Got self max_conn: %s", this->chat_conn_num_.c_str()); + + this->chat_sticky_num_ = utils::text::source_get_value(&resp.data, 2, "\"sticky_token\":\"", "\""); + parent->debugLogA(" Got self sticky_token: %s", this->chat_sticky_num_.c_str()); + + //std::string retry_interval = utils::text::source_get_value2(&resp.data, "\"retry_interval\":", ",}"); + //parent->debugLogA(" Got self retry_interval: %s", retry_interval.c_str()); + + //std::string visibility = utils::text::source_get_value2(&resp.data, "\"visibility\":", ",}"); + //parent->debugLogA(" Got self visibility: %s", visibility); return handle_success("reconnect"); } @@ -1073,17 +1082,18 @@ bool facebook_client::channel() parent->debugLogA(" Got self sticky number: %s", this->chat_sticky_num_.c_str()); } else if (type == "fullReload" || type == "refresh") { - // Something went wrong (server flooding?) + // Requested reload of page or relogin (due to some settings change, removing this session, etc.) parent->debugLogA("! ! ! Requested %s", type.c_str()); this->chat_sequence_num_ = utils::text::source_get_value2(&resp.data, "\"seq\":", ",}"); parent->debugLogA(" Got self sequence number: %s", this->chat_sequence_num_.c_str()); - this->chat_reconnect_reason_ = utils::text::source_get_value2(&resp.data, "\"reason\":", ",}"); - parent->debugLogA(" Reconnect reason: %s", this->chat_reconnect_reason_.c_str()); + if (type == "refresh") { + this->chat_reconnect_reason_ = utils::text::source_get_value2(&resp.data, "\"reason\":", ",}"); + parent->debugLogA(" Reconnect reason: %s", this->chat_reconnect_reason_.c_str()); - if (type == "refresh") return this->reconnect(); + } } else if (!type.empty()) { // Something has been received, throw to new thread to process |