aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0048_bookmarks
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-03-11 01:40:42 +0100
committerfiaxh <git@mx.ax.lt>2017-03-11 01:40:42 +0100
commit1ccad732b9a783d8f0140373602b7c1b84d04198 (patch)
tree368df267ba013c03d01c06c78b6559fa59338be3 /xmpp-vala/src/module/xep/0048_bookmarks
parent95e8d126db06a183918b4db4e84013ff28f8b1f7 (diff)
downloaddino-1ccad732b9a783d8f0140373602b7c1b84d04198.tar.gz
dino-1ccad732b9a783d8f0140373602b7c1b84d04198.zip
Use typed identity in stream modules
Diffstat (limited to 'xmpp-vala/src/module/xep/0048_bookmarks')
-rw-r--r--xmpp-vala/src/module/xep/0048_bookmarks/module.vala18
1 files changed, 7 insertions, 11 deletions
diff --git a/xmpp-vala/src/module/xep/0048_bookmarks/module.vala b/xmpp-vala/src/module/xep/0048_bookmarks/module.vala
index 25a4678e..25191122 100644
--- a/xmpp-vala/src/module/xep/0048_bookmarks/module.vala
+++ b/xmpp-vala/src/module/xep/0048_bookmarks/module.vala
@@ -13,7 +13,7 @@ public class Module : XmppStreamModule {
public void get_conferences(XmppStream stream, ConferencesRetrieveResponseListener response_listener) {
StanzaNode get_node = new StanzaNode.build("storage", NS_URI).add_self_xmlns();
- PrivateXmlStorage.Module.get_module(stream).retrieve(stream, get_node, new GetConferences(response_listener));
+ stream.get_module(PrivateXmlStorage.Module.IDENTITY).retrieve(stream, get_node, new GetConferences(response_listener));
}
public void set_conferences(XmppStream stream, ArrayList<Conference> conferences) {
@@ -21,7 +21,7 @@ public class Module : XmppStreamModule {
foreach (Conference conference in conferences) {
storage_node.put_node(conference.stanza_node);
}
- PrivateXmlStorage.Module.get_module(stream).store(stream, storage_node, new StoreResponseListenerImpl(conferences));
+ stream.get_module(PrivateXmlStorage.Module.IDENTITY).store(stream, storage_node, new StoreResponseListenerImpl(conferences));
}
private class StoreResponseListenerImpl : PrivateXmlStorage.StoreResponseListener, Object {
@@ -30,7 +30,7 @@ public class Module : XmppStreamModule {
this.conferences = conferences;
}
public void on_success(XmppStream stream) {
- Module.get_module(stream).conferences_updated(stream, conferences);
+ stream.get_module(Module.IDENTITY).conferences_updated(stream, conferences);
}
}
@@ -65,7 +65,7 @@ public class Module : XmppStreamModule {
}
public void on_result(XmppStream stream, ArrayList<Conference> conferences) {
conferences.add(conference);
- Module.get_module(stream).set_conferences(stream, conferences);
+ stream.get_module(Module.IDENTITY).set_conferences(stream, conferences);
}
}
@@ -85,7 +85,7 @@ public class Module : XmppStreamModule {
break;
}
}
- Module.get_module(stream).set_conferences(stream, conferences);
+ stream.get_module(Module.IDENTITY).set_conferences(stream, conferences);
}
}
@@ -102,7 +102,7 @@ public class Module : XmppStreamModule {
}
}
if (rem != null) conferences.remove(rem);
- Module.get_module(stream).set_conferences(stream, conferences);
+ stream.get_module(Module.IDENTITY).set_conferences(stream, conferences);
}
}
@@ -110,12 +110,8 @@ public class Module : XmppStreamModule {
public override void detach(XmppStream stream) { }
- public static Module? get_module(XmppStream stream) {
- return (Module?) stream.get_module(IDENTITY);
- }
-
public static void require(XmppStream stream) {
- if (get_module(stream) == null) stderr.printf("");
+ if (stream.get_module(IDENTITY) == null) stderr.printf("");
}
public override string get_ns() { return NS_URI; }