From 05f0864ded4c0d5b2944da460db49564f9e88322 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 6 Jan 2024 14:55:42 -0600 Subject: oops --- src/slskd/Application.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs index fd2a2487..fe754220 100644 --- a/src/slskd/Application.cs +++ b/src/slskd/Application.cs @@ -477,7 +477,7 @@ namespace slskd private Task EnqueueDownload(string username, IPEndPoint endpoint, string filename) { - if (IsBlacklisted(username, endpoint.Address)) + if (Users.IsBlacklisted(username, endpoint.Address)) { Log.Information("Rejected enqueue request for blacklisted user {Username} ({IP})", username, endpoint.Address); return Task.FromException(new DownloadEnqueueException($"File not shared.")); @@ -502,7 +502,7 @@ namespace slskd { Metrics.Browse.RequestsReceived.Inc(1); - if (IsBlacklisted(username, endpoint.Address)) + if (Users.IsBlacklisted(username, endpoint.Address)) { Log.Information("Returned empty browse listing for blacklisted user {Username} ({IP})", username, endpoint.Address); return new BrowseResponse(); @@ -965,7 +965,7 @@ namespace slskd /// A Task resolving an instance of Soulseek.Directory containing the contents of the requested directory. private async Task DirectoryContentsResponseResolver(string username, IPEndPoint endpoint, int token, string directory) { - if (IsBlacklisted(username, endpoint.Address)) + if (Users.IsBlacklisted(username, endpoint.Address)) { Log.Information("Returned empty directory listing for blacklisted user {Username} ({IP})", username, endpoint.Address); return new Soulseek.Directory(directory); @@ -1358,15 +1358,15 @@ namespace slskd /// The username of the requesting user. /// The IP endpoint of the requesting user. /// A Task resolving the UserInfo instance. - private Task UserInfoResolver(string username, IPEndPoint endpoint) + private async Task UserInfoResolver(string username, IPEndPoint endpoint) { if (Users.IsBlacklisted(username, endpoint.Address)) { - return Task.FromResult(new UserInfo( + return new UserInfo( description: Options.Soulseek.Description, uploadSlots: 0, queueLength: int.MaxValue, - hasFreeUploadSlot: false)); + hasFreeUploadSlot: false); } try @@ -1374,7 +1374,7 @@ namespace slskd // 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 - var groupName = Users.GetOrFetchGroup(username); + var groupName = await Users.GetOrFetchGroupAsync(username); var group = Transfers.Uploads.Queue.GetGroupInfo(groupName); // forecast the position at which this user would enter the queue if they were to request @@ -1392,7 +1392,7 @@ namespace slskd queueLength: forecastedPosition, hasFreeUploadSlot: forecastedPosition == 0); - return Task.FromResult(info); + return info; } catch (Exception ex) { -- cgit v1.2.3