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:
@@ -10003,3 +10003,17 @@ Sorry for the inconvenience.";
|
|||||||
"Conversation.BoostChannel" = "BOOST";
|
"Conversation.BoostChannel" = "BOOST";
|
||||||
|
|
||||||
"MediaEditor.Audio" = "Audio";
|
"MediaEditor.Audio" = "Audio";
|
||||||
|
|
||||||
|
"Stats.Statistics" = "Statistics";
|
||||||
|
"Stats.Boosts" = "Boosts";
|
||||||
|
|
||||||
|
"Stats.Boosts.BoostersNone" = "BOOSTERS";
|
||||||
|
"Stats.Boosts.Boosters_1" = "%@ BOOSTER";
|
||||||
|
"Stats.Boosts.Boosters_any" = "%@ BOOSTERS";
|
||||||
|
"Stats.Boosts.NoBoostersYet" = "No users currently boost your channel";
|
||||||
|
"Stats.Boosts.BoostersInfo" = "Your channel is currently boosted by these users.";
|
||||||
|
"Stats.Boosts.ExpiresOn" = "Boost expires on %@";
|
||||||
|
|
||||||
|
"Stats.Boosts.OverviewHeader" = "OVERVIEW";
|
||||||
|
"Stats.Boosts.LinkHeader" = "LINK FOR BOOSTING";
|
||||||
|
"Stats.Boosts.LinkInfo" = "Share this link with your subscribers to get more boosts.";
|
||||||
|
|||||||
@@ -247,12 +247,15 @@ open class ViewControllerComponentContainer: ViewController {
|
|||||||
|> deliverOnMainQueue).start(next: { [weak self] presentationData in
|
|> deliverOnMainQueue).start(next: { [weak self] presentationData in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
var theme = presentationData.theme
|
var theme = presentationData.theme
|
||||||
|
|
||||||
|
var resolvedTheme = resolveTheme(baseTheme: presentationData.theme, theme: strongSelf.theme)
|
||||||
if case .modal = presentationMode {
|
if case .modal = presentationMode {
|
||||||
theme = theme.withModalBlocksBackground()
|
theme = theme.withModalBlocksBackground()
|
||||||
|
resolvedTheme = resolvedTheme.withModalBlocksBackground()
|
||||||
}
|
}
|
||||||
|
|
||||||
strongSelf.node.presentationData = presentationData.withUpdated(theme: theme)
|
strongSelf.node.presentationData = presentationData.withUpdated(theme: theme)
|
||||||
strongSelf.node.resolvedTheme = resolveTheme(baseTheme: presentationData.theme, theme: strongSelf.theme)
|
strongSelf.node.resolvedTheme = resolvedTheme
|
||||||
|
|
||||||
switch statusBarStyle {
|
switch statusBarStyle {
|
||||||
case .none:
|
case .none:
|
||||||
|
|||||||
@@ -483,6 +483,10 @@ public final class DrawingEntitiesView: UIView, TGPhotoDrawingEntitiesView {
|
|||||||
public func remove(uuid: UUID, animated: Bool = false, announce: Bool = true) {
|
public func remove(uuid: UUID, animated: Bool = false, announce: Bool = true) {
|
||||||
if let view = self.getView(for: uuid) {
|
if let view = self.getView(for: uuid) {
|
||||||
if self.selectedEntityView === view {
|
if self.selectedEntityView === view {
|
||||||
|
if let stickerEntityView = self.selectedEntityView as? DrawingStickerEntityView {
|
||||||
|
stickerEntityView.onDeselection()
|
||||||
|
}
|
||||||
|
|
||||||
self.selectedEntityView = nil
|
self.selectedEntityView = nil
|
||||||
self.selectionChanged(nil)
|
self.selectionChanged(nil)
|
||||||
self.hasSelectionChanged(false)
|
self.hasSelectionChanged(false)
|
||||||
|
|||||||
@@ -554,7 +554,7 @@ final class LimitsPageComponent: CombinedComponent {
|
|||||||
)
|
)
|
||||||
|
|
||||||
let background = background.update(
|
let background = background.update(
|
||||||
component: Rectangle(color: theme.list.plainBackgroundColor),
|
component: Rectangle(color: theme.overallDarkAppearance ? theme.list.blocksBackgroundColor : theme.list.plainBackgroundColor),
|
||||||
availableSize: scroll.size,
|
availableSize: scroll.size,
|
||||||
transition: context.transition
|
transition: context.transition
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1553,8 +1553,14 @@ private final class PremiumIntroScreenContentComponent: CombinedComponent {
|
|||||||
let sideInsets = sideInset * 2.0 + environment.safeInsets.left + environment.safeInsets.right
|
let sideInsets = sideInset * 2.0 + environment.safeInsets.left + environment.safeInsets.right
|
||||||
var size = CGSize(width: context.availableSize.width, height: 0.0)
|
var size = CGSize(width: context.availableSize.width, height: 0.0)
|
||||||
|
|
||||||
|
var topBackgroundColor = theme.list.plainBackgroundColor
|
||||||
|
let bottomBackgroundColor = theme.list.blocksBackgroundColor
|
||||||
|
if theme.overallDarkAppearance {
|
||||||
|
topBackgroundColor = bottomBackgroundColor
|
||||||
|
}
|
||||||
|
|
||||||
let overscroll = overscroll.update(
|
let overscroll = overscroll.update(
|
||||||
component: Rectangle(color: theme.list.plainBackgroundColor),
|
component: Rectangle(color: topBackgroundColor),
|
||||||
availableSize: CGSize(width: context.availableSize.width, height: 1000),
|
availableSize: CGSize(width: context.availableSize.width, height: 1000),
|
||||||
transition: context.transition
|
transition: context.transition
|
||||||
)
|
)
|
||||||
@@ -1565,8 +1571,8 @@ private final class PremiumIntroScreenContentComponent: CombinedComponent {
|
|||||||
let fade = fade.update(
|
let fade = fade.update(
|
||||||
component: RoundedRectangle(
|
component: RoundedRectangle(
|
||||||
colors: [
|
colors: [
|
||||||
theme.list.plainBackgroundColor,
|
topBackgroundColor,
|
||||||
theme.list.blocksBackgroundColor
|
bottomBackgroundColor
|
||||||
],
|
],
|
||||||
cornerRadius: 0.0,
|
cornerRadius: 0.0,
|
||||||
gradientDirection: .vertical
|
gradientDirection: .vertical
|
||||||
@@ -2862,7 +2868,7 @@ public final class PremiumIntroScreen: ViewControllerComponentContainer {
|
|||||||
completion: {
|
completion: {
|
||||||
completionImpl?()
|
completionImpl?()
|
||||||
}
|
}
|
||||||
), navigationBarAppearance: .transparent, theme: forceDark ? .dark : .default)
|
), navigationBarAppearance: .transparent, presentationMode: modal ? .modal : .default, theme: forceDark ? .dark : .default)
|
||||||
|
|
||||||
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ public class PremiumLimitsListScreen: ViewController {
|
|||||||
if forceDark {
|
if forceDark {
|
||||||
self.presentationData = self.presentationData.withUpdated(theme: defaultDarkPresentationTheme)
|
self.presentationData = self.presentationData.withUpdated(theme: defaultDarkPresentationTheme)
|
||||||
}
|
}
|
||||||
|
self.presentationData = self.presentationData.withUpdated(theme: self.presentationData.theme.withModalBlocksBackground())
|
||||||
|
|
||||||
self.controller = controller
|
self.controller = controller
|
||||||
|
|
||||||
@@ -71,7 +72,7 @@ public class PremiumLimitsListScreen: ViewController {
|
|||||||
super.init()
|
super.init()
|
||||||
|
|
||||||
self.containerView.clipsToBounds = true
|
self.containerView.clipsToBounds = true
|
||||||
self.containerView.backgroundColor = self.presentationData.theme.list.plainBackgroundColor
|
self.containerView.backgroundColor = self.presentationData.theme.overallDarkAppearance ? self.presentationData.theme.list.blocksBackgroundColor : self.presentationData.theme.list.plainBackgroundColor
|
||||||
|
|
||||||
self.addSubnode(self.dim)
|
self.addSubnode(self.dim)
|
||||||
|
|
||||||
@@ -1149,7 +1150,7 @@ private class FooterNode: ASDisplayNode {
|
|||||||
self.buttonNode.title = title
|
self.buttonNode.title = title
|
||||||
|
|
||||||
self.coverNode = ASDisplayNode()
|
self.coverNode = ASDisplayNode()
|
||||||
self.coverNode.backgroundColor = self.theme.list.plainBackgroundColor
|
self.coverNode.backgroundColor = self.theme.overallDarkAppearance ? self.theme.list.blocksBackgroundColor : self.theme.list.plainBackgroundColor
|
||||||
|
|
||||||
self.pageIndicatorView = ComponentHostView<Empty>()
|
self.pageIndicatorView = ComponentHostView<Empty>()
|
||||||
self.pageIndicatorView.isUserInteractionEnabled = false
|
self.pageIndicatorView.isUserInteractionEnabled = false
|
||||||
|
|||||||
@@ -611,7 +611,7 @@ final class StoriesPageComponent: CombinedComponent {
|
|||||||
)
|
)
|
||||||
|
|
||||||
let background = background.update(
|
let background = background.update(
|
||||||
component: Rectangle(color: theme.list.plainBackgroundColor),
|
component: Rectangle(color: theme.overallDarkAppearance ? theme.list.blocksBackgroundColor : theme.list.plainBackgroundColor),
|
||||||
availableSize: scroll.size,
|
availableSize: scroll.size,
|
||||||
transition: context.transition
|
transition: context.transition
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -474,7 +474,7 @@ private enum StatsEntry: ItemListNodeEntry {
|
|||||||
})
|
})
|
||||||
case let .booster(_, _, dateTimeFormat, peer, expires):
|
case let .booster(_, _, dateTimeFormat, peer, expires):
|
||||||
let expiresValue = stringForFullDate(timestamp: expires, strings: presentationData.strings, dateTimeFormat: dateTimeFormat)
|
let expiresValue = stringForFullDate(timestamp: expires, strings: presentationData.strings, dateTimeFormat: dateTimeFormat)
|
||||||
return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: PresentationDateTimeFormat(), nameDisplayOrder: presentationData.nameDisplayOrder, context: arguments.context, peer: peer, presence: nil, text: .text("Boost expires on \(expiresValue)", .secondary), label: .none, editing: ItemListPeerItemEditing(editable: false, editing: false, revealed: false), switchValue: nil, enabled: true, selectable: false, sectionId: self.section, action: {
|
return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: PresentationDateTimeFormat(), nameDisplayOrder: presentationData.nameDisplayOrder, context: arguments.context, peer: peer, presence: nil, text: .text(presentationData.strings.Stats_Boosts_ExpiresOn(expiresValue).string, .secondary), label: .none, editing: ItemListPeerItemEditing(editable: false, editing: false, revealed: false), switchValue: nil, enabled: true, selectable: true, sectionId: self.section, action: {
|
||||||
arguments.openPeer(peer)
|
arguments.openPeer(peer)
|
||||||
}, setPeerIdWithRevealedOptions: { _, _ in }, removePeer: { _ in })
|
}, setPeerIdWithRevealedOptions: { _, _ in }, removePeer: { _ in })
|
||||||
case let .boostersExpand(theme, title):
|
case let .boostersExpand(theme, title):
|
||||||
@@ -617,19 +617,19 @@ private func channelStatsControllerEntries(state: ChannelStatsControllerState, p
|
|||||||
}
|
}
|
||||||
entries.append(.boostLevel(presentationData.theme, Int32(boostData.boosts), Int32(boostData.level), progress))
|
entries.append(.boostLevel(presentationData.theme, Int32(boostData.boosts), Int32(boostData.level), progress))
|
||||||
|
|
||||||
entries.append(.boostOverviewTitle(presentationData.theme, "OVERVIEW"))
|
entries.append(.boostOverviewTitle(presentationData.theme, presentationData.strings.Stats_Boosts_OverviewHeader))
|
||||||
entries.append(.boostOverview(presentationData.theme, boostData))
|
entries.append(.boostOverview(presentationData.theme, boostData))
|
||||||
|
|
||||||
let boostersTitle: String
|
let boostersTitle: String
|
||||||
let boostersPlaceholder: String?
|
let boostersPlaceholder: String?
|
||||||
let boostersFooter: String?
|
let boostersFooter: String?
|
||||||
if let boostersState, boostersState.count > 0 {
|
if let boostersState, boostersState.count > 0 {
|
||||||
boostersTitle = "\(boostersState.count) BOOSTERS"
|
boostersTitle = presentationData.strings.Stats_Boosts_Boosters(boostersState.count)
|
||||||
boostersPlaceholder = nil
|
boostersPlaceholder = nil
|
||||||
boostersFooter = "Your channel is currently boosted by these users."
|
boostersFooter = presentationData.strings.Stats_Boosts_BoostersInfo
|
||||||
} else {
|
} else {
|
||||||
boostersTitle = "BOOSTERS"
|
boostersTitle = presentationData.strings.Stats_Boosts_BoostersNone
|
||||||
boostersPlaceholder = "No users currently boost your channel"
|
boostersPlaceholder = presentationData.strings.Stats_Boosts_NoBoostersYet
|
||||||
boostersFooter = nil
|
boostersFooter = nil
|
||||||
}
|
}
|
||||||
entries.append(.boostersTitle(presentationData.theme, boostersTitle))
|
entries.append(.boostersTitle(presentationData.theme, boostersTitle))
|
||||||
@@ -663,7 +663,7 @@ private func channelStatsControllerEntries(state: ChannelStatsControllerState, p
|
|||||||
entries.append(.boostersInfo(presentationData.theme, boostersFooter))
|
entries.append(.boostersInfo(presentationData.theme, boostersFooter))
|
||||||
}
|
}
|
||||||
|
|
||||||
entries.append(.boostLinkTitle(presentationData.theme, "LINK FOR BOOSTING"))
|
entries.append(.boostLinkTitle(presentationData.theme, presentationData.strings.Stats_Boosts_LinkHeader))
|
||||||
|
|
||||||
if let peer {
|
if let peer {
|
||||||
let link: String
|
let link: String
|
||||||
@@ -675,7 +675,7 @@ private func channelStatsControllerEntries(state: ChannelStatsControllerState, p
|
|||||||
entries.append(.boostLink(presentationData.theme, link))
|
entries.append(.boostLink(presentationData.theme, link))
|
||||||
}
|
}
|
||||||
|
|
||||||
entries.append(.boostLinkInfo(presentationData.theme, "Share this link with your subscribers to get more boosts."))
|
entries.append(.boostLinkInfo(presentationData.theme, presentationData.strings.Stats_Boosts_LinkInfo))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -834,7 +834,9 @@ public func channelStatsController(context: AccountContext, updatedPresentationD
|
|||||||
return map
|
return map
|
||||||
}
|
}
|
||||||
|
|
||||||
let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .sectionControl(["Statistics", "Boosts"], state.section == .boosts ? 1 : 0), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true)
|
|
||||||
|
|
||||||
|
let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .sectionControl([presentationData.strings.Stats_Statistics, presentationData.strings.Stats_Boosts], state.section == .boosts ? 1 : 0), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true)
|
||||||
let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: channelStatsControllerEntries(state: state, peer: peer, data: data, messages: messages, interactions: interactions, boostData: boostData, boostersState: boostersState, presentationData: presentationData), style: .blocks, emptyStateItem: emptyStateItem, crossfadeState: previous == nil, animateChanges: false)
|
let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: channelStatsControllerEntries(state: state, peer: peer, data: data, messages: messages, interactions: interactions, boostData: boostData, boostersState: boostersState, presentationData: presentationData), style: .blocks, emptyStateItem: emptyStateItem, crossfadeState: previous == nil, animateChanges: false)
|
||||||
|
|
||||||
return (controllerState, (listState, arguments))
|
return (controllerState, (listState, arguments))
|
||||||
|
|||||||
@@ -4449,7 +4449,7 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !skipSendCheck, let sendAsPeerId = self.state.privacy.sendAsPeerId, sendAsPeerId.namespace == Namespaces.Peer.CloudChannel {
|
if !self.isEditingStory, !skipSendCheck, let sendAsPeerId = self.state.privacy.sendAsPeerId, sendAsPeerId.namespace == Namespaces.Peer.CloudChannel {
|
||||||
let _ = (self.context.engine.messages.checkStoriesUploadAvailability(target: .peer(sendAsPeerId))
|
let _ = (self.context.engine.messages.checkStoriesUploadAvailability(target: .peer(sendAsPeerId))
|
||||||
|> deliverOnMainQueue).start(next: { [weak self] status in
|
|> deliverOnMainQueue).start(next: { [weak self] status in
|
||||||
guard let self else {
|
guard let self else {
|
||||||
|
|||||||
@@ -450,7 +450,7 @@ public final class PeerListItemComponent: Component {
|
|||||||
leftInset += 9.0
|
leftInset += 9.0
|
||||||
}
|
}
|
||||||
var rightInset: CGFloat = contextInset * 2.0 + 8.0 + component.sideInset
|
var rightInset: CGFloat = contextInset * 2.0 + 8.0 + component.sideInset
|
||||||
if component.reaction != nil {
|
if component.reaction != nil || component.rightAccessory != .none {
|
||||||
rightInset += 32.0
|
rightInset += 32.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -854,7 +854,11 @@ final class ChatPinnedMessageTitlePanelNode: ChatTitleAccessoryPanelNode {
|
|||||||
case .text:
|
case .text:
|
||||||
controllerInteraction.sendMessage(button.title)
|
controllerInteraction.sendMessage(button.title)
|
||||||
case let .url(url):
|
case let .url(url):
|
||||||
controllerInteraction.openUrl(url, true, nil, nil)
|
var isConcealed = true
|
||||||
|
if url.hasPrefix("tg://") {
|
||||||
|
isConcealed = false
|
||||||
|
}
|
||||||
|
controllerInteraction.openUrl(url, isConcealed, nil, nil)
|
||||||
case .requestMap:
|
case .requestMap:
|
||||||
controllerInteraction.shareCurrentLocation()
|
controllerInteraction.shareCurrentLocation()
|
||||||
case .requestPhone:
|
case .requestPhone:
|
||||||
|
|||||||
Reference in New Issue
Block a user