Lightfinder merge into group changes
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
namespace LightlessSync.API.Data;
|
namespace LightlessSync.API.Data;
|
||||||
|
|
||||||
[MessagePackObject(keyAsPropertyName: true)]
|
[MessagePackObject(keyAsPropertyName: true)]
|
||||||
public record UserData(string UID, string? Alias = null)
|
public record UserData(string UID, string? Alias = null, bool IsAdmin = false, bool IsModerator = false)
|
||||||
{
|
{
|
||||||
[IgnoreMember]
|
[IgnoreMember]
|
||||||
public string AliasOrUID => string.IsNullOrWhiteSpace(Alias) ? UID : Alias;
|
public string AliasOrUID => string.IsNullOrWhiteSpace(Alias) ? UID : Alias;
|
||||||
|
|||||||
11
LightlessSyncAPI/Dto/Group/GroupBroadcastRequestDto.cs
Normal file
11
LightlessSyncAPI/Dto/Group/GroupBroadcastRequestDto.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
using MessagePack;
|
||||||
|
|
||||||
|
namespace LightlessSync.API.Dto.Group;
|
||||||
|
|
||||||
|
[MessagePackObject(keyAsPropertyName: true)]
|
||||||
|
public sealed class GroupBroadcastRequestDto
|
||||||
|
{
|
||||||
|
public required string GID { get; init; }
|
||||||
|
public string? HashedCID { get; set; }
|
||||||
|
public required bool Enabled { get; init; }
|
||||||
|
}
|
||||||
12
LightlessSyncAPI/Dto/Group/GroupJoinHashedDto.cs
Normal file
12
LightlessSyncAPI/Dto/Group/GroupJoinHashedDto.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using LightlessSync.API.Data;
|
||||||
|
using LightlessSync.API.Data.Enum;
|
||||||
|
using MessagePack;
|
||||||
|
|
||||||
|
namespace LightlessSync.API.Dto.Group;
|
||||||
|
|
||||||
|
[MessagePackObject(keyAsPropertyName: true)]
|
||||||
|
public record GroupJoinHashedDto(
|
||||||
|
GroupData Group,
|
||||||
|
string HashedPassword,
|
||||||
|
GroupUserPreferredPermissions GroupUserPreferredPermissions
|
||||||
|
);
|
||||||
9
LightlessSyncAPI/Dto/User/BroadcastStatusBatchDto.cs
Normal file
9
LightlessSyncAPI/Dto/User/BroadcastStatusBatchDto.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
using MessagePack;
|
||||||
|
|
||||||
|
namespace LightlessSync.API.Dto.User;
|
||||||
|
|
||||||
|
[MessagePackObject(keyAsPropertyName: true)]
|
||||||
|
public sealed class BroadcastStatusBatchDto
|
||||||
|
{
|
||||||
|
public Dictionary<string, BroadcastStatusInfoDto> Results { get; init; } = new();
|
||||||
|
}
|
||||||
12
LightlessSyncAPI/Dto/User/BroadcastStatusInfoDto.cs
Normal file
12
LightlessSyncAPI/Dto/User/BroadcastStatusInfoDto.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using MessagePack;
|
||||||
|
|
||||||
|
namespace LightlessSync.API.Dto.User;
|
||||||
|
|
||||||
|
[MessagePackObject(keyAsPropertyName: true)]
|
||||||
|
public sealed class BroadcastStatusInfoDto
|
||||||
|
{
|
||||||
|
public required string HashedCID { get; init; }
|
||||||
|
public required bool IsBroadcasting { get; init; }
|
||||||
|
public TimeSpan? TTL { get; init; }
|
||||||
|
public string? GID { get; init; }
|
||||||
|
}
|
||||||
12
LightlessSyncAPI/Dto/User/BroadcastStatusRequestDto.cs
Normal file
12
LightlessSyncAPI/Dto/User/BroadcastStatusRequestDto.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using MessagePack;
|
||||||
|
|
||||||
|
namespace LightlessSync.API.Dto.User;
|
||||||
|
|
||||||
|
[MessagePackObject(keyAsPropertyName: true)]
|
||||||
|
public sealed class BroadcastStatusRequestDto
|
||||||
|
{
|
||||||
|
public required string HashedCID { get; init; }
|
||||||
|
public required bool Enabled { get; init; }
|
||||||
|
public string? GID { get; init; }
|
||||||
|
}
|
||||||
|
|
||||||
@@ -56,6 +56,7 @@ public interface ILightlessHub
|
|||||||
Task<List<BannedGroupUserDto>> GroupGetBannedUsers(GroupDto group);
|
Task<List<BannedGroupUserDto>> GroupGetBannedUsers(GroupDto group);
|
||||||
Task<GroupJoinInfoDto> GroupJoin(GroupPasswordDto passwordedGroup);
|
Task<GroupJoinInfoDto> GroupJoin(GroupPasswordDto passwordedGroup);
|
||||||
Task<bool> GroupJoinFinalize(GroupJoinDto passwordedGroup);
|
Task<bool> GroupJoinFinalize(GroupJoinDto passwordedGroup);
|
||||||
|
Task<GroupJoinInfoDto> GroupJoinHashed(GroupJoinHashedDto dto);
|
||||||
Task GroupLeave(GroupDto group);
|
Task GroupLeave(GroupDto group);
|
||||||
Task GroupRemoveUser(GroupPairDto groupPair);
|
Task GroupRemoveUser(GroupPairDto groupPair);
|
||||||
Task<GroupProfileDto> GroupGetProfile(GroupDto dto);
|
Task<GroupProfileDto> GroupGetProfile(GroupDto dto);
|
||||||
@@ -66,6 +67,15 @@ public interface ILightlessHub
|
|||||||
Task<int> GroupPrune(GroupDto group, int days, bool execute);
|
Task<int> GroupPrune(GroupDto group, int days, bool execute);
|
||||||
|
|
||||||
Task UserAddPair(UserDto user);
|
Task UserAddPair(UserDto user);
|
||||||
|
Task TryPairWithContentId(string otherCid, string myCid);
|
||||||
|
|
||||||
|
Task SetBroadcastStatus(string hashedCid, bool enabled, GroupBroadcastRequestDto? groupDto = null);
|
||||||
|
Task<bool> SetGroupBroadcastStatus(GroupBroadcastRequestDto dto);
|
||||||
|
Task<List<GroupJoinDto>> GetBroadcastedGroups(List<BroadcastStatusInfoDto> broadcastEntries);
|
||||||
|
Task<BroadcastStatusInfoDto?> IsUserBroadcasting(string hashedCid);
|
||||||
|
Task<BroadcastStatusBatchDto> AreUsersBroadcasting(List<string> hashedCids);
|
||||||
|
Task<TimeSpan?> GetBroadcastTtl(string hashedCid);
|
||||||
|
|
||||||
Task UserDelete();
|
Task UserDelete();
|
||||||
Task<List<OnlineUserIdentDto>> UserGetOnlinePairs(CensusDataDto? censusDataDto);
|
Task<List<OnlineUserIdentDto>> UserGetOnlinePairs(CensusDataDto? censusDataDto);
|
||||||
Task<List<UserFullPairDto>> UserGetPairedClients();
|
Task<List<UserFullPairDto>> UserGetPairedClients();
|
||||||
|
|||||||
Reference in New Issue
Block a user