mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-29 13:59:26 +01:00
fix uses of renamed method
`FederatedInstanceService.fetch` will now just load from the DB, it won't do anything if the instance is not already there
This commit is contained in:
parent
b47b25871d
commit
41ac75a113
4 changed files with 5 additions and 5 deletions
|
@ -411,7 +411,7 @@ export class NoteCreateService implements OnApplicationShutdown {
|
|||
}
|
||||
|
||||
if (user.host && !data.cw) {
|
||||
await this.federatedInstanceService.fetch(user.host).then(async i => {
|
||||
await this.federatedInstanceService.fetchOrRegister(user.host).then(async i => {
|
||||
if (i.isNSFW) {
|
||||
data.cw = 'Instance is marked as NSFW';
|
||||
}
|
||||
|
|
|
@ -441,7 +441,7 @@ export class NoteEditService implements OnApplicationShutdown {
|
|||
}
|
||||
|
||||
if (user.host && !data.cw) {
|
||||
await this.federatedInstanceService.fetch(user.host).then(async i => {
|
||||
await this.federatedInstanceService.fetchOrRegister(user.host).then(async i => {
|
||||
if (i.isNSFW) {
|
||||
data.cw = 'Instance is marked as NSFW';
|
||||
}
|
||||
|
@ -593,7 +593,7 @@ export class NoteEditService implements OnApplicationShutdown {
|
|||
// Register host
|
||||
if (this.meta.enableStatsForFederatedInstances) {
|
||||
if (this.userEntityService.isRemoteUser(user)) {
|
||||
this.federatedInstanceService.fetch(user.host).then(async i => {
|
||||
this.federatedInstanceService.fetchOrRegister(user.host).then(async i => {
|
||||
if (note.renote && note.text || !note.renote) {
|
||||
this.updateNotesCountQueue.enqueue(i.id, 1);
|
||||
}
|
||||
|
|
|
@ -538,7 +538,7 @@ export class ApInboxService {
|
|||
@bindThis
|
||||
private async flag(actor: MiRemoteUser, activity: IFlag): Promise<string> {
|
||||
// Make sure the source instance is allowed to send reports.
|
||||
const instance = await this.federatedInstanceService.fetch(actor.host);
|
||||
const instance = await this.federatedInstanceService.fetchOrRegister(actor.host);
|
||||
if (instance.rejectReports) {
|
||||
throw new Bull.UnrecoverableError(`Rejecting report from instance: ${actor.host}`);
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ export class ApImageService {
|
|||
// 2. or the image is not sensitive
|
||||
const shouldBeCached = this.meta.cacheRemoteFiles && (this.meta.cacheRemoteSensitiveFiles || !image.sensitive);
|
||||
|
||||
await this.federatedInstanceService.fetch(actor.host).then(async i => {
|
||||
await this.federatedInstanceService.fetchOrRegister(actor.host).then(async i => {
|
||||
if (i.isNSFW) {
|
||||
image.sensitive = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue