summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGary Kim <gary@garykim.dev>2021-05-29 17:47:36 -0400
committerGitHub <noreply@github.com>2021-05-29 23:47:36 +0200
commit766f35554e16ee5462370be714ef29b71745d478 (patch)
treec899fcf255b34a0902250c1ad21aa879590abdc3
parentc86137449e733fc643337f33eaa33daf9e16d73c (diff)
downloadmatterbridge-msglm-766f35554e16ee5462370be714ef29b71745d478.tar.gz
matterbridge-msglm-766f35554e16ee5462370be714ef29b71745d478.tar.bz2
matterbridge-msglm-766f35554e16ee5462370be714ef29b71745d478.zip
Fix content body issue for redactions (matrix) (#1496)
Signed-off-by: Gary Kim <gary@garykim.dev>
-rw-r--r--bridge/matrix/matrix.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/bridge/matrix/matrix.go b/bridge/matrix/matrix.go
index 9516a4fa..b50c9d8b 100644
--- a/bridge/matrix/matrix.go
+++ b/bridge/matrix/matrix.go
@@ -368,13 +368,6 @@ 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("(.*?):.*")
@@ -390,6 +383,13 @@ 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