diff options
author | Marvin W <git@larma.de> | 2019-10-18 16:52:29 +0200 |
---|---|---|
committer | Marvin W <git@larma.de> | 2019-10-18 16:52:29 +0200 |
commit | e330e60f83e6e46bbc3d320711709f2448b802e7 (patch) | |
tree | 9caf36bae3326e711fe113336985e80e7218b3d5 /main/src/ui/conversation_summary | |
parent | de3af0ae24b70ccb7670fa236076c061316f03cb (diff) | |
download | dino-e330e60f83e6e46bbc3d320711709f2448b802e7.tar.gz dino-e330e60f83e6e46bbc3d320711709f2448b802e7.zip |
Base avatars and names on conversation, not JID.
Fixes #598
Diffstat (limited to 'main/src/ui/conversation_summary')
3 files changed, 5 insertions, 5 deletions
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<string> display_names = new ArrayList<string>(); 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 = @"<span foreground=\"#$color\">$display_name</span>"; } |