summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-04-23 23:29:15 +0200
committerWim <wim@42.be>2019-04-23 23:29:52 +0200
commit5f5d6c6e8a7d112aaa2a8b72ce8acf23337abec0 (patch)
treecbb01c20b05e2a52f45f37a5c0ab685d62224058
parentaefa8a93415c895ca5cbbdf4a6de696a8edde405 (diff)
downloadmatterbridge-msglm-5f5d6c6e8a7d112aaa2a8b72ce8acf23337abec0.tar.gz
matterbridge-msglm-5f5d6c6e8a7d112aaa2a8b72ce8acf23337abec0.tar.bz2
matterbridge-msglm-5f5d6c6e8a7d112aaa2a8b72ce8acf23337abec0.zip
Disable user lookups on delete messages (slack) (#812)
-rw-r--r--bridge/slack/handlers.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/bridge/slack/handlers.go b/bridge/slack/handlers.go
index 87102636..5a55949a 100644
--- a/bridge/slack/handlers.go
+++ b/bridge/slack/handlers.go
@@ -22,20 +22,20 @@ func (b *Bslack) handleSlack() {
time.Sleep(time.Second)
b.Log.Debug("Start listening for Slack messages")
for message := range messages {
- if message.Event != config.EventUserTyping {
+ // don't do any action on deleted/typing messages
+ if message.Event != config.EventUserTyping && message.Event != config.EventMsgDelete {
b.Log.Debugf("<= Sending message from %s on %s to gateway", message.Username, b.Account)
+ // cleanup the message
+ message.Text = b.replaceMention(message.Text)
+ message.Text = b.replaceVariable(message.Text)
+ message.Text = b.replaceChannel(message.Text)
+ message.Text = b.replaceURL(message.Text)
+ message.Text = html.UnescapeString(message.Text)
+
+ // Add the avatar
+ message.Avatar = b.users.getAvatar(message.UserID)
}
- // cleanup the message
- message.Text = b.replaceMention(message.Text)
- message.Text = b.replaceVariable(message.Text)
- message.Text = b.replaceChannel(message.Text)
- message.Text = b.replaceURL(message.Text)
- message.Text = html.UnescapeString(message.Text)
-
- // Add the avatar
- message.Avatar = b.users.getAvatar(message.UserID)
-
b.Log.Debugf("<= Message is %#v", message)
b.Remote <- *message
}