mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
better access to usernames
This commit is contained in:
parent
fc71103aa3
commit
3249aab371
1 changed files with 12 additions and 0 deletions
|
|
@ -54,6 +54,18 @@ public extension Peer {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
var usernames: [TelegramPeerUsername] {
|
||||
switch self {
|
||||
case let user as TelegramUser:
|
||||
return user.usernames
|
||||
case _ as TelegramGroup:
|
||||
return []
|
||||
case let channel as TelegramChannel:
|
||||
return channel.usernames
|
||||
default:
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
var displayLetters: [String] {
|
||||
switch self {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue