forked from mirror/mautrix-discord
Add support for encrypted events in webhook replies
Obviously won't help if the encryption hardening options are enabled, because the point of those is to prevent the bridge from decrypting old messages. Fixes #131
This commit is contained in:
parent
8035a2d3a1
commit
3f5484c73e
1 changed files with 6 additions and 0 deletions
|
@ -1414,6 +1414,12 @@ func (portal *Portal) convertReplyMessageToEmbed(eventID id.EventID, url string)
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to fetch event: %w", err)
|
||||
}
|
||||
if evt.Type == event.EventEncrypted {
|
||||
evt, err = portal.bridge.Crypto.Decrypt(evt)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to decrypt event: %w", err)
|
||||
}
|
||||
}
|
||||
err = evt.Content.ParseRaw(evt.Type)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to parse event content: %w", err)
|
||||
|
|
Loading…
Reference in a new issue