-
Notifications
You must be signed in to change notification settings - Fork 713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove "X kicked X" terminology when removing people from a room #4911
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"/kick" command is replaced with "/remove" | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe also update the comment above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As it is a change in the SDK api, would be better to keep
|
||
|
||
/** | ||
* Join the room, or accept an invitation. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,42 +24,46 @@ import im.vector.app.R | |
* the user can write theses messages to perform some actions | ||
* the list will be displayed in this order | ||
*/ | ||
enum class Command(val command: String, val parameters: String, @StringRes val description: Int, val isDevCommand: Boolean) { | ||
EMOTE("/me", "<message>", R.string.command_description_emote, false), | ||
BAN_USER("/ban", "<user-id> [reason]", R.string.command_description_ban_user, false), | ||
UNBAN_USER("/unban", "<user-id> [reason]", R.string.command_description_unban_user, false), | ||
IGNORE_USER("/ignore", "<user-id> [reason]", R.string.command_description_ignore_user, false), | ||
UNIGNORE_USER("/unignore", "<user-id>", R.string.command_description_unignore_user, false), | ||
SET_USER_POWER_LEVEL("/op", "<user-id> [<power-level>]", R.string.command_description_op_user, false), | ||
RESET_USER_POWER_LEVEL("/deop", "<user-id>", R.string.command_description_deop_user, false), | ||
ROOM_NAME("/roomname", "<name>", R.string.command_description_room_name, false), | ||
INVITE("/invite", "<user-id> [reason]", R.string.command_description_invite_user, false), | ||
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), | ||
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 */), | ||
CHANGE_AVATAR_FOR_ROOM("/myroomavatar", "<mxc_url>", R.string.command_description_avatar_for_room, true /* Since user has to know the mxc url */), | ||
MARKDOWN("/markdown", "<on|off>", R.string.command_description_markdown, false), | ||
RAINBOW("/rainbow", "<message>", R.string.command_description_rainbow, false), | ||
RAINBOW_EMOTE("/rainbowme", "<message>", R.string.command_description_rainbow_emote, false), | ||
CLEAR_SCALAR_TOKEN("/clear_scalar_token", "", R.string.command_description_clear_scalar_token, false), | ||
SPOILER("/spoiler", "<message>", R.string.command_description_spoiler, false), | ||
SHRUG("/shrug", "<message>", R.string.command_description_shrug, false), | ||
LENNY("/lenny", "<message>", R.string.command_description_lenny, false), | ||
PLAIN("/plain", "<message>", R.string.command_description_plain, false), | ||
WHOIS("/whois", "<user-id>", R.string.command_description_whois, false), | ||
DISCARD_SESSION("/discardsession", "", R.string.command_description_discard_session, false), | ||
CONFETTI("/confetti", "<message>", R.string.command_confetti, false), | ||
SNOWFALL("/snowfall", "<message>", R.string.command_snow, false), | ||
CREATE_SPACE("/createspace", "<name> <invitee>*", R.string.command_description_create_space, true), | ||
ADD_TO_SPACE("/addToSpace", "spaceId", R.string.command_description_add_to_space, true), | ||
JOIN_SPACE("/joinSpace", "spaceId", R.string.command_description_join_space, true), | ||
LEAVE_ROOM("/leave", "<roomId?>", R.string.command_description_leave_room, true), | ||
UPGRADE_ROOM("/upgraderoom", "newVersion", R.string.command_description_upgrade_room, true); | ||
enum class Command(val command: String, val aliases: Array<CharSequence>?, val parameters: String, @StringRes val description: Int, val isDevCommand: Boolean) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not a strong opinion about it, but why using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did it because of spread operation used later here
|
||
EMOTE("/me", null, "<message>", R.string.command_description_emote, false), | ||
BAN_USER("/ban", null, "<user-id> [reason]", R.string.command_description_ban_user, false), | ||
UNBAN_USER("/unban", null, "<user-id> [reason]", R.string.command_description_unban_user, false), | ||
IGNORE_USER("/ignore", null, "<user-id> [reason]", R.string.command_description_ignore_user, false), | ||
UNIGNORE_USER("/unignore", null, "<user-id>", R.string.command_description_unignore_user, false), | ||
SET_USER_POWER_LEVEL("/op", null, "<user-id> [<power-level>]", R.string.command_description_op_user, false), | ||
RESET_USER_POWER_LEVEL("/deop", null, "<user-id>", R.string.command_description_deop_user, false), | ||
ROOM_NAME("/roomname", null, "<name>", R.string.command_description_room_name, false), | ||
INVITE("/invite", null, "<user-id> [reason]", R.string.command_description_invite_user, false), | ||
JOIN_ROOM("/join", arrayOf("/j", "/goto"), "<room-address> [reason]", R.string.command_description_join_room, false), | ||
PART("/part", null, "[<room-address>]", R.string.command_description_part_room, false), | ||
TOPIC("/topic", null, "<topic>", R.string.command_description_topic, false), | ||
REMOVE_USER("/remove", arrayOf("/kick"), "<user-id> [reason]", R.string.command_description_kick_user, false), | ||
CHANGE_DISPLAY_NAME("/nick", null, "<display-name>", R.string.command_description_nick, false), | ||
CHANGE_DISPLAY_NAME_FOR_ROOM("/myroomnick", arrayOf("/roomnick"), "<display-name>", R.string.command_description_nick_for_room, false), | ||
ROOM_AVATAR("/roomavatar", null, "<mxc_url>", R.string.command_description_room_avatar, true /* Since user has to know the mxc url */), | ||
CHANGE_AVATAR_FOR_ROOM("/myroomavatar", null, "<mxc_url>", R.string.command_description_avatar_for_room, true /* Since user has to know the mxc url */), | ||
MARKDOWN("/markdown", null, "<on|off>", R.string.command_description_markdown, false), | ||
RAINBOW("/rainbow", null, "<message>", R.string.command_description_rainbow, false), | ||
RAINBOW_EMOTE("/rainbowme", null, "<message>", R.string.command_description_rainbow_emote, false), | ||
CLEAR_SCALAR_TOKEN("/clear_scalar_token", null, "", R.string.command_description_clear_scalar_token, false), | ||
SPOILER("/spoiler", null, "<message>", R.string.command_description_spoiler, false), | ||
SHRUG("/shrug", null, "<message>", R.string.command_description_shrug, false), | ||
LENNY("/lenny", null, "<message>", R.string.command_description_lenny, false), | ||
PLAIN("/plain", null, "<message>", R.string.command_description_plain, false), | ||
WHOIS("/whois", null, "<user-id>", R.string.command_description_whois, false), | ||
DISCARD_SESSION("/discardsession", null, "", R.string.command_description_discard_session, false), | ||
CONFETTI("/confetti", null, "<message>", R.string.command_confetti, false), | ||
SNOWFALL("/snowfall", null, "<message>", R.string.command_snow, false), | ||
CREATE_SPACE("/createspace", null, "<name> <invitee>*", R.string.command_description_create_space, true), | ||
ADD_TO_SPACE("/addToSpace", null, "spaceId", R.string.command_description_add_to_space, true), | ||
JOIN_SPACE("/joinSpace", null, "spaceId", R.string.command_description_join_space, true), | ||
LEAVE_ROOM("/leave", null, "<roomId?>", R.string.command_description_leave_room, true), | ||
UPGRADE_ROOM("/upgraderoom", null, "newVersion", R.string.command_description_upgrade_room, true); | ||
|
||
val length | ||
get() = command.length + 1 | ||
val allAliases = arrayOf(command, *aliases.orEmpty()) | ||
|
||
fun matches(inputCommand: CharSequence) = allAliases.any { it.contentEquals(inputCommand, true) } | ||
|
||
fun startsWith(input: CharSequence) = | ||
allAliases.any { it.startsWith(input, 1, true) } | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also mention the replacement in the wordings.