diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2014-11-29 15:30:09 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2014-11-29 15:30:09 +0000 |
commit | fe076d92eca402b27979bacf4062563e759e7279 (patch) | |
tree | acca86039c851dd4a85240c195f0e759787aecbe /protocols/Yahoo | |
parent | 425e0f8eb79c6779ebe40f75cce92194ed103389 (diff) |
-Fixed a bug in Ping and other small things reported in #837
git-svn-id: http://svn.miranda-ng.org/main/trunk@11151 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Yahoo')
-rw-r--r-- | protocols/Yahoo/src/proto.cpp | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp index 3b0f6e7494..2d635246bf 100644 --- a/protocols/Yahoo/src/proto.cpp +++ b/protocols/Yahoo/src/proto.cpp @@ -767,36 +767,39 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY) {
char str[128];
- BOOL reconnectRequired = FALSE;
+ bool reconnectRequired = false;
GetDlgItemTextA(hwndDlg, IDC_HANDLE, str, sizeof(str));
-
- dbv.pszVal = NULL;
-
- if (ppro->getString(YAHOO_LOGINID, &dbv) || lstrcmpA(str, dbv.pszVal))
- reconnectRequired = TRUE;
-
- if (dbv.pszVal != NULL)
+
+ if (ppro->getString(YAHOO_LOGINID, &dbv)) {
+ reconnectRequired = true;
+ }
+ else {
+ if(lstrcmpA(str, dbv.pszVal))
+ reconnectRequired = true;
db_free(&dbv);
+ }
ppro->setString(YAHOO_LOGINID, str);
GetDlgItemTextA(hwndDlg, IDC_PASSWORD, str, sizeof(str));
- dbv.pszVal = NULL;
- if (ppro->getString(YAHOO_PASSWORD, &dbv) || lstrcmpA(str, dbv.pszVal))
- reconnectRequired = TRUE;
- if (dbv.pszVal != NULL)
+ if (ppro->getString(YAHOO_PASSWORD, &dbv)) {
+ reconnectRequired = true;
+ }
+ else {
+ if(lstrcmpA(str, dbv.pszVal))
+ reconnectRequired = true;
db_free(&dbv);
-
- if (reconnectRequired)
- ppro->delSetting(YAHOO_PWTOKEN);
+ }
ppro->setString(YAHOO_PASSWORD, str);
ppro->setByte("YahooJapan", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_YAHOO_JAPAN));
- if (reconnectRequired && ppro->m_bLoggedIn)
- MessageBoxA(hwndDlg, Translate("The changes you have made require you to reconnect to the Yahoo network before they take effect"), Translate("YAHOO Options"), MB_OK);
-
+ if (reconnectRequired) {
+ ppro->delSetting(YAHOO_PWTOKEN);
+ if (ppro->m_bLoggedIn)
+ MessageBox(hwndDlg, TranslateT("The changes you have made require you to reconnect to the Yahoo network before they take effect"), TranslateT("YAHOO Options"), MB_OK);
+ }
return TRUE;
}
break;
|