mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-03 21:16:35 +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.Title" = "Boost Channel";
|
||||||
"ChannelBoost.Info" = "Subscribers of your channel can **boost** it so that it **levels up** and gets **exclusive features**.";
|
"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
|
hasDraft = true
|
||||||
authorAttributedString = NSAttributedString(string: item.presentationData.strings.DialogList_Draft, font: textFont, textColor: theme.messageDraftTextColor)
|
authorAttributedString = NSAttributedString(string: item.presentationData.strings.DialogList_Draft, font: textFont, textColor: theme.messageDraftTextColor)
|
||||||
|
|
||||||
//TODO:localize
|
|
||||||
switch mediaDraftContentType {
|
switch mediaDraftContentType {
|
||||||
case .audio:
|
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:
|
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 {
|
} else if inlineAuthorPrefix == nil, let draftState = draftState {
|
||||||
hasDraft = true
|
hasDraft = true
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB |
@ -546,7 +546,7 @@ final class BusinessPageComponent: CombinedComponent {
|
|||||||
state.isDisplaying = environment.isDisplaying
|
state.isDisplaying = environment.isDisplaying
|
||||||
|
|
||||||
let theme = context.component.theme
|
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
|
let topInset: CGFloat = 56.0
|
||||||
|
|
||||||
@ -604,10 +604,9 @@ final class BusinessPageComponent: CombinedComponent {
|
|||||||
transition: context.transition
|
transition: context.transition
|
||||||
)
|
)
|
||||||
|
|
||||||
//TODO:localize
|
|
||||||
let title = title.update(
|
let title = title.update(
|
||||||
component: MultilineTextComponent(
|
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,
|
horizontalAlignment: .center,
|
||||||
truncationType: .end,
|
truncationType: .end,
|
||||||
maximumNumberOfLines: 1
|
maximumNumberOfLines: 1
|
||||||
|
|||||||
@ -309,6 +309,10 @@ class GiftOptionItemNode: ItemListRevealOptionsItemNode {
|
|||||||
textConstrainedWidth -= 54.0
|
textConstrainedWidth -= 54.0
|
||||||
subtitleConstrainedWidth -= 30.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 (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()))
|
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
|
size.height += 8.0
|
||||||
|
|
||||||
let status = state.peer?.emojiStatus
|
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
|
let accentColor = environment.theme.list.itemAccentColor
|
||||||
var perksItems: [AnyComponentWithIdentity<Empty>] = []
|
var perksItems: [AnyComponentWithIdentity<Empty>] = []
|
||||||
@ -2347,7 +2346,6 @@ private final class PremiumIntroScreenContentComponent: CombinedComponent {
|
|||||||
} else {
|
} else {
|
||||||
layoutPerks()
|
layoutPerks()
|
||||||
|
|
||||||
|
|
||||||
let textPadding: CGFloat = 13.0
|
let textPadding: CGFloat = 13.0
|
||||||
|
|
||||||
let infoTitle = infoTitle.update(
|
let infoTitle = infoTitle.update(
|
||||||
|
|||||||
@ -825,6 +825,9 @@ struct ChatRecentActionsEntry: Comparable, Identifiable {
|
|||||||
order = [
|
order = [
|
||||||
(.canChangeInfo, self.presentationData.strings.Channel_AdminLog_CanChangeInfo),
|
(.canChangeInfo, self.presentationData.strings.Channel_AdminLog_CanChangeInfo),
|
||||||
(.canDeleteMessages, self.presentationData.strings.Channel_AdminLog_CanDeleteMessages),
|
(.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),
|
(.canBanUsers, self.presentationData.strings.Channel_AdminLog_CanBanUsers),
|
||||||
(.canInviteUsers, self.presentationData.strings.Channel_AdminLog_CanInviteUsersViaLink),
|
(.canInviteUsers, self.presentationData.strings.Channel_AdminLog_CanInviteUsersViaLink),
|
||||||
(.canPinMessages, self.presentationData.strings.Channel_AdminLog_CanPinMessages),
|
(.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: {
|
items[.payment]!.append(PeerInfoScreenDisclosureItem(id: 100, label: .text(""), text: presentationData.strings.Settings_Premium, icon: PresentationResourcesSettings.premium, action: {
|
||||||
interaction.openSettings(.premium)
|
interaction.openSettings(.premium)
|
||||||
}))
|
}))
|
||||||
//TODO:localize
|
items[.payment]!.append(PeerInfoScreenDisclosureItem(id: 101, label: .text(""), additionalBadgeLabel: presentationData.strings.Settings_New, text: presentationData.strings.Settings_Business, icon: PresentationResourcesSettings.business, action: {
|
||||||
items[.payment]!.append(PeerInfoScreenDisclosureItem(id: 101, label: .text(""), additionalBadgeLabel: presentationData.strings.Settings_New, text: "Telegram Business", icon: PresentationResourcesSettings.business, action: {
|
|
||||||
interaction.openSettings(.businessSetup)
|
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)
|
interaction.openSettings(.premiumGift)
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -442,7 +442,7 @@ public final class PeerNameColorItemNode: ListViewItemNode, ItemListItemNode {
|
|||||||
let sideInset: CGFloat = params.leftInset + 10.0
|
let sideInset: CGFloat = params.leftInset + 10.0
|
||||||
let iconSize = CGSize(width: 32.0, height: 32.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)
|
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()
|
let _ = strongSelf.context.engine.messages.deleteMessagesInteractively(messageIds: Array(messageIds), type: .forEveryone).startStandalone()
|
||||||
}
|
}
|
||||||
if let giveaway {
|
if let giveaway {
|
||||||
Queue.mainQueue().after(0.2) {
|
let currentTime = Int32(CFAbsoluteTimeGetCurrent() + kCFAbsoluteTimeIntervalSince1970)
|
||||||
let dateString = stringForDate(timestamp: giveaway.untilDate, timeZone: .current, strings: strongSelf.presentationData.strings)
|
if currentTime < giveaway.untilDate {
|
||||||
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: {
|
Queue.mainQueue().after(0.2) {
|
||||||
commit()
|
let dateString = stringForDate(timestamp: giveaway.untilDate, timeZone: .current, strings: strongSelf.presentationData.strings)
|
||||||
}), TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_Cancel, action: {
|
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: {
|
||||||
})], parseMarkdown: true), in: .window(.root))
|
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 {
|
} else {
|
||||||
if "".isEmpty {
|
if "".isEmpty {
|
||||||
f(.dismissWithoutContent)
|
f(.dismissWithoutContent)
|
||||||
|
|||||||
@ -91,11 +91,10 @@ final class ChatRestrictedInputPanelNode: ChatInputPanelNode {
|
|||||||
} else if personal {
|
} else if personal {
|
||||||
self.textNode.attributedText = NSAttributedString(string: interfaceState.strings.Conversation_RestrictedText, font: Font.regular(13.0), textColor: interfaceState.theme.chat.inputPanel.secondaryTextColor)
|
self.textNode.attributedText = NSAttributedString(string: interfaceState.strings.Conversation_RestrictedText, font: Font.regular(13.0), textColor: interfaceState.theme.chat.inputPanel.secondaryTextColor)
|
||||||
} else {
|
} else {
|
||||||
if "".isEmpty {
|
if (self.presentationInterfaceState?.boostsToUnrestrict ?? 0) > 0 {
|
||||||
//TODO:localize
|
|
||||||
iconSpacing = 0.0
|
iconSpacing = 0.0
|
||||||
iconImage = PresentationResourcesChat.chatPanelBoostIcon(interfaceState.theme)
|
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
|
isUserInteractionEnabled = true
|
||||||
} else {
|
} else {
|
||||||
self.textNode.attributedText = NSAttributedString(string: interfaceState.strings.Conversation_DefaultRestrictedText, font: Font.regular(13.0), textColor: interfaceState.theme.chat.inputPanel.secondaryTextColor)
|
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