summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-02 20:55:18 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-02 20:55:18 +0000
commit78c0815c4118fe24ab78cce2dc48a6232dcd824a (patch)
tree8512c50df70b8dd80c919e88ade3419207c95956 /protocols/Gadu-Gadu
parentce816d83a8c75808e0eb06832592bffefe4a8dc4 (diff)
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Gadu-Gadu')
-rw-r--r--protocols/Gadu-Gadu/core.c52
-rw-r--r--protocols/Gadu-Gadu/dialogs.c6
-rw-r--r--protocols/Gadu-Gadu/filetransfer.c22
-rw-r--r--protocols/Gadu-Gadu/groupchat.c24
-rw-r--r--protocols/Gadu-Gadu/import.c6
-rw-r--r--protocols/Gadu-Gadu/oauth.c12
-rw-r--r--protocols/Gadu-Gadu/ownerinfo.c4
-rw-r--r--protocols/Gadu-Gadu/services.c24
-rw-r--r--protocols/Gadu-Gadu/token.c2
-rw-r--r--protocols/Gadu-Gadu/userutils.c16
10 files changed, 84 insertions, 84 deletions
diff --git a/protocols/Gadu-Gadu/core.c b/protocols/Gadu-Gadu/core.c
index ea739c6dce..4f1ac840bd 100644
--- a/protocols/Gadu-Gadu/core.c
+++ b/protocols/Gadu-Gadu/core.c
@@ -207,10 +207,10 @@ int gg_decodehosts(char *var, GGHOST *hosts, int max)
*(var - 1) = 0;
portname = var;
while(var && *var && isdigit(*var)) var++;
- if(*var) { *var = 0; var ++; }
+ if (*var) { *var = 0; var ++; }
}
else
- if(*var) { *var = 0; var ++; }
+ if (*var) { *var = 0; var ++; }
// Insert new item
hosts[hp].hostname[127] = 0;
@@ -315,7 +315,7 @@ void __cdecl gg_mainthread(GGPROTO *gg, void *empty)
// Check out manual host setting
if(DBGetContactSettingByte(NULL, GG_PROTO, GG_KEY_MANUALHOST, GG_KEYDEF_MANUALHOST))
{
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_SERVERHOSTS, &dbv))
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_SERVERHOSTS, &dbv))
{
hostcount = gg_decodehosts(dbv.pszVal, hosts, 64);
DBFreeVariant(&dbv);
@@ -323,7 +323,7 @@ void __cdecl gg_mainthread(GGPROTO *gg, void *empty)
}
// Readup password
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_PASSWORD, &dbv))
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_PASSWORD, &dbv))
{
CallService(MS_DB_CRYPT_DECODESTRING, strlen(dbv.pszVal) + 1, (LPARAM) dbv.pszVal);
p.password = mir_strdup(dbv.pszVal);
@@ -337,7 +337,7 @@ void __cdecl gg_mainthread(GGPROTO *gg, void *empty)
}
// Readup number
- if(!(p.uin = DBGetContactSettingDword(NULL, GG_PROTO, GG_KEY_UIN, 0)))
+ if (!(p.uin = DBGetContactSettingDword(NULL, GG_PROTO, GG_KEY_UIN, 0)))
{
gg_netlog(gg, "gg_mainthread(%x): No Gadu-Gadu number specified. Exiting.", gg);
gg_broadcastnewstatus(gg, ID_STATUS_OFFLINE);
@@ -354,7 +354,7 @@ void __cdecl gg_mainthread(GGPROTO *gg, void *empty)
////////////////////////////// DCC STARTUP /////////////////////////////
// Uin is ok so startup dcc if not started already
- if(!gg->dcc)
+ if (!gg->dcc)
{
gg->event = CreateEvent(NULL, TRUE, FALSE, NULL);
gg_dccstart(gg);
@@ -369,9 +369,9 @@ void __cdecl gg_mainthread(GGPROTO *gg, void *empty)
// Check if dcc is running and setup forwarding port
if(gg->dcc && DBGetContactSettingByte(NULL, GG_PROTO, GG_KEY_FORWARDING, GG_KEYDEF_FORWARDING))
{
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_FORWARDHOST, &dbv))
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_FORWARDHOST, &dbv))
{
- if(!(p.external_addr = gg_dnslookup(gg, dbv.pszVal)))
+ if (!(p.external_addr = gg_dnslookup(gg, dbv.pszVal)))
{
char error[128];
mir_snprintf(error, sizeof(error), Translate("External direct connections hostname %s is invalid. Disabling external host forwarding."), dbv.pszVal);
@@ -399,7 +399,7 @@ retry:
// Check manual hosts
if(hostnum < hostcount)
{
- if(!(p.server_addr = gg_dnslookup(gg, hosts[hostnum].hostname)))
+ if (!(p.server_addr = gg_dnslookup(gg, hosts[hostnum].hostname)))
{
char error[128];
mir_snprintf(error, sizeof(error), Translate("Server hostname %s is invalid. Using default hostname provided by the network."), hosts[hostnum].hostname);
@@ -510,7 +510,7 @@ retry:
while(gg_isonline(gg))
{
// Connection broken/closed
- if(!(e = gg_watch_fd(gg->sess)))
+ if (!(e = gg_watch_fd(gg->sess)))
{
gg_netlog(gg, "gg_mainthread(%x): Connection closed.", gg);
EnterCriticalSection(&gg->sess_mutex);
@@ -814,12 +814,12 @@ retry:
// Received message
case GG_EVENT_MSG:
// This is CTCP request
- if((e->event.msg.msgclass & GG_CLASS_CTCP))
+ if ((e->event.msg.msgclass & GG_CLASS_CTCP))
{
gg_dccconnect(gg, e->event.msg.sender);
}
// Check if not conference and block
- else if(!e->event.msg.recipients_count || gg->gc_enabled)
+ else if (!e->event.msg.recipients_count || gg->gc_enabled)
{
// Check if groupchat
if(e->event.msg.recipients_count && gg->gc_enabled && !DBGetContactSettingByte(NULL, GG_PROTO, GG_KEY_IGNORECONF, GG_KEYDEF_IGNORECONF))
@@ -844,7 +844,7 @@ retry:
}
}
// Check if not empty message ( who needs it? )
- else if(!e->event.msg.recipients_count && e->event.msg.message && *e->event.msg.message && strcmp(e->event.msg.message, "\xA0\0"))
+ else if (!e->event.msg.recipients_count && e->event.msg.message && *e->event.msg.message && strcmp(e->event.msg.message, "\xA0\0"))
{
CCSDATA ccs = {0};
PROTORECVEVENT pre = {0};
@@ -994,7 +994,7 @@ retry:
HANDLE hContact = gg_getcontact(gg, e->event.image_reply.sender, 1, 0, NULL);
void *img = (void *)gg_img_loadpicture(gg, e, 0);
- if(!img)
+ if (!img)
break;
if(DBGetContactSettingByte(NULL, GG_PROTO, GG_KEY_IMGMETHOD, GG_KEYDEF_IMGMETHOD) == 1 || gg_img_opened(gg, e->event.image_reply.sender))
@@ -1038,7 +1038,7 @@ retry:
dcc7->contact = gg_getcontact(gg, dcc7->peer_uin, 0, 0, NULL);
// Check if user is on the list and if it is my uin
- if(!dcc7->contact || DBGetContactSettingDword(NULL, GG_PROTO, GG_KEY_UIN, -1) != dcc7->uin) {
+ if (!dcc7->contact || DBGetContactSettingDword(NULL, GG_PROTO, GG_KEY_UIN, -1) != dcc7->uin) {
gg_dcc7_free(dcc7);
e->event.dcc7_new = NULL;
break;
@@ -1327,11 +1327,11 @@ int gg_dbsettingchanged(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
char *szProto = NULL;
// Check if the contact is NULL or we are not online
- if(!gg_isonline(gg))
+ if (!gg_isonline(gg))
return 0;
// If contact has been blocked
- if(!strcmp(cws->szModule, GG_PROTO) && !strcmp(cws->szSetting, GG_KEY_BLOCK))
+ if (!strcmp(cws->szModule, GG_PROTO) && !strcmp(cws->szSetting, GG_KEY_BLOCK))
{
gg_notifyuser(gg, hContact, 1);
return 0;
@@ -1348,7 +1348,7 @@ int gg_dbsettingchanged(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
{
// Most important... check redundancy (fucking cascading)
static int cascade = 0;
- if(!cascade && dbv.pszVal)
+ if (!cascade && dbv.pszVal)
{
GCDEST gcdest = {GG_PROTO, dbv.pszVal, GC_EVENT_CHANGESESSIONAME};
GCEVENT gcevent = {sizeof(GCEVENT), &gcdest};
@@ -1367,14 +1367,14 @@ int gg_dbsettingchanged(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
}
// Contact list changes
- if(!strcmp(cws->szModule, "CList"))
+ if (!strcmp(cws->szModule, "CList"))
{
// If name changed... change nick
- if(!strcmp(cws->szSetting, "MyHandle") && cws->value.type == DBVT_ASCIIZ && cws->value.pszVal)
+ if (!strcmp(cws->szSetting, "MyHandle") && cws->value.type == DBVT_ASCIIZ && cws->value.pszVal)
DBWriteContactSettingString(hContact, GG_PROTO, GG_KEY_NICK, cws->value.pszVal);
// If not on list changed
- if(!strcmp(cws->szSetting, "NotOnList"))
+ if (!strcmp(cws->szSetting, "NotOnList"))
{
if(DBGetContactSettingByte(hContact, "CList", "Hidden", 0))
return 0;
@@ -1540,7 +1540,7 @@ HANDLE gg_getcontact(GGPROTO *gg, uin_t uin, int create, int inlist, char *szNic
szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
if(szProto != NULL && !strcmp(szProto, GG_PROTO))
{
- if((uin_t)DBGetContactSettingDword(hContact, GG_PROTO, GG_KEY_UIN, 0) == uin
+ if ((uin_t)DBGetContactSettingDword(hContact, GG_PROTO, GG_KEY_UIN, 0) == uin
&& DBGetContactSettingByte(hContact, GG_PROTO, "ChatRoom", 0) == 0)
{
if(inlist)
@@ -1553,11 +1553,11 @@ HANDLE gg_getcontact(GGPROTO *gg, uin_t uin, int create, int inlist, char *szNic
}
hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
}
- if(!create) return NULL;
+ if (!create) return NULL;
hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
- if(!hContact)
+ if (!hContact)
{
gg_netlog(gg, "gg_getcontact(): Failed to create Gadu-Gadu contact %s", szNick);
return NULL;
@@ -1572,7 +1572,7 @@ HANDLE gg_getcontact(GGPROTO *gg, uin_t uin, int create, int inlist, char *szNic
}
gg_netlog(gg, "gg_getcontact(): Added buddy: %d", uin);
- if(!inlist)
+ if (!inlist)
{
DBWriteContactSettingByte(hContact, "CList", "NotOnList", 1);
//DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
@@ -1743,7 +1743,7 @@ void gg_changecontactstatus(GGPROTO *gg, uin_t uin, int status, const char *ides
HANDLE hContact = gg_getcontact(gg, uin, 0, 0, NULL);
// Check if contact is on list
- if(!hContact) return;
+ if (!hContact) return;
// Write contact status
DBWriteContactSettingWord(hContact, GG_PROTO, GG_KEY_STATUS, (WORD)status_gg2m(gg, status));
diff --git a/protocols/Gadu-Gadu/dialogs.c b/protocols/Gadu-Gadu/dialogs.c
index 63a87570e6..b6bfc8f5c0 100644
--- a/protocols/Gadu-Gadu/dialogs.c
+++ b/protocols/Gadu-Gadu/dialogs.c
@@ -320,7 +320,7 @@ static INT_PTR CALLBACK gg_genoptsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
GetDlgItemText(hwndDlg, IDC_UIN, email, sizeof(email));
uin = atoi(email);
GetDlgItemText(hwndDlg, IDC_EMAIL, email, sizeof(email));
- if(!strlen(email))
+ if (!strlen(email))
MessageBox(
NULL,
Translate("You need to specify your registration e-mail first."),
@@ -724,7 +724,7 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
dat->updating = FALSE;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
// Add genders
- if(!dat->hContact)
+ if (!dat->hContact)
{
SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)_T("")); // 0
SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)Translate("Female")); // 1
@@ -920,7 +920,7 @@ int gg_details_init(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
}
// Start search for user data
- if((HANDLE)lParam == NULL)
+ if ((HANDLE)lParam == NULL)
gg_getinfo((PROTO_INTERFACE *)gg, NULL, 0);
return 0;
diff --git a/protocols/Gadu-Gadu/filetransfer.c b/protocols/Gadu-Gadu/filetransfer.c
index f738dfa774..cc55b993b8 100644
--- a/protocols/Gadu-Gadu/filetransfer.c
+++ b/protocols/Gadu-Gadu/filetransfer.c
@@ -45,7 +45,7 @@ void gg_dccstart(GGPROTO *gg)
}
// Check if we wan't direct connections
- if(!DBGetContactSettingByte(NULL, GG_PROTO, GG_KEY_DIRECTCONNS, GG_KEYDEF_DIRECTCONNS))
+ if (!DBGetContactSettingByte(NULL, GG_PROTO, GG_KEY_DIRECTCONNS, GG_KEYDEF_DIRECTCONNS))
{
gg_netlog(gg, "gg_dccstart(): No direct connections setup.");
if(gg->event) SetEvent(gg->event);
@@ -65,7 +65,7 @@ void gg_dccconnect(GGPROTO *gg, uin_t uin)
gg_netlog(gg, "gg_dccconnect(): Connecting to uin %d.", uin);
// If unknown user or not on list ignore
- if(!hContact) return;
+ if (!hContact) return;
// Read user IP and port
ip = swap32(DBGetContactSettingDword(hContact, GG_PROTO, GG_KEY_CLIENTIP, 0));
@@ -73,9 +73,9 @@ void gg_dccconnect(GGPROTO *gg, uin_t uin)
myuin = DBGetContactSettingDword(NULL, GG_PROTO, GG_KEY_UIN, 0);
// If not port nor ip nor my uin (?) specified
- if(!ip || !port || !uin) return;
+ if (!ip || !port || !uin) return;
- if(!(dcc = gg_dcc_get_file(ip, port, myuin, uin)))
+ if (!(dcc = gg_dcc_get_file(ip, port, myuin, uin)))
return;
// Add client dcc to watches
@@ -144,7 +144,7 @@ void __cdecl gg_dccmainthread(GGPROTO *gg, void *empty)
}
// Create listen socket on config direct port
- if(!(gg->dcc = gg_dcc_socket_create(uin, (uint16_t)DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_DIRECTPORT, GG_KEYDEF_DIRECTPORT))))
+ if (!(gg->dcc = gg_dcc_socket_create(uin, (uint16_t)DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_DIRECTPORT, GG_KEYDEF_DIRECTPORT))))
{
gg_netlog(gg, "gg_dccmainthread(): Cannot create DCC listen socket. Exiting.");
// Signalize mainthread we haven't start
@@ -652,7 +652,7 @@ HANDLE gg_sendfile(PROTO_INTERFACE *proto, HANDLE hContact, const PROTOCHAR* szD
uin_t myuin, uin;
// Check if main dcc thread is on
- if(!gg_isonline(gg)) return ftfail(gg, hContact);
+ if (!gg_isonline(gg)) return ftfail(gg, hContact);
filename = gg_t2a(ppszFiles[0]);
@@ -696,7 +696,7 @@ HANDLE gg_sendfile(PROTO_INTERFACE *proto, HANDLE hContact, const PROTOCHAR* szD
}
// Return if bad connection info
- if(!port || !uin || !myuin)
+ if (!port || !uin || !myuin)
{
gg_netlog(gg, "gg_sendfile(): Bad contact uin or my uin. Exit.");
mir_free(filename);
@@ -704,7 +704,7 @@ HANDLE gg_sendfile(PROTO_INTERFACE *proto, HANDLE hContact, const PROTOCHAR* szD
}
// Try to connect if not ask user to connect me
- if((ip && port >= 10 && !(dcc = gg_dcc_send_file(ip, port, myuin, uin))) || (port < 10 && port > 0))
+ if ((ip && port >= 10 && !(dcc = gg_dcc_send_file(ip, port, myuin, uin))) || (port < 10 && port > 0))
{
// Make fake dcc structure
dcc = malloc(sizeof(struct gg_dcc));
@@ -766,7 +766,7 @@ HANDLE gg_dccfileallow(GGPROTO *gg, HANDLE hTransfer, const PROTOCHAR* szPath)
LeaveCriticalSection(&gg->ft_mutex);
// Open file for appending and check if ok
- if((dcc->file_fd = _open(fileName, _O_WRONLY | _O_APPEND | _O_BINARY | _O_CREAT, _S_IREAD | _S_IWRITE)) == -1)
+ if ((dcc->file_fd = _open(fileName, _O_WRONLY | _O_APPEND | _O_BINARY | _O_CREAT, _S_IREAD | _S_IWRITE)) == -1)
{
gg_netlog(gg, "gg_dccfileallow(): Failed to create file \"%s\".", fileName);
ProtoBroadcastAck(GG_PROTO, dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0);
@@ -814,7 +814,7 @@ HANDLE gg_dcc7fileallow(GGPROTO *gg, HANDLE hTransfer, const PROTOCHAR* szPath)
}
// Open file for appending and check if ok
- if((dcc7->file_fd = _open(fileName, _O_WRONLY | _O_APPEND | _O_BINARY | _O_CREAT, _S_IREAD | _S_IWRITE)) == -1)
+ if ((dcc7->file_fd = _open(fileName, _O_WRONLY | _O_APPEND | _O_BINARY | _O_CREAT, _S_IREAD | _S_IWRITE)) == -1)
{
gg_netlog(gg, "gg_dcc7fileallow(): Failed to create file \"%s\".", fileName);
gg_dcc7_reject(dcc7, GG_DCC7_REJECT_USER);
@@ -973,7 +973,7 @@ int gg_filecancel(PROTO_INTERFACE *proto, HANDLE hContact, HANDLE hTransfer)
struct gg_common *c = (struct gg_common *) hTransfer;
// Check if its proper dcc
- if(!c) return 0;
+ if (!c) return 0;
if (c->type == GG_SESSION_DCC7_SEND || c->type == GG_SESSION_DCC7_GET)
return gg_dcc7filecancel((GGPROTO *) proto, hTransfer);
diff --git a/protocols/Gadu-Gadu/groupchat.c b/protocols/Gadu-Gadu/groupchat.c
index 26a797f163..9ead102cf8 100644
--- a/protocols/Gadu-Gadu/groupchat.c
+++ b/protocols/Gadu-Gadu/groupchat.c
@@ -131,7 +131,7 @@ int gg_gc_event(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
uin_t uin;
// Check if we got our protocol, and fields are set
- if(!gch
+ if (!gch
|| !gch->pDest
|| !gch->pDest->pszID
|| !gch->pDest->pszModule
@@ -153,7 +153,7 @@ int gg_gc_event(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
while (hContact)
{
DBVARIANT dbv;
- if(!DBGetContactSettingString(hContact, GG_PROTO, "ChatRoomID", &dbv))
+ if (!DBGetContactSettingString(hContact, GG_PROTO, "ChatRoomID", &dbv))
{
if(dbv.pszVal && !strcmp(gch->pDest->pszID, dbv.pszVal))
CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
@@ -177,7 +177,7 @@ int gg_gc_event(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
gcevent.pszUID = id;
gcevent.pszText = gch->pszText;
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_NICK, &dbv))
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_NICK, &dbv))
gcevent.pszNick = dbv.pszVal;
else
gcevent.pszNick = Translate("Me");
@@ -201,7 +201,7 @@ int gg_gc_event(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
if(gch->pDest->iType == GC_USER_PRIVMESS)
{
HANDLE hContact = NULL;
- if((uin = atoi(gch->pszUID)) && (hContact = gg_getcontact(gg, uin, 1, 0, NULL)))
+ if ((uin = atoi(gch->pszUID)) && (hContact = gg_getcontact(gg, uin, 1, 0, NULL)))
CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, (LPARAM)0);
}
gg_netlog(gg, "gg_gc_event(): Unhandled event %d, chat %x, uin %d, text \"%s\".", gch->pDest->iType, chat, uin, gch->pszText);
@@ -230,18 +230,18 @@ char *gg_gc_getchat(GGPROTO *gg, uin_t sender, uin_t *recipients, int recipients
GCEVENT gcevent = {sizeof(GCEVENT), &gcdest};
gg_netlog(gg, "gg_gc_getchat(): Count %d.", recipients_count);
- if(!recipients) return NULL;
+ if (!recipients) return NULL;
// Look for existing chat
for(l = gg->chats; l; l = l->next)
{
GGGC *chat = (GGGC *)l->data;
- if(!chat) continue;
+ if (!chat) continue;
if(chat->recipients_count == recipients_count + (sender ? 1 : 0))
{
int i, j, found = 0, sok = (sender == 0);
- if(!sok) for(i = 0; i < chat->recipients_count; i++)
+ if (!sok) for(i = 0; i < chat->recipients_count; i++)
if(sender == chat->recipients[i])
{
sok = 1;
@@ -273,15 +273,15 @@ char *gg_gc_getchat(GGPROTO *gg, uin_t sender, uin_t *recipients, int recipients
int unknown = (gg_getcontact(gg, sender, 0, 0, NULL) == NULL),
unknownSender = unknown;
for(i = 0; i < recipients_count; i++)
- if(!gg_getcontact(gg, recipients[i], 0, 0, NULL))
+ if (!gg_getcontact(gg, recipients[i], 0, 0, NULL))
unknown ++;
- if((DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_POLICY_DEFAULT, GG_KEYDEF_GC_POLICY_DEFAULT) == 2) ||
+ if ((DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_POLICY_DEFAULT, GG_KEYDEF_GC_POLICY_DEFAULT) == 2) ||
(DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_POLICY_TOTAL, GG_KEYDEF_GC_POLICY_TOTAL) == 2 &&
recipients_count >= DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_COUNT_TOTAL, GG_KEYDEF_GC_COUNT_TOTAL)) ||
(DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_POLICY_UNKNOWN, GG_KEYDEF_GC_POLICY_UNKNOWN) == 2 &&
unknown >= DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_COUNT_UNKNOWN, GG_KEYDEF_GC_COUNT_UNKNOWN)))
chat->ignore = TRUE;
- if(!chat->ignore && ((DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_POLICY_DEFAULT, GG_KEYDEF_GC_POLICY_DEFAULT) == 1) ||
+ if (!chat->ignore && ((DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_POLICY_DEFAULT, GG_KEYDEF_GC_POLICY_DEFAULT) == 1) ||
(DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_POLICY_TOTAL, GG_KEYDEF_GC_POLICY_TOTAL) == 1 &&
recipients_count >= DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_COUNT_TOTAL, GG_KEYDEF_GC_COUNT_TOTAL)) ||
(DBGetContactSettingWord(NULL, GG_PROTO, GG_KEY_GC_POLICY_UNKNOWN, GG_KEYDEF_GC_POLICY_UNKNOWN) == 1 &&
@@ -353,7 +353,7 @@ char *gg_gc_getchat(GGPROTO *gg, uin_t sender, uin_t *recipients, int recipients
if(uin = DBGetContactSettingDword(NULL, GG_PROTO, GG_KEY_UIN, 0))
{
UIN2ID(uin, id);
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_NICK, &dbv))
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_NICK, &dbv))
gcevent.pszNick = dbv.pszVal;
else
gcevent.pszNick = Translate("Me");
@@ -646,7 +646,7 @@ int gg_gc_changenick(GGPROTO *gg, HANDLE hContact, char *pszNick)
{
list_t l;
uin_t uin = DBGetContactSettingDword(hContact, GG_PROTO, GG_KEY_UIN, 0);
- if(!uin || !pszNick) return 0;
+ if (!uin || !pszNick) return 0;
gg_netlog(gg, "gg_gc_changenick(): Nickname for uin %d changed to %s.", uin, pszNick);
// Lookup for chats having this nick
diff --git a/protocols/Gadu-Gadu/import.c b/protocols/Gadu-Gadu/import.c
index a933135baf..43a0367402 100644
--- a/protocols/Gadu-Gadu/import.c
+++ b/protocols/Gadu-Gadu/import.c
@@ -276,7 +276,7 @@ void gg_parsecontacts(GGPROTO *gg, char *contacts)
n = strchr(p, '\n');
p = (n + 1);
}
- if(!n) p = NULL;
+ if (!n) p = NULL;
// Loadup contact
if(uin && strNick)
@@ -447,7 +447,7 @@ static INT_PTR gg_import_text(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
#ifdef DEBUGMODE
gg_netlog(gg, "gg_import_text()");
#endif
- if(!GetOpenFileName(&ofn)) return 0;
+ if (!GetOpenFileName(&ofn)) return 0;
f = fopen(str, "r");
_stat(str, &st);
@@ -519,7 +519,7 @@ static INT_PTR gg_export_text(GGPROTO *gg, WPARAM wParam, LPARAM lParam)
#ifdef DEBUGMODE
gg_netlog(gg, "gg_export_text(%s).", str);
#endif
- if(!GetSaveFileName(&ofn)) return 0;
+ if (!GetSaveFileName(&ofn)) return 0;
if(f = fopen(str, "w"))
{
diff --git a/protocols/Gadu-Gadu/oauth.c b/protocols/Gadu-Gadu/oauth.c
index 849852d32b..2c0631d655 100644
--- a/protocols/Gadu-Gadu/oauth.c
+++ b/protocols/Gadu-Gadu/oauth.c
@@ -366,16 +366,16 @@ char *gg_oauth_header(GGPROTO *gg, const char *httpmethod, const char *url)
DBVARIANT dbv;
UIN2ID(DBGetContactSettingDword(NULL, GG_PROTO, GG_KEY_UIN, 0), uin);
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_PASSWORD, &dbv)) {
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_PASSWORD, &dbv)) {
CallService(MS_DB_CRYPT_DECODESTRING, (WPARAM)(int)strlen(dbv.pszVal) + 1, (LPARAM)dbv.pszVal);
password = mir_strdup(dbv.pszVal);
DBFreeVariant(&dbv);
}
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_TOKEN, &dbv)) {
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_TOKEN, &dbv)) {
token = mir_strdup(dbv.pszVal);
DBFreeVariant(&dbv);
}
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_TOKENSECRET, &dbv)) {
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_TOKENSECRET, &dbv)) {
CallService(MS_DB_CRYPT_DECODESTRING, (WPARAM)(int)strlen(dbv.pszVal) + 1, (LPARAM)dbv.pszVal);
token_secret = mir_strdup(dbv.pszVal);
DBFreeVariant(&dbv);
@@ -400,7 +400,7 @@ int gg_oauth_receivetoken(GGPROTO *gg)
HANDLE nlc = NULL;
UIN2ID(DBGetContactSettingDword(NULL, GG_PROTO, GG_KEY_UIN, 0), uin);
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_PASSWORD, &dbv)) {
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_PASSWORD, &dbv)) {
CallService(MS_DB_CRYPT_DECODESTRING, strlen(dbv.pszVal) + 1, (LPARAM)dbv.pszVal);
password = mir_strdup(dbv.pszVal);
DBFreeVariant(&dbv);
@@ -564,11 +564,11 @@ int gg_oauth_checktoken(GGPROTO *gg, int force)
DBVARIANT dbv;
int res = 1;
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_TOKEN, &dbv)) {
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_TOKEN, &dbv)) {
token = mir_strdup(dbv.pszVal);
DBFreeVariant(&dbv);
}
- if(!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_TOKENSECRET, &dbv)) {
+ if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_TOKENSECRET, &dbv)) {
CallService(MS_DB_CRYPT_DECODESTRING, (WPARAM)(int)strlen(dbv.pszVal) + 1, (LPARAM)dbv.pszVal);
token_secret = mir_strdup(dbv.pszVal);
DBFreeVariant(&dbv);
diff --git a/protocols/Gadu-Gadu/ownerinfo.c b/protocols/Gadu-Gadu/ownerinfo.c
index aeeb7f1a9b..28cfb4df75 100644
--- a/protocols/Gadu-Gadu/ownerinfo.c
+++ b/protocols/Gadu-Gadu/ownerinfo.c
@@ -39,14 +39,14 @@ void __cdecl gg_remindpasswordthread(GGPROTO *gg, void *param)
#ifdef DEBUGMODE
gg_netlog(gg, "gg_remindpasswordthread(): Starting.");
#endif
- if(!rp || !rp->email || !rp->uin || !strlen(rp->email))
+ if (!rp || !rp->email || !rp->uin || !strlen(rp->email))
{
if(rp) free(rp);
return;
}
// Get token
- if(!gg_gettoken(gg, &token)) return;
+ if (!gg_gettoken(gg, &token)) return;
if (!(h = gg_remind_passwd3(rp->uin, rp->email, token.id, token.val, 0)))
{
diff --git a/protocols/Gadu-Gadu/services.c b/protocols/Gadu-Gadu/services.c
index bbb7434f6b..7591356f81 100644
--- a/protocols/Gadu-Gadu/services.c
+++ b/protocols/Gadu-Gadu/services.c
@@ -132,7 +132,7 @@ int gg_refreshstatus(GGPROTO *gg, int status)
return TRUE;
}
- if(!gg_isonline(gg))
+ if (!gg_isonline(gg))
{
DWORD exitCode = 0;
GetExitCodeThread(gg->pth_sess.hThread, &exitCode);
@@ -279,7 +279,7 @@ HANDLE gg_basicsearch(PROTO_INTERFACE *proto, const PROTOCHAR *id)
gg_pubdir50_t req;
char *ida;
- if(!gg_isonline(gg))
+ if (!gg_isonline(gg))
return (HANDLE)0;
if (!(req = gg_pubdir50_new(GG_PUBDIR50_SEARCH)))
@@ -297,7 +297,7 @@ HANDLE gg_basicsearch(PROTO_INTERFACE *proto, const PROTOCHAR *id)
mir_free(ida);
EnterCriticalSection(&gg->sess_mutex);
- if(!gg_pubdir50(gg->sess, req))
+ if (!gg_pubdir50(gg->sess, req))
{
LeaveCriticalSection(&gg->sess_mutex);
gg_forkthread(gg, gg_searchthread, NULL);
@@ -317,10 +317,10 @@ static HANDLE gg_searchbydetails(PROTO_INTERFACE *proto, const PROTOCHAR *nick,
char data[512] = "\0";
// Check if connected and if there's a search data
- if(!gg_isonline(gg))
+ if (!gg_isonline(gg))
return 0;
- if(!nick && !firstName && !lastName)
+ if (!nick && !firstName && !lastName)
return 0;
if (!(req = gg_pubdir50_new(GG_PUBDIR50_SEARCH)))
@@ -368,7 +368,7 @@ static HANDLE gg_searchbydetails(PROTO_INTERFACE *proto, const PROTOCHAR *nick,
gg_pubdir50_seq_set(req, GG_SEQ_SEARCH);
EnterCriticalSection(&gg->sess_mutex);
- if(!gg_pubdir50(gg->sess, req))
+ if (!gg_pubdir50(gg->sess, req))
{
LeaveCriticalSection(&gg->sess_mutex);
gg_forkthread(gg, gg_searchthread, NULL);
@@ -432,7 +432,7 @@ int gg_getinfo(PROTO_INTERFACE *proto, HANDLE hContact, int infoType)
if(gg_isonline(gg))
{
EnterCriticalSection(&gg->sess_mutex);
- if(!gg_pubdir50(gg->sess, req))
+ if (!gg_pubdir50(gg->sess, req))
{
LeaveCriticalSection(&gg->sess_mutex);
gg_forkthread(gg, gg_cmdgetinfothread, hContact);
@@ -457,7 +457,7 @@ int gg_getinfo(PROTO_INTERFACE *proto, HANDLE hContact, int infoType)
if(gg_isonline(gg))
{
EnterCriticalSection(&gg->sess_mutex);
- if(!gg_pubdir50(gg->sess, req))
+ if (!gg_pubdir50(gg->sess, req))
{
LeaveCriticalSection(&gg->sess_mutex);
gg_forkthread(gg, gg_cmdgetinfothread, hContact);
@@ -617,7 +617,7 @@ HWND gg_searchbyadvanced(PROTO_INTERFACE *proto, HWND hwndDlg)
unsigned long crc;
// Check if connected
- if(!gg_isonline(gg)) return (HWND)0;
+ if (!gg_isonline(gg)) return (HWND)0;
if (!(req = gg_pubdir50_new(GG_PUBDIR50_SEARCH)))
{
@@ -672,11 +672,11 @@ HWND gg_searchbyadvanced(PROTO_INTERFACE *proto, HWND hwndDlg)
yearFrom = atoi(age);
// Count & fix ranges
- if(!yearTo)
+ if (!yearTo)
yearTo = ay;
else
yearTo = ay - yearTo;
- if(!yearFrom)
+ if (!yearFrom)
yearFrom = 0;
else
yearFrom = ay - yearFrom;
@@ -723,7 +723,7 @@ HWND gg_searchbyadvanced(PROTO_INTERFACE *proto, HWND hwndDlg)
if(gg_isonline(gg))
{
EnterCriticalSection(&gg->sess_mutex);
- if(!gg_pubdir50(gg->sess, req))
+ if (!gg_pubdir50(gg->sess, req))
{
LeaveCriticalSection(&gg->sess_mutex);
gg_forkthread(gg, gg_searchthread, NULL);
diff --git a/protocols/Gadu-Gadu/token.c b/protocols/Gadu-Gadu/token.c
index 44bfb1f794..378766ef4a 100644
--- a/protocols/Gadu-Gadu/token.c
+++ b/protocols/Gadu-Gadu/token.c
@@ -115,7 +115,7 @@ int gg_gettoken(GGPROTO *gg, GGTOKEN *token)
strcpy(token->id, "");
strcpy(token->val, "");
- if(!(h = gg_token(0)) || gg_token_watch_fd(h) || h->state == GG_STATE_ERROR || h->state != GG_STATE_DONE)
+ if (!(h = gg_token(0)) || gg_token_watch_fd(h) || h->state == GG_STATE_ERROR || h->state != GG_STATE_DONE)
{
char error[128];
mir_snprintf(error, sizeof(error), Translate("Token retrieval failed because of error:\n\t%s"), http_error_string(h ? h->error : 0));
diff --git a/protocols/Gadu-Gadu/userutils.c b/protocols/Gadu-Gadu/userutils.c
index 1217488c93..721e4d32cf 100644
--- a/protocols/Gadu-Gadu/userutils.c
+++ b/protocols/Gadu-Gadu/userutils.c
@@ -32,10 +32,10 @@ void *gg_doregister(GGPROTO *gg, char *newPass, char *newEmail)
#ifdef DEBUGMODE
gg_netlog(gg, "gg_doregister(): Starting.");
#endif
- if(!newPass || !newEmail) return NULL;
+ if (!newPass || !newEmail) return NULL;
// Load token
- if(!gg_gettoken(gg, &token)) return NULL;
+ if (!gg_gettoken(gg, &token)) return NULL;
if (!(h = gg_register3(newEmail, newPass, token.id, token.val, 0)) || !(s = h->data) || !s->success || !s->uin)
{
@@ -87,10 +87,10 @@ void *gg_dounregister(GGPROTO *gg, uin_t uin, char *password)
#ifdef DEBUGMODE
gg_netlog(gg, "gg_dounregister(): Starting.");
#endif
- if(!uin || !password) return NULL;
+ if (!uin || !password) return NULL;
// Load token
- if(!gg_gettoken(gg, &token)) return NULL;
+ if (!gg_gettoken(gg, &token)) return NULL;
if (!(h = gg_unregister3(uin, password, token.id, token.val, 0)) || !(s = h->data) || !s->success || s->uin != uin)
{
@@ -141,7 +141,7 @@ void *gg_dochpass(GGPROTO *gg, uin_t uin, char *password, char *newPass)
#ifdef DEBUGMODE
gg_netlog(gg, "gg_dochpass(): Starting.");
#endif
- if(!uin || !password || !newPass) return NULL;
+ if (!uin || !password || !newPass) return NULL;
if (!DBGetContactSettingString(NULL, GG_PROTO, GG_KEY_EMAIL, &dbv_email))
{
@@ -150,7 +150,7 @@ void *gg_dochpass(GGPROTO *gg, uin_t uin, char *password, char *newPass)
}
// Load token
- if(!gg_gettoken(gg, &token)) return NULL;
+ if (!gg_gettoken(gg, &token)) return NULL;
if (!(h = gg_change_passwd4(uin, email, password, newPass, token.id, token.val, 0)) || !(s = h->data) || !s->success)
{
@@ -199,10 +199,10 @@ void *gg_dochemail(GGPROTO *gg, uin_t uin, char *password, char *email, char *ne
#ifdef DEBUGMODE
gg_netlog(gg, "gg_doemail(): Starting.");
#endif
- if(!uin || !email || !newEmail) return NULL;
+ if (!uin || !email || !newEmail) return NULL;
// Load token
- if(!gg_gettoken(gg, &token)) return NULL;
+ if (!gg_gettoken(gg, &token)) return NULL;
if (!(h = gg_change_passwd4(uin, newEmail, password, password, token.id, token.val, 0)) || !(s = h->data) || !s->success)
{