remove fetchMeta argument

This commit is contained in:
naskya 2024-06-07 08:41:13 +09:00
parent 2c54bc3364
commit 3bd7588077
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
7 changed files with 10 additions and 10 deletions

View file

@ -231,7 +231,7 @@ export const DriveFileRepository = db.getRepository(DriveFile).extend({
if (url.startsWith(`${config.url}/identicon`)) return url;
if (url.startsWith(`${config.url}/avatar`)) return url;
const meta = await fetchMeta(true);
const meta = await fetchMeta();
const baseUrl = meta
? meta.objectStorageBaseUrl ??
`${meta.objectStorageUseSsl ? "https" : "http"}://${

View file

@ -158,7 +158,7 @@ export class NotificationConverter {
subscription: SwSubscription,
ctx: MastoContext,
): Promise<MastodonEntity.PushSubscription> {
const instance = await fetchMeta(true);
const instance = await fetchMeta();
const result: MastodonEntity.PushSubscription = {
id: subscription.id,
endpoint: subscription.endpoint,

View file

@ -69,7 +69,7 @@ export class AuthHelpers {
client_id: app.id,
client_secret: app.secret,
vapid_key:
(await fetchMeta(true).then((meta) => meta.swPublicKey)) ?? undefined,
(await fetchMeta().then((meta) => meta.swPublicKey)) ?? undefined,
};
}
@ -228,7 +228,7 @@ export class AuthHelpers {
return {
name: app.name,
website: app.description,
vapid_key: await fetchMeta(true).then(
vapid_key: await fetchMeta().then(
(meta) => meta.swPublicKey ?? undefined,
),
};

View file

@ -43,7 +43,7 @@ export class MiscHelpers {
},
order: { id: "ASC" },
}).then((p) => (p ? UserConverter.encode(p, ctx) : null));
const meta = await fetchMeta(true);
const meta = await fetchMeta();
const res = {
uri: config.host,
@ -119,7 +119,7 @@ export class MiscHelpers {
},
order: { id: "ASC" },
}).then((p) => (p ? UserConverter.encode(p, ctx) : null));
const meta = await fetchMeta(true);
const meta = await fetchMeta();
const res = {
domain: config.host,
@ -261,7 +261,7 @@ export class MiscHelpers {
const user = ctx.user as ILocalUser;
const results: Promise<MastodonEntity.SuggestedAccount[]>[] = [];
const pinned = fetchMeta(true).then((meta) =>
const pinned = fetchMeta().then((meta) =>
Promise.all(
meta.pinnedUsers
.map((acct) => stringToAcct(acct))

View file

@ -720,7 +720,7 @@ export class NoteHelpers {
ctx: MastoContext,
): Promise<MastodonEntity.StatusTranslation> {
const user = ctx.user as ILocalUser;
const instance = await fetchMeta(true);
const instance = await fetchMeta();
const provider = instance.libreTranslateApiUrl
? "LibreTranslate"
: instance.deeplAuthKey

View file

@ -85,7 +85,7 @@ export class TimelineHelpers {
}
if (!local) {
const m = await fetchMeta(true);
const m = await fetchMeta();
if (m.disableGlobalTimeline) {
if (user == null || !(user.isAdmin || user.isModerator)) {
throw new Error("global timeline is disabled");

View file

@ -25,7 +25,7 @@ export class MastodonStreamPublic extends MastodonStream {
}
public async init() {
const meta = await fetchMeta(true);
const meta = await fetchMeta();
if (meta.disableGlobalTimeline) {
if (this.user == null || !(this.user.isAdmin || this.user.isModerator))
return;