removed obsolete settings, introduced mention setting

This commit is contained in:
Ulf Gebhardt 2025-04-05 04:39:17 +02:00
parent 58ceceab68
commit b67de647c2
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
4 changed files with 8 additions and 19 deletions

View File

@ -12,8 +12,7 @@ export async function up(next) {
await transaction.run(`
MATCH (user:User)
SET user.emailNotificationsCommentOnObservedPost = user.sendNotificationEmails
SET user.emailNotificationsPostByFollowedUser = user.sendNotificationEmails
SET user.emailNotificationsPostInGroup = user.sendNotificationEmails
SET user.emailNotificationsMention = user.sendNotificationEmails
SET user.emailNotificationsGroupMemberJoined = user.sendNotificationEmails
SET user.emailNotificationsGroupMemberLeft = user.sendNotificationEmails
SET user.emailNotificationsGroupMemberRemoved = user.sendNotificationEmails
@ -45,8 +44,7 @@ export async function down(next) {
MATCH (user:User)
SET user.sendNotificationEmails = true
REMOVE user.emailNotificationsCommentOnObservedPost
REMOVE user.emailNotificationsPostByFollowedUser
REMOVE user.emailNotificationsPostInGroup
REMOVE user.emailNotificationsMention
REMOVE user.emailNotificationsGroupMemberJoined
REMOVE user.emailNotificationsGroupMemberLeft
REMOVE user.emailNotificationsGroupMemberRemoved

View File

@ -101,7 +101,7 @@ const handleContentDataOfPost = async (resolve, root, args, context, resolveInfo
if (post) {
await publishNotifications(context, [
notifyUsersOfMention('Post', post.id, idsOfUsers, 'mentioned_in_post', context),
], 'TODO')
], 'emailNotificationsMention')
}
return post
}
@ -120,7 +120,7 @@ const handleContentDataOfComment = async (resolve, root, args, context, resolveI
'mentioned_in_comment',
context,
),
], 'TODO')
], 'emailNotificationsMention')
await publishNotifications(context, [
notifyUsersOfComment('Comment', comment.id, 'commented_on_post', context),
@ -129,11 +129,6 @@ const handleContentDataOfComment = async (resolve, root, args, context, resolveI
return comment
}
/* TODO unused
emailNotificationsPostByFollowedUser: true
emailNotificationsPostInGroup: true
*/
const postAuthorOfComment = async (commentId, { context }) => {
const session = context.driver.session()
let postAuthorId

View File

@ -161,11 +161,7 @@ export default {
type: 'boolean',
default: true,
},
emailNotificationsPostByFollowedUser: {
type: 'boolean',
default: true,
},
emailNotificationsPostInGroup: {
emailNotificationsMention: {
type: 'boolean',
default: true,
},

View File

@ -159,6 +159,7 @@ export default {
emailNotificationSettings.forEach((setting) => {
const allowedSettingNames = [
'commentOnObservedPost',
'mention',
'postByFollowedUser',
'postInGroup',
'groupMemberJoined',
@ -395,11 +396,10 @@ export default {
value: parent.emailNotificationsCommentOnObservedPost ?? true,
},
{
name: 'postByFollowedUser',
name: 'mention',
type: 'post',
value: parent.emailNotificationsPostByFollowedUser ?? true,
value: parent.emailNotificationsMention ?? true,
},
{ name: 'postInGroup', type: 'post', value: parent.emailNotificationsPostInGroup ?? true},
{
name: 'groupMemberJoined',
type: 'group',