lengthed chat buffer for mod channel to 1000

This commit is contained in:
rainbow napkin 2022-01-09 22:13:14 +00:00
parent c99fda5da2
commit cb8945b8ef
8 changed files with 136 additions and 16 deletions

View file

@ -15,8 +15,8 @@ AnonymousCheck.prototype.onUserPreJoin = function (user, data, cb) {
return cb("User disconnected", ChannelModule.DENY);
}
//if(anonymousBanned && user.isAnonymous()) {
if(anonymousBanned && user.account.globalRank <= 0) {
if(anonymousBanned && user.isAnonymous()) {
//if(anonymousBanned && user.account.globalRank <= 0) {
user.socket.on("disconnect", function () {
if (!user.is(Flags.U_IN_CHANNEL)) {
cb("User disconnected", ChannelModule.DENY);

View file

@ -437,8 +437,12 @@ ChatModule.prototype.sendMessage = function (msgobj) {
this.channel.broadcastAll("chatMsg", msgobj);
this.dirty = true;
this.buffer.push(msgobj);
if (this.buffer.length > 15) {
this.buffer.push(msgobj);//msg buffer push, trims it down to 15 messages
if (this.channel.uniqueName === "mods"){
if(this.buffer.length > 500){//make mods channel an exception :) Eventually this will be a setting per channel you can set from the web ui
this.buffer.shift();
}
}else if (this.buffer.length > 15) {
this.buffer.shift();
}