diff --git a/DysonNetwork.Sphere/Chat/Realtime/LivekitService.cs b/DysonNetwork.Sphere/Chat/Realtime/LivekitService.cs index 63a3219..ca6b082 100644 --- a/DysonNetwork.Sphere/Chat/Realtime/LivekitService.cs +++ b/DysonNetwork.Sphere/Chat/Realtime/LivekitService.cs @@ -125,7 +125,7 @@ public class LivekitRealtimeService : IRealtimeService RoomAdmin = isAdmin, Room = sessionId }) - .WithAttributes(new Dictionary { { "account_id", account.Id.ToString() } }) + .WithMetadata(JsonSerializer.Serialize(new Dictionary { { "account_id", account.Id.ToString() } })) .WithTtl(TimeSpan.FromHours(1)); return token.ToJwt(); } @@ -199,7 +199,7 @@ public class LivekitRealtimeService : IRealtimeService // Get the current participants list var participants = await _cache.GetAsync>(participantsKey) ?? - new List(); + []; // Check if the participant already exists var existingIndex = participants.FindIndex(p => p.Identity == participant.Identity); @@ -253,7 +253,7 @@ public class LivekitRealtimeService : IRealtimeService public async Task> GetRoomParticipantsAsync(string roomName) { var participantsKey = _GetParticipantsKey(roomName); - return await _cache.GetAsync>(participantsKey) ?? new List(); + return await _cache.GetAsync>(participantsKey) ?? []; } // Class to represent a participant in the cache