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() {