diff options
author | Wim <wim@42.be> | 2017-04-16 00:16:24 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2017-04-16 00:16:24 +0200 |
commit | 4d2207aba7698fe5ed46c9ad5bc012ee93b68ef5 (patch) | |
tree | 94f8851db8f1aef8e2a5aebfacfdb53f5a41ad65 | |
parent | 17b8b86d68badfe27c29c7448548f9eb97dd26e9 (diff) | |
download | matterbridge-msglm-4d2207aba7698fe5ed46c9ad5bc012ee93b68ef5.tar.gz matterbridge-msglm-4d2207aba7698fe5ed46c9ad5bc012ee93b68ef5.tar.bz2 matterbridge-msglm-4d2207aba7698fe5ed46c9ad5bc012ee93b68ef5.zip |
Add support for edited messages (slack)
-rw-r--r-- | bridge/slack/slack.go | 5 | ||||
-rw-r--r-- | changelog.md | 1 | ||||
-rw-r--r-- | matterbridge.toml.sample | 8 |
3 files changed, 14 insertions, 0 deletions
diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index 5de6cf9b..9c9f3fc3 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -199,6 +199,11 @@ func (b *Bslack) handleSlackClient(mchan chan *MMMessage) { // ignore first message if count > 0 { flog.Debugf("Receiving from slackclient %#v", ev) + if !b.Config.EditDisable && ev.SubMessage != nil { + flog.Debugf("SubMessage %#v", ev.SubMessage) + ev.User = ev.SubMessage.User + ev.Text = ev.SubMessage.Text + b.Config.EditSuffix + } // use our own func because rtm.GetChannelInfo doesn't work for private channels channel, err := b.getChannelByID(ev.Channel) if err != nil { diff --git a/changelog.md b/changelog.md index fd640095..035ac2e9 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # v0.12.0 ## Changes +* general: edited messages are now being sent by default on discord/mattermost/telegram/gitter/slack. See "New Features" * gitter: The default support for edited messages enables experimental FAYE support for gitter. If you need stable code add EditDisable=true to your gitter configuration. diff --git a/matterbridge.toml.sample b/matterbridge.toml.sample index a54da452..531dba7b 100644 --- a/matterbridge.toml.sample +++ b/matterbridge.toml.sample @@ -364,6 +364,14 @@ NickFormatter="plain" #OPTIONAL (default 4) NicksPerRow=4 +#Disable sending of edits to other bridges +#OPTIONAL (default false) +EditDisable=true + +#Message to be appended to every edited message +#OPTIONAL (default empty) +EditSuffix=" (edited)" + #Whether to prefix messages from other bridges to mattermost with RemoteNickFormat #Useful if username overrides for incoming webhooks isn't enabled on the #slack server. If you set PrefixMessagesWithNick to true, each message |