diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index 88166c7015..3660858164 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -8649,7 +8649,7 @@ Sorry for the inconvenience."; "RequestPeer.Requirement.Group.HasUsernameOn" = "The group should be public."; "RequestPeer.Requirement.Group.ForumOff" = "The group should have topics turned off."; -"RequestPeer.Requirement.Group.ForumOn" = "The group should have topics turned on."; +"RequestPeer.Requirement.Group.ForumOn" = "The group should have topics turned on."; "RequestPeer.Requirement.Group.ParticipantOn" = "Bot should be in the group."; "RequestPeer.Requirement.Group.CreatorOn" = "You should be the owner of the group."; diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index 79ece00f05..6650241eeb 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -4162,7 +4162,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G return } - let attributedTitle: NSAttributedString? + var attributedTitle: NSAttributedString? let attributedText: NSAttributedString let theme = AlertControllerTheme(presentationData: strongSelf.presentationData) @@ -4198,12 +4198,17 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G attributedText = formattedString } } else { - let stringWithRanges = strongSelf.presentationData.strings.RequestPeer_SelectionConfirmationInviteText(botName, peerName) - let formattedString = NSMutableAttributedString(string: stringWithRanges.string, font: Font.regular(13.0), textColor: theme.primaryColor, paragraphAlignment: .center) - for range in stringWithRanges.ranges.prefix(2) { - formattedString.addAttribute(.font, value: Font.semibold(13.0), range: range.range) + if case let .group(group) = peerType, group.botParticipant { + let stringWithRanges = strongSelf.presentationData.strings.RequestPeer_SelectionConfirmationInviteText(botName, peerName) + let formattedString = NSMutableAttributedString(string: stringWithRanges.string, font: Font.regular(13.0), textColor: theme.primaryColor, paragraphAlignment: .center) + for range in stringWithRanges.ranges.prefix(2) { + formattedString.addAttribute(.font, value: Font.semibold(13.0), range: range.range) + } + attributedText = formattedString + } else { + attributedTitle = nil + attributedText = NSAttributedString(string: strongSelf.presentationData.strings.RequestPeer_SelectionConfirmationTitle(peerName, botName).string, font: Font.medium(17.0), textColor: theme.primaryColor, paragraphAlignment: .center) } - attributedText = formattedString } } @@ -4233,7 +4238,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G case .user: break case let .group(group): - let createGroupController = createGroupControllerImpl(context: context, peerIds: peerId.flatMap { [$0] } ?? [], mode: .requestPeer(group), willComplete: { peerName, complete in + let createGroupController = createGroupControllerImpl(context: context, peerIds: group.botParticipant || group.botAdminRights != nil ? (peerId.flatMap { [$0] } ?? []) : [], mode: .requestPeer(group), willComplete: { peerName, complete in presentConfirmation(peerName, false, { complete() }) diff --git a/submodules/TranslateUI/Sources/ChatTranslation.swift b/submodules/TranslateUI/Sources/ChatTranslation.swift index a18c27c93e..599a5e6674 100644 --- a/submodules/TranslateUI/Sources/ChatTranslation.swift +++ b/submodules/TranslateUI/Sources/ChatTranslation.swift @@ -148,7 +148,7 @@ public func chatTranslationState(context: AccountContext, peerId: EnginePeer.Id) } else { return .single(nil) |> then( - context.account.viewTracker.aroundMessageHistoryViewForLocation(.peer(peerId: peerId, threadId: nil), index: .upperBound, anchorIndex: .upperBound, count: 10, fixedCombinedReadStates: nil) + context.account.viewTracker.aroundMessageHistoryViewForLocation(.peer(peerId: peerId, threadId: nil), index: .upperBound, anchorIndex: .upperBound, count: 16, fixedCombinedReadStates: nil) |> filter { messageHistoryView -> Bool in return messageHistoryView.0.entries.count > 1 } @@ -175,7 +175,7 @@ public func chatTranslationState(context: AccountContext, peerId: EnginePeer.Id) } count += 1 } - if count >= 5 { + if count >= 10 { break } } @@ -186,8 +186,10 @@ public func chatTranslationState(context: AccountContext, peerId: EnginePeer.Id) var mostFrequent: (String, Int)? for (lang, count) in fromLangs { - if let current = mostFrequent, count > current.1 { - mostFrequent = (lang, count) + if let current = mostFrequent { + if count > current.1 { + mostFrequent = (lang, count) + } } else { mostFrequent = (lang, count) }