This commit is contained in:
2026-03-04 23:13:32 +01:00
parent 2fa0f3cb8b
commit 4e6b5da71b
6 changed files with 160 additions and 10 deletions

View File

@@ -7,6 +7,9 @@ public class Whiteboard
public Guid WhiteboardId { get; set; }
public Guid OwnerId { get; set; }
public HashSet<Guid> AcceptedUsers { get; } = new();
public HashSet<Guid> PendingUsers { get; } = new();
public List<Shape> Shapes { get; } = [];
@@ -38,4 +41,16 @@ public class Whiteboard
Shapes.Add(shape);
TextShapes.Add(shape);
}
public void AddPendingUser(Guid userId) => PendingUsers.Add(userId);
public void AcceptUser(Guid userId)
{
PendingUsers.Remove(userId);
AcceptedUsers.Add(userId);
}
public void RejectUser(Guid userId) => PendingUsers.Remove(userId);
public bool IsAccepted(Guid userId) => AcceptedUsers.Contains(userId);
}