aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/bind.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-08-12 23:14:50 +0200
committerfiaxh <git@mx.ax.lt>2017-08-14 22:38:12 +0200
commita59f728bdd7b81964a460b96b6c56da0d9dfda01 (patch)
tree21f1e2bd3a83a296f87f1a0307f258f0732dff24 /xmpp-vala/src/module/bind.vala
parent6904bda756321c67bea0108342fa9ba859dd66e9 (diff)
downloaddino-a59f728bdd7b81964a460b96b6c56da0d9dfda01.tar.gz
dino-a59f728bdd7b81964a460b96b6c56da0d9dfda01.zip
Stream Management
Diffstat (limited to 'xmpp-vala/src/module/bind.vala')
-rw-r--r--xmpp-vala/src/module/bind.vala7
1 files changed, 3 insertions, 4 deletions
diff --git a/xmpp-vala/src/module/bind.vala b/xmpp-vala/src/module/bind.vala
index 7b08e0f7..a13f9640 100644
--- a/xmpp-vala/src/module/bind.vala
+++ b/xmpp-vala/src/module/bind.vala
@@ -7,7 +7,7 @@ namespace Xmpp.Bind {
public class Module : XmppStreamNegotiationModule {
public static ModuleIdentity<Module> IDENTITY = new ModuleIdentity<Module>(NS_URI, "bind_module");
- private string requested_resource;
+ public string requested_resource { get; set; }
public signal void bound_to_resource(XmppStream stream, string my_jid);
@@ -28,15 +28,14 @@ namespace Xmpp.Bind {
public void received_features_node(XmppStream stream) {
if (stream.is_setup_needed()) return;
+ if (stream.is_negotiation_active()) return;
var bind = stream.features.get_subnode("bind", NS_URI);
if (bind != null) {
var flag = new Flag();
StanzaNode bind_node = new StanzaNode.build("bind", NS_URI).add_self_xmlns();
bind_node.put_node(new StanzaNode.build("resource", NS_URI).put_node(new StanzaNode.text(requested_resource)));
- stream.get_module(Iq.Module.IDENTITY).send_iq(stream, new Iq.Stanza.set(bind_node), (stream, iq) => {
- stream.get_module(Module.IDENTITY).iq_response_stanza(stream, iq);
- });
+ stream.get_module(Iq.Module.IDENTITY).send_iq(stream, new Iq.Stanza.set(bind_node), iq_response_stanza);
stream.add_flag(flag);
}
}