From 329a367b763c8b9482ffbb9b770b0da326351e48 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 29 Jan 2021 15:57:46 -0600 Subject: bump Soulseek.NET to 2.0.0 --- src/slskd/Entities/Room.cs | 58 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/slskd/Entities/Room.cs (limited to 'src/slskd/Entities') diff --git a/src/slskd/Entities/Room.cs b/src/slskd/Entities/Room.cs new file mode 100644 index 00000000..71b7f1fc --- /dev/null +++ b/src/slskd/Entities/Room.cs @@ -0,0 +1,58 @@ +namespace slskd.Entities +{ + using Soulseek; + using System.Collections.Generic; + using System.Linq; + + public class Room + { + /// + /// The room name. + /// + public string Name { get; set; } + + /// + /// A value indicating whether the room is private. + /// + public bool IsPrivate { get; set; } + + /// + /// The number of operators in the room, if private. + /// + public int? OperatorCount { get; set; } + + /// + /// The operators in the room, if private. + /// + public IList Operators { get; set; } + + /// + /// The owner of the room, if private. + /// + public string Owner { get; set; } + + /// + /// The list of users in the room. + /// + public IList Users { get; set; } = new List(); + + /// + /// The list of messages. + /// + public IList Messages { get; set; } = new List(); + + public static Room FromRoomData(RoomData roomData) + { + return new Room() + { + Name = roomData.Name, + IsPrivate = roomData.IsPrivate, + OperatorCount = roomData.OperatorCount, + Operators = roomData.Operators?.ToList(), + Owner = roomData.Owner, + Users = roomData.Users?.ToList(), + Messages = new List() + }; + } + } +} -- cgit v1.2.3