From 4e2386deebe1bc5ede1d51aa29c126fc0f694c90 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 21 Apr 2024 18:14:36 -0500 Subject: add docs to events --- src/slskd/Users/UserService.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/slskd/Users/UserService.cs b/src/slskd/Users/UserService.cs index 7a7de43a..757d9333 100644 --- a/src/slskd/Users/UserService.cs +++ b/src/slskd/Users/UserService.cs @@ -1,4 +1,4 @@ -// +// // Copyright (c) slskd Team. All rights reserved. // // This program is free software: you can redistribute it and/or modify @@ -91,8 +91,16 @@ namespace slskd.Users _ = GetStatisticsAsync(userStatus.Username); }; - Client.Connected += (_, _) => Reset(); + // it's important for us to force a reconfig at login to discard any users that were previously tracked + // specific scenario being; up and running for some time, offline for some time (days?), reconnect, are users still online? have stats changed? + // to avoid needing to go through and exhaustively check each user in the tracking dictionary, just delete it and let it be built back up + // any user we are downloading from will be tracked again when pending downloads are re-requested Client.LoggedIn += (_, _) => Configure(OptionsMonitor.CurrentValue, force: true); + + // working hand-in-hand with the forced reconfig on login, reset clears everything upon connect; clearing the way + // for the reconfig at login to rebuild it. i think. yeah, that sounds right. we don't ever want Configure() to reset anything + // so the connect is distinctly different from reconfig at login. + Client.Connected += (_, _) => Reset(); Client.PrivilegedUserListReceived += (_, list) => Client_PrivilegedUserListReceived(list); Configure(OptionsMonitor.CurrentValue); -- cgit v1.2.3