mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 17:36:14 -04:00
Changing behavior of the same user on a pad. Kick old sessions instead of refusing new
This commit is contained in:
parent
bf32c18d8d
commit
b692ffec0b
2 changed files with 18 additions and 30 deletions
|
@ -90,39 +90,28 @@ function handshake()
|
|||
//if we haven't recieved the clientVars yet, then this message should it be
|
||||
if(!receivedClientVars)
|
||||
{
|
||||
//We get a disconnect message
|
||||
if(window.console)
|
||||
console.log(obj);
|
||||
|
||||
receivedClientVars=true;
|
||||
|
||||
clientVars = obj;
|
||||
clientVars.userAgent=navigator.userAgent;
|
||||
clientVars.collab_client_vars.clientAgent=navigator.userAgent;
|
||||
|
||||
pad.init();
|
||||
|
||||
initalized=true;
|
||||
}
|
||||
//This handles every Message after the clientVars
|
||||
else
|
||||
{
|
||||
if(obj.disconnect)
|
||||
{
|
||||
socket.disconnect();
|
||||
padconnectionstatus.disconnected("userdup");
|
||||
return;
|
||||
}
|
||||
//yeah, the clientVars are here :). So we can start initalizing the Pad
|
||||
else
|
||||
{
|
||||
if(window.console)
|
||||
console.log(obj);
|
||||
|
||||
receivedClientVars=true;
|
||||
|
||||
clientVars = obj;
|
||||
clientVars.userAgent=navigator.userAgent;
|
||||
clientVars.collab_client_vars.clientAgent=navigator.userAgent;
|
||||
|
||||
pad.init();
|
||||
|
||||
initalized=true;
|
||||
}
|
||||
}
|
||||
//This handles every Message after the clientVars
|
||||
else
|
||||
{
|
||||
//We can't handle the message before we initalized the pad, so let this message bounce back in 100ms
|
||||
if(!initalized)
|
||||
{
|
||||
setTimeOut(this(obj), 100);
|
||||
}
|
||||
//We're initalized, so give this message to the collabClient
|
||||
else
|
||||
{
|
||||
pad.collabClient.handleMessageFromServer(obj);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue