summaryrefslogtreecommitdiff
path: root/src/modules/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/protocols')
-rw-r--r--src/modules/protocols/protoaccs.cpp67
-rw-r--r--src/modules/protocols/protocols.cpp42
-rw-r--r--src/modules/protocols/protodir.cpp5
-rw-r--r--src/modules/protocols/protoint.cpp104
-rw-r--r--src/modules/protocols/protoopts.cpp59
5 files changed, 172 insertions, 105 deletions
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp
index 69946b91a6..bafe19b7f4 100644
--- a/src/modules/protocols/protoaccs.cpp
+++ b/src/modules/protocols/protoaccs.cpp
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../clist/clc.h"
bool CheckProtocolOrder(void);
-void BuildProtoMenus();
+void BuildProtoMenus();
static BOOL bModuleInitialized = FALSE;
@@ -282,86 +282,103 @@ int LoadAccountsModule(void)
/////////////////////////////////////////////////////////////////////////////////////////
static INT_PTR stub1(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
-{ return (INT_PTR)ppi->AddToList(wParam, (PROTOSEARCHRESULT*)lParam);
+{
+ return (INT_PTR)ppi->AddToList(wParam, (PROTOSEARCHRESULT*)lParam);
}
static INT_PTR stub2(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
-{ return (INT_PTR)ppi->AddToListByEvent(HIWORD(wParam), LOWORD(wParam), (HANDLE)lParam);
+{
+ return (INT_PTR)ppi->AddToListByEvent(HIWORD(wParam), LOWORD(wParam), (HANDLE)lParam);
}
static INT_PTR stub3(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM)
-{ return (INT_PTR)ppi->Authorize((HANDLE)wParam);
+{
+ return (INT_PTR)ppi->Authorize((HANDLE)wParam);
}
static INT_PTR stub4(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
-{ return (INT_PTR)ppi->AuthDeny((HANDLE)wParam, StrConvT((const char*)lParam));
+{
+ return (INT_PTR)ppi->AuthDeny((HANDLE)wParam, StrConvT((const char*)lParam));
}
static INT_PTR stub7(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
-{ return (INT_PTR)ppi->ChangeInfo(wParam, (void*)lParam);
+{
+ return (INT_PTR)ppi->ChangeInfo(wParam, (void*)lParam);
}
static INT_PTR stub11(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
-{ PROTOFILERESUME* pfr = (PROTOFILERESUME*)lParam;
+{
+ PROTOFILERESUME* pfr = (PROTOFILERESUME*)lParam;
return (INT_PTR)ppi->FileResume((HANDLE)wParam, &pfr->action, (const PROTOCHAR**)&pfr->szFilename);
}
static INT_PTR stub12(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
-{ return (INT_PTR)ppi->GetCaps(wParam, (HANDLE)lParam);
+{
+ return (INT_PTR)ppi->GetCaps(wParam, (HANDLE)lParam);
}
static INT_PTR stub13(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM)
-{ return (INT_PTR)ppi->GetIcon(wParam);
+{
+ return (INT_PTR)ppi->GetIcon(wParam);
}
static INT_PTR stub15(PROTO_INTERFACE* ppi, WPARAM, LPARAM lParam)
-{ return (INT_PTR)ppi->SearchBasic(StrConvT((char*)lParam));
+{
+ return (INT_PTR)ppi->SearchBasic(StrConvT((char*)lParam));
}
static INT_PTR stub16(PROTO_INTERFACE* ppi, WPARAM, LPARAM lParam)
-{ return (INT_PTR)ppi->SearchByEmail(StrConvT((char*)lParam));
+{
+ return (INT_PTR)ppi->SearchByEmail(StrConvT((char*)lParam));
}
static INT_PTR stub17(PROTO_INTERFACE* ppi, WPARAM, LPARAM lParam)
-{ PROTOSEARCHBYNAME* psbn = (PROTOSEARCHBYNAME*)lParam;
+{
+ PROTOSEARCHBYNAME* psbn = (PROTOSEARCHBYNAME*)lParam;
return (INT_PTR)ppi->SearchByName(StrConvT((char*)psbn->pszNick),
StrConvT((char*)psbn->pszFirstName), StrConvT((char*)psbn->pszLastName));
}
static INT_PTR stub18(PROTO_INTERFACE* ppi, WPARAM, LPARAM lParam)
-{ return (INT_PTR)ppi->SearchAdvanced((HWND)lParam);
+{
+ return (INT_PTR)ppi->SearchAdvanced((HWND)lParam);
}
static INT_PTR stub19(PROTO_INTERFACE* ppi, WPARAM, LPARAM lParam)
-{ return (INT_PTR)ppi->CreateExtendedSearchUI ((HWND)lParam);
+{
+ return (INT_PTR)ppi->CreateExtendedSearchUI ((HWND)lParam);
}
static INT_PTR stub22(PROTO_INTERFACE* ppi, WPARAM, LPARAM lParam)
-{ CCSDATA *ccs = (CCSDATA*)lParam;
+{
+ CCSDATA *ccs = (CCSDATA*)lParam;
ppi->RecvMsg(ccs->hContact, (PROTORECVEVENT*)ccs->lParam);
return 0;
}
static INT_PTR stub29(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM)
-{ return (INT_PTR)ppi->SetStatus(wParam);
+{
+ return (INT_PTR)ppi->SetStatus(wParam);
}
static INT_PTR stub33(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
-{ return (INT_PTR)ppi->SetAwayMsg(wParam, StrConvT((const char*)lParam));
+{
+ return (INT_PTR)ppi->SetAwayMsg(wParam, StrConvT((const char*)lParam));
}
static INT_PTR stub41(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
-{ lstrcpynA((char*)lParam, ppi->m_szModuleName, wParam);
+{
+ lstrcpynA((char*)lParam, ppi->m_szModuleName, wParam);
return 0;
}
static INT_PTR stub42(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
-{ return ppi->m_iStatus;
+{
+ return ppi->m_iStatus;
}
-
static INT_PTR stub43(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
-{
+{
PROTO_AVATAR_INFORMATION* p = (PROTO_AVATAR_INFORMATION*)lParam;
PROTO_AVATAR_INFORMATIONW tmp = { 0 };
@@ -380,7 +397,7 @@ static INT_PTR stub43(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
}
static INT_PTR stub44(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
-{
+{
wchar_t* buf = (wchar_t*)_alloca(sizeof(wchar_t) * (lParam + 1));
int result = CallProtoServiceInt(NULL,ppi->m_szModuleName, PS_GETMYAVATARW, WPARAM(buf), lParam);
if (result == 0)
@@ -396,11 +413,10 @@ static INT_PTR stub44(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
}
static INT_PTR stub45(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
-{
+{
return CallProtoServiceInt(NULL,ppi->m_szModuleName, PS_SETMYAVATARW, wParam, (LPARAM)(LPCTSTR)StrConvT((char*)lParam));
}
-
static HANDLE CreateProtoServiceEx(const char* szModule, const char* szService, MIRANDASERVICEOBJ pFunc, void* param)
{
char tmp[100];
@@ -532,7 +548,7 @@ void DeactivateAccount(PROTOACCOUNT* pa, bool bIsDynamic, bool bErase)
pa->ppro = NULL;
if (bIsDynamic)
mir_forkthread((pThreadFunc)DeactivationThread, param);
- else
+ else
DeactivationThread(param);
}
@@ -569,7 +585,6 @@ void EraseAccount(const char* pszModuleName)
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)pszModuleName);
}
-
/////////////////////////////////////////////////////////////////////////////////////////
void UnloadAccount(PROTOACCOUNT* pa, bool bIsDynamic, bool bErase)
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp
index 090428cc45..6121609829 100644
--- a/src/modules/protocols/protocols.cpp
+++ b/src/modules/protocols/protocols.cpp
@@ -38,7 +38,8 @@ typedef struct
TServiceListItem;
static int CompareServiceItems(const TServiceListItem* p1, const TServiceListItem* p2)
-{ return strcmp(p1->name, p2->name);
+{
+ return strcmp(p1->name, p2->name);
}
static LIST<TServiceListItem> serviceItems(10, CompareServiceItems);
@@ -46,7 +47,8 @@ static LIST<TServiceListItem> serviceItems(10, CompareServiceItems);
//------------------------------------------------------------------------------------
static int CompareProtos(const PROTOCOLDESCRIPTOR* p1, const PROTOCOLDESCRIPTOR* p2)
-{ return strcmp(p1->szName, p2->szName);
+{
+ return strcmp(p1->szName, p2->szName);
}
static LIST<PROTOCOLDESCRIPTOR> protos(10, CompareProtos);
@@ -267,11 +269,11 @@ void Proto_SetStatus(const char* szProto, unsigned status)
{
CallProtoServiceInt(NULL,szProto, PS_SETAWAYMSGT, status, (LPARAM) awayMsg);
mir_free(awayMsg);
- } }
+ }
+ }
CallProtoServiceInt(NULL,szProto, PS_SETSTATUS, status, 0);
}
-
char** __fastcall Proto_FilesMatrixA(wchar_t **files)
{
if (files == NULL) return NULL;
@@ -364,7 +366,7 @@ INT_PTR CallProtoServiceInt(HANDLE hContact, const char *szModule, const char *s
TServiceListItem *item = serviceItems.find((TServiceListItem*)&szService);
if (item) {
switch(item->id) {
- case 1:
+ case 1:
if (ppi->m_iVersion > 1 || !(((PROTOSEARCHRESULT*)lParam)->flags & PSR_UNICODE))
return (INT_PTR)ppi->AddToList(wParam, (PROTOSEARCHRESULT*)lParam);
else {
@@ -387,27 +389,27 @@ INT_PTR CallProtoServiceInt(HANDLE hContact, const char *szModule, const char *s
return res;
}
- case 2: return (INT_PTR)ppi->AddToListByEvent(LOWORD(wParam), HIWORD(wParam), (HANDLE)lParam);
- case 3: return (INT_PTR)ppi->Authorize((HANDLE)wParam);
- case 4:
+ case 2: return (INT_PTR)ppi->AddToListByEvent(LOWORD(wParam), HIWORD(wParam), (HANDLE)lParam);
+ case 3: return (INT_PTR)ppi->Authorize((HANDLE)wParam);
+ case 4:
if (ppi->m_iVersion > 1)
return (INT_PTR)ppi->AuthDeny((HANDLE)wParam, StrConvT((char*)lParam));
else
return (INT_PTR)ppi->AuthDeny((HANDLE)wParam, (PROTOCHAR*)lParam);
- case 5: return (INT_PTR)ppi->AuthRecv(hContact, (PROTORECVEVENT*)lParam);
- case 6:
+ case 5: return (INT_PTR)ppi->AuthRecv(hContact, (PROTORECVEVENT*)lParam);
+ case 6:
if (ppi->m_iVersion > 1)
return (INT_PTR)ppi->AuthRequest(hContact, StrConvT((char*)lParam));
else
return (INT_PTR)ppi->AuthRequest(hContact, (PROTOCHAR*)lParam);
- case 7: return (INT_PTR)ppi->ChangeInfo(wParam, (void*)lParam);
- case 8:
+ case 7: return (INT_PTR)ppi->ChangeInfo(wParam, (void*)lParam);
+ case 8:
if (ppi->m_iVersion > 1)
return (INT_PTR)ppi->FileAllow(hContact, (HANDLE)wParam, StrConvT((char*)lParam));
else
return (INT_PTR)ppi->FileAllow(hContact, (HANDLE)wParam, (PROTOCHAR*)lParam);
- case 9: return (INT_PTR)ppi->FileCancel(hContact, (HANDLE)wParam);
- case 10:
+ case 9: return (INT_PTR)ppi->FileCancel(hContact, (HANDLE)wParam);
+ case 10:
if (ppi->m_iVersion > 1)
return (INT_PTR)ppi->FileDeny(hContact, (HANDLE)wParam, StrConvT((char*)lParam));
else
@@ -510,7 +512,8 @@ INT_PTR CallProtoServiceInt(HANDLE hContact, const char *szModule, const char *s
INT_PTR res = (INT_PTR)ppi->FileResume((HANDLE)wParam, &pfr->action,
(const PROTOCHAR**)&szFname);
mir_free(szFname);
- } }
+ }
+ }
case 106:
if (ppi->m_iVersion > 1)
return (INT_PTR)ppi->AuthRequest(hContact, (const TCHAR*)lParam);
@@ -539,8 +542,9 @@ INT_PTR CallProtoServiceInt(HANDLE hContact, const char *szModule, const char *s
return (INT_PTR)ppi->SearchByEmail((const TCHAR*)lParam);
else
return (INT_PTR)ppi->SearchByEmail(StrConvA((const TCHAR*)lParam));
- } } }
-
+ }
+ }
+ }
if ( !strcmp(szService, PS_ADDTOLIST)) {
PROTOSEARCHRESULT *psr = (PROTOSEARCHRESULT*)lParam;
@@ -602,8 +606,8 @@ INT_PTR CallProtoServiceInt(HANDLE hContact, const char *szModule, const char *s
}
case 110:
return (INT_PTR)pa->ppro->SearchByEmail((const TCHAR*)lParam);
- } }
-
+ }
+ }
return res;
}
diff --git a/src/modules/protocols/protodir.cpp b/src/modules/protocols/protodir.cpp
index 1edcd3fc2d..f5f82bc304 100644
--- a/src/modules/protocols/protodir.cpp
+++ b/src/modules/protocols/protodir.cpp
@@ -168,7 +168,7 @@ void contactDir_Contact_Add(contactDir * cd, HANDLE hContact, char * proto, char
// only expected to be called at startup.
void contactDir_Proto_Walk(contactDir * cd)
{
- HANDLE hContact;
+ HANDLE hContact;
char buf[128];
DBCONTACTGETSETTING gsProto;
DBVARIANT dbvProto;
@@ -229,7 +229,6 @@ void InitContactDir(void)
//CreateServiceFunction(MS_PROTODIR_PROTOFROMCONTACT, contactDirGetProto);
}
-
void UninitContactDir(void)
{
return;
@@ -244,5 +243,5 @@ void UninitContactDir(void)
}
}
contactDir_Deinit(&condir);
-#endif
+#endif
}
diff --git a/src/modules/protocols/protoint.cpp b/src/modules/protocols/protoint.cpp
index ecc93265df..8146754c9d 100644
--- a/src/modules/protocols/protoint.cpp
+++ b/src/modules/protocols/protoint.cpp
@@ -54,28 +54,34 @@ INT_PTR __fastcall MyCallProtoService(const char *szModule, const char *szServic
struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
{
HANDLE __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr)
- { return (HANDLE)MyCallProtoService(m_szModuleName, PS_ADDTOLIST, flags, (LPARAM)psr);
+ {
+ return (HANDLE)MyCallProtoService(m_szModuleName, PS_ADDTOLIST, flags, (LPARAM)psr);
}
HANDLE __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
- { return (HANDLE)MyCallProtoService(m_szModuleName, PS_ADDTOLISTBYEVENT, MAKELONG(flags, iContact), (LPARAM)hDbEvent);
+ {
+ return (HANDLE)MyCallProtoService(m_szModuleName, PS_ADDTOLISTBYEVENT, MAKELONG(flags, iContact), (LPARAM)hDbEvent);
}
int __cdecl Authorize(HANDLE hContact)
- { return (int)MyCallProtoService(m_szModuleName, PS_AUTHALLOW, (WPARAM)hContact, 0);
+ {
+ return (int)MyCallProtoService(m_szModuleName, PS_AUTHALLOW, (WPARAM)hContact, 0);
}
int __cdecl AuthDeny(HANDLE hContact, const TCHAR* szReason)
- { return (int)MyCallProtoService(m_szModuleName, PS_AUTHDENY, (WPARAM)hContact, (LPARAM)StrConvA(szReason));
+ {
+ return (int)MyCallProtoService(m_szModuleName, PS_AUTHDENY, (WPARAM)hContact, (LPARAM)StrConvA(szReason));
}
int __cdecl AuthRecv(HANDLE hContact, PROTORECVEVENT* evt)
- { CCSDATA ccs = { hContact, PSR_AUTH, 0, (LPARAM)evt };
+ {
+ CCSDATA ccs = { hContact, PSR_AUTH, 0, (LPARAM)evt };
return (int)MyCallProtoService(m_szModuleName, PSR_AUTH, 0, (LPARAM)&ccs);
}
int __cdecl AuthRequest(HANDLE hContact, const TCHAR* szMessage)
- { CCSDATA ccs = { hContact, PSS_AUTHREQUEST, 0, (LPARAM)szMessage };
+ {
+ CCSDATA ccs = { hContact, PSS_AUTHREQUEST, 0, (LPARAM)szMessage };
ccs.lParam = (LPARAM)mir_t2a(szMessage);
int res = (int)MyCallProtoService(m_szModuleName, PSS_AUTHREQUEST, 0, (LPARAM)&ccs);
mir_free((char*)ccs.lParam);
@@ -83,11 +89,13 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
}
HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData)
- { return (HANDLE)MyCallProtoService(m_szModuleName, PS_CHANGEINFO, iInfoType, (LPARAM)pInfoData);
+ {
+ return (HANDLE)MyCallProtoService(m_szModuleName, PS_CHANGEINFO, iInfoType, (LPARAM)pInfoData);
}
HANDLE __cdecl FileAllow(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
- { CCSDATA ccs = { hContact, PSS_FILEALLOW, (WPARAM)hTransfer, (LPARAM)szPath };
+ {
+ CCSDATA ccs = { hContact, PSS_FILEALLOW, (WPARAM)hTransfer, (LPARAM)szPath };
ccs.lParam = (LPARAM)mir_t2a(szPath);
HANDLE res = (HANDLE)MyCallProtoService(m_szModuleName, PSS_FILEALLOW, 0, (LPARAM)&ccs);
@@ -96,12 +104,14 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
}
int __cdecl FileCancel(HANDLE hContact, HANDLE hTransfer)
- { CCSDATA ccs = { hContact, PSS_FILECANCEL, (WPARAM)hTransfer, 0 };
+ {
+ CCSDATA ccs = { hContact, PSS_FILECANCEL, (WPARAM)hTransfer, 0 };
return (int)MyCallProtoService(m_szModuleName, PSS_FILECANCEL, 0, (LPARAM)&ccs);
}
int __cdecl FileDeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason)
- { CCSDATA ccs = { hContact, PSS_FILEDENY, (WPARAM)hTransfer, (LPARAM)szReason };
+ {
+ CCSDATA ccs = { hContact, PSS_FILEDENY, (WPARAM)hTransfer, (LPARAM)szReason };
ccs.lParam = (LPARAM)mir_t2a(szReason);
int res = (int)MyCallProtoService(m_szModuleName, PSS_FILEDENY, 0, (LPARAM)&ccs);
@@ -110,7 +120,8 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
}
int __cdecl FileResume(HANDLE hTransfer, int* action, const PROTOCHAR** szFilename)
- { PROTOFILERESUME pfr = { *action, *szFilename };
+ {
+ PROTOFILERESUME pfr = { *action, *szFilename };
pfr.szFilename = (PROTOCHAR*)mir_t2a(pfr.szFilename);
int res = (int)MyCallProtoService(m_szModuleName, PS_FILERESUME, (WPARAM)hTransfer, (LPARAM)&pfr);
@@ -121,28 +132,34 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
}
DWORD_PTR __cdecl GetCaps(int type, HANDLE hContact)
- { return (DWORD_PTR)MyCallProtoService(m_szModuleName, PS_GETCAPS, type, (LPARAM)hContact);
+ {
+ return (DWORD_PTR)MyCallProtoService(m_szModuleName, PS_GETCAPS, type, (LPARAM)hContact);
}
HICON __cdecl GetIcon(int iconIndex)
- { return (HICON)MyCallProtoService(m_szModuleName, PS_LOADICON, iconIndex, 0);
+ {
+ return (HICON)MyCallProtoService(m_szModuleName, PS_LOADICON, iconIndex, 0);
}
int __cdecl GetInfo(HANDLE hContact, int flags)
- { CCSDATA ccs = { hContact, PSS_GETINFO, flags, 0 };
+ {
+ CCSDATA ccs = { hContact, PSS_GETINFO, flags, 0 };
return MyCallProtoService(m_szModuleName, PSS_GETINFO, 0, (LPARAM)&ccs);
}
HANDLE __cdecl SearchBasic(const PROTOCHAR* id)
- { return (HANDLE)MyCallProtoService(m_szModuleName, PS_BASICSEARCH, 0, (LPARAM)StrConvA(id));
+ {
+ return (HANDLE)MyCallProtoService(m_szModuleName, PS_BASICSEARCH, 0, (LPARAM)StrConvA(id));
}
HANDLE __cdecl SearchByEmail(const PROTOCHAR* email)
- { return (HANDLE)MyCallProtoService(m_szModuleName, PS_SEARCHBYEMAIL, 0, (LPARAM)StrConvA(email));
+ {
+ return (HANDLE)MyCallProtoService(m_szModuleName, PS_SEARCHBYEMAIL, 0, (LPARAM)StrConvA(email));
}
HANDLE __cdecl SearchByName(const PROTOCHAR* nick, const PROTOCHAR* firstName, const PROTOCHAR* lastName)
- { PROTOSEARCHBYNAME psn;
+ {
+ PROTOSEARCHBYNAME psn;
psn.pszNick = (PROTOCHAR*)mir_t2a(nick);
psn.pszFirstName = (PROTOCHAR*)mir_t2a(firstName);
@@ -156,42 +173,50 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
}
HWND __cdecl SearchAdvanced(HWND owner)
- { return (HWND)MyCallProtoService(m_szModuleName, PS_SEARCHBYADVANCED, 0, (LPARAM)owner);
+ {
+ return (HWND)MyCallProtoService(m_szModuleName, PS_SEARCHBYADVANCED, 0, (LPARAM)owner);
}
HWND __cdecl CreateExtendedSearchUI(HWND owner)
- { return (HWND)MyCallProtoService(m_szModuleName, PS_CREATEADVSEARCHUI, 0, (LPARAM)owner);
+ {
+ return (HWND)MyCallProtoService(m_szModuleName, PS_CREATEADVSEARCHUI, 0, (LPARAM)owner);
}
int __cdecl RecvContacts(HANDLE hContact, PROTORECVEVENT* evt)
- { CCSDATA ccs = { hContact, PSR_CONTACTS, 0, (LPARAM)evt };
+ {
+ CCSDATA ccs = { hContact, PSR_CONTACTS, 0, (LPARAM)evt };
return (int)MyCallProtoService(m_szModuleName, PSR_CONTACTS, 0, (LPARAM)&ccs);
}
int __cdecl RecvFile(HANDLE hContact, PROTOFILEEVENT* evt)
- { CCSDATA ccs = { hContact, PSR_FILE, 0, (LPARAM)evt };
+ {
+ CCSDATA ccs = { hContact, PSR_FILE, 0, (LPARAM)evt };
return MyCallProtoService(m_szModuleName, PSR_FILE, 0, (LPARAM)&ccs);
}
int __cdecl RecvMsg(HANDLE hContact, PROTORECVEVENT* evt)
- { CCSDATA ccs = { hContact, PSR_MESSAGE, 0, (LPARAM)evt };
+ {
+ CCSDATA ccs = { hContact, PSR_MESSAGE, 0, (LPARAM)evt };
return (int)MyCallProtoService(m_szModuleName, PSR_MESSAGE, 0, (LPARAM)&ccs);
}
int __cdecl RecvUrl(HANDLE hContact, PROTORECVEVENT* evt)
- { CCSDATA ccs = { hContact, PSR_URL, 0, (LPARAM)evt };
+ {
+ CCSDATA ccs = { hContact, PSR_URL, 0, (LPARAM)evt };
return (int)MyCallProtoService(m_szModuleName, PSR_URL, 0, (LPARAM)&ccs);
}
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);
}
HANDLE __cdecl SendFile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles)
- { CCSDATA ccs = { hContact, PSS_FILE, (WPARAM)szDescription, (LPARAM)ppszFiles };
+ {
+ CCSDATA ccs = { hContact, PSS_FILE, (WPARAM)szDescription, (LPARAM)ppszFiles };
- ccs.wParam = (WPARAM)mir_t2a(szDescription);
+ ccs.wParam = (WPARAM)mir_t2a(szDescription);
ccs.lParam = (LPARAM)Proto_FilesMatrixA(ppszFiles);
HANDLE res = (HANDLE)MyCallProtoService(m_szModuleName, PSS_FILE, 0, (LPARAM)&ccs);
if (res == 0) FreeFilesMatrix((TCHAR***)&ccs.lParam);
@@ -200,45 +225,54 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
}
int __cdecl SendMsg(HANDLE hContact, int flags, const char* msg)
- { CCSDATA ccs = { hContact, PSS_MESSAGE, flags, (LPARAM)msg };
+ {
+ CCSDATA ccs = { hContact, PSS_MESSAGE, flags, (LPARAM)msg };
return (int)MyCallProtoService(m_szModuleName, PSS_MESSAGE, 0, (LPARAM)&ccs);
}
int __cdecl SendUrl(HANDLE hContact, int flags, const char* url)
- { CCSDATA ccs = { hContact, PSS_URL, flags, (LPARAM)url };
+ {
+ CCSDATA ccs = { hContact, PSS_URL, flags, (LPARAM)url };
return (int)MyCallProtoService(m_szModuleName, PSS_URL, 0, (LPARAM)&ccs);
}
int __cdecl SetApparentMode(HANDLE hContact, int mode)
- { CCSDATA ccs = { hContact, PSS_SETAPPARENTMODE, mode, 0 };
+ {
+ CCSDATA ccs = { hContact, PSS_SETAPPARENTMODE, mode, 0 };
return (int)MyCallProtoService(m_szModuleName, PSS_SETAPPARENTMODE, 0, (LPARAM)&ccs);
}
int __cdecl SetStatus(int iNewStatus)
- { return (int)MyCallProtoService(m_szModuleName, PS_SETSTATUS, iNewStatus, 0);
+ {
+ return (int)MyCallProtoService(m_szModuleName, PS_SETSTATUS, iNewStatus, 0);
}
HANDLE __cdecl GetAwayMsg(HANDLE hContact)
- { CCSDATA ccs = { hContact, PSS_GETAWAYMSG, 0, 0 };
+ {
+ CCSDATA ccs = { hContact, PSS_GETAWAYMSG, 0, 0 };
return (HANDLE)MyCallProtoService(m_szModuleName, PSS_GETAWAYMSG, 0, (LPARAM)&ccs);
}
int __cdecl RecvAwayMsg(HANDLE hContact, int statusMode, PROTORECVEVENT* evt)
- { CCSDATA ccs = { hContact, PSR_AWAYMSG, statusMode, (LPARAM)evt };
+ {
+ CCSDATA ccs = { hContact, PSR_AWAYMSG, statusMode, (LPARAM)evt };
return (int)MyCallProtoService(m_szModuleName, PSR_AWAYMSG, 0, (LPARAM)&ccs);
}
int __cdecl SendAwayMsg(HANDLE hContact, HANDLE hProcess, const char* msg)
- { CCSDATA ccs = { hContact, PSS_AWAYMSG, (WPARAM)hProcess, (LPARAM)msg };
+ {
+ CCSDATA ccs = { hContact, PSS_AWAYMSG, (WPARAM)hProcess, (LPARAM)msg };
return (int)MyCallProtoService(m_szModuleName, PSS_AWAYMSG, 0, (LPARAM)&ccs);
}
int __cdecl SetAwayMsg(int iStatus, const TCHAR* msg)
- { return (int)MyCallProtoService(m_szModuleName, PS_SETAWAYMSG, iStatus, (LPARAM)StrConvA(msg));
+ {
+ return (int)MyCallProtoService(m_szModuleName, PS_SETAWAYMSG, iStatus, (LPARAM)StrConvA(msg));
}
int __cdecl UserIsTyping(HANDLE hContact, int type)
- { CCSDATA ccs = { hContact, PSS_USERISTYPING, (WPARAM)hContact, type };
+ {
+ CCSDATA ccs = { hContact, PSS_USERISTYPING, (WPARAM)hContact, type };
return MyCallProtoService(m_szModuleName, PSS_USERISTYPING, 0, (LPARAM)&ccs);
}
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp
index 420540b314..636a316222 100644
--- a/src/modules/protocols/protoopts.cpp
+++ b/src/modules/protocols/protoopts.cpp
@@ -127,7 +127,8 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam
for (int i=0; i < accounts.getCount(); i++)
if (_stricmp(buf, accounts[i]->szModuleName) == 0)
return FALSE;
- } }
+ }
+ }
switch(param->action) {
case PRAC_UPGRADED:
@@ -176,7 +177,7 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam
if (DBGetContactSettingString(NULL, buf, "AM_BaseProto", &dbv))
break;
db_free(&dbv);
- }
+ }
}
pa->szModuleName = mir_strdup(buf);
@@ -387,7 +388,8 @@ static void sttSubclassAccList(HWND hwnd, BOOL subclass)
SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)dat->oldWndProc);
SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
mir_free(dat);
-} }
+ }
+}
static void sttSelectItem(struct TAccMgrData *dat, HWND hwndList, int iItem)
{
@@ -445,10 +447,12 @@ static void sttUpdateAccountInfo(HWND hwndDlg, struct TAccMgrData *dat)
else {
ShowWindow( GetDlgItem(hwndDlg, IDC_TXT_INFO), SW_SHOW);
SetWindowText( GetDlgItem(hwndDlg, IDC_TXT_INFO), legacyMsg);
- } }
+ }
+ }
return;
- } }
-
+ }
+ }
+
EnableWindow( GetDlgItem(hwndDlg, IDC_UPGRADE), FALSE);
EnableWindow( GetDlgItem(hwndDlg, IDC_EDIT), FALSE);
EnableWindow( GetDlgItem(hwndDlg, IDC_REMOVE), FALSE);
@@ -621,7 +625,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
szIdName = (char *)acc->ppro->GetCaps(PFLAG_UNIQUEIDTEXT, 0);
tszIdName = szIdName ? mir_a2t(szIdName) : mir_tstrdup(TranslateT("Account ID"));
-
+
ci.cbSize = sizeof(ci);
ci.hContact = NULL;
ci.szProto = acc->szModuleName;
@@ -646,7 +650,8 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
DrawText(lps->hDC, text, -1, &lps->rcItem, DT_LEFT|DT_NOPREFIX|DT_SINGLELINE|DT_END_ELLIPSIS);
GetTextExtentPoint32(lps->hDC, text, length, &sz);
lps->rcItem.top += sz.cy + 2;
- } }
+ }
+ }
return TRUE;
case WM_MY_REFRESH:
@@ -744,7 +749,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
break;
}
DestroyMenu(hMenu);
- }
+ }
}
break;
@@ -783,9 +788,9 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
DWORD dwStatus = CallProtoServiceInt(NULL,pa->szModuleName, PS_GETSTATUS, 0, 0);
if (dwStatus >= ID_STATUS_ONLINE) {
if (IDCANCEL == ::MessageBox(hwndDlg,
- TranslateT("Account is online. Disable account?"),
- TranslateT("Accounts"), MB_OKCANCEL)) {
- pa->bIsEnabled = 1; //stay enabled
+ TranslateT("Account is online. Disable account?"),
+ TranslateT("Accounts"), MB_OKCANCEL)) {
+ pa->bIsEnabled = 1; //stay enabled
}
}
@@ -797,7 +802,8 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
NotifyEventHooks(hAccListChanged, PRAC_CHECKED, (LPARAM)pa);
sttUpdateAccountInfo(hwndDlg, dat);
RedrawWindow(hwndList, NULL, NULL, RDW_INVALIDATE);
- } }
+ }
+ }
break;
case LBN_MY_RENAME:
@@ -822,7 +828,8 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
else mir_free((TCHAR*)lParam);
}
break;
- } }
+ }
+ }
break;
case IDC_ADD:
@@ -876,7 +883,9 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
EnableWindow(hList, TRUE);
EnableWindow( GetDlgItem(hwndDlg, IDC_ADD), TRUE);
- } } }
+ }
+ }
+ }
break;
case IDC_OPTIONS:
@@ -894,7 +903,8 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
Options_Open(&ood);
}
else OpenAccountOptions(pa);
- } }
+ }
+ }
break;
case IDC_UPGRADE:
@@ -904,7 +914,8 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
if (idx != -1) {
AccFormDlgParam param = { PRAC_UPGRADED, (PROTOACCOUNT*)ListBox_GetItemData(hList, idx) };
DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ACCFORM), hwndDlg, AccFormDlgProc, (LPARAM)&param);
- } }
+ }
+ }
break;
case IDC_LNK_NETWORK:
@@ -964,7 +975,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- {
+ {
int i;
PSHNOTIFY pshn = {0};
pshn.hdr.code = PSN_APPLY;
@@ -973,11 +984,12 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
pshn.hdr.hwndFrom = accounts[i]->hwndAccMgrUI;
SendMessage(accounts[i]->hwndAccMgrUI, WM_NOTIFY, 0, (LPARAM)&pshn);
accounts[i]->bAccMgrUIChanged = FALSE;
- } }
+ }
+ }
return TRUE;
}
case PSN_RESET:
- {
+ {
int i;
PSHNOTIFY pshn = {0};
pshn.hdr.code = PSN_RESET;
@@ -986,7 +998,8 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
pshn.hdr.hwndFrom = accounts[i]->hwndAccMgrUI;
SendMessage(accounts[i]->hwndAccMgrUI, WM_NOTIFY, 0, (LPARAM)&pshn);
accounts[i]->bAccMgrUIChanged = FALSE;
- } }
+ }
+ }
return TRUE;
}
}
@@ -1000,7 +1013,9 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
if (accounts[i]->hwndAccMgrUI) {
DestroyWindow(accounts[i]->hwndAccMgrUI);
accounts[i]->hwndAccMgrUI = NULL;
- } } }
+ }
+ }
+ }
Window_FreeIcon_IcoLib(hwndDlg);
Button_FreeIcon_IcoLib(hwndDlg, IDC_ADD);