Refactor
This commit is contained in:
parent
e8bde94e5b
commit
cd2542e0fd
99 changed files with 111 additions and 111 deletions
20
src/remote/activitypub/renderer/person.ts
Normal file
20
src/remote/activitypub/renderer/person.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import renderImage from './image';
|
||||
import renderKey from './key';
|
||||
import config from '../../../conf';
|
||||
|
||||
export default user => {
|
||||
const id = `${config.url}/@${user.username}`;
|
||||
|
||||
return {
|
||||
type: 'Person',
|
||||
id,
|
||||
inbox: `${id}/inbox`,
|
||||
outbox: `${id}/outbox`,
|
||||
preferredUsername: user.username,
|
||||
name: user.name,
|
||||
summary: user.description,
|
||||
icon: user.avatarId && renderImage({ _id: user.avatarId }),
|
||||
image: user.bannerId && renderImage({ _id: user.bannerId }),
|
||||
publicKey: renderKey(user)
|
||||
};
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue