summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2014-11-29 15:30:09 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2014-11-29 15:30:09 +0000
commitfe076d92eca402b27979bacf4062563e759e7279 (patch)
treeacca86039c851dd4a85240c195f0e759787aecbe /protocols
parent425e0f8eb79c6779ebe40f75cce92194ed103389 (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')
-rw-r--r--protocols/JabberG/src/jabber_file.cpp3
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp2
-rw-r--r--protocols/Yahoo/src/proto.cpp39
3 files changed, 23 insertions, 21 deletions
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp
index f394d8ff8e..078cbcc98f 100644
--- a/protocols/JabberG/src/jabber_file.cpp
+++ b/protocols/JabberG/src/jabber_file.cpp
@@ -37,7 +37,6 @@ void __cdecl CJabberProto::FileReceiveThread(filetransfer *ft)
NETLIBOPENCONNECTION nloc = { 0 };
nloc.cbSize = sizeof(nloc);
- nloc.cbSize = sizeof(NETLIBOPENCONNECTION);
nloc.szHost = ft->httpHostName;
nloc.wPort = ft->httpPort;
info.s = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)m_hNetlibUser, (LPARAM)&nloc);
@@ -73,7 +72,7 @@ void __cdecl CJabberProto::FileReceiveThread(filetransfer *ft)
ft->s = NULL;
- if (ft->state == FT_DONE || (ft->state == FT_RECEIVING && ft->std.currentFileSize < 0))
+ if (ft->state == FT_DONE || (ft->state == FT_RECEIVING && ft->std.currentFileSize == 0))
ft->complete();
debugLogA("Thread ended: type=file_receive server='%s'", ft->httpHostName);
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index 5c8ab6f357..330f472c40 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -519,7 +519,7 @@ INT_PTR CJabberDlgGcJoin::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
case WM_DRAWITEM:
{
LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam;
- if (lpdis->CtlID != IDC_ROOM || lpdis->itemID < 0)
+ if (lpdis->CtlID != IDC_ROOM)
break;
RoomInfo *info = (RoomInfo *)SendDlgItemMessage(m_hwnd, IDC_ROOM, CB_GETITEMDATA, lpdis->itemID, 0);
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;