mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 01:55:38 -05:00
Removed watcher emails for overloaded watchers.
This commit is contained in:
parent
1ab8274c43
commit
dec201ad22
1 changed files with 2 additions and 3 deletions
|
@ -447,7 +447,8 @@ module.exports = class Handler
|
|||
docLink = "http://codecombat.com#{editPath}"
|
||||
@sendChangedHipChatMessage creator: editor, target: changedDocument, docLink: docLink
|
||||
watchers = changedDocument.get('watchers') or []
|
||||
watchers = (w for w in watchers when not w.equals(editor.get('_id')))
|
||||
# Don't send these emails to the person who submitted the patch, or to Nick, George, or Scott.
|
||||
watchers = (w for w in watchers when not w.equals(editor.get('_id')) and not (w + '' in ['512ef4805a67a8c507000001', '5162fab9c92b4c751e000274', '51538fdb812dd9af02000001']))
|
||||
return unless watchers.length
|
||||
User.find({_id:{$in:watchers}}).select({email:1, name:1}).exec (err, watchers) =>
|
||||
for watcher in watchers
|
||||
|
@ -477,9 +478,7 @@ module.exports = class Handler
|
|||
watchers = [req.user.get('_id')]
|
||||
if req.user.isAdmin() # https://github.com/codecombat/codecombat/issues/1105
|
||||
nick = mongoose.Types.ObjectId('512ef4805a67a8c507000001')
|
||||
scott = mongoose.Types.ObjectId('5162fab9c92b4c751e000274')
|
||||
watchers.push nick unless _.find watchers, (id) -> id.equals nick
|
||||
watchers.push scott unless _.find watchers, (id) -> id.equals scott
|
||||
model.set 'watchers', watchers
|
||||
model
|
||||
|
||||
|
|
Loading…
Reference in a new issue