summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src
diff options
context:
space:
mode:
authorsss <sss@dark-alexandr.net>2022-03-13 19:13:44 +0300
committersss <sss@dark-alexandr.net>2022-03-13 19:13:44 +0300
commit152bd3a7503805978ba7c9fd4f62caf74547c20b (patch)
tree38d2fa6ce7f9681803c2f89bc86e130102208e4e /protocols/JabberG/src
parent0187ea2b4e05a9db837260bb1a581b9e86e280c2 (diff)
omemo: added iqresult handler for manual polling of devicelist
Diffstat (limited to 'protocols/JabberG/src')
-rwxr-xr-xprotocols/JabberG/src/jabber_iqid.cpp9
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.h1
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp4
3 files changed, 14 insertions, 0 deletions
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index d46980ca7e..a0c0d8bdfd 100755
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -1069,6 +1069,15 @@ void CJabberProto::OnIqResultSetVcard(const TiXmlElement *iqNode, CJabberIqInfo*
SendPresence(m_iStatus, false);
}
}
+void CJabberProto::OnIqResultGetOmemodevicelist(const TiXmlElement* iqNode, CJabberIqInfo* pInfo)
+{
+ auto* itemsNode = XmlGetChildByTag(iqNode, "items", "node", JABBER_FEAT_OMEMO ".devicelist");
+ auto from = XmlGetAttr(iqNode, "from");
+ if (itemsNode) {
+ OmemoHandleDeviceList(from, itemsNode);
+ return;
+ }
+}
void CJabberProto::OnIqResultSetSearch(const TiXmlElement *iqNode, CJabberIqInfo*)
{
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index 6b3047b2cb..6d7cd09086 100755
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -566,6 +566,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void OnIqResultSetPassword(const TiXmlElement *iqNode, CJabberIqInfo *pInfo);
void OnIqResultSetSearch(const TiXmlElement *iqNode, CJabberIqInfo *pInfo);
void OnIqResultSetVcard(const TiXmlElement *iqNode, CJabberIqInfo *pInfo);
+ void OnIqResultGetOmemodevicelist(const TiXmlElement* iqNode, CJabberIqInfo* pInfo);
void OnProcessLoginRq(ThreadData *info, uint32_t rq);
void OnLoggedIn(void);
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index 7aa94ca70c..8a9d408fc6 100755
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -1578,6 +1578,10 @@ void CJabberProto::OnProcessPresence(const TiXmlElement *node, ThreadData *info)
iq << XATTR("to", from);
iq << XCHILDNS("pubsub", "http://jabber.org/protocol/pubsub")
<< XCHILD("items") << XATTR("node", JABBER_FEAT_OMEMO ".devicelist");
+ m_ThreadInfo->send(
+ XmlNodeIq(AddIQ(&CJabberProto::OnIqResultGetRoster, JABBER_IQ_TYPE_GET))
+ << XCHILDNS("query", JABBER_FEAT_IQ_ROSTER));
+
m_ThreadInfo->send(iq);
}
if (!ListGetItemPtr(LIST_ROSTER, from)) {