Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit 32941ef8c67983e4dd035538b161c558e44d9ecf Author: Gary Kim <gary@garykim.dev> Date: Sat May 29 17:47:36 2021 +0000 Fix content body issue for redactions (matrix) (#1496) Signed-off-by: Gary Kim <gary@garykim.dev> diff --git a/bridge/matrix/matrix.go b/bridge/matrix/matrix.go index 9516a4f..b50c9d8 100644 --- a/bridge/matrix/matrix.go +++ b/bridge/matrix/matrix.go @@ -36813 +3686 @@ func (b *Bmatrix) handleEvent(ev *matrix.Event) {   Avatar: b.getAvatarURL(ev.Sender),   }   - // Text must be a string - if rmsg.Text, ok = ev.Content["body"].(string); !ok { - b.Log.Errorf("Content[body] is not a string: %T\n%#v", - ev.Content["body"], ev.Content) - return - } -   // Remove homeserver suffix if configured   if b.GetBool("NoHomeServerSuffix") {   re := regexp.MustCompile("(.*?):.*") @@ -3906 +38313 @@ func (b *Bmatrix) handleEvent(ev *matrix.Event) {   return   }   + // Text must be a string + if rmsg.Text, ok = ev.Content["body"].(string); !ok { + b.Log.Errorf("Content[body] is not a string: %T\n%#v", + ev.Content["body"], ev.Content) + return + } +   // Do we have a /me action   if ev.Content["msgtype"].(string) == "m.emote" {   rmsg.Event = config.EventUserAction