summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2015-05-31 07:03:02 +0000
committerRobert Pösel <robyer@seznam.cz>2015-05-31 07:03:02 +0000
commit24760c05a20878a201fb531503ba153d603c2f6a (patch)
tree8a6164d38a56b0b620be970ac71b3f727aecc03f
parent63bea9fe2a7f02f9246db900c08501fd6f567918 (diff)
Facebook: Raise sync threads limit to 2 days and classically load unread messages all the time (sync threads is not reliable)
I'm not sure whether this will cause duplicit messages or not. But this (or any) sync should be improved anyway. git-svn-id: http://svn.miranda-ng.org/main/trunk@13925 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/FacebookRM/src/process.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp
index cbd2bff762..cd76503b21 100644
--- a/protocols/FacebookRM/src/process.cpp
+++ b/protocols/FacebookRM/src/process.cpp
@@ -561,17 +561,17 @@ void FacebookProto::SyncThreads(void*)
if (isOffline())
return;
+ // Always load unread messages because syncthreads request is not reliable (probably doesn't load multi user chat messages at all)
+ ProcessUnreadMessages(NULL);
+
// Get timestamp of last action (message or other event)
time_t timestamp = getDword(FACEBOOK_KEY_LAST_ACTION_TS, 0);
- // If last event is older than 1 day, we force sync to be 1 day old
- time_t yesterday = ::time(NULL) - 24 * 60 * 60;
- if (timestamp < yesterday) {
- debugLogA(" Last action timestamp is too old: %d, use 24 hours old instead: %d", timestamp, yesterday);
- timestamp = yesterday;
-
- // And load older unread messages that we might not get otherwise
- ProcessUnreadMessages(NULL);
+ // If last event is older than 2 day, we force sync to be max. 2 day old
+ time_t daysBefore = ::time(NULL) - 24 * 60 * 60 * 2;
+ if (timestamp < daysBefore) {
+ debugLogA(" Last action timestamp is too old: %d, use 24 hours old instead: %d", timestamp, daysBefore);
+ timestamp = daysBefore;
}
// Receive messages from all folders by default, use hidden setting to receive only inbox messages