mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-06-26 16:39:24 +00:00
Modify Send() to return also a message id
This commit is contained in:
@ -74,17 +74,17 @@ func (b *Bmatrix) JoinChannel(channel config.ChannelInfo) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (b *Bmatrix) Send(msg config.Message) error {
|
||||
func (b *Bmatrix) Send(msg config.Message) (string, error) {
|
||||
flog.Debugf("Receiving %#v", msg)
|
||||
channel := b.getRoomID(msg.Channel)
|
||||
flog.Debugf("Sending to channel %s", channel)
|
||||
if msg.Event == config.EVENT_USER_ACTION {
|
||||
b.mc.SendMessageEvent(channel, "m.room.message",
|
||||
matrix.TextMessage{"m.emote", msg.Username + msg.Text})
|
||||
return nil
|
||||
return "", nil
|
||||
}
|
||||
b.mc.SendText(channel, msg.Username+msg.Text)
|
||||
return nil
|
||||
return "", nil
|
||||
}
|
||||
|
||||
func (b *Bmatrix) getRoomID(channel string) string {
|
||||
|
Reference in New Issue
Block a user