mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Improvements
This commit is contained in:
@@ -70,6 +70,25 @@ extension PeerIndexNameRepresentation {
|
||||
return foundAtLeastOne
|
||||
}
|
||||
|
||||
public func matchesByTokens(_ other: [ValueBoxKey]) -> Bool {
|
||||
var foundAtLeastOne = false
|
||||
for searchToken in other {
|
||||
var found = false
|
||||
for token in self.indexTokens {
|
||||
if searchToken.isPrefix(to: token) {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
return false
|
||||
}
|
||||
foundAtLeastOne = true
|
||||
break
|
||||
}
|
||||
return foundAtLeastOne
|
||||
}
|
||||
|
||||
public var indexTokens: [ValueBoxKey] {
|
||||
switch self {
|
||||
case let .title(title, addressNames):
|
||||
|
||||
Reference in New Issue
Block a user