mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
Fix SIGSEGV bug!!
This commit is contained in:
parent
9514deb330
commit
63b13ca5e8
5 changed files with 48 additions and 31 deletions
|
|
@ -9,7 +9,6 @@ import type { StatusWithRelations } from "./Status";
|
|||
/**
|
||||
* Represents a Like entity in the database.
|
||||
*/
|
||||
|
||||
export const toLysand = (like: Like): LysandLike => {
|
||||
return {
|
||||
id: like.id,
|
||||
|
|
@ -21,6 +20,11 @@ export const toLysand = (like: Like): LysandLike => {
|
|||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a like
|
||||
* @param user User liking the status
|
||||
* @param status Status being liked
|
||||
*/
|
||||
export const createLike = async (
|
||||
user: UserWithRelations,
|
||||
status: StatusWithRelations
|
||||
|
|
@ -47,6 +51,11 @@ export const createLike = async (
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Delete a like
|
||||
* @param user User deleting their like
|
||||
* @param status Status being unliked
|
||||
*/
|
||||
export const deleteLike = async (
|
||||
user: UserWithRelations,
|
||||
status: StatusWithRelations
|
||||
|
|
@ -68,7 +77,7 @@ export const deleteLike = async (
|
|||
},
|
||||
});
|
||||
|
||||
if (user.instanceId === null) {
|
||||
if (user.instanceId === null && status.author.instanceId !== null) {
|
||||
// User is local, federate the delete
|
||||
// TODO: Federate this
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue