Show sorted field on the long list by default

This commit is contained in:
Ske
2020-06-28 18:07:50 +02:00
parent 3207fcff1b
commit 9420cb56f8
2 changed files with 16 additions and 9 deletions

View File

@@ -53,9 +53,16 @@ namespace PluralKit.Bot
public bool ShowLastSwitch = false;
public bool ShowLastMessage = false;
public static MemberFields FromFlags(Context ctx)
public static MemberFields FromFlags(Context ctx, SortFilterOptions opts)
{
var def = new MemberFields();
var def = new MemberFields
{
// Add some defaults depending on sort order
ShowLastMessage = opts.SortProperty == SortProperty.LastMessage,
ShowLastSwitch = opts.SortProperty == SortProperty.LastSwitch,
ShowMessageCount = opts.SortProperty == SortProperty.MessageCount
};
if (ctx.MatchFlag("with-last-switch", "with-last-fronted", "with-last-front", "wls", "wlf"))
def.ShowLastSwitch = true;
if (ctx.MatchFlag("with-message-count", "wmc"))