From 7399e8bac14d5fb1653bcd3c6149641bd9a1acbd Mon Sep 17 00:00:00 2001 From: Toastie Date: Tue, 6 Aug 2024 22:38:09 +1200 Subject: [PATCH] small cleanup in clubs --- src/EllieBot/Modules/Xp/Club/ClubService.cs | 11 +++++------ src/EllieBot/Modules/Xp/Club/IClubService.cs | 2 -- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/EllieBot/Modules/Xp/Club/ClubService.cs b/src/EllieBot/Modules/Xp/Club/ClubService.cs index d143ff5..0c63913 100644 --- a/src/EllieBot/Modules/Xp/Club/ClubService.cs +++ b/src/EllieBot/Modules/Xp/Club/ClubService.cs @@ -1,4 +1,3 @@ -#nullable disable using LinqToDB; using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; @@ -99,9 +98,9 @@ public class ClubService : IEService, IClubService return member; } - public async Task SetClubIconAsync(ulong ownerUserId, string url) + public async Task SetClubIconAsync(ulong ownerUserId, string? url) { - if (url is not null) + if (!string.IsNullOrWhiteSpace(url)) { using var http = _httpFactory.CreateClient(); using var temp = await http.GetAsync(url, HttpCompletionOption.ResponseHeadersRead); @@ -174,7 +173,7 @@ public class ClubService : IEService, IClubService } - public ClubAcceptResult AcceptApplication(ulong clubOwnerUserId, string userName, out DiscordUser discordUser) + public ClubAcceptResult AcceptApplication(ulong clubOwnerUserId, string userName, out DiscordUser? discordUser) { discordUser = null; using var uow = _db.GetDbContext(); @@ -200,7 +199,7 @@ public class ClubService : IEService, IClubService return ClubAcceptResult.Accepted; } - public ClubDenyResult RejectApplication(ulong clubOwnerUserId, string userName, out DiscordUser discordUser) + public ClubDenyResult RejectApplication(ulong clubOwnerUserId, string userName, out DiscordUser? discordUser) { discordUser = null; using var uow = _db.GetDbContext(); @@ -241,7 +240,7 @@ public class ClubService : IEService, IClubService return ClubLeaveResult.Success; } - public bool SetDescription(ulong userId, string desc) + public bool SetDescription(ulong userId, string? desc) { using var uow = _db.GetDbContext(); var club = uow.Set().GetByOwner(userId); diff --git a/src/EllieBot/Modules/Xp/Club/IClubService.cs b/src/EllieBot/Modules/Xp/Club/IClubService.cs index 8a45e8d..863d81f 100644 --- a/src/EllieBot/Modules/Xp/Club/IClubService.cs +++ b/src/EllieBot/Modules/Xp/Club/IClubService.cs @@ -12,8 +12,6 @@ public interface IClubService Task SetClubIconAsync(ulong ownerUserId, string? url); bool GetClubByName(string clubName, out ClubInfo club); ClubApplyResult ApplyToClub(IUser user, ClubInfo club); - ClubAcceptResult AcceptApplication(ulong clubOwnerUserId, string userName, out DiscordUser discordUser); - ClubDenyResult RejectApplication(ulong clubOwnerUserId, string userName, out DiscordUser discordUser); ClubInfo? GetClubWithBansAndApplications(ulong ownerUserId); ClubLeaveResult LeaveClub(IUser user); bool SetDescription(ulong userId, string? desc);