diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2014-12-15 16:11:04 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2014-12-15 16:11:04 +0000 |
commit | e16d8a339254b1e55bfffeb8e88bbf5990686dcf (patch) | |
tree | 1d5fe3c77f8d20ed53da89341406e7eba10db41f /protocols/GTalkExt/src | |
parent | 95807393b69d3d3ae9ec3256bdff2824999cff5d (diff) |
GTalkExt: changed warning lavel to w4
git-svn-id: http://svn.miranda-ng.org/main/trunk@11437 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/GTalkExt/src')
-rw-r--r-- | protocols/GTalkExt/src/GTalkExt.cpp | 10 | ||||
-rw-r--r-- | protocols/GTalkExt/src/avatar.cpp | 4 | ||||
-rw-r--r-- | protocols/GTalkExt/src/googletalk.h | 4 | ||||
-rw-r--r-- | protocols/GTalkExt/src/handlers.cpp | 64 | ||||
-rw-r--r-- | protocols/GTalkExt/src/inbox.cpp | 20 | ||||
-rw-r--r-- | protocols/GTalkExt/src/menu.cpp | 2 | ||||
-rw-r--r-- | protocols/GTalkExt/src/notifications.cpp | 66 | ||||
-rw-r--r-- | protocols/GTalkExt/src/options.cpp | 4 | ||||
-rw-r--r-- | protocols/GTalkExt/src/tipper_items.cpp | 16 |
9 files changed, 95 insertions, 95 deletions
diff --git a/protocols/GTalkExt/src/GTalkExt.cpp b/protocols/GTalkExt/src/GTalkExt.cpp index 8b486e0cc6..c2ad8dcaaf 100644 --- a/protocols/GTalkExt/src/GTalkExt.cpp +++ b/protocols/GTalkExt/src/GTalkExt.cpp @@ -37,7 +37,7 @@ PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
- PLUGIN_MAKE_VERSION(__MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM),
+ PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
__DESCRIPTION,
__AUTHOR,
__AUTHOREMAIL,
@@ -45,10 +45,10 @@ PLUGININFOEX pluginInfo = __AUTHORWEB,
UNICODE_AWARE,
//{08B86253-EC6E-4d09-B7A9-64ACDF0627B8}
- {0x08B86253, 0xEC6E, 0x4d09, { 0xB7, 0xA9, 0x64, 0xAC, 0xDF, 0x06, 0x27, 0xB8 }}
+ { 0x08B86253, 0xEC6E, 0x4d09, { 0xB7, 0xA9, 0x64, 0xAC, 0xDF, 0x06, 0x27, 0xB8 } }
};
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
@@ -80,8 +80,8 @@ extern "C" int __declspec(dllexport) Load(void) {
mir_getLP(&pluginInfo);
mir_getXI(&xi);
-
- WNDCLASS cls = {0};
+
+ WNDCLASS cls = { 0 };
cls.lpfnWndProc = WndProc;
cls.lpszClassName = TEMP_WINDOW_CLASS_NAME;
RegisterClass(&cls);
diff --git a/protocols/GTalkExt/src/avatar.cpp b/protocols/GTalkExt/src/avatar.cpp index 433ac0db65..8af3953e98 100644 --- a/protocols/GTalkExt/src/avatar.cpp +++ b/protocols/GTalkExt/src/avatar.cpp @@ -84,7 +84,7 @@ struct AVACHANGED { MCONTACT hContact;
};
-VOID CALLBACK CallSetAvatar(PVOID lpParameter, BOOLEAN TimerOrWaitFired)
+VOID CALLBACK CallSetAvatar(PVOID lpParameter, BOOLEAN)
{
Thread_Push(0);
__try {
@@ -145,7 +145,7 @@ void SetAvatar(MCONTACT hContact) return;
HANDLE hFile;
- ptrT avaFile( CreateAvaFile(&hFile));
+ ptrT avaFile(CreateAvaFile(&hFile));
if (avaFile == NULL)
return;
diff --git a/protocols/GTalkExt/src/googletalk.h b/protocols/GTalkExt/src/googletalk.h index 117692a8fe..3c9f686bb5 100644 --- a/protocols/GTalkExt/src/googletalk.h +++ b/protocols/GTalkExt/src/googletalk.h @@ -27,7 +27,7 @@ #define JABBER_FEAT_GTALK_SHARED_STATUS _T("google:shared-status")
#define JABBER_EXT_GTALK_PMUC _T("pmuc-v1")
-
+
#define NOTIFY_FEATURE_XMLNS _T("google:mail:notify")
#define SETTING_FEATURE_XMLNS _T("google:setting")
#define DISCOVERY_XMLNS _T("http://jabber.org/protocol/disco#info")
@@ -48,7 +48,7 @@ #define ATTRNAME_NEWER_THAN_TID _T("newer-than-tid")
#define ATTRNAME_VALUE _T("value")
#define ATTRNAME_VAR _T("var")
-
+
#define IQTYPE_RESULT _T("result")
#define IQTYPE_SET _T("set")
#define IQTYPE_GET _T("get")
diff --git a/protocols/GTalkExt/src/handlers.cpp b/protocols/GTalkExt/src/handlers.cpp index 0bfbc8f980..259f32aca4 100644 --- a/protocols/GTalkExt/src/handlers.cpp +++ b/protocols/GTalkExt/src/handlers.cpp @@ -31,7 +31,7 @@ LRESULT CALLBACK PopupProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam);
-XML_API xi = {0};
+XML_API xi = { 0 };
#include <tchar.h>
@@ -74,7 +74,7 @@ LPTSTR ExtractJid(LPCTSTR jidWithRes) BOOL TimerHandler(IJabberInterface *ji, HXML node, void *pUserData);
-BOOL InternalListHandler(IJabberInterface *ji, HXML node, LPCTSTR jid, LPCTSTR mailboxUrl)
+BOOL InternalListHandler(HXML node, LPCTSTR jid, LPCTSTR mailboxUrl)
{
ULONGLONG maxTid = 0;
LPCTSTR sMaxTid = NULL;
@@ -112,7 +112,7 @@ BOOL InternalListHandler(IJabberInterface *ji, HXML node, LPCTSTR jid, LPCTSTR m }
else
for (int i = 0; i < xi.getChildCount(node); i++) {
- MAIL_THREAD_NOTIFICATION mtn = {0};
+ MAIL_THREAD_NOTIFICATION mtn = { 0 };
HXML thread = xi.getChild(node, i);
mtn.subj = xi.getText(xi.getChildByPath(thread, NODENAME_SUBJECT, FALSE));
@@ -132,9 +132,9 @@ BOOL InternalListHandler(IJabberInterface *ji, HXML node, LPCTSTR jid, LPCTSTR m LPCTSTR url = xi.getAttrValue(thread, ATTRNAME_URL);
LPCTSTR tid = xi.getAttrValue(thread, ATTRNAME_TID);
- if ( ReadCheckbox(0, IDC_STANDARDVIEW, settings))
+ if (ReadCheckbox(0, IDC_STANDARDVIEW, settings))
FormatMessageUrl(MESSAGE_URL_FORMAT_STANDARD, (LPTSTR)url, mailboxUrl, tid);
- else if ( ReadCheckbox(0, IDC_HTMLVIEW, settings))
+ else if (ReadCheckbox(0, IDC_HTMLVIEW, settings))
FormatMessageUrl(MESSAGE_URL_FORMAT_HTML, (LPTSTR)url, mailboxUrl, tid);
else
MakeUrlHex((LPTSTR)url, tid);
@@ -149,7 +149,7 @@ BOOL InternalListHandler(IJabberInterface *ji, HXML node, LPCTSTR jid, LPCTSTR m return TRUE;
}
-BOOL MailListHandler(IJabberInterface *ji, HXML node, void *pUserData)
+BOOL MailListHandler(IJabberInterface *ji, HXML node, void *)
{
LPCTSTR jidWithRes = xi.getAttrValue(node, ATTRNAME_TO);
__try {
@@ -163,13 +163,13 @@ BOOL MailListHandler(IJabberInterface *ji, HXML node, void *pUserData) LPCTSTR url = xi.getAttrValue(node, ATTRNAME_URL);
- return InternalListHandler(ji, node, jid, url);
+ return InternalListHandler(node, jid, url);
}
__finally {
if (jidWithRes)
ji->AddTemporaryIqHandler(TimerHandler, JABBER_IQ_TYPE_RESULT, 0,
- (PVOID)_tcsdup(jidWithRes), TIMER_INTERVAL);
- // Never get a real result stanza. Results elapsed request after WAIT_TIMER_INTERVAL ms
+ (PVOID)_tcsdup(jidWithRes), TIMER_INTERVAL);
+ // Never get a real result stanza. Results elapsed request after WAIT_TIMER_INTERVAL ms
}
}
@@ -181,12 +181,12 @@ void RequestMail(LPCTSTR jidWithRes, IJabberInterface *ji) xi.addAttr(node, ATTRNAME_FROM, jidWithRes);
UINT uID = ji->SerialNext();
- ptrT jid( ExtractJid(jidWithRes));
+ ptrT jid(ExtractJid(jidWithRes));
xi.addAttr(node, ATTRNAME_TO, jid);
- ptrT
- lastMailTime( ReadJidSetting(LAST_MAIL_TIME_FROM_JID, jid)),
- lastThreadId( ReadJidSetting(LAST_THREAD_ID_FROM_JID, jid));
+ ptrT
+ lastMailTime(ReadJidSetting(LAST_MAIL_TIME_FROM_JID, jid)),
+ lastThreadId(ReadJidSetting(LAST_THREAD_ID_FROM_JID, jid));
TCHAR id[30];
mir_sntprintf(id, SIZEOF(id), JABBER_IQID_FORMAT, uID);
@@ -204,14 +204,14 @@ void RequestMail(LPCTSTR jidWithRes, IJabberInterface *ji) if (node) xi.destroyNode(node);
}
-BOOL TimerHandler(IJabberInterface *ji, HXML node, void *pUserData)
+BOOL TimerHandler(IJabberInterface *ji, HXML, void *pUserData)
{
RequestMail((LPCTSTR)pUserData, ji);
free(pUserData);
return FALSE;
}
-BOOL NewMailHandler(IJabberInterface *ji, HXML node, void *pUserData)
+BOOL NewMailHandler(IJabberInterface *ji, HXML node, void *)
{
HXML response = xi.createNode(NODENAME_IQ, NULL, FALSE);
__try {
@@ -245,7 +245,7 @@ void SetNotificationSetting(LPCTSTR jidWithResource, IJabberInterface *ji) xi.addAttr(node, ATTRNAME_TYPE, IQTYPE_SET);
xi.addAttr(node, ATTRNAME_FROM, jidWithResource);
- ptrT jid( ExtractJid(jidWithResource));
+ ptrT jid(ExtractJid(jidWithResource));
xi.addAttr(node, ATTRNAME_TO, jid);
TCHAR id[30];
@@ -264,7 +264,7 @@ void SetNotificationSetting(LPCTSTR jidWithResource, IJabberInterface *ji) if (node) xi.destroyNode(node);
}
-BOOL DiscoverHandler(IJabberInterface *ji, HXML node, void *pUserData)
+BOOL DiscoverHandler(IJabberInterface *ji, HXML node, void *)
{
if (!node) return FALSE;
@@ -285,7 +285,7 @@ BOOL DiscoverHandler(IJabberInterface *ji, HXML node, void *pUserData) return FALSE;
}
-BOOL SendHandler(IJabberInterface *ji, HXML node, void *pUserData)
+BOOL SendHandler(IJabberInterface *ji, HXML node, void *)
{
GoogleTalkAcc *gta = isGoogle(LPARAM(ji));
if (gta == NULL)
@@ -295,10 +295,10 @@ BOOL SendHandler(IJabberInterface *ji, HXML node, void *pUserData) if (queryNode) {
LPCTSTR ptszId = xi.getAttrValue(node, ATTRNAME_ID);
if (ptszId)
- ji->AddTemporaryIqHandler(DiscoverHandler, JABBER_IQ_TYPE_RESULT, _ttoi(ptszId+4), NULL, RESPONSE_TIMEOUT, 500);
+ ji->AddTemporaryIqHandler(DiscoverHandler, JABBER_IQ_TYPE_RESULT, _ttoi(ptszId + 4), NULL, RESPONSE_TIMEOUT, 500);
}
- if ( !mir_tstrcmp(xi.getName(node), _T("presence")) && xi.getAttrValue(node, ATTRNAME_TO) == 0) {
+ if (!mir_tstrcmp(xi.getName(node), _T("presence")) && xi.getAttrValue(node, ATTRNAME_TO) == 0) {
if (!gta->m_bGoogleSharedStatus)
return FALSE;
@@ -317,7 +317,7 @@ BOOL SendHandler(IJabberInterface *ji, HXML node, void *pUserData) /////////////////////////////////////////////////////////////////////////////////////////
// Google shared status
-BOOL OnIqResultGoogleSharedStatus(IJabberInterface *ji, HXML node, void *pUserData)
+BOOL OnIqResultGoogleSharedStatus(IJabberInterface *ji, HXML node, void *)
{
GoogleTalkAcc *gta = isGoogle(LPARAM(ji));
if (gta != NULL) {
@@ -327,7 +327,7 @@ BOOL OnIqResultGoogleSharedStatus(IJabberInterface *ji, HXML node, void *pUserDa return FALSE;
}
-BOOL OnIqSetGoogleSharedStatus(IJabberInterface *ji, HXML iqNode, void *pUserData)
+BOOL OnIqSetGoogleSharedStatus(IJabberInterface *ji, HXML iqNode, void *)
{
GoogleTalkAcc *gta = isGoogle(LPARAM(ji));
if (gta == NULL)
@@ -343,7 +343,7 @@ BOOL OnIqSetGoogleSharedStatus(IJabberInterface *ji, HXML iqNode, void *pUserDat if (0 == _tcsicmp(_T("true"), xi.getAttrValue(node, _T("value"))))
status = ID_STATUS_INVISIBLE;
else {
- LPCTSTR txt = xi.getText( xi.getChildByPath(query, _T("show"), 0));
+ LPCTSTR txt = xi.getText(xi.getChildByPath(query, _T("show"), 0));
if (txt && 0 == _tcsicmp(_T("dnd"), txt))
status = ID_STATUS_DND;
else if (gta->m_pa->ppro->m_iStatus == ID_STATUS_DND || gta->m_pa->ppro->m_iStatus == ID_STATUS_INVISIBLE)
@@ -367,18 +367,18 @@ void GoogleTalkAcc::SendIqGoogleSharedStatus(LPCTSTR status, LPCTSTR msg) xi.addChild(query, ATTRNAME_XMLNS, JABBER_FEAT_GTALK_SHARED_STATUS);
xi.addAttrInt(query, _T("version"), 2);
- HXML statNode = xi.addChild(query, _T("status"), msg);
- if ( !mir_tstrcmp(status, _T("invisible"))) {
+ xi.addChild(query, _T("status"), msg);
+ if (!mir_tstrcmp(status, _T("invisible"))) {
xi.addChild(query, _T("show"), _T("default"));
- xi.addAttr( xi.addChild(query, _T("invisible"), 0), _T("value"), _T("true"));
+ xi.addAttr(xi.addChild(query, _T("invisible"), 0), _T("value"), _T("true"));
}
else {
- if ( !mir_tstrcmp(status, _T("dnd")))
+ if (!mir_tstrcmp(status, _T("dnd")))
xi.addChild(query, _T("show"), _T("dnd"));
else
xi.addChild(query, _T("show"), _T("default"));
- xi.addAttr( xi.addChild(query, _T("invisible"), 0), _T("value"), _T("false"));
+ xi.addAttr(xi.addChild(query, _T("invisible"), 0), _T("value"), _T("false"));
}
m_bGoogleSharedStatusLock = TRUE;
m_japi->SendXmlNode(iq);
@@ -394,7 +394,7 @@ int OnServerDiscoInfo(WPARAM wParam, LPARAM lParam) // m_ThreadInfo->jabberServerCaps |= JABBER_CAPS_PING;
JABBER_DISCO_FIELD *fld = (JABBER_DISCO_FIELD*)wParam;
- if ( !mir_tstrcmp(fld->category, _T("server")) && !mir_tstrcmp(fld->type, _T("im")) && !mir_tstrcmp(fld->name, _T("Google Talk"))) {
+ if (!mir_tstrcmp(fld->category, _T("server")) && !mir_tstrcmp(fld->type, _T("im")) && !mir_tstrcmp(fld->name, _T("Google Talk"))) {
HXML iq = xi.createNode(NODENAME_IQ, NULL, FALSE);
xi.addAttr(iq, ATTRNAME_TYPE, IQTYPE_GET);
@@ -440,7 +440,7 @@ static void sttCreateInstance(LPCSTR szModuleName) if (japi == NULL)
return;
- ptrA host( db_get_sa(NULL, szModuleName, "ManualHost"));
+ ptrA host(db_get_sa(NULL, szModuleName, "ManualHost"));
if (host == NULL || strcmp(host, "talk.google.com"))
return;
@@ -463,12 +463,12 @@ int AccListChanged(WPARAM wParam, LPARAM lParam) return 0;
}
-int ModulesLoaded(WPARAM wParam, LPARAM lParam)
+int ModulesLoaded(WPARAM, LPARAM)
{
int count;
PROTOACCOUNT **protos;
ProtoEnumAccounts(&count, &protos);
- for (int i=0; i < count; i++)
+ for (int i = 0; i < count; i++)
sttCreateInstance(protos[i]->szModuleName);
HookEvent(ME_JABBER_MENUINIT, InitMenus);
diff --git a/protocols/GTalkExt/src/inbox.cpp b/protocols/GTalkExt/src/inbox.cpp index 218c3d28bc..5fa07c9bed 100644 --- a/protocols/GTalkExt/src/inbox.cpp +++ b/protocols/GTalkExt/src/inbox.cpp @@ -36,7 +36,7 @@ #define TOKEN_AUTH_URL "https://www.google.com/accounts/TokenAuth?auth=%s&service=mail&continue=%s&source=googletalk"
-const NETLIBHTTPHEADER HEADER_URL_ENCODED = {"Content-Type", "application/x-www-form-urlencoded"};
+const NETLIBHTTPHEADER HEADER_URL_ENCODED = { "Content-Type", "application/x-www-form-urlencoded" };
#define HTTP_OK 200
#define SID_KEY_NAME "SID="
@@ -77,7 +77,7 @@ LPSTR HttpPost(HANDLE hUser, LPSTR reqUrl, LPSTR reqParams) LPSTR MakeRequest(HANDLE hUser, LPSTR reqUrl, LPSTR reqParamsFormat, LPSTR p1, LPSTR p2)
{
- ptrA encodedP1( mir_urlEncode(p1)), encodedP2( mir_urlEncode(p2));
+ ptrA encodedP1(mir_urlEncode(p1)), encodedP2(mir_urlEncode(p2));
size_t size = mir_strlen(reqParamsFormat) + 1 + mir_strlen(encodedP1) + mir_strlen(encodedP2);
LPSTR reqParams = (LPSTR)alloca(size);
mir_snprintf(reqParams, size, reqParamsFormat, encodedP1, encodedP2);
@@ -106,7 +106,7 @@ LPSTR FindSid(LPSTR resp, LPSTR *LSID) void DoOpenUrl(LPSTR tokenResp, LPSTR url)
{
- ptrA encodedUrl( mir_urlEncode(url)), encodedToken( mir_urlEncode(tokenResp));
+ ptrA encodedUrl(mir_urlEncode(url)), encodedToken(mir_urlEncode(tokenResp));
size_t size = mir_strlen(TOKEN_AUTH_URL) + 1 + mir_strlen(encodedToken) + mir_strlen(encodedUrl);
LPSTR composedUrl = (LPSTR)alloca(size);
mir_snprintf(composedUrl, size, TOKEN_AUTH_URL, encodedToken, encodedUrl);
@@ -115,13 +115,13 @@ void DoOpenUrl(LPSTR tokenResp, LPSTR url) BOOL AuthAndOpen(HANDLE hUser, LPSTR url, LPSTR mailbox, LPSTR pwd)
{
- ptrA authResp( MakeRequest(hUser, AUTH_REQUEST_URL, AUTH_REQUEST_PARAMS, mailbox, pwd));
+ ptrA authResp(MakeRequest(hUser, AUTH_REQUEST_URL, AUTH_REQUEST_PARAMS, mailbox, pwd));
if (!authResp)
return FALSE;
LPSTR LSID;
LPSTR SID = FindSid(authResp, &LSID);
- ptrA tokenResp( MakeRequest(hUser, ISSUE_TOKEN_REQUEST_URL, ISSUE_TOKEN_REQUEST_PARAMS, SID, LSID));
+ ptrA tokenResp(MakeRequest(hUser, ISSUE_TOKEN_REQUEST_URL, ISSUE_TOKEN_REQUEST_PARAMS, SID, LSID));
if (!tokenResp)
return FALSE;
@@ -148,14 +148,14 @@ HANDLE FindNetUserHandle(LPCSTR acc) void OpenUrlThread(void *param)
{
OPEN_URL_HEADER* data = (OPEN_URL_HEADER*)param;
-
+
HANDLE hUser = FindNetUserHandle(data->acc);
if (!hUser || !AuthAndOpen(hUser, data->url, data->mailbox, data->pwd))
CallService(MS_UTILS_OPENURL, 0, (LPARAM)data->url);
free(data);
}
-int GetMailboxPwd(LPCSTR acc, LPCTSTR mailbox, LPSTR *pwd, int buffSize)
+int GetMailboxPwd(LPCSTR acc, LPSTR *pwd, int buffSize)
{
char buff[256];
if (db_get_static(NULL, acc, LOGIN_PASS_SETTING_NAME, buff, sizeof(buff)))
@@ -174,7 +174,7 @@ int GetMailboxPwd(LPCSTR acc, LPCTSTR mailbox, LPSTR *pwd, int buffSize) BOOL OpenUrlWithAuth(LPCSTR acc, LPCTSTR mailbox, LPCTSTR url)
{
- int pwdLen = GetMailboxPwd(acc, mailbox, NULL, 0);
+ int pwdLen = GetMailboxPwd(acc, NULL, 0);
if (!pwdLen++) return FALSE;
size_t urlLen = mir_tstrlen(url) + 1;
@@ -188,7 +188,7 @@ BOOL OpenUrlWithAuth(LPCSTR acc, LPCTSTR mailbox, LPCTSTR url) memcpy(data->mailbox, _T2A(mailbox), mailboxLen);
data->pwd = data->mailbox + mailboxLen;
- if (!GetMailboxPwd(acc, mailbox, &data->pwd, pwdLen))
+ if (!GetMailboxPwd(acc, &data->pwd, pwdLen))
return FALSE;
data->acc = acc;
@@ -211,7 +211,7 @@ void OpenUrl(LPCSTR acc, LPCTSTR mailbox, LPCTSTR url) void OpenContactInbox(LPCSTR szModuleName)
{
- ptrT tszJid( db_get_tsa(0, szModuleName, "jid"));
+ ptrT tszJid(db_get_tsa(0, szModuleName, "jid"));
if (tszJid == NULL)
return;
diff --git a/protocols/GTalkExt/src/menu.cpp b/protocols/GTalkExt/src/menu.cpp index 7d09ec15fa..b640317fe3 100644 --- a/protocols/GTalkExt/src/menu.cpp +++ b/protocols/GTalkExt/src/menu.cpp @@ -29,7 +29,7 @@ extern HICON g_hPopupIcon;
-INT_PTR OpenMailboxMenuHandler(WPARAM wParam, LPARAM lParam, LPARAM param)
+INT_PTR OpenMailboxMenuHandler(WPARAM, LPARAM, LPARAM param)
{
OpenContactInbox((LPCSTR)param);
return 0;
diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp index dd72fefa24..7b56eabf26 100644 --- a/protocols/GTalkExt/src/notifications.cpp +++ b/protocols/GTalkExt/src/notifications.cpp @@ -52,10 +52,10 @@ LPCSTR GetJidAcc(LPCTSTR jid) int count = 0;
PROTOACCOUNT **protos;
ProtoEnumAccounts(&count, &protos);
- for (int i=0; i < count; i++) {
- if ( getJabberApi(protos[i]->szModuleName)) {
- ptrT tszJid( db_get_tsa(0, protos[i]->szModuleName, "jid"));
- if ( !mir_tstrcmpi(jid, tszJid))
+ for (int i = 0; i < count; i++) {
+ if (getJabberApi(protos[i]->szModuleName)) {
+ ptrT tszJid(db_get_tsa(0, protos[i]->szModuleName, "jid"));
+ if (!mir_tstrcmpi(jid, tszJid))
return protos[i]->szModuleName;
}
}
@@ -66,10 +66,10 @@ LPCSTR GetJidAcc(LPCTSTR jid) void MarkEventRead(MCONTACT hCnt, HANDLE hEvt)
{
DWORD settings = (DWORD)TlsGetValue(itlsSettings);
- if ( ReadCheckbox(0, IDC_POPUPSENABLED, settings) &&
- ReadCheckbox(0, IDC_PSEUDOCONTACTENABLED, settings) &&
- ReadCheckbox(0, IDC_MARKEVENTREAD, settings) &&
- db_event_markRead(hCnt, hEvt) != -1)
+ if (ReadCheckbox(0, IDC_POPUPSENABLED, settings) &&
+ ReadCheckbox(0, IDC_PSEUDOCONTACTENABLED, settings) &&
+ ReadCheckbox(0, IDC_MARKEVENTREAD, settings) &&
+ db_event_markRead(hCnt, hEvt) != -1)
CallService(MS_CLIST_REMOVEEVENT, (WPARAM)hCnt, (LPARAM)hEvt);
}
@@ -107,20 +107,20 @@ LRESULT CALLBACK PopupProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam) return 0;
case UM_FREEPLUGINDATA:
- {
- HANDLE hHook = GetProp(wnd, EVT_DELETED_HOOK_PROP_NAME);
- RemoveProp(wnd, EVT_DELETED_HOOK_PROP_NAME);
- UnhookEvent(hHook);
- }
+ {
+ HANDLE hHook = GetProp(wnd, EVT_DELETED_HOOK_PROP_NAME);
+ RemoveProp(wnd, EVT_DELETED_HOOK_PROP_NAME);
+ UnhookEvent(hHook);
+ }
- if (ppdh->MarkRead && ppdh->hDbEvent && (acc = GetJidAcc(ppdh->jid))) {
- ReadNotificationSettings(acc);
- MarkEventRead(ppdh->hContact, ppdh->hDbEvent);
- CallService(MS_CLIST_REMOVEEVENT, (WPARAM)ppdh->hContact, (LPARAM)ppdh->hDbEvent);
- }
- RemoveProp(wnd, PLUGIN_DATA_PROP_NAME);
- free(ppdh);
- return 0;
+ if (ppdh->MarkRead && ppdh->hDbEvent && (acc = GetJidAcc(ppdh->jid))) {
+ ReadNotificationSettings(acc);
+ MarkEventRead(ppdh->hContact, ppdh->hDbEvent);
+ CallService(MS_CLIST_REMOVEEVENT, (WPARAM)ppdh->hContact, (LPARAM)ppdh->hDbEvent);
+ }
+ RemoveProp(wnd, PLUGIN_DATA_PROP_NAME);
+ free(ppdh);
+ return 0;
case WM_LBUTTONUP:
acc = NULL;
@@ -144,7 +144,7 @@ LRESULT CALLBACK PopupProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam) static bool DoAddPopup(POPUPDATAT *data)
{
- if ( ReadCheckbox(0, IDC_POPUPSINFULLSCREEN, (DWORD)TlsGetValue(itlsSettings)) && IsFullScreen()) {
+ if (ReadCheckbox(0, IDC_POPUPSINFULLSCREEN, (DWORD)TlsGetValue(itlsSettings)) && IsFullScreen()) {
HWND handle = CreateWindowEx(WS_EX_TOOLWINDOW, TEMP_WINDOW_CLASS_NAME, NULL, WS_OVERLAPPED | WS_VISIBLE, -100, -100, 10, 10, 0, 0, 0, 0);
if (handle) {
ShowWindow(handle, SW_MINIMIZE);
@@ -158,7 +158,7 @@ static bool DoAddPopup(POPUPDATAT *data) void FormatPseudocontactDisplayName(LPTSTR buff, LPCTSTR jid, LPCTSTR unreadCount)
{
- if (mir_tstrcmp(unreadCount, _T("0")))
+ if (mir_tstrcmp(unreadCount, _T("0")))
wsprintf(buff, _T("%s [%s]"), jid, unreadCount); //!!!!!!!!!!!
else
wsprintf(buff, _T("%s"), jid); //!!!!!!!!!!!
@@ -188,9 +188,9 @@ MCONTACT SetupPseudocontact(LPCTSTR jid, LPCTSTR unreadCount, LPCSTR acc, LPCTST return hContact;
}
-HANDLE AddCListNotification(MCONTACT hContact, LPCSTR acc, POPUPDATAT *data, LPCTSTR jid, LPCTSTR url, LPCTSTR unreadCount)
+HANDLE AddCListNotification(MCONTACT hContact, LPCSTR acc, POPUPDATAT *data, LPCTSTR url)
{
- mir_ptr<char> szUrl( mir_utf8encodeT(url)), szText( mir_utf8encodeT(data->lptzText));
+ mir_ptr<char> szUrl(mir_utf8encodeT(url)), szText(mir_utf8encodeT(data->lptzText));
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.szModule = (LPSTR)acc;
@@ -215,7 +215,7 @@ void ShowNotification(LPCSTR acc, POPUPDATAT *data, LPCTSTR jid, LPCTSTR url, LP {
MCONTACT hCnt = SetupPseudocontact(jid, unreadCount, acc, &data->lptzContactName[0]);
HANDLE hEvt = ReadCheckbox(0, IDC_PSEUDOCONTACTENABLED, (DWORD)TlsGetValue(itlsSettings))
- ? AddCListNotification(hCnt, acc, data, jid, url, unreadCount) : NULL;
+ ? AddCListNotification(hCnt, acc, data, url) : NULL;
if (!UsePopups())
return;
@@ -245,13 +245,13 @@ void ShowNotification(LPCSTR acc, POPUPDATAT *data, LPCTSTR jid, LPCTSTR url, LP memcpy(ppdh->url, url, lurl);
data->PluginData = ppdh;
- if ( !DoAddPopup(data))
+ if (!DoAddPopup(data))
free(data->PluginData);
}
void UnreadMailNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unreadCount)
{
- POPUPDATAT data = {0};
+ POPUPDATAT data = { 0 };
FormatPseudocontactDisplayName(&data.lptzContactName[0], jid, unreadCount);
mir_sntprintf(data.lptzText, SIZEOF(data.lptzText), TranslateT("You've received an e-mail\n%s unread threads"), unreadCount);
@@ -261,7 +261,7 @@ void UnreadMailNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unread void UnreadThreadNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unreadCount, const MAIL_THREAD_NOTIFICATION *mtn)
{
- POPUPDATAT data = {0};
+ POPUPDATAT data = { 0 };
FormatPseudocontactDisplayName(&data.lptzContactName[0], jid, unreadCount);
LPTSTR senders = (LPTSTR)malloc(SENDER_COUNT * 100 * sizeof(TCHAR));
@@ -275,7 +275,7 @@ void UnreadThreadNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unre currSender += mir_tstrlen(currSender);
}
- if ( ReadCheckbox(0, IDC_ADDSNIP, (DWORD)TlsGetValue(itlsSettings)))
+ if (ReadCheckbox(0, IDC_ADDSNIP, (DWORD)TlsGetValue(itlsSettings)))
mir_sntprintf(data.lptzText, SIZEOF(data.lptzText), TranslateTS(FULL_NOTIFICATION_FORMAT), mtn->subj, senders, mtn->snip);
else
mir_sntprintf(data.lptzText, SIZEOF(data.lptzText), TranslateTS(SHORT_NOTIFICATION_FORMAT), mtn->subj, senders);
@@ -332,10 +332,10 @@ void CloseNotifications(LPCSTR acc, LPCTSTR url, LPCTSTR jid, BOOL PopupsOnly) {
DWORD settings = (DWORD)TlsGetValue(itlsSettings);
if (acc && !PopupsOnly &&
- ReadCheckbox(0, IDC_PSEUDOCONTACTENABLED, settings) &&
- ReadCheckbox(0, IDC_CLEARPSEUDOCONTACTLOG, settings))
+ ReadCheckbox(0, IDC_PSEUDOCONTACTENABLED, settings) &&
+ ReadCheckbox(0, IDC_CLEARPSEUDOCONTACTLOG, settings))
ClearNotificationContactHistory(acc);
- POPUP_IDENT_STRINGS pis = {url, jid};
+ POPUP_IDENT_STRINGS pis = { url, jid };
EnumWindows(ClosePopupFunc, (LPARAM)&pis);
}
diff --git a/protocols/GTalkExt/src/options.cpp b/protocols/GTalkExt/src/options.cpp index f75d6cbe3f..89099c4fd1 100644 --- a/protocols/GTalkExt/src/options.cpp +++ b/protocols/GTalkExt/src/options.cpp @@ -226,7 +226,7 @@ INT_PTR CALLBACK PopupsOptionsDlgProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM /////////////////////////////////////////////////////////////////////////////////////////
-int OptionsInitialization(WPARAM wParam, LPARAM lParam)
+int OptionsInitialization(WPARAM wParam, LPARAM)
{
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
@@ -239,7 +239,7 @@ int OptionsInitialization(WPARAM wParam, LPARAM lParam) Options_AddPage(wParam, &odp);
}
- for (int i=0; i < g_accs.getCount(); i++) {
+ for (int i = 0; i < g_accs.getCount(); i++) {
LPCSTR szProto = g_accs[i]->m_pa->szModuleName;
PROTOACCOUNT *pa = ProtoGetAccount(szProto);
if (pa != NULL) {
diff --git a/protocols/GTalkExt/src/tipper_items.cpp b/protocols/GTalkExt/src/tipper_items.cpp index e2420305b9..a17127abda 100644 --- a/protocols/GTalkExt/src/tipper_items.cpp +++ b/protocols/GTalkExt/src/tipper_items.cpp @@ -74,15 +74,15 @@ void SetLabelProp(int index, LPSTR setting) {
sprintf(setting, LABEL_SETTING_PROP, index); //!!!!!!!!!!!!!!
- ptrT tszProp( db_get_tsa(0, TIPPER_ITEMS_MOD_NAME, setting));
+ ptrT tszProp(db_get_tsa(0, TIPPER_ITEMS_MOD_NAME, setting));
if (tszProp == NULL)
return;
- ptrT tszLastWritten( db_get_tsa(0, SHORT_PLUGIN_NAME, LAST_WRITTEN_LABEL_SETTING));
+ ptrT tszLastWritten(db_get_tsa(0, SHORT_PLUGIN_NAME, LAST_WRITTEN_LABEL_SETTING));
if (tszLastWritten == NULL)
return;
- if ( !mir_tstrcmp(tszProp, tszLastWritten)) {
+ if (!mir_tstrcmp(tszProp, tszLastWritten)) {
LPTSTR label = TranslateTS(UNREAD_THREADS_LABEL);
db_set_ts(0, SHORT_PLUGIN_NAME, LAST_WRITTEN_LABEL_SETTING, label);
db_set_ts(0, TIPPER_ITEMS_MOD_NAME, setting, label);
@@ -103,9 +103,9 @@ void AddTipperItem() for (i = 0; i < itemCount; i++) {
mir_snprintf(setting, l, VALUE_SETTING_PROP, i);
- ptrT tszSetting( db_get_tsa(0, TIPPER_ITEMS_MOD_NAME, setting));
+ ptrT tszSetting(db_get_tsa(0, TIPPER_ITEMS_MOD_NAME, setting));
if (tszSetting) {
- if ( !mir_tstrcmp(UNREAD_THREADS_RAW, tszSetting)) {
+ if (!mir_tstrcmp(UNREAD_THREADS_RAW, tszSetting)) {
SetLabelProp(i, setting);
return;
}
@@ -115,10 +115,10 @@ void AddTipperItem() for (i = 0; i < SIZEOF(TipperItemProps); i++)
ShiftTipperSettings(setting, itemCount, TipperItemProps[i]);
- #define WRITE_TIPPER_PROPS(index, value)\
+#define WRITE_TIPPER_PROPS(index, value)\
mir_snprintf(setting, l, TipperItemProps[##index##], 0);\
db_set_ts(0, TIPPER_ITEMS_MOD_NAME, setting, ##value##)
- #define WRITE_TIPPER_PROPB(index, value)\
+#define WRITE_TIPPER_PROPB(index, value)\
mir_snprintf(setting, l, TipperItemProps[##index##], 0);\
db_set_b(0, TIPPER_ITEMS_MOD_NAME, setting, ##value##)
@@ -133,5 +133,5 @@ void AddTipperItem() WRITE_TIPPER_PROPS(4, UNREAD_THREADS_RAW);
WRITE_TIPPER_PROPB(5, 1);
- db_set_w(0, TIPPER_ITEMS_MOD_NAME, TIPPER_ITEM_COUNT_SETTING, itemCount+1);
+ db_set_w(0, TIPPER_ITEMS_MOD_NAME, TIPPER_ITEM_COUNT_SETTING, itemCount + 1);
}
\ No newline at end of file |