This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +11
-0
lines changed Expand file tree Collapse file tree 4 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import {PillCompletion} from './Components';
25
25
import type { SelectionRange , Completion } from './Autocompleter' ;
26
26
import _uniq from 'lodash/uniq' ;
27
27
import _sortBy from 'lodash/sortBy' ;
28
+ import UserSettingsStore from '../UserSettingsStore' ;
28
29
29
30
import EmojiData from '../stripped-emoji.json' ;
30
31
@@ -96,6 +97,10 @@ export default class EmojiProvider extends AutocompleteProvider {
96
97
}
97
98
98
99
async getCompletions ( query : string , selection : SelectionRange ) {
100
+ if ( UserSettingsStore . getSyncedSetting ( "MessageComposerInput.dontSuggestEmoji" ) ) {
101
+ return [ ] ; // don't give any suggestions if the user doesn't want them
102
+ }
103
+
99
104
const EmojiText = sdk . getComponent ( 'views.elements.EmojiText' ) ;
100
105
101
106
let completions = [ ] ;
Original file line number Diff line number Diff line change @@ -105,6 +105,10 @@ const SETTINGS_LABELS = [
105
105
id : 'MessageComposerInput.autoReplaceEmoji' ,
106
106
label : 'Automatically replace plain text Emoji' ,
107
107
} ,
108
+ {
109
+ id : 'MessageComposerInput.dontSuggestEmoji' ,
110
+ label : 'Disable Emoji suggestions while typing' ,
111
+ } ,
108
112
{
109
113
id : 'Pill.shouldHidePillAvatar' ,
110
114
label : 'Hide avatars in user and room mentions' ,
Original file line number Diff line number Diff line change 283
283
"matrix-react-sdk version:" : " matrix-react-sdk version:" ,
284
284
"Matrix Apps" : " Matrix Apps" ,
285
285
"Members only" : " Members only" ,
286
+ "Disable Emoji suggestions while typing" : " Disable Emoji suggestions while typing" ,
286
287
"Message not sent due to unknown devices being present" : " Message not sent due to unknown devices being present" ,
287
288
"Missing room_id in request" : " Missing room_id in request" ,
288
289
"Missing user_id in request" : " Missing user_id in request" ,
Original file line number Diff line number Diff line change 249
249
"matrix-react-sdk version:" : " matrix-react-sdk version:" ,
250
250
"Matrix Apps" : " Matrix Apps" ,
251
251
"Members only" : " Members only" ,
252
+ "Disable Emoji suggestions while typing" : " Disable Emoji suggestions while typing" ,
252
253
"Message not sent due to unknown devices being present" : " Message not sent due to unknown devices being present" ,
253
254
"Missing room_id in request" : " Missing room_id in request" ,
254
255
"Missing user_id in request" : " Missing user_id in request" ,
You can’t perform that action at this time.
0 commit comments