location #20

Merged
defnotken merged 5 commits from location into main 2025-12-31 14:12:12 +00:00
4 changed files with 5 additions and 13 deletions
Showing only changes of commit 03243c93c6 - Show all commits

View File

@@ -9,5 +9,4 @@ public enum UserPermissions
DisableSounds = 4,
DisableVFX = 8,
Sticky = 16,
ShareLocation = 32,
}

View File

@@ -28,10 +28,6 @@ public static class UserPermissionsExtensions
{
return perm.HasFlag(UserPermissions.Sticky);
}
public static bool IsSharingLocation(this UserPermissions perm)
{
return perm.HasFlag(UserPermissions.ShareLocation);
}
public static void SetDisableAnimations(this ref UserPermissions perm, bool set)
{
@@ -62,10 +58,4 @@ public static class UserPermissionsExtensions
if (sticky) perm |= UserPermissions.Sticky;
else perm &= ~UserPermissions.Sticky;
}
public static void SetShareLocation(this ref UserPermissions perm, bool? set)
{
if (set == true) perm |= UserPermissions.ShareLocation;
else perm &= ~UserPermissions.ShareLocation;
}
}

View File

@@ -9,4 +9,7 @@ namespace LightlessSync.API.Dto.User;
public record LocationDto(UserData User, LocationInfo Location);
[MessagePackObject(keyAsPropertyName: true)]
public record LocationWithTimeDto(LocationDto Location, DateTimeOffset ExpireAt);
public record LocationWithTimeDto(LocationDto Location, DateTimeOffset ExpireAt);
[MessagePackObject(keyAsPropertyName: true)]
public record SharingStatusDto(UserData User, DateTimeOffset ExpireAt);

View File

@@ -118,7 +118,7 @@ public interface ILightlessHub
Task SetChatParticipantMute(ChatParticipantMuteRequestDto request);
Task UpdateLocation(LocationDto locationDto, bool offline);
Task<List<LocationWithTimeDto>> RequestAllLocationInfo();
Task<(List<LocationWithTimeDto>, List<SharingStatusDto>)> RequestAllLocationInfo();
Task ToggleLocationSharing(LocationSharingToggleDto dto);
}