From 4a28ea700316315d8b970290d2399436b0a99527 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Thu, 7 Sep 2023 14:50:26 +0100 Subject: [PATCH] daemon: fix bug wiping out contact details records were being left alonge if "... err != nil", instead of "... err == nil". Sorry to anyone affected. --- daemon.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/daemon.go b/daemon.go index 320afac..3e62ae1 100644 --- a/daemon.go +++ b/daemon.go @@ -10,7 +10,7 @@ func (app *appContext) clearEmails() { emails := app.storage.GetEmails() for _, email := range emails { _, status, err := app.jf.UserByID(email.JellyfinID, false) - if status == 200 && err != nil { + if status == 200 && err == nil { continue } app.storage.DeleteEmailsKey(email.JellyfinID) @@ -23,7 +23,7 @@ func (app *appContext) clearDiscord() { discordUsers := app.storage.GetDiscord() for _, discordUser := range discordUsers { _, status, err := app.jf.UserByID(discordUser.JellyfinID, false) - if status == 200 && err != nil { + if status == 200 && err == nil { continue } app.storage.DeleteDiscordKey(discordUser.JellyfinID) @@ -36,7 +36,7 @@ func (app *appContext) clearMatrix() { matrixUsers := app.storage.GetMatrix() for _, matrixUser := range matrixUsers { _, status, err := app.jf.UserByID(matrixUser.JellyfinID, false) - if status == 200 && err != nil { + if status == 200 && err == nil { continue } app.storage.DeleteMatrixKey(matrixUser.JellyfinID) @@ -49,7 +49,7 @@ func (app *appContext) clearTelegram() { telegramUsers := app.storage.GetTelegram() for _, telegramUser := range telegramUsers { _, status, err := app.jf.UserByID(telegramUser.JellyfinID, false) - if status == 200 && err != nil { + if status == 200 && err == nil { continue } app.storage.DeleteTelegramKey(telegramUser.JellyfinID)