mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-23 01:20:35 +03:00
Fix member state setting filter
What we want with that setting: - When enabled, include all member state events - When disable, exclude all member state events What it did: - When enabled, exclude all member state events except from the logged-in user - When disabled, include all member state events Change-Id: I86eec2188163dc3265444e121d230ce0cb9c7f7a
This commit is contained in:
parent
7c5d49909c
commit
8c2dbc342b
1 changed files with 6 additions and 2 deletions
|
@ -54,11 +54,15 @@ class TimelineSettingsFactory @Inject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun List<String>.createAllowedEventTypeFilters(): List<EventTypeFilter> {
|
private fun List<String>.createAllowedEventTypeFilters(): List<EventTypeFilter> {
|
||||||
return map {
|
var result = map {
|
||||||
EventTypeFilter(
|
EventTypeFilter(
|
||||||
eventType = it,
|
eventType = it,
|
||||||
stateKey = if (it == EventType.STATE_ROOM_MEMBER && userPreferencesProvider.shouldShowRoomMemberStateEvents()) session.myUserId else null
|
stateKey = null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (!userPreferencesProvider.shouldShowRoomMemberStateEvents()) {
|
||||||
|
result = result.filter { it.eventType != EventType.STATE_ROOM_MEMBER }
|
||||||
|
}
|
||||||
|
return result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue