replace "kick" with "remove"
This commit is contained in:
parent
3251463410
commit
9ec662ccdc
|
@ -0,0 +1 @@
|
|||
"/kick" command is replaced with "/remove"
|
|
@ -77,7 +77,7 @@ interface MembershipService {
|
|||
/**
|
||||
* Kick a user from the room
|
||||
*/
|
||||
suspend fun kick(userId: String, reason: String? = null)
|
||||
suspend fun remove(userId: String, reason: String? = null)
|
||||
|
||||
/**
|
||||
* Join the room, or accept an invitation.
|
||||
|
|
|
@ -125,7 +125,7 @@ internal class DefaultMembershipService @AssistedInject constructor(
|
|||
membershipAdminTask.execute(params)
|
||||
}
|
||||
|
||||
override suspend fun kick(userId: String, reason: String?) {
|
||||
override suspend fun remove(userId: String, reason: String?) {
|
||||
val params = MembershipAdminTask.Params(MembershipAdminTask.Type.KICK, roomId, userId, reason)
|
||||
membershipAdminTask.execute(params)
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ enum class Command(val command: String, val parameters: String, @StringRes val d
|
|||
JOIN_ROOM("/join", "<room-address> [reason]", R.string.command_description_join_room, false),
|
||||
PART("/part", "[<room-address>]", R.string.command_description_part_room, false),
|
||||
TOPIC("/topic", "<topic>", R.string.command_description_topic, false),
|
||||
KICK_USER("/kick", "<user-id> [reason]", R.string.command_description_kick_user, false),
|
||||
REMOVE_USER("/remove", "<user-id> [reason]", R.string.command_description_kick_user, false),
|
||||
CHANGE_DISPLAY_NAME("/nick", "<display-name>", R.string.command_description_nick, false),
|
||||
CHANGE_DISPLAY_NAME_FOR_ROOM("/myroomnick", "<display-name>", R.string.command_description_nick_for_room, false),
|
||||
ROOM_AVATAR("/roomavatar", "<mxc_url>", R.string.command_description_room_avatar, true /* Since user has to know the mxc url */),
|
||||
|
|
|
@ -200,22 +200,22 @@ object CommandParser {
|
|||
ParsedCommand.ErrorSyntax(Command.INVITE)
|
||||
}
|
||||
}
|
||||
Command.KICK_USER.command -> {
|
||||
Command.REMOVE_USER.command -> {
|
||||
if (messageParts.size >= 2) {
|
||||
val userId = messageParts[1]
|
||||
|
||||
if (MatrixPatterns.isUserId(userId)) {
|
||||
ParsedCommand.KickUser(
|
||||
ParsedCommand.RemoveUser(
|
||||
userId,
|
||||
textMessage.substring(Command.KICK_USER.length + userId.length)
|
||||
textMessage.substring(Command.REMOVE_USER.length + userId.length)
|
||||
.trim()
|
||||
.takeIf { it.isNotBlank() }
|
||||
)
|
||||
} else {
|
||||
ParsedCommand.ErrorSyntax(Command.KICK_USER)
|
||||
ParsedCommand.ErrorSyntax(Command.REMOVE_USER)
|
||||
}
|
||||
} else {
|
||||
ParsedCommand.ErrorSyntax(Command.KICK_USER)
|
||||
ParsedCommand.ErrorSyntax(Command.REMOVE_USER)
|
||||
}
|
||||
}
|
||||
Command.BAN_USER.command -> {
|
||||
|
|
|
@ -51,7 +51,7 @@ sealed class ParsedCommand {
|
|||
class JoinRoom(val roomAlias: String, val reason: String?) : ParsedCommand()
|
||||
class PartRoom(val roomAlias: String?) : ParsedCommand()
|
||||
class ChangeTopic(val topic: String) : ParsedCommand()
|
||||
class KickUser(val userId: String, val reason: String?) : ParsedCommand()
|
||||
class RemoveUser(val userId: String, val reason: String?) : ParsedCommand()
|
||||
class ChangeDisplayName(val displayName: String) : ParsedCommand()
|
||||
class ChangeDisplayNameForRoom(val displayName: String) : ParsedCommand()
|
||||
class ChangeRoomAvatar(val url: String) : ParsedCommand()
|
||||
|
|
|
@ -217,8 +217,8 @@ class MessageComposerViewModel @AssistedInject constructor(
|
|||
is ParsedCommand.UnignoreUser -> {
|
||||
handleUnignoreSlashCommand(slashCommandResult)
|
||||
}
|
||||
is ParsedCommand.KickUser -> {
|
||||
handleKickSlashCommand(slashCommandResult)
|
||||
is ParsedCommand.RemoveUser -> {
|
||||
handleRemoveSlashCommand(slashCommandResult)
|
||||
}
|
||||
is ParsedCommand.JoinRoom -> {
|
||||
handleJoinToAnotherRoomSlashCommand(slashCommandResult)
|
||||
|
@ -576,9 +576,9 @@ class MessageComposerViewModel @AssistedInject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun handleKickSlashCommand(kick: ParsedCommand.KickUser) {
|
||||
private fun handleRemoveSlashCommand(removeUser: ParsedCommand.RemoveUser) {
|
||||
launchSlashCommandFlowSuspendable {
|
||||
room.kick(kick.userId, kick.reason)
|
||||
room.remove(removeUser.userId, removeUser.reason)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -254,7 +254,7 @@ class RoomMemberProfileViewModel @AssistedInject constructor(
|
|||
viewModelScope.launch {
|
||||
try {
|
||||
_viewEvents.post(RoomMemberProfileViewEvents.Loading())
|
||||
room.kick(initialState.userId, action.reason)
|
||||
room.remove(initialState.userId, action.reason)
|
||||
_viewEvents.post(RoomMemberProfileViewEvents.OnKickActionSuccess)
|
||||
} catch (failure: Throwable) {
|
||||
_viewEvents.post(RoomMemberProfileViewEvents.Failure(failure))
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
<string name="notice_direct_room_leave_by_you">You left the room</string>
|
||||
<string name="notice_room_reject">%1$s rejected the invitation</string>
|
||||
<string name="notice_room_reject_by_you">You rejected the invitation</string>
|
||||
<string name="notice_room_kick">%1$s kicked %2$s</string>
|
||||
<string name="notice_room_kick_by_you">You kicked %1$s</string>
|
||||
<string name="notice_room_kick">%1$s removed %2$s</string>
|
||||
<string name="notice_room_kick_by_you">You removed %1$s</string>
|
||||
<string name="notice_room_unban">%1$s unbanned %2$s</string>
|
||||
<string name="notice_room_unban_by_you">You unbanned %1$s</string>
|
||||
<string name="notice_room_ban">%1$s banned %2$s</string>
|
||||
|
@ -229,8 +229,8 @@
|
|||
<string name="notice_direct_room_leave_with_reason_by_you">You left. Reason: %1$s</string>
|
||||
<string name="notice_room_reject_with_reason">%1$s rejected the invitation. Reason: %2$s</string>
|
||||
<string name="notice_room_reject_with_reason_by_you">You rejected the invitation. Reason: %1$s</string>
|
||||
<string name="notice_room_kick_with_reason">%1$s kicked %2$s. Reason: %3$s</string>
|
||||
<string name="notice_room_kick_with_reason_by_you">You kicked %1$s. Reason: %2$s</string>
|
||||
<string name="notice_room_kick_with_reason">%1$s removed %2$s. Reason: %3$s</string>
|
||||
<string name="notice_room_kick_with_reason_by_you">You removed %1$s. Reason: %2$s</string>
|
||||
<string name="notice_room_unban_with_reason">%1$s unbanned %2$s. Reason: %3$s</string>
|
||||
<string name="notice_room_unban_with_reason_by_you">You unbanned %1$s. Reason: %2$s</string>
|
||||
<string name="notice_room_ban_with_reason">%1$s banned %2$s. Reason: %3$s</string>
|
||||
|
@ -884,7 +884,7 @@
|
|||
<string name="room_participants_action_remove">Remove from this room</string>
|
||||
<string name="room_participants_action_ban">Ban</string>
|
||||
<string name="room_participants_action_unban">Unban</string>
|
||||
<string name="room_participants_action_kick">Kick</string>
|
||||
<string name="room_participants_action_kick">Remove from chat</string>
|
||||
<string name="room_participants_action_set_default_power_level">Reset to normal user</string>
|
||||
<string name="room_participants_action_set_moderator">Make moderator</string>
|
||||
<string name="room_participants_action_set_admin">Make admin</string>
|
||||
|
@ -908,15 +908,15 @@
|
|||
|
||||
<string name="room_participants_action_cancel_invite_title">Cancel invite</string>
|
||||
<string name="room_participants_action_cancel_invite_prompt_msg">Are you sure you want to cancel the invite for this user?</string>
|
||||
<string name="room_participants_kick_title">Kick user</string>
|
||||
<string name="room_participants_kick_reason">Reason to kick</string>
|
||||
<string name="room_participants_kick_prompt_msg">kicking user will remove them from this room.\n\nTo prevent them from joining again, you should ban them instead.</string>
|
||||
<string name="space_participants_kick_prompt_msg">kicking user will remove them from this space.\n\nTo prevent them from joining again, you should ban them instead.</string>
|
||||
<string name="room_participants_kick_title">Remove user</string>
|
||||
<string name="room_participants_kick_reason">Reason to remove</string>
|
||||
<string name="room_participants_kick_prompt_msg">The user will be removed from this room.\n\nTo prevent them from joining again, you should ban them instead.</string>
|
||||
<string name="space_participants_kick_prompt_msg">The user will be removed from this space.\n\nTo prevent them from joining again, you should ban them instead.</string>
|
||||
<string name="room_participants_ban_title">Ban user</string>
|
||||
<string name="room_participants_ban_reason">Reason to ban</string>
|
||||
<string name="room_participants_unban_title">Unban user</string>
|
||||
<string name="room_participants_ban_prompt_msg">Banning user will kick them from this room and prevent them from joining again.</string>
|
||||
<string name="space_participants_ban_prompt_msg">Banning user will kick them from this space and prevent them from joining again.</string>
|
||||
<string name="room_participants_ban_prompt_msg">Banning user will remove them from this room and prevent them from joining again.</string>
|
||||
<string name="space_participants_ban_prompt_msg">Banning user will remove them from this space and prevent them from joining again.</string>
|
||||
<string name="room_participants_unban_prompt_msg">Unbanning user will allow them to join the room again.</string>
|
||||
<string name="space_participants_unban_prompt_msg">Unbanning user will allow them to join the space again.</string>
|
||||
|
||||
|
@ -996,7 +996,7 @@
|
|||
<string name="room_permissions_send_messages">Send messages</string>
|
||||
<string name="room_permissions_invite_users">Invite users</string>
|
||||
<string name="room_permissions_change_settings">Change settings</string>
|
||||
<string name="room_permissions_kick_users">Kick users</string>
|
||||
<string name="room_permissions_kick_users">Remove users</string>
|
||||
<string name="room_permissions_ban_users">Ban users</string>
|
||||
<string name="room_permissions_remove_messages_sent_by_others">Remove messages sent by others</string>
|
||||
<string name="room_permissions_notify_everyone">Notify everyone</string>
|
||||
|
@ -1323,9 +1323,9 @@
|
|||
<string name="settings_show_room_member_state_events">Show room member state events</string>
|
||||
<string name="settings_chat_effects_title">Show chat effects</string>
|
||||
<string name="settings_chat_effects_description">Use /confetti command or send a message containing ❄️ or 🎉</string>
|
||||
<string name="settings_show_room_member_state_events_summary">Includes invite/join/left/kick/ban events and avatar/display name changes.</string>
|
||||
<string name="settings_show_room_member_state_events_summary">Includes invite/join/left/remove/ban events and avatar/display name changes.</string>
|
||||
<string name="settings_show_join_leave_messages">Show join and leave events</string>
|
||||
<string name="settings_show_join_leave_messages_summary">Invites, kicks, and bans are unaffected.</string>
|
||||
<string name="settings_show_join_leave_messages_summary">Invites, removes, and bans are unaffected.</string>
|
||||
<string name="settings_show_avatar_display_name_changes_messages">Show account events</string>
|
||||
<string name="settings_show_avatar_display_name_changes_messages_summary">Includes avatar and display name changes.</string>
|
||||
<string name="settings_vibrate_on_mention">Vibrate when mentioning a user</string>
|
||||
|
@ -1853,7 +1853,7 @@
|
|||
<string name="command_description_join_room">Joins room with given address</string>
|
||||
<string name="command_description_part_room">Leave room</string>
|
||||
<string name="command_description_topic">Set the room topic</string>
|
||||
<string name="command_description_kick_user">Kicks user with given id</string>
|
||||
<string name="command_description_kick_user">Removes user with given id from this room</string>
|
||||
<string name="command_description_nick">Changes your display nickname</string>
|
||||
<string name="command_description_nick_for_room">Changes your display nickname in the current room only</string>
|
||||
<string name="command_description_room_avatar">Changes the avatar of the current room</string>
|
||||
|
@ -1903,7 +1903,7 @@
|
|||
</plurals>
|
||||
<string name="group_no_long_description">The community admin has not provided a long description for this community.</string>
|
||||
|
||||
<string name="has_been_kicked">You have been kicked from %1$s by %2$s</string>
|
||||
<string name="has_been_kicked">You have been removed from %1$s by %2$s</string>
|
||||
<string name="has_been_banned">You have been banned from %1$s by %2$s</string>
|
||||
<string name="reason_colon">Reason: %1$s</string>
|
||||
<string name="rejoin">Rejoin</string>
|
||||
|
|
Loading…
Reference in New Issue