aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0048_bookmarks/module.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-04-23 13:50:32 +0200
committerfiaxh <git@mx.ax.lt>2017-04-23 14:03:44 +0200
commit3eb9aa0fa79ea9fcebb5f702f81c2e54aafdc8cc (patch)
tree01d04b731296a807285621ad628e79e48ef3c077 /xmpp-vala/src/module/xep/0048_bookmarks/module.vala
parent5c8275ed4efdc7a3a0bc2a9c3a3f46d0383ddcf4 (diff)
downloaddino-3eb9aa0fa79ea9fcebb5f702f81c2e54aafdc8cc.tar.gz
dino-3eb9aa0fa79ea9fcebb5f702f81c2e54aafdc8cc.zip
Sync MUC join/part behaviour with autojoin flag in bookmarks
Diffstat (limited to 'xmpp-vala/src/module/xep/0048_bookmarks/module.vala')
-rw-r--r--xmpp-vala/src/module/xep/0048_bookmarks/module.vala12
1 files changed, 7 insertions, 5 deletions
diff --git a/xmpp-vala/src/module/xep/0048_bookmarks/module.vala b/xmpp-vala/src/module/xep/0048_bookmarks/module.vala
index 0e0d9489..bf5bd612 100644
--- a/xmpp-vala/src/module/xep/0048_bookmarks/module.vala
+++ b/xmpp-vala/src/module/xep/0048_bookmarks/module.vala
@@ -8,25 +8,27 @@ private const string NS_URI = "storage:bookmarks";
public class Module : XmppStreamModule {
public static ModuleIdentity<Module> IDENTITY = new ModuleIdentity<Module>(NS_URI, "0048_bookmarks_module");
- public signal void conferences_updated(XmppStream stream, ArrayList<Conference> conferences);
+ public signal void received_conferences(XmppStream stream, Gee.List<Conference> conferences);
- [CCode (has_target = false)] public delegate void OnResult(XmppStream stream, ArrayList<Conference> conferences, Object? reference);
+ [CCode (has_target = false)] public delegate void OnResult(XmppStream stream, Gee.List<Conference> conferences, Object? storage);
public void get_conferences(XmppStream stream, OnResult listener, Object? store) {
StanzaNode get_node = new StanzaNode.build("storage", NS_URI).add_self_xmlns();
stream.get_module(PrivateXmlStorage.Module.IDENTITY).retrieve(stream, get_node, (stream, node, o) => {
Tuple<OnResult, Object?> tuple = o as Tuple<OnResult, Object?>;
OnResult on_result = tuple.a;
- on_result(stream, get_conferences_from_stanza(node), tuple.b);
+ Gee.List<Conference> conferences = get_conferences_from_stanza(node);
+ stream.get_module(Module.IDENTITY).received_conferences(stream, conferences);
+ on_result(stream, conferences, tuple.b);
}, Tuple.create(listener, store));
}
- public void set_conferences(XmppStream stream, ArrayList<Conference> conferences) {
+ public void set_conferences(XmppStream stream, Gee.List<Conference> conferences) {
StanzaNode storage_node = (new StanzaNode.build("storage", NS_URI)).add_self_xmlns();
foreach (Conference conference in conferences) {
storage_node.put_node(conference.stanza_node);
}
stream.get_module(PrivateXmlStorage.Module.IDENTITY).store(stream, storage_node, (stream, o) => {
- stream.get_module(Module.IDENTITY).conferences_updated(stream, o as ArrayList<Conference>);
+ stream.get_module(Module.IDENTITY).received_conferences(stream, o as ArrayList<Conference>);
}, conferences);
}