diff options
Diffstat (limited to 'protocols')
51 files changed, 76 insertions, 87 deletions
diff --git a/protocols/AimOscar/src/utility.cpp b/protocols/AimOscar/src/utility.cpp index 4c487cf818..15359a9a9b 100644 --- a/protocols/AimOscar/src/utility.cpp +++ b/protocols/AimOscar/src/utility.cpp @@ -163,7 +163,7 @@ unsigned short CAimProto::get_default_port(void) bool CAimProto::is_my_contact(HANDLE hContact)
{
- const char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ const char* szProto = GetContactProto(hContact);
return szProto != NULL && strcmp(m_szModuleName, szProto) == 0;
}
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index cabad56410..aea08663fb 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -24,9 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. bool FacebookProto::IsMyContact(HANDLE hContact, bool include_chat)
{
- const char *proto = reinterpret_cast<char*>( CallService(MS_PROTO_GETCONTACTBASEPROTO,
- reinterpret_cast<WPARAM>(hContact),0));
-
+ const char *proto = GetContactProto(hContact);
if( proto && strcmp(m_szModuleName,proto) == 0 )
{
if( include_chat )
diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp index 859f1f9e56..5d7c002398 100644 --- a/protocols/FacebookRM/src/theme.cpp +++ b/protocols/FacebookRM/src/theme.cpp @@ -115,9 +115,8 @@ HANDLE g_hContactMenuSvc[CMITEMS_COUNT]; // Helper functions
static FacebookProto * GetInstanceByHContact(HANDLE hContact)
{
- char *proto = reinterpret_cast<char*>( CallService(MS_PROTO_GETCONTACTBASEPROTO,
- reinterpret_cast<WPARAM>(hContact),0));
- if(!proto)
+ char *proto = GetContactProto(hContact);
+ if( !proto )
return 0;
for(int i=0; i<g_Instances.getCount(); i++)
diff --git a/protocols/GTalkExt/src/db.cpp b/protocols/GTalkExt/src/db.cpp index a1658dbdcf..27290afafb 100644 --- a/protocols/GTalkExt/src/db.cpp +++ b/protocols/GTalkExt/src/db.cpp @@ -92,7 +92,7 @@ void RenewPseudocontactHandles() HANDLE hContact = db_find_first();
while (hContact) {
if (DBGetContactSettingByte(hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) {
- LPCSTR proto = (LPCSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ LPCSTR proto = (LPCSTR)GetContactProto(hContact);
DBWriteContactSettingDword(0, proto, PSEUDOCONTACT_LINK, (DWORD)hContact);
}
hContact = db_find_next(hContact);
diff --git a/protocols/GTalkExt/src/inbox.cpp b/protocols/GTalkExt/src/inbox.cpp index 53a4aa2fcb..e52939aa10 100644 --- a/protocols/GTalkExt/src/inbox.cpp +++ b/protocols/GTalkExt/src/inbox.cpp @@ -382,7 +382,7 @@ LPTSTR CraftInboxUrl(LPTSTR jid) void OpenContactInbox(HANDLE hContact)
{
- LPSTR acc = (LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ LPSTR acc = GetContactProto(hContact);
if (!acc) return;
DBVARIANT dbv;
diff --git a/protocols/GTalkExt/src/popups.cpp b/protocols/GTalkExt/src/popups.cpp index 99ab94470b..0f0b6c2d04 100644 --- a/protocols/GTalkExt/src/popups.cpp +++ b/protocols/GTalkExt/src/popups.cpp @@ -47,7 +47,7 @@ LRESULT CALLBACK PopupHookProc(int nCode, WPARAM wParam, LPARAM lParam) if (hContact != (HANDLE)-1 &&
hContact != (HANDLE)0x80000000 &&
DBGetContactSettingByte(hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) {
- LPCSTR proto = (LPCSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ LPCSTR proto = (LPCSTR)GetContactProto(hContact);
DWORD checkboxes = ReadCheckboxes(0, proto);
if (ReadCheckbox(0, IDC_PSEUDOCONTACTENABLED, checkboxes) &&
ReadCheckbox(0, IDC_SUPRESSFOREIGN, checkboxes))
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index d3b359e49f..4c6b1faa59 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -1405,7 +1405,7 @@ void GGPROTO::setalloffline() 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, m_szModuleName))
{
db_set_w(hContact, m_szModuleName, GG_KEY_STATUS, ID_STATUS_OFFLINE);
@@ -1478,7 +1478,7 @@ void GGPROTO::notifyall() hContact = db_find_first();
while (hContact)
{
- szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ szProto = GetContactProto(hContact);
if (szProto != NULL && !strcmp(szProto, m_szModuleName)) count ++;
hContact = db_find_next(hContact);
}
@@ -1501,7 +1501,7 @@ void GGPROTO::notifyall() hContact = db_find_first();
while (hContact && cc < count)
{
- szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ szProto = GetContactProto(hContact);
if (szProto != NULL && !strcmp(szProto, m_szModuleName) && (uins[cc] = db_get_dw(hContact, m_szModuleName, GG_KEY_UIN, 0)))
{
if ((db_get_w(hContact, m_szModuleName, GG_KEY_APPARENT, (WORD) ID_STATUS_ONLINE) == ID_STATUS_OFFLINE) ||
@@ -1540,7 +1540,7 @@ HANDLE GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick) // Look for contact in DB
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, m_szModuleName)) {
if ((uin_t)db_get_dw(hContact, m_szModuleName, GG_KEY_UIN, 0) == uin
&& db_get_b(hContact, m_szModuleName, "ChatRoom", 0) == 0)
diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp index d34b8e54d1..440e0718e4 100644 --- a/protocols/Gadu-Gadu/src/dialogs.cpp +++ b/protocols/Gadu-Gadu/src/dialogs.cpp @@ -746,7 +746,7 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, if (hContact == NULL)
szProto = gg->m_szModuleName;
else
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ szProto = GetContactProto(hContact);
if (szProto == NULL)
break;
@@ -880,7 +880,7 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, int GGPROTO::details_init(WPARAM wParam, LPARAM lParam)
{
- char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, lParam, 0);
+ char* szProto = GetContactProto((HANDLE)lParam);
if ((szProto == NULL || strcmp(szProto, m_szModuleName)) && lParam || lParam && db_get_b((HANDLE)lParam, m_szModuleName, "ChatRoom", 0))
return 0;
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index eafcb952fa..c6c5b9715a 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -211,7 +211,7 @@ static int gg_preshutdown(WPARAM wParam, LPARAM lParam) // Gets protocol instance associated with a contact
static GGPROTO* gg_getprotoinstance(HANDLE hContact)
{
- char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char* szProto = GetContactProto(hContact);
list_t l = g_Instances;
if (szProto == NULL)
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp index 0117ce8805..118a674439 100644 --- a/protocols/Gadu-Gadu/src/groupchat.cpp +++ b/protocols/Gadu-Gadu/src/groupchat.cpp @@ -399,7 +399,7 @@ char* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count) static HANDLE gg_getsubcontact(GGPROTO* gg, HANDLE hContact)
{
- char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char* szProto = GetContactProto(hContact);
char* szMetaProto = (char*)CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
if (szProto && szMetaProto && (INT_PTR)szMetaProto != CALLSERVICE_NOTFOUND && !lstrcmpA(szProto, szMetaProto))
@@ -409,7 +409,7 @@ static HANDLE gg_getsubcontact(GGPROTO* gg, HANDLE hContact) for (i = 0; i < nSubContacts; i++)
{
hMetaContact = (HANDLE)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, i);
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hMetaContact, 0);
+ szProto = GetContactProto(hMetaContact);
if (szProto && !lstrcmpA(szProto, gg->m_szModuleName))
return hMetaContact;
}
@@ -557,7 +557,7 @@ static INT_PTR CALLBACK gg_gc_openconfdlg(HWND hwndDlg, UINT message, WPARAM wPa }
else
{
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ szProto = GetContactProto(hContact);
uin = (uin_t)db_get_dw(hContact, gg->m_szModuleName, GG_KEY_UIN, 0);
}
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp index 3ccc95c7fe..1bb5725222 100644 --- a/protocols/Gadu-Gadu/src/import.cpp +++ b/protocols/Gadu-Gadu/src/import.cpp @@ -104,7 +104,7 @@ char *gg_makecontacts(GGPROTO *gg, int cr) 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, gg->m_szModuleName) && !db_get_b(hContact, gg->m_szModuleName, "ChatRoom", 0))
{
DBVARIANT dbv;
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index 64c7086355..78aa938026 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -93,7 +93,7 @@ static HANDLE hPreBuildContactMenu, hMenuChanSettings, hMenuWhois, hMenuDisconne static CIrcProto* IrcGetInstanceByHContact(HANDLE hContact)
{
- char* szProto = ( char* )CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char* szProto = GetContactProto(hContact);
if (szProto == NULL)
return NULL;
diff --git a/protocols/IcqOscarJ/src/UI/userinfotab.cpp b/protocols/IcqOscarJ/src/UI/userinfotab.cpp index 91d28c0e04..47c47d755f 100644 --- a/protocols/IcqOscarJ/src/UI/userinfotab.cpp +++ b/protocols/IcqOscarJ/src/UI/userinfotab.cpp @@ -231,7 +231,7 @@ static INT_PTR CALLBACK IcqDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (hContact == NULL)
szProto = ppro->m_szModuleName;
else
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ szProto = GetContactProto(hContact);
if (!szProto)
break;
diff --git a/protocols/IcqOscarJ/src/icq_db.cpp b/protocols/IcqOscarJ/src/icq_db.cpp index f199860df8..9e9ca34fb2 100644 --- a/protocols/IcqOscarJ/src/icq_db.cpp +++ b/protocols/IcqOscarJ/src/icq_db.cpp @@ -340,7 +340,7 @@ int __fastcall ICQFreeVariant(DBVARIANT *dbv) int CIcqProto::IsICQContact(HANDLE hContact)
{
- char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char* szProto = GetContactProto(hContact);
return !strcmpnull(szProto, m_szModuleName);
}
diff --git a/protocols/IcqOscarJ/src/icq_menu.cpp b/protocols/IcqOscarJ/src/icq_menu.cpp index f3dd072cde..6694b6145b 100644 --- a/protocols/IcqOscarJ/src/icq_menu.cpp +++ b/protocols/IcqOscarJ/src/icq_menu.cpp @@ -43,7 +43,7 @@ LIST<CIcqProto> g_Instances(1, sttCompareProtocols); static CIcqProto* IcqGetInstanceByHContact(HANDLE hContact)
{
- char* szProto = ( char* )CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char* szProto = GetContactProto(hContact);
if (szProto == NULL)
return NULL;
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 76772609f9..78542e10f0 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -711,7 +711,7 @@ class CGroupchatInviteDlg : public CJabberDlgBase hContact;
hContact = db_find_next(hContact))
{
- char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *proto = GetContactProto(hContact);
if (lstrcmpA(proto, m_proto->m_szModuleName) || db_get_b(hContact, proto, "ChatRoom", 0))
if (HANDLE hItem = m_clc.FindContact(hContact))
m_clc.DeleteItem(hItem);
@@ -829,7 +829,7 @@ public: hContact;
hContact = db_find_next(hContact))
{
- char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *proto = GetContactProto(hContact);
if ( !lstrcmpA(proto, m_proto->m_szModuleName) && !db_get_b(hContact, proto, "ChatRoom", 0))
{
if (int hItem = SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0))
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index 84981edb0f..2df794d300 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -539,7 +539,7 @@ void CJabberProto::CheckAllContactsAreTransported() {
HANDLE hContact = (HANDLE)db_find_first();
while (hContact != NULL) {
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if ( !lstrcmpA(m_szModuleName, szProto)) {
DBVARIANT dbv;
if ( !JGetStringT(hContact, "jid", &dbv)) {
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index b043e7fcb3..9e61999c4c 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -528,7 +528,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo* pInfo) HANDLE* list = NULL;
HANDLE hContact = (HANDLE)db_find_first();
while (hContact != NULL) {
- char* str = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char* str = GetContactProto(hContact);
if (str != NULL && !strcmp(str, m_szModuleName)) {
DBVARIANT dbv;
if ( !JGetStringT(hContact, "jid", &dbv)) {
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 225a4fccc2..1a490f1eb9 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -81,7 +81,7 @@ static INT_PTR JabberMenuChooseService(WPARAM wParam, LPARAM lParam) static CJabberProto* JabberGetInstanceByHContact(HANDLE hContact)
{
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto == NULL)
return NULL;
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index ba6a104413..106c837ef9 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -177,7 +177,7 @@ HANDLE CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL t // We can't use JabberHContactFromJID() here because of the stripResource option
HANDLE hContact = (HANDLE)db_find_first();
while (hContact != NULL) {
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ szProto = GetContactProto(hContact);
if (szProto!=NULL && !strcmp(m_szModuleName, szProto)) {
DBVARIANT dbv;
if ( !JGetStringT(hContact, "jid", &dbv)) {
@@ -330,7 +330,7 @@ void CJabberProto::ResolveTransportNicks(const TCHAR *jid) hContact = (HANDLE)db_find_first();
for (; hContact != NULL; hContact = db_find_next(hContact)) {
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (lstrcmpA(szProto, m_szModuleName))
continue;
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index 4f2dd2060f..cdf57f3f91 100644 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -1065,7 +1065,7 @@ void CJabberProto::_RosterHandleGetRequest(HXML node) HANDLE hContact = (HANDLE)db_find_first();
while (hContact != NULL)
{
- char* str = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char* str = GetContactProto(hContact);
if (str != NULL && !strcmp(str, m_szModuleName))
{
DBVARIANT dbv;
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index c5754fcd0d..15a10b143b 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -435,7 +435,7 @@ public: HANDLE hContact = (HANDLE)db_find_first();
while (hContact != NULL)
{
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto != NULL && !strcmp(szProto, m_proto->m_szModuleName))
{
DBVARIANT dbv;
@@ -1372,7 +1372,7 @@ void CJabberDlgPrivacyLists::CListFilter(HWND) hContact;
hContact = db_find_next(hContact))
{
- char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *proto = GetContactProto(hContact);
if ( !proto || lstrcmpA(proto, m_proto->m_szModuleName))
if (HANDLE hItem = m_clcClist.FindContact(hContact))
m_clcClist.DeleteItem(hItem);
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 2a10f808a9..fbb88dde49 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -317,7 +317,7 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM) HANDLE hContact = (HANDLE)db_find_first();
while (hContact != NULL) {
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto != NULL && !strcmp(szProto, m_szModuleName))
MenuHideSrmmIcon(hContact);
hContact = db_find_next(hContact);
@@ -342,7 +342,7 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM) // Set all contacts to offline
HANDLE hContact = db_find_first();
while (hContact != NULL) {
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto != NULL && !strcmp(szProto, m_szModuleName)) {
SetContactOfflineStatus(hContact);
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp index 53f5310b28..aeb7ef9bc4 100644 --- a/protocols/JabberG/src/jabber_rc.cpp +++ b/protocols/JabberG/src/jabber_rc.cpp @@ -478,7 +478,7 @@ int CJabberProto::RcGetUnreadEventsCount() int nEventsSent = 0;
HANDLE hContact = (HANDLE)db_find_first();
while (hContact != NULL) {
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto != NULL && !strcmp(szProto, m_szModuleName)) {
DBVARIANT dbv;
if ( !JGetStringT(hContact, "jid", &dbv)) {
@@ -575,7 +575,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo* pInfo, CJabberAdhocSe int nEventsSent = 0;
HANDLE hContact = (HANDLE)db_find_first();
while (hContact != NULL) {
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto != NULL && !strcmp(szProto, m_szModuleName)) {
DBVARIANT dbv;
if ( !JGetStringT(hContact, "jid", &dbv)) {
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index e4c946a2ad..0604e9c3b1 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -585,7 +585,7 @@ recvRest: // Set all contacts to offline
HANDLE hContact = (HANDLE)db_find_first();
while (hContact != NULL) {
- if ( !lstrcmpA((char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0), m_szModuleName))
+ if ( !lstrcmpA(GetContactProto(hContact), m_szModuleName))
{
SetContactOfflineStatus(hContact);
MenuHideSrmmIcon(hContact);
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index 1894d79934..681dfbbd3a 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -852,7 +852,7 @@ int CJabberProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) HANDLE hContact = (HANDLE)lParam;
if (hContact) {
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto != NULL && !strcmp(szProto, m_szModuleName)) {
odp.pfnDlgProc = JabberUserInfoDlgProc;
odp.position = -2000000000;
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 8c59d09f6b..3c9dbc4b71 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -76,7 +76,7 @@ HANDLE CJabberProto::ChatRoomHContactFromJID(const TCHAR *jid) HANDLE hContactMatched = NULL;
HANDLE hContact = (HANDLE)db_find_first();
while (hContact != NULL) {
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto != NULL && !strcmp(m_szModuleName, szProto)) {
DBVARIANT dbv;
int result = JGetStringT(hContact, "ChatRoomID", &dbv);
@@ -111,7 +111,7 @@ HANDLE CJabberProto::HContactFromJID(const TCHAR *jid , BOOL bStripResource) HANDLE hContactMatched = NULL;
HANDLE hContact = (HANDLE)db_find_first();
while (hContact != NULL) {
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto != NULL && !strcmp(m_szModuleName, szProto)) {
DBVARIANT dbv;
int result;
diff --git a/protocols/MRA/src/MraSelectEMail.cpp b/protocols/MRA/src/MraSelectEMail.cpp index 14b630eec6..29c5c4fd7d 100644 --- a/protocols/MRA/src/MraSelectEMail.cpp +++ b/protocols/MRA/src/MraSelectEMail.cpp @@ -65,7 +65,7 @@ INT_PTR CALLBACK MraSelectEMailDlgProc(HWND hWndDlg, UINT message, WPARAM wParam }
if (dat->hContact)
- lpszProto = (LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ lpszProto = GetContactProto(dat->hContact);
else
lpszProto = dat->ppro->m_szModuleName;
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 5c6905df7e..eb6497f506 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -824,7 +824,7 @@ BOOL CMraProto::IsContactMra(HANDLE hContact) BOOL IsContactMraProto(HANDLE hContact)
{
BOOL bRet = FALSE;
- LPSTR lpszProto = (LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ LPSTR lpszProto = GetContactProto(hContact);
if (lpszProto)
{
@@ -992,7 +992,7 @@ DWORD CMraProto::GetContactEMailCount(HANDLE hContact, BOOL bMRAOnly) LPSTR lpszProto;
if (hContact)
- lpszProto = (LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ lpszProto = GetContactProto(hContact);
else
lpszProto = m_szModuleName;
@@ -1049,7 +1049,7 @@ BOOL CMraProto::GetContactFirstEMail(HANDLE hContact, BOOL bMRAOnly, LPSTR lpszR LPSTR lpszProto;
if (hContact)
- lpszProto = (LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ lpszProto = GetContactProto(hContact);
else
lpszProto = m_szModuleName;
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp index 1913483b36..1d8c813377 100644 --- a/protocols/MSN/src/msn_menu.cpp +++ b/protocols/MSN/src/msn_menu.cpp @@ -388,7 +388,7 @@ void CMsnProto::MSN_EnableMenuItems(bool bEnable) static CMsnProto* GetProtoInstanceByHContact(HANDLE hContact)
{
- char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char* szProto = GetContactProto(hContact);
if (szProto == NULL)
return NULL;
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index 1a31662de7..5599ce3b22 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -1373,7 +1373,7 @@ char* MSN_Base64Decode(const char* str) bool CMsnProto::MSN_IsMyContact(HANDLE hContact)
{
- const char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ const char* szProto = GetContactProto(hContact);
return szProto != NULL && strcmp(m_szModuleName, szProto) == 0;
}
diff --git a/protocols/NewsAggregator/Src/Utils.cpp b/protocols/NewsAggregator/Src/Utils.cpp index 197cc5a0ba..90ce3cc2d9 100644 --- a/protocols/NewsAggregator/Src/Utils.cpp +++ b/protocols/NewsAggregator/Src/Utils.cpp @@ -24,7 +24,7 @@ BOOL UpdateListFlag = FALSE; BOOL IsMyContact(HANDLE hContact)
{
- const char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ const char* szProto = GetContactProto(hContact);
return szProto != NULL && strcmp(MODULE, szProto) == 0;
}
diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp index 9386bd787d..c58d431a4c 100644 --- a/protocols/Omegle/src/proto.cpp +++ b/protocols/Omegle/src/proto.cpp @@ -244,7 +244,7 @@ int OmegleProto::OnContactDeleted(WPARAM wparam,LPARAM) /*bool OmegleProto::IsMyContact(HANDLE hContact, bool include_chat)
{
- const char *proto = reinterpret_cast<char*>( CallService(MS_PROTO_GETCONTACTBASEPROTO,
+ const char *proto = reinterpret_cast<char*>(GetContactProto(
reinterpret_cast<WPARAM>(hContact),0));
if ( proto && strcmp(m_szModuleName,proto) == 0 )
diff --git a/protocols/Omegle/src/theme.cpp b/protocols/Omegle/src/theme.cpp index 216e2fd98b..4ed027ed0c 100644 --- a/protocols/Omegle/src/theme.cpp +++ b/protocols/Omegle/src/theme.cpp @@ -93,8 +93,7 @@ HANDLE GetIconHandle(const char* name) // Helper functions
static OmegleProto * GetInstanceByHContact(HANDLE hContact)
{
- char *proto = reinterpret_cast<char*>( CallService(MS_PROTO_GETCONTACTBASEPROTO,
- reinterpret_cast<WPARAM>(hContact),0));
+ char *proto = GetContactProto(hContact);
if (!proto)
return 0;
diff --git a/protocols/Quotes/src/QuotesProviders.cpp b/protocols/Quotes/src/QuotesProviders.cpp index c7d6823cec..26cbb067ea 100644 --- a/protocols/Quotes/src/QuotesProviders.cpp +++ b/protocols/Quotes/src/QuotesProviders.cpp @@ -86,9 +86,8 @@ void CQuotesProviders::InitProviders() CQuotesProviders::TQuotesProviderPtr CQuotesProviders::GetContactProviderPtr(HANDLE hContact)const
{
- char* szProto = reinterpret_cast<char*>(CallService(MS_PROTO_GETCONTACTBASEPROTO,
- reinterpret_cast<WPARAM>(hContact),0));
- if(NULL == szProto || 0 != ::_stricmp(szProto,QUOTES_PROTOCOL_NAME))
+ char* szProto = GetContactProto(hContact);
+ if(NULL == szProto || 0 != ::_stricmp(szProto, QUOTES_PROTOCOL_NAME))
{
return TQuotesProviderPtr();
}
diff --git a/protocols/Tlen/src/jabber_iqid.cpp b/protocols/Tlen/src/jabber_iqid.cpp index 2fde1bb6df..49df5a88be 100644 --- a/protocols/Tlen/src/jabber_iqid.cpp +++ b/protocols/Tlen/src/jabber_iqid.cpp @@ -213,7 +213,7 @@ void JabberIqResultRoster(TlenProtocol *proto, XmlNode *iqNode) list = NULL;
hContact = db_find_first();
while (hContact != NULL) {
- str = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ str = GetContactProto(hContact);
if (str != NULL && !strcmp(str, proto->m_szModuleName)) {
if (!DBGetContactSetting(hContact, proto->m_szModuleName, "jid", &dbv)) {
if (!JabberListExist(proto, LIST_ROSTER, dbv.pszVal)) {
diff --git a/protocols/Tlen/src/jabber_misc.cpp b/protocols/Tlen/src/jabber_misc.cpp index c9db7eed21..b31dcd7815 100644 --- a/protocols/Tlen/src/jabber_misc.cpp +++ b/protocols/Tlen/src/jabber_misc.cpp @@ -93,7 +93,7 @@ HANDLE JabberHContactFromJID(TlenProtocol *proto, const char *jid) hContactMatched = NULL;
hContact = db_find_first();
while (hContact != NULL) {
- szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ szProto = GetContactProto(hContact);
if (szProto != NULL && !strcmp(proto->m_szModuleName, szProto)) {
if (!DBGetContactSetting(hContact, proto->m_szModuleName, "jid", &dbv)) {
if ((p=dbv.pszVal) != NULL) {
diff --git a/protocols/Tlen/src/jabber_svc.cpp b/protocols/Tlen/src/jabber_svc.cpp index 345490df30..0c4ba468e5 100644 --- a/protocols/Tlen/src/jabber_svc.cpp +++ b/protocols/Tlen/src/jabber_svc.cpp @@ -931,7 +931,7 @@ int JabberDbSettingChanged(void *ptr, WPARAM wParam, LPARAM lParam) char *szProto, *nick, *jid, *group;
hContact = (HANDLE) wParam;
- szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ szProto = GetContactProto(hContact);
if (szProto == NULL || strcmp(szProto, proto->m_szModuleName)) return 0;
// if (DBGetContactSettingByte(hContact, proto->m_szModuleName, "ChatRoom", 0) != 0) return 0;
// A contact's group is changed
@@ -977,7 +977,7 @@ int JabberDbSettingChanged(void *ptr, WPARAM wParam, LPARAM lParam) char *newNick;
// hContact = (HANDLE) wParam;
-// szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+// szProto = GetContactProto(hContact);
// if (szProto == NULL || strcmp(szProto, proto->m_szModuleName)) return 0;
if (!DBGetContactSetting(hContact, proto->m_szModuleName, "jid", &dbv)) {
@@ -1058,7 +1058,7 @@ int JabberContactDeleted(void *ptr, WPARAM wParam, LPARAM lParam) if (!proto->isOnline) // should never happen
return 0;
- szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ szProto = GetContactProto((HANDLE)wParam);
if (szProto == NULL || strcmp(szProto, proto->m_szModuleName))
return 0;
if (!DBGetContactSetting((HANDLE) wParam, proto->m_szModuleName, "jid", &dbv)) {
diff --git a/protocols/Tlen/src/jabber_thread.cpp b/protocols/Tlen/src/jabber_thread.cpp index b9fe951ee1..1250c2aa13 100644 --- a/protocols/Tlen/src/jabber_thread.cpp +++ b/protocols/Tlen/src/jabber_thread.cpp @@ -369,7 +369,7 @@ void __cdecl JabberServerThread(ThreadData *info) // Set all contacts to offline
hContact = db_find_first();
while (hContact != NULL) {
- str = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ str = GetContactProto(hContact);
if (str != NULL && !strcmp(str, info->proto->m_szModuleName)) {
if (DBGetContactSettingWord(hContact, info->proto->m_szModuleName, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) {
DBWriteContactSettingWord(hContact, info->proto->m_szModuleName, "Status", ID_STATUS_OFFLINE);
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp index b494faef88..0267dd5bb5 100644 --- a/protocols/Tlen/src/tlen.cpp +++ b/protocols/Tlen/src/tlen.cpp @@ -321,7 +321,7 @@ int TlenOnModulesLoaded(void *ptr, WPARAM wParam, LPARAM lParam) /* Set all contacts to offline */
HANDLE hContact = db_find_first();
while (hContact != NULL) {
- char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto != NULL && !strcmp(szProto, proto->m_szModuleName)) {
if (DBGetContactSettingWord(hContact, proto->m_szModuleName, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) {
DBWriteContactSettingWord(hContact, proto->m_szModuleName, "Status", ID_STATUS_OFFLINE);
diff --git a/protocols/Tlen/src/tlen_muc.cpp b/protocols/Tlen/src/tlen_muc.cpp index 5f3809d806..6990b7e9aa 100644 --- a/protocols/Tlen/src/tlen_muc.cpp +++ b/protocols/Tlen/src/tlen_muc.cpp @@ -959,7 +959,7 @@ static void __cdecl TlenMUCCSendQueryResultThread(void *ptr) queryResult.iItemsNum = 0;
hContact = db_find_first();
while (hContact != NULL) {
- char *str = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char *str = GetContactProto(hContact);
if (str != NULL && !strcmp(str, threadData->proto->m_szModuleName)) {
if (!DBGetContactSettingByte(hContact, threadData->proto->m_szModuleName, "bChat", FALSE)) {
if (!DBGetContactSetting(hContact, threadData->proto->m_szModuleName, "jid", &dbv)) {
@@ -977,7 +977,7 @@ static void __cdecl TlenMUCCSendQueryResultThread(void *ptr) queryResult.iItemsNum = 0;
hContact = db_find_first();
while (hContact != NULL) {
- char *baseProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ char *baseProto = GetContactProto(hContact);
if (baseProto != NULL && !strcmp(baseProto, threadData->proto->m_szModuleName)) {
if (!DBGetContactSettingByte(hContact, threadData->proto->m_szModuleName, "bChat", FALSE)) {
if (!DBGetContactSetting(hContact, threadData->proto->m_szModuleName, "jid", &dbv)) {
diff --git a/protocols/Tlen/src/tlen_userinfo.cpp b/protocols/Tlen/src/tlen_userinfo.cpp index 38463f746c..25f2858d8a 100644 --- a/protocols/Tlen/src/tlen_userinfo.cpp +++ b/protocols/Tlen/src/tlen_userinfo.cpp @@ -138,7 +138,7 @@ int TlenUserInfoInit(void *ptr, WPARAM wParam, LPARAM lParam) if (!CallService(MS_PROTO_ISPROTOCOLLOADED, 0, (LPARAM) proto->m_szModuleName))
return 0;
hContact = (HANDLE) lParam;
- szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ szProto = GetContactProto(hContact);
if ((szProto != NULL && !strcmp(szProto, proto->m_szModuleName)) || !lParam) {
odp.cbSize = sizeof(odp);
odp.hInstance = hInst;
diff --git a/protocols/Twitter/src/contacts.cpp b/protocols/Twitter/src/contacts.cpp index 902f485ea2..dae818d52b 100644 --- a/protocols/Twitter/src/contacts.cpp +++ b/protocols/Twitter/src/contacts.cpp @@ -212,18 +212,13 @@ int TwitterProto::OnContactDeleted(WPARAM wParam,LPARAM lParam) bool TwitterProto::IsMyContact(HANDLE hContact,bool include_chat)
{
- const char *proto = reinterpret_cast<char*>( CallService(MS_PROTO_GETCONTACTBASEPROTO,
- reinterpret_cast<WPARAM>(hContact),0));
-
- if(proto && strcmp(m_szModuleName,proto) == 0)
- {
+ char *proto = GetContactProto(hContact);
+ if(proto && strcmp(m_szModuleName,proto) == 0) {
if(include_chat)
return true;
- else
- return DBGetContactSettingByte(hContact,m_szModuleName,"ChatRoom",0) == 0;
+ return DBGetContactSettingByte(hContact,m_szModuleName,"ChatRoom",0) == 0;
}
- else
- return false;
+ else return false;
}
HANDLE TwitterProto::UsernameToHContact(const char *name)
diff --git a/protocols/Twitter/src/theme.cpp b/protocols/Twitter/src/theme.cpp index 82df5563b0..18cc7ce7f8 100644 --- a/protocols/Twitter/src/theme.cpp +++ b/protocols/Twitter/src/theme.cpp @@ -102,8 +102,7 @@ static HANDLE g_hMenuEvts[3]; // Helper functions
static TwitterProto * GetInstanceByHContact(HANDLE hContact)
{
- char *proto = reinterpret_cast<char*>( CallService(MS_PROTO_GETCONTACTBASEPROTO,
- reinterpret_cast<WPARAM>(hContact),0));
+ char *proto = GetContactProto(hContact);
if(!proto)
return 0;
diff --git a/protocols/Weather/src/weather_contacts.cpp b/protocols/Weather/src/weather_contacts.cpp index fe9179867c..3c2a250ac6 100644 --- a/protocols/Weather/src/weather_contacts.cpp +++ b/protocols/Weather/src/weather_contacts.cpp @@ -480,6 +480,6 @@ int ContactDeleted(WPARAM wParam, LPARAM lParam) BOOL IsMyContact(HANDLE hContact)
{
- const char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ const char* szProto = GetContactProto(hContact);
return szProto != NULL && strcmp(WEATHERPROTONAME, szProto) == 0;
}
diff --git a/protocols/Xfire/src/userdetails.cpp b/protocols/Xfire/src/userdetails.cpp index 955f65fe13..c53ab8e0dc 100644 --- a/protocols/Xfire/src/userdetails.cpp +++ b/protocols/Xfire/src/userdetails.cpp @@ -251,7 +251,7 @@ static BOOL CALLBACK DlgProcUserDetails(HWND hwndDlg, UINT msg, WPARAM wParam, L if (hContact == NULL)
szProto = protocolname;
else
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ szProto = GetContactProto(hContact);
if (szProto == NULL)
break;
@@ -375,7 +375,7 @@ static BOOL CALLBACK DlgProcUserDetails(HWND hwndDlg, UINT msg, WPARAM wParam, L if (hContact == NULL)
szProto = protocolname;
else
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ szProto = GetContactProto(hContact);
if (szProto == NULL)
break;
diff --git a/protocols/YAMN/src/proto/pop3/pop3comm.cpp b/protocols/YAMN/src/proto/pop3/pop3comm.cpp index d5b229f78c..98888a1733 100644 --- a/protocols/YAMN/src/proto/pop3/pop3comm.cpp +++ b/protocols/YAMN/src/proto/pop3/pop3comm.cpp @@ -287,7 +287,7 @@ int RegisterPOP3Plugin(WPARAM,LPARAM) hContact = db_find_first();
while(hContact)
{
- szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ szProto = GetContactProto(hContact);
if (szProto != NULL && strcmp(szProto, YAMN_DBMODULE)==0)
{
if (!DBGetContactSettingString(hContact,YAMN_DBMODULE,"Id",&dbv)) {
diff --git a/protocols/YAMN/src/services.cpp b/protocols/YAMN/src/services.cpp index 14f2d5b2c3..7254a02428 100644 --- a/protocols/YAMN/src/services.cpp +++ b/protocols/YAMN/src/services.cpp @@ -69,7 +69,7 @@ static int Service_ContactDoubleclicked(WPARAM wParam, LPARAM lParam) static INT_PTR ContactApplication(WPARAM wParam, LPARAM lParam)
{
- char *szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = GetContactProto((HANDLE)wParam);
if ( lstrcmpA(szProto, YAMN_DBMODULE))
return 0;
@@ -171,7 +171,7 @@ static INT_PTR AccountMailCheck(WPARAM wParam, LPARAM lParam){ static INT_PTR ContactMailCheck(WPARAM wParam, LPARAM lParam)
{
- char *szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = GetContactProto((HANDLE)wParam);
if ( lstrcmpA(szProto, YAMN_DBMODULE))
return 0;
@@ -230,7 +230,7 @@ void MainMenuAccountClicked(WPARAM wParam, LPARAM lParam) /*static*/ void ContactDoubleclicked(WPARAM wParam, LPARAM lParam)
{
- char *szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = GetContactProto((HANDLE)wParam);
if ( lstrcmpA(szProto, YAMN_DBMODULE))
return;
diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp index 806fae3757..6d42641ec4 100644 --- a/protocols/Yahoo/src/proto.cpp +++ b/protocols/Yahoo/src/proto.cpp @@ -725,7 +725,7 @@ int __cdecl CYahooProto::UserIsTyping( HANDLE hContact, int type ) if (!m_bLoggedIn)
return 0;
- char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char *szProto = GetContactProto(hContact);
if (szProto==NULL || strcmp(szProto, m_szModuleName))
return 0;
diff --git a/protocols/Yahoo/src/user_info.cpp b/protocols/Yahoo/src/user_info.cpp index d17ca165c7..c957dbc81d 100644 --- a/protocols/Yahoo/src/user_info.cpp +++ b/protocols/Yahoo/src/user_info.cpp @@ -52,7 +52,7 @@ static INT_PTR CALLBACK YahooUserInfoDlgProc( HWND hwndDlg, UINT msg, WPARAM wPa if (hContact == NULL) {
szProto = ppro->m_szModuleName;
} else {
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ szProto = GetContactProto(hContact);
}
if (!szProto)
diff --git a/protocols/Yahoo/src/util.cpp b/protocols/Yahoo/src/util.cpp index 977d0b43cc..d3a31ccebd 100644 --- a/protocols/Yahoo/src/util.cpp +++ b/protocols/Yahoo/src/util.cpp @@ -321,7 +321,7 @@ bool CYahooProto::IsMyContact(HANDLE hContact) {
if (!hContact) return false;
- char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ char* szProto = GetContactProto(hContact);
return szProto && !strcmp(szProto, m_szModuleName);
}
|