diff --git a/src/components/avatar.rs b/src/components/avatar.rs index 53aed03de..3c716424a 100644 --- a/src/components/avatar.rs +++ b/src/components/avatar.rs @@ -196,7 +196,10 @@ impl Avatar { self.load_image(user.avatar(), user.session()); } } else if let Some(chat) = item.downcast_ref::() { - if chat.is_own_chat() { + if chat.is_replies_chat() { + imp.avatar.set_icon_name(Some("mail-reply-sender-symbolic")); + imp.avatar.set_show_initials(false); + } else if chat.is_own_chat() { imp.avatar.set_icon_name(Some("user-bookmarks-symbolic")); imp.avatar.set_show_initials(false); } else { @@ -214,7 +217,7 @@ impl Avatar { imp.avatar .set_text(Some(&strings::user_display_name(user, true))); } else if let Some(chat) = item.downcast_ref::() { - if chat.is_own_chat() { + if chat.is_own_chat() || chat.is_replies_chat() { imp.avatar.set_text(Some("-")); } else { imp.avatar.set_text(Some(chat.title().as_ref())); diff --git a/src/expressions.rs b/src/expressions.rs index 00e5efc7a..85691afe6 100644 --- a/src/expressions.rs +++ b/src/expressions.rs @@ -27,6 +27,8 @@ pub(crate) fn chat_display_name(chat_expression: >k::Expression) -> gtk::Expre let is_deleted = args[3].get::().unwrap(); if chat.is_own_chat() { gettext("Saved Messages") + } else if chat.is_replies_chat() { + gettext("Replies") } else if is_deleted { gettext("Deleted Account") } else { diff --git a/src/session/content/chat_action_bar.rs b/src/session/content/chat_action_bar.rs index b6894ec17..b80a1f073 100644 --- a/src/session/content/chat_action_bar.rs +++ b/src/session/content/chat_action_bar.rs @@ -775,6 +775,14 @@ impl ChatActionBar { imp.action_bar_stack.set_visible_child_name("entry"); } else if is_blocked { imp.action_bar_stack.set_visible_child_name("unblock"); + } else if chat.is_replies_chat() { + imp.action_bar_stack.set_visible_child_name("mute"); + + if self.is_chat_muted() { + imp.mute_button.set_label(&gettext("Unmute")); + } else { + imp.mute_button.set_label(&gettext("Mute")); + } } else { imp.action_bar_stack.set_visible_child_name("entry"); } diff --git a/src/session/content/message_row/bubble.rs b/src/session/content/message_row/bubble.rs index 056a30503..b8c5a7983 100644 --- a/src/session/content/message_row/bubble.rs +++ b/src/session/content/message_row/bubble.rs @@ -185,7 +185,7 @@ impl MessageBubble { let show_sender = if force_hide_sender { None - } else if message.chat().is_own_chat() { + } else if message.chat().is_own_chat() || message.chat().is_replies_chat() { if message.is_outgoing() { None } else { diff --git a/src/session/content/message_row/mod.rs b/src/session/content/message_row/mod.rs index ac593098d..2f333ab70 100644 --- a/src/session/content/message_row/mod.rs +++ b/src/session/content/message_row/mod.rs @@ -220,7 +220,7 @@ impl MessageRow { if let Some(message) = message.downcast_ref::() { let show_avatar = if message.is_outgoing() { false - } else if message.chat().is_own_chat() { + } else if message.chat().is_own_chat() || message.chat().is_replies_chat() { message.forward_info().is_some() } else { match message.chat().type_() { @@ -248,7 +248,7 @@ impl MessageRow { } }; - if message.chat().is_own_chat() { + if message.chat().is_own_chat() || message.chat().is_replies_chat() { match message.forward_info().unwrap().origin() { MessageForwardOrigin::User(user) => { avatar.set_custom_text(None); diff --git a/src/session/sidebar/row.rs b/src/session/sidebar/row.rs index 76749ab6c..c40dd78d4 100644 --- a/src/session/sidebar/row.rs +++ b/src/session/sidebar/row.rs @@ -584,7 +584,7 @@ fn sender_label(message: Message) -> Option { _ => return None, } - if message.chat().is_own_chat() { + if message.chat().is_own_chat() || message.chat().is_replies_chat() { if message.is_outgoing() { None } else { diff --git a/src/tdlib/chat.rs b/src/tdlib/chat.rs index bdd92bcb4..4329dc169 100644 --- a/src/tdlib/chat.rs +++ b/src/tdlib/chat.rs @@ -484,6 +484,10 @@ impl Chat { self.type_().user() == Some(&self.session().me()) } + pub(crate) fn is_replies_chat(&self) -> bool { + self.id() == 1271266957 || self.id() == 708513 + } + pub(crate) fn permissions(&self) -> BoxedChatPermissions { self.imp().permissions.borrow().to_owned().unwrap() } diff --git a/src/tdlib/message.rs b/src/tdlib/message.rs index 0a5fd1e64..29ed43922 100644 --- a/src/tdlib/message.rs +++ b/src/tdlib/message.rs @@ -322,7 +322,7 @@ impl Message { } pub(crate) fn sender_display_name_expression(&self) -> gtk::Expression { - if self.chat().is_own_chat() { + if self.chat().is_own_chat() || self.chat().is_replies_chat() { self.forward_info() .map(MessageForwardInfo::origin) .map(|forward_origin| match forward_origin {