支持私聊消息加密转发到群聊

This commit is contained in:
xhgit committed 2026-11-14 14:52:22 +08:00
1 parent 20e179a877
commit 9028ba0eed
8 files changed
+99 -62

No files matched your search

+6 -4
View File
@@ -276,10 +276,12 @@ export function localMessageAction(identity: ChatIdentity, line: ChatLine, actio
})
}
export async function forwardMessage(identity: ChatIdentity, line: ChatLine, recipient: string, device: Peer, call: Call) {
if (line.recalled) throw new Error('撤回的消息无法转发')
const content = line.attachment ? await readForwardedFile(line.attachment, call) : line.text
await send(identity, recipient, device, content, call)
export function readPrivateForward(identity: ChatIdentity, message: Pick<ChatLine, 'id' | 'peer' | 'own'>, call: Call) {
return update(identity, async (state) => {
const line = state.lines.find((item) => item.id === message.id && item.peer === message.peer && item.own === message.own)
if (!line || line.recalled) throw new Error('此私聊消息无法转发')
return line.attachment ? readForwardedFile(line.attachment, call) : line.text
})
}
export function recentConversations(identity: ChatIdentity) {