From 33545291145cfc9541bbc33155cb9f4a71c9f329 Mon Sep 17 00:00:00 2001 From: Kieran Date: Mon, 26 Jun 2023 12:31:42 +0100 Subject: [PATCH] Chat blocking fix fixes #589 --- packages/app/src/chat/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/app/src/chat/index.ts b/packages/app/src/chat/index.ts index a458fb936..36977809a 100644 --- a/packages/app/src/chat/index.ts +++ b/packages/app/src/chat/index.ts @@ -5,6 +5,7 @@ import { unwrap } from "@snort/shared"; import { Chats } from "Cache"; import { findTag, unixNow } from "SnortUtils"; import { Nip29ChatSystem } from "./nip29"; +import useModeration from "Hooks/useModeration"; export enum ChatType { DirectMessage = 1, @@ -85,6 +86,7 @@ export function useNip29Chat() { export function useChatSystem() { const nip4 = useNip4Chat(); const nip29 = useNip29Chat(); + const { muted, blocked } = useModeration(); - return [...nip4, ...nip29]; + return [...nip4, ...nip29].filter(a => !(muted.includes(a.id) || blocked.includes(a.id))); }