Show relevant user in local suggestions on user talk pages

Bug: T273324
Change-Id: I60e550efbea3d9e250dcaf13080407094a23aad3
This commit is contained in:
Ed Sanders 2021-02-09 21:51:28 +00:00
parent 89dd44bb35
commit b581883e7c

View file

@ -17,7 +17,8 @@ var controller = require( 'ext.discussionTools.init' ).controller;
* @param {ve.ui.Surface} surface Surface to act on
*/
function MWUsernameCompletionAction( surface ) {
var action = this;
var action = this,
relevantUserName = mw.config.get( 'wgRelevantUserName' );
// Parent constructor
MWUsernameCompletionAction.super.call( this, surface );
@ -34,6 +35,10 @@ function MWUsernameCompletionAction( surface ) {
action.localUsers.push( user );
}
} );
if ( relevantUserName && this.localUsers.indexOf( relevantUserName ) === -1 ) {
this.localUsers.push( relevantUserName );
this.localUsers.sort();
}
this.remoteUsers = [];
}