mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
refactor(database): ♻️ Simplify User and Note logic further
This commit is contained in:
parent
a8541bdc44
commit
83399ba5f1
6 changed files with 67 additions and 107 deletions
|
|
@ -15,14 +15,7 @@ import type {
|
|||
Note as VersiaNote,
|
||||
User as VersiaUser,
|
||||
} from "@versia/federation/types";
|
||||
import {
|
||||
Instance,
|
||||
Like,
|
||||
Note,
|
||||
Notification,
|
||||
Relationship,
|
||||
User,
|
||||
} from "@versia/kit/db";
|
||||
import { Instance, Like, Note, Relationship, User } from "@versia/kit/db";
|
||||
import { Likes, Notes } from "@versia/kit/tables";
|
||||
import type { SocketAddress } from "bun";
|
||||
import chalk from "chalk";
|
||||
|
|
@ -340,11 +333,10 @@ export class InboxProcessor {
|
|||
languages: [],
|
||||
});
|
||||
|
||||
await Notification.insert({
|
||||
accountId: author.id,
|
||||
type: followee.data.isLocked ? "follow_request" : "follow",
|
||||
notifiedId: followee.id,
|
||||
});
|
||||
await followee.createNotification(
|
||||
followee.data.isLocked ? "follow_request" : "follow",
|
||||
author,
|
||||
);
|
||||
|
||||
if (!followee.data.isLocked) {
|
||||
await followee.sendFollowAccept(author);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue