summaryrefslogtreecommitdiffstats
path: root/bridge/telegram/telegram.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-05-15 23:23:10 +0200
committerWim <wim@42.be>2017-05-15 23:23:10 +0200
commit2888fd64b0a25e40541d0ac8b4e176ba46905f9f (patch)
tree7791a37bb3b16a8e2d13e8e3a90404cfd86d48ba /bridge/telegram/telegram.go
parent27c0f37e49ef7de3a18b1771620941b4158ccefb (diff)
downloadmatterbridge-msglm-2888fd64b0a25e40541d0ac8b4e176ba46905f9f.tar.gz
matterbridge-msglm-2888fd64b0a25e40541d0ac8b4e176ba46905f9f.tar.bz2
matterbridge-msglm-2888fd64b0a25e40541d0ac8b4e176ba46905f9f.zip
Add UseFirstName option (telegram). Closes #144
Diffstat (limited to 'bridge/telegram/telegram.go')
-rw-r--r--bridge/telegram/telegram.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go
index 32269241..8631f2f9 100644
--- a/bridge/telegram/telegram.go
+++ b/bridge/telegram/telegram.go
@@ -98,9 +98,14 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) {
message.Text = message.Text + b.Config.EditSuffix
}
if message.From != nil {
- username = message.From.FirstName
+ if b.Config.UseFirstName {
+ username = message.From.FirstName
+ }
if username == "" {
username = message.From.UserName
+ if username == "" {
+ username = message.From.FirstName
+ }
}
text = message.Text
channel = strconv.FormatInt(message.Chat.ID, 10)