From 4d2ef7788a70741e2f94d1540f9d83b88f8f8edd Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Wed, 23 Jul 2025 18:43:03 +0200 Subject: [PATCH 1/2] PL150 users are displayed as Owner in the list --- Riot/Assets/en.lproj/Vector.strings | 1 + Riot/Generated/Strings.swift | 4 ++++ Riot/Model/Room/RoomPowerLevel.swift | 5 ++++- Riot/Modules/Room/Members/RoomParticipantsViewController.m | 3 +++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index 6adee1f2a..e10a8dbb5 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -523,6 +523,7 @@ Tap the + to start adding people."; "room_member_power_level_moderator_in" = "Moderator in %@"; "room_member_power_level_custom_in" = "Custom (%@) in %@"; +"room_member_power_level_short_owner" = "Owner"; "room_member_power_level_short_admin" = "Admin"; "room_member_power_level_short_moderator" = "Mod"; "room_member_power_level_short_custom" = "Custom"; diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index d4dc0d142..1ee48dcf0 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -6171,6 +6171,10 @@ public class VectorL10n: NSObject { public static var roomMemberPowerLevelShortModerator: String { return VectorL10n.tr("Vector", "room_member_power_level_short_moderator") } + /// Owner + public static var roomMemberPowerLevelShortOwner: String { + return VectorL10n.tr("Vector", "room_member_power_level_short_owner") + } /// Editing public static var roomMessageEditing: String { return VectorL10n.tr("Vector", "room_message_editing") diff --git a/Riot/Model/Room/RoomPowerLevel.swift b/Riot/Model/Room/RoomPowerLevel.swift index b008801b2..9463f5586 100644 --- a/Riot/Model/Room/RoomPowerLevel.swift +++ b/Riot/Model/Room/RoomPowerLevel.swift @@ -10,13 +10,16 @@ import Foundation /// Riot Standard Room Member Power Level @objc public enum RoomPowerLevel: Int { + case owner = 150 case admin = 100 case moderator = 50 case user = 0 public init?(rawValue: Int) { switch rawValue { - case 100...: + case 150...: + self = .owner + case 100...149: self = .admin case 50...99: self = .moderator diff --git a/Riot/Modules/Room/Members/RoomParticipantsViewController.m b/Riot/Modules/Room/Members/RoomParticipantsViewController.m index bd7f07aed..6ec3b8e7c 100644 --- a/Riot/Modules/Room/Members/RoomParticipantsViewController.m +++ b/Riot/Modules/Room/Members/RoomParticipantsViewController.m @@ -988,6 +988,9 @@ Please see LICENSE in the repository root for full details. NSString *powerLevelText; switch (roomPowerLevel) { + case RoomPowerLevelOwner: + powerLevelText = [VectorL10n roomMemberPowerLevelShortOwner]; + break; case RoomPowerLevelAdmin: powerLevelText = [VectorL10n roomMemberPowerLevelShortAdmin]; break; From eb0deaa54d0773339598581f22496578d2aa793a Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Wed, 23 Jul 2025 18:50:10 +0200 Subject: [PATCH 2/2] added also the owner in x string --- Riot/Assets/en.lproj/Vector.strings | 1 + Riot/Generated/Strings.swift | 4 ++++ .../Room/Members/Detail/RoomMemberDetailsViewController.m | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index e10a8dbb5..c5a94ded1 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -519,6 +519,7 @@ Tap the + to start adding people."; "room_participants_security_information_room_encrypted" = "Messages in this room are end-to-end encrypted.\n\nYour messages are secured with locks and only you and the recipient have the unique keys to unlock them."; "room_participants_security_information_room_encrypted_for_dm" = "Messages here are end-to-end encrypted.\n\nYour messages are secured with locks and only you and the recipient have the unique keys to unlock them."; +"room_member_power_level_owner_in" = "Owner in %@"; "room_member_power_level_admin_in" = "Admin in %@"; "room_member_power_level_moderator_in" = "Moderator in %@"; "room_member_power_level_custom_in" = "Custom (%@) in %@"; diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index 1ee48dcf0..790cbb1af 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -6155,6 +6155,10 @@ public class VectorL10n: NSObject { public static func roomMemberPowerLevelModeratorIn(_ p1: String) -> String { return VectorL10n.tr("Vector", "room_member_power_level_moderator_in", p1) } + /// Owner in %@ + public static func roomMemberPowerLevelOwnerIn(_ p1: String) -> String { + return VectorL10n.tr("Vector", "room_member_power_level_owner_in", p1) + } /// You will not be able to undo this change as you are promoting the user to have the same power level as yourself.\nAre you sure? public static var roomMemberPowerLevelPrompt: String { return VectorL10n.tr("Vector", "room_member_power_level_prompt") diff --git a/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m b/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m index 2e3e5b155..07b3f3dd3 100644 --- a/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m +++ b/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m @@ -356,6 +356,10 @@ Please see LICENSE in the repository root for full details. RoomPowerLevel roomPowerLevel = [RoomPowerLevelHelper roomPowerLevelFrom:powerLevel]; switch (roomPowerLevel) { + case RoomPowerLevelOwner: + self.roomMemberPowerLevelLabel.text = [VectorL10n roomMemberPowerLevelOwnerIn:self.mxRoom.summary.displayName]; + self.roomMemberPowerLevelContainerView.hidden = NO; + break; case RoomPowerLevelAdmin: self.roomMemberPowerLevelLabel.text = [VectorL10n roomMemberPowerLevelAdminIn:self.mxRoom.summary.displayName]; self.roomMemberPowerLevelContainerView.hidden = NO;