From c6ff3387fa7b23678bbfe644c9e1b668ac92a731 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Mon, 17 Apr 2017 22:46:12 +0200 Subject: Handle conference bookmarks w/o nick --- libdino/src/service/muc_manager.vala | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'libdino') diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala index b9d6dce2..a0d6dbe5 100644 --- a/libdino/src/service/muc_manager.vala +++ b/libdino/src/service/muc_manager.vala @@ -14,7 +14,6 @@ public class MucManager : StreamInteractionModule, Object { public signal void bookmarks_updated(Account account, ArrayList conferences); private StreamInteractor stream_interactor; - protected HashMap conference_bookmarks = new HashMap(); public static void start(StreamInteractor stream_interactor) { MucManager m = new MucManager(stream_interactor); @@ -28,10 +27,11 @@ public class MucManager : StreamInteractionModule, Object { stream_interactor.get_module(MessageProcessor.IDENTITY).pre_message_received.connect(on_pre_message_received); } - public void join(Account account, Jid jid, string nick, string? password = null) { + public void join(Account account, Jid jid, string? nick, string? password) { Core.XmppStream stream = stream_interactor.get_stream(account); if (stream == null) return; - stream.get_module(Xep.Muc.Module.IDENTITY).enter(stream, jid.bare_jid.to_string(), nick, password); + string nick_ = nick ?? account.bare_jid.localpart ?? account.bare_jid.domainpart; + stream.get_module(Xep.Muc.Module.IDENTITY).enter(stream, jid.bare_jid.to_string(), nick_, password); } public void part(Account account, Jid jid) { @@ -169,9 +169,8 @@ public class MucManager : StreamInteractionModule, Object { Account account_ = tuple.b; foreach (Xep.Bookmarks.Conference bookmark in conferences) { Jid jid = new Jid(bookmark.jid); - outer_.conference_bookmarks[jid] = bookmark; if (bookmark.autojoin) { - outer_.join(account_, jid, bookmark.nick); + outer_.join(account_, jid, bookmark.nick, bookmark.password); } } }, Tuple.create(this, account)); -- cgit v1.2.3-70-g09d2