Skip to content

Commit

Permalink
getRemoteUserFromKeyIdはもういらない
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Feb 28, 2024
1 parent dcdad28 commit 67a5dd0
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions src/remote/activitypub/db-resolver.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import * as mongo from 'mongodb';
import config from '../../config';
import User, { IUser, IRemoteUser } from '../../models/user';
import User, { IUser } from '../../models/user';
import Note, { INote } from '../../models/note';
import { IObject, getApId } from './type';
import * as escapeRegexp from 'escape-regexp';
import MessagingMessage, { IMessagingMessage } from '../../models/messaging-message';
import { toDbHost } from '../../misc/convert-host';

export default class DbResolver {
constructor() {
Expand Down Expand Up @@ -54,23 +53,6 @@ export default class DbResolver {
return null;
}

public async getRemoteUserFromKeyId(keyId: string): Promise<IRemoteUser | null> {
let u: URL | null = null;
try {
u = new URL(keyId);
} catch {
return null;
}

const user = await User.findOne({
host: toDbHost(u.hostname),
'publicKey.id': keyId,
deletedAt: { $exists: false }
}) as IRemoteUser;

return user || null;
}

/**
* AP Person => Misskey User in DB
*/
Expand Down

0 comments on commit 67a5dd0

Please sign in to comment.