diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-07-20 07:46:19 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-07-20 07:46:19 +0000 |
commit | 42c1d344fd105bcc25ae35e5a82d16a978b302c4 (patch) | |
tree | 818f9107867a2ccc49cb0596aac0707e11a7b014 /protocols/FacebookRM/src/process.cpp | |
parent | 471448968040658dbade77474b06248983a807bc (diff) |
Facebook: Don't do any requests when protocol is offline
git-svn-id: http://svn.miranda-ng.org/main/trunk@9875 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/process.cpp')
-rw-r--r-- | protocols/FacebookRM/src/process.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index 7dce1b8b14..7d783a66c7 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -284,6 +284,9 @@ void FacebookProto::ProcessFriendList(void*) void FacebookProto::ProcessUnreadMessages(void*) { + if (isOffline()) + return; + facy.handle_entry("ProcessUnreadMessages"); // receive messages from all folders by default, use hidden setting to receive only inbox messages @@ -330,6 +333,11 @@ void FacebookProto::ProcessUnreadMessage(void *p) if (p == NULL) return; + if (isOffline()) { + delete (std::vector<std::string>*)p; + return; + } + facy.handle_entry("ProcessUnreadMessage"); std::vector<std::string> threads = *(std::vector<std::string>*)p; @@ -434,6 +442,11 @@ void FacebookProto::LoadLastMessages(void *p) if (p == NULL) return; + if (isOffline()) { + delete (MCONTACT*)p; + return; + } + facy.handle_entry("LoadLastMessages"); MCONTACT hContact = *(MCONTACT*)p; @@ -725,6 +738,11 @@ void FacebookProto::ProcessMessages(void* data) if (data == NULL) return; + if (isOffline()) { + delete (std::string*)data; + return; + } + std::string* resp = (std::string*)data; // receive messages from all folders by default, use hidden setting to receive only inbox messages @@ -813,6 +831,9 @@ void FacebookProto::ProcessNotifications(void*) void FacebookProto::ProcessFriendRequests(void*) { + if (isOffline()) + return; + facy.handle_entry("friendRequests"); // Get notifications @@ -1076,9 +1097,9 @@ void FacebookProto::ProcessFeeds(void* data) facy.handle_success("feeds"); } -void FacebookProto::ProcessPages(void *data) +void FacebookProto::ProcessPages(void*) { - if (!getByte(FACEBOOK_KEY_LOAD_PAGES, DEFAULT_LOAD_PAGES)) + if (isOffline() || !getByte(FACEBOOK_KEY_LOAD_PAGES, DEFAULT_LOAD_PAGES)) return; facy.handle_entry("load_pages"); |