diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-01-29 15:57:46 -0600 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-01-29 15:57:46 -0600 |
| commit | 329a367b763c8b9482ffbb9b770b0da326351e48 (patch) | |
| tree | fc46fcf0a8afc0f233b90105a9cd8485070aa0c6 /src/slskd/Entities | |
| parent | 0f76728a60e16acae2aab0e3c661d32ab7e5a01c (diff) | |
| download | slskd-329a367b763c8b9482ffbb9b770b0da326351e48.tar.gz | |
bump Soulseek.NET to 2.0.0
Diffstat (limited to 'src/slskd/Entities')
| -rw-r--r-- | src/slskd/Entities/Room.cs | 58 |
1 files changed, 58 insertions, 0 deletions
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 + { + /// <summary> + /// The room name. + /// </summary> + public string Name { get; set; } + + /// <summary> + /// A value indicating whether the room is private. + /// </summary> + public bool IsPrivate { get; set; } + + /// <summary> + /// The number of operators in the room, if private. + /// </summary> + public int? OperatorCount { get; set; } + + /// <summary> + /// The operators in the room, if private. + /// </summary> + public IList<string> Operators { get; set; } + + /// <summary> + /// The owner of the room, if private. + /// </summary> + public string Owner { get; set; } + + /// <summary> + /// The list of users in the room. + /// </summary> + public IList<UserData> Users { get; set; } = new List<UserData>(); + + /// <summary> + /// The list of messages. + /// </summary> + public IList<RoomMessage> Messages { get; set; } = new List<RoomMessage>(); + + 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<RoomMessage>() + }; + } + } +} |
