summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-04-26 11:49:51 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-04-26 11:49:51 +0300
commitfd1ca33248519ee530d1d05c6a451c9c63bf4e8a (patch)
tree46dda932cb045828614cc9194cc5107cb5102111
parent7ff20362f58bb2cbdf64545b375090e02a4ae504 (diff)
Jabber: old erroneous idea about subjects in group chats removed
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp2
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp5
-rw-r--r--protocols/JabberG/src/jabber_list.h10
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp2
4 files changed, 10 insertions, 9 deletions
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index c55f4fbd16..69cc778e26 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -148,7 +148,7 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM *item)
}
item->bChatLogging = false;
- item->dwChatInitTime = time(0);
+ item->iChatInitTime = time(0);
for (int i = _countof(sttStatuses) - 1; i >= 0; i--)
Chat_AddGroup(si, TranslateW(Utf2T(sttStatuses[i])));
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index 827e9575da..03d7d5c0a1 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -1009,7 +1009,6 @@ void CJabberProto::GroupchatProcessMessage(const TiXmlElement *node)
resource = nullptr;
if ((n = XmlFirstChild(node, "subject")) != nullptr) {
- item->bChatLogging = true;
msgText = n->GetText();
if (msgText == nullptr || msgText[0] == '\0')
return;
@@ -1065,7 +1064,9 @@ void CJabberProto::GroupchatProcessMessage(const TiXmlElement *node)
if (!msgTime || msgTime > now)
msgTime = now;
- if (now - item->dwChatInitTime > 2)
+ // 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) {
diff --git a/protocols/JabberG/src/jabber_list.h b/protocols/JabberG/src/jabber_list.h
index 83d2699ef9..082d247350 100644
--- a/protocols/JabberG/src/jabber_list.h
+++ b/protocols/JabberG/src/jabber_list.h
@@ -181,11 +181,11 @@ struct JABBER_LIST_ITEM : public MZeroedObject
// LIST_CHATROOM
// jid = room JID
SESSION_INFO *si;
- HWND hwndGcListBan;
- HWND hwndGcListAdmin;
- HWND hwndGcListOwner;
- int iChatState;
- uint32_t dwChatInitTime;
+ HWND hwndGcListBan;
+ HWND hwndGcListAdmin;
+ HWND hwndGcListOwner;
+ int iChatState;
+ time_t iChatInitTime;
// LIST_FILE
// jid = string representation of port number
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index 78f9150aaf..dcd5e5d6b7 100644
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -2000,7 +2000,7 @@ int ThreadData::recv(char* buf, size_t len)
if (useZlib)
return zlibRecv(buf, (long)len);
- return proto->WsRecv(s, buf, len, MSG_DUMPASTEXT);
+ return proto->WsRecv(s, buf, (long)len, MSG_DUMPASTEXT);
}
int ThreadData::send(char* buf, int bufsize)