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) <noreply@anthropic.com>
This commit is contained in:
2026-04-03 16:12:19 +10:00
parent 327cd36b6d
commit c56c2d59fd

View File

@@ -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<List<MessageModel>> _mapTimeline(Timeline timeline, Room room) async {
final myUserId = _client.userID ?? '';
final models = <MessageModel>[];
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