summaryrefslogtreecommitdiffstats
path: root/bridge/telegram
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/telegram')
-rw-r--r--bridge/telegram/telegram.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go
index 91e2e767..c2f69c3d 100644
--- a/bridge/telegram/telegram.go
+++ b/bridge/telegram/telegram.go
@@ -180,6 +180,24 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) {
b.handleDownload(message.Document, &fmsg)
}
+ if message.ForwardFrom != nil {
+ text = "Forward from " + message.ForwardFrom.FirstName
+ usernameForward := ""
+ if b.Config.UseFirstName {
+ usernameForward = message.ForwardFrom.FirstName
+ }
+ if usernameForward == "" {
+ usernameForward = message.ForwardFrom.UserName
+ if usernameForward == "" {
+ usernameForward = message.ForwardFrom.FirstName
+ }
+ }
+ if usernameForward == "" {
+ usernameForward = "unknown"
+ }
+ text = "Forwarded from " + usernameForward + ": " + text
+ }
+
// quote the previous message
if message.ReplyToMessage != nil {
usernameReply := ""