aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0054_vcard
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/0054_vcard
parent95e8d126db06a183918b4db4e84013ff28f8b1f7 (diff)
downloaddino-1ccad732b9a783d8f0140373602b7c1b84d04198.tar.gz
dino-1ccad732b9a783d8f0140373602b7c1b84d04198.zip
Use typed identity in stream modules
Diffstat (limited to 'xmpp-vala/src/module/xep/0054_vcard')
-rw-r--r--xmpp-vala/src/module/xep/0054_vcard/module.vala12
1 files changed, 4 insertions, 8 deletions
diff --git a/xmpp-vala/src/module/xep/0054_vcard/module.vala b/xmpp-vala/src/module/xep/0054_vcard/module.vala
index d0b23db5..037f723b 100644
--- a/xmpp-vala/src/module/xep/0054_vcard/module.vala
+++ b/xmpp-vala/src/module/xep/0054_vcard/module.vala
@@ -19,19 +19,15 @@ public class Module : XmppStreamModule {
public override void attach(XmppStream stream) {
Iq.Module.require(stream);
Presence.Module.require(stream);
- Presence.Module.get_module(stream).received_presence.connect(on_received_presence);
+ stream.get_module(Presence.Module.IDENTITY).received_presence.connect(on_received_presence);
}
public override void detach(XmppStream stream) {
- Presence.Module.get_module(stream).received_presence.disconnect(on_received_presence);
- }
-
- public static Module? get_module(XmppStream stream) {
- return (Module?) stream.get_module(IDENTITY);
+ stream.get_module(Presence.Module.IDENTITY).received_presence.disconnect(on_received_presence);
}
public static void require(XmppStream stream) {
- if (get_module(stream) == null) stderr.printf("VCardModule required but not attached!\n"); ;
+ if (stream.get_module(IDENTITY) == null) stderr.printf("VCardModule required but not attached!\n"); ;
}
public override string get_ns() { return NS_URI; }
@@ -57,7 +53,7 @@ public class Module : XmppStreamModule {
} else {
iq.to = get_bare_jid(presence.from);
}
- Iq.Module.get_module(stream).send_iq(stream, iq, new IqResponseListenerImpl(this, storage, sha1));
+ stream.get_module(Iq.Module.IDENTITY).send_iq(stream, iq, new IqResponseListenerImpl(this, storage, sha1));
}
}