diff --git a/imports/modules/server/notificationsProcess.js b/imports/modules/server/notificationsProcess.js index e78f426..657aa2a 100644 --- a/imports/modules/server/notificationsProcess.js +++ b/imports/modules/server/notificationsProcess.js @@ -43,7 +43,18 @@ function imgUrl(lat, lng) { return ``; } */ +// Cutover flag (fase 1a): channels listed in +// Meteor.settings.private.notifDisabledChannels (e.g. ['mobile','web']) are +// handled by the tcef-notifications microservice, so the old observer/cron must +// NOT send them. Mutual exclusion per channel — reversible by editing settings, +// no code deploy needed. ES5-compatible on purpose (Meteor 1.6 / Node 8). +const notifDisabledChannels = (Meteor.settings.private && Meteor.settings.private.notifDisabledChannels) || []; + const processNotif = (notif) => { + if (notifDisabledChannels.indexOf(notif.type) !== -1) { + // This channel was migrated to tcef-notifications; do nothing here. + return; + } if (isMailServerMaster && validFcmSender && notif.type === 'mobile' && notif.notified !== true) { const fcmSender = new gcm.Sender(Meteor.settings.private.fcmApiToken); const user = Meteor.users.findOne({ _id: notif.userId });