Fix #232: Do not store messages in memory when running in public mode
This commit is contained in:
parent
2f1eec32b3
commit
148be767bb
@ -26,16 +26,22 @@ function Chan(attr) {
|
||||
}
|
||||
|
||||
Chan.prototype.pushMessage = function(client, msg) {
|
||||
client.emit("msg", {
|
||||
chan: this.id,
|
||||
msg: msg
|
||||
});
|
||||
|
||||
// Never store messages in public mode as the session
|
||||
// is completely destroyed when the page gets closed
|
||||
if (config.public) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.messages.push(msg);
|
||||
|
||||
if (config.maxHistory >= 0 && this.messages.length > config.maxHistory) {
|
||||
this.messages.splice(0, this.messages.length - config.maxHistory);
|
||||
}
|
||||
|
||||
client.emit("msg", {
|
||||
chan: this.id,
|
||||
msg: msg
|
||||
});
|
||||
};
|
||||
|
||||
Chan.prototype.sortUsers = function(irc) {
|
||||
|
Loading…
Reference in New Issue
Block a user