summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-04-27 18:32:16 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-04-27 18:32:16 +0000
commit8b48b41245884894fdfe102287dcdeacb0ace9b5 (patch)
tree84f4d392ac81180c10a9172ae5d259b60157b063 /protocols
parent0a5d4c1026a8146e6213e531f22b7ec32d4fc61e (diff)
fixes #1224 (Stoped using room name from bookmark)
git-svn-id: http://svn.miranda-ng.org/main/trunk@16782 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/JabberG/src/jabber.cpp2
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp29
-rw-r--r--protocols/JabberG/src/stdafx.h5
3 files changed, 22 insertions, 14 deletions
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 <m_avatars.h>
#include <m_awaymsg.h>
#include <m_button.h>
-#include <m_chat.h>
+#include <m_chat_int.h>
#include <m_clist.h>
#include <m_cluiframes.h>
#include <m_contacts.h>
@@ -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<CJabberProto>