fix: share only emails email_confirmed recipients

This commit is contained in:
KernelDeimos 2024-12-17 10:00:43 -05:00
parent 63efee390a
commit 2336a62b4f

View File

@ -194,14 +194,16 @@ module.exports = new Sequence([
// Working on notifications
// Email should have a link to a shared file, right?
// .. how do I make those URLs? (gui feature)
await svc_email.send_email({
email: recipient_item.user.email,
}, 'share_by_username', {
// link: // TODO: create a link to the shared file
susername: actor.type.user.username,
rusername: username,
message: metadata.message,
});
if ( recipient_item.user.email && recipient_item.user.email_confirmed ) {
await svc_email.send_email({
email: recipient_item.user.email,
}, 'share_by_username', {
// link: // TODO: create a link to the shared file
susername: actor.type.user.username,
rusername: username,
message: metadata.message,
});
}
result.recipients[recipient_item.i] =
{ $: 'api:status-report', status: 'success' };