diff options
Diffstat (limited to 'protocols')
77 files changed, 128 insertions, 156 deletions
diff --git a/protocols/AimOscar/src/aim.cpp b/protocols/AimOscar/src/aim.cpp index f4f0e39df2..6650975186 100644 --- a/protocols/AimOscar/src/aim.cpp +++ b/protocols/AimOscar/src/aim.cpp @@ -109,7 +109,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = protoInit;
pd.fnUninit = protoUninit;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM) & pd);
+ Proto_RegisterModule( & pd);
InitIcons();
InitExtraIcons();
diff --git a/protocols/AimOscar/src/stdafx.h b/protocols/AimOscar/src/stdafx.h index 371dffa66f..f9d92fbd30 100644 --- a/protocols/AimOscar/src/stdafx.h +++ b/protocols/AimOscar/src/stdafx.h @@ -44,7 +44,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <m_netlib.h>
#include <m_options.h>
#include <m_popup.h>
-#include <m_protomod.h>
#include <m_userinfo.h>
#include <m_icolib.h>
#include <m_imgsrvc.h>
diff --git a/protocols/AimOscar/src/utility.cpp b/protocols/AimOscar/src/utility.cpp index ce2fac297a..174764ee46 100644 --- a/protocols/AimOscar/src/utility.cpp +++ b/protocols/AimOscar/src/utility.cpp @@ -194,7 +194,7 @@ MCONTACT CAimProto::contact_from_sn(const char* sn, bool addIfNeeded, bool tempo if (addIfNeeded) {
MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (hContact) {
- if (CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName) == 0) {
+ if (Proto_AddToContact(hContact, m_szModuleName) == 0) {
setString(hContact, AIM_KEY_SN, norm_sn);
setString(hContact, AIM_KEY_NK, sn);
debugLogA("Adding contact %s to client side list.",norm_sn);
diff --git a/protocols/Dummy/src/main.cpp b/protocols/Dummy/src/main.cpp index ec1c2e52eb..d5cb7ab141 100644 --- a/protocols/Dummy/src/main.cpp +++ b/protocols/Dummy/src/main.cpp @@ -87,7 +87,7 @@ extern "C" int __declspec(dllexport) Load() pd.fnInit = (pfnInitProto)dummyProtoInit; pd.fnUninit = (pfnUninitProto)dummyProtoUninit; pd.type = PROTOTYPE_PROTOCOL; - CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); + Proto_RegisterModule(&pd); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); return 0; diff --git a/protocols/Dummy/src/stdafx.h b/protocols/Dummy/src/stdafx.h index ac945252c3..7416c2aeef 100644 --- a/protocols/Dummy/src/stdafx.h +++ b/protocols/Dummy/src/stdafx.h @@ -47,7 +47,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <m_message.h> #include <m_netlib.h> #include <m_options.h> -#include <m_protomod.h> #include <m_protosvc.h> #include <m_protoint.h> #include <m_skin.h> diff --git a/protocols/EmLanProto/src/amdproto.cpp b/protocols/EmLanProto/src/amdproto.cpp index ec6c441374..abfb8bedfb 100644 --- a/protocols/EmLanProto/src/amdproto.cpp +++ b/protocols/EmLanProto/src/amdproto.cpp @@ -354,7 +354,7 @@ extern "C" int __declspec(dllexport) __cdecl Load() PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
pd.szName = PROTONAME;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
CreateProtoServiceFunction(PROTONAME, PS_GETCAPS, EMPGetCaps);
CreateProtoServiceFunction(PROTONAME, PS_GETNAME, EMPGetName);
diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp index 9ac8e81bd7..62a08d3196 100644 --- a/protocols/EmLanProto/src/mlan.cpp +++ b/protocols/EmLanProto/src/mlan.cpp @@ -237,7 +237,7 @@ MCONTACT CMLan::FindContact(in_addr addr, const char* nick, bool add_to_list, bo if (add_to_list) { MCONTACT res = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); - CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)res, (LPARAM)PROTONAME); + Proto_AddToContact(res, PROTONAME); db_set_dw(res, PROTONAME, "ipaddr", addr.S_un.S_addr); db_set_s(res, PROTONAME, "Nick", nick); diff --git a/protocols/EmLanProto/src/stdafx.h b/protocols/EmLanProto/src/stdafx.h index db054e03c0..3db62db596 100644 --- a/protocols/EmLanProto/src/stdafx.h +++ b/protocols/EmLanProto/src/stdafx.h @@ -14,8 +14,8 @@ #include <newpluginapi.h>
#include <m_options.h>
+#include <m_protosvc.h>
#include <m_database.h>
-#include <m_protomod.h>
#include <m_langpack.h>
#include "resource.h"
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index e94b84f6a7..d7b575f6ed 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -352,7 +352,7 @@ MCONTACT FacebookProto::AddToContactList(facebook_user* fbu, ContactType type, b // Try to make a new contact MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); - if (hContact && CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName) != 0) { + if (hContact && Proto_AddToContact(hContact, m_szModuleName) != 0) { CallService(MS_DB_CONTACT_DELETE, hContact, 0); hContact = NULL; } diff --git a/protocols/FacebookRM/src/main.cpp b/protocols/FacebookRM/src/main.cpp index 0fa30147f4..f58efe34da 100644 --- a/protocols/FacebookRM/src/main.cpp +++ b/protocols/FacebookRM/src/main.cpp @@ -98,7 +98,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = protoInit;
pd.fnUninit = protoUninit;
- CallService(MS_PROTO_REGISTERMODULE, 0, reinterpret_cast<LPARAM>(&pd));
+ Proto_RegisterModule(&pd);
InitIcons();
InitContactMenus();
diff --git a/protocols/FacebookRM/src/stdafx.h b/protocols/FacebookRM/src/stdafx.h index ce1b356b67..bcbf0f6298 100644 --- a/protocols/FacebookRM/src/stdafx.h +++ b/protocols/FacebookRM/src/stdafx.h @@ -51,7 +51,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <m_popup.h>
#include <m_protosvc.h>
#include <m_protoint.h>
-#include <m_protomod.h>
#include <m_skin.h>
#include <m_icolib.h>
#include <m_hotkeys.h>
diff --git a/protocols/GTalkExt/src/handlers.cpp b/protocols/GTalkExt/src/handlers.cpp index 1aa2733414..0c835729f6 100644 --- a/protocols/GTalkExt/src/handlers.cpp +++ b/protocols/GTalkExt/src/handlers.cpp @@ -446,7 +446,7 @@ static void sttCreateInstance(LPCSTR szModuleName) GoogleTalkAcc *gta = new GoogleTalkAcc();
gta->m_japi = japi;
- gta->m_pa = ProtoGetAccount(szModuleName);
+ gta->m_pa = Proto_GetAccount(szModuleName);
g_accs.insert(gta);
// Google Shared Status (http://code.google.com/apis/talk/jep_extensions/shared_status.html)
@@ -467,7 +467,7 @@ int ModulesLoaded(WPARAM, LPARAM) {
int count;
PROTOACCOUNT **protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (int i = 0; i < count; i++)
sttCreateInstance(protos[i]->szModuleName);
diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp index e7813894c1..9f0dd6dbde 100644 --- a/protocols/GTalkExt/src/notifications.cpp +++ b/protocols/GTalkExt/src/notifications.cpp @@ -51,7 +51,7 @@ LPCSTR GetJidAcc(LPCTSTR jid) {
int count = 0;
PROTOACCOUNT **protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (int i = 0; i < count; i++) {
if (getJabberApi(protos[i]->szModuleName)) {
ptrT tszJid(db_get_tsa(0, protos[i]->szModuleName, "jid"));
@@ -171,7 +171,7 @@ MCONTACT SetupPseudocontact(LPCTSTR jid, LPCTSTR unreadCount, LPCSTR acc, LPCTST hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
db_set_dw(0, acc, PSEUDOCONTACT_LINK, hContact);
db_set_b(hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 1);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)acc);
+ Proto_AddToContact(hContact, acc);
}
// SetAvatar(hContact);
diff --git a/protocols/GTalkExt/src/options.cpp b/protocols/GTalkExt/src/options.cpp index b15eb53042..eb5286d7f5 100644 --- a/protocols/GTalkExt/src/options.cpp +++ b/protocols/GTalkExt/src/options.cpp @@ -241,7 +241,7 @@ int OptionsInitialization(WPARAM wParam, LPARAM) for (int i = 0; i < g_accs.getCount(); i++) {
LPCSTR szProto = g_accs[i]->m_pa->szModuleName;
- PROTOACCOUNT *pa = ProtoGetAccount(szProto);
+ PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (pa != NULL) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.ptszTitle = pa->tszAccountName;
diff --git a/protocols/GTalkExt/src/stdafx.h b/protocols/GTalkExt/src/stdafx.h index 00a2ea659e..86f1fdb01b 100644 --- a/protocols/GTalkExt/src/stdafx.h +++ b/protocols/GTalkExt/src/stdafx.h @@ -54,7 +54,6 @@ #include <m_langpack.h>
#include <m_protosvc.h>
#include <m_protocols.h>
-#include <m_protomod.h>
#include <m_protoint.h>
#include <m_options.h>
#include <m_utils.h>
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 0a4883ba4b..47b20cb21d 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -1543,7 +1543,7 @@ MCONTACT GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick) return NULL;
}
- if (CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName) != 0) {
+ if (Proto_AddToContact(hContact, m_szModuleName) != 0) {
// For some reason we failed to register the protocol for this contact
CallService(MS_DB_CONTACT_DELETE, hContact, 0);
debugLogA("getcontact(): Failed to register GG contact %d", uin);
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index 1d62a341fd..de7203f4d9 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -342,10 +342,9 @@ extern "C" int __declspec(dllexport) Load(void) pd.fnInit = (pfnInitProto)gg_proto_init;
pd.fnUninit = (pfnUninitProto)gg_proto_uninit;
pd.type = PROTOTYPE_PROTOCOL;
+ Proto_RegisterModule( &pd);
- // Register module
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM) &pd);
- gg_links_instancemenu_init();
+ gg_links_instancemenu_init();
return 0;
}
diff --git a/protocols/Gadu-Gadu/src/gg.h b/protocols/Gadu-Gadu/src/gg.h index a2b2525ef3..308946b7c1 100644 --- a/protocols/Gadu-Gadu/src/gg.h +++ b/protocols/Gadu-Gadu/src/gg.h @@ -50,7 +50,6 @@ #include <m_database.h>
#include <m_netlib.h>
#include <m_protocols.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_protoint.h>
#include <m_langpack.h>
diff --git a/protocols/ICQCorp/src/corp.cpp b/protocols/ICQCorp/src/corp.cpp index 08619f9d9f..e7652f349c 100644 --- a/protocols/ICQCorp/src/corp.cpp +++ b/protocols/ICQCorp/src/corp.cpp @@ -72,7 +72,7 @@ extern "C" __declspec(dllexport) int Load() PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
pd.szName = protoName;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
LoadServices();
return 0;
diff --git a/protocols/ICQCorp/src/corp.h b/protocols/ICQCorp/src/corp.h index 444f40382b..c703ee04ea 100644 --- a/protocols/ICQCorp/src/corp.h +++ b/protocols/ICQCorp/src/corp.h @@ -32,7 +32,6 @@ #include <newpluginapi.h>
#include <m_system.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_langpack.h>
#include <m_database.h>
diff --git a/protocols/ICQCorp/src/protocol.cpp b/protocols/ICQCorp/src/protocol.cpp index 1325126aa3..8a4967f5f1 100644 --- a/protocols/ICQCorp/src/protocol.cpp +++ b/protocols/ICQCorp/src/protocol.cpp @@ -1155,23 +1155,23 @@ void ICQ::updateContactList() //HANDLE hContact;
ICQUser *u;
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- proto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if (proto && !mir_strcmp(proto, protoName))
- {
- if ((u = getUserByContact(hContact)) == NULL)
- {
- u = new ICQUser();
- u->hContact = hContact;
- u->uin = db_get_dw(hContact, protoName, "UIN", 0);
- icqUsers.push_back(u);
- }
- if (statusVal <= ID_STATUS_OFFLINE) u->setStatus(ID_STATUS_OFFLINE);
- else u->statusVal = db_get_w(hContact, protoName, "Status", ID_STATUS_OFFLINE);
- }
- }
-
- if (statusVal <= ID_STATUS_OFFLINE) return;
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ proto = GetContactProto(hContact);
+ if (proto && !mir_strcmp(proto, protoName))
+ {
+ if ((u = getUserByContact(hContact)) == NULL)
+ {
+ u = new ICQUser();
+ u->hContact = hContact;
+ u->uin = db_get_dw(hContact, protoName, "UIN", 0);
+ icqUsers.push_back(u);
+ }
+ if (statusVal <= ID_STATUS_OFFLINE) u->setStatus(ID_STATUS_OFFLINE);
+ else u->statusVal = db_get_w(hContact, protoName, "Status", ID_STATUS_OFFLINE);
+ }
+ }
+
+ if (statusVal <= ID_STATUS_OFFLINE) return;
// create user info packet
@@ -1298,40 +1298,40 @@ void ICQ::updateUserList(ICQUser *u, char list, char add) ICQUser *ICQ::addUser(unsigned int uin, bool persistent)
{
- unsigned int i;
- ICQUser *u;
-
- for (i=0; i<icqUsers.size(); i++)
- {
- u = icqUsers[i];
- if (u->uin == uin)
- {
- if (persistent)
- {
- db_unset(u->hContact, "CList", "NotOnList");
- db_unset(u->hContact, "CList", "Hidden");
- }
- return u;
- }
- }
-
- u = new ICQUser();
- u->uin = uin;
+ unsigned int i;
+ ICQUser *u;
+
+ for (i=0; i<icqUsers.size(); i++)
+ {
+ u = icqUsers[i];
+ if (u->uin == uin)
+ {
+ if (persistent)
+ {
+ db_unset(u->hContact, "CList", "NotOnList");
+ db_unset(u->hContact, "CList", "Hidden");
+ }
+ return u;
+ }
+ }
+
+ u = new ICQUser();
+ u->uin = uin;
u->hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- icqUsers.push_back(u);
+ icqUsers.push_back(u);
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)u->hContact, (LPARAM)protoName);
- u->setInfo("UIN", uin);
+ Proto_AddToContact(u->hContact, protoName);
+ u->setInfo("UIN", uin);
- if (persistent) getUserInfo(u, true);
- else
- {
- db_set_b(u->hContact, "CList", "NotOnList", 1);
- db_set_b(u->hContact, "CList", "Hidden", 1);
- }
+ if (persistent) getUserInfo(u, true);
+ else
+ {
+ db_set_b(u->hContact, "CList", "NotOnList", 1);
+ db_set_b(u->hContact, "CList", "Hidden", 1);
+ }
- updateContactList();
- return u;
+ updateContactList();
+ return u;
}
///////////////////////////////////////////////////////////////////////////////
@@ -1814,7 +1814,7 @@ void ICQ::authorize(unsigned int uinToAuthorize) void ICQ::processTcpPacket(Packet &packet, unsigned int hSocket)
{
- unsigned int i, checkUin, senderIp, localIp, userStatus, senderPort, junkLong, thePort, theTCPSequence;
+ unsigned int i, checkUin, senderIp, localIp, userStatus, senderPort, junkLong, thePort, theTCPSequence = 0;
unsigned short version, command, junkShort, newCommand, /*messageLen,*/ cicqVersion;
unsigned char cicqChar, junkChar;
char *message = NULL;
@@ -2190,7 +2190,7 @@ void ICQ::addMessage(ICQUser *u, char *m, unsigned short theCmd, unsigned short pre.timestamp = t;
pre.szMessage = (char*)m;
pre.lParam = 0;
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ Proto_ChainRecv(0, &ccs);
}
///////////////////////////////////////////////////////////////////////////////
@@ -2217,7 +2217,7 @@ void ICQ::addUrl(ICQUser *u, char *m, unsigned short theCmd, unsigned short theS pre.timestamp = t;
pre.szMessage = url;
pre.lParam = 0;
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ Proto_ChainRecv(0, &ccs);
delete [] url;
}
@@ -2239,7 +2239,7 @@ void ICQ::addAwayMsg(ICQUser *u, char *m, unsigned short theCmd, unsigned short pre.timestamp = t;
pre.szMessage = (char*)m;
pre.lParam = theSequence;
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ Proto_ChainRecv(0, &ccs);
}
///////////////////////////////////////////////////////////////////////////////
@@ -2313,7 +2313,7 @@ void ICQ::addFileReq(ICQUser *u, char *m, char *filename, unsigned long size, un pre.timestamp = t;
pre.szMessage = szBlob;
pre.lParam = theSequence;
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ Proto_ChainRecv(0, &ccs);
delete [] szBlob;
diff --git a/protocols/ICQCorp/src/user.cpp b/protocols/ICQCorp/src/user.cpp index c70054e095..ba2fd4c2fb 100644 --- a/protocols/ICQCorp/src/user.cpp +++ b/protocols/ICQCorp/src/user.cpp @@ -140,20 +140,18 @@ static BOOL CALLBACK icqUserInfoDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR int icqUserInfoInitialise(WPARAM wParam, LPARAM lParam)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- char *proto;
-
- proto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, lParam, 0);
- if ((proto == NULL || mir_strcmp(proto, protoName)) && lParam) return 0;
-
- odp.position = -1900000000;
- odp.pszTitle = Translate(protoName);
- odp.pfnDlgProc = (DLGPROC)icqUserInfoDlgProc;
- odp.pszTemplate = MAKEINTRESOURCE(IDD_INFO_ICQCORP);
- odp.hInstance = hInstance;
+ char *proto = GetContactProto(lParam);
+ if ((proto == NULL || mir_strcmp(proto, protoName)) && lParam)
+ return 0;
+
+ OPTIONSDIALOGPAGE odp = { 0 };
+ odp.position = -1900000000;
+ odp.pszTitle = Translate(protoName);
+ odp.pfnDlgProc = (DLGPROC)icqUserInfoDlgProc;
+ odp.pszTemplate = MAKEINTRESOURCE(IDD_INFO_ICQCORP);
+ odp.hInstance = hInstance;
Options_AddPage(wParam, &odp);
-
- return 0;
+ return 0;
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp index 210024ffc0..8d6fac1a5c 100644 --- a/protocols/IRCG/src/clist.cpp +++ b/protocols/IRCG/src/clist.cpp @@ -99,7 +99,7 @@ MCONTACT CIrcProto::CList_AddContact(CONTACT *user, bool InList, bool SetOnline) // here we create a new one since no one is to be found
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (hContact) {
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
if (InList)
db_unset(hContact, "CList", "NotOnList");
diff --git a/protocols/IRCG/src/main.cpp b/protocols/IRCG/src/main.cpp index 7f91134cc1..accf27a448 100644 --- a/protocols/IRCG/src/main.cpp +++ b/protocols/IRCG/src/main.cpp @@ -101,7 +101,7 @@ extern "C" int __declspec(dllexport) Load() pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = (pfnInitProto)ircProtoInit;
pd.fnUninit = (pfnUninitProto)ircProtoUninit;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
return 0;
}
diff --git a/protocols/IRCG/src/stdafx.h b/protocols/IRCG/src/stdafx.h index 506f831ed8..8cdf9c96b7 100644 --- a/protocols/IRCG/src/stdafx.h +++ b/protocols/IRCG/src/stdafx.h @@ -45,7 +45,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "m_system.h"
#include "m_system_cpp.h"
#include "m_protocols.h"
-#include "m_protomod.h"
#include "m_protosvc.h"
#include "m_protoint.h"
#include "m_clist.h"
diff --git a/protocols/IcqOscarJ/src/init.cpp b/protocols/IcqOscarJ/src/init.cpp index a2d005fe47..ddaec0e16c 100644 --- a/protocols/IcqOscarJ/src/init.cpp +++ b/protocols/IcqOscarJ/src/init.cpp @@ -108,7 +108,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = icqProtoInit;
pd.fnUninit = icqProtoUninit;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
// Initialize charset conversion routines
InitI18N();
diff --git a/protocols/IcqOscarJ/src/stdafx.h b/protocols/IcqOscarJ/src/stdafx.h index 431c4dcf10..b28a33ae00 100644 --- a/protocols/IcqOscarJ/src/stdafx.h +++ b/protocols/IcqOscarJ/src/stdafx.h @@ -63,7 +63,6 @@ #include <m_message.h>
#include <m_netlib.h>
#include <m_protocols.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_options.h>
#include <m_system.h>
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index 3a5974df1a..9071a5a8bd 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -448,7 +448,7 @@ MCONTACT CIcqProto::HContactFromUIN(DWORD dwUin, int *Added) return INVALID_CONTACT_ID;
}
- if (CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName) != 0) {
+ if (Proto_AddToContact(hContact, m_szModuleName) != 0) {
// For some reason we failed to register the protocol to this contact
CallService(MS_DB_CONTACT_DELETE, hContact, 0);
debugLogA("Failed to register ICQ contact %u", dwUin);
@@ -514,7 +514,7 @@ MCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) debugLogA("Attempt to create ICQ contact by string <%s>", szUid);
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
setString(hContact, UNIQUEIDSETTING, szUid);
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp index 97d203b105..caedaddab5 100644 --- a/protocols/JabberG/src/jabber.cpp +++ b/protocols/JabberG/src/jabber.cpp @@ -212,7 +212,7 @@ extern "C" int __declspec(dllexport) Load() pd.fnInit = (pfnInitProto)jabberProtoInit;
pd.fnUninit = (pfnUninitProto)jabberProtoUninit;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
g_IconsInit();
g_XstatusIconsInit();
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index 4fe5a32f0c..6c9372874b 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -128,7 +128,7 @@ MCONTACT CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL }
MCONTACT hNewContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hNewContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hNewContact, m_szModuleName);
setTString(hNewContact, "jid", s);
if (nick != NULL && *nick != '\0')
setTString(hNewContact, "Nick", nick);
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index df78bae751..076e76aeca 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -301,7 +301,7 @@ MCONTACT CJabberProto::AddToListByJID(const TCHAR *newJid, DWORD flags) // not already there: add
debugLog(_T("Add new jid to contact jid = %s"), newJid);
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
setTString(hContact, "jid", newJid);
// Note that by removing or disable the "NotOnList" will trigger
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index 14e275df5c..93ef27846b 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -800,7 +800,7 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP int CJabberProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) { - if (!ProtoGetAccount(m_szModuleName)) + if (!Proto_GetAccount(m_szModuleName)) return 0; MCONTACT hContact = lParam; diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h index db155e7555..d92cad8c6c 100644 --- a/protocols/JabberG/src/stdafx.h +++ b/protocols/JabberG/src/stdafx.h @@ -81,7 +81,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_message.h>
#include <m_netlib.h>
#include <m_options.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_protoint.h>
#include <m_skin.h>
diff --git a/protocols/MRA/src/Mra.cpp b/protocols/MRA/src/Mra.cpp index a58b7b23ea..0acd463767 100644 --- a/protocols/MRA/src/Mra.cpp +++ b/protocols/MRA/src/Mra.cpp @@ -92,7 +92,7 @@ extern "C" __declspec(dllexport) int Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = (pfnInitProto)mraProtoInit;
pd.fnUninit = (pfnUninitProto)mraProtoUninit;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
return 0;
}
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index f7ef7aa58c..8197824146 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -543,7 +543,7 @@ MCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNe }
else {
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
}
if (hContact) {
@@ -711,7 +711,7 @@ bool IsHTTPSProxyUsed(HANDLE hNetlibUser) // определяет принадлежность контакта данной копии плагина
bool CMraProto::IsContactMra(MCONTACT hContact)
{
- return CallService(MS_PROTO_ISPROTOONCONTACT, hContact, (LPARAM)m_szModuleName) != 0;
+ return Proto_IsProtoOnContact(hContact, m_szModuleName) != 0;
}
// определяется является ли контакт контактом MRA протокола, не зависимо от того какому плагину он принадлежит
@@ -887,7 +887,9 @@ void CMraProto::ShowFormattedErrorMessage(LPWSTR lpwszErrText, DWORD dwErrorCode static void FakeThread(void* param)
{
Sleep(100);
- CallService(MS_PROTO_BROADCASTACK, 0, (LPARAM)param);
+
+ ACKDATA *ack = (ACKDATA*)param;
+ ProtoBroadcastAck(ack->szModule, ack->hContact, ack->type, ack->result, ack->hProcess, ack->lParam);
mir_free(param);
}
diff --git a/protocols/MRA/src/stdafx.h b/protocols/MRA/src/stdafx.h index 39d1253497..f5b3741957 100644 --- a/protocols/MRA/src/stdafx.h +++ b/protocols/MRA/src/stdafx.h @@ -32,7 +32,6 @@ #include <m_ignore.h>
#include <m_message.h>
#include <m_options.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_protoint.h>
#include <m_skin.h>
diff --git a/protocols/MSN/src/msn.cpp b/protocols/MSN/src/msn.cpp index 8f4200e74a..ec7f204449 100644 --- a/protocols/MSN/src/msn.cpp +++ b/protocols/MSN/src/msn.cpp @@ -122,7 +122,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.fnInit = (pfnInitProto)msnProtoInit;
pd.fnUninit = (pfnUninitProto)msnProtoUninit;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
MsnInitIcons();
MSN_InitContactMenu();
diff --git a/protocols/MSN/src/msn_contact.cpp b/protocols/MSN/src/msn_contact.cpp index bfa8f8253c..3c875990b7 100644 --- a/protocols/MSN/src/msn_contact.cpp +++ b/protocols/MSN/src/msn_contact.cpp @@ -37,7 +37,7 @@ MCONTACT CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick, if (hContact == NULL && addIfNeeded) {
int netId = (msc && msc->netId)?msc->netId:(szNet?atoi(szNet):NETID_MSN);
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
if (netId != NETID_SKYPE) setString(hContact, "e-mail", szEmail);
setStringUtf(hContact, "Nick", msnNick ? msnNick : szEmail);
setWord(hContact, "netId", netId);
diff --git a/protocols/MSN/src/stdafx.h b/protocols/MSN/src/stdafx.h index fa4a6f165a..5bdd6c9098 100644 --- a/protocols/MSN/src/stdafx.h +++ b/protocols/MSN/src/stdafx.h @@ -45,7 +45,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <m_message.h>
#include <m_options.h>
#include <m_protocols.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_protoint.h>
#include <m_skin.h>
diff --git a/protocols/MinecraftDynmap/src/main.cpp b/protocols/MinecraftDynmap/src/main.cpp index fd618ed8e9..9f60c4d084 100644 --- a/protocols/MinecraftDynmap/src/main.cpp +++ b/protocols/MinecraftDynmap/src/main.cpp @@ -98,7 +98,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL; pd.fnInit = protoInit; pd.fnUninit = protoUninit; - CallService(MS_PROTO_REGISTERMODULE, 0, reinterpret_cast<LPARAM>(&pd)); + Proto_RegisterModule(&pd); InitIcons(); diff --git a/protocols/Omegle/src/main.cpp b/protocols/Omegle/src/main.cpp index da8afbbcd6..fdc7d17897 100644 --- a/protocols/Omegle/src/main.cpp +++ b/protocols/Omegle/src/main.cpp @@ -100,7 +100,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = protoInit;
pd.fnUninit = protoUninit;
- CallService(MS_PROTO_REGISTERMODULE,0,reinterpret_cast<LPARAM>(&pd));
+ Proto_RegisterModule(&pd);
InitIcons();
//InitContactMenus();
diff --git a/protocols/Sametime/src/StdAfx.h b/protocols/Sametime/src/StdAfx.h index 7fbf8e695a..d1e286e1d4 100644 --- a/protocols/Sametime/src/StdAfx.h +++ b/protocols/Sametime/src/StdAfx.h @@ -65,7 +65,6 @@ extern "C" { #include <m_netlib.h>
#include <m_database.h>
#include <m_protocols.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_ignore.h>
#include <m_clui.h>
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index bf324f6528..d29923d882 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -271,7 +271,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.szName = "Sametime";
pd.fnInit = (pfnInitProto)sametime_proto_init;
pd.fnUninit = (pfnUninitProto)sametime_proto_uninit;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
return 0;
}
diff --git a/protocols/Sametime/src/userlist.cpp b/protocols/Sametime/src/userlist.cpp index a38c1e44d4..6db619e1d5 100644 --- a/protocols/Sametime/src/userlist.cpp +++ b/protocols/Sametime/src/userlist.cpp @@ -76,7 +76,7 @@ MCONTACT CSametimeProto::AddContact(mwSametimeUser* user, bool temporary) debugLog(_T("AddContact(): Failed to create Sametime contact"));
return NULL; ///TODO error handling
}
- if (CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName) != 0) {
+ if (Proto_AddToContact(hContact, m_szModuleName) != 0) {
CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
debugLog(_T("AddContact(): Failed to register Sametime contact"));
return NULL; ///TODO error handling
diff --git a/protocols/SkypeWeb/src/main.cpp b/protocols/SkypeWeb/src/main.cpp index ce02a8ea26..103306d981 100644 --- a/protocols/SkypeWeb/src/main.cpp +++ b/protocols/SkypeWeb/src/main.cpp @@ -68,7 +68,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = (pfnInitProto)CSkypeProto::InitAccount;
pd.fnUninit = (pfnUninitProto)CSkypeProto::UninitAccount;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
CSkypeProto::InitIcons();
CSkypeProto::InitMenus();
diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index 1afb872205..68b354d40c 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -90,7 +90,7 @@ MCONTACT CSkypeProto::AddContact(const char *skypename, bool isTemporary) if (!hContact)
{
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
setString(hContact, SKYPE_SETTINGS_ID, skypename);
diff --git a/protocols/SkypeWeb/src/stdafx.h b/protocols/SkypeWeb/src/stdafx.h index a4250c6e65..bdc07e528a 100644 --- a/protocols/SkypeWeb/src/stdafx.h +++ b/protocols/SkypeWeb/src/stdafx.h @@ -30,7 +30,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <newpluginapi.h>
#include <m_protoint.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_database.h>
diff --git a/protocols/Steam/src/main.cpp b/protocols/Steam/src/main.cpp index fa597983d9..5f67cea6a6 100644 --- a/protocols/Steam/src/main.cpp +++ b/protocols/Steam/src/main.cpp @@ -44,7 +44,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = (pfnInitProto)CSteamProto::InitProtoInstance;
pd.fnUninit = (pfnUninitProto)CSteamProto::UninitProtoInstance;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
char iconName[100];
mir_snprintf(iconName, SIZEOF(iconName), "%s_%s", MODULE, "gaming");
diff --git a/protocols/Steam/src/stdafx.h b/protocols/Steam/src/stdafx.h index 489c994784..7aecea533b 100644 --- a/protocols/Steam/src/stdafx.h +++ b/protocols/Steam/src/stdafx.h @@ -23,7 +23,6 @@ #include <m_freeimage.h>
#include <m_imgsrvc.h>
#include <m_protocols.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_protoint.h>
#include <m_idle.h>
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 72a5422e5a..f9a6b0c0c0 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -296,7 +296,7 @@ MCONTACT CSteamProto::AddContact(const char *steamId, bool isTemporary) { // create contact hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); - CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)this->m_szModuleName); + Proto_AddToContact(hContact, this->m_szModuleName); setString(hContact, "SteamID", steamId); diff --git a/protocols/Steam/src/steam_instances.cpp b/protocols/Steam/src/steam_instances.cpp index edd1eaef7f..d535e53b09 100644 --- a/protocols/Steam/src/steam_instances.cpp +++ b/protocols/Steam/src/steam_instances.cpp @@ -32,8 +32,7 @@ void CSteamProto::UninitProtoInstances() CSteamProto* CSteamProto::GetContactProtoInstance(MCONTACT hContact)
{
- char *proto = (char *)::CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0);
-
+ char *proto = GetContactProto(hContact);
if (proto == NULL)
return NULL;
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp index 077b6a5933..8ae89022a8 100644 --- a/protocols/Tlen/src/tlen.cpp +++ b/protocols/Tlen/src/tlen.cpp @@ -375,8 +375,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.fnInit = ( pfnInitProto )tlenProtoInit;
pd.fnUninit = ( pfnUninitProto )tlenProtoUninit;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM) &pd);
-
+ Proto_RegisterModule(&pd);
return 0;
}
diff --git a/protocols/Tlen/src/tlen.h b/protocols/Tlen/src/tlen.h index 2207ba640f..2c1f51c5f4 100644 --- a/protocols/Tlen/src/tlen.h +++ b/protocols/Tlen/src/tlen.h @@ -59,7 +59,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_system.h>
#include <m_system_cpp.h>
#include <m_netlib.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_protoint.h>
#include <m_contacts.h>
diff --git a/protocols/Tlen/src/tlen_misc.cpp b/protocols/Tlen/src/tlen_misc.cpp index fd868ecc5a..37692d98b1 100644 --- a/protocols/Tlen/src/tlen_misc.cpp +++ b/protocols/Tlen/src/tlen_misc.cpp @@ -46,7 +46,7 @@ void TlenDBAddAuthRequest(TlenProtocol *proto, char *jid, char *nick) if ((hContact=TlenHContactFromJID(proto, jid)) == NULL) {
hContact = (MCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)proto->m_szModuleName);
+ Proto_AddToContact(hContact, proto->m_szModuleName);
// strip resource if present
s = TlenLoginFromJID(jid);
_strlwr(s);
@@ -114,7 +114,7 @@ MCONTACT TlenDBCreateContact(TlenProtocol *proto, char *jid, char *nick, BOOL te if ((hContact=TlenHContactFromJID(proto, jid)) == NULL) {
hContact = (MCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)proto->m_szModuleName);
+ Proto_AddToContact(hContact, proto->m_szModuleName);
db_set_s(hContact, proto->m_szModuleName, "jid", jid);
if (nick != NULL && nick[0] != '\0')
db_set_s(hContact, proto->m_szModuleName, "Nick", nick);
diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp index a6adc2dc97..75dfe31c80 100644 --- a/protocols/Tlen/src/tlen_svc.cpp +++ b/protocols/Tlen/src/tlen_svc.cpp @@ -183,7 +183,7 @@ static MCONTACT AddToListByJID(TlenProtocol *proto, const char *newJid, DWORD fl // not already there: add
char *jid = mir_strdup(newJid); _strlwr(jid);
hContact = (MCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM) proto->m_szModuleName);
+ Proto_AddToContact(hContact, proto->m_szModuleName);
db_set_s(hContact, proto->m_szModuleName, "jid", jid);
char *nick=TlenNickFromJID(newJid);
if (nick == NULL)
diff --git a/protocols/Tlen/src/tlen_userinfo.cpp b/protocols/Tlen/src/tlen_userinfo.cpp index 453b0120c8..161bb926ae 100644 --- a/protocols/Tlen/src/tlen_userinfo.cpp +++ b/protocols/Tlen/src/tlen_userinfo.cpp @@ -127,7 +127,7 @@ static void FetchCombo(HWND hwndDlg, UINT idCtrl, char *fieldName, char **str, i int TlenProtocol::UserInfoInit(WPARAM wParam, LPARAM lParam)
{
- if (!ProtoGetAccount(m_szModuleName))
+ if (!Proto_GetAccount(m_szModuleName))
return 0;
MCONTACT hContact = (MCONTACT) lParam;
diff --git a/protocols/Tox/src/stdafx.h b/protocols/Tox/src/stdafx.h index 82ef5e31e3..3a5cfafe8b 100644 --- a/protocols/Tox/src/stdafx.h +++ b/protocols/Tox/src/stdafx.h @@ -17,7 +17,6 @@ #include <newpluginapi.h>
#include <m_protoint.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_database.h>
diff --git a/protocols/Tox/src/tox.cpp b/protocols/Tox/src/tox.cpp index f6c89d2a00..3643149fbd 100644 --- a/protocols/Tox/src/tox.cpp +++ b/protocols/Tox/src/tox.cpp @@ -49,7 +49,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = (pfnInitProto)CToxProto::InitAccount;
pd.fnUninit = (pfnUninitProto)CToxProto::UninitAccount;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
HookEvent(ME_SYSTEM_MODULESLOADED, &CToxProto::OnModulesLoaded);
diff --git a/protocols/Tox/src/tox_chatrooms.cpp b/protocols/Tox/src/tox_chatrooms.cpp index 27aa4c7444..629d46c510 100644 --- a/protocols/Tox/src/tox_chatrooms.cpp +++ b/protocols/Tox/src/tox_chatrooms.cpp @@ -24,7 +24,7 @@ MCONTACT CToxProto::AddChatRoom(int groupNumber) if (!hContact)
{
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
setWord(hContact, TOX_SETTINGS_CHAT_ID, groupNumber);
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index 532f23ab48..069f368990 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -69,7 +69,7 @@ MCONTACT CToxProto::AddContact(const char *address, const char *nick, const char if (!hContact)
{
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
setString(hContact, TOX_SETTINGS_ID, address);
@@ -376,7 +376,7 @@ void CToxProto::OnConnectionStatusChanged(Tox*, uint32_t friendNumber, TOX_CONNE int CToxProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam)
{
- if (!CallService(MS_PROTO_ISPROTOCOLLOADED, 0, (LPARAM)m_szModuleName))
+ if (!Proto_IsProtocolLoaded(m_szModuleName))
return 0;
MCONTACT hContact = lParam;
diff --git a/protocols/Twitter/src/contacts.cpp b/protocols/Twitter/src/contacts.cpp index 99e954b5f2..ccae792f37 100644 --- a/protocols/Twitter/src/contacts.cpp +++ b/protocols/Twitter/src/contacts.cpp @@ -237,7 +237,7 @@ MCONTACT TwitterProto::AddToClientList(const char *name, const char *status) // If not, make a new contact!
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (hContact) {
- if (CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName) == 0) {
+ if (Proto_AddToContact(hContact, m_szModuleName) == 0) {
db_set_s(hContact, m_szModuleName, TWITTER_KEY_UN, name);
db_set_w(hContact, m_szModuleName, "Status", ID_STATUS_ONLINE);
db_set_utf(hContact, "CList", "StatusMsg", status);
diff --git a/protocols/Twitter/src/main.cpp b/protocols/Twitter/src/main.cpp index 2503f64da5..58bc371096 100644 --- a/protocols/Twitter/src/main.cpp +++ b/protocols/Twitter/src/main.cpp @@ -96,7 +96,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = protoInit;
pd.fnUninit = protoUninit;
- CallService(MS_PROTO_REGISTERMODULE, 0, reinterpret_cast<LPARAM>(&pd));
+ Proto_RegisterModule(&pd);
InitIcons();
InitContactMenus();
diff --git a/protocols/Twitter/src/stdafx.h b/protocols/Twitter/src/stdafx.h index 9c12e052fa..2a2287db6b 100644 --- a/protocols/Twitter/src/stdafx.h +++ b/protocols/Twitter/src/stdafx.h @@ -52,7 +52,6 @@ typedef std::basic_string<TCHAR> tstring; #include <m_options.h>
#include <m_popup.h>
#include <m_protocols.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_protoint.h>
#include <m_skin.h>
diff --git a/protocols/VKontakte/src/main.cpp b/protocols/VKontakte/src/main.cpp index e6ff1af0b9..7974618a9b 100644 --- a/protocols/VKontakte/src/main.cpp +++ b/protocols/VKontakte/src/main.cpp @@ -81,7 +81,7 @@ extern "C" int __declspec(dllexport) Load() pd.fnInit = (pfnInitProto)vkProtoInit;
pd.fnUninit = (pfnUninitProto)vkProtoUninit;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
return 0;
}
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 0c6d23000a..85c2c6cbb0 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -263,7 +263,7 @@ MCONTACT CVkProto::FindUser(LONG dwUserid, bool bCreate) return NULL;
MCONTACT hNewContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hNewContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hNewContact, m_szModuleName);
setDword(hNewContact, "ID", dwUserid);
db_set_ts(hNewContact, "CList", "Group", m_defaultGroup);
return hNewContact;
diff --git a/protocols/VKontakte/src/stdafx.h b/protocols/VKontakte/src/stdafx.h index 0748199a1d..475b19372c 100644 --- a/protocols/VKontakte/src/stdafx.h +++ b/protocols/VKontakte/src/stdafx.h @@ -49,7 +49,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <m_message.h>
#include <m_netlib.h>
#include <m_options.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_protoint.h>
#include <m_skin.h>
diff --git a/protocols/WhatsApp/src/common.h b/protocols/WhatsApp/src/common.h index e3e1ceb679..c602a4fc09 100644 --- a/protocols/WhatsApp/src/common.h +++ b/protocols/WhatsApp/src/common.h @@ -54,7 +54,6 @@ Copyright © 2013-14 Uli Hecht #include <m_protocols.h>
#include <m_protosvc.h>
#include <m_protoint.h>
-#include <m_protomod.h>
#include <m_skin.h>
#include <m_string.h>
#include <statusmodes.h>
diff --git a/protocols/WhatsApp/src/contacts.cpp b/protocols/WhatsApp/src/contacts.cpp index 3756fded33..20c04040f0 100644 --- a/protocols/WhatsApp/src/contacts.cpp +++ b/protocols/WhatsApp/src/contacts.cpp @@ -36,7 +36,7 @@ MCONTACT WhatsAppProto::AddToContactList(const std::string &jid, const char *new if ((hContact = CallService(MS_DB_CONTACT_ADD, 0, 0)) == 0)
return INVALID_CONTACT_ID;
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
setString(hContact, "ID", jid.c_str());
debugLogA("Added contact %s", jid.c_str());
setString(hContact, "MirVer", "WhatsApp");
diff --git a/protocols/WhatsApp/src/main.cpp b/protocols/WhatsApp/src/main.cpp index 93abf0bbc0..5d0697d998 100644 --- a/protocols/WhatsApp/src/main.cpp +++ b/protocols/WhatsApp/src/main.cpp @@ -74,7 +74,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = protoInit;
pd.fnUninit = protoUninit;
- CallService(MS_PROTO_REGISTERMODULE, 0, reinterpret_cast<LPARAM>(&pd));
+ Proto_RegisterModule(&pd);
InitIcons();
//InitContactMenus();
diff --git a/protocols/Xfire/src/all_statusmsg.cpp b/protocols/Xfire/src/all_statusmsg.cpp index f5910b2df5..42936c9df0 100644 --- a/protocols/Xfire/src/all_statusmsg.cpp +++ b/protocols/Xfire/src/all_statusmsg.cpp @@ -57,7 +57,7 @@ BOOL BackupStatusMsg() { oltostatus = new vector < unsigned int > ;
//alle protokolle durchgehen und den status in den vector sichern
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&anz, (LPARAM)&temp);
+ Proto_EnumAccounts(&anz, &temp);
for (int i = 0; i < anz; i++)
{
statusid = CallProtoService(temp[i]->szModuleName, PS_GETSTATUS, 0, 0);
@@ -225,7 +225,7 @@ BOOL SetGameStatusMsg() statusMsg = statusmsg;
}
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&anz, (LPARAM)&temp);
+ Proto_EnumAccounts(&anz, &temp);
for (int i = 0; i < anz; i++)
{
if (olstatus->at(i) != -1)
@@ -290,7 +290,7 @@ BOOL SetOldStatusMsg() if (olstatusmsg == NULL)
return FALSE;
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&anz, (LPARAM)&temp);
+ Proto_EnumAccounts(&anz, &temp);
for (int i = 0; i < anz; i++)
{
if (olstatus->at(i) != -1)
diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index 9a2e1f51f0..fd04b1f76e 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -1053,8 +1053,7 @@ extern "C" __declspec(dllexport) int Load(void) PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
pd.szName = protocolname;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
-
+ Proto_RegisterModule(&pd);
hLogEvent = CreateHookableEvent("XFireProtocol/Log");
@@ -1592,7 +1591,7 @@ MCONTACT CList_AddContact(XFireContact xfc, bool InList, bool SetOnline, int cla // here we create a new one since no one is to be found
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (hContact) {
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)protocolname);
+ Proto_AddToContact(hContact, protocolname);
if (InList)
db_unset(hContact, "CList", "NotOnList");
diff --git a/protocols/Xfire/src/stdafx.h b/protocols/Xfire/src/stdafx.h index eb20af3e4d..f6cd6313c2 100644 --- a/protocols/Xfire/src/stdafx.h +++ b/protocols/Xfire/src/stdafx.h @@ -53,11 +53,9 @@ #include <m_clui.h>
#include <m_skin.h>
#include <m_langpack.h>
-#include <m_protomod.h>
#include <m_database.h>
#include <m_system.h>
#include <m_protocols.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_protoint.h>
#include <m_userinfo.h>
diff --git a/protocols/Yahoo/src/main.cpp b/protocols/Yahoo/src/main.cpp index 74d61a4fbc..ea336f0fd9 100644 --- a/protocols/Yahoo/src/main.cpp +++ b/protocols/Yahoo/src/main.cpp @@ -105,7 +105,7 @@ extern "C" int __declspec(dllexport)Load(void) pd.type = PROTOTYPE_PROTOCOL;
pd.fnInit = (pfnInitProto)yahooProtoInit;
pd.fnUninit = (pfnUninitProto)yahooProtoUninit;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
diff --git a/protocols/Yahoo/src/services.cpp b/protocols/Yahoo/src/services.cpp index d77b172cd6..5900aea998 100644 --- a/protocols/Yahoo/src/services.cpp +++ b/protocols/Yahoo/src/services.cpp @@ -13,7 +13,6 @@ #include "yahoo.h"
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_langpack.h>
#include <m_skin.h>
diff --git a/protocols/Yahoo/src/util.cpp b/protocols/Yahoo/src/util.cpp index 030599d82a..098eae59e7 100644 --- a/protocols/Yahoo/src/util.cpp +++ b/protocols/Yahoo/src/util.cpp @@ -13,7 +13,6 @@ #include "yahoo.h"
#include <windowsx.h>
#include <m_popup.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_langpack.h>
#include <m_skin.h>
diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index 394e979589..7e98c01909 100644 --- a/protocols/Yahoo/src/yahoo.cpp +++ b/protocols/Yahoo/src/yahoo.cpp @@ -262,7 +262,7 @@ MCONTACT CYahooProto::add_buddy(const char *yahoo_id, const char *yahoo_name, in //not already there: add
LOG(("[add_buddy] Adding buddy id: %s (Nick: %s), flags: %lu", yid, yahoo_name, flags));
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
+ Proto_AddToContact(hContact, m_szModuleName);
setString(hContact, YAHOO_LOGINID, yid);
Set_Protocol(hContact, protocol);
diff --git a/protocols/Yahoo/src/yahoo.h b/protocols/Yahoo/src/yahoo.h index 97c38e77ae..d90d1abcb7 100644 --- a/protocols/Yahoo/src/yahoo.h +++ b/protocols/Yahoo/src/yahoo.h @@ -35,7 +35,6 @@ #include <m_system_cpp.h>
#include <m_database.h>
-#include <m_protomod.h>
#include <m_netlib.h>
#include <m_idle.h>
#include <m_clist.h>
|