Make sure all joins send filtered clone

This commit is contained in:
Pavel Djundik 2017-12-03 16:29:50 +02:00
parent fe1c7612f5
commit 5fc70397a9
7 changed files with 8 additions and 6 deletions

View File

@ -47,6 +47,6 @@ exports.input = function(network, chan, cmd, args) {
network.channels.push(newChan);
this.emit("join", {
network: network.id,
chan: newChan,
chan: newChan.getFilteredClone(true),
});
};

View File

@ -29,7 +29,7 @@ module.exports = function(irc, network) {
network.channels.push(chan);
client.emit("join", {
network: network.id,
chan: chan,
chan: chan.getFilteredClone(true),
});
}

View File

@ -18,7 +18,7 @@ module.exports = function(irc, network) {
client.save();
client.emit("join", {
network: network.id,
chan: chan,
chan: chan.getFilteredClone(true),
});
// Request channels' modes

View File

@ -49,7 +49,7 @@ module.exports = function(irc, network) {
network.channels.push(chan);
client.emit("join", {
network: network.id,
chan: chan,
chan: chan.getFilteredClone(true),
});
}

View File

@ -68,7 +68,7 @@ module.exports = function(irc, network) {
network.channels.push(chan);
client.emit("join", {
network: network.id,
chan: chan,
chan: chan.getFilteredClone(true),
});
}
}

View File

@ -17,7 +17,7 @@ module.exports = function(irc, network) {
client.emit("join", {
shouldOpen: true,
network: network.id,
chan: chan,
chan: chan.getFilteredClone(true),
});
}

View File

@ -208,6 +208,8 @@ describe("Chan", function() {
expect(messages).to.have.lengthOf(4);
expect(messages[0].id).to.equal(10);
expect(messages[3].id).to.equal(13);
expect(chan.getFilteredClone(true).messages).to.have.lengthOf(4);
});
it("should only send new messages", function() {