feat(chat): allow banning problem users from chat rooms
This commit is contained in:
@@ -217,6 +217,7 @@ api.getChat = function(req, res, next) {
|
||||
api.postChat = function(req, res, next) {
|
||||
var user = res.locals.user
|
||||
var group = res.locals.group;
|
||||
if (group.type!='party' && user.flags.chatRevoked) return res.json(401,{err:'Your chat privileges have been revoked.'});
|
||||
var lastClientMsg = req.query.previousMsg;
|
||||
var chatUpdated = (lastClientMsg && group.chat && group.chat[0] && group.chat[0].id !== lastClientMsg) ? true : false;
|
||||
|
||||
|
||||
+2
-1
@@ -109,7 +109,8 @@ var UserSchema = new Schema({
|
||||
mathUpdates: Boolean,
|
||||
rebirthEnabled: {type: Boolean, 'default': false},
|
||||
freeRebirth: {type: Boolean, 'default': false},
|
||||
levelDrops: {type:Schema.Types.Mixed, 'default':{}}
|
||||
levelDrops: {type:Schema.Types.Mixed, 'default':{}},
|
||||
chatRevoked: Boolean
|
||||
},
|
||||
history: {
|
||||
exp: Array, // [{date: Date, value: Number}], // big peformance issues if these are defined
|
||||
|
||||
Reference in New Issue
Block a user