mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 12:13:48 +01:00
Skip mention user lookup for local users
This commit is contained in:
parent
1d543b5bf8
commit
b04619e007
@ -193,16 +193,17 @@ export async function getSubjectHostFromUriAndUsernameCached(uri: string, userna
|
|||||||
const hostname = new URL(uri).hostname;
|
const hostname = new URL(uri).hostname;
|
||||||
username = username.substring(1); // remove leading @ from username
|
username = username.substring(1); // remove leading @ from username
|
||||||
|
|
||||||
|
if (hostname === config.hostname) {
|
||||||
|
// user is local, return local account domain
|
||||||
|
return config.domain;
|
||||||
|
}
|
||||||
|
|
||||||
const user = await Users.findOneBy({
|
const user = await Users.findOneBy({
|
||||||
usernameLower: username.toLowerCase(),
|
usernameLower: username.toLowerCase(),
|
||||||
host: hostname
|
host: hostname
|
||||||
});
|
});
|
||||||
|
|
||||||
if (user) {
|
return user ? user.host : await uriHostCache.fetch(uri, async () => await getSubjectHostFromUri(uri) ?? hostname);
|
||||||
return user.host;
|
|
||||||
}
|
|
||||||
|
|
||||||
return await uriHostCache.fetch(uri, async () => await getSubjectHostFromUri(uri) ?? hostname);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getSubjectHostFromAcct(acct: string): Promise<string | null> {
|
export async function getSubjectHostFromAcct(acct: string): Promise<string | null> {
|
||||||
|
Loading…
Reference in New Issue
Block a user