Chat blocking fix

fixes #589
This commit is contained in:
Kieran 2023-06-26 12:31:42 +01:00
parent 379bce6f9e
commit 3354529114
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -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)));
}