summaryrefslogtreecommitdiff
path: root/src/remote
diff options
context:
space:
mode:
Diffstat (limited to 'src/remote')
-rw-r--r--src/remote/activitypub/act/create/image.ts2
-rw-r--r--src/remote/activitypub/act/create/index.ts2
-rw-r--r--src/remote/activitypub/act/delete/index.ts2
-rw-r--r--src/remote/activitypub/act/undo/index.ts2
-rw-r--r--src/remote/activitypub/renderer/follow.ts2
-rw-r--r--src/remote/activitypub/renderer/key.ts2
-rw-r--r--src/remote/request.ts7
7 files changed, 10 insertions, 9 deletions
diff --git a/src/remote/activitypub/act/create/image.ts b/src/remote/activitypub/act/create/image.ts
index 30a75e7377..c87423c5fd 100644
--- a/src/remote/activitypub/act/create/image.ts
+++ b/src/remote/activitypub/act/create/image.ts
@@ -7,7 +7,7 @@ import { IDriveFile } from '../../../../models/drive-file';
const log = debug('misskey:activitypub');
export default async function(actor: IRemoteUser, image): Promise<IDriveFile> {
- if ('attributedTo' in image && actor.account.uri !== image.attributedTo) {
+ if ('attributedTo' in image && actor.uri !== image.attributedTo) {
log(`invalid image: ${JSON.stringify(image, null, 2)}`);
throw new Error('invalid image');
}
diff --git a/src/remote/activitypub/act/create/index.ts b/src/remote/activitypub/act/create/index.ts
index dd0b112141..7cb9b08449 100644
--- a/src/remote/activitypub/act/create/index.ts
+++ b/src/remote/activitypub/act/create/index.ts
@@ -9,7 +9,7 @@ import { ICreate } from '../../type';
const log = debug('misskey:activitypub');
export default async (actor: IRemoteUser, activity: ICreate): Promise<void> => {
- if ('actor' in activity && actor.account.uri !== activity.actor) {
+ if ('actor' in activity && actor.uri !== activity.actor) {
throw new Error('invalid actor');
}
diff --git a/src/remote/activitypub/act/delete/index.ts b/src/remote/activitypub/act/delete/index.ts
index 6c6faa1ae5..10b47dc4ca 100644
--- a/src/remote/activitypub/act/delete/index.ts
+++ b/src/remote/activitypub/act/delete/index.ts
@@ -7,7 +7,7 @@ import { IRemoteUser } from '../../../../models/user';
* 削除アクティビティを捌きます
*/
export default async (actor: IRemoteUser, activity): Promise<void> => {
- if ('actor' in activity && actor.account.uri !== activity.actor) {
+ if ('actor' in activity && actor.uri !== activity.actor) {
throw new Error('invalid actor');
}
diff --git a/src/remote/activitypub/act/undo/index.ts b/src/remote/activitypub/act/undo/index.ts
index 3ede9fcfb8..71f547aeb9 100644
--- a/src/remote/activitypub/act/undo/index.ts
+++ b/src/remote/activitypub/act/undo/index.ts
@@ -8,7 +8,7 @@ import Resolver from '../../resolver';
const log = debug('misskey:activitypub');
export default async (actor: IRemoteUser, activity: IUndo): Promise<void> => {
- if ('actor' in activity && actor.account.uri !== activity.actor) {
+ if ('actor' in activity && actor.uri !== activity.actor) {
throw new Error('invalid actor');
}
diff --git a/src/remote/activitypub/renderer/follow.ts b/src/remote/activitypub/renderer/follow.ts
index 6d1ded9a95..0a1ae1a4b2 100644
--- a/src/remote/activitypub/renderer/follow.ts
+++ b/src/remote/activitypub/renderer/follow.ts
@@ -4,5 +4,5 @@ import { IRemoteUser } from '../../../models/user';
export default ({ username }, followee: IRemoteUser) => ({
type: 'Follow',
actor: `${config.url}/@${username}`,
- object: followee.account.uri
+ object: followee.uri
});
diff --git a/src/remote/activitypub/renderer/key.ts b/src/remote/activitypub/renderer/key.ts
index 85be7b1367..76e2f13bcc 100644
--- a/src/remote/activitypub/renderer/key.ts
+++ b/src/remote/activitypub/renderer/key.ts
@@ -6,5 +6,5 @@ export default (user: ILocalUser) => ({
id: `${config.url}/@${user.username}/publickey`,
type: 'Key',
owner: `${config.url}/@${user.username}`,
- publicKeyPem: extractPublic(user.account.keypair)
+ publicKeyPem: extractPublic(user.keypair)
});
diff --git a/src/remote/request.ts b/src/remote/request.ts
index a375aebfbb..a0c69cf4ef 100644
--- a/src/remote/request.ts
+++ b/src/remote/request.ts
@@ -4,10 +4,11 @@ import { URL } from 'url';
import * as debug from 'debug';
import config from '../config';
+import { ILocalUser } from '../models/user';
const log = debug('misskey:activitypub:deliver');
-export default ({ account, username }, url, object) => new Promise((resolve, reject) => {
+export default (user: ILocalUser, url, object) => new Promise((resolve, reject) => {
log(`--> ${url}`);
const { protocol, hostname, port, pathname, search } = new URL(url);
@@ -35,8 +36,8 @@ export default ({ account, username }, url, object) => new Promise((resolve, rej
sign(req, {
authorizationHeaderName: 'Signature',
- key: account.keypair,
- keyId: `acct:${username}@${config.host}`
+ key: user.keypair,
+ keyId: `acct:${user.username}@${config.host}`
});
req.end(JSON.stringify(object));