diff options
author | fiaxh <git@mx.ax.lt> | 2017-03-19 12:55:36 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-03-20 22:28:27 +0100 |
commit | db57a973534f099af2b150f1a1307d1948553d9f (patch) | |
tree | 238ae1d4e53412a33e3febd07318dfd38b0eb2f8 /main/src/ui/conversation_selector | |
parent | 233f2b35d033cd20d1ac648bf2d723bcb7a918fc (diff) | |
download | dino-db57a973534f099af2b150f1a1307d1948553d9f.tar.gz dino-db57a973534f099af2b150f1a1307d1948553d9f.zip |
Add typed identity to manager modules and stream flags
Diffstat (limited to 'main/src/ui/conversation_selector')
4 files changed, 17 insertions, 17 deletions
diff --git a/main/src/ui/conversation_selector/chat_row.vala b/main/src/ui/conversation_selector/chat_row.vala index 96f6921d..5e3270aa 100644 --- a/main/src/ui/conversation_selector/chat_row.vala +++ b/main/src/ui/conversation_selector/chat_row.vala @@ -40,7 +40,7 @@ public class ChatRow : ConversationRow { } public void update_avatar() { - ArrayList<Jid> full_jids = PresenceManager.get_instance(stream_interactor).get_full_jids(conversation.counterpart, conversation.account); + ArrayList<Jid> full_jids = stream_interactor.get_module(PresenceManager.IDENTITY).get_full_jids(conversation.counterpart, conversation.account); set_avatar((new AvatarGenerator(AVATAR_SIZE, AVATAR_SIZE, image.scale_factor)) .set_greyscale(full_jids == null) .draw_conversation(stream_interactor, conversation), image.scale_factor); @@ -54,12 +54,12 @@ public class ChatRow : ConversationRow { jid_label.label = conversation.counterpart.to_string(); - ArrayList<Jid>? full_jids = PresenceManager.get_instance(stream_interactor).get_full_jids(conversation.counterpart, conversation.account); + ArrayList<Jid>? full_jids = stream_interactor.get_module(PresenceManager.IDENTITY).get_full_jids(conversation.counterpart, conversation.account); if (full_jids != null) { for (int i = 0; i < full_jids.size; i++) { Box box = new Box(Orientation.HORIZONTAL, 5); - Show show = PresenceManager.get_instance(stream_interactor).get_last_show(full_jids[i], conversation.account); + Show show = stream_interactor.get_module(PresenceManager.IDENTITY).get_last_show(full_jids[i], conversation.account); Image image = new Image(); if (show.as == Show.AWAY) { image.set_from_icon_name("dino-status-away", IconSize.SMALL_TOOLBAR); diff --git a/main/src/ui/conversation_selector/conversation_row.vala b/main/src/ui/conversation_selector/conversation_row.vala index ef3984c1..c16da287 100644 --- a/main/src/ui/conversation_selector/conversation_row.vala +++ b/main/src/ui/conversation_selector/conversation_row.vala @@ -46,7 +46,7 @@ public abstract class ConversationRow : ListBoxRow { x_button.clicked.connect(on_x_button_clicked); update_name(Util.get_conversation_display_name(stream_interactor, conversation)); - Entities.Message message = MessageManager.get_instance(stream_interactor).get_last_message(conversation); + Entities.Message message = stream_interactor.get_module(MessageManager.IDENTITY).get_last_message(conversation); if (message != null) { message_received(message); } diff --git a/main/src/ui/conversation_selector/groupchat_row.vala b/main/src/ui/conversation_selector/groupchat_row.vala index 7fe52d89..598902cc 100644 --- a/main/src/ui/conversation_selector/groupchat_row.vala +++ b/main/src/ui/conversation_selector/groupchat_row.vala @@ -23,12 +23,12 @@ public class GroupchatRow : ConversationRow { public override void network_connection(bool connected) { set_avatar((new AvatarGenerator(AVATAR_SIZE, AVATAR_SIZE, image.scale_factor)) .set_greyscale(!connected || - MucManager.get_instance(stream_interactor).get_nick(conversation.counterpart, conversation.account) == null) // TODO better currently joined + stream_interactor.get_module(MucManager.IDENTITY).get_nick(conversation.counterpart, conversation.account) == null) // TODO better currently joined .draw_conversation(stream_interactor, conversation), image.scale_factor); } private void on_x_button_clicked() { - MucManager.get_instance(stream_interactor).part(conversation.account, conversation.counterpart); + stream_interactor.get_module(MucManager.IDENTITY).part(conversation.account, conversation.counterpart); } } diff --git a/main/src/ui/conversation_selector/list.vala b/main/src/ui/conversation_selector/list.vala index 071ac504..d95128f1 100644 --- a/main/src/ui/conversation_selector/list.vala +++ b/main/src/ui/conversation_selector/list.vala @@ -22,31 +22,31 @@ public class List : ListBox { set_header_func(header); set_sort_func(sort); - ChatInteraction.get_instance(stream_interactor).conversation_read.connect((conversation) => { + stream_interactor.get_module(ChatInteraction.IDENTITY).conversation_read.connect((conversation) => { Idle.add(() => {if (rows.has_key(conversation)) rows[conversation].mark_read(); return false;}); }); - ChatInteraction.get_instance(stream_interactor).conversation_unread.connect((conversation) => { + stream_interactor.get_module(ChatInteraction.IDENTITY).conversation_unread.connect((conversation) => { Idle.add(() => {if (rows.has_key(conversation)) rows[conversation].mark_unread(); return false;}); }); - ConversationManager.get_instance(stream_interactor).conversation_activated.connect((conversation) => { + stream_interactor.get_module(ConversationManager.IDENTITY).conversation_activated.connect((conversation) => { Idle.add(() => {add_conversation(conversation); return false;}); }); - MessageManager.get_instance(stream_interactor).message_received.connect((message, conversation) => { + stream_interactor.get_module(MessageManager.IDENTITY).message_received.connect((message, conversation) => { Idle.add(() => {on_message_received(message, conversation); return false;}); }); - MessageManager.get_instance(stream_interactor).message_sent.connect((message, conversation) => { + stream_interactor.get_module(MessageManager.IDENTITY).message_sent.connect((message, conversation) => { Idle.add(() => {on_message_received(message, conversation); return false;}); }); - PresenceManager.get_instance(stream_interactor).show_received.connect((show, jid, account) => { + stream_interactor.get_module(PresenceManager.IDENTITY).show_received.connect((show, jid, account) => { Idle.add(() => { - Conversation? conversation = ConversationManager.get_instance(stream_interactor).get_conversation(jid, account); + Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation(jid, account); if (conversation != null && rows.has_key(conversation)) rows[conversation].on_show_received(show); 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(() => { - Conversation? conversation = ConversationManager.get_instance(stream_interactor).get_conversation(jid, account); + Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation(jid, account); if (conversation != null && rows.has_key(conversation)) { ChatRow row = rows[conversation] as ChatRow; if (row != null) row.on_updated_roster_item(roster_item); @@ -54,9 +54,9 @@ public class List : ListBox { return false; }); }); - AvatarManager.get_instance(stream_interactor).received_avatar.connect((avatar, jid, account) => { + stream_interactor.get_module(AvatarManager.IDENTITY).received_avatar.connect((avatar, jid, account) => { Idle.add(() => { - Conversation? conversation = ConversationManager.get_instance(stream_interactor).get_conversation(jid, account); + Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation(jid, account); if (conversation != null && rows.has_key(conversation)) { ChatRow row = rows[conversation] as ChatRow; if (row != null) row.update_avatar(); |