Commit 85c4d144 authored by JC Brand's avatar JC Brand

Only show mention autocomplete suggestions for MUC occupants with nicks

parent fcc9e8c3
......@@ -642,13 +642,17 @@ converse.plugins.add('converse-muc-views', {
container_el.insertAdjacentElement('beforeend', view.el);
},
getAutoCompleteList () {
return this.model.occupants.filter('nick').map(o => ({'label': o.get('nick'), 'value': `@${o.get('nick')}`}));
},
initMentionAutoComplete () {
this.mention_auto_complete = new _converse.AutoComplete(this.el, {
'auto_first': true,
'auto_evaluate': false,
'min_chars': 1,
'match_current_word': true,
'list': () => this.model.occupants.map(o => ({'label': o.getDisplayName(), 'value': `@${o.getDisplayName()}`})),
'list': () => this.getAutoCompleteList(),
'filter': _converse.FILTER_STARTSWITH,
'ac_triggers': ["Tab", "@"],
'include_triggers': []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment