diff options
Diffstat (limited to 'plugins/Popup/src')
-rw-r--r-- | plugins/Popup/src/popup_wnd2.cpp | 17 | ||||
-rw-r--r-- | plugins/Popup/src/services.cpp | 4 |
2 files changed, 8 insertions, 13 deletions
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index 74ff137c79..6ff98aba12 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -616,10 +616,8 @@ void PopupWnd2::fixDefaults() m_hContactPassed = m_hContact;
if (m_hContact)
- {
- if (!CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)m_hContact, 0))
+ if (!GetContactProto(m_hContact))
m_hContact = NULL;
- }
switch (m_textType)
{
@@ -653,10 +651,7 @@ void PopupWnd2::fixAvatar() int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
{
- bool isIm = (m_hContact &&
- (CallProtoService(
- (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)m_hContact, 0),
- PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM)) ? true : false;
+ bool isIm = (m_hContact && (CallProtoService(GetContactProto(m_hContact), PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM)) ? true : false;
// bool enableDefault = (isIm || !(PopUpOptions.actions&ACT_DEF_IMONLY)) ? true : false;
bool enableDefaultGen = (m_hContact || !(PopUpOptions.actions&ACT_DEF_NOGLOBAL)) ? true : false;
@@ -1042,7 +1037,7 @@ struct ReplyEditData bool IsMsgServiceNameW(HANDLE hContact) {
if (g_popup.isMirUnicode) {
char szServiceName[100];
- char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto == NULL)
return false;
@@ -1055,13 +1050,13 @@ bool IsMsgServiceNameW(HANDLE hContact) { BOOL IsUtfSendAvailable(HANDLE hContact)
{
- char* szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char* szProto = GetContactProto(hContact);
if(szProto == NULL) return FALSE;
//check for MetaContact and get szProto from subcontact
if(strcmp(szProto, gszMetaProto)==0) {
HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT, (WPARAM)hContact, 0);
if (!hSubContact) return FALSE;
- szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hSubContact, 0);
+ szProto = GetContactProto(hSubContact);
}
return(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_IMSENDUTF) ? TRUE : FALSE;
}
@@ -1072,7 +1067,7 @@ void AddMessageToDB(HANDLE hContact, char *msg, int flag/*bool utf*/) dbei.cbSize = sizeof(dbei);
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_SENT | ((flag&PREF_UTF)==PREF_UTF ? DBEF_UTF : 0);
- dbei.szModule = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ dbei.szModule = GetContactProto(hContact);
dbei.timestamp = time(NULL);
if(g_popup.isOsUnicode && !((flag&PREF_UTF)==PREF_UTF) && (flag&PREF_UNICODE)==PREF_UNICODE)
dbei.cbBlob = (lstrlenW((LPWSTR)msg) + 1)*sizeof(WCHAR/*TCHAR*/);
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index d0c98c9903..c74bcbbe55 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -254,7 +254,7 @@ INT_PTR PopUp_AddPopUp2(WPARAM wParam, LPARAM lParam) // Check if contact handle is valid.
char *proto = NULL;
if (ppd->lchContact)
- proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ppd->lchContact, 0);
+ proto = GetContactProto(ppd->lchContact);
BYTE bShowMode = proto ? DBGetContactSettingByte(ppd->lchContact, MODULNAME, "ShowMode", PU_SHOWMODE_AUTO) : PU_SHOWMODE_AUTO;
@@ -292,7 +292,7 @@ INT_PTR PopUp_AddPopUp2(WPARAM wParam, LPARAM lParam) if (proto)
{
char prefix[128];
- mir_snprintf(prefix, sizeof(prefix), "Protocol Status/%s", (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ppd->lchContact, 0));
+ mir_snprintf(prefix, sizeof(prefix), "Protocol Status/%s", GetContactProto(ppd->lchContact));
if (DBGetContactSettingDword(NULL, MODULNAME, prefix, 0) &
Proto_Status2Flag_My(CallProtoService(proto, PS_GETSTATUS, 0, 0)))
return -1;
|