mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-11-25 00:41:37 +00:00
Fix possible panics (matrix). Closes #333
This commit is contained in:
parent
ee87626a93
commit
8830a5a1df
@ -91,6 +91,9 @@ func (b *Bmatrix) Send(msg config.Message) (string, error) {
|
|||||||
if msg.Event == config.EVENT_USER_ACTION {
|
if msg.Event == config.EVENT_USER_ACTION {
|
||||||
resp, err := b.mc.SendMessageEvent(channel, "m.room.message",
|
resp, err := b.mc.SendMessageEvent(channel, "m.room.message",
|
||||||
matrix.TextMessage{"m.emote", msg.Username + msg.Text})
|
matrix.TextMessage{"m.emote", msg.Username + msg.Text})
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
return resp.EventID, err
|
return resp.EventID, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,6 +135,9 @@ func (b *Bmatrix) Send(msg config.Message) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resp, err := b.mc.SendText(channel, msg.Username+msg.Text)
|
resp, err := b.mc.SendText(channel, msg.Username+msg.Text)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
return resp.EventID, err
|
return resp.EventID, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user