summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM/src/server.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-11-27 21:04:41 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-11-27 21:04:41 +0300
commit390d3ecc13780511a2416eb4eb82a14a06516945 (patch)
treed2b134d10b92e78b8375e106e5fcb957a72d3b22 /protocols/ICQ-WIM/src/server.cpp
parente0b3359cf55fbf3d83faad624265d928023f0928 (diff)
fixes #3810 (ICQ: неверно работает Last seen в user details)
Diffstat (limited to 'protocols/ICQ-WIM/src/server.cpp')
-rw-r--r--protocols/ICQ-WIM/src/server.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp
index cc63593a3a..deb86738ec 100644
--- a/protocols/ICQ-WIM/src/server.cpp
+++ b/protocols/ICQ-WIM/src/server.cpp
@@ -417,8 +417,13 @@ MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact, boo
// we shall not remove existing phone number anyhow
Json2string(hContact, buddy, "phoneNumber", DB_KEY_PHONE, true);
+ int onlineTime = buddy["onlineTime"].as_int();
+ if (onlineTime)
+ setDword(hContact, DB_KEY_ONLINETS, time(0) - onlineTime);
+ else
+ delSetting(hContact, DB_KEY_ONLINETS);
+
Json2int(hContact, buddy, "official", "Official", bIsPartial);
- Json2int(hContact, buddy, "onlineTime", DB_KEY_ONLINETS, bIsPartial);
Json2int(hContact, buddy, "idleTime", "IdleTS", bIsPartial);
Json2int(hContact, buddy, "memberSince", DB_KEY_MEMBERSINCE, bIsPartial);