Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance(abuses): 通報一覧ページの改修 #222

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10009,6 +10009,14 @@ export interface Locale extends ILocale {
* 数字引用しました
*/
readonly "didNumberquote": string;
/**
* {user}によって解決済み
*/
readonly "resolvedBy": ParameterizedString<"user">;
/**
* リモートサーバーに転送済み
*/
readonly "forwardedReport": string;
readonly "_about": {
/**
* taiymeについて
Expand Down
2 changes: 2 additions & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2666,6 +2666,8 @@ _tms:
numberquote: "数字引用する"
didPakuru: "パクりました"
didNumberquote: "数字引用しました"
resolvedBy: "{user}によって解決済み"
forwardedReport: "リモートサーバーに転送済み"
_about:
title: "taiymeについて"
description: "taiymeは、Misskeyから派生したオープンソースのソフトウェアです。"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@ export class AbuseUserReportEntityService {
assigneeId: report.assigneeId,
reporter: this.userEntityService.pack(report.reporter ?? report.reporterId, null, {
schema: 'UserDetailedNotMe',
iAmModerator: true,
}),
targetUser: this.userEntityService.pack(report.targetUser ?? report.targetUserId, null, {
schema: 'UserDetailedNotMe',
iAmModerator: true,
}),
assignee: report.assigneeId ? this.userEntityService.pack(report.assignee ?? report.assigneeId, null, {
schema: 'UserDetailedNotMe',
iAmModerator: true,
}) : null,
forwarded: report.forwarded,
});
Expand Down
4 changes: 3 additions & 1 deletion packages/backend/src/core/entities/UserEntityService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,19 +404,21 @@ export class UserEntityService implements OnModuleInit {
userRelations?: Map<MiUser['id'], UserRelation>,
userMemos?: Map<MiUser['id'], string | null>,
pinNotes?: Map<MiUser['id'], MiUserNotePining[]>,
iAmModerator?: boolean,
},
): Promise<Packed<S>> {
const opts = Object.assign({
schema: 'UserLite',
includeSecrets: false,
iAmModerator: false,
}, options);

const user = typeof src === 'object' ? src : await this.usersRepository.findOneByOrFail({ id: src });

const isDetailed = opts.schema !== 'UserLite';
const meId = me ? me.id : null;
const isMe = meId === user.id;
const iAmModerator = me ? await this.roleService.isModerator(me as MiUser) : false;
const iAmModerator = opts.iAmModerator || (me ? await this.roleService.isModerator(me as MiUser) : false);

const profile = isDetailed
? (opts.userProfile ?? await this.userProfilesRepository.findOneByOrFail({ userId: user.id }))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export const meta = {
nullable: true, optional: true,
ref: 'UserDetailedNotMe',
},
forwarded: {
type: 'boolean',
nullable: false, optional: false,
},
},
},
},
Expand Down
Loading