mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-22 13:48:46 +00:00
Only send "Quest Started" Notifications to users which accepted the quest
This commit is contained in:
parent
264a1e4b16
commit
5612b4be6b
1 changed files with 5 additions and 4 deletions
|
|
@ -831,16 +831,17 @@ questStart = function(req, res, next) {
|
|||
updates['$set']['party.quest.progress.collect'] = collected;
|
||||
updates['$set']['party.quest.completed'] = null;
|
||||
questMembers[m] = true;
|
||||
|
||||
User.findOne({_id: m}, {pushDevices: 1}, function(err, user){
|
||||
pushNotify.sendNotify(user, "HabitRPG", shared.i18n.t('questStarted') + ": "+ quest.text() );
|
||||
});
|
||||
} else {
|
||||
updates['$set']['party.quest'] = Group.cleanQuestProgress();
|
||||
}
|
||||
|
||||
parallel.push(function(cb2){
|
||||
User.update({_id:m},updates,cb2);
|
||||
});
|
||||
|
||||
User.findOne({_id: m}, {pushDevices: 1}, function(err, user){
|
||||
pushNotify.sendNotify(user, "HabitRPG", shared.i18n.t('questStarted') + ": "+ quest.text() );
|
||||
});
|
||||
});
|
||||
|
||||
group.quest.active = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue