summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu/src/userutils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Gadu-Gadu/src/userutils.cpp')
-rw-r--r--protocols/Gadu-Gadu/src/userutils.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/protocols/Gadu-Gadu/src/userutils.cpp b/protocols/Gadu-Gadu/src/userutils.cpp
index ec4441b2a3..3f3f06d14c 100644
--- a/protocols/Gadu-Gadu/src/userutils.cpp
+++ b/protocols/Gadu-Gadu/src/userutils.cpp
@@ -41,7 +41,7 @@ void *gg_doregister(GGPROTO *gg, char *newPass, char *newEmail)
if (!(h = gg_register3(newEmail, newPass, token.id, token.val, 0)) || !(s = (gg_pubdir*)h->data) || !s->success || !s->uin) {
TCHAR error[128];
mir_sntprintf(error, TranslateT("Cannot register new account because of error:\n\t%s"),
- (h && !s) ? http_error_string(h ? h->error : 0) :
+ (h && !s) ? http_error_string(h->error) :
(s ? TranslateT("Registration rejected") : _tcserror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
gg->debugLogA("gg_doregister(): Cannot register. errno=%d: %s", errno, strerror(errno));
@@ -86,7 +86,7 @@ void *gg_dounregister(GGPROTO *gg, uin_t uin, char *password)
{
TCHAR error[128];
mir_sntprintf(error, TranslateT("Your account cannot be removed because of error:\n\t%s"),
- (h && !s) ? http_error_string(h ? h->error : 0) :
+ (h && !s) ? http_error_string(h->error) :
(s ? TranslateT("Bad number or password") : _tcserror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
gg->debugLogA("gg_dounregister(): Cannot remove account. errno=%d: %s", errno, strerror(errno));
@@ -138,7 +138,7 @@ void *gg_dochpass(GGPROTO *gg, uin_t uin, char *password, char *newPass)
{
TCHAR error[128];
mir_sntprintf(error, TranslateT("Your password cannot be changed because of error:\n\t%s"),
- (h && !s) ? http_error_string(h ? h->error : 0) :
+ (h && !s) ? http_error_string(h->error) :
(s ? TranslateT("Invalid data entered") : _tcserror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
gg->debugLogA("gg_dochpass(): Cannot change password. errno=%d: %s", errno, strerror(errno));
@@ -163,24 +163,24 @@ void *gg_dochpass(GGPROTO *gg, uin_t uin, char *password, char *newPass)
void *gg_dochemail(GGPROTO *gg, uin_t uin, char *password, char *email, char *newEmail)
{
- // Connection handles
- struct gg_http *h;
- struct gg_pubdir *s;
- GGTOKEN token;
-
#ifdef DEBUGMODE
gg->debugLogA("gg_dochemail(): Starting.");
#endif
if (!uin || !email || !newEmail) return NULL;
// Load token
- if (!gg->gettoken(&token)) return NULL;
+ GGTOKEN token;
+ if (!gg->gettoken(&token))
+ return NULL;
- if (!(h = gg_change_passwd4(uin, newEmail, password, password, token.id, token.val, 0)) || !(s = (gg_pubdir*)h->data) || !s->success)
+ // Connection handles
+ struct gg_pubdir *s;
+ struct gg_http *h = gg_change_passwd4(uin, newEmail, password, password, token.id, token.val, 0);
+ if (!h || !(s = (gg_pubdir*)h->data) || !s->success)
{
TCHAR error[128];
mir_sntprintf(error, TranslateT("Your e-mail cannot be changed because of error:\n\t%s"),
- (h && !s) ? http_error_string(h ? h->error : 0) : (s ? TranslateT("Bad old e-mail or password") : _tcserror(errno)));
+ (h && !s) ? http_error_string(h->error) : (s ? TranslateT("Bad old e-mail or password") : _tcserror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
gg->debugLogA("gg_dochemail(): Cannot change e-mail. errno=%d: %s", errno, strerror(errno));
}