mirror of https://github.com/msgbyte/tailchat
refactor: 用户私信列表管理
parent
d96d137893
commit
ad8bef67b7
@ -0,0 +1,15 @@
|
||||
import { getCachedConverseInfo } from '../cache/cache';
|
||||
import type { ChatConverseInfo } from '../model/converse';
|
||||
import { appendUserDMConverse } from '../model/user';
|
||||
|
||||
/**
|
||||
* 确保私信会话存在
|
||||
*/
|
||||
export async function ensureDMConverse(
|
||||
converseId: string
|
||||
): Promise<ChatConverseInfo> {
|
||||
const converse = await getCachedConverseInfo(converseId);
|
||||
await appendUserDMConverse(converseId);
|
||||
|
||||
return converse;
|
||||
}
|
Loading…
Reference in New Issue