From 8b6bf2f2690e6da0857ac32fd007456145c20264 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sun, 24 Sep 2017 06:55:17 +0200 Subject: [PATCH] Fixed owners not being able to ban/kick users from clubs. --- .../Services/Database/Repositories/Impl/ClubRepository.cs | 1 + .../Database/Repositories/Impl/DiscordUserRepository.cs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/NadekoBot/Services/Database/Repositories/Impl/ClubRepository.cs b/src/NadekoBot/Services/Database/Repositories/Impl/ClubRepository.cs index 0977e3bf..8caa1838 100644 --- a/src/NadekoBot/Services/Database/Repositories/Impl/ClubRepository.cs +++ b/src/NadekoBot/Services/Database/Repositories/Impl/ClubRepository.cs @@ -32,6 +32,7 @@ namespace NadekoBot.Services.Database.Repositories.Impl .Include(x => x.Applicants) .ThenInclude(x => x.User) .Include(x => x.Owner) + .Include(x => x.Users) .FirstOrDefault(x => x.Owner.UserId == userId) ?? _context.Set() .Include(x => x.Club) diff --git a/src/NadekoBot/Services/Database/Repositories/Impl/DiscordUserRepository.cs b/src/NadekoBot/Services/Database/Repositories/Impl/DiscordUserRepository.cs index 5238198d..933d583b 100644 --- a/src/NadekoBot/Services/Database/Repositories/Impl/DiscordUserRepository.cs +++ b/src/NadekoBot/Services/Database/Repositories/Impl/DiscordUserRepository.cs @@ -42,12 +42,12 @@ namespace NadekoBot.Services.Database.Repositories.Impl { if (!_set.Where(y => y.UserId == id).Any()) { - return _set.Count(); + return _set.Count() + 1; } return _set.Count(x => x.TotalXp >= _set.Where(y => y.UserId == id) .DefaultIfEmpty() - .Sum(y => y.TotalXp)) + 1; + .Sum(y => y.TotalXp)); } public DiscordUser[] GetUsersXpLeaderboardFor(int page)