feat(chat): allow banning problem users from chat rooms

This commit is contained in:
Tyler Renelle 2014-05-14 16:01:39 -06:00
parent 96c9c7f101
commit af74ff9da0
2 changed files with 3 additions and 1 deletions

View file

@ -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;

View file

@ -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