Bug 455048

Summary: Show non-message matrix events in the room list as message preview
Product: [Applications] NeoChat Reporter: Jan Bidler <janbidler00>
Component: GeneralAssignee: Tobias Fella <fella>
Status: RESOLVED FIXED    
Severity: normal CC: carl, james.h.graham
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: All   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Jan Bidler 2022-06-08 18:24:26 UTC
SUMMARY
NeoChat shows a preview of the latest message in the room list preview. It does not show a preview however for join/leave/nick/avatar events, which then gets a little confusing since the roomlist is sorted by that activity as well, making it not quite obvious, why room X is suddenly at the top.


STEPS TO REPRODUCE
1. Have the matrix events visibilty toggled ON in the NeoChat settings.
2. Join a room
3. Have another user of that room send a non-message matrix event (like joining that room as well, leaving it, changing nick etc.)


OBSERVED RESULT
The joined room will have its position updated in the room list to be at the top, but the message preview will now show the channel topic.

EXPECTED RESULT
A sentence describing the event should be shown as the message preview (i.e. if a user left the room "<User> has left the room")

SOFTWARE/OS VERSIONS
Windows: 10 21H1
Linux: Arch Linux
NeoChat Version: 22.04
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.2 / 5.15.4
Comment 1 Bug Janitor Service 2023-02-04 18:22:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/neochat/-/merge_requests/785
Comment 2 James Graham 2023-03-13 19:04:54 UTC
Fixed by https://invent.kde.org/network/neochat/-/merge_requests/785
Comment 3 Tobias Fella 2023-03-13 20:03:44 UTC
Git commit 76b5463dac83507b38ef015c36c08d63c638bd1b by Tobias Fella, on behalf of James Graham.
Committed on 13/03/2023 at 20:03.
Pushed by tfella into branch 'release/23.04'.

Cherrypick Fix state event visiblity in timeline 23.04

Rework the filtering of state events in the timeline and for lastevent. This is now consistent everywhere and includes the following:
- The timeline settings are obeyed everywhere
- A new setting is added to filter all state events
- Last event obeys the timeline setting in all cases
- The roomlist will show a state event as the latest event if it's visible in the timeline
- Names are no longer hyperlinked in eventToString if plaintext is selected.
Closes network/neochat#148


(cherry picked from commit 741cb571056959c5ca56995b7238e9cf7dc2abb0)

M  +11   -20   src/models/messageeventmodel.cpp
M  +0    -2    src/models/messageeventmodel.h
M  +8    -22   src/models/messagefiltermodel.cpp
M  +0    -21   src/models/roomlistmodel.cpp
M  +0    -1    src/models/roomlistmodel.h
M  +8    -4    src/neochatconfig.kcfg
M  +31   -7    src/neochatroom.cpp
M  +1    -1    src/neochatroom.h
M  +42   -15   src/qml/Settings/GeneralSettingsPage.qml

https://invent.kde.org/network/neochat/commit/76b5463dac83507b38ef015c36c08d63c638bd1b
Comment 4 James Graham 2023-03-24 18:16:52 UTC
Git commit 741cb571056959c5ca56995b7238e9cf7dc2abb0 by James Graham.
Committed on 13/03/2023 at 19:00.
Pushed by nvrwhere into branch 'master'.

Fix state event visiblity in timeline

Rework the filtering of state events in the timeline and for lastevent. This is now consistent everywhere and includes the following:
- The timeline settings are obeyed everywhere
- A new setting is added to filter all state events
- Last event obeys the timeline setting in all cases
- The roomlist will show a state event as the latest event if it's visible in the timeline
- Names are no longer hyperlinked in eventToString if plaintext is selected.
Closes network/neochat#148

M  +11   -20   src/models/messageeventmodel.cpp
M  +0    -2    src/models/messageeventmodel.h
M  +8    -22   src/models/messagefiltermodel.cpp
M  +0    -21   src/models/roomlistmodel.cpp
M  +0    -1    src/models/roomlistmodel.h
M  +8    -4    src/neochatconfig.kcfg
M  +31   -7    src/neochatroom.cpp
M  +1    -1    src/neochatroom.h
M  +42   -15   src/qml/Settings/GeneralSettingsPage.qml

https://invent.kde.org/network/neochat/commit/741cb571056959c5ca56995b7238e9cf7dc2abb0