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:
@@ -103,10 +103,34 @@ class ChatRepository {
|
|||||||
await room.requestHistory();
|
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 {
|
Future<List<MessageModel>> _mapTimeline(Timeline timeline, Room room) async {
|
||||||
final myUserId = _client.userID ?? '';
|
final myUserId = _client.userID ?? '';
|
||||||
final models = <MessageModel>[];
|
final models = <MessageModel>[];
|
||||||
for (final e in timeline.events) {
|
for (final e in timeline.events) {
|
||||||
|
if (_hiddenEventTypes.contains(e.type)) continue;
|
||||||
models.add(_toModel(e, timeline, myUserId));
|
models.add(_toModel(e, timeline, myUserId));
|
||||||
}
|
}
|
||||||
// Matrix SDK timeline.events is newest-first. Keep that order because
|
// Matrix SDK timeline.events is newest-first. Keep that order because
|
||||||
|
|||||||
Reference in New Issue
Block a user