diff options
author | George Hazan <ghazan@miranda.im> | 2022-10-30 20:02:46 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-10-30 20:02:46 +0300 |
commit | 3217d7889f3db73e145e74c60710440c34a83b7a (patch) | |
tree | 4fc899958c07a555b5901586e49c4e7813de3b1e | |
parent | c7672ecadf9007ca8f57b0b98c729ccac8fc257e (diff) |
fixes #3211 (Jabber: при входе в чат в лог прилетают фейковые входы всех остальные участников)
-rw-r--r-- | protocols/JabberG/src/jabber_chat.cpp | 1 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_groupchat.cpp | 5 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_thread.cpp | 14 |
3 files changed, 14 insertions, 6 deletions
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 2ebf696113..627b6668a8 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -154,7 +154,6 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM *item) 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) {
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index b4361422df..6c25309f6e 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -1069,11 +1069,6 @@ void CJabberProto::GroupchatProcessMessage(const TiXmlElement *node) if (!msgTime || msgTime > now)
msgTime = now;
- // ugly hack to cut out group chat history: 2 seconds delay to skip all old messages
- // unfortunately there's no other way to detect if that message came online or from history
- if (now - item->iChatInitTime > 2)
- item->bChatLogging = true;
-
if (resource != nullptr) {
pResourceStatus r(item->findResource(resource));
nick = (r && r->m_szNick) ? r->m_szNick.get() : resource;
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 1d9bd95910..f45e313e05 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -149,6 +149,20 @@ void CJabberProto::CheckKeepAlive() }
}
+ // ugly hack to cut out group chat history: 2 seconds delay to skip all old messages
+ // unfortunately there's no other way to detect if that message came online or from history
+ time_t now = time(0);
+ LISTFOREACH(i, this, LIST_CHATROOM)
+ {
+ if (auto *item = ListGetItemPtrFromIndex(i)) {
+ if (!item->bChatLogging && now - item->iChatInitTime > 2) {
+ item->bChatLogging = true;
+ Chat_Control(m_szModuleName, Utf2T(item->jid), SESSION_ONLINE);
+ }
+ }
+ }
+
+
// check expired iq requests
m_iqManager.CheckExpired();
|