diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2017-02-21 20:29:59 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2017-02-21 20:29:59 +0300 |
commit | 2cf889e14cb73a24f0ab1a5cb5e2a5d09a98c895 (patch) | |
tree | 515319bcec520c0c89bf0ac7f87d07314e491fb3 /protocols/JabberG/src/jabber_thread.cpp | |
parent | 8f7c934625129b4dde3e57163a6b1a2b01bc5963 (diff) |
protocols:
jabber:
omemo:
empty handlers for omemo message/key, omemo devicelist update
Diffstat (limited to 'protocols/JabberG/src/jabber_thread.cpp')
-rwxr-xr-x | protocols/JabberG/src/jabber_thread.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
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;
|