//
// ▄▄▄▄ ▄▄▄▄ ▄▄▄▄
// ▄▄▄▄▄▄█ █▄▄▄▄▄█ █▄▄▄▄▄█ █
// █__ --█ █__ --█ ◄█ - █
// █▄▄▄▄▄█▄▄█▄▄▄▄▄█▄▄█▄▄█▄▄▄▄▄█
// ┍━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━ ━ ━┉ ┉ ┉
// │ Copyright (c) JP Dillingham.
// │
// │ 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, version 3.
// │
// │ 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/.
// │
// │ This program is distributed with Additional Terms pursuant to Section 7
// │ of the AGPLv3. See the LICENSE file in the root directory of this
// │ project for the complete terms and conditions.
// │
// │ https://slskd.org
// │
// ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ╌ ╌╌╌╌ ╌
// │ SPDX-FileCopyrightText: JP Dillingham
// │ SPDX-License-Identifier: AGPL-3.0-only
// ╰───────────────────────────────────────────╶──── ─ ─── ─ ── ──┈ ┈
//
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(),
};
}
}
}