Disable user lookups on delete messages (slack) (#812)

This commit is contained in:
Wim 2019-04-23 23:29:15 +02:00 committed by GitHub
parent 9be0be0316
commit 65781b9316
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,10 +22,9 @@ func (b *Bslack) handleSlack() {
time.Sleep(time.Second) time.Sleep(time.Second)
b.Log.Debug("Start listening for Slack messages") b.Log.Debug("Start listening for Slack messages")
for message := range 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) b.Log.Debugf("<= Sending message from %s on %s to gateway", message.Username, b.Account)
}
// cleanup the message // cleanup the message
message.Text = b.replaceMention(message.Text) message.Text = b.replaceMention(message.Text)
message.Text = b.replaceVariable(message.Text) message.Text = b.replaceVariable(message.Text)
@ -35,6 +34,7 @@ func (b *Bslack) handleSlack() {
// Add the avatar // Add the avatar
message.Avatar = b.users.getAvatar(message.UserID) message.Avatar = b.users.getAvatar(message.UserID)
}
b.Log.Debugf("<= Message is %#v", message) b.Log.Debugf("<= Message is %#v", message)
b.Remote <- *message b.Remote <- *message