Refactor push notifications test; Prevent push notification from being sent when buying gems for yourself as a gift

This commit is contained in:
Blade Barringer
2015-05-12 20:18:06 -05:00
parent 9a84503aed
commit 8a4abc632f
2 changed files with 51 additions and 27 deletions
+4 -2
View File
@@ -136,7 +136,9 @@ exports.buyGems = function(data, cb) {
]);
}
pushNotify.sendNotify(data.gift.member, shared.i18n.t('giftedGems'), gemAmount + ' Gems - by '+byUsername);
if (data.gift.member._id != data.user._id) { // Only send push notifications if sending to a user other than yourself
pushNotify.sendNotify(data.gift.member, shared.i18n.t('giftedGems'), gemAmount + ' Gems - by '+byUsername);
}
}
async.parallel([
function(cb2){data.user.save(cb2)},
@@ -164,4 +166,4 @@ exports.paypalCheckoutSuccess = paypal.executePayment;
exports.paypalIPN = paypal.ipn;
exports.iapAndroidVerify = iap.androidVerify;
exports.iapIosVerify = iap.iosVerify;
exports.iapIosVerify = iap.iosVerify;