feat(bot): -with-birthday flag on member lists
This commit is contained in:
parent
47449ecbc7
commit
44fe3d538a
@ -75,6 +75,8 @@ public static class ContextListExt
|
|||||||
p.IncludePronouns = true;
|
p.IncludePronouns = true;
|
||||||
if (ctx.MatchFlag("with-displayname", "wdn"))
|
if (ctx.MatchFlag("with-displayname", "wdn"))
|
||||||
p.IncludeDisplayName = true;
|
p.IncludeDisplayName = true;
|
||||||
|
if (ctx.MatchFlag("with-birthday", "wbd", "wb"))
|
||||||
|
p.IncludeBirthday = true;
|
||||||
|
|
||||||
// Always show the sort property, too (unless this is the short list)
|
// Always show the sort property, too (unless this is the short list)
|
||||||
if (p.Type != ListType.Short)
|
if (p.Type != ListType.Short)
|
||||||
@ -84,6 +86,7 @@ public static class ContextListExt
|
|||||||
if (p.SortProperty == SortProperty.CreationDate) p.IncludeCreated = true;
|
if (p.SortProperty == SortProperty.CreationDate) p.IncludeCreated = true;
|
||||||
if (p.SortProperty == SortProperty.LastSwitch) p.IncludeLastSwitch = true;
|
if (p.SortProperty == SortProperty.LastSwitch) p.IncludeLastSwitch = true;
|
||||||
if (p.SortProperty == SortProperty.LastMessage) p.IncludeLastMessage = true;
|
if (p.SortProperty == SortProperty.LastMessage) p.IncludeLastMessage = true;
|
||||||
|
if (p.SortProperty == SortProperty.Birthdate) p.IncludeBirthday = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the options are valid
|
// Make sure the options are valid
|
||||||
@ -197,6 +200,10 @@ public static class ContextListExt
|
|||||||
{
|
{
|
||||||
ret += $"({pronouns})";
|
ret += $"({pronouns})";
|
||||||
}
|
}
|
||||||
|
else if (opts.IncludeBirthday && m.BirthdayFor(lookupCtx) is {} birthday)
|
||||||
|
{
|
||||||
|
ret += $"(birthday: {m.BirthdayString})";
|
||||||
|
}
|
||||||
else if (m.HasProxyTags)
|
else if (m.HasProxyTags)
|
||||||
{
|
{
|
||||||
var proxyTagsString = m.ProxyTagsString();
|
var proxyTagsString = m.ProxyTagsString();
|
||||||
|
@ -40,6 +40,7 @@ public class ListOptions
|
|||||||
public bool IncludeAvatar { get; set; }
|
public bool IncludeAvatar { get; set; }
|
||||||
public bool IncludePronouns { get; set; }
|
public bool IncludePronouns { get; set; }
|
||||||
public bool IncludeDisplayName { get; set; }
|
public bool IncludeDisplayName { get; set; }
|
||||||
|
public bool IncludeBirthday { get; set; }
|
||||||
|
|
||||||
public string CreateFilterString()
|
public string CreateFilterString()
|
||||||
{
|
{
|
||||||
@ -174,6 +175,7 @@ public static class ListOptionsExt
|
|||||||
opts.IncludeAvatar,
|
opts.IncludeAvatar,
|
||||||
opts.IncludePronouns,
|
opts.IncludePronouns,
|
||||||
opts.IncludeDisplayName,
|
opts.IncludeDisplayName,
|
||||||
|
opts.IncludeBirthday,
|
||||||
}.Sum(x => Convert.ToInt32(x)) > 1;
|
}.Sum(x => Convert.ToInt32(x)) > 1;
|
||||||
|
|
||||||
if (hasMultipleIncluded)
|
if (hasMultipleIncluded)
|
||||||
|
Loading…
Reference in New Issue
Block a user