summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2017-02-21 20:29:59 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2017-02-21 20:29:59 +0300
commit2cf889e14cb73a24f0ab1a5cb5e2a5d09a98c895 (patch)
tree515319bcec520c0c89bf0ac7f87d07314e491fb3 /protocols/JabberG/src
parent8f7c934625129b4dde3e57163a6b1a2b01bc5963 (diff)
protocols:
jabber: omemo: empty handlers for omemo message/key, omemo devicelist update
Diffstat (limited to 'protocols/JabberG/src')
-rwxr-xr-xprotocols/JabberG/src/jabber_omemo.cpp10
-rwxr-xr-x[-rw-r--r--]protocols/JabberG/src/jabber_proto.h4
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp27
3 files changed, 41 insertions, 0 deletions
diff --git a/protocols/JabberG/src/jabber_omemo.cpp b/protocols/JabberG/src/jabber_omemo.cpp
index 6cd11cbe42..be4f896e49 100755
--- a/protocols/JabberG/src/jabber_omemo.cpp
+++ b/protocols/JabberG/src/jabber_omemo.cpp
@@ -412,3 +412,13 @@ namespace omemo {
}
};
+
+void CJabberProto::OmemoHandleMessage(HXML /*node*/)
+{
+ //TODO: handle "encrypted" node here
+}
+
+void CJabberProto::OmemoHandleDeviceList(HXML /*node*/)
+{
+ //TODO: handle omemo device list event node here
+} \ No newline at end of file
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index f62d73c528..b2042bcdd1 100644..100755
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -336,6 +336,10 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void AddMucListItem(JABBER_MUC_JIDLIST_INFO* jidListInfo, const wchar_t* str, const wchar_t* rsn);
void DeleteMucListItem(JABBER_MUC_JIDLIST_INFO* jidListInfo, const wchar_t* jid);
+ //---- jabber_omemo.cpp --------------------------------------------------------------
+ void OmemoHandleMessage(HXML node);
+ void OmemoHandleDeviceList(HXML node);
+
//---- jabber_console.cpp ------------------------------------------------------------
INT_PTR __cdecl OnMenuHandleConsole(WPARAM wParam, LPARAM lParam);
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;