summaryrefslogtreecommitdiff
path: root/protocols/JabberG
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/JabberG')
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp8
-rw-r--r--protocols/JabberG/src/jabber_iqid.cpp14
2 files changed, 4 insertions, 18 deletions
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index 0f405da76c..5838b6e2e1 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -127,13 +127,7 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM *item)
sttRoleItems[i].translate();
ptrW szNick(JabberNickFromJID(item->jid));
-
- GCSESSION gcw = {};
- gcw.iType = GCW_CHATROOM;
- gcw.pszModule = m_szModuleName;
- gcw.ptszName = szNick;
- gcw.ptszID = item->jid;
- Chat_NewSession(&gcw);
+ Chat_NewSession(GCW_CHATROOM, m_szModuleName, item->jid, szNick);
GCSessionInfoBase *si = pci->SM_FindSession(item->jid, m_szModuleName);
if (si != NULL) {
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index bbf2407010..b0be15fb1d 100644
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -440,17 +440,9 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
else db_unset(hContact, "CList", "MyHandle");
if (isChatRoom(hContact)) {
- GCSESSION gcw = {};
- gcw.iType = GCW_CHATROOM;
- gcw.pszModule = m_szModuleName;
- gcw.ptszID = jid;
- gcw.ptszName = NEWWSTR_ALLOCA(jid);
-
- wchar_t *p = (wchar_t*)wcschr(gcw.ptszName, '@');
- if (p)
- *p = 0;
-
- Chat_NewSession(&gcw);
+ wchar_t *wszTitle = NEWWSTR_ALLOCA(jid);
+ if (wchar_t *p = wcschr(wszTitle, '@')) *p = 0;
+ Chat_NewSession(GCW_CHATROOM, m_szModuleName, jid, wszTitle);
db_unset(hContact, "CList", "Hidden");
chatRooms.insert((HANDLE)hContact);