Ignore deleted users when looking up a user
After the change to converting users to tombstones instead of removing them from the database several places would accidentally use deleted user accounts instead of ignoring them.
This commit is contained in:
parent
f4e4dc9f11
commit
352362b9c3
2 changed files with 4 additions and 4 deletions
|
@ -151,7 +151,7 @@ export async function broadcastEvent(event: ApiEvent) {
|
|||
} else {
|
||||
let userType: ApiAccount["type"] | undefined;
|
||||
if (streamData.accountId !== undefined) {
|
||||
userType = users.find(a => a.id === streamData.accountId)?.type
|
||||
userType = users.find(a => !a.deleted && a.id === streamData.accountId)?.type
|
||||
}
|
||||
const data = encodeEvent(event, userType)
|
||||
sendMessage(stream, `id: ${id}\nevent: update\ndata: ${data}\n\n`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue