From d9b91206c0291fa8aa58df572292784a4f8ff878 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sat, 28 Oct 2017 22:02:32 +0200 Subject: Keep MUC join dialog open until joined, show errors --- xmpp-vala/src/module/xep/0045_muc/module.vala | 6 +++--- xmpp-vala/src/module/xep/0199_ping.vala | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'xmpp-vala/src/module/xep') diff --git a/xmpp-vala/src/module/xep/0045_muc/module.vala b/xmpp-vala/src/module/xep/0045_muc/module.vala index 0b92119c..08747343 100644 --- a/xmpp-vala/src/module/xep/0045_muc/module.vala +++ b/xmpp-vala/src/module/xep/0045_muc/module.vala @@ -163,7 +163,7 @@ public class Module : XmppStreamModule { public override void attach(XmppStream stream) { stream.add_flag(new Muc.Flag()); stream.get_module(Message.Module.IDENTITY).received_message.connect(on_received_message); - stream.get_module(Presence.Module.IDENTITY).received_presence.connect(on_received_presence); + stream.get_module(Presence.Module.IDENTITY).received_presence.connect(check_for_enter_error); stream.get_module(Presence.Module.IDENTITY).received_available.connect(on_received_available); stream.get_module(Presence.Module.IDENTITY).received_unavailable.connect(on_received_unavailable); if (stream.get_module(ServiceDiscovery.Module.IDENTITY) != null) { @@ -179,7 +179,7 @@ public class Module : XmppStreamModule { public override void detach(XmppStream stream) { stream.get_module(Message.Module.IDENTITY).received_message.disconnect(on_received_message); - stream.get_module(Presence.Module.IDENTITY).received_presence.disconnect(on_received_presence); + stream.get_module(Presence.Module.IDENTITY).received_presence.disconnect(check_for_enter_error); stream.get_module(Presence.Module.IDENTITY).received_available.disconnect(on_received_available); stream.get_module(Presence.Module.IDENTITY).received_unavailable.disconnect(on_received_unavailable); } @@ -206,7 +206,7 @@ public class Module : XmppStreamModule { } } - private void on_received_presence(XmppStream stream, Presence.Stanza presence) { + private void check_for_enter_error(XmppStream stream, Presence.Stanza presence) { Flag flag = stream.get_flag(Flag.IDENTITY); if (presence.is_error() && flag.is_muc_enter_outstanding() && flag.is_occupant(presence.from)) { string bare_jid = get_bare_jid(presence.from); diff --git a/xmpp-vala/src/module/xep/0199_ping.vala b/xmpp-vala/src/module/xep/0199_ping.vala index 74802be1..4902b0c7 100644 --- a/xmpp-vala/src/module/xep/0199_ping.vala +++ b/xmpp-vala/src/module/xep/0199_ping.vala @@ -12,7 +12,9 @@ namespace Xmpp.Xep.Ping { public void send_ping(XmppStream stream, string jid, owned OnResult? listener) { Iq.Stanza iq = new Iq.Stanza.get(new StanzaNode.build("ping", NS_URI).add_self_xmlns()); iq.to = jid; - stream.get_module(Iq.Module.IDENTITY).send_iq(stream, iq, (stream) => { listener(stream); }); + stream.get_module(Iq.Module.IDENTITY).send_iq(stream, iq, (stream) => { + if (listener != null) listener(stream); + }); } public override void attach(XmppStream stream) { -- cgit v1.2.3-70-g09d2