mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Bot peer request improvements
This commit is contained in:
@@ -1675,7 +1675,7 @@ public final class ChatListNode: ListView {
|
||||
isEmpty = false
|
||||
return true
|
||||
case let .peerType(peerType):
|
||||
if let peer = peer.peer {
|
||||
if let peer = peer.peer, !peer.isDeleted {
|
||||
switch peerType {
|
||||
case let .user(userType):
|
||||
if case let .user(user) = peer {
|
||||
@@ -1725,18 +1725,21 @@ public final class ChatListNode: ListView {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if let isForum = groupType.isForum, isForum {
|
||||
if let isForum = groupType.isForum {
|
||||
if isForum != channel.flags.contains(.isForum) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if let hasUsername = groupType.hasUsername, hasUsername {
|
||||
if let hasUsername = groupType.hasUsername {
|
||||
if hasUsername != (channel.addressName != nil) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if let userAdminRights = groupType.userAdminRights {
|
||||
if channel.flags.contains(.isCreator) {
|
||||
if let rights = channel.adminRights, rights.rights.contains(.canBeAnonymous) != userAdminRights.rights.contains(.canBeAnonymous) {
|
||||
return false
|
||||
}
|
||||
} else if let rights = channel.adminRights {
|
||||
if rights.rights.intersection(userAdminRights.rights) != userAdminRights.rights {
|
||||
return false
|
||||
@@ -1762,6 +1765,19 @@ public final class ChatListNode: ListView {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if let userAdminRights = channelType.userAdminRights {
|
||||
if channel.flags.contains(.isCreator) {
|
||||
if let rights = channel.adminRights, rights.rights.contains(.canBeAnonymous) != userAdminRights.rights.contains(.canBeAnonymous) {
|
||||
return false
|
||||
}
|
||||
} else if let rights = channel.adminRights {
|
||||
if rights.rights.intersection(userAdminRights.rights) != userAdminRights.rights {
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
isEmpty = false
|
||||
return true
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user