Merge branch 'krille/redacted-stories' into 'main'

fix: Hide redacted stories

See merge request famedly/fluffychat!774
This commit is contained in:
Krille Fear 2022-03-13 10:19:03 +00:00
commit b75c994950

View File

@ -294,6 +294,7 @@ class StoryPageController extends State<StoryPage> {
future: event.redactEvent, future: event.redactEvent,
); );
setState(() { setState(() {
events.remove(event);
_modalOpened = false; _modalOpened = false;
}); });
} }
@ -395,8 +396,9 @@ class StoryPageController extends State<StoryPage> {
} }
final timeline = this.timeline = await room.getTimeline(); final timeline = this.timeline = await room.getTimeline();
timeline.requestKeys(); timeline.requestKeys();
var events = var events = timeline.events
timeline.events.where((e) => e.type == EventTypes.Message).toList(); .where((e) => e.type == EventTypes.Message && !e.redacted)
.toList();
final hasOutdatedEvents = events.removeOutdatedEvents(); final hasOutdatedEvents = events.removeOutdatedEvents();