mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-23 14:17:05 +00:00
FIX: Quest Invitation Notification
ADD: Quest Started Notification
This commit is contained in:
parent
ca31b490e6
commit
264a1e4b16
1 changed files with 10 additions and 6 deletions
|
|
@ -837,7 +837,11 @@ questStart = function(req, res, next) {
|
|||
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;
|
||||
if (quest.boss) {
|
||||
|
|
@ -913,10 +917,6 @@ api.questAccept = function(req, res, next) {
|
|||
group.quest.leader = user._id;
|
||||
} else {
|
||||
group.quest.members[m] = undefined;
|
||||
|
||||
User.findById(m, function(err,groupMember){
|
||||
pushNotify.sendNotify(groupMember, shared.i18n.t('questInvitationTitle'), shared.i18n.t('questInvitationInfo', { quest: quest.text() }));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -924,7 +924,7 @@ api.questAccept = function(req, res, next) {
|
|||
_id: {
|
||||
$in: _.without(group.members, user._id)
|
||||
}
|
||||
}, {auth: 1, preferences: 1, profile: 1}, function(err, members){
|
||||
}, {auth: 1, preferences: 1, profile: 1, pushDevices: 1}, function(err, members){
|
||||
if(err) return next(err);
|
||||
|
||||
var inviterVars = utils.getUserInfo(user, ['name', 'email']);
|
||||
|
|
@ -940,6 +940,10 @@ api.questAccept = function(req, res, next) {
|
|||
{name: 'PARTY_URL', content: '/#/options/groups/party'}
|
||||
]);
|
||||
|
||||
_.each(members, function(groupMember){
|
||||
pushNotify.sendNotify(groupMember, shared.i18n.t('questInvitationTitle'), shared.i18n.t('questInvitationInfo', { quest: quest.text() }));
|
||||
});
|
||||
|
||||
questStart(req,res,next);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue