summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/Skype/docs/todo_list.txt3
-rw-r--r--protocols/Skype/src/skype_contacts.cpp20
-rw-r--r--protocols/Skype/src/skype_dialogs.cpp55
3 files changed, 58 insertions, 20 deletions
diff --git a/protocols/Skype/docs/todo_list.txt b/protocols/Skype/docs/todo_list.txt
index a440867c1f..c20f78a386 100644
--- a/protocols/Skype/docs/todo_list.txt
+++ b/protocols/Skype/docs/todo_list.txt
@@ -1,10 +1,9 @@
Bugs:
-- don't send auth request
- don't correct loading and setting users avatars
Features:
- add avatar loading to skype server
-- add correct users and own info
+- add correct own info
- multiuser chat
- voice
- video
diff --git a/protocols/Skype/src/skype_contacts.cpp b/protocols/Skype/src/skype_contacts.cpp
index 5d497ece2e..736bffd7c6 100644
--- a/protocols/Skype/src/skype_contacts.cpp
+++ b/protocols/Skype/src/skype_contacts.cpp
@@ -312,20 +312,20 @@ void CSkypeProto::UpdateContactTimezone(HANDLE hContact, CContact::Ref contact)
void CSkypeProto::UpdateContactOnlineSinceTime(HANDLE hContact, CContact::Ref contact)
{
- uint data;
- contact->GetPropLastonlineTimestamp(data);
- if (data > 0)
- {
- }
+ uint newTS = 0;
+ contact->GetPropLastonlineTimestamp(newTS);
+ DWORD oldTS = this->GetSettingDword(hContact, "OnlineSinceTS");
+ if (newTS > oldTS)
+ this->SetSettingDword(hContact, "OnlineSinceTS", newTS);
}
void CSkypeProto::UpdateContactLastEventDate(HANDLE hContact, CContact::Ref contact)
{
- uint data;
- contact->GetPropLastusedTimestamp(data);
- if (data > 0)
- {
- }
+ uint newTS = 0;
+ contact->GetPropLastusedTimestamp(newTS);
+ DWORD oldTS = this->GetSettingDword(hContact, "LastEventDateTS");
+ if (newTS > oldTS)
+ this->SetSettingDword(hContact, "LastEventDateTS", newTS);
}
void CSkypeProto::UpdateFullName(HANDLE hContact, CContact::Ref contact)
diff --git a/protocols/Skype/src/skype_dialogs.cpp b/protocols/Skype/src/skype_dialogs.cpp
index 0d973cce77..908786fd01 100644
--- a/protocols/Skype/src/skype_dialogs.cpp
+++ b/protocols/Skype/src/skype_dialogs.cpp
@@ -267,9 +267,39 @@ INT_PTR CALLBACK CSkypeProto::SkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
::SetDlgItemText(hwndDlg, IDC_SID, ppro->GetSettingString(hContact, "sid"));
::SetDlgItemText(hwndDlg, IDC_STATUSTEXT, ppro->GetSettingString(hContact, "XStatusMsg") ? ppro->GetSettingString(hContact, "XStatusMsg") : TranslateT("<not specified>"));
- ::SetDlgItemText(hwndDlg, IDC_ONLINESINCE, ppro->GetSettingDword(hContact, "OnlineSinceTS") ? ppro->GetSettingString(hContact, "OnlineSinceTS") : TranslateT("<not specified>"));
- //::SetDlgItemText(hwndDlg, IDC_LASTEVENTDATE, ppro->GetSettingDword(hContact, "LastEventDateTS") ? ppro->GetSettingString(hContact, "LastEventDateTS") : TranslateT("<not specified>"));
- //::SetDlgItemText(hwndDlg, IDC_LASTPROFILECHANGE, ppro->GetSettingDword(hContact, "ProfileTS") ? ppro->GetSettingDword(hContact, "ProfileTS") : TranslateT("<not specified>"));
+
+ if (ppro->GetSettingDword(hContact, "OnlineSinceTS")) {
+ TCHAR date[64];
+ DBTIMETOSTRINGT tts = {0};
+ tts.szFormat = _T("d s");
+ tts.szDest = date;
+ tts.cbDest = sizeof(date);
+ CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, (WPARAM)ppro->GetSettingDword(hContact, "OnlineSinceTS"), (LPARAM)&tts);
+ ::SetDlgItemText(hwndDlg, IDC_ONLINESINCE, date);
+ } else
+ ::SetDlgItemText(hwndDlg, IDC_ONLINESINCE, TranslateT("<not specified>"));
+
+ if (ppro->GetSettingDword(hContact, "LastEventDateTS")) {
+ TCHAR date[64];
+ DBTIMETOSTRINGT tts = {0};
+ tts.szFormat = _T("d s");
+ tts.szDest = date;
+ tts.cbDest = sizeof(date);
+ CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, (WPARAM)ppro->GetSettingDword(hContact, "LastEventDateTS"), (LPARAM)&tts);
+ ::SetDlgItemText(hwndDlg, IDC_LASTEVENTDATE, date);
+ } else
+ ::SetDlgItemText(hwndDlg, IDC_ONLINESINCE, TranslateT("<not specified>"));
+
+ if (ppro->GetSettingDword(hContact, "ProfileTS")) {
+ TCHAR date[64];
+ DBTIMETOSTRINGT tts = {0};
+ tts.szFormat = _T("d s");
+ tts.szDest = date;
+ tts.cbDest = sizeof(date);
+ CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, (WPARAM)ppro->GetSettingDword(hContact, "ProfileTS"), (LPARAM)&tts);
+ ::SetDlgItemText(hwndDlg, IDC_LASTPROFILECHANGE, date);
+ } else
+ ::SetDlgItemText(hwndDlg, IDC_ONLINESINCE, TranslateT("<not specified>"));
}
break;
}
@@ -299,11 +329,20 @@ int __cdecl CSkypeProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam)
odp.flags = ODPF_TCHAR | ODPF_DONTTRANSLATE;
odp.hInstance = g_hInstance;
odp.dwInitParam = LPARAM(this);
- odp.pfnDlgProc = SkypeDlgProc;
- odp.position = -1900000000;
- odp.ptszTitle = m_tszUserName;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_SKYPE);
- UserInfo_AddPage(wParam, &odp);
+
+ HANDLE hContact = (HANDLE)lParam;
+ if (hContact) {
+ char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ if (szProto != NULL && !strcmp(szProto, m_szModuleName)) {
+ odp.pfnDlgProc = SkypeDlgProc;
+ odp.position = -1900000000;
+ odp.ptszTitle = m_tszUserName;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_SKYPE);
+ UserInfo_AddPage(wParam, &odp);
+ }
+ } else {
+ //show own info
+ }
return 0;
} \ No newline at end of file