diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2015-06-17 23:15:57 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2015-06-17 23:15:57 +0000 |
commit | 65cf85ee6e83594f4de5d6d06012bde070b6c6b1 (patch) | |
tree | 50b3747038b77088ee0bef29f6594a74807397c3 /protocols/Gadu-Gadu/src/userutils.cpp | |
parent | 2d26921c87c663de4725963d7da87c6eacd1e3d3 (diff) |
GaduGadu: Cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@14241 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Gadu-Gadu/src/userutils.cpp')
-rw-r--r-- | protocols/Gadu-Gadu/src/userutils.cpp | 22 |
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));
}
|