diff --git a/user.go b/user.go index 807b262..7ab56be 100644 --- a/user.go +++ b/user.go @@ -277,10 +277,11 @@ func (user *User) Start() error { ) user.IM.LoginTestConfig = user.bridge.Config.IMessage.LoginTest cfg := user.AppleRegistration + cfgWasNil := false if cfg == nil { + cfgWasNil = true cfg = &ids.Config{} user.AppleRegistration = cfg - user.bridge.DB.KV.Delete(database.KVHackyNACErrorPersistence) } ctx := user.zlog.WithContext(context.TODO()) err := user.IM.Configure(ctx, cfg, false) @@ -289,6 +290,9 @@ func (user *User) Start() error { user.BridgeState.Send(status.BridgeState{StateEvent: status.StateUnknownError, Error: "im-albert-fail"}) return err } + if cfgWasNil { + user.bridge.DB.KV.Delete(database.KVHackyNACErrorPersistence) + } go user.IM.Run(user.zlog, nil, nil) if user.bridge.DB.KV.Get(database.KVLookedForPortals) != "true" {