replaced deprecated function with the new one to check for power levels

This commit is contained in:
Mauro Romito
2025-07-22 16:17:48 +02:00
parent 1db7169d4e
commit 1a23b84882
22 changed files with 64 additions and 51 deletions
@@ -354,7 +354,7 @@ Please see LICENSE in the repository root for full details.
{
// Check whether the user has enough power to rename the room
MXRoomPowerLevels *powerLevels = self.mxRoom.dangerousSyncState.powerLevels;
NSInteger userPowerLevel = [powerLevels powerLevelOfUserWithUserID:self.mxRoom.mxSession.myUser.userId];
NSInteger userPowerLevel = [self.mxRoom.dangerousSyncState powerLevelOfUserWithUserID:self.mxRoom.mxSession.myUser.userId];
if (userPowerLevel >= [powerLevels minimumPowerLevelForSendingEventAsStateEvent:kMXEventTypeStringRoomName])
{
// Only the room name is edited here, update the text field with the room name
@@ -384,7 +384,7 @@ Please see LICENSE in the repository root for full details.
{
// Check whether the user has enough power to edit room topic
MXRoomPowerLevels *powerLevels = self.mxRoom.dangerousSyncState.powerLevels;
NSInteger userPowerLevel = [powerLevels powerLevelOfUserWithUserID:self.mxRoom.mxSession.myUser.userId];
NSInteger userPowerLevel = [self.mxRoom.dangerousSyncState powerLevelOfUserWithUserID:self.mxRoom.mxSession.myUser.userId];
if (userPowerLevel >= [powerLevels minimumPowerLevelForSendingEventAsStateEvent:kMXEventTypeStringRoomTopic])
{
textField.backgroundColor = [UIColor whiteColor];