Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit 91946a56437f7e14d13fc6526046fd838e00d1b3 Author: Wim <wim@42.be> Date: Mon Oct 25 00:08:08 2021 +0000 Do not check cache on deleted messages (mattermost). Fixes #1555 (#1624) diff --git a/go.mod b/go.mod index 2e2a486..43d84e3 100644 --- a/go.mod +++ b/go.mod @@ -277 +277 @@ require (   github.com/matterbridge/go-xmpp v0.0.0-20210731150933-5702291c239f   github.com/matterbridge/gozulipbot v0.0.0-20211023205727-a19d6c1f3b75   github.com/matterbridge/logrus-prefixed-formatter v0.5.3-0.20200523233437-d971309a77ba - github.com/matterbridge/matterclient v0.0.0-20211021135437-2dc2bc7dce2d + github.com/matterbridge/matterclient v0.0.0-20211024214211-22e762684b4a   github.com/mattermost/mattermost-server/v5 v5.39.0   github.com/mattermost/mattermost-server/v6 v6.0.0   github.com/mattn/godown v0.0.1 diff --git a/go.sum b/go.sum index b93c1b4..bf995f7 100644 --- a/go.sum +++ b/go.sum @@ -6658 +6658 @@ github.com/matterbridge/gozulipbot v0.0.0-20211023205727-a19d6c1f3b75 h1:GslZKF7  github.com/matterbridge/gozulipbot v0.0.0-20211023205727-a19d6c1f3b75/go.mod h1:yAjnZ34DuDyPHMPHHjOsTk/FefW4JJjoMMCGt/8uuQA=  github.com/matterbridge/logrus-prefixed-formatter v0.5.3-0.20200523233437-d971309a77ba h1:XleOY4IjAEIcxAh+IFwT5JT5Ze3RHiYz6m+4ZfZ0rc0=  github.com/matterbridge/logrus-prefixed-formatter v0.5.3-0.20200523233437-d971309a77ba/go.mod h1:iXGEotOvwI1R1SjLxRc+BF5rUORTMtE0iMZBT2lxqAU= -github.com/matterbridge/matterclient v0.0.0-20211021135437-2dc2bc7dce2d h1:zOIeYDh2WcqEZkJTiV5tHynjuP40IFHubliqhvfhc/0= -github.com/matterbridge/matterclient v0.0.0-20211021135437-2dc2bc7dce2d/go.mod h1:Gh3tFUjkcPIBBeEkfXBbGio4ONMMKNmlmGECvXLY0TE= +github.com/matterbridge/matterclient v0.0.0-20211024214211-22e762684b4a h1:j5/5gEHtACfrG/Exygfjqj0ip/zRgsa8KaAyuvO2c5Y= +github.com/matterbridge/matterclient v0.0.0-20211024214211-22e762684b4a/go.mod h1:Gh3tFUjkcPIBBeEkfXBbGio4ONMMKNmlmGECvXLY0TE=  github.com/mattermost/go-i18n v1.11.0 h1:1hLKqn/ZvhZ80OekjVPGYcCrBfMz+YxNNgqS+beL7zE=  github.com/mattermost/go-i18n v1.11.0/go.mod h1:RyS7FDNQlzF1PsjbJWHRI35exqaKGSO9qD4iv8QjE34=  github.com/mattermost/gorp v1.6.2-0.20210419141818-0904a6a388d3/go.mod h1:QCQ3U0M9T/BlAdjKFJo0I1oe/YAgbyjNdhU8bpOLafk= diff --git a/matterclient/messages.go b/matterclient/messages.go index ad66462..81c3ecb 100644 --- a/matterclient/messages.go +++ b/matterclient/messages.go @@ -97 +97 @@ import (  func (m *MMClient) parseActionPost(rmsg *Message) {   // add post to cache, if it already exists don't relay this again.   // this should fix reposts - if ok, _ := m.lruCache.ContainsOrAdd(digestString(rmsg.Raw.Data["post"].(string)), true); ok { + if ok, _ := m.lruCache.ContainsOrAdd(digestString(rmsg.Raw.Data["post"].(string)), true); ok && rmsg.Raw.Event != model.WEBSOCKET_EVENT_POST_DELETED {   m.logger.Debugf("message %#v in cache, not processing again", rmsg.Raw.Data["post"].(string))   rmsg.Text = ""   return