From 0e2522279e8671a345c1be6b8b07c0f1a505e23e Mon Sep 17 00:00:00 2001 From: David Hill Date: Wed, 7 Nov 2018 14:36:50 -0500 Subject: Clean up various stuff (#508) * various cleanups --- bridge/matrix/matrix.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'bridge/matrix/matrix.go') 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 } -- cgit v1.2.3