mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
fix: 🚨 Fix DeepSource linter warnings
This commit is contained in:
parent
45e5460975
commit
1d301d72ae
10 changed files with 39 additions and 40 deletions
|
|
@ -3,6 +3,7 @@ import { sanitizeHtml, sanitizeHtmlInline } from "@/sanitization";
|
|||
import markdownItTaskLists from "@hackmd/markdown-it-task-lists";
|
||||
import { type Note, User, db } from "@versia/kit/db";
|
||||
import { Instances, Users } from "@versia/kit/tables";
|
||||
import { FederationRequester } from "@versia/sdk/http";
|
||||
import { and, eq, inArray, isNull, or, sql } from "drizzle-orm";
|
||||
import linkifyHtml from "linkify-html";
|
||||
import {
|
||||
|
|
@ -222,10 +223,7 @@ export const findManyNotes = async (
|
|||
* @param text The text to parse mentions from.
|
||||
* @returns An array of users mentioned in the text.
|
||||
*/
|
||||
export const parseTextMentions = async (
|
||||
text: string,
|
||||
author: User,
|
||||
): Promise<User[]> => {
|
||||
export const parseTextMentions = async (text: string): Promise<User[]> => {
|
||||
const mentionedPeople = [...text.matchAll(mentionValidator)];
|
||||
if (mentionedPeople.length === 0) {
|
||||
return [];
|
||||
|
|
@ -276,7 +274,7 @@ export const parseTextMentions = async (
|
|||
|
||||
// Resolve remote mentions not in database
|
||||
for (const person of notFoundRemoteUsers) {
|
||||
const url = await (await author.federationRequester).resolveWebFinger(
|
||||
const url = await FederationRequester.resolveWebFinger(
|
||||
person[1] ?? "",
|
||||
person[2] ?? "",
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue