diff --git a/website/src/models/group.js b/website/src/models/group.js index 7ba8dac173..b699164c73 100644 --- a/website/src/models/group.js +++ b/website/src/models/group.js @@ -154,6 +154,9 @@ var chatDefaults = module.exports.chatDefaults = function(msg,user){ } return message; } + +var NO_CHAT_NOTIFICATIONS = ['habitrpg', '5481ccf3-5d2d-48a9-a871-70a7380cee5a'] + GroupSchema.methods.sendChat = function(message, user){ var group = this; group.chat.unshift(chatDefaults(message,user)); @@ -161,7 +164,7 @@ GroupSchema.methods.sendChat = function(message, user){ // Kick off chat notifications in the background. var lastSeenUpdate = {$set:{}, $inc:{_v:1}}; lastSeenUpdate['$set']['newMessages.'+group._id] = {name:group.name,value:true}; - if (group._id == 'habitrpg') { + if (NO_CHAT_NOTIFICATIONS.indexOf(group._id) !== -1) { // TODO For Tavern, only notify them if their name was mentioned // var profileNames = [] // get usernames from regex of @xyz. how to handle space-delimited profile names? // User.update({'profile.name':{$in:profileNames}},lastSeenUpdate,{multi:true}).exec();