From e03fb7549893ad9c415e223534035457a09fb639 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Wed, 10 Jul 2024 20:24:48 +0200 Subject: [PATCH] Explicitly announce the sender of each file in Telegram, simplifying moderation --- bridge/telegram/telegram.go | 5 +++++ matterbridge.toml.sample | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go index e7885ca3e9..e95849fc2b 100644 --- a/bridge/telegram/telegram.go +++ b/bridge/telegram/telegram.go @@ -159,6 +159,11 @@ func (b *Btelegram) Send(msg config.Message) (string, error) { } // check if we have files to upload (from slack, telegram or mattermost) if len(msg.Extra["file"]) > 0 { + if !b.GetBool("AnnounceFileSender") { + if _, msgErr := b.sendMessage(chatid, topicid, msg.Username, "", parentID); msgErr != nil { + b.Log.Errorf("sendMessage failed: %s", msgErr) + } + } return b.handleUploadFile(&msg, chatid, topicid, parentID) } } diff --git a/matterbridge.toml.sample b/matterbridge.toml.sample index 0665a5992f..e5de69245d 100644 --- a/matterbridge.toml.sample +++ b/matterbridge.toml.sample @@ -1088,6 +1088,10 @@ ShowTopicChange=false #OPTIONAL (default false) PreserveThreading=false +#Send an extra message indicating the sender for files. +#OPTIONAL (default false) +AnnounceFileSender=false + ################################################################### #rocketchat section ###################################################################