From dabc2a8b1d2a7bf2019e5f913c736d80f11ceb53 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Tue, 13 Jun 2017 16:04:26 +0200 Subject: MUC join behaviour + small MUC error changes --- libdino/src/service/muc_manager.vala | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libdino/src') diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala index d6132d19..2c916c99 100644 --- a/libdino/src/service/muc_manager.vala +++ b/libdino/src/service/muc_manager.vala @@ -14,6 +14,7 @@ public class MucManager : StreamInteractionModule, Object { public signal void bookmarks_updated(Account account, Gee.List conferences); private StreamInteractor stream_interactor; + private HashMap enter_errors = new HashMap(Jid.hash_func, Jid.equals_func); public static void start(StreamInteractor stream_interactor) { MucManager m = new MucManager(stream_interactor); @@ -28,6 +29,8 @@ public class MucManager : StreamInteractionModule, Object { } public void join(Account account, Jid jid, string? nick, string? password) { + if (enter_errors.has_key(jid)) return; + Core.XmppStream? stream = stream_interactor.get_stream(account); if (stream == null) return; string nick_ = nick ?? account.bare_jid.localpart ?? account.bare_jid.domainpart; @@ -204,6 +207,9 @@ public class MucManager : StreamInteractionModule, Object { stream_interactor.module_manager.get_module(account, Xep.Muc.Module.IDENTITY).room_entered.connect( (stream, jid, nick) => { joined(account, new Jid(jid), nick); }); + stream_interactor.module_manager.get_module(account, Xep.Muc.Module.IDENTITY).room_enter_error.connect( (stream, jid, error) => { + enter_errors[new Jid(jid)] = error; + }); stream_interactor.module_manager.get_module(account, Xep.Muc.Module.IDENTITY).self_removed_from_room.connect( (stream, jid, code) => { left(account, new Jid(jid)); }); -- cgit v1.2.3-70-g09d2