Refactor
This commit is contained in:
parent
ad57e36d0d
commit
e8bde94e5b
9 changed files with 47 additions and 40 deletions
|
|
@ -1,8 +1,8 @@
|
|||
import config from '../../../../conf';
|
||||
import { IRemoteAccount } from '../../../../models/user';
|
||||
import { IRemoteUser } from '../../../../models/user';
|
||||
|
||||
export default ({ username }, { account }) => ({
|
||||
export default ({ username }, followee: IRemoteUser) => ({
|
||||
type: 'Follow',
|
||||
actor: `${config.url}/@${username}`,
|
||||
object: (account as IRemoteAccount).uri
|
||||
object: followee.account.uri
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import config from '../../../../conf';
|
||||
import { extractPublic } from '../../../../crypto_key';
|
||||
import { ILocalAccount } from '../../../../models/user';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
export default ({ username, account }) => ({
|
||||
id: `${config.url}/@${username}/publickey`,
|
||||
export default (user: ILocalUser) => ({
|
||||
id: `${config.url}/@${user.username}/publickey`,
|
||||
type: 'Key',
|
||||
owner: `${config.url}/@${username}`,
|
||||
publicKeyPem: extractPublic((account as ILocalAccount).keypair)
|
||||
owner: `${config.url}/@${user.username}`,
|
||||
publicKeyPem: extractPublic(user.account.keypair)
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue