diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/addcontact/addcontact.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/clc.cpp | 10 | ||||
-rw-r--r-- | src/modules/clist/clcfiledrop.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/clcitems.cpp | 6 | ||||
-rw-r--r-- | src/modules/clist/clistevents.cpp | 16 | ||||
-rw-r--r-- | src/modules/clist/clistmenus.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/clistmod.cpp | 8 | ||||
-rw-r--r-- | src/modules/clist/clistsettings.cpp | 4 | ||||
-rw-r--r-- | src/modules/clist/clui.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/contact.cpp | 6 | ||||
-rw-r--r-- | src/modules/extraicons/DefaultExtraIcons.cpp | 12 | ||||
-rw-r--r-- | src/modules/ignore/ignore.cpp | 2 | ||||
-rw-r--r-- | src/modules/protocols/protocols.cpp | 6 | ||||
-rw-r--r-- | src/modules/utils/path.cpp | 4 | ||||
-rw-r--r-- | src/modules/utils/timezones.cpp | 2 | ||||
-rw-r--r-- | src/modules/visibility/visibility.cpp | 2 |
16 files changed, 43 insertions, 43 deletions
diff --git a/src/modules/addcontact/addcontact.cpp b/src/modules/addcontact/addcontact.cpp index 60ef8cca0d..5516611297 100644 --- a/src/modules/addcontact/addcontact.cpp +++ b/src/modules/addcontact/addcontact.cpp @@ -86,7 +86,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp if (acs->handleType == HANDLE_CONTACT && acs->handle)
if (acs->szProto == NULL || (acs->szProto != NULL && *acs->szProto == 0))
- acs->szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)acs->handle, 0);
+ acs->szProto = GetContactProto(acs->handle);
{
int groupId;
diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp index 81e0fe8ce3..d05ee95686 100644 --- a/src/modules/clist/clc.cpp +++ b/src/modules/clist/clc.cpp @@ -93,7 +93,7 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam) cli.pfnClcBroadcast(INTM_NAMEORDERCHANGED, 0, 0);
}
else {
- char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = GetContactProto((HANDLE)wParam);
if (szProto != NULL) {
if ( !strcmp(cws->szModule, "Protocol") && !strcmp(cws->szSetting, "p"))
cli.pfnClcBroadcast(INTM_PROTOCHANGED, wParam, lParam);
@@ -511,7 +511,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, HANDLE hSelItem = NULL;
ClcContact *selcontact = NULL;
- char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = GetContactProto((HANDLE)wParam);
if (szProto == NULL)
status = ID_STATUS_OFFLINE;
else
@@ -580,7 +580,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
break;
- contact->proto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ contact->proto = GetContactProto((HANDLE)wParam);
cli.pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam);
lstrcpyn(contact->szText, cli.pfnGetContactDisplayName((HANDLE)wParam, 0), SIZEOF(contact->szText));
SortClcByTimer(hwnd);
@@ -606,7 +606,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, case INTM_APPARENTMODECHANGED:
if ( cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) {
- char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = GetContactProto((HANDLE)wParam);
if (szProto == NULL)
break;
@@ -628,7 +628,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, case INTM_IDLECHANGED:
if ( cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) {
- char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = GetContactProto((HANDLE)wParam);
if (szProto == NULL)
break;
contact->flags &= ~CONTACTF_IDLE;
diff --git a/src/modules/clist/clcfiledrop.cpp b/src/modules/clist/clcfiledrop.cpp index 1993936a01..c33bc23334 100644 --- a/src/modules/clist/clcfiledrop.cpp +++ b/src/modules/clist/clcfiledrop.cpp @@ -76,7 +76,7 @@ static HANDLE HContactFromPoint(HWND hwnd, struct ClcData *dat, int x, int y, in if (hit == -1 || !(hitFlags & (CLCHT_ONITEMLABEL | CLCHT_ONITEMICON)) || contact->type != CLCIT_CONTACT)
return NULL;
- char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) contact->hContact, 0);
+ char *szProto = GetContactProto(contact->hContact);
if (szProto == NULL)
return NULL;
diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp index e9d280b96f..4619ba6c4b 100644 --- a/src/modules/clist/clcitems.cpp +++ b/src/modules/clist/clcitems.cpp @@ -184,7 +184,7 @@ int fnAddContactToGroup(struct ClcData *dat, ClcGroup *group, HANDLE hContact) }
i = cli.pfnAddItemToGroup(group, index + 1);
- char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char *szProto = GetContactProto(hContact);
group->cl.items[i]->type = CLCIT_CONTACT;
group->cl.items[i]->iImage = CallService(MS_CLIST_GETCONTACTICON, (WPARAM) hContact, 0);
group->cl.items[i]->hContact = hContact;
@@ -218,7 +218,7 @@ void fnAddContactToTree(HWND hwnd, struct ClcData *dat, HANDLE hContact, int upd DBVARIANT dbv;
DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
WORD status = ID_STATUS_OFFLINE;
- char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char *szProto = GetContactProto(hContact);
dat->needsResort = 1;
if (style & CLS_NOHIDEOFFLINE)
@@ -392,7 +392,7 @@ void fnRebuildEntireList(HWND hwnd, struct ClcData *dat) if (_tcsstr(lowered_name, lowered_search))
cli.pfnAddContactToGroup(dat, group, hContact);
} else if ( !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) {
- szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ szProto = GetContactProto(hContact);
if (szProto == NULL) {
if ( !cli.pfnIsHiddenMode(dat, ID_STATUS_OFFLINE))
cli.pfnAddContactToGroup(dat, group, hContact);
diff --git a/src/modules/clist/clistevents.cpp b/src/modules/clist/clistevents.cpp index 71a520b2ff..253381b4a9 100644 --- a/src/modules/clist/clistevents.cpp +++ b/src/modules/clist/clistevents.cpp @@ -73,7 +73,7 @@ static char * GetEventProtocol(int idx) szProto = NULL;
}
else
- szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) cli.events.items[idx]->cle.hContact, 0);
+ szProto = GetContactProto(cli.events.items[idx]->cle.hContact);
return szProto;
}
return NULL;
@@ -185,8 +185,8 @@ struct CListEvent* fnAddEvent(CLISTEVENT *cle) else
szProto = NULL;
}
- else
- szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)cle->hContact, 0);
+ else szProto = GetContactProto(cle->hContact);
+
iconsOn = 1;
flashTimerId = SetTimer(NULL, 0, db_get_w(NULL, "CList", "IconFlashTime", 550), IconFlashTimer);
cli.pfnTrayIconUpdateWithImageList(p->imlIconIndex, p->cle.ptszTooltip, szProto);
@@ -214,7 +214,7 @@ int fnRemoveEvent(HANDLE hContact, HANDLE dbEvent) return 1;
// Update contact's icon
- szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ szProto = GetContactProto(hContact);
cli.pfnChangeContactIcon(cli.events.items[i]->cle.hContact,
CallService(MS_CLIST_GETCONTACTICON, (WPARAM)cli.events.items[i]->cle.hContact, 1),
0);
@@ -228,7 +228,7 @@ int fnRemoveEvent(HANDLE hContact, HANDLE dbEvent) for (i=0; i < cli.events.count; i++)
{
if (cli.events.items[i]->cle.hContact)
- szEventProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)(cli.events.items[i]->cle.hContact), 0);
+ szEventProto = GetContactProto((cli.events.items[i]->cle.hContact));
else if (cli.events.items[i]->cle.flags&CLEF_PROTOCOLGLOBAL)
szEventProto = (char *) cli.events.items[i]->cle.lpszProtocol;
else
@@ -248,7 +248,7 @@ int fnRemoveEvent(HANDLE hContact, HANDLE dbEvent) if (cli.events.items[0]->cle.hContact == NULL)
szProto = NULL;
else
- szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) cli.events.items[0]->cle.hContact, 0);
+ szProto = GetContactProto(cli.events.items[0]->cle.hContact);
cli.pfnTrayIconUpdateWithImageList(iconsOn ? cli.events.items[0]->imlIconIndex : 0, cli.events.items[0]->cle.ptszTooltip, szProto);
}
@@ -304,7 +304,7 @@ int fnEventsProcessTrayDoubleClick(int index) for (i=0; i<cli.events.count; i++) {
char * eventProto = NULL;
if (cli.events.items[i]->cle.hContact)
- eventProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)cli.events.items[i]->cle.hContact, 0);
+ eventProto = GetContactProto(cli.events.items[i]->cle.hContact);
if ( !eventProto)
eventProto = cli.events.items[i]->cle.lpszProtocol;
@@ -321,7 +321,7 @@ int fnEventsProcessTrayDoubleClick(int index) for (i=0; i<cli.events.count; i++) {
char * eventProto = NULL;
if (cli.events.items[i]->cle.hContact)
- eventProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)cli.events.items[i]->cle.hContact, 0);
+ eventProto = GetContactProto(cli.events.items[i]->cle.hContact);
if ( !eventProto)
eventProto = cli.events.items[i]->cle.lpszProtocol;
if (eventProto) {
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp index ce37c3ad59..e88ca7aa46 100644 --- a/src/modules/clist/clistmenus.cpp +++ b/src/modules/clist/clistmenus.cpp @@ -331,7 +331,7 @@ static INT_PTR BuildContactMenu(WPARAM wParam, LPARAM) HANDLE hContact = (HANDLE)wParam;
NotifyEventHooks(hPreBuildContactMenuEvent, (WPARAM)hContact, 0);
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
BuildContactParam bcp;
bcp.szProto = szProto;
diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp index fdbc75fe82..3c7f6ddc49 100644 --- a/src/modules/clist/clistmod.cpp +++ b/src/modules/clist/clistmod.cpp @@ -148,7 +148,7 @@ static int ProtocolAck(WPARAM, LPARAM lParam) if (caps & PF1_SERVERCLIST) {
HANDLE hContact = db_find_first();
while (hContact) {
- char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto != NULL && !strcmp(szProto, ack->szModule))
if (db_get_b(hContact, "CList", "Delete", 0))
CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0);
@@ -187,7 +187,7 @@ int fnIconFromStatusMode(const char *szProto, int status, HANDLE) static INT_PTR GetContactIcon(WPARAM wParam, LPARAM)
{
- char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = GetContactProto((HANDLE)wParam);
HANDLE hContact = (HANDLE)wParam;
return cli.pfnIconFromStatusMode(szProto,
@@ -444,8 +444,8 @@ static INT_PTR CompareContacts(WPARAM wParam, LPARAM lParam) char *szProto1, *szProto2;
int rc;
- szProto1 = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) a, 0);
- szProto2 = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) b, 0);
+ szProto1 = GetContactProto(a);
+ szProto2 = GetContactProto(b);
statusa = db_get_w((HANDLE) a, SAFESTRING(szProto1), "Status", ID_STATUS_OFFLINE);
statusb = db_get_w((HANDLE) b, SAFESTRING(szProto2), "Status", ID_STATUS_OFFLINE);
diff --git a/src/modules/clist/clistsettings.cpp b/src/modules/clist/clistsettings.cpp index 504511acd2..b3d1edb897 100644 --- a/src/modules/clist/clistsettings.cpp +++ b/src/modules/clist/clistsettings.cpp @@ -214,7 +214,7 @@ INT_PTR InvalidateDisplayName(WPARAM wParam, LPARAM) int ContactAdded(WPARAM wParam, LPARAM)
{
- cli.pfnChangeContactIcon((HANDLE)wParam, cli.pfnIconFromStatusMode((char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0), ID_STATUS_OFFLINE, NULL), 1);
+ cli.pfnChangeContactIcon((HANDLE)wParam, cli.pfnIconFromStatusMode(GetContactProto((HANDLE)wParam), ID_STATUS_OFFLINE, NULL), 1);
cli.pfnSortContacts();
return 0;
}
@@ -269,7 +269,7 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam) if ( !strcmp(cws->szModule, "CList")) {
if ( !strcmp(cws->szSetting, "Hidden")) {
if (cws->value.type == DBVT_DELETED || cws->value.bVal == 0) {
- char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = GetContactProto((HANDLE)wParam);
cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode(szProto, szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact), 1);
}
else
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index 58f3978b84..612be5cd8e 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -192,7 +192,7 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam) // Delete contact
case IDYES:
{
- char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = GetContactProto((HANDLE)wParam);
if (szProto != NULL) {
// Check if protocol uses server side lists
DWORD caps;
diff --git a/src/modules/clist/contact.cpp b/src/modules/clist/contact.cpp index 76cb8960c7..9ecc273604 100644 --- a/src/modules/clist/contact.cpp +++ b/src/modules/clist/contact.cpp @@ -45,7 +45,7 @@ static const struct { static int GetContactStatus(HANDLE hContact)
{
- char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char* szProto = GetContactProto(hContact);
if (szProto == NULL)
return ID_STATUS_OFFLINE;
return db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
@@ -83,7 +83,7 @@ void fnLoadContactTree(void) while (hContact != NULL) {
status = GetContactStatus(hContact);
if (( !hideOffline || status != ID_STATUS_OFFLINE) && !db_get_b(hContact, "CList", "Hidden", 0))
- cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode((char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0), status, hContact), 1);
+ cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode(GetContactProto(hContact), status, hContact), 1);
hContact = db_find_next(hContact);
}
sortByStatus = db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT);
@@ -168,7 +168,7 @@ INT_PTR ContactChangeGroup(WPARAM wParam, LPARAM lParam) db_set_ts((HANDLE)wParam, "CList", "Group", grpChg.pszNewName);
}
CallService(MS_CLUI_CONTACTADDED, wParam,
- cli.pfnIconFromStatusMode((char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0), GetContactStatus((HANDLE)wParam), (HANDLE)wParam));
+ cli.pfnIconFromStatusMode(GetContactProto((HANDLE)wParam), GetContactStatus((HANDLE)wParam), (HANDLE)wParam));
NotifyEventHooks(hGroupChangeEvent, wParam, (LPARAM)&grpChg);
return 0;
diff --git a/src/modules/extraicons/DefaultExtraIcons.cpp b/src/modules/extraicons/DefaultExtraIcons.cpp index 5f848af03f..5e865c7609 100644 --- a/src/modules/extraicons/DefaultExtraIcons.cpp +++ b/src/modules/extraicons/DefaultExtraIcons.cpp @@ -64,7 +64,7 @@ static void SetVisibility(HANDLE hContact, int apparentMode, bool clear) if (hContact == NULL)
return;
- char *proto = (char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char *proto = GetContactProto(hContact);
if ( IsEmpty(proto))
return;
@@ -101,7 +101,7 @@ static void SetGender(HANDLE hContact, int gender, bool clear) if (hContact == NULL)
return;
- char *proto = (char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char *proto = GetContactProto(hContact);
if ( IsEmpty(proto))
return;
@@ -172,7 +172,7 @@ static void SetExtraIcons(HANDLE hContact) if (hContact == NULL)
return;
- char *proto = (char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char *proto = GetContactProto(hContact);
if ( IsEmpty(proto))
return;
@@ -204,7 +204,7 @@ static int SettingChanged(WPARAM wParam, LPARAM lParam) if (hContact == NULL)
return 0;
- char *proto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char *proto = GetContactProto(hContact);
if ( IsEmpty(proto))
return 0;
@@ -252,7 +252,7 @@ static int DefaultOnClick(WPARAM wParam, LPARAM lParam, LPARAM param) if (hContact == NULL)
return 0;
- char *proto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char *proto = GetContactProto(hContact);
if ( IsEmpty(proto))
return 0;
@@ -347,7 +347,7 @@ static int ProtocolApplyIcon(WPARAM wParam, LPARAM lParam) {
HANDLE hContact = (HANDLE)wParam;
- char *proto = (char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char *proto = GetContactProto(hContact);
if ( IsEmpty(proto))
return 0;
diff --git a/src/modules/ignore/ignore.cpp b/src/modules/ignore/ignore.cpp index 6373a32b6c..8b93c9bdf4 100644 --- a/src/modules/ignore/ignore.cpp +++ b/src/modules/ignore/ignore.cpp @@ -172,7 +172,7 @@ static void SetAllContactIcons(HWND hwndList) HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX, 0)) == EMPTY_EXTRA_ICON) {
DWORD proto1Caps, proto4Caps;
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto) {
proto1Caps = CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_1, 0);
proto4Caps = CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_4, 0);
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp index bac663a48f..a39e62899a 100644 --- a/src/modules/protocols/protocols.cpp +++ b/src/modules/protocols/protocols.cpp @@ -166,7 +166,7 @@ static INT_PTR Proto_RecvMessage(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.eventType = EVENTTYPE_MESSAGE;
if (pre->flags & PREF_UNICODE) {
@@ -218,7 +218,7 @@ static int Proto_ValidTypingContact(HANDLE hContact, char *szProto) static INT_PTR Proto_SelfIsTyping(WPARAM wParam, LPARAM lParam)
{
if (lParam == PROTOTYPE_SELFTYPING_OFF || lParam == PROTOTYPE_SELFTYPING_ON) {
- char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char* szProto = GetContactProto((HANDLE)wParam);
if ( !szProto)
return 0;
@@ -232,7 +232,7 @@ static INT_PTR Proto_SelfIsTyping(WPARAM wParam, LPARAM lParam) static INT_PTR Proto_ContactIsTyping(WPARAM wParam, LPARAM lParam)
{
int type = (int)lParam;
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = GetContactProto((HANDLE)wParam);
if ( !szProto)
return 0;
diff --git a/src/modules/utils/path.cpp b/src/modules/utils/path.cpp index 24e30fcf4a..184dd876f7 100644 --- a/src/modules/utils/path.cpp +++ b/src/modules/utils/path.cpp @@ -66,7 +66,7 @@ static INT_PTR createDirTreeW(WPARAM, LPARAM lParam) TCHAR *GetContactID(HANDLE hContact)
{
TCHAR *theValue = {0};
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1) {
DBVARIANT dbv;
if ( !DBGetContactSettingTString(hContact, szProto, "ChatRoomID", &dbv)) {
@@ -275,7 +275,7 @@ XCHAR *GetInternalVariable(XCHAR *key, size_t keyLength, HANDLE hContact) if ( !_xcscmp(theKey, XSTR(key, "nick")))
theValue = GetContactNickX(key, hContact);
else if ( !_xcscmp(theKey, XSTR(key, "proto")))
- theValue = mir_a2x(key, (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0));
+ theValue = mir_a2x(key, GetContactProto(hContact));
else if ( !_xcscmp(theKey, XSTR(key, "userid")))
theValue = GetContactIDX(key, hContact);
}
diff --git a/src/modules/utils/timezones.cpp b/src/modules/utils/timezones.cpp index a230fa7083..dcdc68b32d 100644 --- a/src/modules/utils/timezones.cpp +++ b/src/modules/utils/timezones.cpp @@ -197,7 +197,7 @@ static HANDLE timeapiGetInfoByContact(HANDLE hContact, DWORD dwFlags) signed char timezone = (signed char)db_get_b(hContact, "UserInfo", "Timezone", -1);
if (timezone == -1)
{
- char* szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char* szProto = GetContactProto(hContact);
if ( !DBGetContactSettingTString(hContact, szProto, "TzName", &dbv))
{
HANDLE res = timeapiGetInfoByName(dbv.ptszVal, dwFlags);
diff --git a/src/modules/visibility/visibility.cpp b/src/modules/visibility/visibility.cpp index 8f7172dbaa..c6d02a148e 100644 --- a/src/modules/visibility/visibility.cpp +++ b/src/modules/visibility/visibility.cpp @@ -111,7 +111,7 @@ static void SetAllContactIcons(HWND hwndList) if (hItem) {
DWORD flags;
WORD status;
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto == NULL) {
flags = 0;
status = 0;
|