summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-04-15 19:07:35 +0200
committerWim <wim@42.be>2017-04-15 19:07:35 +0200
commit7469732bbc84dbb60b6eafc29fb8d0771a48ba27 (patch)
treee68f515e09f3d6ce608098e68f3537302cfc3e40
parentd1dd6c34405c210f8bc44c78c425113e60ea221e (diff)
downloadmatterbridge-msglm-7469732bbc84dbb60b6eafc29fb8d0771a48ba27.tar.gz
matterbridge-msglm-7469732bbc84dbb60b6eafc29fb8d0771a48ba27.tar.bz2
matterbridge-msglm-7469732bbc84dbb60b6eafc29fb8d0771a48ba27.zip
Add support for edited messages (telegram)
-rw-r--r--bridge/telegram/telegram.go6
-rw-r--r--matterbridge.toml.sample8
2 files changed, 12 insertions, 2 deletions
diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go
index d6c2f255..32269241 100644
--- a/bridge/telegram/telegram.go
+++ b/bridge/telegram/telegram.go
@@ -85,15 +85,17 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) {
if update.ChannelPost != nil {
message = update.ChannelPost
}
- if update.EditedChannelPost != nil {
+ if update.EditedChannelPost != nil && !b.Config.EditDisable {
message = update.EditedChannelPost
+ message.Text = message.Text + b.Config.EditSuffix
}
// handle groups
if update.Message != nil {
message = update.Message
}
- if update.EditedMessage != nil {
+ if update.EditedMessage != nil && !b.Config.EditDisable {
message = update.EditedMessage
+ message.Text = message.Text + b.Config.EditSuffix
}
if message.From != nil {
username = message.From.FirstName
diff --git a/matterbridge.toml.sample b/matterbridge.toml.sample
index 2b2ee822..69c18164 100644
--- a/matterbridge.toml.sample
+++ b/matterbridge.toml.sample
@@ -435,6 +435,14 @@ Token="Yourtokenhere"
#See https://core.telegram.org/bots/api#html-style
MessageFormat=""
+#Disable sending of edits to other bridges
+#OPTIONAL (default false)
+EditDisable=false
+
+#Message to be appended to every edited message
+#OPTIONAL (default empty)
+EditSuffix=" (edited)"
+
#Nicks you want to ignore.
#Messages from those users will not be sent to other bridges.
#OPTIONAL