diff --git a/lib/src/room.dart b/lib/src/room.dart index 6dd8afb2..9aefeb70 100644 --- a/lib/src/room.dart +++ b/lib/src/room.dart @@ -1037,10 +1037,12 @@ class Room { /// be received maximum. When the request is answered, [onHistoryReceived] will be triggered **before** /// the historical events will be published in the onEvent stream. /// Returns the actual count of received timeline events. - Future requestHistory( - {int historyCount = defaultHistoryCount, - void Function()? onHistoryReceived, - direction = Direction.b}) async { + Future requestHistory({ + int historyCount = defaultHistoryCount, + void Function()? onHistoryReceived, + direction = Direction.b, + StateFilter? filter, + }) async { final prev_batch = this.prev_batch; final storeInDatabase = !isArchived; @@ -1053,7 +1055,7 @@ class Room { direction, from: prev_batch, limit: historyCount, - filter: jsonEncode(StateFilter(lazyLoadMembers: true).toJson()), + filter: jsonEncode((filter ?? StateFilter(lazyLoadMembers: true)).toJson()), ); if (onHistoryReceived != null) onHistoryReceived(); diff --git a/lib/src/timeline.dart b/lib/src/timeline.dart index ce9938bc..66481fef 100644 --- a/lib/src/timeline.dart +++ b/lib/src/timeline.dart @@ -166,6 +166,7 @@ class Timeline { await room.requestHistory( historyCount: historyCount, direction: direction, + filter: filter, onHistoryReceived: () { _collectHistoryUpdates = true; },