forge
Explore
Log in

Don't you dare go Hollow

Builders see a reply to a deleted message as plain 'Deleted message' like everyone

Browse files at this commit

f66143fbcdf408a5d384230cffa03b5ff74e69a6Ahmet Kaan GümüşParent: a5cfbc8
  • style
    • builders see a reply to a deleted message as plain 'Deleted message' like everyone
    • clicking it reveals the original quote (then clicking jumps)
Show full message
💄 style: builders see a reply to a deleted message as plain 'Deleted message' like everyone; clicking it reveals the original quote (then clicking jumps)
crates/client/src/gui/chat.rsmodified+2 -0
@@ -142,6 +142,7 @@ pub struct Chat {
142142 pub(super) muted: HashSet<Id>,
143143 pub(super) pinned: HashSet<Id>,
144144 pub(super) edits: HashMap<Id, Vec<Edit>>,
145+ pub(super) revealed: HashSet<Id>,
145146 pub(super) message_input: Entity<TextareaState>,
146147 pub(super) search_input: Entity<InputState>,
147148 pub(super) friends_open: bool,
@@ -434,6 +435,7 @@ impl Chat {
434435 muted: HashSet::new(),
435436 pinned: HashSet::new(),
436437 edits: HashMap::new(),
438+ revealed: HashSet::new(),
437439 message_input,
438440 search_input,
439441 friends_open: false,
crates/client/src/gui/message_actions.rsmodified+17 -1
@@ -168,9 +168,25 @@ pub fn quote_line(
168168 .border_color(palette.border)
169169 .text_size(text(text::CAPTION))
170170 .text_color(palette.muted);
171+ let holder = message.id;
171172 let (quote, deleted) = match message.reply.as_ref()? {
172173 Reply::Quote(quote) => (quote, false),
173- Reply::Deleted(Some(quote)) => (quote, true),
174+ Reply::Deleted(Some(quote)) if chat.revealed.contains(&holder) => (quote, true),
175+ Reply::Deleted(Some(_)) => {
176+ let entity = entity.clone();
177+ return Some(
178+ frame
179+ .italic()
180+ .cursor_pointer()
181+ .on_click(move |_, _, cx| {
182+ entity.update(cx, |yumush, cx| {
183+ yumush.chat.revealed.insert(holder);
184+ cx.notify();
185+ })
186+ })
187+ .child(w().message_actions.deleted),
188+ );
189+ }
174190 Reply::Deleted(None) => {
175191 return Some(frame.italic().child(w().message_actions.deleted));
176192 }