From 1ccad732b9a783d8f0140373602b7c1b84d04198 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sat, 11 Mar 2017 01:40:42 +0100 Subject: Use typed identity in stream modules --- xmpp-vala/src/module/bind.vala | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'xmpp-vala/src/module/bind.vala') diff --git a/xmpp-vala/src/module/bind.vala b/xmpp-vala/src/module/bind.vala index 388a907e..4ddce17d 100644 --- a/xmpp-vala/src/module/bind.vala +++ b/xmpp-vala/src/module/bind.vala @@ -35,14 +35,14 @@ namespace Xmpp.Bind { var flag = new Flag(); StanzaNode bind_node = new StanzaNode.build("bind", NS_URI).add_self_xmlns() .put_node(new StanzaNode.build("resource", NS_URI).put_node(new StanzaNode.text(requested_resource))); - Iq.Module.get_module(stream).send_iq(stream, new Iq.Stanza.set(bind_node), new IqResponseListenerImpl()); + stream.get_module(Iq.Module.IDENTITY).send_iq(stream, new Iq.Stanza.set(bind_node), new IqResponseListenerImpl()); stream.add_flag(flag); } } private class IqResponseListenerImpl : Iq.ResponseListener, Object { public void on_result(XmppStream stream, Iq.Stanza iq) { - Bind.Module.get_module(stream).iq_response_stanza(stream, iq); + stream.get_module(Bind.Module.IDENTITY).iq_response_stanza(stream, iq); } } @@ -55,12 +55,8 @@ namespace Xmpp.Bind { stream.received_features_node.disconnect(this.received_features_node); } - public static Module? get_module(XmppStream stream) { - return (Module?) stream.get_module(IDENTITY); - } - public static void require(XmppStream stream) { - if (get_module(stream) == null) stream.add_module(new Bind.Module("")); + if (stream.get_module(IDENTITY) == null) stream.add_module(new Bind.Module("")); } public override bool mandatory_outstanding(XmppStream stream) { -- cgit v1.2.3-54-g00ecf