From cf828510d0463cc85140545a7bef04cc2603e0a7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 1 Nov 2022 16:28:57 +0300 Subject: fixes #3211 --- protocols/JabberG/src/jabber_chat.cpp | 6 +++++- protocols/JabberG/src/jabber_groupchat.cpp | 1 + protocols/JabberG/src/jabber_thread.cpp | 9 ++------- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 0e181acac6..2acc35a39d 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -153,6 +153,9 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM *item) for (int i = _countof(sttStatuses) - 1; i >= 0; i--) Chat_AddGroup(si, TranslateW(Utf2T(sttStatuses[i]))); + Chat_Control(m_szModuleName, wszJid, (item->bAutoJoin && m_bAutoJoinHidden) ? WINDOW_HIDDEN : SESSION_INITDONE); + Chat_Control(m_szModuleName, wszJid, SESSION_ONLINE); + time_t lastDate = getDword(si->hContact, "LastGetVcard"), now = time(0); if (now - lastDate > 24 * 60 * 60) { SendGetVcard(si->hContact); @@ -249,7 +252,7 @@ void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const char *r myNick = JabberNickFromJID(m_szJabberJID); GCEVENT gce = { m_szModuleName, item->jid, 0 }; - gce.dwFlags = GCEF_UTF8 | ((item->bChatLogging) ? GCEF_ADDTOLOG : 0); + gce.dwFlags = GCEF_UTF8 | ((item->bChatLogging) ? 0 : GCEF_SILENT); gce.pszNick.a = nick; gce.pszUID.a = resource; gce.pszUserInfo.a = jid; @@ -270,6 +273,7 @@ void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const char *r switch (action) { case 0: gce.iType = GC_EVENT_ADDSTATUS; + __fallthrough; case GC_EVENT_REMOVESTATUS: gce.dwFlags &= ~GCEF_ADDTOLOG; } diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index 6c25309f6e..cc9f07ce96 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -1079,6 +1079,7 @@ void CJabberProto::GroupchatProcessMessage(const TiXmlElement *node) szText.Replace("%", "%%"); szText += imgLink; + gce.dwFlags = GCEF_UTF8; gce.pszUID.a = resource; gce.pszNick.a = nick; gce.time = msgTime; diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index d234e46dac..212c6bdd6a 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -154,14 +154,9 @@ void CJabberProto::CheckKeepAlive() time_t now = time(0); LISTFOREACH(i, this, LIST_CHATROOM) { - if (auto *item = ListGetItemPtrFromIndex(i)) { - if (!item->bChatLogging && now - item->iChatInitTime > 2) { + if (auto *item = ListGetItemPtrFromIndex(i)) + if (!item->bChatLogging && now - item->iChatInitTime > 2) item->bChatLogging = true; - Utf2T wszJid(item->jid); - Chat_Control(m_szModuleName, wszJid, (item->bAutoJoin && m_bAutoJoinHidden) ? WINDOW_HIDDEN : SESSION_INITDONE); - Chat_Control(m_szModuleName, wszJid, SESSION_ONLINE); - } - } } -- cgit v1.2.3