Mare 0.9 (#17)
* add jwt expiry * bump api version * start rework permissions * ok so in theory this compiles * update api * update api * update api * update api once more * oh apiii I hate submodules * blabla * we only live to suffer * stop reading my commit messages * nothing to see here move along * update nuget * some rework --------- Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
This commit is contained in:
@@ -4,36 +4,24 @@ namespace MareSynchronos.API.Data.Extensions;
|
||||
|
||||
public static class GroupPermissionsExtensions
|
||||
{
|
||||
public static bool IsDisableAnimations(this GroupPermissions perm)
|
||||
{
|
||||
return perm.HasFlag(GroupPermissions.DisableAnimations);
|
||||
}
|
||||
|
||||
public static bool IsDisableSounds(this GroupPermissions perm)
|
||||
{
|
||||
return perm.HasFlag(GroupPermissions.DisableSounds);
|
||||
}
|
||||
|
||||
public static bool IsDisableInvites(this GroupPermissions perm)
|
||||
{
|
||||
return perm.HasFlag(GroupPermissions.DisableInvites);
|
||||
}
|
||||
|
||||
public static bool IsDisableVFX(this GroupPermissions perm)
|
||||
public static bool IsPreferDisableAnimations(this GroupPermissions perm)
|
||||
{
|
||||
return perm.HasFlag(GroupPermissions.DisableVFX);
|
||||
return perm.HasFlag(GroupPermissions.PreferDisableAnimations);
|
||||
}
|
||||
|
||||
public static void SetDisableAnimations(this ref GroupPermissions perm, bool set)
|
||||
public static bool IsPreferDisableSounds(this GroupPermissions perm)
|
||||
{
|
||||
if (set) perm |= GroupPermissions.DisableAnimations;
|
||||
else perm &= ~GroupPermissions.DisableAnimations;
|
||||
return perm.HasFlag(GroupPermissions.PreferDisableSounds);
|
||||
}
|
||||
|
||||
public static void SetDisableSounds(this ref GroupPermissions perm, bool set)
|
||||
public static bool IsPreferDisableVFX(this GroupPermissions perm)
|
||||
{
|
||||
if (set) perm |= GroupPermissions.DisableSounds;
|
||||
else perm &= ~GroupPermissions.DisableSounds;
|
||||
return perm.HasFlag(GroupPermissions.PreferDisableVFX);
|
||||
}
|
||||
|
||||
public static void SetDisableInvites(this ref GroupPermissions perm, bool set)
|
||||
@@ -42,9 +30,21 @@ public static class GroupPermissionsExtensions
|
||||
else perm &= ~GroupPermissions.DisableInvites;
|
||||
}
|
||||
|
||||
public static void SetDisableVFX(this ref GroupPermissions perm, bool set)
|
||||
public static void SetPreferDisableAnimations(this ref GroupPermissions perm, bool set)
|
||||
{
|
||||
if (set) perm |= GroupPermissions.DisableVFX;
|
||||
else perm &= ~GroupPermissions.DisableVFX;
|
||||
if (set) perm |= GroupPermissions.PreferDisableAnimations;
|
||||
else perm &= ~GroupPermissions.PreferDisableAnimations;
|
||||
}
|
||||
|
||||
public static void SetPreferDisableSounds(this ref GroupPermissions perm, bool set)
|
||||
{
|
||||
if (set) perm |= GroupPermissions.PreferDisableSounds;
|
||||
else perm &= ~GroupPermissions.PreferDisableSounds;
|
||||
}
|
||||
|
||||
public static void SetPreferDisableVFX(this ref GroupPermissions perm, bool set)
|
||||
{
|
||||
if (set) perm |= GroupPermissions.PreferDisableVFX;
|
||||
else perm &= ~GroupPermissions.PreferDisableVFX;
|
||||
}
|
||||
}
|
||||
@@ -4,25 +4,25 @@ namespace MareSynchronos.API.Data.Extensions;
|
||||
|
||||
public static class GroupUserInfoExtensions
|
||||
{
|
||||
public static bool IsModerator(this GroupUserInfo info)
|
||||
public static bool IsModerator(this GroupPairUserInfo info)
|
||||
{
|
||||
return info.HasFlag(GroupUserInfo.IsModerator);
|
||||
return info.HasFlag(GroupPairUserInfo.IsModerator);
|
||||
}
|
||||
|
||||
public static bool IsPinned(this GroupUserInfo info)
|
||||
public static bool IsPinned(this GroupPairUserInfo info)
|
||||
{
|
||||
return info.HasFlag(GroupUserInfo.IsPinned);
|
||||
return info.HasFlag(GroupPairUserInfo.IsPinned);
|
||||
}
|
||||
|
||||
public static void SetModerator(this ref GroupUserInfo info, bool isModerator)
|
||||
public static void SetModerator(this ref GroupPairUserInfo info, bool isModerator)
|
||||
{
|
||||
if (isModerator) info |= GroupUserInfo.IsModerator;
|
||||
else info &= ~GroupUserInfo.IsModerator;
|
||||
if (isModerator) info |= GroupPairUserInfo.IsModerator;
|
||||
else info &= ~GroupPairUserInfo.IsModerator;
|
||||
}
|
||||
|
||||
public static void SetPinned(this ref GroupUserInfo info, bool isPinned)
|
||||
public static void SetPinned(this ref GroupPairUserInfo info, bool isPinned)
|
||||
{
|
||||
if (isPinned) info |= GroupUserInfo.IsPinned;
|
||||
else info &= ~GroupUserInfo.IsPinned;
|
||||
if (isPinned) info |= GroupPairUserInfo.IsPinned;
|
||||
else info &= ~GroupPairUserInfo.IsPinned;
|
||||
}
|
||||
}
|
||||
@@ -4,47 +4,47 @@ namespace MareSynchronos.API.Data.Extensions;
|
||||
|
||||
public static class GroupUserPermissionsExtensions
|
||||
{
|
||||
public static bool IsDisableAnimations(this GroupUserPermissions perm)
|
||||
public static bool IsDisableAnimations(this GroupUserPreferredPermissions perm)
|
||||
{
|
||||
return perm.HasFlag(GroupUserPermissions.DisableAnimations);
|
||||
return perm.HasFlag(GroupUserPreferredPermissions.DisableAnimations);
|
||||
}
|
||||
|
||||
public static bool IsDisableSounds(this GroupUserPermissions perm)
|
||||
public static bool IsDisableSounds(this GroupUserPreferredPermissions perm)
|
||||
{
|
||||
return perm.HasFlag(GroupUserPermissions.DisableSounds);
|
||||
return perm.HasFlag(GroupUserPreferredPermissions.DisableSounds);
|
||||
}
|
||||
|
||||
public static bool IsPaused(this GroupUserPermissions perm)
|
||||
public static bool IsDisableVFX(this GroupUserPreferredPermissions perm)
|
||||
{
|
||||
return perm.HasFlag(GroupUserPermissions.Paused);
|
||||
return perm.HasFlag(GroupUserPreferredPermissions.DisableVFX);
|
||||
}
|
||||
|
||||
public static bool IsDisableVFX(this GroupUserPermissions perm)
|
||||
public static bool IsPaused(this GroupUserPreferredPermissions perm)
|
||||
{
|
||||
return perm.HasFlag(GroupUserPermissions.DisableVFX);
|
||||
return perm.HasFlag(GroupUserPreferredPermissions.Paused);
|
||||
}
|
||||
|
||||
public static void SetDisableAnimations(this ref GroupUserPermissions perm, bool set)
|
||||
public static void SetDisableAnimations(this ref GroupUserPreferredPermissions perm, bool set)
|
||||
{
|
||||
if (set) perm |= GroupUserPermissions.DisableAnimations;
|
||||
else perm &= ~GroupUserPermissions.DisableAnimations;
|
||||
if (set) perm |= GroupUserPreferredPermissions.DisableAnimations;
|
||||
else perm &= ~GroupUserPreferredPermissions.DisableAnimations;
|
||||
}
|
||||
|
||||
public static void SetDisableSounds(this ref GroupUserPermissions perm, bool set)
|
||||
public static void SetDisableSounds(this ref GroupUserPreferredPermissions perm, bool set)
|
||||
{
|
||||
if (set) perm |= GroupUserPermissions.DisableSounds;
|
||||
else perm &= ~GroupUserPermissions.DisableSounds;
|
||||
if (set) perm |= GroupUserPreferredPermissions.DisableSounds;
|
||||
else perm &= ~GroupUserPreferredPermissions.DisableSounds;
|
||||
}
|
||||
|
||||
public static void SetPaused(this ref GroupUserPermissions perm, bool set)
|
||||
public static void SetDisableVFX(this ref GroupUserPreferredPermissions perm, bool set)
|
||||
{
|
||||
if (set) perm |= GroupUserPermissions.Paused;
|
||||
else perm &= ~GroupUserPermissions.Paused;
|
||||
if (set) perm |= GroupUserPreferredPermissions.DisableVFX;
|
||||
else perm &= ~GroupUserPreferredPermissions.DisableVFX;
|
||||
}
|
||||
|
||||
public static void SetDisableVFX(this ref GroupUserPermissions perm, bool set)
|
||||
public static void SetPaused(this ref GroupUserPreferredPermissions perm, bool set)
|
||||
{
|
||||
if (set) perm |= GroupUserPermissions.DisableVFX;
|
||||
else perm &= ~GroupUserPermissions.DisableVFX;
|
||||
if (set) perm |= GroupUserPreferredPermissions.Paused;
|
||||
else perm &= ~GroupUserPreferredPermissions.Paused;
|
||||
}
|
||||
}
|
||||
@@ -4,16 +4,6 @@ namespace MareSynchronos.API.Data.Extensions;
|
||||
|
||||
public static class UserPermissionsExtensions
|
||||
{
|
||||
public static bool IsPaired(this UserPermissions perm)
|
||||
{
|
||||
return perm.HasFlag(UserPermissions.Paired);
|
||||
}
|
||||
|
||||
public static bool IsPaused(this UserPermissions perm)
|
||||
{
|
||||
return perm.HasFlag(UserPermissions.Paused);
|
||||
}
|
||||
|
||||
public static bool IsDisableAnimations(this UserPermissions perm)
|
||||
{
|
||||
return perm.HasFlag(UserPermissions.DisableAnimations);
|
||||
@@ -29,16 +19,14 @@ public static class UserPermissionsExtensions
|
||||
return perm.HasFlag(UserPermissions.DisableVFX);
|
||||
}
|
||||
|
||||
public static void SetPaired(this ref UserPermissions perm, bool paired)
|
||||
public static bool IsPaused(this UserPermissions perm)
|
||||
{
|
||||
if (paired) perm |= UserPermissions.Paired;
|
||||
else perm &= ~UserPermissions.Paired;
|
||||
return perm.HasFlag(UserPermissions.Paused);
|
||||
}
|
||||
|
||||
public static void SetPaused(this ref UserPermissions perm, bool paused)
|
||||
public static bool IsSticky(this UserPermissions perm)
|
||||
{
|
||||
if (paused) perm |= UserPermissions.Paused;
|
||||
else perm &= ~UserPermissions.Paused;
|
||||
return perm.HasFlag(UserPermissions.Sticky);
|
||||
}
|
||||
|
||||
public static void SetDisableAnimations(this ref UserPermissions perm, bool set)
|
||||
@@ -58,4 +46,16 @@ public static class UserPermissionsExtensions
|
||||
if (set) perm |= UserPermissions.DisableVFX;
|
||||
else perm &= ~UserPermissions.DisableVFX;
|
||||
}
|
||||
|
||||
public static void SetPaused(this ref UserPermissions perm, bool paused)
|
||||
{
|
||||
if (paused) perm |= UserPermissions.Paused;
|
||||
else perm &= ~UserPermissions.Paused;
|
||||
}
|
||||
|
||||
public static void SetSticky(this ref UserPermissions perm, bool sticky)
|
||||
{
|
||||
if (sticky) perm |= UserPermissions.Sticky;
|
||||
else perm &= ~UserPermissions.Sticky;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user