diff options
author | fiaxh <git@mx.ax.lt> | 2017-10-28 22:02:32 +0200 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-10-31 15:41:45 +0100 |
commit | d9b91206c0291fa8aa58df572292784a4f8ff878 (patch) | |
tree | 09721f9fdffbb87ec8ab25fd1c44a7bc535fffab /xmpp-vala/src | |
parent | 7e83529afcd0ccfff5c65c99e4427bd6cf3f82ac (diff) | |
download | dino-d9b91206c0291fa8aa58df572292784a4f8ff878.tar.gz dino-d9b91206c0291fa8aa58df572292784a4f8ff878.zip |
Keep MUC join dialog open until joined, show errors
Diffstat (limited to 'xmpp-vala/src')
-rw-r--r-- | xmpp-vala/src/module/xep/0045_muc/module.vala | 6 | ||||
-rw-r--r-- | xmpp-vala/src/module/xep/0199_ping.vala | 4 |
2 files changed, 6 insertions, 4 deletions
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) { |