summaryrefslogtreecommitdiff
path: root/src/modules/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-14 15:51:34 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-14 15:51:34 +0000
commite58823d961a630eb62e60d2ccb443761ba5f1704 (patch)
tree62d071be480d57af2a53f154a1468abe0b9449ff /src/modules/protocols
parent721aea0764451e985d575236205808bbef298244 (diff)
- all MS_CLIST_ADD*ITEM services replaced with Menu_Add*Item stubs.
- massive cleanup of the menu-related code git-svn-id: http://svn.miranda-ng.org/main/trunk@410 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/protocols')
-rw-r--r--src/modules/protocols/protoaccs.cpp4
-rw-r--r--src/modules/protocols/protochains.cpp84
-rw-r--r--src/modules/protocols/protocols.cpp20
-rw-r--r--src/modules/protocols/protoint.cpp8
-rw-r--r--src/modules/protocols/protoopts.cpp18
5 files changed, 67 insertions, 67 deletions
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp
index e865450967..f2706ddb08 100644
--- a/src/modules/protocols/protoaccs.cpp
+++ b/src/modules/protocols/protoaccs.cpp
@@ -2,7 +2,7 @@
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
diff --git a/src/modules/protocols/protochains.cpp b/src/modules/protocols/protochains.cpp
index f5ebd92fb1..0960aa34f0 100644
--- a/src/modules/protocols/protochains.cpp
+++ b/src/modules/protocols/protochains.cpp
@@ -2,7 +2,7 @@
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_protomod.h>
//Protocol chain is list of integers "0".."n", with network protocol named "p"
-INT_PTR Proto_CallContactService(WPARAM wParam,LPARAM lParam)
+INT_PTR Proto_CallContactService(WPARAM wParam, LPARAM lParam)
//note that this is ChainSend() too, due to a quirk of function definitions
{
CCSDATA *ccs=(CCSDATA*)lParam;
@@ -68,7 +68,7 @@ INT_PTR Proto_CallContactService(WPARAM wParam,LPARAM lParam)
return ret;
}
-static INT_PTR CallRecvChain(WPARAM wParam,LPARAM lParam)
+static INT_PTR CallRecvChain(WPARAM wParam, LPARAM lParam)
{
CCSDATA *ccs=(CCSDATA*)lParam;
int i;
@@ -121,10 +121,10 @@ static INT_PTR CallRecvChain(WPARAM wParam,LPARAM lParam)
return ret;
}
-static INT_PTR Proto_ChainRecv(WPARAM wParam,LPARAM lParam)
+static INT_PTR Proto_ChainRecv(WPARAM wParam, LPARAM lParam)
{
/* this will switch threads just like before */
- return CallServiceSync(MS_PROTO_CHAINRECV "ThreadSafe",wParam,lParam);
+ return CallServiceSync(MS_PROTO_CHAINRECV "ThreadSafe", wParam, lParam);
}
PROTOACCOUNT* __fastcall Proto_GetAccount(HANDLE hContact)
@@ -157,7 +157,7 @@ static INT_PTR Proto_GetContactBaseAccount(WPARAM wParam, LPARAM)
return (INT_PTR)(pa ? pa->szModuleName : NULL);
}
-static INT_PTR Proto_IsProtoOnContact(WPARAM wParam,LPARAM lParam)
+static INT_PTR Proto_IsProtoOnContact(WPARAM wParam, LPARAM lParam)
{
int i;
char str[10];
@@ -165,17 +165,17 @@ static INT_PTR Proto_IsProtoOnContact(WPARAM wParam,LPARAM lParam)
if (!lParam) return 0;
- if (!DBGetContactSettingString((HANDLE)wParam,"Protocol","p",&dbv)) {
- if (!_stricmp((char*)lParam,dbv.pszVal)) {
+ if (!DBGetContactSettingString((HANDLE)wParam, "Protocol", "p", &dbv)) {
+ if (!_stricmp((char*)lParam, dbv.pszVal)) {
mir_free(dbv.pszVal);
return -1;
}
mir_free(dbv.pszVal);
}
for (i=0;;i++) {
- _itoa(i,str,10);
- if (DBGetContactSettingString((HANDLE)wParam,"_Filter",str,&dbv)) break;
- if (!strcmp((char*)lParam,dbv.pszVal)) {
+ _itoa(i, str, 10);
+ if (DBGetContactSettingString((HANDLE)wParam, "_Filter", str, &dbv)) break;
+ if (!strcmp((char*)lParam, dbv.pszVal)) {
mir_free(dbv.pszVal);
return i+1;
}
@@ -184,33 +184,33 @@ static INT_PTR Proto_IsProtoOnContact(WPARAM wParam,LPARAM lParam)
return 0;
}
-static INT_PTR Proto_AddToContact(WPARAM wParam,LPARAM lParam)
+static INT_PTR Proto_AddToContact(WPARAM wParam, LPARAM lParam)
{
- PROTOCOLDESCRIPTOR *pd,*pdCompare;
+ PROTOCOLDESCRIPTOR *pd, *pdCompare;
pd = Proto_IsProtocolLoaded(( char* )lParam );
if ( pd == NULL ) {
PROTOACCOUNT* pa = Proto_GetAccount(( char* )lParam );
if ( pa ) {
- DBWriteContactSettingString((HANDLE)wParam,"Protocol","p",(char*)lParam);
+ DBWriteContactSettingString((HANDLE)wParam, "Protocol", "p", (char*)lParam);
return 0;
}
return 1;
}
if ( pd->type == PROTOTYPE_PROTOCOL ) {
- DBWriteContactSettingString((HANDLE)wParam,"Protocol","p",(char*)lParam);
+ DBWriteContactSettingString((HANDLE)wParam, "Protocol", "p", (char*)lParam);
return 0;
}
- if (Proto_IsProtoOnContact(wParam,lParam)) return 1;
+ if (Proto_IsProtoOnContact(wParam, lParam)) return 1;
{ /* v:0.3.3 + PROTO FILTERS ARE NOW KEPT IN THEIR OWN DB MODULE! */
int i;
- char str[10],*lastProto;
+ char str[10], *lastProto;
DBVARIANT dbv;
for (i=0;;i++) {
- _itoa(i,str,10);
- if (DBGetContactSettingString((HANDLE)wParam,"_Filter",str,&dbv)) break;
+ _itoa(i, str, 10);
+ if (DBGetContactSettingString((HANDLE)wParam, "_Filter", str, &dbv)) break;
pdCompare = Proto_IsProtocolLoaded(( char* )dbv.pszVal );
mir_free(dbv.pszVal);
if (pdCompare == NULL) continue;
@@ -219,13 +219,13 @@ static INT_PTR Proto_AddToContact(WPARAM wParam,LPARAM lParam)
//put the new module at position i
lastProto=mir_strdup((char*)lParam);
for (;;i++) {
- _itoa(i,str,10);
- if (DBGetContactSettingString((HANDLE)wParam,"_Filter",str,&dbv)) {
- DBWriteContactSettingString((HANDLE)wParam,"_Filter",str,lastProto);
+ _itoa(i, str, 10);
+ if (DBGetContactSettingString((HANDLE)wParam, "_Filter", str, &dbv)) {
+ DBWriteContactSettingString((HANDLE)wParam, "_Filter", str, lastProto);
mir_free(lastProto);
break;
}
- DBWriteContactSettingString((HANDLE)wParam,"_Filter",str,lastProto);
+ DBWriteContactSettingString((HANDLE)wParam, "_Filter", str, lastProto);
mir_free(lastProto);
lastProto=dbv.pszVal;
}
@@ -233,26 +233,26 @@ static INT_PTR Proto_AddToContact(WPARAM wParam,LPARAM lParam)
return 0;
}
-static INT_PTR Proto_RemoveFromContact(WPARAM wParam,LPARAM lParam)
+static INT_PTR Proto_RemoveFromContact(WPARAM wParam, LPARAM lParam)
{
int i;
DBVARIANT dbv;
char str[10];
- i = Proto_IsProtoOnContact(wParam,lParam);
+ i = Proto_IsProtoOnContact(wParam, lParam);
if (!i) return 1;
if (i == -1)
- DBDeleteContactSetting((HANDLE)wParam,"Protocol","p");
+ DBDeleteContactSetting((HANDLE)wParam, "Protocol", "p");
else {
for (i--;;i++) { //we have to decrease i, as Proto_IsOnContact returns +1 more number than read from database
- _itoa(i+1,str,10);
- if (0 != DBGetContactSettingString((HANDLE)wParam,"_Filter",str,&dbv)) {
- _itoa(i,str,10);
- DBDeleteContactSetting((HANDLE)wParam,"_Filter",str);
+ _itoa(i+1, str, 10);
+ if (0 != DBGetContactSettingString((HANDLE)wParam, "_Filter", str, &dbv)) {
+ _itoa(i, str, 10);
+ DBDeleteContactSetting((HANDLE)wParam, "_Filter", str);
break;
}
- _itoa(i,str,10);
- DBWriteContactSettingString((HANDLE)wParam,"_Filter",str,dbv.pszVal);
+ _itoa(i, str, 10);
+ DBWriteContactSettingString((HANDLE)wParam, "_Filter", str, dbv.pszVal);
mir_free(dbv.pszVal);
}
}
@@ -261,14 +261,14 @@ static INT_PTR Proto_RemoveFromContact(WPARAM wParam,LPARAM lParam)
int LoadProtoChains(void)
{
- CreateServiceFunction(MS_PROTO_CALLCONTACTSERVICE,Proto_CallContactService);
- CreateServiceFunction(MS_PROTO_CHAINSEND,Proto_CallContactService);
- CreateServiceFunction(MS_PROTO_CHAINRECV,Proto_ChainRecv);
- CreateServiceFunction(MS_PROTO_CHAINRECV "ThreadSafe",CallRecvChain);
- CreateServiceFunction(MS_PROTO_GETCONTACTBASEPROTO,Proto_GetContactBaseProto);
- CreateServiceFunction(MS_PROTO_GETCONTACTBASEACCOUNT,Proto_GetContactBaseAccount);
- CreateServiceFunction(MS_PROTO_ISPROTOONCONTACT,Proto_IsProtoOnContact);
- CreateServiceFunction(MS_PROTO_ADDTOCONTACT,Proto_AddToContact);
- CreateServiceFunction(MS_PROTO_REMOVEFROMCONTACT,Proto_RemoveFromContact);
+ CreateServiceFunction(MS_PROTO_CALLCONTACTSERVICE, Proto_CallContactService);
+ CreateServiceFunction(MS_PROTO_CHAINSEND, Proto_CallContactService);
+ CreateServiceFunction(MS_PROTO_CHAINRECV, Proto_ChainRecv);
+ CreateServiceFunction(MS_PROTO_CHAINRECV "ThreadSafe", CallRecvChain);
+ CreateServiceFunction(MS_PROTO_GETCONTACTBASEPROTO, Proto_GetContactBaseProto);
+ CreateServiceFunction(MS_PROTO_GETCONTACTBASEACCOUNT, Proto_GetContactBaseAccount);
+ CreateServiceFunction(MS_PROTO_ISPROTOONCONTACT, Proto_IsProtoOnContact);
+ CreateServiceFunction(MS_PROTO_ADDTOCONTACT, Proto_AddToContact);
+ CreateServiceFunction(MS_PROTO_REMOVEFROMCONTACT, Proto_RemoveFromContact);
return 0;
}
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp
index ed1e7c14f2..1da7f0b4dd 100644
--- a/src/modules/protocols/protocols.cpp
+++ b/src/modules/protocols/protocols.cpp
@@ -2,7 +2,7 @@
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@@ -26,7 +26,7 @@ int LoadProtoChains(void);
int LoadProtoOptions( void );
HANDLE hAccListChanged;
-static HANDLE hAckEvent,hTypeEvent;
+static HANDLE hAckEvent, hTypeEvent;
static BOOL bModuleInitialized = FALSE;
typedef struct
@@ -86,7 +86,7 @@ INT_PTR srvProto_IsLoaded(WPARAM, LPARAM lParam)
return (INT_PTR)Proto_GetAccount(( char* )lParam );
}
-INT_PTR Proto_EnumProtocols(WPARAM wParam,LPARAM lParam)
+INT_PTR Proto_EnumProtocols(WPARAM wParam, LPARAM lParam)
{
*( int* )wParam = protos.getCount();
*( PROTOCOLDESCRIPTOR*** )lParam = protos.getArray();
@@ -144,7 +144,7 @@ static INT_PTR Proto_RegisterModule(WPARAM, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
// Basic core services
-static INT_PTR Proto_RecvFile(WPARAM,LPARAM lParam)
+static INT_PTR Proto_RecvFile(WPARAM, LPARAM lParam)
{
CCSDATA* ccs = ( CCSDATA* )lParam;
PROTORECVEVENT* pre = ( PROTORECVEVENT* )ccs->lParam;
@@ -195,7 +195,7 @@ static void sttRecvCreateBlob( DBEVENTINFO& dbei, int fileCount, char** pszFiles
strcpy(( char* )p, ( szDescr == NULL ) ? "" : szDescr );
}
-static INT_PTR Proto_RecvFileT(WPARAM,LPARAM lParam)
+static INT_PTR Proto_RecvFileT(WPARAM, LPARAM lParam)
{
CCSDATA* ccs = ( CCSDATA* )lParam;
PROTORECVFILET* pre = ( PROTORECVFILET* )ccs->lParam;
@@ -230,7 +230,7 @@ static INT_PTR Proto_RecvFileT(WPARAM,LPARAM lParam)
return 0;
}
-static INT_PTR Proto_RecvMessage(WPARAM,LPARAM lParam)
+static INT_PTR Proto_RecvMessage(WPARAM, LPARAM lParam)
{
CCSDATA *ccs = ( CCSDATA* )lParam;
PROTORECVEVENT *pre = ( PROTORECVEVENT* )ccs->lParam;
@@ -262,10 +262,10 @@ static int Proto_ValidTypingContact(HANDLE hContact, char *szProto)
if ( !hContact || !szProto )
return 0;
- return ( CallProtoService(szProto,PS_GETCAPS,PFLAGNUM_4,0) & PF4_SUPPORTTYPING ) ? 1 : 0;
+ return ( CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_SUPPORTTYPING ) ? 1 : 0;
}
-static INT_PTR Proto_SelfIsTyping(WPARAM wParam,LPARAM lParam)
+static INT_PTR Proto_SelfIsTyping(WPARAM wParam, LPARAM lParam)
{
if ( lParam == PROTOTYPE_SELFTYPING_OFF || lParam == PROTOTYPE_SELFTYPING_ON ) {
char* szProto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, wParam, 0 );
@@ -279,7 +279,7 @@ static INT_PTR Proto_SelfIsTyping(WPARAM wParam,LPARAM lParam)
return 0;
}
-static INT_PTR Proto_ContactIsTyping(WPARAM wParam,LPARAM lParam)
+static INT_PTR Proto_ContactIsTyping(WPARAM wParam, LPARAM lParam)
{
int type = (int)lParam;
char *szProto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, wParam, 0 );
diff --git a/src/modules/protocols/protoint.cpp b/src/modules/protocols/protoint.cpp
index 0acabb84a2..ccad4701d6 100644
--- a/src/modules/protocols/protoint.cpp
+++ b/src/modules/protocols/protoint.cpp
@@ -2,7 +2,7 @@
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@@ -30,7 +30,7 @@ INT_PTR __fastcall MyCallProtoService( const char *szModule, const char *szServi
{
char str[MAXMODULELABELLENGTH];
mir_snprintf( str, sizeof(str), "%s%s", szModule, szService );
- return CallService(str,wParam,lParam);
+ return CallService(str, wParam, lParam);
}
struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
@@ -180,7 +180,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
}
int __cdecl SendContacts( HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList )
- { CCSDATA ccs = { hContact, PSS_CONTACTS, MAKEWPARAM(flags,nContacts), (LPARAM)hContactsList };
+ { CCSDATA ccs = { hContact, PSS_CONTACTS, MAKEWPARAM(flags, nContacts), (LPARAM)hContactsList };
return ( int )MyCallProtoService( m_szModuleName, PSS_CONTACTS, 0, (LPARAM)&ccs );
}
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp
index 4fcb5b7e18..ccf68482ee 100644
--- a/src/modules/protocols/protoopts.cpp
+++ b/src/modules/protocols/protoopts.cpp
@@ -2,7 +2,7 @@
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@@ -69,7 +69,7 @@ typedef struct
}
AccFormDlgParam;
-static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg,UINT message, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch( message ) {
case WM_INITDIALOG:
@@ -277,7 +277,7 @@ static LRESULT CALLBACK sttEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
return CallWindowProc((WNDPROC)GetWindowLongPtr(hwnd, GWLP_USERDATA), hwnd, msg, wParam, lParam);
}
-static LRESULT CALLBACK AccListWndProc(HWND hwnd,UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT CALLBACK AccListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
struct TAccListData *dat = (struct TAccListData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if ( !dat )
@@ -461,7 +461,7 @@ static void sttUpdateAccountInfo(HWND hwndDlg, struct TAccMgrData *dat)
SetWindowText(GetDlgItem(hwndDlg, IDC_TXT_INFO), TranslateT(welcomeMsg));
}
-INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg,UINT message, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
struct TAccMgrData *dat = (struct TAccMgrData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
@@ -783,8 +783,8 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg,UINT message, WPARAM wParam, LPARAM
else {
DWORD dwStatus = CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0);
if (dwStatus >= ID_STATUS_ONLINE) {
- if (IDCANCEL == ::MessageBox(hwndDlg,
- TranslateT("Account is online. Disable account?"),
+ if (IDCANCEL == ::MessageBox(hwndDlg,
+ TranslateT("Account is online. Disable account?"),
TranslateT("Accounts"), MB_OKCANCEL)) {
pa->bIsEnabled = 1; //stay enabled
}
@@ -852,7 +852,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg,UINT message, WPARAM wParam, LPARAM
TCHAR buf[ 200 ];
mir_sntprintf( buf, SIZEOF(buf), TranslateT( "Account %s is being deleted" ), pa->tszAccountName );
if (pa->bOldProto) {
- MessageBox( NULL, TranslateT( "You need to disable plugin to delete this account" ), buf,
+ MessageBox( NULL, TranslateT( "You need to disable plugin to delete this account" ), buf,
MB_ICONERROR | MB_OK );
break;
}
@@ -1041,7 +1041,7 @@ int OptProtosLoaded(WPARAM, LPARAM)
mi.position = 1900000000;
mi.pszName = LPGEN("&Accounts...");
mi.pszService = MS_PROTO_SHOWACCMGR;
- CallService( MS_CLIST_ADDMAINMENUITEM, 0, ( LPARAM )&mi );
+ Menu_AddMainMenuItem(&mi);
return 0;
}