Refactor push notifications test; Prevent push notification from being sent when buying gems for yourself as a gift
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user