mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2026-01-05 00:00:21 +01:00
made Peer.UserOrChat as protected internal to be user-overridable
This commit is contained in:
parent
014f563b89
commit
8f10df8849
|
|
@ -14,7 +14,7 @@ namespace TL
|
|||
public override long ID => 0;
|
||||
internal Dictionary<long, User> _users;
|
||||
internal Dictionary<long, ChatBase> _chats;
|
||||
internal override IPeerInfo UserOrChat(Dictionary<long, User> users, Dictionary<long, ChatBase> chats)
|
||||
protected internal override IPeerInfo UserOrChat(Dictionary<long, User> users, Dictionary<long, ChatBase> chats)
|
||||
{
|
||||
lock (_users)
|
||||
foreach (var user in users.Values)
|
||||
|
|
|
|||
|
|
@ -117,25 +117,25 @@ namespace TL
|
|||
partial class Peer
|
||||
{
|
||||
public abstract long ID { get; }
|
||||
internal abstract IPeerInfo UserOrChat(Dictionary<long, User> users, Dictionary<long, ChatBase> chats);
|
||||
protected internal abstract IPeerInfo UserOrChat(Dictionary<long, User> users, Dictionary<long, ChatBase> chats);
|
||||
}
|
||||
partial class PeerUser
|
||||
{
|
||||
public override string ToString() => "user " + user_id;
|
||||
public override long ID => user_id;
|
||||
internal override IPeerInfo UserOrChat(Dictionary<long, User> users, Dictionary<long, ChatBase> chats) => users.TryGetValue(user_id, out var user) ? user : null;
|
||||
protected internal override IPeerInfo UserOrChat(Dictionary<long, User> users, Dictionary<long, ChatBase> chats) => users.TryGetValue(user_id, out var user) ? user : null;
|
||||
}
|
||||
partial class PeerChat
|
||||
{
|
||||
public override string ToString() => "chat " + chat_id;
|
||||
public override long ID => chat_id;
|
||||
internal override IPeerInfo UserOrChat(Dictionary<long, User> users, Dictionary<long, ChatBase> chats) => chats.TryGetValue(chat_id, out var chat) ? chat : null;
|
||||
protected internal override IPeerInfo UserOrChat(Dictionary<long, User> users, Dictionary<long, ChatBase> chats) => chats.TryGetValue(chat_id, out var chat) ? chat : null;
|
||||
}
|
||||
partial class PeerChannel
|
||||
{
|
||||
public override string ToString() => "channel " + channel_id;
|
||||
public override long ID => channel_id;
|
||||
internal override IPeerInfo UserOrChat(Dictionary<long, User> users, Dictionary<long, ChatBase> chats) => chats.TryGetValue(channel_id, out var chat) ? chat : null;
|
||||
protected internal override IPeerInfo UserOrChat(Dictionary<long, User> users, Dictionary<long, ChatBase> chats) => chats.TryGetValue(channel_id, out var chat) ? chat : null;
|
||||
}
|
||||
|
||||
partial class UserBase : IPeerInfo
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<Version>0.0.0</Version>
|
||||
<Authors>Wizou</Authors>
|
||||
<Description>Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 151 Release Notes: $(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))</Description>
|
||||
<Copyright>Copyright © Olivier Marcoux 2021-2022</Copyright>
|
||||
<Copyright>Copyright © Olivier Marcoux 2021-2023</Copyright>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<PackageProjectUrl>https://github.com/wiz0u/WTelegramClient</PackageProjectUrl>
|
||||
<PackageIcon>logo.png</PackageIcon>
|
||||
|
|
|
|||
Loading…
Reference in a new issue