summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_caps.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-06-14 14:06:57 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-06-14 14:07:08 +0300
commitbe8d0bf26361c0df6a7fe949d639a7f42b962f7d (patch)
tree9b6455841897ee919b5cee4bb8f8837dd999043f /protocols/JabberG/src/jabber_caps.cpp
parent048083df09b9bc77259ff98008f29cc09e17b5cc (diff)
Jabber: fix for adjusting caps according to the options
Diffstat (limited to 'protocols/JabberG/src/jabber_caps.cpp')
-rw-r--r--protocols/JabberG/src/jabber_caps.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp
index a4d8767152..e2d663fd7c 100644
--- a/protocols/JabberG/src/jabber_caps.cpp
+++ b/protocols/JabberG/src/jabber_caps.cpp
@@ -109,7 +109,13 @@ void CJabberProto::AddDefaultCaps()
JabberCapsBits myCaps = JABBER_CAPS_MIRANDA_ALL;
if (m_bUseOMEMO)
myCaps |= JABBER_CAPS_OMEMO_DEVICELIST_NOTIFY;
-
+ if (!m_bAllowTimeReplies)
+ myCaps &= ~JABBER_CAPS_ENTITY_TIME;
+ if (!m_bAllowVersionRequests)
+ myCaps &= ~JABBER_CAPS_VERSION;
+ if (!m_bMsgAck)
+ myCaps &= ~(JABBER_CAPS_CHAT_MARKERS | JABBER_CAPS_MESSAGE_RECEIPTS);
+
for (auto &it : g_JabberFeatCapPairsExt)
if (it.Valid())
myCaps |= it.jcbCap;
@@ -368,6 +374,8 @@ bool CJabberProto::HandleCapsInfoRequest(const TiXmlElement *, CJabberIqInfo *pI
jcb &= ~JABBER_CAPS_ENTITY_TIME;
if (!m_bAllowVersionRequests)
jcb &= ~JABBER_CAPS_VERSION;
+ if (!m_bMsgAck)
+ jcb &= ~(JABBER_CAPS_CHAT_MARKERS | JABBER_CAPS_MESSAGE_RECEIPTS);
XmlNodeIq iq("result", pInfo);
@@ -436,6 +444,8 @@ void CJabberProto::UpdateFeatHash()
if (m_bUseOMEMO)
jcb |= JABBER_CAPS_OMEMO_DEVICELIST_NOTIFY;
+ if (!m_bMsgAck)
+ jcb &= ~(JABBER_CAPS_CHAT_MARKERS | JABBER_CAPS_MESSAGE_RECEIPTS);
CMStringA feat_buf(FORMAT, "client/pc//Miranda %d.%d.%d.%d<", __MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM);
for (auto &it : g_JabberFeatCapPairs)