mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2026-04-05 06:25:30 +00:00
Removed DisplayName in favor of ToString() for User classes
This commit is contained in:
parent
480697d329
commit
80edb184bc
2 changed files with 6 additions and 6 deletions
|
|
@ -64,7 +64,6 @@ namespace TL
|
|||
partial class UserBase
|
||||
{
|
||||
public abstract long ID { get; }
|
||||
public abstract string DisplayName { get; }
|
||||
protected abstract InputPeer ToInputPeer();
|
||||
protected abstract InputUserBase ToInputUser();
|
||||
public static implicit operator InputPeer(UserBase user) => user.ToInputPeer();
|
||||
|
|
@ -73,14 +72,14 @@ namespace TL
|
|||
partial class UserEmpty
|
||||
{
|
||||
public override long ID => id;
|
||||
public override string DisplayName => null;
|
||||
public override string ToString() => null;
|
||||
protected override InputPeer ToInputPeer() => null;
|
||||
protected override InputUserBase ToInputUser() => null;
|
||||
}
|
||||
partial class User
|
||||
{
|
||||
public override long ID => id;
|
||||
public override string DisplayName => username != null ? '@' + username : last_name == null ? first_name : $"{first_name} {last_name}";
|
||||
public override string ToString() => username != null ? '@' + username : last_name == null ? first_name : $"{first_name} {last_name}";
|
||||
protected override InputPeer ToInputPeer() => new InputPeerUser { user_id = id, access_hash = access_hash };
|
||||
protected override InputUserBase ToInputUser() => new InputUser { user_id = id, access_hash = access_hash };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue