CollabTarget: set name to logged in MW user

Change-Id: Ic39ce1790d3a267123810bdb87cc0a844df0d42c
This commit is contained in:
David Lynch 2018-05-16 12:48:34 +02:00
parent a5814e2213
commit c3d03ae101

View file

@ -124,6 +124,13 @@ ve.init.mw.CollabTarget.prototype.setSurface = function ( surface ) {
{ server: this.rebaserUrl }
);
// TODO: server could communicate with MW (via oauth?) to know the
// current-user's name. Disable changing name if logged in?
// Communicate an I-am-a-valid-user flag to other clients?
if ( !mw.user.isAnon() ) {
synchronizer.changeName( mw.user.getName() );
}
surfaceView.setSynchronizer( synchronizer );
}