remove fetchMeta argument
This commit is contained in:
parent
2c54bc3364
commit
3bd7588077
7 changed files with 10 additions and 10 deletions
|
@ -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"}://${
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
),
|
||||
};
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue