Skip to content
Snippets Groups Projects
Commit 54e86bf0 authored by echicken's avatar echicken
Browse files

Fixed forwarding / display of some message types (join/part type things).

Should rework how this filtering stuff is organized at some point.
parent ba0db87a
No related branches found
No related tags found
No related merge requests found
......@@ -139,6 +139,7 @@ function client_accept() {
// Forward a message to all applicable clients
function client_send(message, username) {
Object.keys(clients).forEach(function (e) {
if (message.to_user == 'NOTME' && message.from_user == clients[e].username) return;
if (!username || clients[e].username == username) {
log(LOG_DEBUG, 'Forwarding message to ' + clients[e].username);
clients[e].socket.sendline(JSON.stringify(message));
......@@ -209,7 +210,7 @@ function mrc_receive(sock) {
return;
}
if (['', 'ALL', FROM_SITE].indexOf(message.to_site) > -1) {
if (['', 'CLIENT', 'ALL'].indexOf(message.to_site) > -1) {
if (['', 'CLIENT', 'ALL', 'NOTME'].indexOf(message.to_user) > -1) {
// Forward to all clients
client_send(message);
} else {
......
......@@ -99,6 +99,7 @@ function MRC_Session(host, port, user, pass, alias) {
} else if (msg.body.search(/just joined room/) > -1) {
send_command('USERLIST', 'ALL');
}
emit('message', msg);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment