summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsss <sss@dark-alexandr.net>2022-03-13 15:40:36 +0300
committersss <sss@dark-alexandr.net>2022-03-13 15:41:24 +0300
commit0187ea2b4e05a9db837260bb1a581b9e86e280c2 (patch)
tree7b57057fecf0e47d246c78fa2efdaf3f67f78f6c
parent0c1773e33853e75d31ba1d2e073567acce0606a5 (diff)
omemo: removed outdated comments, added non-standard complient hack for devicelist polling (still need response handler as it is not event and not handled by existing handler)
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp1
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp11
2 files changed, 10 insertions, 2 deletions
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index cfdadd8696..6af5a01d2a 100755
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -919,7 +919,6 @@ int CJabberProto::SendMsg(MCONTACT hContact, int unused_unknown, const char *psz
// omemo enabled in options, omemo enabled for contact
if (m_bUseOMEMO && OmemoIsEnabled(hContact) && !mir_strcmp(msgType, "chat")) {
- // TODO: check if message encrypted for at least one session and return error if not
if (!OmemoEncryptMessage(m, pszSrc, hContact)) {
ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, 0, (LPARAM)TranslateT("No valid OMEMO session exists"));
return 0;
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index 3f23c57079..7aa94ca70c 100755
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -941,7 +941,6 @@ void CJabberProto::OnProcessPubsubEvent(const TiXmlElement *node)
OmemoHandleDeviceList(from, itemsNode);
return;
}
- //TODO:handle omemo device list
}
if (m_bEnableUserTune)
@@ -1571,6 +1570,16 @@ void CJabberProto::OnProcessPresence(const TiXmlElement *node, ThreadData *info)
}
hContact = DBCreateContact(from, nick, true, true);
}
+ if (hContact && m_bUseOMEMO)
+ {
+ char szBareJid[JABBER_MAX_JID_LEN];
+ XmlNodeIq iq("get", SerialNext());
+ iq << XATTR("from", m_ThreadInfo->fullJID);
+ iq << XATTR("to", from);
+ iq << XCHILDNS("pubsub", "http://jabber.org/protocol/pubsub")
+ << XCHILD("items") << XATTR("node", JABBER_FEAT_OMEMO ".devicelist");
+ m_ThreadInfo->send(iq);
+ }
if (!ListGetItemPtr(LIST_ROSTER, from)) {
debugLogA("Receive presence online from %s (who is not in my roster)", from);
ListAdd(LIST_ROSTER, from, hContact);