From 1e11f5fc920b54759b2ec16854d8f9e65662cdec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sun, 6 Jul 2014 09:00:21 +0000 Subject: Facebook: Fix invisible status (now it's not true-invisible again) It's not fully tested, should be fixed better later. git-svn-id: http://svn.miranda-ng.org/main/trunk@9702 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/connection.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'protocols/FacebookRM/src/connection.cpp') diff --git a/protocols/FacebookRM/src/connection.cpp b/protocols/FacebookRM/src/connection.cpp index 02699bc1e0..7ecc553f20 100644 --- a/protocols/FacebookRM/src/connection.cpp +++ b/protocols/FacebookRM/src/connection.cpp @@ -125,11 +125,18 @@ void FacebookProto::ChangeStatus(void*) debugLogA("***** SignOn complete"); } - facy.chat_state(m_iDesiredStatus != ID_STATUS_INVISIBLE); + m_invisible = (new_status == ID_STATUS_INVISIBLE); - ForkThread(&FacebookProto::ProcessBuddyList, NULL); + facy.chat_state(!m_invisible); - m_iStatus = facy.self_.status_id = m_iDesiredStatus; + if (m_invisible) { + facy.buddies.clear(); + SetAllContactStatuses(ID_STATUS_OFFLINE); + } else { + ForkThread(&FacebookProto::ProcessBuddyList, NULL); + } + + m_iStatus = facy.self_.status_id = new_status; ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus); debugLogA("***** ChangeStatus complete"); @@ -181,7 +188,8 @@ void FacebookProto::UpdateLoop(void *) for (int i = -1; !isOffline(); i = ++i % 50) { if (i != -1) { - ProcessBuddyList(NULL); + if (!isInvisible()) + ProcessBuddyList(NULL); if (getByte(FACEBOOK_KEY_EVENT_FEEDS_ENABLE, DEFAULT_EVENT_FEEDS_ENABLE)) ProcessFeeds(NULL); -- cgit v1.2.3