diff options
author | David Hill <dhill@mindcry.org> | 2018-11-07 14:36:50 -0500 |
---|---|---|
committer | Wim <wim@42.be> | 2018-11-07 20:36:50 +0100 |
commit | 0e2522279e8671a345c1be6b8b07c0f1a505e23e (patch) | |
tree | 968ac4b1acd0352ae9962d6f71bfd7d9c668596f /bridge/matrix | |
parent | 141a42a75b47b0a05f5b360ff5711819d3727a75 (diff) | |
download | matterbridge-msglm-0e2522279e8671a345c1be6b8b07c0f1a505e23e.tar.gz matterbridge-msglm-0e2522279e8671a345c1be6b8b07c0f1a505e23e.tar.bz2 matterbridge-msglm-0e2522279e8671a345c1be6b8b07c0f1a505e23e.zip |
Clean up various stuff (#508)
* various cleanups
Diffstat (limited to 'bridge/matrix')
-rw-r--r-- | bridge/matrix/matrix.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bridge/matrix/matrix.go b/bridge/matrix/matrix.go index 95ba6b42..ba02d4aa 100644 --- a/bridge/matrix/matrix.go +++ b/bridge/matrix/matrix.go @@ -73,8 +73,11 @@ func (b *Bmatrix) Send(msg config.Message) (string, error) { // Make a action /me of the message if msg.Event == config.EVENT_USER_ACTION { - resp, err := b.mc.SendMessageEvent(channel, "m.room.message", - matrix.TextMessage{"m.emote", msg.Username + msg.Text}) + m := matrix.TextMessage{ + MsgType: "m.emote", + Body: msg.Username + msg.Text, + } + resp, err := b.mc.SendMessageEvent(channel, "m.room.message", m) if err != nil { return "", err } @@ -158,7 +161,8 @@ func (b *Bmatrix) handleEvent(ev *matrix.Event) { // Text must be a string if rmsg.Text, ok = ev.Content["body"].(string); !ok { - b.Log.Errorf("Content[body] wasn't a %T ?", rmsg.Text) + b.Log.Errorf("Content[body] is not a string: %T\n%#v", + ev.Content["body"], ev.Content) return } |