From 9dba628f10f16fd616338631b5ab375f9ec51923 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 1 Jul 2017 12:55:43 +0100 Subject: [PATCH] add missing commands to the Autocomplete CommandProvider Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/autocomplete/CommandProvider.js | 32 +++++++++++++++++++++++++++++ src/i18n/strings/en_EN.json | 6 ++++++ 2 files changed, 38 insertions(+) diff --git a/src/autocomplete/CommandProvider.js b/src/autocomplete/CommandProvider.js index 205a3737dc..d48e2d7b37 100644 --- a/src/autocomplete/CommandProvider.js +++ b/src/autocomplete/CommandProvider.js @@ -21,6 +21,7 @@ import AutocompleteProvider from './AutocompleteProvider'; import Fuse from 'fuse.js'; import {TextualCompletion} from './Components'; +// TODO merge this with the factory mechanics of SlashCommands? // Warning: Since the description string will be translated in _t(result.description), all these strings below must be in i18n/strings/en_EN.json file const COMMANDS = [ { @@ -33,6 +34,16 @@ const COMMANDS = [ args: ' [reason]', description: 'Bans user with given id', }, + { + command: '/unban', + args: ' [reason]', + description: 'Unbans user with given id', + }, + { + command: '/op', + args: '', + description: 'Ops user with given id', + }, { command: '/deop', args: '', @@ -48,6 +59,16 @@ const COMMANDS = [ args: '', description: 'Joins room with given alias', }, + { + command: '/part', + args: '', + description: 'Leaves room with given alias', + }, + { + command: '/topic', + args: '', + description: 'Sets the room topic', + }, { command: '/kick', args: ' [reason]', @@ -63,6 +84,17 @@ const COMMANDS = [ args: '', description: 'Searches DuckDuckGo for results', }, + { + command: '/tint', + args: ' []', + description: 'Change colourscheme of current room', + }, + { + command: '/verify', + args: ' ', + description: 'Verify a user, device, and pubkey tuple', + }, + // Omitting `/markdown` as it only seems to apply to OldComposer ]; const COMMAND_RE = /(^\/\w*)/g; diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index a4dcb2873f..e3e64a808e 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -187,6 +187,7 @@ "Can't connect to homeserver via HTTP when an HTTPS URL is in your browser bar. Either use HTTPS or enable unsafe scripts.": "Can't connect to homeserver via HTTP when an HTTPS URL is in your browser bar. Either use HTTPS or enable unsafe scripts.", "Can't load user settings": "Can't load user settings", "Change Password": "Change Password", + "Change colourscheme of current room": "Change colourscheme of current room", "%(senderName)s changed their display name from %(oldDisplayName)s to %(displayName)s.": "%(senderName)s changed their display name from %(oldDisplayName)s to %(displayName)s.", "%(senderName)s changed their profile picture.": "%(senderName)s changed their profile picture.", "%(senderName)s changed the power level of %(powerLevelDiffText)s.": "%(senderName)s changed the power level of %(powerLevelDiffText)s.", @@ -376,6 +377,7 @@ "Labs": "Labs", "Last seen": "Last seen", "Leave room": "Leave room", + "Leaves room with given alias": "Leaves room with given alias", "left and rejoined": "left and rejoined", "left": "left", "%(targetName)s left the room.": "%(targetName)s left the room.", @@ -507,6 +509,7 @@ "%(senderName)s set their display name to %(displayName)s.": "%(senderName)s set their display name to %(displayName)s.", "Set": "Set", "Settings": "Settings", + "Sets the room topic": "Sets the room topic", "Show panel": "Show panel", "Show Text Formatting Toolbar": "Show Text Formatting Toolbar", "Show timestamps in 12 hour format (e.g. 2:30pm)": "Show timestamps in 12 hour format (e.g. 2:30pm)", @@ -581,6 +584,7 @@ "Unable to restore previous session": "Unable to restore previous session", "Unable to verify email address.": "Unable to verify email address.", "Unban": "Unban", + "Unbans user with given id": "Unbans user with given id", "%(senderName)s unbanned %(targetName)s.": "%(senderName)s unbanned %(targetName)s.", "Unable to ascertain that the address this invite was sent to matches one associated with your account.": "Unable to ascertain that the address this invite was sent to matches one associated with your account.", "Unable to capture screen": "Unable to capture screen", @@ -803,6 +807,7 @@ "Analytics": "Analytics", "Opt out of analytics": "Opt out of analytics", "Options": "Options", + "Ops user with given id": "Ops user with given id", "Riot collects anonymous analytics to allow us to improve the application.": "Riot collects anonymous analytics to allow us to improve the application.", "Passphrases must match": "Passphrases must match", "Passphrase must not be empty": "Passphrase must not be empty", @@ -835,6 +840,7 @@ "If it matches, press the verify button below. If it doesn't, then someone else is intercepting this device and you probably want to press the blacklist button instead.": "If it matches, press the verify button below. If it doesn't, then someone else is intercepting this device and you probably want to press the blacklist button instead.", "In future this verification process will be more sophisticated.": "In future this verification process will be more sophisticated.", "Verify device": "Verify device", + "Verify a user, device, and pubkey tuple": "Verify a user, device, and pubkey tuple", "I verify that the keys match": "I verify that the keys match", "We encountered an error trying to restore your previous session. If you continue, you will need to log in again, and encrypted chat history will be unreadable.": "We encountered an error trying to restore your previous session. If you continue, you will need to log in again, and encrypted chat history will be unreadable.", "Unable to restore session": "Unable to restore session",