Fetch the initial ignored user list manually (#4598)

The SDK won't return it automatically, so we need to fetch it manually.
This commit is contained in:
Jorge Martin Espinosa 2025-04-16 12:55:18 +02:00 committed by GitHub
parent f74486f525
commit a11ca17242
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -221,6 +221,9 @@ class RustMatrixClient(
override val userProfile: StateFlow<MatrixUser> = _userProfile
override val ignoredUsersFlow = mxCallbackFlow<ImmutableList<UserId>> {
// Fetch the initial value manually, the SDK won't return it automatically
channel.trySend(innerClient.ignoredUsers().map(::UserId).toPersistentList())
innerClient.subscribeToIgnoredUsers(object : IgnoredUsersListener {
override fun call(ignoredUserIds: List<String>) {
channel.trySend(ignoredUserIds.map(::UserId).toPersistentList())