diff options
| author | JP Dillingham <jp@dillingham.me> | 2024-01-01 18:43:18 -0600 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2024-01-01 18:43:18 -0600 |
| commit | 1cd4b10a25052e4e82c1f86a9bc92f06f5605114 (patch) | |
| tree | 2ef809c949945e44de0df0e914134a34ebb06a16 /src/slskd/Application.cs | |
| parent | d409b1e3e371cfe8fd1e59e9ad53b0f7e4edafca (diff) | |
| download | slskd-1cd4b10a25052e4e82c1f86a9bc92f06f5605114.tar.gz | |
wip
Diffstat (limited to 'src/slskd/Application.cs')
| -rw-r--r-- | src/slskd/Application.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs index 6e430fe5..506f08ac 100644 --- a/src/slskd/Application.cs +++ b/src/slskd/Application.cs @@ -1357,13 +1357,21 @@ namespace slskd /// <returns>A Task resolving the UserInfo instance.</returns> private Task<UserInfo> UserInfoResolver(string username, IPEndPoint endpoint) { + if (IsBlacklisted(username, endpoint.Address)) + { + return Task.FromResult(new UserInfo( + description: Options.Soulseek.Description, + uploadSlots: 0, + queueLength: int.MaxValue, + hasFreeUploadSlot: false)); + } + try { // note: users must first be watched or cached for leech and privilege detection to work. // we are deliberately skipping it here; if the username is watched // leech detection works and they get accurate info, if not, they won't - // todo: add a fetch of user info to ensure group accuracy - var groupName = Users.ResolveGroup(username); + var groupName = Users.GetGroup(username); var group = Transfers.Uploads.Queue.GetGroupInfo(groupName); // forecast the position at which this user would enter the queue if they were to request |
