diff options
author | fiaxh <git@mx.ax.lt> | 2017-04-17 22:46:12 +0200 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-04-17 22:48:43 +0200 |
commit | c6ff3387fa7b23678bbfe644c9e1b668ac92a731 (patch) | |
tree | b94ff5fb03bff01a0f204883bdcf827f528f7567 /libdino/src | |
parent | 653c361420d658097a4affeb8bf256f02cc9bb2a (diff) | |
download | dino-c6ff3387fa7b23678bbfe644c9e1b668ac92a731.tar.gz dino-c6ff3387fa7b23678bbfe644c9e1b668ac92a731.zip |
Handle conference bookmarks w/o nick
Diffstat (limited to 'libdino/src')
-rw-r--r-- | libdino/src/service/muc_manager.vala | 9 |
1 files changed, 4 insertions, 5 deletions
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<Xep.Bookmarks.Conference> conferences); private StreamInteractor stream_interactor; - protected HashMap<Jid, Xep.Bookmarks.Conference> conference_bookmarks = new HashMap<Jid, Xep.Bookmarks.Conference>(); 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)); |