exists -> ok

This commit is contained in:
Slavi Pantaleev
2022-08-25 21:44:06 +03:00
parent a093de51c4
commit 8507af670a
2 changed files with 4 additions and 4 deletions

View File

@@ -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

View File

@@ -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
}