mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
pad: Pass color and display name in CLIENT_READY
This commit is contained in:
parent
7a0d8cb52e
commit
56cb08f4c5
3 changed files with 22 additions and 12 deletions
|
@ -184,12 +184,23 @@ const sendClientReady = (isReconnect) => {
|
|||
Cookies.set('token', token, {expires: 60});
|
||||
}
|
||||
|
||||
// If known, propagate the display name and color to the server in the CLIENT_READY message. This
|
||||
// allows the server to include the values in its reply CLIENT_VARS message (which avoids
|
||||
// initialization race conditions) and in the USER_NEWINFO messages sent to the other users on the
|
||||
// pad (which enables them to display a user join notification with the correct name).
|
||||
const params = getUrlVars();
|
||||
const userInfo = {
|
||||
colorId: params.get('userColor'),
|
||||
name: params.get('userName'),
|
||||
};
|
||||
|
||||
const msg = {
|
||||
component: 'pad',
|
||||
type: 'CLIENT_READY',
|
||||
padId,
|
||||
sessionID: Cookies.get('sessionID'),
|
||||
token,
|
||||
userInfo,
|
||||
};
|
||||
|
||||
// this is a reconnect, lets tell the server our revisionnumber
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue