mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Fixes #4222 - Hide timeline item actions that the user's power level does not allow
This commit is contained in:
committed by
Stefan Ceriu
parent
f04f3e74a7
commit
ccb0fc7de0
@@ -404,6 +404,12 @@ class TimelineViewModel: TimelineViewModelType, TimelineViewModelProtocol {
|
||||
}
|
||||
|
||||
private func updatePermissions() async {
|
||||
if case let .success(value) = await roomProxy.canUser(userID: roomProxy.ownUserID, sendMessage: .roomMessage) {
|
||||
state.canCurrentUserSendMessage = value
|
||||
} else {
|
||||
state.canCurrentUserSendMessage = false
|
||||
}
|
||||
|
||||
if case let .success(value) = await roomProxy.canUserRedactOther(userID: roomProxy.ownUserID) {
|
||||
state.canCurrentUserRedactOthers = value
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user