From 60b391e2a55749c0cf9e96f53515673a0898a0d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sun, 15 Feb 2015 10:24:20 +0000 Subject: Facebook: Fix for infinite channel "starting"; Version bump This fixes it by better using of random number generator. Now we use rand_s() instead of rand() because of thread safety and also we have random "seed" per each facebook_client with much better initial random seed. Previously when user logged off and then logged in again, it used same randomgly generated clientid which resulted in confusion on Facebook server and "infinite" repeated requests for channel every second from Miranda... This bug was here probably for many months and affected all stable and development versions. git-svn-id: http://svn.miranda-ng.org/main/trunk@12119 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/connection.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'protocols/FacebookRM/src/connection.cpp') diff --git a/protocols/FacebookRM/src/connection.cpp b/protocols/FacebookRM/src/connection.cpp index 42f1526e38..8eaec5044a 100644 --- a/protocols/FacebookRM/src/connection.cpp +++ b/protocols/FacebookRM/src/connection.cpp @@ -54,6 +54,10 @@ void FacebookProto::ChangeStatus(void*) ToggleStatusMenuItems(false); delSetting(FACEBOOK_KEY_LOGON_TS); + facy.chat_traceid_.clear(); + facy.chat_sticky_num_.clear(); + facy.chat_sticky_pool_.clear(); + facy.clear_cookies(); facy.clear_notifications(); facy.clear_chatrooms(); @@ -186,7 +190,7 @@ bool FacebookProto::NegotiateConnection() facy.https_ = getByte(FACEBOOK_KEY_FORCE_HTTPS, DEFAULT_FORCE_HTTPS) != 0; // Generate random clientid for this connection - facy.chat_clientid_ = utils::text::rand_string(8, "0123456789abcdef"); + facy.chat_clientid_ = utils::text::rand_string(8, "0123456789abcdef", &facy.random_); // Create default group for new contacts if (m_tszDefaultGroup) -- cgit v1.2.3