支持私聊消息加密转发到群聊
This commit is contained in:
1 parent
20e179a877
commit
9028ba0eed
8 files changed
+99
-62
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user