Merge pull request #342 from Spectralitree/fixgroupiconprivacy

Fix looking up private group icons
This commit is contained in:
Astrid 2021-05-30 16:55:28 +02:00 committed by GitHub
commit 549877c816
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -153,6 +153,9 @@ namespace PluralKit.Bot
} }
else if (!ctx.HasNext()) else if (!ctx.HasNext())
{ {
if (!target.DescriptionPrivacy.CanAccess(ctx.LookupContextFor(target.System)))
throw Errors.LookupNotAllowed;
if (target.Description == null) if (target.Description == null)
if (ctx.System?.Id == target.System) if (ctx.System?.Id == target.System)
await ctx.Reply($"This group does not have a description set. To set one, type `pk;group {target.Reference()} description <description>`."); await ctx.Reply($"This group does not have a description set. To set one, type `pk;group {target.Reference()} description <description>`.");
@ -218,6 +221,8 @@ namespace PluralKit.Bot
async Task ShowIcon() async Task ShowIcon()
{ {
if (!target.IconPrivacy.CanAccess(ctx.LookupContextFor(target.System)))
throw Errors.LookupNotAllowed;
if ((target.Icon?.Trim() ?? "").Length > 0) if ((target.Icon?.Trim() ?? "").Length > 0)
{ {
var eb = new EmbedBuilder() var eb = new EmbedBuilder()