// // Copyright (c) slskd Team. All rights reserved. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published // by the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see https://www.gnu.org/licenses/. // namespace slskd.Messaging { using System.Collections.Generic; using System.Linq; using Soulseek; 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(), }; } } }