Skip to content

Commit e03fb75

Browse files
committed
Explicitly announce the sender of each file in Telegram, simplifying moderation
1 parent d16645c commit e03fb75

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

bridge/telegram/telegram.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ func (b *Btelegram) Send(msg config.Message) (string, error) {
159159
}
160160
// check if we have files to upload (from slack, telegram or mattermost)
161161
if len(msg.Extra["file"]) > 0 {
162+
if !b.GetBool("AnnounceFileSender") {
163+
if _, msgErr := b.sendMessage(chatid, topicid, msg.Username, "", parentID); msgErr != nil {
164+
b.Log.Errorf("sendMessage failed: %s", msgErr)
165+
}
166+
}
162167
return b.handleUploadFile(&msg, chatid, topicid, parentID)
163168
}
164169
}

matterbridge.toml.sample

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,10 @@ ShowTopicChange=false
10881088
#OPTIONAL (default false)
10891089
PreserveThreading=false
10901090

1091+
#Send an extra message indicating the sender for files.
1092+
#OPTIONAL (default false)
1093+
AnnounceFileSender=false
1094+
10911095
###################################################################
10921096
#rocketchat section
10931097
###################################################################

0 commit comments

Comments
 (0)