summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-07-15 11:00:55 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-07-15 11:00:55 +0000
commitec72adc886bfaac0cb1ed19520a555bbe0f9f1cd (patch)
treecd325e7632830b526c694104b0bc3b4a778659eb /protocols/JabberG/src
parent7ee3b9cf43887a9de4e32eb2b02f5b0524e6d6b9 (diff)
fix for crazy chars in Jabber search dialog
git-svn-id: http://svn.miranda-ng.org/main/trunk@5358 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src')
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp4
-rw-r--r--protocols/JabberG/src/jabber_search.cpp11
2 files changed, 7 insertions, 8 deletions
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index f6b5e699be..7daa60e3b3 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -882,7 +882,7 @@ HANDLE __cdecl CJabberProto::SearchByEmail(const TCHAR *email)
int iqId = SerialNext();
IqAdd(iqId, IQ_PROC_GETSEARCH, &CJabberProto::OnIqResultSetSearch);
- m_ThreadInfo->send( XmlNodeIq(_T("set"), iqId, _A2T(szServerName ? szServerName : "users.jabber.org")) << XQUERY(_T("jabber:iq:search"))
+ m_ThreadInfo->send( XmlNodeIq(_T("set"), iqId, _A2T(szServerName == 0 ? "users.jabber.org" : szServerName)) << XQUERY(_T("jabber:iq:search"))
<< XCHILD(_T("email"), email));
return (HANDLE)iqId;
}
@@ -900,7 +900,7 @@ HANDLE __cdecl CJabberProto::SearchByName(const TCHAR *nick, const TCHAR *firstN
ptrA szServerName( getStringA("Jud"));
int iqId = SerialNext();
- XmlNodeIq iq(_T("set"), iqId, _A2T(szServerName ? szServerName : "users.jabber.org"));
+ XmlNodeIq iq(_T("set"), iqId, _A2T(szServerName == 0 ? "users.jabber.org" : szServerName));
HXML query = iq << XQUERY(_T("jabber:iq:search"));
if (bIsExtFormat) {
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp
index d4843336d1..c88dca0013 100644
--- a/protocols/JabberG/src/jabber_search.cpp
+++ b/protocols/JabberG/src/jabber_search.cpp
@@ -532,29 +532,28 @@ static INT_PTR CALLBACK JabberSearchAdvancedDlgProc(HWND hwndDlg, UINT msg, WPAR
JabberSearchData* dat = (JabberSearchData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
{
- TranslateDialogDefault(hwndDlg);
- dat = (JabberSearchData *)mir_alloc(sizeof(JabberSearchData));
- memset(dat, 0, sizeof(JabberSearchData));
+ dat = (JabberSearchData *)mir_calloc(sizeof(JabberSearchData));
dat->ppro = (CJabberProto*)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
/* Server Combo box */
ptrA jud(dat->ppro->getStringA("Jud"));
- char *szServerName = (jud != NULL) ? jud : "users.jabber.org";
+ char *szServerName = (jud == NULL) ? "users.jabber.org": jud;
SetDlgItemTextA(hwndDlg,IDC_SERVER,szServerName);
SendDlgItemMessageA(hwndDlg,IDC_SERVER,CB_ADDSTRING,0,(LPARAM)szServerName);
//TO DO: Add Transports here
int i, transpCount = dat->ppro->m_lstTransports.getCount();
for (i=0; i < transpCount; i++) {
- TCHAR* szTransp = dat->ppro->m_lstTransports[i];
+ TCHAR *szTransp = dat->ppro->m_lstTransports[i];
if (szTransp)
JabberSearchAddUrlToRecentCombo(hwndDlg, szTransp);
}
DBVARIANT dbv;
- char key[30];
for (i=0; i < 10; i++) {
+ char key[30];
sprintf(key,"RecentlySearched_%d",i);
if ( !dat->ppro->getTString(key, &dbv)) {
JabberSearchAddUrlToRecentCombo(hwndDlg, dbv.ptszVal);