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:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user