mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-13 23:42:12 +00:00
feat(chat): allow banning problem users from chat rooms
This commit is contained in:
parent
96c9c7f101
commit
af74ff9da0
2 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue