summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin10/lib/mir_core.libbin385594 -> 385874 bytes
-rw-r--r--bin10/lib/mir_core64.libbin388690 -> 388946 bytes
-rw-r--r--bin12/lib/mir_core.libbin385594 -> 385874 bytes
-rw-r--r--bin12/lib/mir_core64.libbin388690 -> 388946 bytes
-rw-r--r--include/m_core.h1
-rw-r--r--include/m_protomod.h14
-rw-r--r--plugins/AddContactPlus/src/addcontact.cpp6
-rw-r--r--plugins/ConnectionNotify/src/ConnectionNotify.cpp16
-rw-r--r--plugins/GmailNotifier/src/main.cpp6
-rw-r--r--plugins/IEView/src/Options.cpp9
-rw-r--r--plugins/LotusNotify/src/LotusNotify.cpp16
-rw-r--r--plugins/MenuItemEx/src/main.cpp2
-rw-r--r--plugins/Non-IM Contact/src/main.cpp8
-rw-r--r--plugins/StopSpamPlus/src/events.cpp2
-rw-r--r--plugins/WebView/src/main.cpp41
-rw-r--r--protocols/EmLanProto/src/amdproto.cpp41
-rw-r--r--protocols/ICQCorp/src/services.cpp542
-rw-r--r--protocols/IRCG/src/ircproto.cpp2
-rw-r--r--protocols/Tlen/src/tlen.h3
-rw-r--r--protocols/Tlen/src/tlen_svc.cpp17
-rw-r--r--src/core/stdauth/src/authdialogs.cpp8
-rw-r--r--src/mir_core/src/mir_core.def1
-rw-r--r--src/mir_core/src/mir_core64.def1
-rw-r--r--src/mir_core/src/modules.cpp8
-rw-r--r--src/modules/protocols/protoint.cpp2
25 files changed, 326 insertions, 420 deletions
diff --git a/bin10/lib/mir_core.lib b/bin10/lib/mir_core.lib
index 92ef0ea82b..cfca520b05 100644
--- a/bin10/lib/mir_core.lib
+++ b/bin10/lib/mir_core.lib
Binary files differ
diff --git a/bin10/lib/mir_core64.lib b/bin10/lib/mir_core64.lib
index 8c301e3aab..3ff897278e 100644
--- a/bin10/lib/mir_core64.lib
+++ b/bin10/lib/mir_core64.lib
Binary files differ
diff --git a/bin12/lib/mir_core.lib b/bin12/lib/mir_core.lib
index 92ef0ea82b..8904f185f4 100644
--- a/bin12/lib/mir_core.lib
+++ b/bin12/lib/mir_core.lib
Binary files differ
diff --git a/bin12/lib/mir_core64.lib b/bin12/lib/mir_core64.lib
index 8c301e3aab..1b69a48ad2 100644
--- a/bin12/lib/mir_core64.lib
+++ b/bin12/lib/mir_core64.lib
Binary files differ
diff --git a/include/m_core.h b/include/m_core.h
index efcde5e1c2..c70a79a7ab 100644
--- a/include/m_core.h
+++ b/include/m_core.h
@@ -104,6 +104,7 @@ MIR_CORE_DLL(HANDLE) CreateServiceFunction(const char *name, MIRANDASERVICE ser
MIR_CORE_DLL(HANDLE) CreateServiceFunctionParam(const char *name, MIRANDASERVICEPARAM serviceProc, LPARAM lParam);
MIR_CORE_DLL(HANDLE) CreateServiceFunctionObj(const char *name, MIRANDASERVICEOBJ serviceProc, void* object);
MIR_CORE_DLL(HANDLE) CreateServiceFunctionObjParam(const char *name, MIRANDASERVICEOBJPARAM serviceProc, void* object, LPARAM lParam);
+MIR_CORE_DLL(HANDLE) CreateProtoServiceFunction(const char *szModule, const char *szService, MIRANDASERVICE serviceProc);
MIR_CORE_DLL(int) DestroyServiceFunction(HANDLE hService);
MIR_CORE_DLL(int) ServiceExists(const char *name);
diff --git a/include/m_protomod.h b/include/m_protomod.h
index fcff1ac654..2a4abf55d6 100644
--- a/include/m_protomod.h
+++ b/include/m_protomod.h
@@ -61,20 +61,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//returns 0 on success, nonzero on failure
#define MS_PROTO_REMOVEFROMCONTACT "Proto/RemoveFromContact"
-//Create a protocol service
-//Protocol services are called with wParam and lParam as standard if they are
-//to be called with CallProtoServiceInt(NULL,) (as PS_ services are)
-//If they are called with CallContactService() (PSS_ and PSR_ services) then
-//they are called with lParam = (CCSDATA*)&ccs and wParam an opaque internal
-//reference that should be passed unchanged to MS_PROTO_CHAIN*.
-__forceinline HANDLE CreateProtoServiceFunction(const char *szModule, const char *szService, MIRANDASERVICE serviceProc)
-{
- char str[MAXMODULELABELLENGTH];
- mir_snprintf(str, sizeof(str), "%s%s", szModule, szService);
- str[MAXMODULELABELLENGTH-1] = 0;
- return CreateServiceFunction(str, serviceProc);
-}
-
//Call the next service in the chain for this send operation
//wParam = wParam
//lParam = lParam
diff --git a/plugins/AddContactPlus/src/addcontact.cpp b/plugins/AddContactPlus/src/addcontact.cpp
index b2e0741f56..2c301ebf20 100644
--- a/plugins/AddContactPlus/src/addcontact.cpp
+++ b/plugins/AddContactPlus/src/addcontact.cpp
@@ -296,9 +296,9 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM)
if (flags & PF4_NOCUSTOMAUTH)
CallContactService(hContact, PSS_AUTHREQUEST, 0, 0);
else {
- TCHAR szReason[512];
- GetDlgItemText(hdlg, IDC_AUTHREQ, szReason, SIZEOF(szReason));
- CallContactService(hContact, PSS_AUTHREQUEST, 0, (LPARAM)szReason);
+ TCHAR tszReason[512];
+ GetDlgItemText(hdlg, IDC_AUTHREQ, tszReason, SIZEOF(tszReason));
+ CallContactService(hContact, PSS_AUTHREQUEST, 0, (LPARAM)tszReason);
}
}
}
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp
index 387df80cda..4f2f4b5afc 100644
--- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp
+++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp
@@ -887,17 +887,11 @@ extern "C" int __declspec(dllexport) Load(void)
for (MCONTACT hContact = db_find_first(PLUGINNAME); hContact != NULL; hContact = db_find_next(hContact, PLUGINNAME))
db_set_w(hContact, PLUGINNAME, "status", ID_STATUS_OFFLINE);
- char service[100] = { "" };
- mir_snprintf(service, SIZEOF(service), "%s%s", PLUGINNAME, PS_GETCAPS);
- CreateServiceFunction(service, GetCaps);
- mir_snprintf(service, SIZEOF(service), "%s%s", PLUGINNAME, PS_GETNAME);
- CreateServiceFunction(service, GetName);
- mir_snprintf(service, SIZEOF(service), "%s%s", PLUGINNAME, PS_LOADICON);
- CreateServiceFunction(service, TMLoadIcon);
- mir_snprintf(service, SIZEOF(service), "%s%s", PLUGINNAME, PS_SETSTATUS);
- CreateServiceFunction(service, SetStatus);
- mir_snprintf(service, SIZEOF(service), "%s%s", PLUGINNAME, PS_GETSTATUS);
- CreateServiceFunction(service, GetStatus);
+ CreateProtoServiceFunction(PLUGINNAME, PS_GETCAPS, GetCaps);
+ CreateProtoServiceFunction(PLUGINNAME, PS_GETNAME, GetName);
+ CreateProtoServiceFunction(PLUGINNAME, PS_LOADICON, TMLoadIcon);
+ CreateProtoServiceFunction(PLUGINNAME, PS_SETSTATUS, SetStatus);
+ CreateProtoServiceFunction(PLUGINNAME, PS_GETSTATUS, GetStatus);
SkinAddNewSoundEx(PLUGINNAME_NEWSOUND, PLUGINNAME, LPGEN("New Connection Notification"));
hOptInit = HookEvent(ME_OPT_INITIALISE, ConnectionNotifyOptInit);//register service to hook option call
diff --git a/plugins/GmailNotifier/src/main.cpp b/plugins/GmailNotifier/src/main.cpp
index 992b2cc633..dc749998b4 100644
--- a/plugins/GmailNotifier/src/main.cpp
+++ b/plugins/GmailNotifier/src/main.cpp
@@ -95,9 +95,9 @@ extern "C" int __declspec(dllexport) Load()
pd.type = PROTOTYPE_VIRTUAL;
CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
- CreateServiceFunction(pluginName PS_GETCAPS, GetCaps);
- CreateServiceFunction(pluginName PS_GETSTATUS, GetStatus);
- CreateServiceFunction(pluginName PS_GETNAME, GetName);
+ CreateProtoServiceFunction(pluginName, PS_GETCAPS, GetCaps);
+ CreateProtoServiceFunction(pluginName, PS_GETSTATUS, GetStatus);
+ CreateProtoServiceFunction(pluginName, PS_GETNAME, GetName);
CreateServiceFunction("GmailMNotifier/Notifying", Notifying);
opt.circleTime = db_get_dw(NULL, pluginName, "circleTime", 30);
diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp
index fb4aa2b3fd..1ae24e9dfd 100644
--- a/plugins/IEView/src/Options.cpp
+++ b/plugins/IEView/src/Options.cpp
@@ -381,14 +381,11 @@ static void RefreshProtoList(HWND hwndDlg, int mode, bool protoTemplates)
tvi.hInsertAfter = TVI_LAST;
tvi.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_STATE | TVIF_SELECTEDIMAGE;
tvi.item.stateMask = TVIS_SELECTED | TVIS_STATEIMAGEMASK;
- if (i == 0) {
+ if (i == 0)
mir_strcpy(protoName, Translate("Default"));
- }
- else {
+ else
CallProtoService(proto->getProtocolName(), PS_GETNAME, sizeof(protoName), (LPARAM)protoName);
- // mir_strcat(protoName, " ");
- // mir_strcat(protoName, Translate("protocol"));
- }
+
tvi.item.pszText = mir_a2t(protoName);
tvi.item.lParam = (LPARAM)proto;
tvi.item.iImage = i;
diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp
index 4faf246e76..a83b42f0a5 100644
--- a/plugins/LotusNotify/src/LotusNotify.cpp
+++ b/plugins/LotusNotify/src/LotusNotify.cpp
@@ -1638,17 +1638,11 @@ extern "C" int __declspec(dllexport) Load(void)
db_set_w(hContact, PLUGINNAME, "status", ID_STATUS_OFFLINE);
}
- char service[100] = {""};
- mir_snprintf(service, SIZEOF(service), "%s%s", PLUGINNAME, PS_GETCAPS);
- CreateServiceFunction(service, GetCaps);
- mir_snprintf(service, SIZEOF(service), "%s%s", PLUGINNAME, PS_GETNAME);
- CreateServiceFunction(service, GetName);
- mir_snprintf(service, SIZEOF(service), "%s%s", PLUGINNAME, PS_LOADICON);
- CreateServiceFunction(service, TMLoadIcon);
- mir_snprintf(service, SIZEOF(service), "%s%s", PLUGINNAME, PS_SETSTATUS);
- CreateServiceFunction(service, SetStatus);
- mir_snprintf(service, SIZEOF(service), "%s%s", PLUGINNAME, PS_GETSTATUS);
- CreateServiceFunction(service, GetStatus);
+ CreateProtoServiceFunction(PLUGINNAME, PS_GETCAPS, GetCaps);
+ CreateProtoServiceFunction(PLUGINNAME, PS_GETNAME, GetName);
+ CreateProtoServiceFunction(PLUGINNAME, PS_LOADICON, TMLoadIcon);
+ CreateProtoServiceFunction(PLUGINNAME, PS_SETSTATUS, SetStatus);
+ CreateProtoServiceFunction(PLUGINNAME, PS_GETSTATUS, GetStatus);
LoadSettings(); //read from db to variables
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp
index 202a4589c5..b75ad82428 100644
--- a/plugins/MenuItemEx/src/main.cpp
+++ b/plugins/MenuItemEx/src/main.cpp
@@ -427,7 +427,7 @@ INT_PTR onSendAuthRequest(WPARAM wparam, LPARAM)
DWORD flags = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0);
if (flags&PF4_NOCUSTOMAUTH)
- CallContactService(hContact, PSS_AUTHREQUEST, 0, (LPARAM)"");
+ CallContactService(hContact, PSS_AUTHREQUEST, 0, (LPARAM)_T(""));
else
CreateDialogParam(hinstance, MAKEINTRESOURCE(IDD_AUTHREQ), (HWND)CallService(MS_CLUI_GETHWND, 0, 0), AuthReqWndProc, (LPARAM)hContact);
diff --git a/plugins/Non-IM Contact/src/main.cpp b/plugins/Non-IM Contact/src/main.cpp
index 08143c5f62..76bdd444de 100644
--- a/plugins/Non-IM Contact/src/main.cpp
+++ b/plugins/Non-IM Contact/src/main.cpp
@@ -128,10 +128,10 @@ extern "C" __declspec(dllexport) int Load()
CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
//load services (the first 5 are the basic ones needed to make a new protocol)
- CreateServiceFunction(MODNAME PS_GETCAPS, GetLCCaps);
- CreateServiceFunction(MODNAME PS_GETNAME, GetLCName);
- CreateServiceFunction(MODNAME PS_LOADICON, LoadLCIcon);
- CreateServiceFunction(MODNAME PS_GETSTATUS, GetLCStatus);
+ CreateProtoServiceFunction(MODNAME, PS_GETCAPS, GetLCCaps);
+ CreateProtoServiceFunction(MODNAME, PS_GETNAME, GetLCName);
+ CreateProtoServiceFunction(MODNAME, PS_LOADICON, LoadLCIcon);
+ CreateProtoServiceFunction(MODNAME, PS_GETSTATUS, GetLCStatus);
CreateServiceFunction("AddLCcontact", addContact);
CreateServiceFunction("EditLCcontact", editContact);
diff --git a/plugins/StopSpamPlus/src/events.cpp b/plugins/StopSpamPlus/src/events.cpp
index a70e70d0aa..ce63fdc878 100644
--- a/plugins/StopSpamPlus/src/events.cpp
+++ b/plugins/StopSpamPlus/src/events.cpp
@@ -33,7 +33,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam)
// ...send message
char *AuthRepl = mir_u2a(variables_parse(plSets->AuthRepl.Get(), hcntct).c_str());
- ProtoCallService(dbei.szModule, PS_AUTHDENY, (WPARAM)hDbEvent, (LPARAM)AuthRepl);
+ ProtoCallService(dbei.szModule, PS_AUTHDENY, hDbEvent, (LPARAM)AuthRepl);
mir_free(AuthRepl);
db_set_b(hcntct, "CList", "NotOnList", 1);
diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp
index 1495f107ff..1e3ff4bd07 100644
--- a/plugins/WebView/src/main.cpp
+++ b/plugins/WebView/src/main.cpp
@@ -48,39 +48,14 @@ PLUGININFOEX pluginInfoEx = {
/*****************************************************************************/
void InitServices()
{
- char SvcFunc[100];
-
- mir_strcpy(SvcFunc, MODULENAME);
- mir_strcat(SvcFunc, PS_GETCAPS);
- CreateServiceFunction(SvcFunc, GetCaps);
-
- mir_strcpy(SvcFunc, MODULENAME);
- mir_strcat(SvcFunc, PS_GETNAME);
- CreateServiceFunction(SvcFunc, GetName);
-
- mir_strcpy(SvcFunc, MODULENAME);
- mir_strcat(SvcFunc, PS_LOADICON);
- CreateServiceFunction(SvcFunc, BPLoadIcon);
-
- mir_strcpy(SvcFunc, MODULENAME);
- mir_strcat(SvcFunc, PS_SETSTATUS);
- CreateServiceFunction(SvcFunc, SetStatus);
-
- mir_strcpy(SvcFunc, MODULENAME);
- mir_strcat(SvcFunc, PS_GETSTATUS);
- CreateServiceFunction(SvcFunc, GetStatus);
- //
- mir_strcpy(SvcFunc, MODULENAME);
- mir_strcat(SvcFunc, PS_BASICSEARCH);
- CreateServiceFunction(SvcFunc, BasicSearch);
-
- mir_strcpy(SvcFunc, MODULENAME);
- mir_strcat(SvcFunc, PS_ADDTOLIST);
- CreateServiceFunction(SvcFunc, AddToList);
-
- mir_strcpy(SvcFunc, MODULENAME);
- mir_strcat(SvcFunc, PSS_GETINFO);
- CreateServiceFunction(SvcFunc, GetInfo);
+ CreateProtoServiceFunction(MODULENAME, PS_GETCAPS, GetCaps);
+ CreateProtoServiceFunction(MODULENAME, PS_GETNAME, GetName);
+ CreateProtoServiceFunction(MODULENAME, PS_LOADICON, BPLoadIcon);
+ CreateProtoServiceFunction(MODULENAME, PS_SETSTATUS, SetStatus);
+ CreateProtoServiceFunction(MODULENAME, PS_GETSTATUS, GetStatus);
+ CreateProtoServiceFunction(MODULENAME, PS_BASICSEARCH, BasicSearch);
+ CreateProtoServiceFunction(MODULENAME, PS_ADDTOLIST, AddToList);
+ CreateProtoServiceFunction(MODULENAME, PSS_GETINFO, GetInfo);
}
/*****************************************************************************/
diff --git a/protocols/EmLanProto/src/amdproto.cpp b/protocols/EmLanProto/src/amdproto.cpp
index 2186c18e55..ec6c441374 100644
--- a/protocols/EmLanProto/src/amdproto.cpp
+++ b/protocols/EmLanProto/src/amdproto.cpp
@@ -356,27 +356,26 @@ extern "C" int __declspec(dllexport) __cdecl Load()
pd.type = PROTOTYPE_PROTOCOL;
CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
- CreateServiceFunction(PROTONAME PS_GETCAPS, EMPGetCaps);
- CreateServiceFunction(PROTONAME PS_GETNAME, EMPGetName);
- CreateServiceFunction(PROTONAME PS_LOADICON, EMPLoadIcon);
- CreateServiceFunction(PROTONAME PS_SETSTATUS, EMPSetStatus);
- CreateServiceFunction(PROTONAME PS_GETSTATUS, EMPGetStatus);
- CreateServiceFunction(PROTONAME PS_BASICSEARCH, EMPBasicSearch);
- CreateServiceFunction(PROTONAME PS_ADDTOLIST, EMPAddToList);
- CreateServiceFunction(PROTONAME PSS_MESSAGE, EMPSendMessage);
- CreateServiceFunction(PROTONAME PSS_URL, EMPSendUrl);
- CreateServiceFunction(PROTONAME PSR_MESSAGE, EMPRecvMessageUrl);
- CreateServiceFunction(PROTONAME PSR_URL, EMPRecvMessageUrl);
- CreateServiceFunction(PROTONAME PSS_GETAWAYMSG, EMPGetAwayMsg);
- CreateServiceFunction(PROTONAME PS_SETAWAYMSG, EMPSetAwayMsg);
- CreateServiceFunction(PROTONAME PSR_AWAYMSG, EMPRecvAwayMessage);
-
- CreateServiceFunction(PROTONAME PS_FILERESUME, EMPFileResume);
- CreateServiceFunction(PROTONAME PSS_FILEALLOW, EMPSendFileAllow);
- CreateServiceFunction(PROTONAME PSS_FILEDENY, EMPSendFileDeny);
- CreateServiceFunction(PROTONAME PSS_FILECANCEL, EMPSendFileCancel);
- CreateServiceFunction(PROTONAME PSS_FILE, EMPSendFile);
- CreateServiceFunction(PROTONAME PSR_FILE, EMPRecvFile);
+ CreateProtoServiceFunction(PROTONAME, PS_GETCAPS, EMPGetCaps);
+ CreateProtoServiceFunction(PROTONAME, PS_GETNAME, EMPGetName);
+ CreateProtoServiceFunction(PROTONAME, PS_LOADICON, EMPLoadIcon);
+ CreateProtoServiceFunction(PROTONAME, PS_SETSTATUS, EMPSetStatus);
+ CreateProtoServiceFunction(PROTONAME, PS_GETSTATUS, EMPGetStatus);
+ CreateProtoServiceFunction(PROTONAME, PS_BASICSEARCH, EMPBasicSearch);
+ CreateProtoServiceFunction(PROTONAME, PS_ADDTOLIST, EMPAddToList);
+ CreateProtoServiceFunction(PROTONAME, PSS_MESSAGE, EMPSendMessage);
+ CreateProtoServiceFunction(PROTONAME, PSS_URL, EMPSendUrl);
+ CreateProtoServiceFunction(PROTONAME, PSR_MESSAGE, EMPRecvMessageUrl);
+ CreateProtoServiceFunction(PROTONAME, PSR_URL, EMPRecvMessageUrl);
+ CreateProtoServiceFunction(PROTONAME, PSS_GETAWAYMSG, EMPGetAwayMsg);
+ CreateProtoServiceFunction(PROTONAME, PS_SETAWAYMSG, EMPSetAwayMsg);
+ CreateProtoServiceFunction(PROTONAME, PSR_AWAYMSG, EMPRecvAwayMessage);
+ CreateProtoServiceFunction(PROTONAME, PS_FILERESUME, EMPFileResume);
+ CreateProtoServiceFunction(PROTONAME, PSS_FILEALLOW, EMPSendFileAllow);
+ CreateProtoServiceFunction(PROTONAME, PSS_FILEDENY, EMPSendFileDeny);
+ CreateProtoServiceFunction(PROTONAME, PSS_FILECANCEL, EMPSendFileCancel);
+ CreateProtoServiceFunction(PROTONAME, PSS_FILE, EMPSendFile);
+ CreateProtoServiceFunction(PROTONAME, PSR_FILE, EMPRecvFile);
g_heOptions = HookEvent(ME_OPT_INITIALISE,EMPCreateOptionsDlg);
diff --git a/protocols/ICQCorp/src/services.cpp b/protocols/ICQCorp/src/services.cpp
index ee34dc062f..5eb8bed4d3 100644
--- a/protocols/ICQCorp/src/services.cpp
+++ b/protocols/ICQCorp/src/services.cpp
@@ -23,260 +23,245 @@
static INT_PTR icqGetCaps(WPARAM wParam, LPARAM lParam)
{
- switch (wParam)
- {
- case PFLAGNUM_1:
- return PF1_IM|PF1_URL|PF1_FILE|PF1_MODEMSG|PF1_AUTHREQ|PF1_ADDED|PF1_PEER2PEER|PF1_BASICSEARCH|PF1_EXTSEARCH|PF1_CANRENAMEFILE|PF1_FILERESUME|PF1_ADDSEARCHRES|PF1_SEARCHBYEMAIL|PF1_SEARCHBYNAME|PF1_NUMERICUSERID;
+ switch (wParam) {
+ case PFLAGNUM_1:
+ return PF1_IM|PF1_URL|PF1_FILE|PF1_MODEMSG|PF1_AUTHREQ|PF1_ADDED|PF1_PEER2PEER|PF1_BASICSEARCH|PF1_EXTSEARCH|PF1_CANRENAMEFILE|PF1_FILERESUME|PF1_ADDSEARCHRES|PF1_SEARCHBYEMAIL|PF1_SEARCHBYNAME|PF1_NUMERICUSERID;
- case PFLAGNUM_2:
- return PF2_ONLINE|PF2_INVISIBLE|PF2_SHORTAWAY|PF2_LONGAWAY|PF2_LIGHTDND|PF2_HEAVYDND|PF2_FREECHAT;
+ case PFLAGNUM_2:
+ return PF2_ONLINE|PF2_INVISIBLE|PF2_SHORTAWAY|PF2_LONGAWAY|PF2_LIGHTDND|PF2_HEAVYDND|PF2_FREECHAT;
- case PFLAGNUM_3:
- return PF2_SHORTAWAY|PF2_LONGAWAY|PF2_LIGHTDND|PF2_HEAVYDND|PF2_FREECHAT;
+ case PFLAGNUM_3:
+ return PF2_SHORTAWAY|PF2_LONGAWAY|PF2_LIGHTDND|PF2_HEAVYDND|PF2_FREECHAT;
- case PFLAG_UNIQUEIDTEXT:
- return (int)Translate("ICQ number:");
+ case PFLAG_UNIQUEIDTEXT:
+ return (int)Translate("ICQ number:");
case PFLAG_UNIQUEIDSETTING:
return (int)"UIN";
- }
- return 0;
+ }
+ return 0;
}
///////////////////////////////////////////////////////////////////////////////
static INT_PTR icqGetName(WPARAM wParam, LPARAM lParam)
{
- strncpy((char*)lParam, Translate(protoName), wParam);
- return 0;
+ strncpy((char*)lParam, Translate(protoName), wParam);
+ return 0;
}
///////////////////////////////////////////////////////////////////////////////
static INT_PTR icqLoadIcon(WPARAM wParam, LPARAM lParam)
{
- unsigned int id;
-
- switch (wParam & 0xFFFF)
- {
- case PLI_PROTOCOL: id = IDI_ICQCORP; break;
- default: return (int)(HICON)NULL;
- }
- return (int)LoadImage(hInstance, MAKEINTRESOURCE(id), IMAGE_ICON, GetSystemMetrics(wParam & PLIF_SMALL ? SM_CXSMICON : SM_CXICON), GetSystemMetrics(wParam & PLIF_SMALL ? SM_CYSMICON : SM_CYICON), 0);
+ unsigned int id;
+
+ switch (wParam & 0xFFFF)
+ {
+ case PLI_PROTOCOL: id = IDI_ICQCORP; break;
+ default: return (int)(HICON)NULL;
+ }
+ return (int)LoadImage(hInstance, MAKEINTRESOURCE(id), IMAGE_ICON, GetSystemMetrics(wParam & PLIF_SMALL ? SM_CXSMICON : SM_CXICON), GetSystemMetrics(wParam & PLIF_SMALL ? SM_CYSMICON : SM_CYICON), 0);
}
///////////////////////////////////////////////////////////////////////////////
static INT_PTR icqSetStatus(WPARAM wParam, LPARAM lParam)
{
- unsigned short desiredStatus = (unsigned short)wParam;
-
- T("[ ] set status\n");
-
- // on change status to online set away msg not calling
- if (desiredStatus == ID_STATUS_ONLINE) icq.awayMessage[0] = 0;
-
- if (icq.desiredStatus == desiredStatus) return 0;
- if (desiredStatus == ID_STATUS_OFFLINE)
- {
- icq.desiredStatus = desiredStatus;
- icq.logoff(false);
- }
- else
- {
- if (icq.statusVal == ID_STATUS_OFFLINE) icq.logon(desiredStatus);
- else icq.setStatus(desiredStatus);
- }
- return 0;
+ unsigned short desiredStatus = (unsigned short)wParam;
+
+ T("[ ] set status\n");
+
+ // on change status to online set away msg not calling
+ if (desiredStatus == ID_STATUS_ONLINE) icq.awayMessage[0] = 0;
+
+ if (icq.desiredStatus == desiredStatus) return 0;
+ if (desiredStatus == ID_STATUS_OFFLINE)
+ {
+ icq.desiredStatus = desiredStatus;
+ icq.logoff(false);
+ }
+ else
+ {
+ if (icq.statusVal == ID_STATUS_OFFLINE) icq.logon(desiredStatus);
+ else icq.setStatus(desiredStatus);
+ }
+ return 0;
}
///////////////////////////////////////////////////////////////////////////////
static INT_PTR icqGetStatus(WPARAM wParam, LPARAM lParam)
{
- return icq.statusVal;
+ return icq.statusVal;
}
///////////////////////////////////////////////////////////////////////////////
static INT_PTR icqAuthAllow(WPARAM wParam, LPARAM lParam)
{
-// DBEVENTINFO dbei;
- //DWORD uin;
-/*
- if (!icqOnline) return 1;
- ZeroMemory(&dbei, sizeof(dbei));
- dbei.cbSize = sizeof(dbei);
- dbei.cbBlob = sizeof(DWORD);
- dbei.pBlob = (PBYTE)&uin;
- if (CallService(MS_DB_EVENT_GET, wParam, (LPARAM)&dbei)) return 1;
- if (dbei.eventType != EVENTTYPE_AUTHREQUEST) return 1;
- if (mir_strcmp(dbei.szModule, ICQOSCPROTONAME)) return 1;
- if (uin <= 1) return 1;
- icq_sendAuthGrantedServ(uin);
-*/
- return 0;
+ return 0;
}
///////////////////////////////////////////////////////////////////////////////
static INT_PTR icqAuthDeny(WPARAM wParam, LPARAM lParam)
{
- return 0;
+ return 0;
}
///////////////////////////////////////////////////////////////////////////////
static INT_PTR icqBasicSearch(WPARAM wParam, LPARAM lParam)
{
- T("[ ] basic search\n");
- icq.startSearch(0, 0, (char*)lParam, 0);
- return 1;
+ T("[ ] basic search\n");
+ icq.startSearch(0, 0, (char*)lParam, 0);
+ return 1;
}
///////////////////////////////////////////////////////////////////////////////
static INT_PTR icqSearchByEmail(WPARAM wParam, LPARAM lParam)
{
- T("[ ] search by e-mail\n");
- icq.startSearch(4, 0, (char*)lParam, 0);
- return 1;
+ T("[ ] search by e-mail\n");
+ icq.startSearch(4, 0, (char*)lParam, 0);
+ return 1;
}
///////////////////////////////////////////////////////////////////////////////
static INT_PTR icqSearchByName(WPARAM wParam, LPARAM lParam)
{
- PROTOSEARCHBYNAME *psbn = (PROTOSEARCHBYNAME*)lParam;
+ PROTOSEARCHBYNAME *psbn = (PROTOSEARCHBYNAME*)lParam;
- T("[ ] search by name\n");
- icq.startSearch(1, 0, psbn->pszNick, 0);
- return 1;
+ T("[ ] search by name\n");
+ icq.startSearch(1, 0, psbn->pszNick, 0);
+ return 1;
}
///////////////////////////////////////////////////////////////////////////////
static INT_PTR icqAddToList(WPARAM wParam, LPARAM lParam)
{
- ICQSEARCHRESULT *isr = (ICQSEARCHRESULT *)lParam;
- bool persistent = (wParam & PALF_TEMPORARY) == 0;
+ ICQSEARCHRESULT *isr = (ICQSEARCHRESULT *)lParam;
+ bool persistent = (wParam & PALF_TEMPORARY) == 0;
- T("[ ] add user to list\n");
- if (isr->hdr.cbSize != sizeof(ICQSEARCHRESULT) || isr->uin == icq.uin) return NULL;
- return (int)icq.addUser(isr->uin, persistent)->hContact;
+ T("[ ] add user to list\n");
+ if (isr->hdr.cbSize != sizeof(ICQSEARCHRESULT) || isr->uin == icq.uin) return NULL;
+ return (int)icq.addUser(isr->uin, persistent)->hContact;
}
///////////////////////////////////////////////////////////////////////////////
static INT_PTR icqGetInfo(WPARAM wParam, LPARAM lParam)
{
- CCSDATA *ccs = (CCSDATA *)lParam;
- ICQUser *u;
+ CCSDATA *ccs = (CCSDATA *)lParam;
+ ICQUser *u;
- T("[ ] get user info\n");
+ T("[ ] get user info\n");
- u = icq.getUserByContact(ccs->hContact);
- if (u == NULL || icq.statusVal <= ID_STATUS_OFFLINE) return 1;
+ u = icq.getUserByContact(ccs->hContact);
+ if (u == NULL || icq.statusVal <= ID_STATUS_OFFLINE) return 1;
- icq.getUserInfo(u, ccs->wParam & SGIF_MINIMAL);
- return 0;
+ icq.getUserInfo(u, ccs->wParam & SGIF_MINIMAL);
+ return 0;
}
///////////////////////////////////////////////////////////////////////////////
static INT_PTR icqSendMessage(WPARAM wParam, LPARAM lParam)
{
- CCSDATA *ccs = (CCSDATA *)lParam;
- ICQUser *u;
- ICQEvent *icqEvent;
+ CCSDATA *ccs = (CCSDATA *)lParam;
+ ICQUser *u;
+ ICQEvent *icqEvent;
- T("[ ] send message\n");
+ T("[ ] send message\n");
- u = icq.getUserByContact(ccs->hContact);
-// uin = db_get_dw(ccs->hContact, ICQCORP_PROTONAME, "UIN", 0);
- if (u == NULL || icq.statusVal <= ID_STATUS_OFFLINE) return 0;
+ u = icq.getUserByContact(ccs->hContact);
+ // uin = db_get_dw(ccs->hContact, ICQCORP_PROTONAME, "UIN", 0);
+ if (u == NULL || icq.statusVal <= ID_STATUS_OFFLINE) return 0;
- icqEvent = icq.sendMessage(u, (char*)ccs->lParam);
- return icqEvent ? icqEvent->sequence : 0;
+ icqEvent = icq.sendMessage(u, (char*)ccs->lParam);
+ return icqEvent ? icqEvent->sequence : 0;
}
///////////////////////////////////////////////////////////////////////////////
static INT_PTR icqRecvMessage(WPARAM wParam, LPARAM lParam)
{
- DBEVENTINFO dbei;
- CCSDATA *ccs = (CCSDATA*)lParam;
- PROTORECVEVENT *pre = (PROTORECVEVENT*)ccs->lParam;
-
- T("[ ] recieve message\n");
-
- db_unset(ccs->hContact, "CList", "Hidden");
- ZeroMemory(&dbei, sizeof(dbei));
- dbei.cbSize = sizeof(dbei);
- dbei.szModule = protoName;
- dbei.timestamp = pre->timestamp;
- dbei.flags = pre->flags & (PREF_CREATEREAD ? DBEF_READ : 0);
- dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.cbBlob = mir_tstrlen(pre->szMessage) + 1;
- dbei.pBlob = (PBYTE)pre->szMessage;
+ DBEVENTINFO dbei;
+ CCSDATA *ccs = (CCSDATA*)lParam;
+ PROTORECVEVENT *pre = (PROTORECVEVENT*)ccs->lParam;
+
+ T("[ ] recieve message\n");
+
+ db_unset(ccs->hContact, "CList", "Hidden");
+ ZeroMemory(&dbei, sizeof(dbei));
+ dbei.cbSize = sizeof(dbei);
+ dbei.szModule = protoName;
+ dbei.timestamp = pre->timestamp;
+ dbei.flags = pre->flags & (PREF_CREATEREAD ? DBEF_READ : 0);
+ dbei.eventType = EVENTTYPE_MESSAGE;
+ dbei.cbBlob = (DWORD)mir_tstrlen(pre->szMessage) + 1;
+ dbei.pBlob = (PBYTE)pre->szMessage;
db_event_add(ccs->hContact, &dbei);
- return 0;
+ return 0;
}
///////////////////////////////////////////////////////////////////////////////
static INT_PTR icqSendUrl(WPARAM wParam, LPARAM lParam)
{
- CCSDATA *ccs = (CCSDATA *)lParam;
- ICQUser *u;
- ICQEvent *icqEvent;
+ CCSDATA *ccs = (CCSDATA *)lParam;
+ ICQUser *u;
+ ICQEvent *icqEvent;
- T("[ ] send url\n");
+ T("[ ] send url\n");
- u = icq.getUserByContact(ccs->hContact);
-// uin = db_get_dw(ccs->hContact, ICQCORP_PROTONAME, "UIN", 0);
- if (u == NULL || icq.statusVal <= ID_STATUS_OFFLINE) return 0;
+ u = icq.getUserByContact(ccs->hContact);
+ if (u == NULL || icq.statusVal <= ID_STATUS_OFFLINE)
+ return 0;
- icqEvent = icq.sendUrl(u, (char*)ccs->lParam);
- return icqEvent ? icqEvent->sequence : 0;
+ icqEvent = icq.sendUrl(u, (char*)ccs->lParam);
+ return icqEvent ? icqEvent->sequence : 0;
}
///////////////////////////////////////////////////////////////////////////////
static INT_PTR icqRecvUrl(WPARAM wParam, LPARAM lParam)
{
- DBEVENTINFO dbei;
- CCSDATA *ccs = (CCSDATA*)lParam;
- PROTORECVEVENT *pre = (PROTORECVEVENT*)ccs->lParam;
- char *pszDescr;
-
- T("[ ] recieve url\n");
-
- db_unset(ccs->hContact, "CList", "Hidden");
- pszDescr = pre->szMessage + mir_tstrlen(pre->szMessage) + 1;
- ZeroMemory(&dbei, sizeof(dbei));
- dbei.cbSize = sizeof(dbei);
- dbei.szModule = protoName;
- dbei.timestamp = pre->timestamp;
- dbei.flags = pre->flags & (PREF_CREATEREAD ? DBEF_READ : 0);
- dbei.eventType = EVENTTYPE_URL;
- dbei.cbBlob = mir_tstrlen(pre->szMessage) + mir_tstrlen(pszDescr) + 2;
- dbei.pBlob = (PBYTE)pre->szMessage;
+ DBEVENTINFO dbei;
+ CCSDATA *ccs = (CCSDATA*)lParam;
+ PROTORECVEVENT *pre = (PROTORECVEVENT*)ccs->lParam;
+ char *pszDescr;
+
+ T("[ ] recieve url\n");
+
+ db_unset(ccs->hContact, "CList", "Hidden");
+ pszDescr = pre->szMessage + mir_tstrlen(pre->szMessage) + 1;
+ ZeroMemory(&dbei, sizeof(dbei));
+ dbei.cbSize = sizeof(dbei);
+ dbei.szModule = protoName;
+ dbei.timestamp = pre->timestamp;
+ dbei.flags = pre->flags & (PREF_CREATEREAD ? DBEF_READ : 0);
+ dbei.eventType = EVENTTYPE_URL;
+ dbei.cbBlob = (DWORD)(mir_tstrlen(pre->szMessage) + mir_tstrlen(pszDescr) + 2);
+ dbei.pBlob = (PBYTE)pre->szMessage;
db_event_add(ccs->hContact, &dbei);
- return 0;
+ return 0;
}
///////////////////////////////////////////////////////////////////////////////
static INT_PTR icqSetAwayMsg(WPARAM wParam, LPARAM lParam)
{
- T("[ ] set away msg\n");
+ T("[ ] set away msg\n");
- if (lParam == NULL) return 0;
+ if (lParam == NULL) return 0;
- if (icq.awayMessage) delete [] icq.awayMessage;
- icq.awayMessage = new char[mir_strlen((char*)lParam) + 1];
- mir_strcpy(icq.awayMessage, (char*)lParam);
+ if (icq.awayMessage) delete [] icq.awayMessage;
+ icq.awayMessage = new char[mir_strlen((char*)lParam) + 1];
+ mir_strcpy(icq.awayMessage, (char*)lParam);
return 0;
}
@@ -286,16 +271,16 @@ static INT_PTR icqSetAwayMsg(WPARAM wParam, LPARAM lParam)
static INT_PTR icqGetAwayMsg(WPARAM wParam, LPARAM lParam)
{
CCSDATA *ccs = (CCSDATA *)lParam;
- ICQUser *u;
- ICQEvent *icqEvent;
+ ICQUser *u;
+ ICQEvent *icqEvent;
- T("[ ] send get away msg\n");
+ T("[ ] send get away msg\n");
- u = icq.getUserByContact(ccs->hContact);
- if (u == NULL || u->statusVal <= ID_STATUS_ONLINE) return 0;
+ u = icq.getUserByContact(ccs->hContact);
+ if (u == NULL || u->statusVal <= ID_STATUS_ONLINE) return 0;
- icqEvent = icq.sendReadAwayMsg(u);
- return icqEvent ? icqEvent->sequence : 0;
+ icqEvent = icq.sendReadAwayMsg(u);
+ return icqEvent ? icqEvent->sequence : 0;
}
///////////////////////////////////////////////////////////////////////////////
@@ -305,7 +290,7 @@ static INT_PTR icqRecvAwayMsg(WPARAM wParam, LPARAM lParam)
CCSDATA *ccs = (CCSDATA *)lParam;
PROTORECVEVENT *pre = (PROTORECVEVENT *)ccs->lParam;
- T("[ ] recieve away message\n");
+ T("[ ] recieve away message\n");
ProtoBroadcastAck(protoName, ccs->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)pre->lParam, (LPARAM)pre->szMessage);
return 0;
@@ -317,42 +302,42 @@ static INT_PTR icqSendFile(WPARAM wParam, LPARAM lParam)
{
CCSDATA *ccs = (CCSDATA *)lParam;
char **files = (char **)ccs->lParam;
- //HANDLE hFile;
- ICQUser *u;
+ //HANDLE hFile;
+ ICQUser *u;
- T("[ ] send file\n");
+ T("[ ] send file\n");
- u = icq.getUserByContact(ccs->hContact);
- if (u == NULL || u->statusVal == ID_STATUS_OFFLINE || icq.statusVal <= ID_STATUS_OFFLINE) return 0;
+ u = icq.getUserByContact(ccs->hContact);
+ if (u == NULL || u->statusVal == ID_STATUS_OFFLINE || icq.statusVal <= ID_STATUS_OFFLINE) return 0;
- unsigned long filesCount, directoriesCount, filesSize = 0;
- char filename[MAX_PATH], format[32];
- WIN32_FIND_DATA findData;
+ unsigned long filesCount, directoriesCount, filesSize = 0;
+ char filename[MAX_PATH], format[32];
+ WIN32_FIND_DATA findData;
for (filesCount=0,directoriesCount=0; files[filesCount]; filesCount++)
- {
- FindClose(FindFirstFile(files[filesCount], &findData));
- if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) directoriesCount++;
- else filesSize += findData.nFileSizeLow;
- }
- filesCount -= directoriesCount;
-
- if (directoriesCount)
- {
- sprintf(format, "%s, %s", filesCount == 1 ? Translate("%d file") : Translate("%d files"), directoriesCount == 1 ? Translate("%d directory") : Translate("%d directories"));
- sprintf(filename, format, filesCount, directoriesCount);
- }
- else
- {
- if (filesCount == 1)
- {
- char *p = strrchr(files[0], '\\');
- mir_strcpy(filename, p ? p+1 : files[0]);
- }
- else sprintf(filename, filesCount == 1 ? Translate("%d file") : Translate("%d files"), filesCount);
- }
-
- return (int)icq.sendFile(u, (char*)ccs->wParam, filename, filesSize, files);
+ {
+ FindClose(FindFirstFile(files[filesCount], &findData));
+ if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) directoriesCount++;
+ else filesSize += findData.nFileSizeLow;
+ }
+ filesCount -= directoriesCount;
+
+ if (directoriesCount)
+ {
+ sprintf(format, "%s, %s", filesCount == 1 ? Translate("%d file") : Translate("%d files"), directoriesCount == 1 ? Translate("%d directory") : Translate("%d directories"));
+ sprintf(filename, format, filesCount, directoriesCount);
+ }
+ else
+ {
+ if (filesCount == 1)
+ {
+ char *p = strrchr(files[0], '\\');
+ mir_strcpy(filename, p ? p+1 : files[0]);
+ }
+ else sprintf(filename, filesCount == 1 ? Translate("%d file") : Translate("%d files"), filesCount);
+ }
+
+ return (int)icq.sendFile(u, (char*)ccs->wParam, filename, filesSize, files);
}
///////////////////////////////////////////////////////////////////////////////
@@ -360,18 +345,18 @@ static INT_PTR icqSendFile(WPARAM wParam, LPARAM lParam)
static INT_PTR icqFileAllow(WPARAM wParam, LPARAM lParam)
{
CCSDATA *ccs = (CCSDATA *)lParam;
- ICQTransfer *t = (ICQTransfer *)ccs->wParam;
- ICQUser *u;
+ ICQTransfer *t = (ICQTransfer *)ccs->wParam;
+ ICQUser *u;
- T("[ ] send accept file request\n");
+ T("[ ] send accept file request\n");
- u = icq.getUserByContact(ccs->hContact);
- if (u == NULL || u->statusVal == ID_STATUS_OFFLINE) return 0;
+ u = icq.getUserByContact(ccs->hContact);
+ if (u == NULL || u->statusVal == ID_STATUS_OFFLINE) return 0;
- t->path = _strdup((char*)ccs->lParam);
+ t->path = _strdup((char*)ccs->lParam);
icq.acceptFile(u, t->sequence, (char*)ccs->lParam);
- return (int)t;
+ return (int)t;
}
///////////////////////////////////////////////////////////////////////////////
@@ -379,28 +364,28 @@ static INT_PTR icqFileAllow(WPARAM wParam, LPARAM lParam)
static INT_PTR icqFileDeny(WPARAM wParam, LPARAM lParam)
{
CCSDATA *ccs = (CCSDATA *)lParam;
- ICQTransfer *t = (ICQTransfer *)ccs->wParam;
- ICQUser *u;
+ ICQTransfer *t = (ICQTransfer *)ccs->wParam;
+ ICQUser *u;
- T("[ ] send refuse file request\n");
+ T("[ ] send refuse file request\n");
- u = icq.getUserByContact(ccs->hContact);
- if (u == NULL || u->statusVal == ID_STATUS_OFFLINE) return 0;
+ u = icq.getUserByContact(ccs->hContact);
+ if (u == NULL || u->statusVal == ID_STATUS_OFFLINE) return 0;
icq.refuseFile(u, t->sequence, (char*)ccs->lParam);
- unsigned int i;
- for (i=0; i<icqTransfers.size(); i++)
- {
- if (icqTransfers[i] == t)
- {
- delete icqTransfers[i];
- icqTransfers[i] = icqTransfers[icqTransfers.size() - 1];
- icqTransfers.pop_back();
- break;
- }
- }
- return 0;
+ unsigned int i;
+ for (i=0; i<icqTransfers.size(); i++)
+ {
+ if (icqTransfers[i] == t)
+ {
+ delete icqTransfers[i];
+ icqTransfers[i] = icqTransfers[icqTransfers.size() - 1];
+ icqTransfers.pop_back();
+ break;
+ }
+ }
+ return 0;
}
///////////////////////////////////////////////////////////////////////////////
@@ -408,28 +393,28 @@ static INT_PTR icqFileDeny(WPARAM wParam, LPARAM lParam)
static INT_PTR icqFileCancel(WPARAM wParam, LPARAM lParam)
{
CCSDATA *ccs = (CCSDATA *)lParam;
- ICQTransfer *t = (ICQTransfer *)ccs->wParam;
- ICQUser *u;
-
- T("[ ] file cancel\n");
-
- u = icq.getUserByContact(ccs->hContact);
- if (u == NULL || u->statusVal == ID_STATUS_OFFLINE) return 0;
-
-// icq.refuseFile(u, t->sequence, (char*)ccs->lParam);
-
- unsigned int i;
- for (i=0; i<icqTransfers.size(); i++)
- {
- if (icqTransfers[i] == t)
- {
- delete icqTransfers[i];
- icqTransfers[i] = icqTransfers[icqTransfers.size() - 1];
- icqTransfers.pop_back();
- break;
- }
- }
- return 0;
+ ICQTransfer *t = (ICQTransfer *)ccs->wParam;
+ ICQUser *u;
+
+ T("[ ] file cancel\n");
+
+ u = icq.getUserByContact(ccs->hContact);
+ if (u == NULL || u->statusVal == ID_STATUS_OFFLINE) return 0;
+
+ // icq.refuseFile(u, t->sequence, (char*)ccs->lParam);
+
+ unsigned int i;
+ for (i=0; i<icqTransfers.size(); i++)
+ {
+ if (icqTransfers[i] == t)
+ {
+ delete icqTransfers[i];
+ icqTransfers[i] = icqTransfers[icqTransfers.size() - 1];
+ icqTransfers.pop_back();
+ break;
+ }
+ }
+ return 0;
}
///////////////////////////////////////////////////////////////////////////////
@@ -441,7 +426,7 @@ static INT_PTR icqRecvFile(WPARAM wParam, LPARAM lParam)
PROTORECVEVENT *pre = (PROTORECVEVENT *)ccs->lParam;
char *szDesc, *szFile;
- T("[ ] recieve file\n");
+ T("[ ] recieve file\n");
db_unset(ccs->hContact, "CList", "Hidden");
@@ -466,39 +451,39 @@ static INT_PTR icqRecvFile(WPARAM wParam, LPARAM lParam)
static INT_PTR icqFileResume(WPARAM wParam, LPARAM lParam)
{
PROTOFILERESUME *pfr = (PROTOFILERESUME*)lParam;
- ICQTransfer *t = (ICQTransfer *)wParam;
+ ICQTransfer *t = (ICQTransfer *)wParam;
- T("[ ] send file resume\n");
- t->resume(pfr->action, pfr->szFilename);
+ T("[ ] send file resume\n");
+ t->resume(pfr->action, pfr->szFilename);
- return 0;
+ return 0;
}
///////////////////////////////////////////////////////////////////////////////
static INT_PTR icqSetApparentMode(WPARAM wParam, LPARAM lParam)
{
-/*
+ /*
CCSDATA *ccs = (CCSDATA *)lParam;
int oldMode, newMode = ccs->wParam;
- ICQUser *u;
+ ICQUser *u;
- u = icq.getUserByContact(ccs->hContact);
- if (u == NULL) return 1;
+ u = icq.getUserByContact(ccs->hContact);
+ if (u == NULL) return 1;
- oldMode = db_get_w(u->hContact, ICQCORP_PROTONAME, "ApparentMode", 0);
- if (newMode == oldMode) return 1;
+ oldMode = db_get_w(u->hContact, ICQCORP_PROTONAME, "ApparentMode", 0);
+ if (newMode == oldMode) return 1;
- T("[ ] set apparent mode\n");
+ T("[ ] set apparent mode\n");
- if (newMode == ID_STATUS_ONLINE || newMode == ID_STATUS_OFFLINE) db_set_w(u->hContact, ICQCORP_PROTONAME, "ApparentMode", (WORD)newMode);
- else db_unset(u->hContact, ICQCORP_PROTONAME, "ApparentMode");
+ if (newMode == ID_STATUS_ONLINE || newMode == ID_STATUS_OFFLINE) db_set_w(u->hContact, ICQCORP_PROTONAME, "ApparentMode", (WORD)newMode);
+ else db_unset(u->hContact, ICQCORP_PROTONAME, "ApparentMode");
if (icq.statusVal <= ID_STATUS_OFFLINE) return 0;
- if (oldMode != 0) icq.updateUserList(u, oldMode == ID_STATUS_OFFLINE ? 1 : 2, 0);
- if (newMode != 0) icq.updateUserList(u, newMode == ID_STATUS_OFFLINE ? 1 : 2, 1);
-*/
+ if (oldMode != 0) icq.updateUserList(u, oldMode == ID_STATUS_OFFLINE ? 1 : 2, 0);
+ if (newMode != 0) icq.updateUserList(u, newMode == ID_STATUS_OFFLINE ? 1 : 2, 1);
+ */
return 0;
}
@@ -506,73 +491,60 @@ static INT_PTR icqSetApparentMode(WPARAM wParam, LPARAM lParam)
static int icqContactDeleted(WPARAM wParam, LPARAM lParam)
{
- ICQUser *u;
+ ICQUser *u;
- T("[ ] contact deleted\n");
+ T("[ ] contact deleted\n");
if ((u = icq.getUserByContact((MCONTACT)wParam)) != NULL) icq.removeUser(u);
- return 0;
+ return 0;
}
///////////////////////////////////////////////////////////////////////////////
static int icqModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- HookEvent(ME_USERINFO_INITIALISE, icqUserInfoInitialise);
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
-char *CreateServiceName(char *serviceName, char *functionName)
-{
- mir_strcpy(serviceName, protoName);
- mir_strcat(serviceName, functionName);
-
- return serviceName;
+ HookEvent(ME_USERINFO_INITIALISE, icqUserInfoInitialise);
+ return 0;
}
///////////////////////////////////////////////////////////////////////////////
int LoadServices()
{
- char serviceName[MAX_PATH + 30];
-
if (!icq.load()) return 1;
HookEvent(ME_DB_CONTACT_DELETED, icqContactDeleted);
HookEvent(ME_OPT_INITIALISE, icqOptionsInitialise);
HookEvent(ME_SYSTEM_MODULESLOADED, icqModulesLoaded);
- CreateServiceFunction(CreateServiceName(serviceName, PS_GETCAPS), icqGetCaps);
- CreateServiceFunction(CreateServiceName(serviceName, PS_GETNAME), icqGetName);
- CreateServiceFunction(CreateServiceName(serviceName, PS_LOADICON), icqLoadIcon);
- CreateServiceFunction(CreateServiceName(serviceName, PS_SETSTATUS), icqSetStatus);
- CreateServiceFunction(CreateServiceName(serviceName, PS_GETSTATUS), icqGetStatus);
- CreateServiceFunction(CreateServiceName(serviceName, PS_SETAWAYMSG), icqSetAwayMsg);
- CreateServiceFunction(CreateServiceName(serviceName, PS_AUTHALLOW), icqAuthAllow);
- CreateServiceFunction(CreateServiceName(serviceName, PS_AUTHDENY), icqAuthDeny);
- CreateServiceFunction(CreateServiceName(serviceName, PS_BASICSEARCH), icqBasicSearch);
- CreateServiceFunction(CreateServiceName(serviceName, PS_SEARCHBYEMAIL), icqSearchByEmail);
- CreateServiceFunction(CreateServiceName(serviceName, PS_SEARCHBYNAME), icqSearchByName);
- CreateServiceFunction(CreateServiceName(serviceName, PS_ADDTOLIST), icqAddToList);
- CreateServiceFunction(CreateServiceName(serviceName, PS_FILERESUME), icqFileResume);
-
- CreateServiceFunction(CreateServiceName(serviceName, PSS_GETINFO), icqGetInfo);
- CreateServiceFunction(CreateServiceName(serviceName, PSS_MESSAGE), icqSendMessage);
- CreateServiceFunction(CreateServiceName(serviceName, PSS_URL), icqSendUrl);
- CreateServiceFunction(CreateServiceName(serviceName, PSS_GETAWAYMSG), icqGetAwayMsg);
- CreateServiceFunction(CreateServiceName(serviceName, PSS_FILE), icqSendFile);
- CreateServiceFunction(CreateServiceName(serviceName, PSS_FILEALLOW), icqFileAllow);
- CreateServiceFunction(CreateServiceName(serviceName, PSS_FILEDENY), icqFileDeny);
- CreateServiceFunction(CreateServiceName(serviceName, PSS_FILECANCEL), icqFileCancel);
- CreateServiceFunction(CreateServiceName(serviceName, PSS_SETAPPARENTMODE), icqSetApparentMode);
-
- CreateServiceFunction(CreateServiceName(serviceName, PSR_MESSAGE), icqRecvMessage);
- CreateServiceFunction(CreateServiceName(serviceName, PSR_URL), icqRecvUrl);
- CreateServiceFunction(CreateServiceName(serviceName, PSR_AWAYMSG), icqRecvAwayMsg);
- CreateServiceFunction(CreateServiceName(serviceName, PSR_FILE), icqRecvFile);
-
+ CreateProtoServiceFunction(protoName, PS_GETCAPS, icqGetCaps);
+ CreateProtoServiceFunction(protoName, PS_GETNAME, icqGetName);
+ CreateProtoServiceFunction(protoName, PS_LOADICON, icqLoadIcon);
+ CreateProtoServiceFunction(protoName, PS_SETSTATUS, icqSetStatus);
+ CreateProtoServiceFunction(protoName, PS_GETSTATUS, icqGetStatus);
+ CreateProtoServiceFunction(protoName, PS_SETAWAYMSG, icqSetAwayMsg);
+ CreateProtoServiceFunction(protoName, PS_AUTHALLOW, icqAuthAllow);
+ CreateProtoServiceFunction(protoName, PS_AUTHDENY, icqAuthDeny);
+ CreateProtoServiceFunction(protoName, PS_BASICSEARCH, icqBasicSearch);
+ CreateProtoServiceFunction(protoName, PS_SEARCHBYEMAIL, icqSearchByEmail);
+ CreateProtoServiceFunction(protoName, PS_SEARCHBYNAME, icqSearchByName);
+ CreateProtoServiceFunction(protoName, PS_ADDTOLIST, icqAddToList);
+ CreateProtoServiceFunction(protoName, PS_FILERESUME, icqFileResume);
+
+ CreateProtoServiceFunction(protoName, PSS_GETINFO, icqGetInfo);
+ CreateProtoServiceFunction(protoName, PSS_MESSAGE, icqSendMessage);
+ CreateProtoServiceFunction(protoName, PSS_URL, icqSendUrl);
+ CreateProtoServiceFunction(protoName, PSS_GETAWAYMSG, icqGetAwayMsg);
+ CreateProtoServiceFunction(protoName, PSS_FILE, icqSendFile);
+ CreateProtoServiceFunction(protoName, PSS_FILEALLOW, icqFileAllow);
+ CreateProtoServiceFunction(protoName, PSS_FILEDENY, icqFileDeny);
+ CreateProtoServiceFunction(protoName, PSS_FILECANCEL, icqFileCancel);
+ CreateProtoServiceFunction(protoName, PSS_SETAPPARENTMODE, icqSetApparentMode);
+
+ CreateProtoServiceFunction(protoName, PSR_MESSAGE, icqRecvMessage);
+ CreateProtoServiceFunction(protoName, PSR_URL, icqRecvUrl);
+ CreateProtoServiceFunction(protoName, PSR_AWAYMSG, icqRecvAwayMsg);
+ CreateProtoServiceFunction(protoName, PSR_FILE, icqRecvFile);
return 0;
}
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index c6526f815d..aa744eb914 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -692,8 +692,6 @@ int __cdecl CIrcProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
return 0;
}
- int codepage = getCodepage();
-
TCHAR *result;
mir_utf8decode(NEWSTR_ALLOCA(pszSrc), &result);
PostIrcMessageWnd(NULL, hContact, result);
diff --git a/protocols/Tlen/src/tlen.h b/protocols/Tlen/src/tlen.h
index 1923125e1f..2207ba640f 100644
--- a/protocols/Tlen/src/tlen.h
+++ b/protocols/Tlen/src/tlen.h
@@ -218,8 +218,6 @@ struct TlenProtocol : public PROTO<TlenProtocol>
virtual int __cdecl Authorize(MEVENT hDbEvent);
virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR* szReason);
- virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage);
virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath);
virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer);
@@ -235,7 +233,6 @@ struct TlenProtocol : public PROTO<TlenProtocol>
virtual HWND __cdecl SearchAdvanced(HWND owner);
virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
- virtual int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT*);
virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILET*);
virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*);
virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT*);
diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp
index 915fa2d7b5..427dec1869 100644
--- a/protocols/Tlen/src/tlen_svc.cpp
+++ b/protocols/Tlen/src/tlen_svc.cpp
@@ -1169,23 +1169,6 @@ int TlenProtocol::OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lPara
return 1;
}
-// PSS_ADDED
-int TlenProtocol::AuthRecv(MCONTACT hContact, PROTORECVEVENT* evt)
-{
- return 1;
-}
-
-// PSS_AUTHREQUEST
-int TlenProtocol::AuthRequest(MCONTACT hContact, const TCHAR* szMessage)
-{
- return 1;
-}
-
-int TlenProtocol::RecvContacts(MCONTACT hContact, PROTORECVEVENT* evt)
-{
- return 1;
-}
-
extern INT_PTR CALLBACK TlenAccMgrUIDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR TlenProtocol::AccMgrUI(WPARAM wParam, LPARAM lParam)
diff --git a/src/core/stdauth/src/authdialogs.cpp b/src/core/stdauth/src/authdialogs.cpp
index 5de5cb0cf3..a1a7897249 100644
--- a/src/core/stdauth/src/authdialogs.cpp
+++ b/src/core/stdauth/src/authdialogs.cpp
@@ -264,11 +264,11 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
db_event_get(hDbEvent, &dbei);
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_DENYREASON))) {
- TCHAR szReason[256];
- GetDlgItemText(hwndDlg, IDC_DENYREASON, szReason, SIZEOF(szReason));
- CallProtoService(dbei.szModule, PS_AUTHDENY, (WPARAM)hDbEvent, (LPARAM)szReason);
+ TCHAR tszReason[256];
+ GetDlgItemText(hwndDlg, IDC_DENYREASON, tszReason, SIZEOF(tszReason));
+ CallProtoService(dbei.szModule, PS_AUTHDENY, hDbEvent, (LPARAM)tszReason);
}
- else CallProtoService(dbei.szModule, PS_AUTHDENY, (WPARAM)hDbEvent, 0);
+ else CallProtoService(dbei.szModule, PS_AUTHDENY, hDbEvent, 0);
}
DestroyWindow(hwndDlg);
break;
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index 838a1d4b0b..1157f2edb5 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -1239,3 +1239,4 @@ Proto_RegisterModule @1074 NONAME
??BJSONNode@@QBE_NXZ @1246 NONAME
?as_mstring@JSONNode@@QBE?AV?$CMStringT@_WV?$ChTraitsCRT@_W@@@@XZ @1247 NONAME
BmpFilterGetStrings @1248
+CreateProtoServiceFunction @1249
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index 248599e8b9..9018911b8b 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -1239,3 +1239,4 @@ Proto_RegisterModule @1074 NONAME
??BJSONNode@@QEBA_NXZ @1246 NONAME
?as_mstring@JSONNode@@QEBA?AV?$CMStringT@_WV?$ChTraitsCRT@_W@@@@XZ @1247 NONAME
BmpFilterGetStrings @1248
+CreateProtoServiceFunction @1249
diff --git a/src/mir_core/src/modules.cpp b/src/mir_core/src/modules.cpp
index e9a79be6b7..51a953e934 100644
--- a/src/mir_core/src/modules.cpp
+++ b/src/mir_core/src/modules.cpp
@@ -489,6 +489,14 @@ MIR_CORE_DLL(HANDLE) CreateServiceFunctionObjParam(const char *name, MIRANDASERV
return CreateServiceInt(3, name, (MIRANDASERVICE)serviceProc, object, lParam);
}
+MIR_CORE_DLL(HANDLE) CreateProtoServiceFunction(const char *szModule, const char *szService, MIRANDASERVICE serviceProc)
+{
+ char str[MAXMODULELABELLENGTH * 2];
+ strncpy_s(str, szModule, _TRUNCATE);
+ strncat_s(str, szService, _TRUNCATE);
+ return CreateServiceFunction(str, serviceProc);
+}
+
MIR_CORE_DLL(int) DestroyServiceFunction(HANDLE hService)
{
mir_cslock lck(csServices);
diff --git a/src/modules/protocols/protoint.cpp b/src/modules/protocols/protoint.cpp
index 6f9624f9f5..2fadfa4e89 100644
--- a/src/modules/protocols/protoint.cpp
+++ b/src/modules/protocols/protoint.cpp
@@ -46,7 +46,7 @@ void FreeFilesMatrix(TCHAR ***files)
struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
{
- MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr)
+ MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT *psr)
{
return (MCONTACT)ProtoCallService(m_szModuleName, PS_ADDTOLIST, flags, (LPARAM)psr);
}