Skip to content

Commit

Permalink
Revert "fix(backend): renoteのリモートで表示のときに正しいページに飛ぶように"
Browse files Browse the repository at this point in the history
This reverts commit 251ddcf.
  • Loading branch information
4ster1sk committed Dec 27, 2024
1 parent 29514fa commit 19702a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
7 changes: 2 additions & 5 deletions packages/backend/src/core/activitypub/ApInboxService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import type { MiRemoteUser } from '@/models/User.js';
import { GlobalEventService } from '@/core/GlobalEventService.js';
import { AbuseReportService } from '@/core/AbuseReportService.js';
import { IdentifiableError } from '@/misc/identifiable-error.js';
import { getApHrefNullable, getApId, getApIds, getApType, getApUrl, isAccept, isActor, isAdd, isAnnounce, isBlock, isCollection, isCollectionOrOrderedCollection, isCreate, isDelete, isFlag, isFollow, isLike, isMove, isPost, isReject, isRemove, isTombstone, isUndo, isUpdate, validActor, validPost } from './type.js';
import { getApHrefNullable, getApId, getApIds, getApType, isAccept, isActor, isAdd, isAnnounce, isBlock, isCollection, isCollectionOrOrderedCollection, isCreate, isDelete, isFlag, isFollow, isLike, isMove, isPost, isReject, isRemove, isTombstone, isUndo, isUpdate, validActor, validPost } from './type.js';
import { ApNoteService } from './models/ApNoteService.js';
import { ApLoggerService } from './ApLoggerService.js';
import { ApDbResolverService } from './ApDbResolverService.js';
Expand Down Expand Up @@ -280,9 +280,8 @@ export class ApInboxService {
@bindThis
private async announce(actor: MiRemoteUser, activity: IAnnounce, resolver?: Resolver): Promise<string | void> {
const uri = getApId(activity);
const url = getApUrl(activity);

this.logger.info(`Announce: ${uri} / ${url}`);
this.logger.info(`Announce: ${uri}`);

// eslint-disable-next-line no-param-reassign
resolver ??= this.apResolverService.createResolver();
Expand All @@ -304,7 +303,6 @@ export class ApInboxService {
@bindThis
private async announceNote(actor: MiRemoteUser, activity: IAnnounce, target: IPost, resolver?: Resolver): Promise<string | void> {
const uri = getApId(activity);
const url = getApUrl(activity);

if (actor.isSuspended) {
return;
Expand Down Expand Up @@ -357,7 +355,6 @@ export class ApInboxService {
visibility: activityAudience.visibility,
visibleUsers: activityAudience.visibleUsers,
uri,
url: url,
});
} finally {
unlock();
Expand Down
6 changes: 0 additions & 6 deletions packages/backend/src/core/activitypub/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ export function getApId(value: string | IObject): string {
throw new Error('cannot detemine id');
}

export function getApUrl(value: string | IActivity): string | null {
if (typeof value === 'string') return value;
if (typeof value.object === 'string') return value.object;
return null;
}

/**
* Get ActivityStreams Object type
*
Expand Down

0 comments on commit 19702a5

Please sign in to comment.