4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-08-10 23:28:08 +00:00

Modify Send() to return also a message id

This commit is contained in:
Wim
2017-08-27 22:59:37 +02:00
parent cfb8107138
commit 5a8d7b5f6d
13 changed files with 41 additions and 35 deletions

View File

@@ -97,15 +97,15 @@ func (b *Bgitter) JoinChannel(channel config.ChannelInfo) error {
return nil
}
func (b *Bgitter) Send(msg config.Message) error {
func (b *Bgitter) Send(msg config.Message) (string, error) {
flog.Debugf("Receiving %#v", msg)
roomID := b.getRoomID(msg.Channel)
if roomID == "" {
flog.Errorf("Could not find roomID for %v", msg.Channel)
return nil
return "", nil
}
// add ZWSP because gitter echoes our own messages
return b.c.SendMessage(roomID, msg.Username+msg.Text+" ")
return "", b.c.SendMessage(roomID, msg.Username+msg.Text+" ")
}
func (b *Bgitter) getRoomID(channel string) string {