aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-06-13 16:04:26 +0200
committerfiaxh <git@mx.ax.lt>2017-06-13 19:51:24 +0200
commitdabc2a8b1d2a7bf2019e5f913c736d80f11ceb53 (patch)
treec767da379fa8b3da9c17446bfb64bbd945fb9305 /libdino/src/service
parente63d59eb3450471b33a22efda6df8871818209b1 (diff)
downloaddino-dabc2a8b1d2a7bf2019e5f913c736d80f11ceb53.tar.gz
dino-dabc2a8b1d2a7bf2019e5f913c736d80f11ceb53.zip
MUC join behaviour + small MUC error changes
Diffstat (limited to 'libdino/src/service')
-rw-r--r--libdino/src/service/muc_manager.vala6
1 files changed, 6 insertions, 0 deletions
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<Xep.Bookmarks.Conference> conferences);
private StreamInteractor stream_interactor;
+ private HashMap<Jid, Xep.Muc.MucEnterError> enter_errors = new HashMap<Jid, Xep.Muc.MucEnterError>(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));
});