From e330e60f83e6e46bbc3d320711709f2448b802e7 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Fri, 18 Oct 2019 16:52:29 +0200 Subject: Base avatars and names on conversation, not JID. Fixes #598 --- main/src/ui/conversation_summary/chat_state_populator.vala | 4 ++-- main/src/ui/conversation_summary/content_item_widget_factory.vala | 2 +- main/src/ui/conversation_summary/conversation_item_skeleton.vala | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'main/src/ui/conversation_summary') diff --git a/main/src/ui/conversation_summary/chat_state_populator.vala b/main/src/ui/conversation_summary/chat_state_populator.vala index d07ab743..04eb4a20 100644 --- a/main/src/ui/conversation_summary/chat_state_populator.vala +++ b/main/src/ui/conversation_summary/chat_state_populator.vala @@ -135,11 +135,11 @@ private class MetaChatStateItem : Plugins.MetaConversationItem { private void update() { if (image == null || label == null) return; - image.set_jids(stream_interactor, jids.to_array(), conversation.account, true); + image.set_conversation_participants(stream_interactor, conversation, jids.to_array()); Gee.List display_names = new ArrayList(); foreach (Jid jid in jids) { - display_names.add(Util.get_display_name(stream_interactor, jid, conversation.account)); + display_names.add(Util.get_participant_display_name(stream_interactor, conversation, jid)); } string new_text = ""; if (jids.size > 3) { diff --git a/main/src/ui/conversation_summary/content_item_widget_factory.vala b/main/src/ui/conversation_summary/content_item_widget_factory.vala index 533b2af1..00972371 100644 --- a/main/src/ui/conversation_summary/content_item_widget_factory.vala +++ b/main/src/ui/conversation_summary/content_item_widget_factory.vala @@ -70,7 +70,7 @@ public class MessageItemWidgetGenerator : WidgetGenerator, Object { } if (message_item.message.body.has_prefix("/me")) { - string display_name = Util.get_message_display_name(stream_interactor, message, conversation.account); + string display_name = Util.get_participant_display_name(stream_interactor, conversation, message.from); update_me_style(stream_interactor, message.real_jid ?? message.from, display_name, conversation.account, label, markup_text); label.realize.connect(() => update_me_style(stream_interactor, message.real_jid ?? message.from, display_name, conversation.account, label, markup_text)); label.style_updated.connect(() => update_me_style(stream_interactor, message.real_jid ?? message.from, display_name, conversation.account, label, markup_text)); diff --git a/main/src/ui/conversation_summary/conversation_item_skeleton.vala b/main/src/ui/conversation_summary/conversation_item_skeleton.vala index 1e47fa7c..182ec298 100644 --- a/main/src/ui/conversation_summary/conversation_item_skeleton.vala +++ b/main/src/ui/conversation_summary/conversation_item_skeleton.vala @@ -29,7 +29,7 @@ public class ConversationItemSkeleton : EventBox { this.get_style_context().add_class("message-box"); if (item.requires_avatar) { - image.set_jid(stream_interactor, item.jid, conversation.account); + image.set_conversation_participant(stream_interactor, conversation, item.jid); image_content_box.add(image); } if (item.display_time != null) { @@ -137,7 +137,7 @@ public class ItemMetaDataHeader : Box { } private void update_name_label() { - string display_name = Markup.escape_text(Util.get_display_name(stream_interactor, item.jid, conversation.account)); + string display_name = Markup.escape_text(Util.get_participant_display_name(stream_interactor, conversation, item.jid)); string color = Util.get_name_hex_color(stream_interactor, conversation.account, item.jid, Util.is_dark_theme(name_label)); name_label.label = @"$display_name"; } -- cgit v1.2.3-70-g09d2