summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_omemo.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2017-03-21 17:36:58 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2017-03-21 17:38:16 +0300
commit61d7b63b8aafd5315de4933ffd56db6b4c94042a (patch)
treef4ccc6bf2b77ebf08ad995555e0079d34672ccc8 /protocols/JabberG/src/jabber_omemo.cpp
parent3dd1a999c9e643fd92fd34301d9e65a7f07d8c54 (diff)
omemo: working on 4.3
createnode fixes typo fixes
Diffstat (limited to 'protocols/JabberG/src/jabber_omemo.cpp')
-rwxr-xr-xprotocols/JabberG/src/jabber_omemo.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/protocols/JabberG/src/jabber_omemo.cpp b/protocols/JabberG/src/jabber_omemo.cpp
index db7ef41854..de38332f0c 100755
--- a/protocols/JabberG/src/jabber_omemo.cpp
+++ b/protocols/JabberG/src/jabber_omemo.cpp
@@ -471,8 +471,6 @@ namespace omemo {
mir_free(key);
signal_buffer_free(key_buf);
-
- //TODO: generate and store "bundle"
//TODO: is it required to resend bundle everytime with device ?
//generate and save signed pre key
@@ -550,6 +548,13 @@ namespace omemo {
iq << XATTR(L"from", proto->m_ThreadInfo->fullJID); //full unstripped jid used here
HXML create_node = iq << XCHILDNS(L"pubsub", L"http://jabber.org/protocol/pubsub") << XCHILD(L"create");
create_node << XATTR(L"node", node_name);
+ if(!mir_wstrcmp(node_name, JABBER_FEAT_OMEMO L":devicelist"))
+ {
+ DWORD own_id = omemo::GetOwnDeviceId(proto);
+ wchar_t attr_val[128];
+ mir_snwprintf(attr_val, L"%s:bundles:%d", JABBER_FEAT_OMEMO, own_id);
+ pubsub_createnode_impl(attr_val, proto);
+ }
proto->m_ThreadInfo->send(iq);
}
@@ -696,7 +701,9 @@ void CJabberProto::OmemoHandleDeviceList(HXML node)
node = XmlGetChildByTag(node, L"list", L"xmlns", JABBER_FEAT_OMEMO); //<list xmlns = 'urn:xmpp:omemo:0'>
if (!node)
return;
- bool own_jid = false; //TODO: detect own jid (not working due to jabber_thread.cpp:947+)
+ bool own_jid = false;
+ if (wcsstr(m_ThreadInfo->fullJID, jid))
+ own_jid = true;
DWORD current_id;
LPCTSTR current_id_str;
if (own_jid)
@@ -823,8 +830,4 @@ void CJabberProto::OmemoSendBundle()
void CJabberProto::OmemoCreateNodes()
{
omemo::pubsub_createnode(JABBER_FEAT_OMEMO L":devicelist", this);
- DWORD own_id = omemo::GetOwnDeviceId(this);
- wchar_t attr_val[128];
- mir_snwprintf(attr_val, L"%s:bundles:%d", JABBER_FEAT_OMEMO, own_id);
- omemo::pubsub_createnode(attr_val, this);
}