diff --git a/scripts/communications.js b/scripts/communications.js index a1b0b93..66ffb52 100644 --- a/scripts/communications.js +++ b/scripts/communications.js @@ -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); + } + } } }); });