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
7efcdb4b8e
commit
3bbb677b0d
@ -13539,11 +13539,6 @@ Sorry for the inconvenience.";
|
||||
"Gift.View.UpgradeForFree" = "Upgrade for Free";
|
||||
"Gift.View.KeepUpgradeOrConvertDescription" = "You can keep this gift, upgrade it, or sell it for %@. [More About Stars >]()";
|
||||
|
||||
"PeerInfo.VerificationInfo.Bot" = "This bot is verified as official by the representatives of Telegram.";
|
||||
"PeerInfo.VerificationInfo.Channel" = "This channel is verified as official by the representatives of Telegram.";
|
||||
"PeerInfo.VerificationInfo.Group" = "This group is verified as official by the representatives of Telegram.";
|
||||
"PeerInfo.VerificationInfo.URL" = "https://telegram.org/verify";
|
||||
|
||||
"ChatList.ToastFolderMutedV2" = "All chats in {folder} are now muted";
|
||||
"ChatList.ToastFolderUnmutedV2" = "All chats in {folder} are now unmuted";
|
||||
"ChatList.AddedToFolderTooltipV2" = "{chat} has been added to folder {folder}";
|
||||
|
@ -1096,7 +1096,7 @@ public func universalServiceMessageString(presentationData: (PresentationTheme,
|
||||
attributedString = addAttributesToStringWithRanges(strings.Notification_StarsGift_Sent(authorName, starsPrice)._tuple, body: bodyAttributes, argumentAttributes: attributes)
|
||||
}
|
||||
}
|
||||
case let .starGiftUnique(gift, isUpgrade, isTransferred, _, _, _, _):
|
||||
case let .starGiftUnique(gift, isUpgrade, _, _, _, _, _):
|
||||
if case let .unique(gift) = gift {
|
||||
if !forAdditionalServiceMessage {
|
||||
attributedString = NSAttributedString(string: "\(gift.title) #\(gift.number)", font: titleFont, textColor: primaryTextColor)
|
||||
@ -1113,7 +1113,7 @@ public func universalServiceMessageString(presentationData: (PresentationTheme,
|
||||
let attributes = peerMentionsAttributes(primaryTextColor: primaryTextColor, peerIds: peerIds)
|
||||
attributedString = addAttributesToStringWithRanges(strings.Notification_StarsGift_Upgrade(peerName)._tuple, body: bodyAttributes, argumentAttributes: attributes)
|
||||
}
|
||||
} else if isTransferred {
|
||||
} else {
|
||||
if message.author?.id == accountPeerId {
|
||||
attributedString = NSAttributedString(string: strings.Notification_StarsGift_TransferYou, font: titleFont, textColor: primaryTextColor)
|
||||
} else {
|
||||
|
@ -557,6 +557,7 @@ public final class ButtonComponent: Component {
|
||||
} else {
|
||||
shimmeringTransition = .immediate
|
||||
shimmeringView = ButtonShimmeringView(frame: .zero)
|
||||
self.shimmeringView = shimmeringView
|
||||
self.insertSubview(shimmeringView, at: 0)
|
||||
}
|
||||
shimmeringView.update(size: availableSize, background: component.background, cornerRadius: component.background.cornerRadius, transition: shimmeringTransition)
|
||||
|
@ -462,7 +462,7 @@ public class ChatMessageGiftBubbleContentNode: ChatMessageBubbleContentNode {
|
||||
buttonTitle = item.presentationData.strings.Notification_PremiumPrize_View
|
||||
hasServiceMessage = false
|
||||
}
|
||||
case let .starGift(gift, convertStars, giftText, giftEntities, _, savedToProfile, converted, upgraded, _, upgradeStars, isRefunded, _):
|
||||
case let .starGift(gift, convertStars, giftText, giftEntities, _, savedToProfile, converted, upgraded, canUpgrade, upgradeStars, isRefunded, _):
|
||||
if case let .generic(gift) = gift {
|
||||
isStarGift = true
|
||||
let authorName = item.message.author.flatMap { EnginePeer($0) }?.compactDisplayTitle ?? ""
|
||||
@ -486,7 +486,7 @@ public class ChatMessageGiftBubbleContentNode: ChatMessageBubbleContentNode {
|
||||
text = item.presentationData.strings.Notification_StarGift_Subtitle_Converted(item.presentationData.strings.Notification_StarGift_Subtitle_Converted_Stars(Int32(convertStars ?? 0))).string
|
||||
} else if upgradeStars != nil {
|
||||
text = item.presentationData.strings.Notification_StarGift_Subtitle_Upgrade
|
||||
} else if isSelfGift {
|
||||
} else if isSelfGift && canUpgrade {
|
||||
text = item.presentationData.strings.Notification_StarsGift_Subtitle_Self
|
||||
} else if savedToProfile {
|
||||
if let convertStars {
|
||||
|
@ -476,6 +476,7 @@ final class GiftOptionsScreenComponent: Component {
|
||||
let bottomContentInset: CGFloat = 24.0
|
||||
let sideInset: CGFloat = 16.0 + environment.safeInsets.left
|
||||
let sectionSpacing: CGFloat = 24.0
|
||||
let headerSideInset: CGFloat = 24.0 + environment.safeInsets.left
|
||||
|
||||
let _ = bottomContentInset
|
||||
let _ = sectionSpacing
|
||||
@ -620,7 +621,7 @@ final class GiftOptionsScreenComponent: Component {
|
||||
horizontalAlignment: .center
|
||||
)),
|
||||
environment: {},
|
||||
containerSize: CGSize(width: availableSize.width, height: 100.0)
|
||||
containerSize: CGSize(width: availableSize.width - headerSideInset * 2.0, height: 100.0)
|
||||
)
|
||||
if let premiumTitleView = self.premiumTitle.view {
|
||||
if premiumTitleView.superview == nil {
|
||||
@ -676,7 +677,7 @@ final class GiftOptionsScreenComponent: Component {
|
||||
}
|
||||
)),
|
||||
environment: {},
|
||||
containerSize: CGSize(width: availableSize.width, height: 1000.0)
|
||||
containerSize: CGSize(width: availableSize.width - headerSideInset * 2.0, height: 1000.0)
|
||||
)
|
||||
let premiumDescriptionFrame = CGRect(origin: CGPoint(x: floor((availableSize.width - premiumDescriptionSize.width) / 2.0), y: contentHeight), size: premiumDescriptionSize)
|
||||
if let premiumDescriptionView = self.premiumDescription.view {
|
||||
@ -818,7 +819,7 @@ final class GiftOptionsScreenComponent: Component {
|
||||
horizontalAlignment: .center
|
||||
)),
|
||||
environment: {},
|
||||
containerSize: CGSize(width: availableSize.width, height: 100.0)
|
||||
containerSize: CGSize(width: availableSize.width - headerSideInset * 2.0, height: 100.0)
|
||||
)
|
||||
if let starsTitleView = self.starsTitle.view {
|
||||
if starsTitleView.superview == nil {
|
||||
@ -864,7 +865,7 @@ final class GiftOptionsScreenComponent: Component {
|
||||
}
|
||||
)),
|
||||
environment: {},
|
||||
containerSize: CGSize(width: availableSize.width, height: 1000.0)
|
||||
containerSize: CGSize(width: availableSize.width - headerSideInset * 2.0, height: 1000.0)
|
||||
)
|
||||
let starsDescriptionFrame = CGRect(origin: CGPoint(x: floor((availableSize.width - starsDescriptionSize.width) / 2.0), y: contentHeight), size: starsDescriptionSize)
|
||||
if let starsDescriptionView = self.starsDescription.view {
|
||||
|
@ -1790,7 +1790,7 @@ public class GiftViewScreen: ViewControllerComponentContainer {
|
||||
context: AccountContext,
|
||||
subject: GiftViewScreen.Subject,
|
||||
forceDark: Bool = false,
|
||||
updateSavedToProfile: ((Bool) -> Void)? = nil,
|
||||
updateSavedToProfile: ((EngineMessage.Id, Bool) -> Void)? = nil,
|
||||
convertToStars: (() -> Void)? = nil,
|
||||
transferGift: ((Bool, EnginePeer.Id) -> Void)? = nil,
|
||||
upgradeGift: ((Int64?, Bool) -> Signal<ProfileGiftsContext.State.StarGift, UpgradeStarGiftError>)? = nil
|
||||
@ -1890,7 +1890,7 @@ public class GiftViewScreen: ViewControllerComponentContainer {
|
||||
}
|
||||
|
||||
if let updateSavedToProfile {
|
||||
updateSavedToProfile(added)
|
||||
updateSavedToProfile(messageId, added)
|
||||
} else {
|
||||
let _ = (context.engine.payments.updateStarGiftAddedToProfile(messageId: messageId, added: added)
|
||||
|> deliverOnMainQueue).startStandalone()
|
||||
|
@ -1641,17 +1641,6 @@ private func infoItems(data: PeerInfoScreenData?, context: AccountContext, prese
|
||||
context.sharedContext.openExternalUrl(context: context, urlContext: .generic, url: url, forceExternal: false, presentationData: presentationData, navigationController: navigationController, dismissInput: {})
|
||||
}
|
||||
}))
|
||||
} else if user.isVerified {
|
||||
let description = presentationData.strings.PeerInfo_VerificationInfo_Bot
|
||||
|
||||
let attributedPrefix = NSMutableAttributedString(string: " ")
|
||||
attributedPrefix.addAttribute(ChatTextInputAttributes.customEmoji, value: ChatTextInputTextCustomEmojiAttribute(interactivelySelectedFromPackId: nil, fileId: 0, file: nil, custom: .verification), range: NSMakeRange(0, 1))
|
||||
|
||||
items[currentPeerInfoSection]!.append(PeerInfoScreenCommentItem(id: 800, text: description, attributedPrefix: attributedPrefix, useAccentLinkColor: false, linkAction: { action in
|
||||
if case .tap = action, let navigationController = interaction.getController()?.navigationController as? NavigationController {
|
||||
context.sharedContext.openExternalUrl(context: context, urlContext: .generic, url: presentationData.strings.PeerInfo_VerificationInfo_URL, forceExternal: false, presentationData: presentationData, navigationController: navigationController, dismissInput: {})
|
||||
}
|
||||
}))
|
||||
} else if let botInfo = user.botInfo, botInfo.flags.contains(.worksWithGroups) {
|
||||
items[currentPeerInfoSection]!.append(PeerInfoScreenActionItem(id: 7, text: presentationData.strings.Bot_AddToChat, color: .accent, action: {
|
||||
interaction.openAddBotToGroup()
|
||||
@ -1821,22 +1810,6 @@ private func infoItems(data: PeerInfoScreenData?, context: AccountContext, prese
|
||||
context.sharedContext.openExternalUrl(context: context, urlContext: .generic, url: url, forceExternal: false, presentationData: presentationData, navigationController: navigationController, dismissInput: {})
|
||||
}
|
||||
}))
|
||||
} else if channel.isVerified {
|
||||
let description: String
|
||||
if case .group = channel.info {
|
||||
description = presentationData.strings.PeerInfo_VerificationInfo_Group
|
||||
} else {
|
||||
description = presentationData.strings.PeerInfo_VerificationInfo_Channel
|
||||
}
|
||||
|
||||
let attributedPrefix = NSMutableAttributedString(string: " ")
|
||||
attributedPrefix.addAttribute(ChatTextInputAttributes.customEmoji, value: ChatTextInputTextCustomEmojiAttribute(interactivelySelectedFromPackId: nil, fileId: 0, file: nil, custom: .verification), range: NSMakeRange(0, 1))
|
||||
|
||||
items[currentPeerInfoSection]!.append(PeerInfoScreenCommentItem(id: 800, text: description, attributedPrefix: attributedPrefix, useAccentLinkColor: false, linkAction: { action in
|
||||
if case .tap = action, let navigationController = interaction.getController()?.navigationController as? NavigationController {
|
||||
context.sharedContext.openExternalUrl(context: context, urlContext: .generic, url: presentationData.strings.PeerInfo_VerificationInfo_URL, forceExternal: false, presentationData: presentationData, navigationController: navigationController, dismissInput: {})
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
if case .broadcast = channel.info {
|
||||
|
@ -224,8 +224,8 @@ public final class PeerInfoGiftsPaneNode: ASDisplayNode, PeerInfoPaneNode, UIScr
|
||||
let controller = GiftViewScreen(
|
||||
context: self.context,
|
||||
subject: .profileGift(self.peerId, product),
|
||||
updateSavedToProfile: { [weak self] added in
|
||||
guard let self, let messageId = product.messageId else {
|
||||
updateSavedToProfile: { [weak self] messageId, added in
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
self.profileGifts.updateStarGiftAddedToProfile(messageId: messageId, added: added)
|
||||
|
Loading…
x
Reference in New Issue
Block a user