commit d393d1b41cbeb3bb1301fc0e43f97966e7bb7ff1
Author: Wim <wim@42.be>
Date: Fri Jan 27 23:59:24 2017 +0000
diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go
index e17c780..38d7fd1 100644
--- a/bridge/telegram/telegram.go
+++ b/bridge/telegram/telegram.go
@@ -1359 +1359 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) {
if username == "" {
username = update.ChannelPost.From.UserName
}
- text = update.ChannelPost.Text
- channel = strconv.FormatInt(update.ChannelPost.Chat.ID, 10)
}
+ text = update.ChannelPost.Text
+ channel = strconv.FormatInt(update.ChannelPost.Chat.ID, 10)
}
// handle groups
if update.Message != nil {
@@ -14611 +14616 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) {
if username == "" {
username = update.Message.From.UserName
}
- text = update.Message.Text
- channel = strconv.FormatInt(update.Message.Chat.ID, 10)
}
+ text = update.Message.Text
+ channel = strconv.FormatInt(update.Message.Chat.ID, 10)
+ }
+ if username == "" {
+ username = "unknown"
+ }
+ if text != "" {
+ flog.Debugf("Sending message from %s on %s to gateway", username, b.Account)
+ b.Remote <- config.Message{Username: username, Text: text, Channel: channel, Account: b.Account}
}
- flog.Debugf("Sending message from %s on %s to gateway", username, b.Account)
- b.Remote <- config.Message{Username: username, Text: text, Channel: channel, Account: b.Account}
}
}