diff options
author | George Hazan <george.hazan@gmail.com> | 2014-02-22 15:43:09 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-02-22 15:43:09 +0000 |
commit | 81c1360e1fd7149a47f0d8c51e27aef811cf2351 (patch) | |
tree | 86da359b1898679f12c15e5a9801774adf35b19c /plugins/NewAwaySysMod/src/ReadAwayMsg.cpp | |
parent | 23060dd7bd4c9cb2572582d2ba3ad7a68790b5af (diff) |
- switch to more effective functions of pcli;
- switch to the new protocol helpers;
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@8217 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewAwaySysMod/src/ReadAwayMsg.cpp')
-rw-r--r-- | plugins/NewAwaySysMod/src/ReadAwayMsg.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp index 1ce86f628b..5b7b9efb70 100644 --- a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp @@ -21,6 +21,13 @@ #include "Common.h"
+struct READAWAYMSGDATA
+{
+ MCONTACT hContact; // contact
+ HANDLE hSeq; // sequence for stat msg request
+ HANDLE hAwayMsgEvent; // hooked
+};
+
#define RAMDLGSIZESETTING "ReadAwayMsgDlg"
HANDLE g_hReadWndList = NULL;
@@ -50,6 +57,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hTitleIcon);
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)hTitleIcon);
Utils_RestoreWindowPosition(hwndDlg, NULL, MOD_NAME, RAMDLGSIZESETTING);
+
READAWAYMSGDATA *awayData = new READAWAYMSGDATA;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)awayData);
awayData->hContact = lParam;
@@ -58,10 +66,9 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam WindowList_Add(g_hReadWndList, hwndDlg, awayData->hContact);
TCHAR str[256], format[128];
- TCHAR *status, *contactName;
- contactName = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)awayData->hContact, GCDNF_TCHAR);
+ TCHAR *contactName = pcli->pfnGetContactDisplayName(awayData->hContact, 0);
char *szProto = GetContactProto(awayData->hContact);
- status = (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, db_get_w(awayData->hContact, szProto, "Status", ID_STATUS_OFFLINE), GSMDF_TCHAR);
+ TCHAR *status = pcli->pfnGetStatusModeDescription(db_get_w(awayData->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
GetWindowText(hwndDlg, format, SIZEOF(format));
_sntprintf(str, SIZEOF(str), format, status, contactName);
SetWindowText(hwndDlg, str);
|