Allowed server to update the chat list

This commit is contained in:
jsrobson10 2019-04-13 10:19:14 +10:00
parent 79f73d3dbc
commit 2a4f48cec7
1 changed files with 19 additions and 0 deletions

View File

@ -376,6 +376,25 @@ function connect(profile, connection_id)
profile_switch_to(connection_id);
}
}
// New chat
if(data.mode == "new_chat")
{
console.log("New chat created");
// Set the data
g.chats.push({
name: data.name,
messages: []
});
// Update the screen if its active
if(active_profile == connection_id)
{
// Refresh this profile
profile_switch_to(connection_id);
}
}
}
});
});