aboutsummaryrefslogtreecommitdiff
path: root/plugins/omemo/src/stream_module.vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2017-03-13 21:54:12 +0100
committerMarvin W <git@larma.de>2017-03-13 22:00:17 +0100
commit2d6f580c871df055ca79b8a8be53e53e62aa155c (patch)
tree9c69f7c7e6a4f4ae2a3137fc580dbb507abf2ad4 /plugins/omemo/src/stream_module.vala
parent1a4cd2508bfc71801d9a1f7029580cc9e4fdf659 (diff)
downloaddino-2d6f580c871df055ca79b8a8be53e53e62aa155c.tar.gz
dino-2d6f580c871df055ca79b8a8be53e53e62aa155c.zip
correctly bootstrap omemo when there is no devicelist on server yet + concurrency bug fixes
Diffstat (limited to 'plugins/omemo/src/stream_module.vala')
-rw-r--r--plugins/omemo/src/stream_module.vala11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/omemo/src/stream_module.vala b/plugins/omemo/src/stream_module.vala
index 86a9225d..4283fd74 100644
--- a/plugins/omemo/src/stream_module.vala
+++ b/plugins/omemo/src/stream_module.vala
@@ -176,8 +176,17 @@ public class StreamModule : XmppStreamModule {
return (string)rarr;
}
- public void on_devicelist(XmppStream stream, string jid, string id, StanzaNode node) {
+ public void request_user_devicelist(XmppStream stream, string jid) {
+ stream.get_module(Pubsub.Module.IDENTITY).request(stream, jid, NODE_DEVICELIST, (stream, jid, id, node, obj) => (obj as StreamModule).on_devicelist(stream, jid, id ?? "", node), this);
+ }
+
+ public void on_devicelist(XmppStream stream, string jid, string id, StanzaNode? node_) {
+ StanzaNode? node = node_;
if (jid == get_bare_jid(Bind.Flag.get_flag(stream).my_jid) && store.local_registration_id != 0) {
+ if (node == null) {
+ node = new StanzaNode.build("list", NS_URI).add_self_xmlns().put_node(new StanzaNode.build("device", NS_URI));
+ }
+
lock (device_list_loading) {
if (!device_list_loading) {
device_list_loading = true;