mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
bridgev2/matrix: return error if trying to encrypt message without encryption enabled
This commit is contained in:
parent
d40aa8c7c6
commit
2355d70426
1 changed files with 3 additions and 0 deletions
|
|
@ -56,6 +56,9 @@ func (as *ASIntent) SendMessage(ctx context.Context, roomID id.RoomID, eventType
|
|||
if encrypted, err := as.Matrix.StateStore.IsEncrypted(ctx, roomID); err != nil {
|
||||
return nil, fmt.Errorf("failed to check if room is encrypted: %w", err)
|
||||
} else if encrypted {
|
||||
if as.Connector.Crypto == nil {
|
||||
return nil, fmt.Errorf("room is encrypted, but bridge isn't configured to support encryption")
|
||||
}
|
||||
if as.Matrix.IsCustomPuppet {
|
||||
if extra.Timestamp.IsZero() {
|
||||
as.Matrix.AddDoublePuppetValue(content)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue