feat: config setting to default show/hide private info

This commit is contained in:
spiral 2021-12-06 04:01:42 -05:00
parent 455830a2b5
commit 32bea51e18
No known key found for this signature in database
GPG key ID: A6059F0CA0E1BD31
14 changed files with 71 additions and 17 deletions

View file

@ -69,7 +69,7 @@ public class MemberEdit
$" To set one, type `pk;member {target.Reference()} description <description>`.";
if (!target.DescriptionPrivacy.CanAccess(ctx.LookupContextFor(target.System)))
throw Errors.LookupNotAllowed;
throw target.System == ctx.System?.Id ? Errors.LookupHidden : Errors.LookupNotAllowed;
if (ctx.MatchRaw())
{
@ -125,7 +125,7 @@ public class MemberEdit
noPronounsSetMessage += $"To set some, type `pk;member {target.Reference()} pronouns <pronouns>`.";
if (!target.PronounPrivacy.CanAccess(ctx.LookupContextFor(target.System)))
throw Errors.LookupNotAllowed;
throw target.System == ctx.System?.Id ? Errors.LookupHidden : Errors.LookupNotAllowed;
if (ctx.MatchRaw())
{
@ -293,7 +293,7 @@ public class MemberEdit
else if (!ctx.HasNext())
{
if (!target.BirthdayPrivacy.CanAccess(ctx.LookupContextFor(target.System)))
throw Errors.LookupNotAllowed;
throw target.System == ctx.System?.Id ? Errors.LookupHidden : Errors.LookupNotAllowed;
if (target.Birthday == null)
await ctx.Reply("This member does not have a birthdate set."