mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Adopt new canOwnUser* power level methods instead of the throwing ones.
This commit is contained in:
committed by
Stefan Ceriu
parent
374fb722c6
commit
c7ff6c019d
@@ -405,12 +405,12 @@ class TimelineViewModel: TimelineViewModelType, TimelineViewModelProtocol {
|
||||
private func updateRoomInfo(roomInfo: RoomInfoProxyProtocol) {
|
||||
state.pinnedEventIDs = roomInfo.pinnedEventIDs
|
||||
|
||||
state.canCurrentUserSendMessage = (try? roomInfo.powerLevels.canUser(userID: roomProxy.ownUserID, sendMessage: .roomMessage).get()) == true
|
||||
state.canCurrentUserRedactOthers = (try? roomInfo.powerLevels.canUserRedactOther(userID: roomProxy.ownUserID).get()) == true
|
||||
state.canCurrentUserRedactSelf = (try? roomInfo.powerLevels.canUserRedactOwn(userID: roomProxy.ownUserID).get()) == true
|
||||
state.canCurrentUserPin = (try? roomInfo.powerLevels.canUserPinOrUnpin(userID: roomProxy.ownUserID).get()) == true
|
||||
state.canCurrentUserKick = (try? roomInfo.powerLevels.canUserKick(userID: roomProxy.ownUserID).get()) == true
|
||||
state.canCurrentUserBan = (try? roomInfo.powerLevels.canUserBan(userID: roomProxy.ownUserID).get()) == true
|
||||
state.canCurrentUserSendMessage = roomInfo.powerLevels.canOwnUser(sendMessage: .roomMessage)
|
||||
state.canCurrentUserRedactOthers = roomInfo.powerLevels.canOwnUserRedactOther()
|
||||
state.canCurrentUserRedactSelf = roomInfo.powerLevels.canOwnUserRedactOwn()
|
||||
state.canCurrentUserPin = roomInfo.powerLevels.canOwnUserPinOrUnpin()
|
||||
state.canCurrentUserKick = roomInfo.powerLevels.canOwnUserKick()
|
||||
state.canCurrentUserBan = roomInfo.powerLevels.canOwnUserBan()
|
||||
}
|
||||
|
||||
private func setupSubscriptions() {
|
||||
|
||||
Reference in New Issue
Block a user