summaryrefslogtreecommitdiffstats
path: root/bridge/telegram/handlers.go
diff options
context:
space:
mode:
authorAlexander <emu.sas@gmail.com>2022-03-25 23:42:28 +0300
committerGitHub <noreply@github.com>2022-03-25 21:42:28 +0100
commitcc36ebf1c9191a6107637b26bd3dbc802f91eb4a (patch)
treec0d96006ebf661a246042535145ade4cfb82375f /bridge/telegram/handlers.go
parente6adecfd81c315689dd2e18a42b92422542211a4 (diff)
downloadmatterbridge-msglm-cc36ebf1c9191a6107637b26bd3dbc802f91eb4a.tar.gz
matterbridge-msglm-cc36ebf1c9191a6107637b26bd3dbc802f91eb4a.tar.bz2
matterbridge-msglm-cc36ebf1c9191a6107637b26bd3dbc802f91eb4a.zip
Add UseFullName option (telegram) (#1777)
Diffstat (limited to 'bridge/telegram/handlers.go')
-rw-r--r--bridge/telegram/handlers.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/bridge/telegram/handlers.go b/bridge/telegram/handlers.go
index 7710f106..d9b104a3 100644
--- a/bridge/telegram/handlers.go
+++ b/bridge/telegram/handlers.go
@@ -71,6 +71,9 @@ func (b *Btelegram) handleForwarded(rmsg *config.Message, message *tgbotapi.Mess
if b.GetBool("UseFirstName") {
usernameForward = message.ForwardFrom.FirstName
}
+ if b.GetBool("UseFullName") {
+ usernameForward = message.ForwardFrom.FirstName + " " + message.ForwardFrom.LastName
+ }
if usernameForward == "" {
usernameForward = message.ForwardFrom.UserName
@@ -94,6 +97,9 @@ func (b *Btelegram) handleQuoting(rmsg *config.Message, message *tgbotapi.Messag
if b.GetBool("UseFirstName") {
usernameReply = message.ReplyToMessage.From.FirstName
}
+ if b.GetBool("UseFullName") {
+ usernameReply = message.ReplyToMessage.From.FirstName + " " + message.ReplyToMessage.From.LastName
+ }
if usernameReply == "" {
usernameReply = message.ReplyToMessage.From.UserName
if usernameReply == "" {
@@ -117,6 +123,9 @@ func (b *Btelegram) handleUsername(rmsg *config.Message, message *tgbotapi.Messa
if b.GetBool("UseFirstName") {
rmsg.Username = message.From.FirstName
}
+ if b.GetBool("UseFullName") {
+ rmsg.Username = message.From.FirstName + " " + message.From.LastName
+ }
if rmsg.Username == "" {
rmsg.Username = message.From.UserName
if rmsg.Username == "" {
@@ -134,6 +143,9 @@ func (b *Btelegram) handleUsername(rmsg *config.Message, message *tgbotapi.Messa
if b.GetBool("UseFirstName") {
rmsg.Username = message.SenderChat.FirstName
}
+ if b.GetBool("UseFullName") {
+ rmsg.Username = message.SenderChat.FirstName + " " + message.SenderChat.LastName
+ }
if rmsg.Username == "" || rmsg.Username == "Channel_Bot" {
rmsg.Username = message.SenderChat.UserName