From f2f7c95e542cf5345ca020f100a1e4a3138c0ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Tue, 29 Jul 2014 11:41:43 +0000 Subject: 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 --- protocols/FacebookRM/src/communication.cpp | 18 ++++++++++++++---- 1 file 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 -- cgit v1.2.3