adding webpush'

This commit is contained in:
aeroreyna
2022-04-23 22:52:46 -07:00
parent 70fffbf55d
commit f7c016264b
5 changed files with 256 additions and 40 deletions

View File

@@ -229,6 +229,20 @@ userDB = (DB) => {
});
}
DB.setWebSubscription = (profileid, webSubscription)=>{
const _id = DB.ObjectID(profileid);
let update = {
$set:{
webSubscription
}
}
if (userProfileCache[profileid]) delete userProfileCache[profileid];
return DB.profileCols.updateOne({_id}, update).catch((err)=>{
console.log(err);
return false;
});
}
DB.addNotification = async (profileid, message, postid, commentIndx, actorid) => {
const _id = DB.ObjectID(profileid);
let update = {