diff --git a/go.mod b/go.mod index 43221e7..ace5b06 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( gopkg.in/yaml.v2 v2.3.0 maunium.net/go/mauflag v1.0.0 maunium.net/go/maulogger/v2 v2.1.1 - maunium.net/go/mautrix v0.5.5 + maunium.net/go/mautrix v0.5.6 ) replace github.com/Rhymen/go-whatsapp => github.com/tulir/go-whatsapp v0.3.4 diff --git a/go.sum b/go.sum index 01625d3..986e8f0 100644 --- a/go.sum +++ b/go.sum @@ -198,3 +198,5 @@ maunium.net/go/mautrix v0.5.4 h1:FX5LXZjdkwjA0ZStVsQo5hyzteiUUNejVvbwv0aZfw4= maunium.net/go/mautrix v0.5.4/go.mod h1:FLbMANzwqlsX2Fgm7SDe+E4I3wSa4UxJRKqS5wGkCwA= maunium.net/go/mautrix v0.5.5 h1:e0Pql1FdxoNUudx2oXo1gZHMrqIh5MC72cdXEPIrYLA= maunium.net/go/mautrix v0.5.5/go.mod h1:FLbMANzwqlsX2Fgm7SDe+E4I3wSa4UxJRKqS5wGkCwA= +maunium.net/go/mautrix v0.5.6 h1:XCpyj3yeSOXpX+HMbF+3rdja97efMv/XchsOHylKdXY= +maunium.net/go/mautrix v0.5.6/go.mod h1:FLbMANzwqlsX2Fgm7SDe+E4I3wSa4UxJRKqS5wGkCwA= diff --git a/portal.go b/portal.go index 682fc3e..8cef41a 100644 --- a/portal.go +++ b/portal.go @@ -1049,6 +1049,16 @@ func (portal *Portal) SetReply(content *event.MessageEventContent, info whatsapp portal.log.Warnln("Failed to get reply target:", err) return } + if evt.Type == event.EventEncrypted { + _ = evt.Content.ParseRaw(evt.Type) + decryptedEvt, err := portal.bridge.Crypto.Decrypt(evt) + if err != nil { + portal.log.Warnln("Failed to decrypt reply target:", err) + } else { + evt = decryptedEvt + } + } + _ = evt.Content.ParseRaw(evt.Type) content.SetReply(evt) } return