summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorsss <sss@dark-alexandr.net>2021-11-06 19:59:39 +0300
committersss <sss@dark-alexandr.net>2021-11-06 19:59:39 +0300
commit66940037defd069b5c6676969b889b60a8ed8fd0 (patch)
tree68085e32629d75b3d4be1842b90e4173f431ed13 /protocols
parentd72c08e9da0b5aa8633e9830d6f8fda77caaa0fe (diff)
omemo: check for "bDisableOmemo" in one more place
Diffstat (limited to 'protocols')
-rwxr-xr-xprotocols/JabberG/src/jabber_omemo.cpp5
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp2
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp2
3 files changed, 4 insertions, 5 deletions
diff --git a/protocols/JabberG/src/jabber_omemo.cpp b/protocols/JabberG/src/jabber_omemo.cpp
index 96febae289..8248deddce 100755
--- a/protocols/JabberG/src/jabber_omemo.cpp
+++ b/protocols/JabberG/src/jabber_omemo.cpp
@@ -2138,8 +2138,7 @@ int CJabberProto::OmemoEncryptMessage(XmlNode &msg, const char *msg_text, MCONTA
return session_count;
}
-bool CJabberProto::OmemoIsEnabled(MCONTACT /*hContact*/)
+bool CJabberProto::OmemoIsEnabled(MCONTACT hContact)
{
- //TODO:
- return true;
+ return !getByte(hContact, "bDisableOmemo", 0);
}
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index bef30e5e0c..7beb4d6a42 100755
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -887,7 +887,7 @@ int CJabberProto::SendMsg(MCONTACT hContact, int unused_unknown, const char *psz
return 1;
}
- if (m_bUseOMEMO && !getByte(hContact, "bDisableOmemo", 0)) {
+ if (m_bUseOMEMO && OmemoIsEnabled(hContact)) {
if (!OmemoCheckSession(hContact)) {
OmemoPutMessageToOutgoingQueue(hContact, unused_unknown, pszSrc);
int id = SerialNext();
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index aa6e78f6cd..e012da46cd 100755
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -1261,7 +1261,7 @@ void CJabberProto::OnProcessMessage(const TiXmlElement *node, ThreadData *info)
// parsing extensions
for (auto *xNode : TiXmlEnum(node)) {
- if (m_bUseOMEMO && !getByte(hContact, "bDisableOmemo", 0)) {
+ if (m_bUseOMEMO && OmemoIsEnabled(hContact)) {
if (!mir_strcmp(xNode->Name(), "encrypted") && xNode->Attribute("xmlns", JABBER_FEAT_OMEMO)) {
if (!OmemoHandleMessage(xNode, from, msgTime))
OmemoPutMessageToIncommingQueue(xNode, from, msgTime);