summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM/src/proto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/ICQ-WIM/src/proto.cpp')
-rw-r--r--protocols/ICQ-WIM/src/proto.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp
index 9255001537..7ea15fc1bd 100644
--- a/protocols/ICQ-WIM/src/proto.cpp
+++ b/protocols/ICQ-WIM/src/proto.cpp
@@ -347,11 +347,23 @@ void CIcqProto::OnLastSeen(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *)
for (auto &it : results["entries"]) {
if (auto *pUser = FindUser(it["sn"].as_mstring())) {
int iLastSeen = it["lastseen"].as_int();
- if (iLastSeen != 0) {
+ switch (iLastSeen) {
+ case 1388520000: // 01/01/2014, 00:00 GMT
+ setWString(pUser->m_hContact, DB_KEY_LASTSEEN, TranslateT("long time ago"));
+ ProcessStatus(pUser, ID_STATUS_OFFLINE);
+ break;
+
+ case 0:
+ if (pUser->m_bWasOnline) {
+ ProcessStatus(pUser, ID_STATUS_ONLINE);
+ break;
+ }
+ __fallthrough;
+
+ default:
setDword(pUser->m_hContact, DB_KEY_LASTSEEN, iLastSeen);
ProcessStatus(pUser, ID_STATUS_OFFLINE);
}
- else ProcessStatus(pUser, ID_STATUS_ONLINE);
}
}
}