summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_omemo.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2017-04-02 16:16:36 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2017-04-02 16:21:26 +0300
commitd353887c8cde702539d8d0f3d339c158498648ed (patch)
tree9ae3d71ee095da94637d57f77b4c396749dd2ebe /protocols/JabberG/src/jabber_omemo.cpp
parent85f860270ed1c622e3e15ee49e741512305a5fe2 (diff)
jabber: omemo: working on 4.3
proper dynamic caps implementation for omemo caps/features and for miranda caps/features in general as required by xep-0115 removed my old attempt to implement dynamic omemo cap fixed few bugs in OmemoHandleDeviceList
Diffstat (limited to 'protocols/JabberG/src/jabber_omemo.cpp')
-rwxr-xr-xprotocols/JabberG/src/jabber_omemo.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/protocols/JabberG/src/jabber_omemo.cpp b/protocols/JabberG/src/jabber_omemo.cpp
index a86e8e0805..be4f9ce400 100755
--- a/protocols/JabberG/src/jabber_omemo.cpp
+++ b/protocols/JabberG/src/jabber_omemo.cpp
@@ -559,7 +559,7 @@ void CJabberProto::OmemoHandleDeviceList(HXML node)
if (!node)
return;
HXML message = xmlGetParent(node);
- message = xmlGetParent(node);
+ message = xmlGetParent(message);
LPCTSTR jid = XmlGetAttrValue(message, L"from");
MCONTACT hContact = HContactFromJID(jid);
node = XmlGetChild(node, "item"); //get <item> node
@@ -578,9 +578,9 @@ void CJabberProto::OmemoHandleDeviceList(HXML node)
//check if our device exist
bool own_device_listed = false;
DWORD own_id = omemo::GetOwnDeviceId(this);
- int i = 0;
char setting_name[64];
- for (HXML list_item = xmlGetFirstChild(node); list_item; xmlGetNextNode(list_item))
+ HXML list_item;
+ for (int p = 1, i = 0; (list_item = XmlGetNthChild(node, L"device", p)) != NULL; p++, i++)
{
current_id_str = xmlGetAttrValue(list_item, L"id");
current_id = _wtoi(current_id_str);
@@ -591,13 +591,14 @@ void CJabberProto::OmemoHandleDeviceList(HXML node)
}
if (!own_device_listed)
OmemoAnnounceDevice();
+ //TODO: remove all settings higher than 'i' from db
}
else
{
//store device id's
- int i = 0;
char setting_name[64];
- for (HXML list_item = xmlGetFirstChild(node); list_item; xmlGetNextNode(list_item), i++)
+ HXML list_item;
+ for (int p = 1, i = 0; (list_item = XmlGetNthChild(node, L"device", p)) != NULL; p++, i++)
{
current_id_str = xmlGetAttrValue(list_item, L"id");
current_id = _wtoi(current_id_str);