mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-05 14:43:09 +02:00
add: description support for mastodon
This commit is contained in:
parent
a505e51777
commit
b569ac911e
3 changed files with 5 additions and 2 deletions
|
@ -321,6 +321,8 @@ export class UserEntityService implements OnModuleInit {
|
|||
.getMany() : [];
|
||||
const profile = opts.detail ? (opts.userProfile ?? await this.userProfilesRepository.findOneByOrFail({ userId: user.id })) : null;
|
||||
|
||||
const mastoapi = opts.userProfile ?? await this.userProfilesRepository.findOneByOrFail({ userId: user.id });
|
||||
|
||||
const followingCount = profile == null ? null :
|
||||
(profile.ffVisibility === 'public') || isMe ? user.followingCount :
|
||||
(profile.ffVisibility === 'followers') && (relation && relation.isFollowing) ? user.followingCount :
|
||||
|
@ -344,6 +346,7 @@ export class UserEntityService implements OnModuleInit {
|
|||
host: user.host,
|
||||
avatarUrl: user.avatarUrl ?? this.getIdenticonUrl(user),
|
||||
avatarBlurhash: user.avatarBlurhash,
|
||||
description: mastoapi!.description,
|
||||
createdAt: user.createdAt.toISOString(),
|
||||
isBot: user.isBot ?? falsy,
|
||||
isCat: user.isCat ?? falsy,
|
||||
|
@ -382,7 +385,6 @@ export class UserEntityService implements OnModuleInit {
|
|||
isLocked: user.isLocked,
|
||||
isSilenced: this.roleService.getUserPolicies(user.id).then(r => !r.canPublicNote),
|
||||
isSuspended: user.isSuspended ?? falsy,
|
||||
description: profile!.description,
|
||||
location: profile!.location,
|
||||
birthday: profile!.birthday,
|
||||
listenbrainz: profile!.listenbrainz,
|
||||
|
|
|
@ -92,7 +92,7 @@ namespace MisskeyAPI {
|
|||
followers_count: u.followersCount ? u.followersCount : 0,
|
||||
following_count: u.followingCount ? u.followingCount : 0,
|
||||
statuses_count: u.notesCount ? u.notesCount : 0,
|
||||
note: '',
|
||||
note: u.description ? u.description : '',
|
||||
url: acctUrl,
|
||||
avatar: u.avatarUrl,
|
||||
avatar_static: u.avatarUrl,
|
||||
|
|
|
@ -6,6 +6,7 @@ namespace MisskeyEntity {
|
|||
name: string
|
||||
username: string
|
||||
createdAt?: string
|
||||
description?: string
|
||||
followingCount?: number
|
||||
followersCount?: number
|
||||
notesCount?: number
|
||||
|
|
Loading…
Reference in a new issue