From 006901599005cad619b8832adc2f1bcb9f34f2ff Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 17 Nov 2012 20:58:10 +0000 Subject: added users info git-svn-id: http://svn.miranda-ng.org/main/trunk@2343 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_dialogs.cpp | 55 ++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 8 deletions(-) (limited to 'protocols/Skype/src/skype_dialogs.cpp') 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("")); - ::SetDlgItemText(hwndDlg, IDC_ONLINESINCE, ppro->GetSettingDword(hContact, "OnlineSinceTS") ? ppro->GetSettingString(hContact, "OnlineSinceTS") : TranslateT("")); - //::SetDlgItemText(hwndDlg, IDC_LASTEVENTDATE, ppro->GetSettingDword(hContact, "LastEventDateTS") ? ppro->GetSettingString(hContact, "LastEventDateTS") : TranslateT("")); - //::SetDlgItemText(hwndDlg, IDC_LASTPROFILECHANGE, ppro->GetSettingDword(hContact, "ProfileTS") ? ppro->GetSettingDword(hContact, "ProfileTS") : TranslateT("")); + + 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("")); + + 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("")); + + 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("")); } 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 -- cgit v1.2.3