Skip to content

Commit 3fb73a8

Browse files
committed
Various fixes
1 parent d62c37a commit 3fb73a8

File tree

6 files changed

+176
-91
lines changed

6 files changed

+176
-91
lines changed

submodules/PremiumUI/Sources/PremiumIntroScreen.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -885,13 +885,7 @@ struct PremiumIntroConfiguration {
885885
if perks.count < 4 {
886886
perks = PremiumIntroConfiguration.defaultValue.perks
887887
}
888-
889-
#if DEBUG
890-
if !perks.contains(.paidMessages) {
891-
perks.append(.paidMessages)
892-
}
893-
#endif
894-
888+
895889
var businessPerks: [PremiumPerk] = []
896890
if let values = data["business_promo_order"] as? [String] {
897891
for value in values {

submodules/SettingsUI/Sources/Privacy and Security/IncomingMessagePrivacyScreen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ public func incomingMessagePrivacyScreen(context: AccountContext, value: GlobalP
356356
},
357357
openPremiumInfo: {
358358
var replaceImpl: ((ViewController) -> Void)?
359-
let controller = context.sharedContext.makePremiumDemoController(context: context, subject: .paidMessages, forceDark: false, action: {
359+
let controller = context.sharedContext.makePremiumDemoController(context: context, subject: .messagePrivacy, forceDark: false, action: {
360360
let controller = context.sharedContext.makePremiumIntroController(context: context, source: .paidMessages, forceDark: false, dismissed: nil)
361361
replaceImpl?(controller)
362362
}, dismissed: nil)

submodules/TelegramUI/Components/Chat/ChatUserInfoItem/Sources/ChatUserInfoItem.swift

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,14 @@ public final class ChatUserInfoItemNode: ListViewItemNode, ASGestureRecognizerDe
219219
}
220220

221221
public override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
222-
let location = gestureRecognizer.location(in: self.offsetContainer.view)
223-
if let backgroundContent = self.backgroundContent, backgroundContent.frame.contains(location) {
224-
return true
222+
if gestureRecognizer.view === self.offsetContainer.view {
223+
let location = gestureRecognizer.location(in: self.offsetContainer.view)
224+
if let backgroundContent = self.backgroundContent, backgroundContent.frame.contains(location) {
225+
return true
226+
}
227+
return false
225228
}
226-
return false
229+
return true
227230
}
228231

229232
@objc private func tapGesture(_ gestureRecognizer: UITapGestureRecognizer) {
@@ -366,7 +369,7 @@ public final class ChatUserInfoItemNode: ListViewItemNode, ASGestureRecognizerDe
366369
var estimatedValueOffset: CGFloat = 0.0
367370
if groupsInCommonCount > 0 {
368371
groupsValueText = NSMutableAttributedString(string: item.presentationData.strings.Chat_NonContactUser_GroupsCount(groupsInCommonCount), font: Font.semibold(13.0), textColor: primaryTextColor)
369-
estimatedValueOffset = avatarImageSize + CGFloat(min(2, max(0, item.groupsInCommonCount - 1))) * avatarSpacing + 4.0
372+
estimatedValueOffset = avatarImageSize + CGFloat(min(2, max(0, item.groupsInCommonCount - 1))) * avatarSpacing + 4.0 + 10.0
370373
} else {
371374
groupsValueText = NSMutableAttributedString(string: "", font: Font.semibold(13.0), textColor: primaryTextColor)
372375
}
@@ -380,7 +383,7 @@ public final class ChatUserInfoItemNode: ListViewItemNode, ASGestureRecognizerDe
380383
backgroundSize.height += groupsValueLayoutAndApply?.0.size.height ?? 0.0
381384

382385
maxTitleWidth = max(maxTitleWidth, groupsTitleLayoutAndApply?.0.size.width ?? 0)
383-
maxValueWidth = max(maxValueWidth, groupsValueLayoutAndApply?.0.size.width ?? 0 + estimatedValueOffset)
386+
maxValueWidth = max(maxValueWidth, (groupsValueLayoutAndApply?.0.size.width ?? 0) + estimatedValueOffset)
384387
} else {
385388
groupsTitleLayoutAndApply = nil
386389
groupsValueLayoutAndApply = nil
@@ -474,15 +477,15 @@ public final class ChatUserInfoItemNode: ListViewItemNode, ASGestureRecognizerDe
474477

475478
var attributeMidpoints: [CGFloat] = []
476479

477-
func appendAttributeMidpoint(titleLayout: TextNodeLayout?, valueLayout: TextNodeLayout?) {
480+
func appendAttributeMidpoint(titleLayout: TextNodeLayout?, valueLayout: TextNodeLayout?, valueOffset: CGFloat = 0.0) {
478481
if let valueLayout {
479-
let midpoint = backgroundSize.width - horizontalContentInset - valueLayout.size.width - attributeSpacing / 2.0
482+
let midpoint = backgroundSize.width - horizontalContentInset - valueLayout.size.width - valueOffset - attributeSpacing / 2.0
480483
attributeMidpoints.append(midpoint)
481484
}
482485
}
483486
appendAttributeMidpoint(titleLayout: phoneCountryTitleLayoutAndApply?.0, valueLayout: phoneCountryValueLayoutAndApply?.0)
484487
appendAttributeMidpoint(titleLayout: registrationDateTitleLayoutAndApply?.0, valueLayout: registrationDateValueLayoutAndApply?.0)
485-
appendAttributeMidpoint(titleLayout: groupsTitleLayoutAndApply?.0, valueLayout: groupsValueLayoutAndApply?.0)
488+
appendAttributeMidpoint(titleLayout: groupsTitleLayoutAndApply?.0, valueLayout: groupsValueLayoutAndApply?.0, valueOffset: estimatedValueOffset)
486489

487490
let middleX = floorToScreenPixels(attributeMidpoints.min() ?? backgroundSize.width / 2.0)
488491

0 commit comments

Comments
 (0)