aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/commands/core/emote.js
diff options
context:
space:
mode:
authormarzavec <admin@marzavec.com>2020-03-12 19:28:20 +0100
committermarzavec <admin@marzavec.com>2020-03-12 19:28:20 +0100
commit2b6e771383f4c6f392b32ce26e4d759b56791132 (patch)
treeb8c1cefecbd7f5816a3fb5ddc4bdb6bdfe463ba2 /server/src/commands/core/emote.js
parentMerge pull request #96 from MinusGix/fixKickHash (diff)
downloadhackchat-2b6e771383f4c6f392b32ce26e4d759b56791132.tar.gz
hackchat-2b6e771383f4c6f392b32ce26e4d759b56791132.zip
Protocol Updates and Bug Fixes
Diffstat (limited to '')
-rw-r--r--server/src/commands/core/emote.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/src/commands/core/emote.js b/server/src/commands/core/emote.js
index 19a5fbe..21d14d1 100644
--- a/server/src/commands/core/emote.js
+++ b/server/src/commands/core/emote.js
@@ -22,7 +22,7 @@ const parseText = (text) => {
// module main
export async function run(core, server, socket, payload) {
// check user input
- const text = parseText(payload.text);
+ let text = parseText(payload.text);
if (!text) {
// lets not send objects or empty text, yea?
@@ -38,11 +38,15 @@ export async function run(core, server, socket, payload) {
}, socket);
}
+ if (!text.startsWith("'")) {
+ text = ` ${text}`;
+ }
+
const newPayload = {
cmd: 'info',
type: 'emote',
nick: socket.nick,
- text: `@${socket.nick} ${text}`,
+ text: `@${socket.nick}${text}`,
};
if (socket.trip) {
newPayload.trip = socket.trip;