4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-26 16:39:24 +00:00

Clean up various stuff (#508)

* various cleanups
This commit is contained in:
David Hill
2018-11-07 14:36:50 -05:00
committed by Wim
parent 141a42a75b
commit 0e2522279e
11 changed files with 77 additions and 54 deletions

View File

@ -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
}