Files
decePubClient/Models/Types/ExpandMedia.cs
T

30 lines
848 B
C#
Raw Normal View History

namespace decePubClient.Models.Types
{
/// <summary>How the persona's cards show media (Mastodon's reading:expand:media, set through /clientapi): Default hides
/// what its author marked sensitive, ShowAll shows everything, HideAll hides every picture, video and sound behind a
/// button.</summary>
public enum ExpandMedia
{
Default = 1,
ShowAll,
HideAll
}
/// <summary>ExpandMedia as PrivaPub names it ("default", "show_all", "hide_all").</summary>
public static class ExpandMediaModes
{
public static ExpandMedia Of(string mode) => mode switch
{
"show_all" => ExpandMedia.ShowAll,
"hide_all" => ExpandMedia.HideAll,
_ => ExpandMedia.Default
};
public static string Name(ExpandMedia mode) => mode switch
{
ExpandMedia.ShowAll => "show_all",
ExpandMedia.HideAll => "hide_all",
_ => "default"
};
}
}