Notification with Service Workers now is working!
When a Notification arrives, it save into the IndexDb, then in Vue.js call a polling to check in the db if there is a different record count. If is different then call a get to update the notification.
This commit is contained in:
@@ -35,7 +35,7 @@ const sendmsgSchema = new Schema({
|
|||||||
status: {
|
status: {
|
||||||
type: Number,
|
type: Number,
|
||||||
},
|
},
|
||||||
options: {
|
typesend: {
|
||||||
type: Number,
|
type: Number,
|
||||||
},
|
},
|
||||||
read: {
|
read: {
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ const sendNotifSchema = new Schema({
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
options: {
|
typesend: {
|
||||||
type: Number,
|
type: Number,
|
||||||
},
|
},
|
||||||
read: {
|
read: {
|
||||||
@@ -75,6 +75,12 @@ const sendNotifSchema = new Schema({
|
|||||||
extrafield: {
|
extrafield: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
|
tag: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
type: Array,
|
||||||
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -144,20 +150,26 @@ sendNotifSchema.statics.getDescrAndLinkByRecNotif = function(recnotif) {
|
|||||||
if (recnotif.typeid === shared_consts.TypeNotifs.ID_BACHECA_NEW_GOOD) {
|
if (recnotif.typeid === shared_consts.TypeNotifs.ID_BACHECA_NEW_GOOD) {
|
||||||
newdescr = i18n.__('<strong>%s</strong> new Good: %s', userorig, mydescr);
|
newdescr = i18n.__('<strong>%s</strong> new Good: %s', userorig, mydescr);
|
||||||
recnotif.openUrl = '/mygood/' + myidrec;
|
recnotif.openUrl = '/mygood/' + myidrec;
|
||||||
|
tag = 'newgood';
|
||||||
} else if (recnotif.typeid === shared_consts.TypeNotifs.ID_BACHECA_NEW_SERVICE) {
|
} else if (recnotif.typeid === shared_consts.TypeNotifs.ID_BACHECA_NEW_SERVICE) {
|
||||||
newdescr = i18n.__('<strong>%s</strong> new Service: %s', userorig, mydescr);
|
newdescr = i18n.__('<strong>%s</strong> new Service: %s', userorig, mydescr);
|
||||||
recnotif.openUrl = '/myservice/' + myidrec;
|
recnotif.openUrl = '/myservice/' + myidrec;
|
||||||
|
tag = 'newservice';
|
||||||
}
|
}
|
||||||
} else if (recnotif.typedir === shared_consts.TypeNotifs.TYPEDIR_FRIENDS) {
|
} else if (recnotif.typedir === shared_consts.TypeNotifs.TYPEDIR_FRIENDS) {
|
||||||
recnotif.openUrl = '/my/' + userorig;
|
recnotif.openUrl = '/my/' + userorig;
|
||||||
if (recnotif.typeid === shared_consts.TypeNotifs.ID_FRIENDS_NEW_REC) {
|
if (recnotif.typeid === shared_consts.TypeNotifs.ID_FRIENDS_NEW_REC) {
|
||||||
newdescr = i18n.__('<strong>%s</strong> asked you for Friendship', userorig, mydescr);
|
newdescr = i18n.__('<strong>%s</strong> asked you for Friendship', userorig, mydescr);
|
||||||
|
tag = 'newfriend';
|
||||||
} else if ((recnotif.typeid === shared_consts.TypeNotifs.ID_FRIENDS_ACCEPTED) ||
|
} else if ((recnotif.typeid === shared_consts.TypeNotifs.ID_FRIENDS_ACCEPTED) ||
|
||||||
(recnotif.typeid === shared_consts.TypeNotifs.ID_FRIENDS_ACCEPTED_MY_REQUEST)) {
|
(recnotif.typeid === shared_consts.TypeNotifs.ID_FRIENDS_ACCEPTED_MY_REQUEST)) {
|
||||||
newdescr = i18n.__('<strong>%s</strong> accepted your Friendship', userorig, mydescr);
|
newdescr = i18n.__('<strong>%s</strong> accepted your Friendship', userorig, mydescr);
|
||||||
|
tag = 'acceptedfriend';
|
||||||
} else if (recnotif.typeid === shared_consts.TypeNotifs.ID_FRIENDS_REFUSED) {
|
} else if (recnotif.typeid === shared_consts.TypeNotifs.ID_FRIENDS_REFUSED) {
|
||||||
newdescr = i18n.__('<strong>%s</strong> refused your Friendship', userorig, mydescr);
|
newdescr = i18n.__('<strong>%s</strong> refused your Friendship', userorig, mydescr);
|
||||||
|
tag = 'refusedfriend';
|
||||||
} else if (recnotif.typeid === shared_consts.TypeNotifs.ID_FRIENDS_REPORTED) {
|
} else if (recnotif.typeid === shared_consts.TypeNotifs.ID_FRIENDS_REPORTED) {
|
||||||
|
tag = 'reportuser';
|
||||||
if (recnotif.paramsObj.usernameDest === recnotif.paramsObj.username_action) {
|
if (recnotif.paramsObj.usernameDest === recnotif.paramsObj.username_action) {
|
||||||
newdescr = i18n.__('FRIEND_REPORTED_YOU', recnotif.paramsObj.username_worked);
|
newdescr = i18n.__('FRIEND_REPORTED_YOU', recnotif.paramsObj.username_worked);
|
||||||
} else if (recnotif.paramsObj.isAdmin) {
|
} else if (recnotif.paramsObj.isAdmin) {
|
||||||
@@ -167,6 +179,7 @@ sendNotifSchema.statics.getDescrAndLinkByRecNotif = function(recnotif) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (recnotif.typedir === shared_consts.TypeNotifs.TYPEDIR_GROUPS) {
|
} else if (recnotif.typedir === shared_consts.TypeNotifs.TYPEDIR_GROUPS) {
|
||||||
|
tag = 'group';
|
||||||
recnotif.openUrl = '/grp/' + recnotif.paramsObj.groupnameDest;
|
recnotif.openUrl = '/grp/' + recnotif.paramsObj.groupnameDest;
|
||||||
if (recnotif.typeid === shared_consts.TypeNotifs.ID_GROUP_NEW_REC) {
|
if (recnotif.typeid === shared_consts.TypeNotifs.ID_GROUP_NEW_REC) {
|
||||||
newdescr = i18n.__('GROUP_CREATED', userorig, recnotif.paramsObj.groupnameDest);
|
newdescr = i18n.__('GROUP_CREATED', userorig, recnotif.paramsObj.groupnameDest);
|
||||||
@@ -202,7 +215,6 @@ sendNotifSchema.statics.getDescrAndLinkByRecNotif = function(recnotif) {
|
|||||||
newdescr = i18n.__('GRUPPO_ELIMINATO', userorig, recnotif.paramsObj.username_action);
|
newdescr = i18n.__('GRUPPO_ELIMINATO', userorig, recnotif.paramsObj.username_action);
|
||||||
tag = 'deletegroup';
|
tag = 'deletegroup';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
recnotif.tag = recnotif.tag ? recnotif.tag : tag;
|
recnotif.tag = recnotif.tag ? recnotif.tag : tag;
|
||||||
@@ -274,26 +286,25 @@ sendNotifSchema.statics.saveAndSendNotif = async function(myrecnotif, req, res,
|
|||||||
if (!myrecout)
|
if (!myrecout)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (save) {
|
// console.log('myrecout._id', myrecout._id.toString());
|
||||||
await myrecout.save().then((writeresult) => {
|
|
||||||
let idobj = writeresult._id;
|
|
||||||
|
|
||||||
return SendNotif.findById(idobj).lean().then(async (recnotif) => {
|
if (save) {
|
||||||
return await globalTables.sendNotif(myrecnotif.typedir, myrecnotif.typeid, res, idapp, user ? user : req.user, recnotif).
|
await myrecout.save().then(async (res) => {
|
||||||
then((ris) => {
|
if (res) {
|
||||||
return recnotif;
|
const idobj = res._id;
|
||||||
});
|
|
||||||
});
|
const myrecread = await SendNotif.findById(idobj).lean();
|
||||||
|
// console.log('myrecread._id', myrecread._id.toString());
|
||||||
|
|
||||||
|
return await globalTables.sendNotif(myrecread.typedir, myrecread.typeid, res, idapp, user ? user : req.user, myrecread);
|
||||||
|
}
|
||||||
|
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e.message);
|
console.log(e.message);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return await globalTables.sendNotif(myrecout.typedir, myrecout.typeid, res, idapp, user ? user : req.user, myrecout).
|
return await globalTables.sendNotif(myrecout.typedir, myrecout.typeid, res, idapp, user ? user : req.user, myrecout);
|
||||||
then((ris) => {
|
|
||||||
return myrecout;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -373,7 +384,7 @@ sendNotifSchema.statics.updateStatusAndDescr = async function(myrecnotif, onlysa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
myrecnotif._id = new ObjectID();
|
// myrecnotif._id = new ObjectID();
|
||||||
if (newstatus > 0) {
|
if (newstatus > 0) {
|
||||||
myrecnotif.status = newstatus;
|
myrecnotif.status = newstatus;
|
||||||
}
|
}
|
||||||
@@ -431,7 +442,8 @@ sendNotifSchema.statics.getExtraParam = function(myrecnotif, paramsObj) {
|
|||||||
//out = myrecnotif._doc
|
//out = myrecnotif._doc
|
||||||
//}
|
//}
|
||||||
out.paramsObj = paramsObj;
|
out.paramsObj = paramsObj;
|
||||||
out.options = paramsObj.options ? paramsObj.options : 0;
|
out.options = paramsObj.options ? paramsObj.options : [];
|
||||||
|
out.typesend = paramsObj.typesend ? paramsObj.typesend : 0;
|
||||||
out.extrafield = paramsObj.groupnameDest ? paramsObj.groupnameDest : '';
|
out.extrafield = paramsObj.groupnameDest ? paramsObj.groupnameDest : '';
|
||||||
|
|
||||||
return myrecnotif;
|
return myrecnotif;
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ async function SendMsgTo(idapp, username, params) {
|
|||||||
if (arrusers !== null) {
|
if (arrusers !== null) {
|
||||||
for (const user of arrusers) {
|
for (const user of arrusers) {
|
||||||
tools.sendNotificationToUser(user._id, params.title, params.content,
|
tools.sendNotificationToUser(user._id, params.title, params.content,
|
||||||
params.openUrl, params.openUrl2, params.tag, params.actions).
|
params.openUrl, params.openUrl2, params.tag, params.actions, params.id).
|
||||||
then(ris => {
|
then(ris => {
|
||||||
if (ris) {
|
if (ris) {
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ router.post('/', authenticate, (req, res) => {
|
|||||||
|
|
||||||
recmsg.typedir = shared_consts.TypeNotifs.TYPEDIR_EVENTS;
|
recmsg.typedir = shared_consts.TypeNotifs.TYPEDIR_EVENTS;
|
||||||
recmsg.typeid = shared_consts.TypeNotifs.ID_EVENTS_REMOVE_REC;
|
recmsg.typeid = shared_consts.TypeNotifs.ID_EVENTS_REMOVE_REC;
|
||||||
return SendNotif.saveAndSendNotif(recmyevent, req, res).then((out) => {
|
return await SendNotif.saveAndSendNotif(recmyevent, req, res).then((out) => {
|
||||||
if (out)
|
if (out)
|
||||||
return res.send({ code: server_constants.RIS_CODE_OK, msg: '', id: recmsg._id });
|
return res.send({ code: server_constants.RIS_CODE_OK, msg: '', id: recmsg._id });
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -3408,7 +3408,7 @@ class Telegram {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
console.log('<<< SEND MSG: >>> ', text.substring(0, 100));
|
console.log('<<< SEND MSG TELEGRAM: >>> ', text.substring(0, 100));
|
||||||
text = text.replace(/<br>/g, '\n');
|
text = text.replace(/<br>/g, '\n');
|
||||||
text = text.replace(/<br\/>/g, '\n');
|
text = text.replace(/<br\/>/g, '\n');
|
||||||
text = text.replace(/<div>/g, '');
|
text = text.replace(/<div>/g, '');
|
||||||
|
|||||||
@@ -583,6 +583,8 @@ module.exports = {
|
|||||||
'idapp',
|
'idapp',
|
||||||
'tablerec',
|
'tablerec',
|
||||||
'extrafield',
|
'extrafield',
|
||||||
|
'tag',
|
||||||
|
'options',
|
||||||
'idrec',
|
'idrec',
|
||||||
'status'];
|
'status'];
|
||||||
},
|
},
|
||||||
@@ -744,7 +746,9 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
sendNotificationToUser: function(userId, title, content, openUrl, openUrl2, tag, actions) {
|
sendNotificationToUser: function(userId, title, content, openUrl, openUrl2, tag, actions, id) {
|
||||||
|
|
||||||
|
content = this.convertHTMLtoText(content);
|
||||||
|
|
||||||
let payload = {
|
let payload = {
|
||||||
actions,
|
actions,
|
||||||
@@ -753,6 +757,7 @@ module.exports = {
|
|||||||
url: openUrl,
|
url: openUrl,
|
||||||
url2: openUrl2,
|
url2: openUrl2,
|
||||||
tag,
|
tag,
|
||||||
|
id,
|
||||||
// ttl: req.body.ttl,
|
// ttl: req.body.ttl,
|
||||||
// icon: req.body.icon,
|
// icon: req.body.icon,
|
||||||
// image: req.body.image,
|
// image: req.body.image,
|
||||||
@@ -931,7 +936,8 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
sendNotifGroupByUsername: async function(cmd, typeid_pass, idapp, usernameOrig, usernameDest, username_action, groupname, myrecgroup, isAdmin, username_worked) {
|
sendNotifGroupByUsername: async function(
|
||||||
|
cmd, typeid_pass, idapp, usernameOrig, usernameDest, username_action, groupname, myrecgroup, isAdmin, username_worked) {
|
||||||
|
|
||||||
const {SendNotif} = require('../models/sendnotif');
|
const {SendNotif} = require('../models/sendnotif');
|
||||||
const {User} = require('../models/user');
|
const {User} = require('../models/user');
|
||||||
@@ -976,7 +982,8 @@ module.exports = {
|
|||||||
typeid = shared_consts.TypeNotifs.ID_GROUP_REQUEST_TO_ENTER;
|
typeid = shared_consts.TypeNotifs.ID_GROUP_REQUEST_TO_ENTER;
|
||||||
// paramsObj.options = MessageOptions.Notify_OnlyToNotifinApp + MessageOptions.Notify_ByBotTelegram;
|
// paramsObj.options = MessageOptions.Notify_OnlyToNotifinApp + MessageOptions.Notify_ByBotTelegram;
|
||||||
const myuserdata = await User.getUserShortDataByUsername(idapp, username_action);
|
const myuserdata = await User.getUserShortDataByUsername(idapp, username_action);
|
||||||
telegrambot.askConfirmationUser(idapp, shared_consts.CallFunz.RICHIESTA_GRUPPO, myuserdata, usernameDest, groupname, myrecgroup._id);
|
telegrambot.askConfirmationUser(idapp, shared_consts.CallFunz.RICHIESTA_GRUPPO, myuserdata, usernameDest, groupname,
|
||||||
|
myrecgroup._id);
|
||||||
onlysave = false;
|
onlysave = false;
|
||||||
} else if (cmd === shared_consts.GROUPSCMD.BLOCK_USER) {
|
} else if (cmd === shared_consts.GROUPSCMD.BLOCK_USER) {
|
||||||
typeid = shared_consts.TypeNotifs.ID_GROUP_BLOCK_USER;
|
typeid = shared_consts.TypeNotifs.ID_GROUP_BLOCK_USER;
|
||||||
@@ -1002,7 +1009,6 @@ module.exports = {
|
|||||||
const {MyGroup} = require('../models/mygroup');
|
const {MyGroup} = require('../models/mygroup');
|
||||||
const {User} = require('../models/user');
|
const {User} = require('../models/user');
|
||||||
|
|
||||||
|
|
||||||
const group = await MyGroup.findOne({idapp, groupname}, {_id: 1, admins: 1, createdBy: 1}).lean();
|
const group = await MyGroup.findOne({idapp, groupname}, {_id: 1, admins: 1, createdBy: 1}).lean();
|
||||||
if (!group)
|
if (!group)
|
||||||
return;
|
return;
|
||||||
@@ -1138,6 +1144,10 @@ module.exports = {
|
|||||||
convertHTMLtoText(myhtml) {
|
convertHTMLtoText(myhtml) {
|
||||||
let msg = myhtml;
|
let msg = myhtml;
|
||||||
msg = msg.replace('"', '"');
|
msg = msg.replace('"', '"');
|
||||||
|
msg = msg.replace(/<strong>/g, '');
|
||||||
|
msg = msg.replace(/<\/strong>/g, '');
|
||||||
|
msg = msg.replace(/<em>/g, '');
|
||||||
|
msg = msg.replace(/<\/em>/g, '');
|
||||||
msg = msg.replace('>', '>');
|
msg = msg.replace('>', '>');
|
||||||
msg = msg.replace('<', '<');
|
msg = msg.replace('<', '<');
|
||||||
msg = msg.replace('&', '&');
|
msg = msg.replace('&', '&');
|
||||||
@@ -1547,12 +1557,10 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Iscritti Conacreis
|
// Iscritti Conacreis
|
||||||
if (params.filterand.includes(shared_consts.FILTER_MISSING_PAYMENT))
|
if (params.filterand.includes(shared_consts.FILTER_REPORTED))
|
||||||
filtriadded.push({
|
filtriadded.push(
|
||||||
$or: [
|
{reported: {$exists: true, $eq: true}},
|
||||||
{ha_pagato: {$exists: false}},
|
);
|
||||||
{ha_pagato: {$exists: true, $lt: 1}}],
|
|
||||||
});
|
|
||||||
|
|
||||||
if (params.filterand.includes(
|
if (params.filterand.includes(
|
||||||
shared_consts.FILTER_TO_MAKE_MEMBERSHIP_CARD))
|
shared_consts.FILTER_TO_MAKE_MEMBERSHIP_CARD))
|
||||||
@@ -1855,6 +1863,17 @@ module.exports = {
|
|||||||
const [ris] = await mythistable.aggregate(query);
|
const [ris] = await mythistable.aggregate(query);
|
||||||
|
|
||||||
if (ris) {
|
if (ris) {
|
||||||
|
if (params.table === 'users') {
|
||||||
|
for (const myrec of ris.rows) {
|
||||||
|
myrec.password = '**********';
|
||||||
|
}
|
||||||
|
} else if (params.table === 'mygroups') {
|
||||||
|
for (const myrec of ris.rows) {
|
||||||
|
if (myrec.pwd_cryp)
|
||||||
|
myrec.pwd_cryp = '**********';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// console.table(ris.rows);
|
// console.table(ris.rows);
|
||||||
// console.log('ROW ', ris.count);
|
// console.log('ROW ', ris.count);
|
||||||
return ({count: ris.count, rows: ris.rows});
|
return ({count: ris.count, rows: ris.rows});
|
||||||
|
|||||||
@@ -221,9 +221,10 @@ module.exports = {
|
|||||||
|
|
||||||
const sendemail = require('../sendemail');
|
const sendemail = require('../sendemail');
|
||||||
|
|
||||||
|
/// ... rivedere il crea gruppo... notifiche...
|
||||||
try {
|
try {
|
||||||
if (!recnotif.options) {
|
if (!recnotif.typesend) {
|
||||||
recnotif.options = shared_consts.MessageOptions.Notify_ByPushNotification + shared_consts.MessageOptions.Notify_ByBotTelegram;
|
recnotif.typesend = shared_consts.MessageOptions.Notify_ByPushNotification + shared_consts.MessageOptions.Notify_ByBotTelegram;
|
||||||
}
|
}
|
||||||
|
|
||||||
let invia = false;
|
let invia = false;
|
||||||
@@ -239,13 +240,16 @@ module.exports = {
|
|||||||
typenotif,
|
typenotif,
|
||||||
idnotif,
|
idnotif,
|
||||||
usernameDest: recnotif.usernameDest ? recnotif.usernameDest : recnotif.dest,
|
usernameDest: recnotif.usernameDest ? recnotif.usernameDest : recnotif.dest,
|
||||||
|
tag: recnotif.tag ? recnotif.tag : '',
|
||||||
|
actions: recnotif.actions ? recnotif.actions : [],
|
||||||
|
id: recnotif._id
|
||||||
};
|
};
|
||||||
|
|
||||||
if (tools.isBitActive(recnotif.options, shared_consts.MessageOptions.Notify_ByPushNotification) && this.checkifSendPushNotification) {
|
if (tools.isBitActive(recnotif.typesend, shared_consts.MessageOptions.Notify_ByPushNotification) && this.checkifSendPushNotification) {
|
||||||
params.typesend = params.typesend + shared_consts.TypeSend.PUSH_NOTIFICATION;
|
params.typesend = params.typesend + shared_consts.TypeSend.PUSH_NOTIFICATION;
|
||||||
invia = true;
|
invia = true;
|
||||||
}
|
}
|
||||||
if (tools.isBitActive(recnotif.options, shared_consts.MessageOptions.Notify_ByBotTelegram)) {
|
if (tools.isBitActive(recnotif.typesend, shared_consts.MessageOptions.Notify_ByBotTelegram)) {
|
||||||
params.typesend = params.typesend + shared_consts.TypeSend.TELEGRAM;
|
params.typesend = params.typesend + shared_consts.TypeSend.TELEGRAM;
|
||||||
invia = true;
|
invia = true;
|
||||||
}
|
}
|
||||||
@@ -256,7 +260,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send Msg by EMAIL
|
// Send Msg by EMAIL
|
||||||
if (tools.isBitActive(recnotif.options, shared_consts.MessageOptions.Notify_ByEmail)) {
|
if (tools.isBitActive(recnotif.typesend, shared_consts.MessageOptions.Notify_ByEmail)) {
|
||||||
// Read from the operator table first
|
// Read from the operator table first
|
||||||
let emaildest = await Operator.getEmailByUsername(recnotif.dest.idapp, recnotif.dest.username);
|
let emaildest = await Operator.getEmailByUsername(recnotif.dest.idapp, recnotif.dest.username);
|
||||||
if (!emaildest)
|
if (!emaildest)
|
||||||
@@ -265,17 +269,17 @@ module.exports = {
|
|||||||
await sendemail.sendEmail_ByNotif(res, user.lang, emaildest, user, idapp, recnotif);
|
await sendemail.sendEmail_ByNotif(res, user.lang, emaildest, user, idapp, recnotif);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return recnotif;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('sendNotif', e, typenotif, recnotif);
|
console.error('sendNotif', e, typenotif, recnotif);
|
||||||
return false;
|
return recnotif;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
SendMsgToParam: async function(idapp, params) {
|
SendMsgToParam: async function(idapp, params) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
console.log('SendMsgToParam');
|
console.log('SendMsgToParam', params.typesend);
|
||||||
|
|
||||||
const telegrambot = require('../telegram/telegrambot');
|
const telegrambot = require('../telegram/telegrambot');
|
||||||
|
|
||||||
@@ -356,7 +360,7 @@ module.exports = {
|
|||||||
if (tools.isBitActive(params.typesend, shared_consts.TypeSend.PUSH_NOTIFICATION)) {
|
if (tools.isBitActive(params.typesend, shared_consts.TypeSend.PUSH_NOTIFICATION)) {
|
||||||
const myparam = {...params};
|
const myparam = {...params};
|
||||||
risult = tools.sendNotificationToUser(user._id, mytitle, mycontent, myparam.openUrl, myparam.openUrl2, myparam.tag,
|
risult = tools.sendNotificationToUser(user._id, mytitle, mycontent, myparam.openUrl, myparam.openUrl2, myparam.tag,
|
||||||
myparam.actions).
|
myparam.actions, myparam.id).
|
||||||
then(ris => {
|
then(ris => {
|
||||||
|
|
||||||
}).
|
}).
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ module.exports = {
|
|||||||
FILTER_ASK_ZOOM_VISTO: 32768,
|
FILTER_ASK_ZOOM_VISTO: 32768,
|
||||||
FILTER_HOURS_MYLIST: 65536,
|
FILTER_HOURS_MYLIST: 65536,
|
||||||
FILTER_HOURS_ALL: 131072,
|
FILTER_HOURS_ALL: 131072,
|
||||||
FILTER_MISSING_PAYMENT: 262144,
|
FILTER_REPORTED: 262144,
|
||||||
FILTER_TO_MAKE_MEMBERSHIP_CARD: 524288,
|
FILTER_TO_MAKE_MEMBERSHIP_CARD: 524288,
|
||||||
FILTER_MEMBERSHIP_CARD_OK: 1048576,
|
FILTER_MEMBERSHIP_CARD_OK: 1048576,
|
||||||
FILTER_USER_NO_VERIFIED_APORTADOR: 2097152,
|
FILTER_USER_NO_VERIFIED_APORTADOR: 2097152,
|
||||||
|
|||||||
Reference in New Issue
Block a user