summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-09-11 20:15:37 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-09-11 20:15:37 +0300
commitb37a9860232c8f9bc8d0503783c53eb6abbae26e (patch)
tree8e52e50cd4b5a1c423f9a0f021a3a551625f386f
parent46088b593a1ee5d5c3f0b4842a7cb1678e54a086 (diff)
Jabber: more correct way to detect chat initialization mode
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp1
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp6
-rw-r--r--protocols/JabberG/src/jabber_list.h1
3 files changed, 5 insertions, 3 deletions
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index 5d625b84b7..78756b8b6f 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -319,6 +319,7 @@ void CJabberProto::GcQuit(JABBER_LIST_ITEM *item, int code, const TiXmlElement *
Contact_Hide(item->hContact, false);
item->bChatActive = false;
+ item->bChatGotSubject = false;
if (m_bJabberOnline) {
m_ThreadInfo->send(
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index 98fc55987d..1ec2e0203c 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -1026,6 +1026,7 @@ void CJabberProto::GroupchatProcessMessage(const TiXmlElement *node)
}
}
+ item->bChatGotSubject = true;
item->getTemp()->m_szStatusMessage = mir_strdup(msgText);
}
else {
@@ -1057,7 +1058,6 @@ void CJabberProto::GroupchatProcessMessage(const TiXmlElement *node)
msgTime = JabberIsoToUnixTime(p);
}
- bool isHistory = msgTime != 0;
time_t now = time(0);
if (!msgTime || msgTime > now)
msgTime = now;
@@ -1078,10 +1078,10 @@ void CJabberProto::GroupchatProcessMessage(const TiXmlElement *node)
gce.pszText.a = szText;
gce.bIsMe = nick == nullptr ? FALSE : (mir_strcmp(resource, item->nick) == 0);
- if (!isHistory)
+ if (item->bChatGotSubject)
gce.dwFlags |= GCEF_ADDTOLOG;
- if (m_bGcLogChatHistory && isHistory)
+ if (m_bGcLogChatHistory && !item->bChatGotSubject)
gce.dwFlags |= GCEF_NOTNOTIFY;
Chat_Event(&gce);
diff --git a/protocols/JabberG/src/jabber_list.h b/protocols/JabberG/src/jabber_list.h
index 258f0c8a4e..2e57760cd2 100644
--- a/protocols/JabberG/src/jabber_list.h
+++ b/protocols/JabberG/src/jabber_list.h
@@ -206,6 +206,7 @@ struct JABBER_LIST_ITEM : public MZeroedObject
char *password; // password for room
bool bAutoJoin;
+ bool bChatGotSubject; // MUC received message with subject
bool bUseResource;
bool bHistoryRead;
bool bRealContact;