diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/stdauth/auth.cpp | 2 | ||||
-rw-r--r-- | src/core/stdaway/awaymsg.cpp | 4 | ||||
-rw-r--r-- | src/core/stdchat/src/clist.cpp | 12 | ||||
-rw-r--r-- | src/core/stdemail/email.cpp | 4 | ||||
-rw-r--r-- | src/core/stdfile/file.cpp | 6 | ||||
-rw-r--r-- | src/core/stdfile/filerecvdlg.cpp | 15 | ||||
-rw-r--r-- | src/core/stdfile/filesenddlg.cpp | 6 | ||||
-rw-r--r-- | src/core/stdfile/filexferdlg.cpp | 6 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 6 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgs.cpp | 10 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgtimedout.cpp | 9 | ||||
-rw-r--r-- | src/core/stdurl/url.cpp | 4 | ||||
-rw-r--r-- | src/core/stdurl/urldialogs.cpp | 8 | ||||
-rw-r--r-- | src/core/stduserinfo/contactinfo.cpp | 2 | ||||
-rw-r--r-- | src/core/stduserinfo/stdinfo.cpp | 14 | ||||
-rw-r--r-- | src/core/stduserinfo/userinfo.cpp | 2 |
16 files changed, 50 insertions, 60 deletions
diff --git a/src/core/stdauth/auth.cpp b/src/core/stdauth/auth.cpp index e124c10bbf..07cb8f4b94 100644 --- a/src/core/stdauth/auth.cpp +++ b/src/core/stdauth/auth.cpp @@ -69,7 +69,7 @@ static int AuthEventAdded(WPARAM, LPARAM lParam) CONTACTINFO ci = {0};
ci.cbSize = sizeof(ci);
ci.hContact = hContact;
- ci.szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ ci.szProto = GetContactProto(hContact);
ci.dwFlag = CNF_UNIQUEID | CNF_TCHAR;
if ( !CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) {
switch (ci.type) {
diff --git a/src/core/stdaway/awaymsg.cpp b/src/core/stdaway/awaymsg.cpp index 8b18198830..4419e34b53 100644 --- a/src/core/stdaway/awaymsg.cpp +++ b/src/core/stdaway/awaymsg.cpp @@ -53,7 +53,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP {
TCHAR str[256], format[128];
TCHAR *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ char *szProto = GetContactProto(dat->hContact);
WORD dwStatus = DBGetContactSettingWord(dat->hContact, szProto, "Status", ID_STATUS_OFFLINE);
TCHAR *status = pcli->pfnGetStatusModeDescription(dwStatus, 0);
@@ -136,7 +136,7 @@ static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM) TCHAR str[128];
char *szProto;
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ szProto = GetContactProto((HANDLE)wParam);
ZeroMemory(&clmi, sizeof(clmi));
clmi.cbSize = sizeof(clmi);
clmi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE | CMIF_HIDDEN | CMIF_TCHAR;
diff --git a/src/core/stdchat/src/clist.cpp b/src/core/stdchat/src/clist.cpp index e3f3e2ed61..83467c0c71 100644 --- a/src/core/stdchat/src/clist.cpp +++ b/src/core/stdchat/src/clist.cpp @@ -89,7 +89,7 @@ END_GROUPLOOP: BOOL CList_SetOffline(HANDLE hContact, BOOL bHide)
{
if ( hContact ) {
- char* szProto = ( char* )CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char* szProto = GetContactProto(hContact);
int i = DBGetContactSettingByte(hContact, szProto, "ChatRoom", 0);
DBWriteContactSettingWord(hContact, szProto,"ApparentMode",(LPARAM) 0);
DBWriteContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
@@ -106,7 +106,7 @@ BOOL CList_SetAllOffline(BOOL bHide, const char *pszModule) hContact = db_find_first();
while ( hContact ) {
- szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ szProto = GetContactProto(hContact);
if ( MM_FindModule( szProto )) {
if ( !pszModule || ( pszModule && !strcmp( pszModule, szProto ))) {
int i = DBGetContactSettingByte(hContact, szProto, "ChatRoom", 0);
@@ -129,7 +129,7 @@ int CList_RoomDoubleclicked( WPARAM wParam, LPARAM lParam ) if ( !hContact )
return 0;
- szProto = ( char* )CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ szProto = GetContactProto(hContact);
if ( MM_FindModule(szProto)) {
if ( DBGetContactSettingByte( hContact, szProto, "ChatRoom", 0 ) == 0 )
return 0;
@@ -169,7 +169,7 @@ INT_PTR CList_JoinChat(WPARAM wParam, LPARAM lParam) {
HANDLE hContact = (HANDLE)wParam;
if ( hContact ) {
- char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char* szProto = GetContactProto(hContact);
if ( szProto ) {
if ( DBGetContactSettingWord( hContact, szProto, "Status", 0 ) == ID_STATUS_OFFLINE )
CallProtoService( szProto, PS_JOINCHAT, wParam, lParam );
@@ -184,7 +184,7 @@ INT_PTR CList_LeaveChat(WPARAM wParam, LPARAM lParam) {
HANDLE hContact = (HANDLE)wParam;
if ( hContact ) {
- char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char* szProto = GetContactProto(hContact);
if ( szProto )
CallProtoService( szProto, PS_LEAVECHAT, wParam, lParam );
}
@@ -195,7 +195,7 @@ int CList_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/stdemail/email.cpp b/src/core/stdemail/email.cpp index 23694dbddb..b18743d809 100644 --- a/src/core/stdemail/email.cpp +++ b/src/core/stdemail/email.cpp @@ -34,7 +34,7 @@ void SendEmailThread(void *szUrl) static INT_PTR SendEMailCommand(WPARAM wParam, LPARAM lParam)
{
DBVARIANT dbv;
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = GetContactProto((HANDLE)wParam);
if (szProto == NULL || DBGetContactSettingString((HANDLE)wParam, szProto, "e-mail", &dbv)) {
if (DBGetContactSettingString((HANDLE)wParam, "UserInfo", "Mye-mail0", &dbv)) {
MessageBox((HWND)lParam, TranslateT("User has not registered an e-mail address"), TranslateT("Send e-mail"), MB_OK);
@@ -56,7 +56,7 @@ static int EMailPreBuildMenu(WPARAM wParam, LPARAM) mi.flags = CMIM_FLAGS;
DBVARIANT dbv = { 0 };
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = GetContactProto((HANDLE)wParam);
if (szProto == NULL || DBGetContactSettingString((HANDLE)wParam, szProto, "e-mail", & dbv))
if (DBGetContactSettingString((HANDLE)wParam, "UserInfo", "Mye-mail0", &dbv))
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
diff --git a/src/core/stdfile/file.cpp b/src/core/stdfile/file.cpp index 5fa7d5ae22..dfb77b086b 100644 --- a/src/core/stdfile/file.cpp +++ b/src/core/stdfile/file.cpp @@ -32,7 +32,7 @@ static HANDLE hSRFileMenuItem; TCHAR *GetContactID(HANDLE hContact)
{
TCHAR *theValue = {0};
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (DBGetContactSettingByte(hContact, szProto, "ChatRoom", 0) == 1) {
DBVARIANT dbv;
if ( !DBGetContactSettingTString(hContact, szProto, "ChatRoomID", &dbv)) {
@@ -312,7 +312,7 @@ static int SRFilePreBuildMenu(WPARAM wParam, LPARAM) mi.cbSize = sizeof(mi);
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = GetContactProto((HANDLE)wParam);
if (szProto != NULL) {
if ( CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_FILESEND) {
if ( CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_OFFLINEFILES)
@@ -396,7 +396,7 @@ static INT_PTR Proto_RecvFileT(WPARAM, LPARAM lParam) DBEVENTINFO dbei = { 0 };
dbei.cbSize = sizeof(dbei);
- dbei.szModule = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ccs->hContact, 0);
+ dbei.szModule = GetContactProto(ccs->hContact);
dbei.timestamp = pre->timestamp;
dbei.flags = (pre->flags & PREF_CREATEREAD) ? DBEF_READ : 0;
dbei.eventType = EVENTTYPE_FILE;
diff --git a/src/core/stdfile/filerecvdlg.cpp b/src/core/stdfile/filerecvdlg.cpp index 6b4ce2e743..6492530004 100644 --- a/src/core/stdfile/filerecvdlg.cpp +++ b/src/core/stdfile/filerecvdlg.cpp @@ -154,7 +154,7 @@ void GetContactReceivedFilesDir(HANDLE hContact, TCHAR *szDir, int cchDir, BOOL rvaVarsToReplace[1].lptzKey = _T("userid");
rvaVarsToReplace[1].lptzValue = GetContactID(hContact);
rvaVarsToReplace[2].lptzKey = _T("proto");
- rvaVarsToReplace[2].lptzValue = mir_a2t((char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0));
+ rvaVarsToReplace[2].lptzValue = mir_a2t(GetContactProto(hContact));
rvaVarsToReplace[3].lptzKey = NULL;
rvaVarsToReplace[3].lptzValue = NULL;
for (int i=0; i < (SIZEOF(rvaVarsToReplace)-1);i++)
@@ -274,7 +274,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l tmi.printTimeStamp(NULL, dbei.timestamp, _T("t d"), datetimestr, SIZEOF(datetimestr), 0);
SetDlgItemText(hwndDlg, IDC_DATE, datetimestr);
- char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ char* szProto = GetContactProto(dat->hContact);
if (szProto) {
int hasName = 0;
char buf[128];
@@ -322,15 +322,12 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);
case WM_DRAWITEM:
- { LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
+ {
+ LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_PROTOCOL)) {
- char *szProto;
-
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ char *szProto = GetContactProto(dat->hContact);
if (szProto) {
- HICON hIcon;
-
- hIcon = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
+ HICON hIcon = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
if (hIcon) {
DrawIconEx(dis->hDC, dis->rcItem.left, dis->rcItem.top, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL);
DestroyIcon(hIcon);
diff --git a/src/core/stdfile/filesenddlg.cpp b/src/core/stdfile/filesenddlg.cpp index 642e2fd950..5c1419c683 100644 --- a/src/core/stdfile/filesenddlg.cpp +++ b/src/core/stdfile/filesenddlg.cpp @@ -231,7 +231,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l TCHAR *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
SetDlgItemText(hwndDlg, IDC_TO, contactName);
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ char *szProto = GetContactProto(dat->hContact);
if (szProto) {
CONTACTINFO ci;
int hasName = 0;
@@ -276,9 +276,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l {
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_PROTOCOL)) {
- char *szProto;
-
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ char *szProto = GetContactProto(dat->hContact);
if (szProto) {
HICON hIcon = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
if (hIcon) {
diff --git a/src/core/stdfile/filexferdlg.cpp b/src/core/stdfile/filexferdlg.cpp index 306c0cd457..474c49f7df 100644 --- a/src/core/stdfile/filexferdlg.cpp +++ b/src/core/stdfile/filexferdlg.cpp @@ -78,7 +78,7 @@ static void SetOpenFileButtonStyle(HWND hwndButton, int enabled) void FillSendData(FileDlgData* dat, DBEVENTINFO& dbei)
{
dbei.cbSize = sizeof(dbei);
- dbei.szModule = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ dbei.szModule = GetContactProto(dat->hContact);
dbei.eventType = EVENTTYPE_FILE;
dbei.flags = DBEF_SENT;
dbei.timestamp = time(NULL);
@@ -282,7 +282,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR dat->hIcon = NULL;
SendDlgItemMessage(hwndDlg, IDC_CONTACT, BM_SETIMAGE, IMAGE_ICON,
- (LPARAM)LoadSkinnedProtoIcon((char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0), ID_STATUS_ONLINE));
+ (LPARAM)LoadSkinnedProtoIcon(GetContactProto(dat->hContact), ID_STATUS_ONLINE));
SendDlgItemMessage(hwndDlg, IDC_CONTACT, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Contact menu"), 0);
SendDlgItemMessage(hwndDlg, IDC_CONTACT, BUTTONSETASFLATBTN, TRUE, 0);
@@ -469,7 +469,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case M_FILEEXISTSDLGREPLY:
{ PROTOFILERESUME *pfr = (PROTOFILERESUME*)lParam;
TCHAR *szOriginalFilename = (TCHAR*)wParam;
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ char *szProto = GetContactProto(dat->hContact);
EnableWindow(hwndDlg, TRUE);
switch(pfr->action) {
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;
diff --git a/src/core/stdurl/url.cpp b/src/core/stdurl/url.cpp index f1751d74c1..767828dc3c 100644 --- a/src/core/stdurl/url.cpp +++ b/src/core/stdurl/url.cpp @@ -105,7 +105,7 @@ static void RestoreUnreadUrlAlerts(void) static int ContactSettingChanged(WPARAM wParam, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = GetContactProto((HANDLE)wParam);
if (lstrcmpA(cws->szModule, "CList") && (szProto == NULL || lstrcmpA(cws->szModule, szProto)))
return 0;
@@ -119,7 +119,7 @@ static int SRUrlPreBuildMenu(WPARAM wParam, LPARAM) mi.cbSize = sizeof(mi);
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = GetContactProto((HANDLE)wParam);
if (szProto != NULL)
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_URLSEND)
mi.flags = CMIM_FLAGS;
diff --git a/src/core/stdurl/urldialogs.cpp b/src/core/stdurl/urldialogs.cpp index b0b8fa00b2..a13b969647 100644 --- a/src/core/stdurl/urldialogs.cpp +++ b/src/core/stdurl/urldialogs.cpp @@ -34,7 +34,7 @@ static void sttUpdateTitle(HWND hwndDlg, HANDLE hContact) char *szProto;
if (hContact) {
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ szProto = GetContactProto(hContact);
if (szProto) {
CONTACTINFO ci;
int hasName = 0;
@@ -141,7 +141,7 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_PROTOCOL)) {
char *szProto;
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ szProto = GetContactProto(dat->hContact);
if (szProto) {
HICON hIcon;
@@ -522,7 +522,7 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP {
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_PROTOCOL)) {
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ char *szProto = GetContactProto(dat->hContact);
if (szProto) {
HICON hIcon = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
if (hIcon) {
@@ -630,7 +630,7 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dbei.cbSize = sizeof(dbei);
dbei.eventType = EVENTTYPE_URL;
dbei.flags = DBEF_SENT;
- dbei.szModule = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ dbei.szModule = GetContactProto(dat->hContact);
dbei.timestamp = time(NULL);
dbei.cbBlob = (DWORD)(strlen(dat->sendBuffer)+strlen(dat->sendBuffer+strlen(dat->sendBuffer)+1)+2);
dbei.pBlob = (PBYTE)dat->sendBuffer;
diff --git a/src/core/stduserinfo/contactinfo.cpp b/src/core/stduserinfo/contactinfo.cpp index 71152950f1..82a40ad899 100644 --- a/src/core/stduserinfo/contactinfo.cpp +++ b/src/core/stduserinfo/contactinfo.cpp @@ -253,7 +253,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP {
HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (hContact != NULL) {
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto == NULL)
break;
diff --git a/src/core/stduserinfo/stdinfo.cpp b/src/core/stduserinfo/stdinfo.cpp index d717b7f68e..986e2d4057 100644 --- a/src/core/stduserinfo/stdinfo.cpp +++ b/src/core/stduserinfo/stdinfo.cpp @@ -67,7 +67,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, HANDLE hContact, char *szModule, {
char str[80], *pstr = NULL;
TCHAR* ptstr = NULL;
- char* szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char* szProto = GetContactProto(hContact);
bool proto_service = szProto && (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_INFOSETTINGSVC);
DBVARIANT dbv = { DBVT_DELETED };
@@ -195,7 +195,7 @@ static INT_PTR CALLBACK SummaryDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (((LPNMHDR)lParam)->code == PSN_INFOCHANGED) {
HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto == NULL)
break;
@@ -270,7 +270,7 @@ static INT_PTR CALLBACK LocationDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (((LPNMHDR)lParam)->code == PSN_INFOCHANGED) {
HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto == NULL)
break;
@@ -320,7 +320,7 @@ static INT_PTR CALLBACK WorkDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (((LPNMHDR)lParam)->code == PSN_INFOCHANGED) {
HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto == NULL) break;
SetValue(hwndDlg, IDC_COMPANY, hContact, szProto, "Company", SVS_ZEROISUNSPEC);
SetValue(hwndDlg, IDC_DEPARTMENT, hContact, szProto, "CompanyDepartment", SVS_ZEROISUNSPEC);
@@ -397,7 +397,7 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto == NULL) break;
bool proto_service = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_INFOSETTINGSVC) == PF4_INFOSETTINGSVC;
SetValue(hwndDlg, IDC_WEBPAGE, hContact, szProto, "Homepage", SVS_ZEROISUNSPEC);
@@ -536,7 +536,7 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR { char *szProto;
HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ szProto = GetContactProto(hContact);
if (szProto == NULL) break;
SetValue(hwndDlg, IDC_ABOUT, hContact, szProto, "About", 0);
}
@@ -577,7 +577,7 @@ int DetailsInit(WPARAM wParam, LPARAM lParam) if (lParam == NULL)
return 0;
- if (CallService(MS_PROTO_GETCONTACTBASEPROTO, lParam, 0) == 0)
+ if (GetContactProto((HANDLE)lParam) == 0)
return 0;
OPTIONSDIALOGPAGE odp;
diff --git a/src/core/stduserinfo/userinfo.cpp b/src/core/stduserinfo/userinfo.cpp index 37b7168137..c8b435e4ed 100644 --- a/src/core/stduserinfo/userinfo.cpp +++ b/src/core/stduserinfo/userinfo.cpp @@ -412,7 +412,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP case M_CHECKONLINE:
if (dat->hContact != NULL) {
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ char *szProto = GetContactProto(dat->hContact);
if (szProto == NULL)
EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE), FALSE);
else {
|