From 8b48b41245884894fdfe102287dcdeacb0ace9b5 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 27 Apr 2016 18:32:16 +0000 Subject: fixes #1224 (Stoped using room name from bookmark) git-svn-id: http://svn.miranda-ng.org/main/trunk@16782 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber.cpp | 2 ++ protocols/JabberG/src/jabber_chat.cpp | 29 ++++++++++++++++------------- protocols/JabberG/src/stdafx.h | 5 ++++- 3 files changed, 22 insertions(+), 14 deletions(-) (limited to 'protocols') diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp index 44ca9357e7..874b3ecab5 100644 --- a/protocols/JabberG/src/jabber.cpp +++ b/protocols/JabberG/src/jabber.cpp @@ -39,6 +39,7 @@ HINSTANCE hInst; int hLangpack; unsigned int g_nTempFileId; +CHAT_MANAGER *pci; int g_cbCountries; CountryListEntry *g_countries; @@ -182,6 +183,7 @@ extern "C" int __declspec(dllexport) Load() // set the memory, lists & utf8 managers mir_getLP(&pluginInfo); mir_getCLI(); + mir_getCI(NULL); { INT_PTR result = CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&FIP); diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 58a2038dab..6dd014257d 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -132,30 +132,33 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM *item) gcw.ptszID = item->jid; CallServiceSync(MS_GC_NEWSESSION, NULL, (LPARAM)&gcw); - MCONTACT hContact = HContactFromJID(item->jid); - if (hContact != NULL) { - if (JABBER_LIST_ITEM *bookmark = ListGetItemPtr(LIST_BOOKMARK, item->jid)) + GCSessionInfoBase *si = pci->SM_FindSession(item->jid, m_szModuleName); + if (si != NULL) { + item->hContact = si->hContact; + + if (JABBER_LIST_ITEM *bookmark = ListGetItemPtr(LIST_BOOKMARK, item->jid)) { if (bookmark->name) { - ptrT myHandle(db_get_tsa(hContact, "CList", "MyHandle")); + ptrT myHandle(db_get_tsa(si->hContact, "CList", "MyHandle")); if (myHandle == NULL) - db_set_ts(hContact, "CList", "MyHandle", bookmark->name); + db_set_ts(si->hContact, "CList", "MyHandle", bookmark->name); } + } - ptrT tszNick(getTStringA(hContact, "MyNick")); + ptrT tszNick(getTStringA(si->hContact, "MyNick")); if (tszNick != NULL) { if (!mir_tstrcmp(tszNick, szNick)) - delSetting(hContact, "MyNick"); + delSetting(si->hContact, "MyNick"); else - setTString(hContact, "MyNick", item->nick); + setTString(si->hContact, "MyNick", item->nick); } - else setTString(hContact, "MyNick", item->nick); + else setTString(si->hContact, "MyNick", item->nick); - ptrT passw(getTStringA(hContact, "Password")); + ptrT passw(getTStringA(si->hContact, "Password")); if (lstrcmp_null(passw, item->password)) { if (!item->password || !item->password[0]) - delSetting(hContact, "Password"); + delSetting(si->hContact, "Password"); else - setTString(hContact, "Password", item->password); + setTString(si->hContact, "Password", item->password); } } @@ -350,7 +353,7 @@ void CJabberProto::GcQuit(JABBER_LIST_ITEM *item, int code, HXML reason) gce.ptszText = XmlGetText(reason); CallServiceSync(MS_GC_EVENT, (code == 200) ? SESSION_TERMINATE : SESSION_OFFLINE, (LPARAM)&gce); - db_unset(HContactFromJID(item->jid), "CList", "Hidden"); + db_unset(item->hContact, "CList", "Hidden"); item->bChatActive = FALSE; if (m_bJabberOnline) { diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h index 87c791afb1..b625d69ecd 100644 --- a/protocols/JabberG/src/stdafx.h +++ b/protocols/JabberG/src/stdafx.h @@ -64,7 +64,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include -#include +#include #include #include #include @@ -114,6 +114,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "jabber_ibb.h" #include "jabber_db_utils.h" +struct SESSION_INFO : public GCSessionInfoBase +{}; + struct CJabberProto; class CJabberDlgBase : public CProtoDlgBase -- cgit v1.2.3