forked from mirrors/misskey
enhance(backend): アカウントでチャットが有効になっているかどうかをユーザーのレスポンスに含めるように
This commit is contained in:
@@ -557,6 +557,7 @@ export class UserEntityService implements OnModuleInit {
|
|||||||
followersVisibility: profile!.followersVisibility,
|
followersVisibility: profile!.followersVisibility,
|
||||||
followingVisibility: profile!.followingVisibility,
|
followingVisibility: profile!.followingVisibility,
|
||||||
chatScope: user.chatScope,
|
chatScope: user.chatScope,
|
||||||
|
canChat: this.roleService.getUserPolicies(user.id).then(r => r.canChat),
|
||||||
roles: this.roleService.getUserRoles(user.id).then(roles => roles.filter(role => role.isPublic).sort((a, b) => b.displayOrder - a.displayOrder).map(role => ({
|
roles: this.roleService.getUserRoles(user.id).then(roles => roles.filter(role => role.isPublic).sort((a, b) => b.displayOrder - a.displayOrder).map(role => ({
|
||||||
id: role.id,
|
id: role.id,
|
||||||
name: role.name,
|
name: role.name,
|
||||||
|
|||||||
@@ -363,6 +363,10 @@ export const packedUserDetailedNotMeOnlySchema = {
|
|||||||
nullable: false, optional: false,
|
nullable: false, optional: false,
|
||||||
enum: ['everyone', 'following', 'followers', 'mutual', 'none'],
|
enum: ['everyone', 'following', 'followers', 'mutual', 'none'],
|
||||||
},
|
},
|
||||||
|
canChat: {
|
||||||
|
type: 'boolean',
|
||||||
|
nullable: false, optional: false,
|
||||||
|
},
|
||||||
roles: {
|
roles: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
nullable: false, optional: false,
|
nullable: false, optional: false,
|
||||||
|
|||||||
@@ -4057,6 +4057,7 @@ export type components = {
|
|||||||
followersVisibility: 'public' | 'followers' | 'private';
|
followersVisibility: 'public' | 'followers' | 'private';
|
||||||
/** @enum {string} */
|
/** @enum {string} */
|
||||||
chatScope: 'everyone' | 'following' | 'followers' | 'mutual' | 'none';
|
chatScope: 'everyone' | 'following' | 'followers' | 'mutual' | 'none';
|
||||||
|
canChat: boolean;
|
||||||
roles: components['schemas']['RoleLite'][];
|
roles: components['schemas']['RoleLite'][];
|
||||||
followedMessage?: string | null;
|
followedMessage?: string | null;
|
||||||
memo: string | null;
|
memo: string | null;
|
||||||
|
|||||||
Reference in New Issue
Block a user