diff options
author | fiaxh <git@lightrise.org> | 2020-04-24 14:19:42 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2020-04-24 14:19:42 +0200 |
commit | f8f305efe551838c780dce4224c06bed695d8a62 (patch) | |
tree | 1e5b9f6988d0bb911a53d3234eba464873e6984b /xmpp-vala/src/module/session.vala | |
parent | 1db94905ae7af1c1aed475a090dfb09e59fb2520 (diff) | |
download | dino-f8f305efe551838c780dce4224c06bed695d8a62.tar.gz dino-f8f305efe551838c780dce4224c06bed695d8a62.zip |
xmpp-vala: Use more async
Diffstat (limited to 'xmpp-vala/src/module/session.vala')
-rw-r--r-- | xmpp-vala/src/module/session.vala | 12 |
1 files changed, 6 insertions, 6 deletions
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; + } } } } |