From c56c2d59fd3d9ff3a36ed7a400158a392563783d Mon Sep 17 00:00:00 2001 From: help4bis Date: Fri, 3 Apr 2026 16:12:19 +1000 Subject: [PATCH] fix: hide call signaling and state events from chat timeline Filter out org.matrix.msc3401.call.member, org.matrix.msc4075.rtc.notification, m.call.*, m.room.member, and other state events from the chat timeline. Users only see actual messages, not protocol noise. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/features/chat/data/chat_repository.dart | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib/features/chat/data/chat_repository.dart b/lib/features/chat/data/chat_repository.dart index da25b9d..135a2d6 100644 --- a/lib/features/chat/data/chat_repository.dart +++ b/lib/features/chat/data/chat_repository.dart @@ -103,10 +103,34 @@ class ChatRepository { await room.requestHistory(); } + /// Event types that should never appear in the chat timeline. + static const _hiddenEventTypes = { + 'org.matrix.msc3401.call.member', + 'org.matrix.msc4075.rtc.notification', + 'com.famedly.call.member', + 'm.call.invite', + 'm.call.answer', + 'm.call.hangup', + 'm.call.candidates', + 'm.call.reject', + 'm.room.member', + 'm.room.power_levels', + 'm.room.join_rules', + 'm.room.history_visibility', + 'm.room.guest_access', + 'm.room.create', + 'm.room.topic', + 'm.room.name', + 'm.room.avatar', + 'm.room.canonical_alias', + 'm.room.encryption', + }; + Future> _mapTimeline(Timeline timeline, Room room) async { final myUserId = _client.userID ?? ''; final models = []; for (final e in timeline.events) { + if (_hiddenEventTypes.contains(e.type)) continue; models.add(_toModel(e, timeline, myUserId)); } // Matrix SDK timeline.events is newest-first. Keep that order because