mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Address review
This commit is contained in:
-8
@@ -99,14 +99,6 @@ class DefaultSlashCommandService(
|
|||||||
override suspend fun proceedAdmin(
|
override suspend fun proceedAdmin(
|
||||||
slashCommand: SlashCommand.SlashCommandAdmin,
|
slashCommand: SlashCommand.SlashCommandAdmin,
|
||||||
): Result<Unit> {
|
): Result<Unit> {
|
||||||
if (slashCommand is SlashCommand.ChangeDisplayNameForRoom) {
|
|
||||||
val canUserChangeDisplayName = withTimeoutOrNull(5.seconds) {
|
|
||||||
capabilitiesProvider.canChangeDisplayName().getOrNull()
|
|
||||||
} ?: false
|
|
||||||
if (!canUserChangeDisplayName) {
|
|
||||||
return Result.failure(Exception("Changing display name is not allowed"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return commandExecutor.proceedAdmin(
|
return commandExecutor.proceedAdmin(
|
||||||
slashCommand = slashCommand,
|
slashCommand = slashCommand,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user