feat: 全てのチャットメッセージを既読にできるように
This commit is contained in:
parent
3ff2e6b299
commit
b7aa013a41
|
@ -6,12 +6,13 @@
|
|||
### Client
|
||||
- Feat: 画像にウォーターマークを付与できるようになりました
|
||||
- Enhance: ノートのリアクション一覧で、押せるリアクションを優先して表示できるようにするオプションを追加
|
||||
- Enhance: 全てのチャットメッセージを既読にできるように(設定→その他)
|
||||
- Fix: ドライブファイルの選択が不安定な問題を修正
|
||||
- Fix: コントロールパネルのファイル欄などのデザインが崩れている問題を修正
|
||||
- Fix: ユーザーの検索結果を追加で読み込むことができない問題を修正
|
||||
|
||||
### Server
|
||||
-
|
||||
- Feat: 全てのチャットメッセージを既読にするAPIを追加(chat/read-all)
|
||||
|
||||
|
||||
## 2025.6.0
|
||||
|
|
|
@ -331,6 +331,16 @@ export class ChatService {
|
|||
await redisPipeline.exec();
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public async readAllChatMessages(
|
||||
readerId: MiUser['id'],
|
||||
): Promise<void> {
|
||||
const redisPipeline = this.redisClient.pipeline();
|
||||
// TODO: newUserChatMessageExists とか newRoomChatMessageExists も消したい(けどキーの列挙が必要になって面倒)
|
||||
redisPipeline.del(`newChatMessagesExists:${readerId}`);
|
||||
await redisPipeline.exec();
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public findMessageById(messageId: MiChatMessage['id']) {
|
||||
return this.chatMessagesRepository.findOneBy({ id: messageId });
|
||||
|
|
|
@ -428,4 +428,5 @@ export * as 'chat/rooms/invitations/ignore' from './endpoints/chat/rooms/invitat
|
|||
export * as 'chat/rooms/invitations/inbox' from './endpoints/chat/rooms/invitations/inbox.js';
|
||||
export * as 'chat/rooms/invitations/outbox' from './endpoints/chat/rooms/invitations/outbox.js';
|
||||
export * as 'chat/history' from './endpoints/chat/history.js';
|
||||
export * as 'chat/read-all' from './endpoints/chat/read-all.js';
|
||||
export * as 'v2/admin/emoji/list' from './endpoints/v2/admin/emoji/list.js';
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import { ChatService } from '@/core/ChatService.js';
|
||||
import { ApiError } from '@/server/api/error.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['chat'],
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'write:chat',
|
||||
|
||||
errors: {
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
},
|
||||
} as const;
|
||||
|
||||
@Injectable()
|
||||
export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-disable-line import/no-default-export
|
||||
constructor(
|
||||
private chatService: ChatService,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
await this.chatService.readAllChatMessages(me.id);
|
||||
});
|
||||
}
|
||||
}
|
|
@ -128,6 +128,10 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
|
||||
<hr>
|
||||
|
||||
<MkButton @click="readAllChatMessages">Read all chat messages</MkButton>
|
||||
|
||||
<hr>
|
||||
|
||||
<FormSlot>
|
||||
<MkButton danger @click="migrate"><i class="ti ti-refresh"></i> {{ i18n.ts.migrateOldSettings }}</MkButton>
|
||||
<template #caption>{{ i18n.ts.migrateOldSettings_description }}</template>
|
||||
|
@ -214,6 +218,10 @@ function hideAllTips() {
|
|||
os.success();
|
||||
}
|
||||
|
||||
function readAllChatMessages() {
|
||||
os.apiWithDialog('chat/read-all', {});
|
||||
}
|
||||
|
||||
const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
|
Loading…
Reference in New Issue