From d6a4b18744a073cd6628baf45b34da7f2a573cd5 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Fri, 7 Jul 2023 19:41:32 +0200 Subject: [PATCH] [mastodon-client] Don't display unsupported notification types --- packages/megalodon/src/misskey.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/megalodon/src/misskey.ts b/packages/megalodon/src/misskey.ts index 61464522a..42268806f 100644 --- a/packages/megalodon/src/misskey.ts +++ b/packages/megalodon/src/misskey.ts @@ -10,6 +10,7 @@ import Entity from './entity' import { MegalodonInterface, WebSocketInterface, NoImplementedError, ArgumentError, UnexpectedError } from './megalodon' import MegalodonEntity from "@/entity"; import fs from "node:fs"; +import MisskeyNotificationType from "./misskey/notification"; type AccountCache = { locks: AsyncLock, @@ -2238,7 +2239,11 @@ export default class Misskey implements MegalodonInterface { } return this.client .post>('/api/i/notifications', params) - .then(res => ({ ...res, data: res.data.map(n => this.converter.notification(n, this.baseUrlToHost(this.baseUrl))) })) + .then(res => ({ + ...res, + data: res.data + .filter(p => p.type != MisskeyNotificationType.FollowRequestAccepted) // these aren't supported on mastodon + .map(n => this.converter.notification(n, this.baseUrlToHost(this.baseUrl))) })) } public async getNotification(_id: string): Promise> {