From 8507af670ad4d32f91fe26ce19aae6399a26b0b5 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 25 Aug 2022 21:44:06 +0300 Subject: [PATCH] exists -> ok --- bot/settings.go | 4 ++-- bot/sync.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bot/settings.go b/bot/settings.go index 01b0955..24cd418 100644 --- a/bot/settings.go +++ b/bot/settings.go @@ -39,8 +39,8 @@ func (s settings) Allowed(noowner bool, userID id.UserID) bool { func (s settings) Get(key string) string { value := s[strings.ToLower(strings.TrimSpace(key))] - sanitizer, exists := sanitizers[key] - if exists { + sanitizer, ok := sanitizers[key] + if ok { return sanitizer(value) } return value diff --git a/bot/sync.go b/bot/sync.go index 79cf381..0781a39 100644 --- a/bot/sync.go +++ b/bot/sync.go @@ -92,8 +92,8 @@ func (b *Bot) onEncryptedMessage(evt *event.Event) { func (b *Bot) onBotJoin(evt *event.Event, hub *sentry.Hub) { // Workaround for membership=join events which are delivered to us twice, // as described in this bug report: https://github.com/matrix-org/synapse/issues/9768 - _, exists := b.handledJoinEvents.LoadOrStore(evt.ID, true) - if exists { + _, ok := b.handledJoinEvents.LoadOrStore(evt.ID, true) + if ok { b.log.Info("Suppressing already handled event %s", evt.ID) return }