chore: prevent unexpected variable scope leaks

This commit is contained in:
naskya 2024-05-24 08:56:48 +09:00
parent bedf4cb791
commit e143f0d7ac
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C

View file

@ -48,7 +48,7 @@ export class MastodonStreamUser extends MastodonStream {
if (!(await this.shouldProcessNote(note))) return;
switch (data.type) {
case "updated":
case "updated": {
const encoded = await NoteConverter.encodeEvent(
note,
this.user,
@ -56,6 +56,7 @@ export class MastodonStreamUser extends MastodonStream {
);
this.connection.send(this.chName, "status.update", encoded);
break;
}
case "deleted":
this.connection.send(this.chName, "delete", note.id);
break;
@ -66,7 +67,7 @@ export class MastodonStreamUser extends MastodonStream {
private async onUserEvent(data: StreamMessages["main"]["payload"]) {
switch (data.type) {
case "notification":
case "notification": {
const encoded = await NotificationConverter.encodeEvent(
data.body.id,
this.user,
@ -74,6 +75,7 @@ export class MastodonStreamUser extends MastodonStream {
);
if (encoded) this.connection.send(this.chName, "notification", encoded);
break;
}
default:
break;
}