Skip to content

Commit

Permalink
Explicitly announce the sender of each file in Telegram, simplifying …
Browse files Browse the repository at this point in the history
…moderation
  • Loading branch information
BenWiederhake committed Sep 3, 2024
1 parent c4157a4 commit 8a2f7dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bridge/telegram/telegram.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
4 changes: 4 additions & 0 deletions matterbridge.toml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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
###################################################################
Expand Down

0 comments on commit 8a2f7dc

Please sign in to comment.