mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-11-22 12:50:27 +00:00
Fix content body issue for redactions (matrix) (#1496)
Signed-off-by: Gary Kim <gary@garykim.dev>
This commit is contained in:
parent
c86137449e
commit
766f35554e
@ -368,13 +368,6 @@ func (b *Bmatrix) handleEvent(ev *matrix.Event) {
|
|||||||
Avatar: b.getAvatarURL(ev.Sender),
|
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
|
// Remove homeserver suffix if configured
|
||||||
if b.GetBool("NoHomeServerSuffix") {
|
if b.GetBool("NoHomeServerSuffix") {
|
||||||
re := regexp.MustCompile("(.*?):.*")
|
re := regexp.MustCompile("(.*?):.*")
|
||||||
@ -390,6 +383,13 @@ func (b *Bmatrix) handleEvent(ev *matrix.Event) {
|
|||||||
return
|
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
|
// Do we have a /me action
|
||||||
if ev.Content["msgtype"].(string) == "m.emote" {
|
if ev.Content["msgtype"].(string) == "m.emote" {
|
||||||
rmsg.Event = config.EventUserAction
|
rmsg.Event = config.EventUserAction
|
||||||
|
Loading…
Reference in New Issue
Block a user