feat(notifications): Add bot owner notifications for interactions

- Create new botOwnerNotify module with notifyBotOwnerForPost and notifyBotOwnerForFollow functions
- Add bot owner notifications to local post interactions (likes, reposts)
- Add bot owner notifications to swarm post interactions (likes, reposts, mentions)
- Add bot owner notifications to follow interactions (local and swarm)
- Implement mention notification creation for local mentions in post creation
- Notify bot owners when their bots receive interactions from other users
- Ensure bot owners are alerted to engagement on their bot accounts across federated network
This commit is contained in:
Christomatt
2026-01-26 10:57:32 +01:00
parent 5efd3adbfd
commit 1c235e2027
9 changed files with 177 additions and 1 deletions
+4
View File
@@ -83,6 +83,10 @@ export async function POST(request: Request, context: RouteContext) {
postId,
type: 'like',
});
// Also notify bot owner if this is a bot's post
const { notifyBotOwnerForPost } = await import('@/lib/notifications/botOwnerNotify');
await notifyBotOwnerForPost(post.userId, user.id, 'like', postId);
}
// SWARM-FIRST: Check if this is a swarm post and deliver directly
+4
View File
@@ -93,6 +93,10 @@ export async function POST(request: Request, context: RouteContext) {
postId,
type: 'repost',
});
// Also notify bot owner if this is a bot's post
const { notifyBotOwnerForPost } = await import('@/lib/notifications/botOwnerNotify');
await notifyBotOwnerForPost(originalPost.userId, user.id, 'repost', postId);
}
// SWARM-FIRST: Deliver repost to swarm node