diff options
-rw-r--r-- | protocols/ICQ-WIM/res/resources.rc | 14 | ||||
-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 |
5 files changed, 17 insertions, 9 deletions
diff --git a/protocols/ICQ-WIM/res/resources.rc b/protocols/ICQ-WIM/res/resources.rc index 169f4d25b0..2193ff7dcb 100644 --- a/protocols/ICQ-WIM/res/resources.rc +++ b/protocols/ICQ-WIM/res/resources.rc @@ -81,14 +81,16 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN LTEXT "UIN:",IDC_STATIC,5,7,63,8 EDITTEXT IDC_UIN,74,7,139,10,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - LTEXT "Online since:",IDC_STATIC,5,32,63,8 - EDITTEXT IDC_ONLINESINCE,74,32,139,10,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - LTEXT "Idle since:",IDC_STATIC,5,45,63,8 - EDITTEXT IDC_IDLETIME,74,45,139,10,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + LTEXT "Online since:",IDC_STATIC,5,45,63,8 + EDITTEXT IDC_ONLINESINCE,74,45,139,10,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + LTEXT "Idle since:",IDC_STATIC,5,58,63,8 + EDITTEXT IDC_IDLETIME,74,58,139,10,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP LTEXT "Nick:",IDC_STATIC,5,19,63,8 EDITTEXT IDC_NICK,74,19,139,10,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - LTEXT "Member since:",IDC_STATIC,5,58,63,8 - EDITTEXT IDC_MEMBERSINCE,74,58,139,10,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + LTEXT "Member since:",IDC_STATIC,5,71,63,8 + EDITTEXT IDC_MEMBERSINCE,74,71,139,10,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + LTEXT "Last seen:",IDC_STATIC,5,32,63,8 + EDITTEXT IDC_LASTSEEN,74,32,139,10,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP END 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; } |