summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-25 19:46:01 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-25 19:46:01 +0000
commit65599a6b52e163df8c47e112bacc4969261cf282 (patch)
treed630d3c52e34ae8152e9b387107bda61a25d0adc
parent418cfb6cb57c9e02ffb9f5aafc747a9dc5b76883 (diff)
.. and also prevent a mess in a nicklist
git-svn-id: http://svn.miranda-ng.org/main/trunk@7888 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-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);