mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Merge commit '5afdedede25e9aad94c591c287fbddb75a018cf7'
This commit is contained in:
commit
a603c138e9
@ -11376,3 +11376,7 @@ to respond to messages faster.";
|
||||
|
||||
"ChannelBoost.Title" = "Boost Channel";
|
||||
"ChannelBoost.Info" = "Subscribers of your channel can **boost** it so that it **levels up** and gets **exclusive features**.";
|
||||
|
||||
"Conversation.BoostToUnrestrictText" = "Boost this group to send messages";
|
||||
|
||||
"Settings.Business" = "Telegram Business";
|
||||
|
@ -2260,12 +2260,11 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
||||
hasDraft = true
|
||||
authorAttributedString = NSAttributedString(string: item.presentationData.strings.DialogList_Draft, font: textFont, textColor: theme.messageDraftTextColor)
|
||||
|
||||
//TODO:localize
|
||||
switch mediaDraftContentType {
|
||||
case .audio:
|
||||
attributedText = NSAttributedString(string: "Voice Message", font: textFont, textColor: theme.messageTextColor)
|
||||
attributedText = NSAttributedString(string: item.presentationData.strings.Message_Audio, font: textFont, textColor: theme.messageTextColor)
|
||||
case .video:
|
||||
attributedText = NSAttributedString(string: "Video Message", font: textFont, textColor: theme.messageTextColor)
|
||||
attributedText = NSAttributedString(string: item.presentationData.strings.Message_VideoMessage, font: textFont, textColor: theme.messageTextColor)
|
||||
}
|
||||
} else if inlineAuthorPrefix == nil, let draftState = draftState {
|
||||
hasDraft = true
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 16 KiB |
@ -546,7 +546,7 @@ final class BusinessPageComponent: CombinedComponent {
|
||||
state.isDisplaying = environment.isDisplaying
|
||||
|
||||
let theme = context.component.theme
|
||||
// let strings = context.component.context.sharedContext.currentPresentationData.with { $0 }.strings
|
||||
let strings = context.component.context.sharedContext.currentPresentationData.with { $0 }.strings
|
||||
|
||||
let topInset: CGFloat = 56.0
|
||||
|
||||
@ -604,10 +604,9 @@ final class BusinessPageComponent: CombinedComponent {
|
||||
transition: context.transition
|
||||
)
|
||||
|
||||
//TODO:localize
|
||||
let title = title.update(
|
||||
component: MultilineTextComponent(
|
||||
text: .plain(NSAttributedString(string: "Telegram Business", font: Font.semibold(20.0), textColor: theme.rootController.navigationBar.primaryTextColor)),
|
||||
text: .plain(NSAttributedString(string: strings.Premium_Business, font: Font.semibold(20.0), textColor: theme.rootController.navigationBar.primaryTextColor)),
|
||||
horizontalAlignment: .center,
|
||||
truncationType: .end,
|
||||
maximumNumberOfLines: 1
|
||||
|
@ -309,6 +309,10 @@ class GiftOptionItemNode: ItemListRevealOptionsItemNode {
|
||||
textConstrainedWidth -= 54.0
|
||||
subtitleConstrainedWidth -= 30.0
|
||||
}
|
||||
if let _ = item.titleBadge {
|
||||
textConstrainedWidth -= 32.0
|
||||
subtitleConstrainedWidth -= 32.0
|
||||
}
|
||||
|
||||
let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: titleAttributedString, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: textConstrainedWidth, height: .greatestFiniteMagnitude)))
|
||||
let (statusLayout, statusApply) = makeStatusLayout(TextNodeLayoutArguments(attributedString: statusAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: subtitleConstrainedWidth, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets()))
|
||||
|
@ -2167,7 +2167,6 @@ private final class PremiumIntroScreenContentComponent: CombinedComponent {
|
||||
size.height += 8.0
|
||||
|
||||
let status = state.peer?.emojiStatus
|
||||
// let statusColor = state.peer?.nameColor.flatMap { context.component.context.peerNameColors.get($0, dark: environment.theme.overallDarkAppearance).main } ?? .blue
|
||||
|
||||
let accentColor = environment.theme.list.itemAccentColor
|
||||
var perksItems: [AnyComponentWithIdentity<Empty>] = []
|
||||
@ -2347,7 +2346,6 @@ private final class PremiumIntroScreenContentComponent: CombinedComponent {
|
||||
} else {
|
||||
layoutPerks()
|
||||
|
||||
|
||||
let textPadding: CGFloat = 13.0
|
||||
|
||||
let infoTitle = infoTitle.update(
|
||||
|
@ -825,6 +825,9 @@ struct ChatRecentActionsEntry: Comparable, Identifiable {
|
||||
order = [
|
||||
(.canChangeInfo, self.presentationData.strings.Channel_AdminLog_CanChangeInfo),
|
||||
(.canDeleteMessages, self.presentationData.strings.Channel_AdminLog_CanDeleteMessages),
|
||||
(.canPostStories, self.presentationData.strings.Channel_AdminLog_CanPostStories),
|
||||
(.canDeleteStories, self.presentationData.strings.Channel_AdminLog_CanDeleteStoriesOfOthers),
|
||||
(.canEditStories, self.presentationData.strings.Channel_AdminLog_CanEditStoriesOfOthers),
|
||||
(.canBanUsers, self.presentationData.strings.Channel_AdminLog_CanBanUsers),
|
||||
(.canInviteUsers, self.presentationData.strings.Channel_AdminLog_CanInviteUsersViaLink),
|
||||
(.canPinMessages, self.presentationData.strings.Channel_AdminLog_CanPinMessages),
|
||||
|
@ -929,11 +929,10 @@ private func settingsItems(data: PeerInfoScreenData?, context: AccountContext, p
|
||||
items[.payment]!.append(PeerInfoScreenDisclosureItem(id: 100, label: .text(""), text: presentationData.strings.Settings_Premium, icon: PresentationResourcesSettings.premium, action: {
|
||||
interaction.openSettings(.premium)
|
||||
}))
|
||||
//TODO:localize
|
||||
items[.payment]!.append(PeerInfoScreenDisclosureItem(id: 101, label: .text(""), additionalBadgeLabel: presentationData.strings.Settings_New, text: "Telegram Business", icon: PresentationResourcesSettings.business, action: {
|
||||
items[.payment]!.append(PeerInfoScreenDisclosureItem(id: 101, label: .text(""), additionalBadgeLabel: presentationData.strings.Settings_New, text: presentationData.strings.Settings_Business, icon: PresentationResourcesSettings.business, action: {
|
||||
interaction.openSettings(.businessSetup)
|
||||
}))
|
||||
items[.payment]!.append(PeerInfoScreenDisclosureItem(id: 102, label: .text(""), additionalBadgeLabel: presentationData.strings.Settings_New, text: presentationData.strings.Settings_PremiumGift, icon: PresentationResourcesSettings.premiumGift, action: {
|
||||
items[.payment]!.append(PeerInfoScreenDisclosureItem(id: 102, label: .text(""), text: presentationData.strings.Settings_PremiumGift, icon: PresentationResourcesSettings.premiumGift, action: {
|
||||
interaction.openSettings(.premiumGift)
|
||||
}))
|
||||
}
|
||||
|
@ -442,7 +442,7 @@ public final class PeerNameColorItemNode: ListViewItemNode, ItemListItemNode {
|
||||
let sideInset: CGFloat = params.leftInset + 10.0
|
||||
let iconSize = CGSize(width: 32.0, height: 32.0)
|
||||
|
||||
let spacing = (params.width - sideInset * 2.0 - iconSize.width * CGFloat(itemsPerRow)) / CGFloat(itemsPerRow - 1)
|
||||
let spacing = floorToScreenPixels((params.width - sideInset * 2.0 - iconSize.width * CGFloat(itemsPerRow)) / CGFloat(itemsPerRow - 1))
|
||||
|
||||
var origin = CGPoint(x: sideInset, y: 10.0)
|
||||
|
||||
|
@ -15460,14 +15460,20 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
let _ = strongSelf.context.engine.messages.deleteMessagesInteractively(messageIds: Array(messageIds), type: .forEveryone).startStandalone()
|
||||
}
|
||||
if let giveaway {
|
||||
Queue.mainQueue().after(0.2) {
|
||||
let dateString = stringForDate(timestamp: giveaway.untilDate, timeZone: .current, strings: strongSelf.presentationData.strings)
|
||||
strongSelf.present(textAlertController(context: strongSelf.context, updatedPresentationData: strongSelf.updatedPresentationData, title: strongSelf.presentationData.strings.Chat_Giveaway_DeleteConfirmation_Title, text: strongSelf.presentationData.strings.Chat_Giveaway_DeleteConfirmation_Text(dateString).string, actions: [TextAlertAction(type: .destructiveAction, title: strongSelf.presentationData.strings.Common_Delete, action: {
|
||||
commit()
|
||||
}), TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_Cancel, action: {
|
||||
})], parseMarkdown: true), in: .window(.root))
|
||||
let currentTime = Int32(CFAbsoluteTimeGetCurrent() + kCFAbsoluteTimeIntervalSince1970)
|
||||
if currentTime < giveaway.untilDate {
|
||||
Queue.mainQueue().after(0.2) {
|
||||
let dateString = stringForDate(timestamp: giveaway.untilDate, timeZone: .current, strings: strongSelf.presentationData.strings)
|
||||
strongSelf.present(textAlertController(context: strongSelf.context, updatedPresentationData: strongSelf.updatedPresentationData, title: strongSelf.presentationData.strings.Chat_Giveaway_DeleteConfirmation_Title, text: strongSelf.presentationData.strings.Chat_Giveaway_DeleteConfirmation_Text(dateString).string, actions: [TextAlertAction(type: .destructiveAction, title: strongSelf.presentationData.strings.Common_Delete, action: {
|
||||
commit()
|
||||
}), TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_Cancel, action: {
|
||||
})], parseMarkdown: true), in: .window(.root))
|
||||
}
|
||||
f(.default)
|
||||
} else {
|
||||
f(.dismissWithoutContent)
|
||||
commit()
|
||||
}
|
||||
f(.default)
|
||||
} else {
|
||||
if "".isEmpty {
|
||||
f(.dismissWithoutContent)
|
||||
|
@ -91,11 +91,10 @@ final class ChatRestrictedInputPanelNode: ChatInputPanelNode {
|
||||
} else if personal {
|
||||
self.textNode.attributedText = NSAttributedString(string: interfaceState.strings.Conversation_RestrictedText, font: Font.regular(13.0), textColor: interfaceState.theme.chat.inputPanel.secondaryTextColor)
|
||||
} else {
|
||||
if "".isEmpty {
|
||||
//TODO:localize
|
||||
if (self.presentationInterfaceState?.boostsToUnrestrict ?? 0) > 0 {
|
||||
iconSpacing = 0.0
|
||||
iconImage = PresentationResourcesChat.chatPanelBoostIcon(interfaceState.theme)
|
||||
self.textNode.attributedText = NSAttributedString(string: "Boost this group to send messages", font: Font.regular(15.0), textColor: interfaceState.theme.chat.inputPanel.panelControlAccentColor)
|
||||
self.textNode.attributedText = NSAttributedString(string: interfaceState.strings.Conversation_BoostToUnrestrictText, font: Font.regular(15.0), textColor: interfaceState.theme.chat.inputPanel.panelControlAccentColor)
|
||||
isUserInteractionEnabled = true
|
||||
} else {
|
||||
self.textNode.attributedText = NSAttributedString(string: interfaceState.strings.Conversation_DefaultRestrictedText, font: Font.regular(13.0), textColor: interfaceState.theme.chat.inputPanel.secondaryTextColor)
|
||||
|
Loading…
x
Reference in New Issue
Block a user