diff options
-rwxr-xr-x | protocols/JabberG/src/jabber_omemo.cpp | 5 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_proto.cpp | 2 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_thread.cpp | 2 |
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);
|