summaryrefslogtreecommitdiff
path: root/src/remote/activitypub/renderer
diff options
context:
space:
mode:
authorMeiMei <30769358+mei23@users.noreply.github.com>2018-12-06 19:15:09 +0900
committerAya Morisawa <AyaMorisawa4869@gmail.com>2018-12-06 19:15:09 +0900
commit008432e156ef540245f81c2326efd311840a67d0 (patch)
tree71da86140cf504ea1048f8849b0ffe7a566fa524 /src/remote/activitypub/renderer
parentAdd missing comma (diff)
downloadmisskey-008432e156ef540245f81c2326efd311840a67d0.tar.gz
misskey-008432e156ef540245f81c2326efd311840a67d0.tar.bz2
misskey-008432e156ef540245f81c2326efd311840a67d0.zip
lint fix (#3522)
Diffstat (limited to 'src/remote/activitypub/renderer')
-rw-r--r--src/remote/activitypub/renderer/person.ts41
1 files changed, 25 insertions, 16 deletions
diff --git a/src/remote/activitypub/renderer/person.ts b/src/remote/activitypub/renderer/person.ts
index 4a6a54881f..2c411e544a 100644
--- a/src/remote/activitypub/renderer/person.ts
+++ b/src/remote/activitypub/renderer/person.ts
@@ -15,28 +15,37 @@ export default async (user: ILocalUser) => {
DriveFile.findOne({ _id: user.avatarId }),
DriveFile.findOne({ _id: user.bannerId })
]);
-
+
const attachment: {
type: string,
name: string,
value: string,
verified_at?: string
}[] = [];
- user.twitter && attachment.push({
- type: 'PropertyValue',
- name: 'Twitter',
- value: `<a href="https://twitter.com/intent/user?user_id=${user.twitter.userId}" rel="me nofollow noopener" target="_blank"><span>@${user.twitter.screenName}</span></a>`
- });
- user.github && attachment.push({
- type: 'PropertyValue',
- name: 'GitHub',
- value: `<a href="https://github.com/${user.github.login}" rel="me nofollow noopener" target="_blank"><span>@${user.github.login}</span></a>`
- });
- user.discord && attachment.push({
- type: 'PropertyValue',
- name: 'Discord',
- value: `<a href="https://discordapp.com/users/${user.discord.id}" rel="me nofollow noopener" target="_blank"><span>@${user.discord.username}#${user.discord.discriminator}</span></a>`
- });
+
+ if (user.twitter) {
+ attachment.push({
+ type: 'PropertyValue',
+ name: 'Twitter',
+ value: `<a href="https://twitter.com/intent/user?user_id=${user.twitter.userId}" rel="me nofollow noopener" target="_blank"><span>@${user.twitter.screenName}</span></a>`
+ });
+ }
+
+ if (user.github) {
+ attachment.push({
+ type: 'PropertyValue',
+ name: 'GitHub',
+ value: `<a href="https://github.com/${user.github.login}" rel="me nofollow noopener" target="_blank"><span>@${user.github.login}</span></a>`
+ });
+ }
+
+ if (user.discord) {
+ attachment.push({
+ type: 'PropertyValue',
+ name: 'Discord',
+ value: `<a href="https://discordapp.com/users/${user.discord.id}" rel="me nofollow noopener" target="_blank"><span>@${user.discord.username}#${user.discord.discriminator}</span></a>`
+ });
+ }
const emojis = await getEmojis(user.emojis);
const apemojis = emojis.map(emoji => renderEmoji(emoji));