diff options
| author | JP Dillingham <jp@dillingham.me> | 2024-04-21 18:14:36 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2024-04-21 18:14:36 -0500 |
| commit | 4e2386deebe1bc5ede1d51aa29c126fc0f694c90 (patch) | |
| tree | ccbd9ba64768cdaa0210d3e8b73b18dde745442a /src/slskd | |
| parent | fabfad8e17222514c14ca540c3b0a9911e816f29 (diff) | |
| download | slskd-4e2386deebe1bc5ede1d51aa29c126fc0f694c90.tar.gz | |
add docs to events
Diffstat (limited to 'src/slskd')
| -rw-r--r-- | src/slskd/Users/UserService.cs | 12 |
1 files changed, 10 insertions, 2 deletions
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 file="UserService.cs" company="slskd Team"> +// <copyright file="UserService.cs" company="slskd Team"> // 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); |
