mirror of https://github.com/vector-im/riot-web
Add option to disable Emoji suggestions
Signed-off-by: Travis Ralston <travpc@gmail.com>pull/21833/head
parent
94ec11d3e1
commit
b2de016b35
|
@ -25,6 +25,7 @@ import {PillCompletion} from './Components';
|
|||
import type {SelectionRange, Completion} from './Autocompleter';
|
||||
import _uniq from 'lodash/uniq';
|
||||
import _sortBy from 'lodash/sortBy';
|
||||
import UserSettingsStore from '../UserSettingsStore';
|
||||
|
||||
import EmojiData from '../stripped-emoji.json';
|
||||
|
||||
|
@ -96,6 +97,10 @@ export default class EmojiProvider extends AutocompleteProvider {
|
|||
}
|
||||
|
||||
async getCompletions(query: string, selection: SelectionRange) {
|
||||
if (UserSettingsStore.getSyncedSetting("MessageComposerInput.dontSuggestEmoji")) {
|
||||
return []; // don't give any suggestions if the user doesn't want them
|
||||
}
|
||||
|
||||
const EmojiText = sdk.getComponent('views.elements.EmojiText');
|
||||
|
||||
let completions = [];
|
||||
|
|
|
@ -105,6 +105,10 @@ const SETTINGS_LABELS = [
|
|||
id: 'MessageComposerInput.autoReplaceEmoji',
|
||||
label: 'Automatically replace plain text Emoji',
|
||||
},
|
||||
{
|
||||
id: 'MessageComposerInput.dontSuggestEmoji',
|
||||
label: 'Disable Emoji suggestions while typing',
|
||||
},
|
||||
{
|
||||
id: 'Pill.shouldHidePillAvatar',
|
||||
label: 'Hide avatars in user and room mentions',
|
||||
|
|
|
@ -283,6 +283,7 @@
|
|||
"matrix-react-sdk version:": "matrix-react-sdk version:",
|
||||
"Matrix Apps": "Matrix Apps",
|
||||
"Members only": "Members only",
|
||||
"Disable Emoji suggestions while typing": "Disable Emoji suggestions while typing",
|
||||
"Message not sent due to unknown devices being present": "Message not sent due to unknown devices being present",
|
||||
"Missing room_id in request": "Missing room_id in request",
|
||||
"Missing user_id in request": "Missing user_id in request",
|
||||
|
|
|
@ -249,6 +249,7 @@
|
|||
"matrix-react-sdk version:": "matrix-react-sdk version:",
|
||||
"Matrix Apps": "Matrix Apps",
|
||||
"Members only": "Members only",
|
||||
"Disable Emoji suggestions while typing": "Disable Emoji suggestions while typing",
|
||||
"Message not sent due to unknown devices being present": "Message not sent due to unknown devices being present",
|
||||
"Missing room_id in request": "Missing room_id in request",
|
||||
"Missing user_id in request": "Missing user_id in request",
|
||||
|
|
Loading…
Reference in New Issue