diff options
author | Saptak S <saptak013@gmail.com> | 2021-11-14 21:06:47 +0530 |
---|---|---|
committer | Saptak S <saptak013@gmail.com> | 2021-11-14 21:06:47 +0530 |
commit | 2a7c3d68671bf4a85d3c67f9e710e6a6228bb81a (patch) | |
tree | 68d0eea3f3eedaa5ec27a2c32eefba161a17264c | |
parent | f4ade1ba8d9529893c6a84e4d335f31722eb59c8 (diff) | |
download | onionshare-2a7c3d68671bf4a85d3c67f9e710e6a6228bb81a.tar.gz onionshare-2a7c3d68671bf4a85d3c67f9e710e6a6228bb81a.zip |
Renames message event to chat_message
-rw-r--r-- | cli/onionshare_cli/resources/static/js/chat.js | 2 | ||||
-rw-r--r-- | cli/onionshare_cli/web/chat_mode.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/cli/onionshare_cli/resources/static/js/chat.js b/cli/onionshare_cli/resources/static/js/chat.js index 78eaa7bc..2be55488 100644 --- a/cli/onionshare_cli/resources/static/js/chat.js +++ b/cli/onionshare_cli/resources/static/js/chat.js @@ -20,7 +20,7 @@ $(function () { // Triggered when message is received from a user. Even when sent // by self, it get triggered after the server sends back the emit. - socket.on('message', function (data) { + socket.on('chat_message', function (data) { addMessageToPanel(data, current_username, 'chat'); console.log(data, current_username); }); diff --git a/cli/onionshare_cli/web/chat_mode.py b/cli/onionshare_cli/web/chat_mode.py index b8053e0c..5f2e30f5 100644 --- a/cli/onionshare_cli/web/chat_mode.py +++ b/cli/onionshare_cli/web/chat_mode.py @@ -131,7 +131,7 @@ class ChatModeWeb: """Sent by a client when the user entered a new message. The message is sent to all people in the server.""" emit( - "message", + "chat_message", {"username": session.get("name"), "msg": message["msg"]}, broadcast=True, ) |