2024-05-19 21:02:17 +00:00
|
|
|
|
namespace SharpChat {
|
2024-05-19 02:17:51 +00:00
|
|
|
|
public class ChannelInfo {
|
2024-05-29 20:51:37 +00:00
|
|
|
|
public string Name { get; set; }
|
2023-02-22 00:28:53 +00:00
|
|
|
|
public string Password { get; set; }
|
|
|
|
|
public bool IsTemporary { get; set; }
|
|
|
|
|
public int Rank { get; set; }
|
|
|
|
|
public long OwnerId { get; set; }
|
2022-08-30 15:00:58 +00:00
|
|
|
|
|
|
|
|
|
public bool HasPassword
|
|
|
|
|
=> !string.IsNullOrWhiteSpace(Password);
|
|
|
|
|
|
2024-05-19 21:02:17 +00:00
|
|
|
|
public bool IsPublic
|
|
|
|
|
=> !IsTemporary && Rank < 1 && !HasPassword;
|
|
|
|
|
|
2024-05-19 02:17:51 +00:00
|
|
|
|
public ChannelInfo(
|
2023-02-22 00:28:53 +00:00
|
|
|
|
string name,
|
2024-05-10 19:18:55 +00:00
|
|
|
|
string? password = null,
|
2023-02-22 00:28:53 +00:00
|
|
|
|
bool isTemporary = false,
|
|
|
|
|
int rank = 0,
|
|
|
|
|
long ownerId = 0
|
|
|
|
|
) {
|
2022-08-30 15:00:58 +00:00
|
|
|
|
Name = name;
|
2023-02-22 00:28:53 +00:00
|
|
|
|
Password = password ?? string.Empty;
|
|
|
|
|
IsTemporary = isTemporary;
|
|
|
|
|
Rank = rank;
|
|
|
|
|
OwnerId = ownerId;
|
2022-08-30 15:00:58 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|