From bd8a04455d9c991c15df2287e091abe4ba054efb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 25 Nov 2012 12:54:45 +0000 Subject: typed stub for MS_PROTO_GETCONTACTBASEPROTO git-svn-id: http://svn.miranda-ng.org/main/trunk@2480 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/stdmsg/src/msgdialog.cpp | 6 +++--- src/core/stdmsg/src/msgs.cpp | 10 +++++----- src/core/stdmsg/src/msgtimedout.cpp | 9 ++------- 3 files changed, 10 insertions(+), 15 deletions(-) (limited to 'src/core/stdmsg') diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index dcd20353bf..22bd5b46e8 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -60,7 +60,7 @@ static void NotifyLocalWinEvent(HANDLE hContact, HWND hwnd, unsigned int type) static char *MsgServiceName(HANDLE hContact) { char szServiceName[100]; - char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0); + char *szProto = GetContactProto(hContact); if (szProto == NULL) return PSS_MESSAGE; @@ -72,7 +72,7 @@ static char *MsgServiceName(HANDLE hContact) static BOOL IsUtfSendAvailable(HANDLE hContact) { - char* szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0); + char* szProto = GetContactProto(hContact); if ( szProto == NULL ) return FALSE; @@ -719,7 +719,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP PostMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_SETSEL, len, len); } - dat->szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) dat->hContact, 0); + dat->szProto = GetContactProto(dat->hContact); RichUtil_SubClass(GetDlgItem(hwndDlg, IDC_LOG)); RichUtil_SubClass(GetDlgItem(hwndDlg, IDC_MESSAGE)); diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 940487b011..6167c53214 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -83,7 +83,7 @@ static int MessageEventAdded(WPARAM wParam, LPARAM lParam) /* new message */ SkinPlaySound("AlertMsg"); { - char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) wParam, 0); + char *szProto = GetContactProto((HANDLE)wParam); if (szProto && (g_dat->openFlags & SRMMStatusToPf2(CallProtoService(szProto, PS_GETSTATUS, 0, 0)))) { struct NewMessageWindowLParam newData = { 0 }; @@ -116,7 +116,7 @@ INT_PTR SendMessageCmd(HANDLE hContact, char* msg, int isWchar) HWND hwnd; /* does the HCONTACT's protocol support IM messages? */ - szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); + szProto = GetContactProto(hContact); if (!szProto || (!CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND)) return 1; @@ -225,7 +225,7 @@ static int MessageSettingChanged(WPARAM wParam, LPARAM lParam) WindowList_Broadcast(g_dat->hMessageWindowList, DM_NEWTIMEZONE, (WPARAM) cws, 0); else { - char * szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0); + char * szProto = GetContactProto((HANDLE)wParam); if (szProto && !strcmp(cws->szModule, szProto)) WindowList_Broadcast(g_dat->hMessageWindowList, DM_UPDATETITLE, (WPARAM) cws, 0); } @@ -273,7 +273,7 @@ static void RestoreUnreadMessageAlerts(void) if (windowAlreadyExists) continue; { - char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0); + char *szProto = GetContactProto(hContact); if (szProto && (g_dat->openFlags & SRMMStatusToPf2(CallProtoService(szProto, PS_GETSTATUS, 0, 0)))) { autoPopup = 1; @@ -374,7 +374,7 @@ static int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) { HANDLE hContact = (HANDLE)wParam; if ( hContact ) { - char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0); + char* szProto = GetContactProto(hContact); CLISTMENUITEM clmi = {0}; clmi.cbSize = sizeof(CLISTMENUITEM); diff --git a/src/core/stdmsg/src/msgtimedout.cpp b/src/core/stdmsg/src/msgtimedout.cpp index 1b1773aa8e..b956faaf2a 100644 --- a/src/core/stdmsg/src/msgtimedout.cpp +++ b/src/core/stdmsg/src/msgtimedout.cpp @@ -70,14 +70,9 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar break; case WM_COMMAND: - switch (LOWORD(wParam)) - { + switch (LOWORD(wParam)) { case IDOK: - { - char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) item->hContact, 0); - SendMessageDirect(item->szMsg, item->hContact, szProto); - } - + SendMessageDirect(item->szMsg, item->hContact, GetContactProto(item->hContact)); DestroyWindow(hwndDlg); break; -- cgit v1.2.3