mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-07 05:25:12 +00:00
better access to usernames
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user