From f8f305efe551838c780dce4224c06bed695d8a62 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Fri, 24 Apr 2020 14:19:42 +0200 Subject: xmpp-vala: Use more async --- xmpp-vala/src/module/session.vala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'xmpp-vala/src/module/session.vala') diff --git a/xmpp-vala/src/module/session.vala b/xmpp-vala/src/module/session.vala index c9e88a27..b1436d1e 100644 --- a/xmpp-vala/src/module/session.vala +++ b/xmpp-vala/src/module/session.vala @@ -22,16 +22,16 @@ public class Module : XmppStreamNegotiationModule { public override string get_ns() { return NS_URI; } public override string get_id() { return IDENTITY.id; } - private void on_bound_resource(XmppStream stream, Jid my_jid) { + private async void on_bound_resource(XmppStream stream, Jid my_jid) { StanzaNode? session_node = stream.features.get_subnode("session", NS_URI); if (session_node != null && session_node.get_subnode("optional", NS_URI) == null) { stream.add_flag(new Flag()); Iq.Stanza iq = new Iq.Stanza.set(new StanzaNode.build("session", NS_URI).add_self_xmlns()) { to=stream.remote_name }; - stream.get_module(Iq.Module.IDENTITY).send_iq(stream, iq, (stream, iq) => { - if (!iq.is_error()) { - stream.get_flag(Flag.IDENTITY).finished = true; - } - }); + + Iq.Stanza result_iq = yield stream.get_module(Iq.Module.IDENTITY).send_iq_async(stream, iq); + if (!result_iq.is_error()) { + stream.get_flag(Flag.IDENTITY).finished = true; + } } } } -- cgit v1.2.3