From 1a8c8c48ed38145781037cbe07f2d0c9c8c75d68 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 19 Apr 2016 18:57:47 +0000 Subject: fix for processing jids from groupchats git-svn-id: http://svn.miranda-ng.org/main/trunk@16719 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_thread.cpp | 16 +++++++--------- protocols/JabberG/src/jabber_util.cpp | 16 +++++++++------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'protocols/JabberG/src') diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 8fba12715f..a909d017a2 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -72,17 +72,15 @@ static INT_PTR CALLBACK JabberPasswordDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); - { - param = (JabberPasswordDlgParam*)lParam; - SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); - TCHAR text[512]; - mir_sntprintf(text, TranslateT("Enter password for %s"), param->ptszJid); - SetDlgItemText(hwndDlg, IDC_JID, text); + param = (JabberPasswordDlgParam*)lParam; + SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); - int bSavePassword = param->pro->getByte("SaveSessionPassword", 0); - CheckDlgButton(hwndDlg, IDC_SAVEPASSWORD, (bSavePassword) ? BST_CHECKED : BST_UNCHECKED); - } + TCHAR text[512]; + mir_sntprintf(text, TranslateT("Enter password for %s"), param->ptszJid); + SetDlgItemText(hwndDlg, IDC_JID, text); + + CheckDlgButton(hwndDlg, IDC_SAVEPASSWORD, param->pro->getByte("SaveSessionPassword", 0) ? BST_CHECKED : BST_UNCHECKED); return TRUE; case WM_COMMAND: diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 5691dc81eb..abef88e3f5 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -51,16 +51,18 @@ MCONTACT CJabberProto::HContactFromJID(const TCHAR *jid, bool bStripResource) if (jid == NULL) return NULL; - TCHAR szJid[JABBER_MAX_JID_LEN]; - if (bStripResource) - JabberStripJid(jid, szJid, _countof(szJid)); - else - _tcsncpy_s(szJid, jid, _TRUNCATE); - - JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, szJid); + JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid); if (item != NULL && item->hContact) return item->hContact; + if (bStripResource) { + TCHAR szJid[JABBER_MAX_JID_LEN]; + JabberStripJid(jid, szJid, _countof(szJid)); + item = ListGetItemPtr(LIST_ROSTER, jid); + if (item != NULL && item->hContact) + return item->hContact; + } + return NULL; } -- cgit v1.2.3