mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Various Fixes
This commit is contained in:
@@ -618,19 +618,30 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo
|
||||
}
|
||||
|> deliverOnMainQueue).start(next: { messages in
|
||||
if let strongSelf = self, !messages.isEmpty {
|
||||
var isChannel = false
|
||||
enum PeerType {
|
||||
case group
|
||||
case channel
|
||||
case bot
|
||||
}
|
||||
var type: PeerType = .group
|
||||
for message in messages {
|
||||
if let channel = message.peers[message.id.peerId] as? TelegramChannel, case .broadcast = channel.info {
|
||||
isChannel = true
|
||||
if let user = message.author?._asPeer() as? TelegramUser, user.botInfo != nil {
|
||||
type = .bot
|
||||
break
|
||||
} else if let channel = message.peers[message.id.peerId] as? TelegramChannel, case .broadcast = channel.info {
|
||||
type = .channel
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
let text: String
|
||||
if save {
|
||||
text = isChannel ? strongSelf.presentationData.strings.Conversation_CopyProtectionSavingDisabledChannel : strongSelf.presentationData.strings.Conversation_CopyProtectionSavingDisabledGroup
|
||||
} else {
|
||||
text = isChannel ? strongSelf.presentationData.strings.Conversation_CopyProtectionForwardingDisabledChannel : strongSelf.presentationData.strings.Conversation_CopyProtectionForwardingDisabledGroup
|
||||
switch type {
|
||||
case .group:
|
||||
text = save ? strongSelf.presentationData.strings.Conversation_CopyProtectionSavingDisabledGroup : strongSelf.presentationData.strings.Conversation_CopyProtectionForwardingDisabledGroup
|
||||
case .channel:
|
||||
text = save ? strongSelf.presentationData.strings.Conversation_CopyProtectionSavingDisabledChannel : strongSelf.presentationData.strings.Conversation_CopyProtectionForwardingDisabledChannel
|
||||
case .bot:
|
||||
text = save ? strongSelf.presentationData.strings.Conversation_CopyProtectionSavingDisabledBot : strongSelf.presentationData.strings.Conversation_CopyProtectionForwardingDisabledBot
|
||||
}
|
||||
|
||||
strongSelf.copyProtectionTooltipController?.dismiss()
|
||||
|
||||
Reference in New Issue
Block a user