diff --git a/go.mod b/go.mod index a924d99..d86349b 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b maunium.net/go/mauflag v1.0.0 maunium.net/go/maulogger/v2 v2.3.1 - maunium.net/go/mautrix v0.10.6-0.20211206194350-22ee22dccd9f + maunium.net/go/mautrix v0.10.7-0.20211216152136-eead69535244 ) require ( diff --git a/go.sum b/go.sum index 95fe195..d370f3c 100644 --- a/go.sum +++ b/go.sum @@ -221,5 +221,5 @@ maunium.net/go/mauflag v1.0.0 h1:YiaRc0tEI3toYtJMRIfjP+jklH45uDHtT80nUamyD4M= maunium.net/go/mauflag v1.0.0/go.mod h1:nLivPOpTpHnpzEh8jEdSL9UqO9+/KBJFmNRlwKfkPeA= maunium.net/go/maulogger/v2 v2.3.1 h1:fwBYJne0pHvJrrIPHK+TAPfyxxbBEz46oVGez2x0ODE= maunium.net/go/maulogger/v2 v2.3.1/go.mod h1:TYWy7wKwz/tIXTpsx8G3mZseIRiC5DoMxSZazOHy68A= -maunium.net/go/mautrix v0.10.6-0.20211206194350-22ee22dccd9f h1:xa2THJban4GMeZ5g6g0vMK/KZ1cmEpVtcIuwyyNTeDU= -maunium.net/go/mautrix v0.10.6-0.20211206194350-22ee22dccd9f/go.mod h1:k4Ng5oci83MEbqPL6KOjPdbU7f8v01KlMjR/zTQ+7mA= +maunium.net/go/mautrix v0.10.7-0.20211216152136-eead69535244 h1:T5kmB+OjrLkcZ8VQYTgHNQ7FllFsr6klb/JtOrldUhs= +maunium.net/go/mautrix v0.10.7-0.20211216152136-eead69535244/go.mod h1:k4Ng5oci83MEbqPL6KOjPdbU7f8v01KlMjR/zTQ+7mA= diff --git a/portal.go b/portal.go index 0c8686a..f49f46c 100644 --- a/portal.go +++ b/portal.go @@ -1236,10 +1236,14 @@ func (portal *Portal) HandleMessageRevoke(user *User, info *types.MessageInfo, k return false } intent := portal.bridge.GetPuppetByJID(info.Sender).IntentFor(portal) - _, err := intent.RedactEvent(portal.MXID, msg.MXID) + redactionReq := mautrix.ReqRedact{Extra: map[string]interface{}{}} + if intent.IsCustomPuppet { + redactionReq.Extra[doublePuppetKey] = doublePuppetValue + } + _, err := intent.RedactEvent(portal.MXID, msg.MXID, redactionReq) if err != nil { if errors.Is(err, mautrix.MForbidden) { - _, err = portal.MainIntent().RedactEvent(portal.MXID, msg.MXID) + _, err = portal.MainIntent().RedactEvent(portal.MXID, msg.MXID, redactionReq) if err != nil { portal.log.Errorln("Failed to redact %s: %v", msg.JID, err) }