From 2cf889e14cb73a24f0ab1a5cb5e2a5d09a98c895 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Tue, 21 Feb 2017 20:29:59 +0300 Subject: protocols: jabber: omemo: empty handlers for omemo message/key, omemo devicelist update --- protocols/JabberG/src/jabber_thread.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'protocols/JabberG/src/jabber_thread.cpp') diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 0b28ee9157..df32105d1d 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -949,6 +949,16 @@ void CJabberProto::OnProcessPubsubEvent(HXML node) return; HXML itemsNode; + if (m_options.UseOMEMO) + { + itemsNode = XmlGetChildByTag(eventNode, "items", "node", JABBER_FEAT_OMEMO":devicelist"); + if (itemsNode) + { + OmemoHandleDeviceList(itemsNode); + return; + } + //TODO:handle omemo device list + } if (m_options.EnableUserTune && (itemsNode = XmlGetChildByTag(eventNode, "items", "node", JABBER_FEAT_USER_TUNE))) { // node retract? if (XmlGetChild(itemsNode, "retract")) { @@ -1183,6 +1193,23 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) // parsing extensions for (int i = 0; (xNode = XmlGetChild(node, i)) != NULL; i++) { + if (m_options.UseOMEMO) + { + //TODO: handle incomming omemo message/key + if ((xNode = XmlGetNthChild(node, L"encrypted", i + 1)) == NULL) + { + const wchar_t *ptszXmlns = XmlGetAttrValue(xNode, L"xmlns"); + if (ptszXmlns == NULL) + continue; + + if (!mir_wstrcmp(ptszXmlns, JABBER_FEAT_OMEMO)) + { + OmemoHandleMessage(xNode); + continue; + } + } + + } if ((xNode = XmlGetNthChild(node, L"x", i + 1)) == NULL) continue; -- cgit v1.2.3