[fractal] fractal-gtk: room_history: Don't group messages if redacted
- From: Daniel Garcia Moreno <danigm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal] fractal-gtk: room_history: Don't group messages if redacted
- Date: Sun, 22 Dec 2019 08:58:47 +0000 (UTC)
commit ef4a8abd9b23ae03a00deb04a2c5001949bcf5e8
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 36bc4382..ea8407ad 100644
--- a/fractal-gtk/src/widgets/room_history.rs
+++ b/fractal-gtk/src/widgets/room_history.rs
@@ -317,7 +317,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]