summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp15
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp5
2 files changed, 11 insertions, 9 deletions
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index 6c2da6e726..20c3d65d6d 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -333,15 +333,7 @@ void CJabberProto::GcQuit(JABBER_LIST_ITEM *item, int code, HXML reason)
{
TCHAR *szMessage = NULL;
- GCDEST gcd = { m_szModuleName, item->jid, GC_EVENT_CONTROL };
- GCEVENT gce = { sizeof(gce), &gcd };
- gce.ptszUID = item->jid;
- gce.ptszText = xmlGetText(reason);
-
if (code != 307 && code != 301) {
- CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, (LPARAM)&gce);
- CallServiceSync(MS_GC_EVENT, WINDOW_CLEARLOG, (LPARAM)&gce);
-
ptrT tszMessage(getTStringA("GcMsgQuit"));
if (tszMessage != NULL)
szMessage = NEWTSTR_ALLOCA(tszMessage);
@@ -351,9 +343,14 @@ void CJabberProto::GcQuit(JABBER_LIST_ITEM *item, int code, HXML reason)
else {
ptrT myNick(JabberNickFromJID(m_szJabberJID));
GcLogUpdateMemberStatus(item, myNick, myNick, NULL, GC_EVENT_KICK, reason);
- CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, (LPARAM)&gce);
}
+ GCDEST gcd = { m_szModuleName, item->jid, GC_EVENT_CONTROL };
+ GCEVENT gce = { sizeof(gce), &gcd };
+ gce.ptszUID = item->jid;
+ gce.ptszText = xmlGetText(reason);
+ CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, (LPARAM)&gce);
+
db_unset(HContactFromJID(item->jid), "CList", "Hidden");
item->bChatActive = FALSE;
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index d3b33c5afa..4449c0d2bf 100644
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -541,6 +541,11 @@ recvRest:
SendMessage(m_hwndJabberChangePassword, WM_COMMAND, MAKEWORD(IDCANCEL, 0), 0);
}
+ // Quit all chatrooms (will send quit message)
+ LISTFOREACH(i, this, LIST_CHATROOM)
+ if (JABBER_LIST_ITEM *item = ListGetItemPtrFromIndex(i))
+ GcQuit(item, 0, NULL);
+
ListRemoveList(LIST_CHATROOM);
ListRemoveList(LIST_BOOKMARK);
//UI_SAFE_NOTIFY(m_pDlgJabberJoinGroupchat, WM_JABBER_CHECK_ONLINE);