From db57a973534f099af2b150f1a1307d1948553d9f Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sun, 19 Mar 2017 12:55:36 +0100 Subject: Add typed identity to manager modules and stream flags --- main/src/ui/add_conversation/chat/add_contact_dialog.vala | 4 ++-- main/src/ui/add_conversation/chat/dialog.vala | 6 +++--- main/src/ui/add_conversation/chat/roster_list.vala | 6 +++--- main/src/ui/add_conversation/conference/add_groupchat_dialog.vala | 4 ++-- main/src/ui/add_conversation/conference/conference_list.vala | 4 ++-- main/src/ui/add_conversation/conference/dialog.vala | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) (limited to 'main/src/ui/add_conversation') diff --git a/main/src/ui/add_conversation/chat/add_contact_dialog.vala b/main/src/ui/add_conversation/chat/add_contact_dialog.vala index df8fbeb9..88bfe2be 100644 --- a/main/src/ui/add_conversation/chat/add_contact_dialog.vala +++ b/main/src/ui/add_conversation/chat/add_contact_dialog.vala @@ -41,9 +41,9 @@ protected class AddContactDialog : Gtk.Dialog { account = account2; } } - RosterManager.get_instance(stream_interactor).add_jid(account, jid, alias); + stream_interactor.get_module(RosterManager.IDENTITY).add_jid(account, jid, alias); if (subscribe_checkbutton.active) { - PresenceManager.get_instance(stream_interactor).request_subscription(account, jid); + stream_interactor.get_module(PresenceManager.IDENTITY).request_subscription(account, jid); } close(); } diff --git a/main/src/ui/add_conversation/chat/dialog.vala b/main/src/ui/add_conversation/chat/dialog.vala index cad2b367..15624731 100644 --- a/main/src/ui/add_conversation/chat/dialog.vala +++ b/main/src/ui/add_conversation/chat/dialog.vala @@ -60,7 +60,7 @@ public class Dialog : Gtk.Dialog { }); select_jid_fragment.remove_jid.connect((row) => { ListRow list_row = roster_list.get_selected_row() as ListRow; - RosterManager.get_instance(stream_interactor).remove_jid(list_row.account, list_row.jid); + stream_interactor.get_module(RosterManager.IDENTITY).remove_jid(list_row.account, list_row.jid); }); select_jid_fragment.notify["done"].connect(() => { ok_button.sensitive = select_jid_fragment.done; @@ -72,8 +72,8 @@ public class Dialog : Gtk.Dialog { ListRow? selected_row = roster_list.get_selected_row() as ListRow; if (selected_row != null) { // TODO move in list to front immediately - ConversationManager.get_instance(stream_interactor).ensure_start_conversation(selected_row.jid, selected_row.account); - Conversation conversation = ConversationManager.get_instance(stream_interactor).get_conversation(selected_row.jid, selected_row.account); + stream_interactor.get_module(ConversationManager.IDENTITY).ensure_start_conversation(selected_row.jid, selected_row.account); + Conversation conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation(selected_row.jid, selected_row.account); conversation_opened(conversation); } close(); diff --git a/main/src/ui/add_conversation/chat/roster_list.vala b/main/src/ui/add_conversation/chat/roster_list.vala index 92388597..c395dc3a 100644 --- a/main/src/ui/add_conversation/chat/roster_list.vala +++ b/main/src/ui/add_conversation/chat/roster_list.vala @@ -20,13 +20,13 @@ protected class RosterList : FilterableList { set_header_func(header); set_sort_func(sort); - RosterManager.get_instance(stream_interactor).removed_roster_item.connect( (account, jid, roster_item) => { + stream_interactor.get_module(RosterManager.IDENTITY).removed_roster_item.connect( (account, jid, roster_item) => { Idle.add(() => { on_removed_roster_item(account, jid, roster_item); return false;});}); - RosterManager.get_instance(stream_interactor).updated_roster_item.connect( (account, jid, roster_item) => { + stream_interactor.get_module(RosterManager.IDENTITY).updated_roster_item.connect( (account, jid, roster_item) => { Idle.add(() => { on_updated_roster_item(account, jid, roster_item); return false;});}); foreach (Account account in stream_interactor.get_accounts()) { - foreach (Roster.Item roster_item in RosterManager.get_instance(stream_interactor).get_roster(account)) { + foreach (Roster.Item roster_item in stream_interactor.get_module(RosterManager.IDENTITY).get_roster(account)) { on_updated_roster_item(account, new Jid(roster_item.jid), roster_item); } } diff --git a/main/src/ui/add_conversation/conference/add_groupchat_dialog.vala b/main/src/ui/add_conversation/conference/add_groupchat_dialog.vala index 8cc5ac72..c097ef06 100644 --- a/main/src/ui/add_conversation/conference/add_groupchat_dialog.vala +++ b/main/src/ui/add_conversation/conference/add_groupchat_dialog.vala @@ -80,9 +80,9 @@ protected class AddGroupchatDialog : Gtk.Dialog { conference.name = alias_entry.text; conference.autojoin = autojoin_checkbutton.active; if (edit_confrence == null) { - MucManager.get_instance(stream_interactor).add_bookmark(account, conference); + stream_interactor.get_module(MucManager.IDENTITY).add_bookmark(account, conference); } else { - MucManager.get_instance(stream_interactor).replace_bookmark(account, edit_confrence, conference); + stream_interactor.get_module(MucManager.IDENTITY).replace_bookmark(account, edit_confrence, conference); } close(); } diff --git a/main/src/ui/add_conversation/conference/conference_list.vala b/main/src/ui/add_conversation/conference/conference_list.vala index 7743ced5..c44f989a 100644 --- a/main/src/ui/add_conversation/conference/conference_list.vala +++ b/main/src/ui/add_conversation/conference/conference_list.vala @@ -20,7 +20,7 @@ protected class ConferenceList : FilterableList { set_header_func(header); set_sort_func(sort); - MucManager.get_instance(stream_interactor).bookmarks_updated.connect((account, conferences) => { + stream_interactor.get_module(MucManager.IDENTITY).bookmarks_updated.connect((account, conferences) => { Idle.add(() => { lists[account] = conferences; refresh_conferences(); @@ -29,7 +29,7 @@ protected class ConferenceList : FilterableList { }); foreach (Account account in stream_interactor.get_accounts()) { - MucManager.get_instance(stream_interactor).get_bookmarks(account, on_conference_bookmarks_received, Tuple.create(this, account)); + stream_interactor.get_module(MucManager.IDENTITY).get_bookmarks(account, on_conference_bookmarks_received, Tuple.create(this, account)); } } diff --git a/main/src/ui/add_conversation/conference/dialog.vala b/main/src/ui/add_conversation/conference/dialog.vala index ff548699..bfb25888 100644 --- a/main/src/ui/add_conversation/conference/dialog.vala +++ b/main/src/ui/add_conversation/conference/dialog.vala @@ -102,7 +102,7 @@ public class Dialog : Gtk.Dialog { }); select_fragment.remove_jid.connect((row) => { ConferenceListRow conference_row = row as ConferenceListRow; - MucManager.get_instance(stream_interactor).remove_bookmark(conference_row.account, conference_row.bookmark); + stream_interactor.get_module(MucManager.IDENTITY).remove_bookmark(conference_row.account, conference_row.bookmark); }); stack.add_named(select_fragment, "select"); } @@ -137,7 +137,7 @@ public class Dialog : Gtk.Dialog { } private void on_ok_button_clicked() { - MucManager.get_instance(stream_interactor).join(details_fragment.account, new Jid(details_fragment.jid), details_fragment.nick, details_fragment.password); + stream_interactor.get_module(MucManager.IDENTITY).join(details_fragment.account, new Jid(details_fragment.jid), details_fragment.nick, details_fragment.password); close(); } -- cgit v1.2.3-70-g09d2