From 21b0093e5774a042fa6aced51aace088bd26f81a Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Thu, 16 Dec 2021 09:06:25 -0700 Subject: [PATCH 1/2] deps/mautrix: update to master --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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= From 76530f5774e30a2072c15153dfff0c35e35c0c70 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Wed, 15 Dec 2021 10:37:01 -0700 Subject: [PATCH 2/2] double puppeting: add flag to redaction events --- portal.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/portal.go b/portal.go index 212cf66..686690f 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) }