diff options
author | George Hazan <ghazan@miranda.im> | 2019-01-29 15:54:15 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-01-29 15:54:15 +0300 |
commit | f72431f2d07395eb2a35929ad85d28dc3a1eacee (patch) | |
tree | f22cfdceb39a4db477b868edaf2e585625869ba7 /protocols/ICQ-WIM/src | |
parent | 0ae0ccdec97de5e60f1e37299c8858b8f4887c29 (diff) |
ICQ-WIM:
- fix for interference with SeenPlugin plugin (reported by OlegVVV);
- LastSeen time added to User Details;
Diffstat (limited to 'protocols/ICQ-WIM/src')
-rw-r--r-- | protocols/ICQ-WIM/src/resource.h | 1 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/server.cpp | 7 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/stdafx.h | 1 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/userinfo.cpp | 3 |
4 files changed, 9 insertions, 3 deletions
diff --git a/protocols/ICQ-WIM/src/resource.h b/protocols/ICQ-WIM/src/resource.h index bbbfab49e9..e8bede4085 100644 --- a/protocols/ICQ-WIM/src/resource.h +++ b/protocols/ICQ-WIM/src/resource.h @@ -20,6 +20,7 @@ #define IDC_NICK 1012 #define IDC_IDLETIME2 1013 #define IDC_MEMBERSINCE 1013 +#define IDC_LASTSEEN 1014 // Next default values for new objects // diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index 6ba6a3ca13..2a64a0f731 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -177,9 +177,12 @@ MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact) Json2string(hContact, buddy, "workNumber", "CompanyPhone"); Json2string(hContact, buddy, "emailId", "e-mail"); + // zero here means that a contact is currently online + int lastSeen = buddy["lastseen"].as_int(); + setDword(hContact, DB_KEY_LASTSEEN, lastSeen ? lastSeen : time(0)); + Json2int(hContact, buddy, "official", "Official"); - Json2int(hContact, buddy, "lastseen", "LastSeen"); - Json2int(hContact, buddy, "onlineTime", "OnlineTS"); + Json2int(hContact, buddy, "onlineTime", DB_KEY_ONLINETS); Json2int(hContact, buddy, "idleTime", "IdleTS"); Json2int(hContact, buddy, "memberSince", DB_KEY_MEMBERSINCE); diff --git a/protocols/ICQ-WIM/src/stdafx.h b/protocols/ICQ-WIM/src/stdafx.h index d0c78a1a45..c651820f1e 100644 --- a/protocols/ICQ-WIM/src/stdafx.h +++ b/protocols/ICQ-WIM/src/stdafx.h @@ -87,6 +87,7 @@ #define DB_KEY_ICQNICK "IcqNick" #define DB_KEY_PHONEREG "PhoneReg" #define DB_KEY_LASTSEEN "LastSeen" +#define DB_KEY_ONLINETS "OnlineTS" #define DB_KEY_RCLIENTID "RClientID" #define DB_KEY_LASTMSGID "LastMsgId" #define DB_KEY_REMOTEREAD "RemoteReadId" diff --git a/protocols/ICQ-WIM/src/userinfo.cpp b/protocols/ICQ-WIM/src/userinfo.cpp index 96595bca46..6cc56fefb2 100644 --- a/protocols/ICQ-WIM/src/userinfo.cpp +++ b/protocols/ICQ-WIM/src/userinfo.cpp @@ -37,8 +37,9 @@ static INT_PTR CALLBACK IcqDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam SetDlgItemTextW(hwndDlg, IDC_NICK, ppro->getMStringW(hContact, DB_KEY_ICQNICK)); SetDlgItemTextA(hwndDlg, IDC_IDLETIME, time2text(ppro->getDword(hContact, DB_KEY_IDLE))); + SetDlgItemTextA(hwndDlg, IDC_LASTSEEN, time2text(ppro->getDword(hContact, DB_KEY_LASTSEEN))); SetDlgItemTextA(hwndDlg, IDC_MEMBERSINCE, time2text(ppro->getDword(hContact, DB_KEY_MEMBERSINCE))); - SetDlgItemTextA(hwndDlg, IDC_ONLINESINCE, time2text(ppro->getDword(hContact, DB_KEY_LASTSEEN))); + SetDlgItemTextA(hwndDlg, IDC_ONLINESINCE, time2text(time(0) - ppro->getDword(hContact, DB_KEY_ONLINETS))); } break; } |