diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-05-18 09:47:19 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-05-18 09:47:19 +0000 |
commit | e63ffcd3b3c8598d28ee899bd2537b02c02d8d39 (patch) | |
tree | 12eeef452ab23f5b60022f91b04ba049c5787789 /protocols/FacebookRM/src/connection.cpp | |
parent | 40b63e431bc8c68c91a32ca7a62337b97da30b91 (diff) |
Facebook: Refactor various working threads and updating contacts procedure; Version bump
This should eliminate creation of duplicite contacts, maybe made little slower or faster logging in...
git-svn-id: http://svn.miranda-ng.org/main/trunk@9217 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/connection.cpp')
-rw-r--r-- | protocols/FacebookRM/src/connection.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/protocols/FacebookRM/src/connection.cpp b/protocols/FacebookRM/src/connection.cpp index 4ff500a31b..48c290dfba 100644 --- a/protocols/FacebookRM/src/connection.cpp +++ b/protocols/FacebookRM/src/connection.cpp @@ -77,13 +77,12 @@ void FacebookProto::ChangeStatus(void*) ResetEvent(update_loop_lock_);
- if (NegotiateConnection() && facy.home())
+ if (NegotiateConnection() && facy.home() && facy.reconnect())
{
- facy.reconnect();
- facy.load_friends();
- facy.load_pages();
+ // Load all friends
+ ProcessFriendList(NULL);
- // Process Friends requests
+ // Process friendship requests
ForkThread(&FacebookProto::ProcessFriendRequests, NULL);
// Get unread messages
@@ -92,6 +91,9 @@ void FacebookProto::ChangeStatus(void*) // Get notifications
ForkThread(&FacebookProto::ProcessNotifications, NULL);
+ // Load pages for post status dialog
+ ForkThread(&FacebookProto::ProcessPages, NULL);
+
setDword("LogonTS", (DWORD)time(NULL));
ForkThread(&FacebookProto::UpdateLoop, NULL);
ForkThread(&FacebookProto::MessageLoop, NULL);
@@ -122,7 +124,8 @@ void FacebookProto::ChangeStatus(void*) }
facy.chat_state(m_iDesiredStatus != ID_STATUS_INVISIBLE);
- facy.buddy_list();
+
+ ForkThread(&FacebookProto::ProcessBuddyList, NULL);
m_iStatus = facy.self_.status_id = m_iDesiredStatus;
ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus);
@@ -175,16 +178,14 @@ void FacebookProto::UpdateLoop(void *) for (int i = -1; !isOffline(); i = ++i % 50)
{
- if (i != -1) {
- if (!facy.buddy_list())
- break;
- }
+ if (i != -1)
+ ProcessBuddyList(NULL);
+
if (i == 2 && getByte(FACEBOOK_KEY_EVENT_FEEDS_ENABLE, DEFAULT_EVENT_FEEDS_ENABLE))
- if (!facy.feeds())
- break;
+ ProcessFeeds(NULL);
if (i == 49)
- ForkThread(&FacebookProto::ProcessFriendRequests, NULL);
+ ProcessFriendRequests(NULL);
debugLogA("***** FacebookProto::UpdateLoop[%d] going to sleep...", tim);
if (WaitForSingleObjectEx(update_loop_lock_, GetPollRate() * 1000, true) != WAIT_TIMEOUT)
|