[fractal/af/redact.next: 2/3] fractal-gtk: room_history: Don't group messages if redacted



commit 9813199b65f8ad1524b8b4c26b18c77f3dba7a14
Author: Alistair Francis <alistair alistair23 me>
Date:   Mon Aug 26 19:26:48 2019 -0700

    fractal-gtk: room_history: Don't group messages if redacted
    
    If the previous message has been redacted don't group the messages.
    
    This fixes an issue where a user can post a single message, resuling in
    their name and message appearing. Then a user can redact that message,
    removing their name and message. Finally they can post a new message
    where only the message but not the name appears.
    
    This commit has the downside that if a user redacts a message in the
    middle of multiple messages their name will appear redundantly. These
    will be fixed by "refresing" the room, by either swapping rooms or
    restarting Fractal.
    
    Signed-off-by: Alistair Francis <alistair alistair23 me>

 fractal-gtk/src/widgets/room_history.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/fractal-gtk/src/widgets/room_history.rs b/fractal-gtk/src/widgets/room_history.rs
index af895f99..4fcee008 100644
--- a/fractal-gtk/src/widgets/room_history.rs
+++ b/fractal-gtk/src/widgets/room_history.rs
@@ -337,7 +337,7 @@ fn create_row(
 
 /* returns if two messages should have only a single header or not */
 fn should_group_message(msg: &MessageContent, prev: &MessageContent) -> bool {
-    if msg.sender == prev.sender {
+    if msg.sender == prev.sender && !prev.msg.redacted {
         let diff = msg.date.signed_duration_since(prev.date);
         let minutes = diff.num_minutes();
         minutes < globals::MINUTES_TO_SPLIT_MSGS


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]