mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various fixes
This commit is contained in:
parent
2f8e6a4809
commit
3032fe0738
@ -13747,6 +13747,7 @@ Sorry for the inconvenience.";
|
||||
|
||||
"Gift.SendChannel.Title" = "Gift Preview";
|
||||
"Gift.SendChannel.HideMyName.Info" = "Hide my name and message from visitors of this channel. The channel admins will still see them.";
|
||||
"Gift.SendChannel.Upgrade.Info" = "Enable this to let the admins of %@ turn your gift into a unique collectible. [Learn More >]()";
|
||||
|
||||
"Media.EditCover" = "Edit Cover";
|
||||
"Media.ChooseFromGallery" = "Choose From Gallery";
|
||||
|
@ -590,6 +590,7 @@ public enum PeerInfoControllerMode {
|
||||
case forumTopic(thread: ChatReplyThreadMessage)
|
||||
case recommendedChannels
|
||||
case myProfile
|
||||
case gifts
|
||||
case myProfileGifts
|
||||
}
|
||||
|
||||
|
@ -218,7 +218,8 @@ final class MutableItemCollectionsView {
|
||||
}
|
||||
}
|
||||
|
||||
let (entries, lower, higher) = aroundEntries(namespaces: namespaces,
|
||||
let (entries, lower, higher) = aroundEntries(
|
||||
namespaces: namespaces,
|
||||
aroundIndex: aroundIndex,
|
||||
count: count, collectionIndexById: { id in
|
||||
return postbox.itemCollectionInfoTable.getIndex(id: id)
|
||||
@ -235,7 +236,8 @@ final class MutableItemCollectionsView {
|
||||
fetchHigherItems: {
|
||||
collectionId, itemIndex, count in
|
||||
return self.higherItems(postbox: postbox, collectionId: collectionId, itemIndex: itemIndex, count: count)
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
self.entries = entries
|
||||
self.lower = lower
|
||||
|
@ -439,7 +439,7 @@ public final class ChatChannelSubscriberInputPanelNode: ChatInputPanelNode {
|
||||
self.giftButton.isHidden = true
|
||||
self.helpButton.isHidden = true
|
||||
}
|
||||
self.giftButton.frame = CGRect(x: width - rightInset - panelHeight - 5.0, y: -3.0, width: panelHeight, height: panelHeight)
|
||||
self.giftButton.frame = CGRect(x: width - rightInset - panelHeight - 5.0, y: 0.0, width: panelHeight, height: panelHeight)
|
||||
self.helpButton.frame = CGRect(x: width - rightInset - panelHeight, y: 0.0, width: panelHeight, height: panelHeight)
|
||||
} else {
|
||||
self.giftButton.isHidden = true
|
||||
|
@ -914,7 +914,7 @@ final class GiftSetupScreenComponent: Component {
|
||||
if let upgradeStars = gift.upgradeStars, component.peerId != component.context.account.peerId {
|
||||
let upgradeFooterRawString: String
|
||||
if isChannelGift {
|
||||
upgradeFooterRawString = "Enable this to let the admins of \(peerName) turn your gift into a unique collectible. [Learn More >]()"
|
||||
upgradeFooterRawString = environment.strings.Gift_SendChannel_Upgrade_Info(peerName).string
|
||||
} else {
|
||||
upgradeFooterRawString = environment.strings.Gift_Send_Upgrade_Info(peerName).string
|
||||
}
|
||||
|
@ -1728,8 +1728,14 @@ private final class GiftViewSheetContent: CombinedComponent {
|
||||
valueAttributedString.addAttribute(.baselineOffset, value: 1.0, range: range)
|
||||
}
|
||||
|
||||
var canConvert = true
|
||||
if let reference = subject.arguments?.reference, case let .peer(peerId, _) = reference {
|
||||
if let peer = state.peerMap[peerId], case let .channel(channel) = peer, !channel.flags.contains(.isCreator) {
|
||||
canConvert = false
|
||||
}
|
||||
}
|
||||
let valueComponent: AnyComponent<Empty>
|
||||
if let convertStars, incoming && !converted {
|
||||
if let convertStars, incoming && !converted && canConvert {
|
||||
valueComponent = AnyComponent(
|
||||
HStack([
|
||||
AnyComponentWithIdentity(
|
||||
@ -2558,10 +2564,13 @@ public class GiftViewScreen: ViewControllerComponentContainer {
|
||||
|
||||
self.dismissAnimated()
|
||||
|
||||
let giftsPeerId: EnginePeer.Id?
|
||||
let text: String
|
||||
if arguments.peerId?.namespace == Namespaces.Peer.CloudChannel {
|
||||
if case let .peer(peerId, _) = arguments.reference, peerId == Namespaces.Peer.CloudChannel {
|
||||
giftsPeerId = peerId
|
||||
text = added ? presentationData.strings.Gift_Displayed_ChannelText : presentationData.strings.Gift_Hidden_ChannelText
|
||||
} else {
|
||||
giftsPeerId = arguments.peerId
|
||||
text = added ? presentationData.strings.Gift_Displayed_NewText : presentationData.strings.Gift_Hidden_NewText
|
||||
}
|
||||
|
||||
@ -2573,8 +2582,8 @@ public class GiftViewScreen: ViewControllerComponentContainer {
|
||||
content: .sticker(context: context, file: animationFile, loop: false, title: nil, text: text, undoText: updateSavedToProfile == nil ? presentationData.strings.Gift_Displayed_View : nil, customAction: nil),
|
||||
elevatedLayout: lastController is ChatController,
|
||||
action: { [weak navigationController] action in
|
||||
if case .undo = action, let navigationController {
|
||||
let _ = (context.engine.data.get(TelegramEngine.EngineData.Item.Peer.Peer(id: context.account.peerId))
|
||||
if case .undo = action, let navigationController, let giftsPeerId {
|
||||
let _ = (context.engine.data.get(TelegramEngine.EngineData.Item.Peer.Peer(id: giftsPeerId))
|
||||
|> deliverOnMainQueue).start(next: { [weak navigationController] peer in
|
||||
guard let peer, let navigationController else {
|
||||
return
|
||||
@ -2583,7 +2592,7 @@ public class GiftViewScreen: ViewControllerComponentContainer {
|
||||
context: context,
|
||||
updatedPresentationData: nil,
|
||||
peer: peer._asPeer(),
|
||||
mode: .myProfileGifts,
|
||||
mode: giftsPeerId == context.account.peerId ? .myProfileGifts : .gifts,
|
||||
avatarInitiallyExpanded: false,
|
||||
fromChat: false,
|
||||
requestsContext: nil
|
||||
|
@ -4440,11 +4440,9 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
|
||||
PeerInfoScreenImpl.openSavedMessagesMoreMenu(context: strongSelf.context, sourceController: controller, isViewingAsTopics: true, sourceView: source.view, gesture: gesture)
|
||||
}
|
||||
default:
|
||||
break
|
||||
}
|
||||
} else {
|
||||
strongSelf.displayMediaGalleryContextMenu(source: source, gesture: gesture)
|
||||
}
|
||||
}
|
||||
case .sort:
|
||||
guard let source else {
|
||||
return
|
||||
|
@ -198,7 +198,7 @@ public final class PeerInfoGiftsPaneNode: ASDisplayNode, PeerInfoPaneNode, UIScr
|
||||
ribbonText = nil
|
||||
}
|
||||
case let .unique(gift):
|
||||
ribbonText = params.presentationData.strings.PeerInfo_Gifts_OneOf(compactNumericCountString(Int(gift.availability.total), decimalSeparator: params.presentationData.dateTimeFormat.decimalSeparator)).string
|
||||
ribbonText = params.presentationData.strings.PeerInfo_Gifts_OneOf(compactNumericCountString(Int(gift.availability.issued), decimalSeparator: params.presentationData.dateTimeFormat.decimalSeparator)).string
|
||||
for attribute in gift.attributes {
|
||||
if case let .backdrop(_, innerColor, outerColor, _, _, _) = attribute {
|
||||
ribbonColor = .custom(outerColor, innerColor)
|
||||
|
@ -188,8 +188,6 @@ final class ChannelAppearanceScreenComponent: Component {
|
||||
private let emojiPackSection = ComponentView<Empty>()
|
||||
private let stickerPackSection = ComponentView<Empty>()
|
||||
|
||||
private var chatPreviewItemNode: PeerNameColorChatPreviewItemNode?
|
||||
|
||||
private var isUpdating: Bool = false
|
||||
|
||||
private var component: ChannelAppearanceScreenComponent?
|
||||
@ -227,7 +225,6 @@ final class ChannelAppearanceScreenComponent: Component {
|
||||
private var applyDisposable: Disposable?
|
||||
|
||||
private weak var emojiStatusSelectionController: ViewController?
|
||||
private weak var currentUndoController: UndoOverlayController?
|
||||
|
||||
override init(frame: CGRect) {
|
||||
self.scrollView = ScrollView()
|
||||
@ -469,11 +466,6 @@ final class ChannelAppearanceScreenComponent: Component {
|
||||
return
|
||||
}
|
||||
|
||||
if resolvedState.changes.isEmpty {
|
||||
self.environment?.controller()?.dismiss()
|
||||
return
|
||||
}
|
||||
|
||||
self.isApplyingSettings = true
|
||||
self.state?.updated(transition: .immediate)
|
||||
|
||||
|
@ -3230,6 +3230,8 @@ private func peerInfoControllerImpl(context: AccountContext, updatedPresentation
|
||||
forumTopicThread = thread
|
||||
case .myProfile:
|
||||
isMyProfile = true
|
||||
case .gifts:
|
||||
switchToGifts = true
|
||||
case .myProfileGifts:
|
||||
isMyProfile = true
|
||||
switchToGifts = true
|
||||
|
Loading…
x
Reference in New Issue
Block a user