refactor: rename isTextRepost to tagFilterOfTextRepost

This commit is contained in:
kPherox
2023-02-16 23:11:29 +09:00
parent d911dc8da3
commit 188b599e85
5 changed files with 10 additions and 10 deletions

View File

@ -6,12 +6,12 @@ import type { NotificationRequest } from "State/Login";
import { MetadataCache, UsersDb } from "State/Users";
import { getDisplayName } from "Element/ProfileImage";
import { MentionRegex } from "Const";
import { isTextRepost } from "Util";
import { tagFilterOfTextRepost } from "Util";
export async function makeNotification(db: UsersDb, ev: TaggedRawEvent): Promise<NotificationRequest | null> {
switch (ev.kind) {
case EventKind.TextNote: {
if (ev.tags.some(isTextRepost(ev))) {
if (ev.tags.some(tagFilterOfTextRepost(ev))) {
return null;
}
const pubkeys = new Set([ev.pubkey, ...ev.tags.filter(a => a[0] === "p").map(a => a[1])]);