diff --git a/client/client.js b/client/client.js index 1238e56..682a28e 100644 --- a/client/client.js +++ b/client/client.js @@ -368,6 +368,11 @@ var COMMANDS = { info: function (args) { args.nick = '*'; pushMessage(args); + }, + + emote: function (args) { + args.nick = '*'; + pushMessage(args); }, warn: function (args) { diff --git a/server/src/commands/admin/addmod.js b/server/src/commands/admin/addmod.js index db645fe..0f443eb 100644 --- a/server/src/commands/admin/addmod.js +++ b/server/src/commands/admin/addmod.js @@ -28,6 +28,7 @@ export async function run({ server.send({ cmd: 'info', text: 'You are now a mod.', + channel: newMod[i].channel, // @todo Multichannel }, newMod[i]); } } @@ -36,12 +37,14 @@ export async function run({ server.reply({ cmd: 'info', text: `Added mod trip: ${payload.trip}, remember to run 'saveconfig' to make it permanent`, + channel: socket.channel, // @todo Multichannel }, socket); // notify all mods server.broadcast({ cmd: 'info', text: `Added mod: ${payload.trip}`, + channel: false, // @todo Multichannel, false for global info }, { level: UAC.isModerator }); return true; diff --git a/server/src/commands/admin/listusers.js b/server/src/commands/admin/listusers.js index b7f8d7c..ba5908a 100644 --- a/server/src/commands/admin/listusers.js +++ b/server/src/commands/admin/listusers.js @@ -42,6 +42,7 @@ export async function run({ server, socket }) { server.reply({ cmd: 'info', text: lines.join('\n'), + channel: socket.channel, // @todo Multichannel }, socket); return true; diff --git a/server/src/commands/admin/reload.js b/server/src/commands/admin/reload.js index e39fe6f..83488e5 100644 --- a/server/src/commands/admin/reload.js +++ b/server/src/commands/admin/reload.js @@ -36,6 +36,7 @@ export async function run({ server.broadcast({ cmd: 'info', text: loadResult, + channel: false, // @todo Multichannel, false for global }, { level: UAC.isModerator }); return true; diff --git a/server/src/commands/admin/removemod.js b/server/src/commands/admin/removemod.js index 1fff3b0..96ae439 100644 --- a/server/src/commands/admin/removemod.js +++ b/server/src/commands/admin/removemod.js @@ -29,6 +29,7 @@ export async function run({ server.send({ cmd: 'info', text: 'You are now a user.', + channel: targetMod[i].channel, // @todo Multichannel }, targetMod[i]); } } @@ -39,12 +40,14 @@ export async function run({ text: `Removed mod trip: ${ payload.trip }, remember to run 'saveconfig' to make it permanent`, + channel: socket.channel, // @todo Multichannel }, socket); // notify all mods server.broadcast({ cmd: 'info', text: `Removed mod: ${payload.trip}`, + channel: false, // @todo Multichannel, false for global }, { level: UAC.isModerator }); return true; diff --git a/server/src/commands/admin/saveconfig.js b/server/src/commands/admin/saveconfig.js index bc01270..2ad8a6e 100644 --- a/server/src/commands/admin/saveconfig.js +++ b/server/src/commands/admin/saveconfig.js @@ -16,6 +16,7 @@ export async function run({ core, server, socket }) { return server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'Failed to save config, check logs.', + channel: socket.channel, // @todo Multichannel }, socket); } @@ -23,6 +24,7 @@ export async function run({ core, server, socket }) { server.broadcast({ cmd: 'info', text: 'Config saved!', + channel: false, // @todo Multichannel }, { level: UAC.isModerator }); return true; diff --git a/server/src/commands/admin/shout.js b/server/src/commands/admin/shout.js index 27002fc..bd3b10d 100644 --- a/server/src/commands/admin/shout.js +++ b/server/src/commands/admin/shout.js @@ -15,6 +15,7 @@ export async function run({ server, socket, payload }) { server.broadcast({ cmd: 'info', text: `Server Notice: ${payload.text}`, + channel: false, // @todo Multichannel, false for global }, {}); return true; diff --git a/server/src/commands/core/changenick.js b/server/src/commands/core/changenick.js index e520aba..2dc55bd 100644 --- a/server/src/commands/core/changenick.js +++ b/server/src/commands/core/changenick.js @@ -14,6 +14,7 @@ export async function run({ return server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'You are changing nicknames too fast. Wait a moment before trying again.', + channel: socket.channel, // @todo Multichannel }, socket); } @@ -30,6 +31,7 @@ export async function run({ return server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'Nickname must consist of up to 24 letters, numbers, and underscores', + channel: socket.channel, // @todo Multichannel }, socket); } @@ -41,6 +43,7 @@ export async function run({ return server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'You are not the admin, liar!', + channel: socket.channel, // @todo Multichannel }, socket); } @@ -48,6 +51,7 @@ export async function run({ return server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'You already have that name', + channel: socket.channel, // @todo Multichannel }, socket); } @@ -65,6 +69,7 @@ export async function run({ return server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'Nickname taken', + channel: socket.channel, // @todo Multichannel }, socket); } @@ -74,6 +79,7 @@ export async function run({ const leaveNotice = { cmd: 'onlineRemove', nick: socket.nick, + channel: socket.channel, // @todo Multichannel }; const joinNotice = { @@ -81,6 +87,7 @@ export async function run({ nick: newNick, trip: socket.trip || 'null', hash: socket.hash, + channel: socket.channel, // @todo Multichannel }; // broadcast remove event and join event with new name, this is to support legacy clients and bots @@ -91,6 +98,7 @@ export async function run({ server.broadcast({ cmd: 'info', text: `${socket.nick} is now ${newNick}`, + channel: socket.channel, // @todo Multichannel }, { channel: socket.channel }); // commit change to nickname @@ -120,6 +128,7 @@ export function nickCheck({ server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'Refer to `/help nick` for instructions on how to use this command.', + channel: socket.channel, // @todo Multichannel }, socket); return false; diff --git a/server/src/commands/core/chat.js b/server/src/commands/core/chat.js index f8998a5..579d7d5 100644 --- a/server/src/commands/core/chat.js +++ b/server/src/commands/core/chat.js @@ -39,6 +39,7 @@ export async function run({ return server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'You are sending too much text. Wait a moment and try again.\nPress the up arrow key to restore your last message.', + channel: socket.channel, // @todo Multichannel }, socket); } @@ -88,6 +89,7 @@ export function commandCheckIn({ server, socket, payload }) { server.reply({ cmd: 'info', text: `Your hash: ${socket.hash}`, + channel: socket.channel, // @todo Multichannel }, socket); return false; @@ -114,6 +116,7 @@ export function finalCmdCheck({ server, socket, payload }) { server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: `Unknown command: ${payload.text}`, + channel: socket.channel, // @todo Multichannel }, socket); return false; diff --git a/server/src/commands/core/emote.js b/server/src/commands/core/emote.js index 3e5b781..da64596 100644 --- a/server/src/commands/core/emote.js +++ b/server/src/commands/core/emote.js @@ -35,6 +35,7 @@ export async function run({ server, socket, payload }) { return server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'You are sending too much text. Wait a moment and try again.\nPress the up arrow key to restore your last message.', + channel: socket.channel, // @todo Multichannel }, socket); } @@ -47,6 +48,7 @@ export async function run({ server, socket, payload }) { nick: socket.nick, userid: socket.userid, text: `@${socket.nick}${text}`, + channel: socket.channel, // @todo Multichannel }; if (socket.trip) { @@ -80,6 +82,7 @@ export function emoteCheck({ server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'Refer to `/help emote` for instructions on how to use this command.', + channel: socket.channel, // @todo Multichannel }, socket); return false; diff --git a/server/src/commands/core/help.js b/server/src/commands/core/help.js index faebd14..ad03ff3 100644 --- a/server/src/commands/core/help.js +++ b/server/src/commands/core/help.js @@ -11,6 +11,7 @@ export async function run({ return server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'You are sending too much text. Wait a moment and try again.\nPress the up arrow key to restore your last message.', + channel: socket.channel, // @todo Multichannel }, socket); } @@ -54,6 +55,7 @@ export async function run({ server.reply({ cmd: 'info', text: reply, + channel: socket.channel, // @todo Multichannel }, socket); return true; diff --git a/server/src/commands/core/invite.js b/server/src/commands/core/invite.js index 14fcb74..9fab2ed 100644 --- a/server/src/commands/core/invite.js +++ b/server/src/commands/core/invite.js @@ -36,6 +36,7 @@ export async function run({ cmd: 'warn', text: 'You are sending invites too fast. Wait a moment before trying again.', id: Errors.Invite.RATELIMIT, + channel: socket.channel, // @todo Multichannel }, socket); } @@ -59,6 +60,7 @@ export async function run({ cmd: 'warn', text: 'Could not find user in that channel', id: Errors.Global.UNKNOWN_USER, + channel: socket.channel, // @todo Multichannel }, socket); } diff --git a/server/src/commands/core/join.js b/server/src/commands/core/join.js index 037eb6c..8174a67 100644 --- a/server/src/commands/core/join.js +++ b/server/src/commands/core/join.js @@ -29,6 +29,7 @@ export async function run({ cmd: 'warn', text: 'You are joining channels too fast. Wait a moment and try again.', id: Errors.Join.RATELIMIT, + channel: false, // @todo Multichannel, false for global event }, socket); } @@ -47,6 +48,7 @@ export async function run({ cmd: 'warn', text: 'You may not join that channel.', id: mayJoin, + channel: false, // @todo Multichannel, false for global event }, socket); } @@ -57,6 +59,7 @@ export async function run({ cmd: 'warn', // @todo Remove this text: 'Joining more than one channel is not currently supported', id: Errors.Join.ALREADY_JOINED, + channel: false, // @todo Multichannel, false for global event }, socket); } // end todo @@ -68,6 +71,7 @@ export async function run({ cmd: 'warn', text: 'Nickname must consist of up to 24 letters, numbers, and underscores', id: Errors.Join.INVALID_NICK, + channel: false, // @todo Multichannel, false for global event }, socket); } @@ -103,6 +107,7 @@ export async function run({ cmd: 'warn', text: 'Nickname taken', id: Errors.Join.NAME_TAKEN, + channel: false, // @todo Multichannel, false for global event }, socket); } @@ -146,6 +151,7 @@ export async function run({ cmd: 'onlineSet', nicks, /* @legacy */ users, + channel, // @todo Multichannel (?) }, socket); // stats are fun diff --git a/server/src/commands/core/morestats.js b/server/src/commands/core/morestats.js index e84a309..f2a9612 100644 --- a/server/src/commands/core/morestats.js +++ b/server/src/commands/core/morestats.js @@ -51,6 +51,7 @@ export async function run({ core, server, socket }) { users-kicked: ${(core.stats.get('users-kicked') || 0)} stats-requested: ${(core.stats.get('stats-requested') || 0)} server-uptime: ${formatTime(process.hrtime(core.stats.get('start-time')))}`, + channel: socket.channel, // @todo Multichannel }, socket); // stats are fun diff --git a/server/src/commands/core/move.js b/server/src/commands/core/move.js index a0ff8e1..8de0a71 100644 --- a/server/src/commands/core/move.js +++ b/server/src/commands/core/move.js @@ -10,6 +10,7 @@ export async function run({ server, socket, payload }) { return server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'You are changing channels too fast. Wait a moment before trying again.', + channel: socket.channel, // @todo Multichannel }, socket); } @@ -22,6 +23,7 @@ export async function run({ server, socket, payload }) { return server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'Cannot move to an empty channel.', + channel: socket.channel, // @todo Multichannel }, socket); } @@ -50,12 +52,14 @@ export async function run({ server, socket, payload }) { server.reply({ cmd: 'onlineRemove', nick: peerList[i].nick, + channel: socket.channel, // @todo Multichannel }, socket); if (socket.nick !== peerList[i].nick) { server.reply({ cmd: 'onlineRemove', nick: socket.nick, + channel: socket.channel, // @todo Multichannel }, peerList[i]); } } @@ -83,6 +87,7 @@ export async function run({ server, socket, payload }) { server.reply({ cmd: 'onlineSet', nicks, + channel: socket.channel, // @todo Multichannel (!) }, socket); // commit change @@ -111,6 +116,7 @@ export function moveCheck({ server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'Refer to `/help move` for instructions on how to use this command.', + channel: socket.channel, // @todo Multichannel }, socket); return false; diff --git a/server/src/commands/core/stats.js b/server/src/commands/core/stats.js index 76bbc98..e3e58fa 100644 --- a/server/src/commands/core/stats.js +++ b/server/src/commands/core/stats.js @@ -25,6 +25,7 @@ export async function run({ core, server, socket }) { server.reply({ cmd: 'info', text: `${uniqueClientCount} unique IPs in ${uniqueChannels} channels`, + channel: socket.channel, // @todo Multichannel }, socket); // stats are fun diff --git a/server/src/commands/core/whisper.js b/server/src/commands/core/whisper.js index fe9ead6..6105ede 100644 --- a/server/src/commands/core/whisper.js +++ b/server/src/commands/core/whisper.js @@ -40,6 +40,7 @@ export async function run({ server, socket, payload }) { return server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'You are sending too much text. Wait a moment and try again.\nPress the up arrow key to restore your last message.', + channel: socket.channel, // @todo Multichannel }, socket); } @@ -55,6 +56,7 @@ export async function run({ server, socket, payload }) { return server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'Could not find user in channel', + channel: socket.channel, // @todo Multichannel }, socket); } @@ -66,6 +68,7 @@ export async function run({ server, socket, payload }) { from: socket.nick, trip: socket.trip || 'null', text: `${socket.nick} whispered: ${text}`, + channel: socket.channel, // @todo Multichannel }, targetClient); targetClient.whisperReply = socket.nick; @@ -74,6 +77,7 @@ export async function run({ server, socket, payload }) { cmd: 'info', type: 'whisper', text: `You whispered to @${targetNick}: ${text}`, + channel: socket.channel, // @todo Multichannel }, socket); return true; @@ -100,6 +104,7 @@ export function whisperCheck({ server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'Refer to `/help whisper` for instructions on how to use this command.', + channel: socket.channel, // @todo Multichannel }, socket); return false; @@ -128,6 +133,7 @@ export function whisperCheck({ server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'Cannot reply to nobody', + channel: socket.channel, // @todo Multichannel }, socket); return false; diff --git a/server/src/commands/internal/disconnect.js b/server/src/commands/internal/disconnect.js index 27280da..69bb061 100644 --- a/server/src/commands/internal/disconnect.js +++ b/server/src/commands/internal/disconnect.js @@ -16,6 +16,7 @@ export async function run({ server, socket, payload }) { cmd: 'onlineRemove', userid: socket.userid, nick: socket.nick, /* @legacy */ + channel: socket.channel, // @todo Multichannel }, { channel: socket.channel }); } diff --git a/server/src/commands/internal/socketreply.js b/server/src/commands/internal/socketreply.js index 9c7ddc8..22fa5ba 100644 --- a/server/src/commands/internal/socketreply.js +++ b/server/src/commands/internal/socketreply.js @@ -13,6 +13,7 @@ export async function run({ server, socket, payload }) { server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: payload.text, + channel: socket.channel || false, // @todo Multichannel }, socket); return true; diff --git a/server/src/commands/mod/ban.js b/server/src/commands/mod/ban.js index 8d6721d..2db87cd 100644 --- a/server/src/commands/mod/ban.js +++ b/server/src/commands/mod/ban.js @@ -38,6 +38,7 @@ export async function run({ cmd: 'warn', text: 'Could not find user in that channel', id: Errors.Global.UNKNOWN_USER, + channel: socket.channel, // @todo Multichannel }, socket); } const targetNick = targetUser.nick; @@ -48,6 +49,7 @@ export async function run({ cmd: 'warn', text: 'Cannot ban other users of the same level, how rude', id: Errors.Global.PERMISSION, + channel: socket.channel, // @todo Multichannel }, socket); } @@ -61,13 +63,15 @@ export async function run({ cmd: 'info', text: `Banned ${targetNick}`, user: UAC.getUserDetails(targetUser), + channel: socket.channel, // @todo Multichannel }, { channel: socket.channel, level: (level) => level < UAC.levels.moderator }); // notify mods server.broadcast({ cmd: 'info', text: `${socket.nick}#${socket.trip} banned ${targetNick} in ${payload.channel}, userhash: ${targetUser.hash}`, - channel: payload.channel, + channel: socket.channel, // @todo Multichannel + inChannel: payload.channel, user: UAC.getUserDetails(targetUser), banner: UAC.getUserDetails(socket), }, { level: UAC.isModerator }); diff --git a/server/src/commands/mod/dumb.js b/server/src/commands/mod/dumb.js index a10d1cb..558f02e 100644 --- a/server/src/commands/mod/dumb.js +++ b/server/src/commands/mod/dumb.js @@ -48,6 +48,7 @@ export async function run({ cmd: 'warn', text: 'Could not find user in that channel', id: Errors.Global.UNKNOWN_USER, + channel: socket.channel, // @todo Multichannel }, socket); } @@ -57,6 +58,7 @@ export async function run({ cmd: 'warn', text: 'This trick wont work on users of the same level', id: Errors.Global.PERMISSION, + channel: socket.channel, // @todo Multichannel }, socket); } @@ -74,6 +76,7 @@ export async function run({ server.broadcast({ cmd: 'info', text: `${socket.nick}#${socket.trip} muzzled ${targetUser.nick} in ${payload.channel}, userhash: ${targetUser.hash}`, + channel: false, // @todo Multichannel, false for global }, { level: UAC.isModerator }); return true; @@ -100,6 +103,7 @@ export function chatCheck({ cmd: 'chat', nick: socket.nick, text: payload.text, + channel: socket.channel, // @todo Multichannel }; if (socket.trip) { @@ -142,6 +146,7 @@ export function inviteCheck({ core, socket, payload }) { server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: nickValid, + channel: socket.channel, // @todo Multichannel }, socket); return false; } @@ -177,6 +182,7 @@ export function whisperCheck({ cmd: 'info', type: 'whisper', text: `You whispered to @${targetNick}: ${payload.text}`, + channel: socket.channel, // @todo Multichannel }, socket); // blanket "spam" protection, may expose the ratelimiting lines from diff --git a/server/src/commands/mod/kick.js b/server/src/commands/mod/kick.js index 3f93cd6..6dc58ea 100644 --- a/server/src/commands/mod/kick.js +++ b/server/src/commands/mod/kick.js @@ -44,6 +44,7 @@ export async function run({ cmd: 'warn', text: 'Could not find user(s) in that channel', id: Errors.Global.UNKNOWN_USER, + channel: socket.channel, // @todo Multichannel }, socket); } @@ -55,6 +56,7 @@ export async function run({ cmd: 'warn', text: 'Cannot kick other users with the same level, how rude', id: Errors.Global.PERMISSION, + channel: socket.channel, // @todo Multichannel }, socket); } else { kicked.push(badClients[i]); @@ -95,6 +97,7 @@ export async function run({ server.broadcast({ cmd: 'info', text: `${kicked[i].nick} was banished to ?${destChannel}`, + channel: socket.channel, // @todo Multichannel }, { channel: socket.channel, level: UAC.isModerator }); console.log(`${socket.nick} [${socket.trip}] kicked ${kicked[i].nick} in ${socket.channel} to ${destChannel} `); @@ -106,6 +109,7 @@ export async function run({ cmd: 'onlineRemove', userid: kicked[i].userid, nick: kicked[i].nick, + channel: socket.channel, // @todo Multichannel }, { channel: socket.channel }); } @@ -113,6 +117,7 @@ export async function run({ server.broadcast({ cmd: 'info', text: `Kicked ${kicked.map((k) => k.nick).join(', ')}`, + channel: socket.channel, // @todo Multichannel }, { channel: socket.channel, level: (level) => level < UAC.levels.moderator }); // stats are fun diff --git a/server/src/commands/mod/moveuser.js b/server/src/commands/mod/moveuser.js index 7c248b6..eb17cf8 100644 --- a/server/src/commands/mod/moveuser.js +++ b/server/src/commands/mod/moveuser.js @@ -28,6 +28,7 @@ export async function run({ server, socket, payload }) { return server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'Could not find user in channel', + channel: socket.channel, // @todo Multichannel }, socket); } @@ -37,6 +38,7 @@ export async function run({ server, socket, payload }) { return server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: 'Cannot move other users of the same level, how rude', + channel: socket.channel, // @todo Multichannel }, socket); } @@ -58,12 +60,14 @@ export async function run({ server, socket, payload }) { server.reply({ cmd: 'onlineRemove', nick: peerList[i].nick, + channel: socket.channel, // @todo Multichannel }, badClient); if (badClient.nick !== peerList[i].nick) { server.reply({ cmd: 'onlineRemove', nick: badClient.nick, + channel: socket.channel, // @todo Multichannel }, peerList[i]); } } @@ -89,6 +93,7 @@ export async function run({ server, socket, payload }) { server.reply({ cmd: 'onlineSet', nicks, + channel: socket.channel, // @todo Multichannel (!) }, badClient); badClient.channel = payload.channel; @@ -96,6 +101,7 @@ export async function run({ server, socket, payload }) { server.broadcast({ cmd: 'info', text: `${badClient.nick} was moved into ?${payload.channel}`, + channel: socket.channel, // @todo Multichannel }, { channel: payload.channel }); return true; diff --git a/server/src/commands/mod/speak.js b/server/src/commands/mod/speak.js index 35dcde3..a197d01 100644 --- a/server/src/commands/mod/speak.js +++ b/server/src/commands/mod/speak.js @@ -28,6 +28,7 @@ export async function run({ return server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: "hash:'targethash' or ip:'1.2.3.4' is required", + channel: socket.channel, // @todo Multichannel }, socket); } @@ -38,6 +39,7 @@ export async function run({ return server.broadcast({ cmd: 'info', text: `${socket.nick} unmuzzled all users`, + channel: false, // @todo Multichannel, false for global }, { level: UAC.isModerator }); } } else if (payload.hash === '*') { @@ -46,6 +48,7 @@ export async function run({ return server.broadcast({ cmd: 'info', text: `${socket.nick} unmuzzled all users`, + channel: false, // @todo Multichannel, false for global }, { level: UAC.isModerator }); } @@ -63,6 +66,7 @@ export async function run({ server.broadcast({ cmd: 'info', text: `${socket.nick}#${socket.trip} unmuzzled : ${target}`, + channel: false, // @todo Multichannel, false for global }, { level: UAC.isModerator }); return true; diff --git a/server/src/commands/mod/unban.js b/server/src/commands/mod/unban.js index e8dc042..a13dea3 100644 --- a/server/src/commands/mod/unban.js +++ b/server/src/commands/mod/unban.js @@ -20,6 +20,7 @@ export async function run({ return server.reply({ cmd: 'warn', // @todo Add numeric error code as `id` text: "hash:'targethash' or ip:'1.2.3.4' is required", + channel: socket.channel, // @todo Multichannel }, socket); } @@ -47,12 +48,14 @@ export async function run({ server.reply({ cmd: 'info', text: `Unbanned ${target}`, + channel: socket.channel, // @todo Multichannel }, socket); // notify mods server.broadcast({ cmd: 'info', text: `${socket.nick}#${socket.trip} unbanned: ${target}`, + channel: false, // @todo Multichannel, false for global }, { level: UAC.isModerator }); // stats are fun diff --git a/server/src/commands/mod/unbanall.js b/server/src/commands/mod/unbanall.js index b43685a..3d37efd 100644 --- a/server/src/commands/mod/unbanall.js +++ b/server/src/commands/mod/unbanall.js @@ -24,12 +24,14 @@ export async function run({ core, server, socket }) { server.reply({ cmd: 'info', text: 'Unbanned all ip addresses', + channel: socket.channel, // @todo Multichannel }, socket); // notify mods server.broadcast({ cmd: 'info', text: `${socket.nick}#${socket.trip} unbanned all ip addresses`, + channel: false, // @todo Multichannel, false for global }, { level: UAC.isModerator }); return true; diff --git a/server/src/commands/utility/_LegacyFunctions.js b/server/src/commands/utility/_LegacyFunctions.js index 2b436ca..4553a48 100644 --- a/server/src/commands/utility/_LegacyFunctions.js +++ b/server/src/commands/utility/_LegacyFunctions.js @@ -67,6 +67,7 @@ export function legacyInviteOut(payload, nick) { type: 'invite', from: nick, text: `${nick} invited you to ?${payload.inviteChannel}`, + channel: payload.channel, // @todo Multichannel }, }; } @@ -85,6 +86,7 @@ export function legacyInviteReply(payload, nick) { type: 'invite', from: '', text: `You invited ${nick} to ?${payload.inviteChannel}`, + channel: payload.channel, // @todo Multichannel }, }; }