mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 21:45:19 +00:00
Cherry pick some fixes
This commit is contained in:
parent
0d1140a175
commit
9b451481a3
@ -9167,6 +9167,7 @@ Sorry for the inconvenience.";
|
|||||||
|
|
||||||
"WebApp.LaunchMoreInfo" = "More about this bot";
|
"WebApp.LaunchMoreInfo" = "More about this bot";
|
||||||
"WebApp.LaunchConfirmation" = "To launch this web app, you will connect to its website.";
|
"WebApp.LaunchConfirmation" = "To launch this web app, you will connect to its website.";
|
||||||
|
"WebApp.LaunchOpenApp" = "Open App";
|
||||||
|
|
||||||
"WallpaperPreview.PreviewInNightMode" = "Preview this wallpaper in night mode.";
|
"WallpaperPreview.PreviewInNightMode" = "Preview this wallpaper in night mode.";
|
||||||
"WallpaperPreview.PreviewInDayMode" = "Preview this wallpaper in day mode.";
|
"WallpaperPreview.PreviewInDayMode" = "Preview this wallpaper in day mode.";
|
||||||
@ -9334,3 +9335,10 @@ Sorry for the inconvenience.";
|
|||||||
"ChatList.EmptyListTooltip" = "Send a message or\nstart a group here.";
|
"ChatList.EmptyListTooltip" = "Send a message or\nstart a group here.";
|
||||||
|
|
||||||
"Username.BotTitle" = "Public Links";
|
"Username.BotTitle" = "Public Links";
|
||||||
|
|
||||||
|
"Notification.LockScreenReactionPlaceholder" = "Reaction";
|
||||||
|
|
||||||
|
"UserInfo.BotNamePlaceholder" = "Bot Name";
|
||||||
|
|
||||||
|
"ChatList.PremiumRestoreDiscountTitle" = "Get Premium back with up to %@ off";
|
||||||
|
"ChatList.PremiumRestoreDiscountText" = "Your Telegram Premium has recently expired. Tap here to extend it.";
|
||||||
|
@ -718,6 +718,7 @@ private final class MainButtonNode: HighlightTrackingButtonNode {
|
|||||||
let statusSize = CGSize(width: 20.0, height: 20.0)
|
let statusSize = CGSize(width: 20.0, height: 20.0)
|
||||||
transition.updateFrame(node: self.statusNode, frame: CGRect(origin: CGPoint(x: size.width - statusSize.width - 15.0, y: floorToScreenPixels((size.height - statusSize.height) / 2.0)), size: statusSize))
|
transition.updateFrame(node: self.statusNode, frame: CGRect(origin: CGPoint(x: size.width - statusSize.width - 15.0, y: floorToScreenPixels((size.height - statusSize.height) / 2.0)), size: statusSize))
|
||||||
|
|
||||||
|
self.statusNode.foregroundNodeColor = state.textColor
|
||||||
self.statusNode.transitionToState(state.progress == .side ? .progress(value: nil, cancelEnabled: false, appearance: SemanticStatusNodeState.ProgressAppearance(inset: 0.0, lineWidth: 2.0)) : .none)
|
self.statusNode.transitionToState(state.progress == .side ? .progress(value: nil, cancelEnabled: false, appearance: SemanticStatusNodeState.ProgressAppearance(inset: 0.0, lineWidth: 2.0)) : .none)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -663,7 +663,7 @@ private func mappedInsertEntries(context: AccountContext, nodeInteraction: ChatL
|
|||||||
nodeInteraction?.openStorageManagement()
|
nodeInteraction?.openStorageManagement()
|
||||||
case .setupPassword:
|
case .setupPassword:
|
||||||
nodeInteraction?.openPasswordSetup()
|
nodeInteraction?.openPasswordSetup()
|
||||||
case .premiumUpgrade, .premiumAnnualDiscount:
|
case .premiumUpgrade, .premiumAnnualDiscount, .premiumRestore:
|
||||||
nodeInteraction?.openPremiumIntro()
|
nodeInteraction?.openPremiumIntro()
|
||||||
case .chatFolderUpdates:
|
case .chatFolderUpdates:
|
||||||
nodeInteraction?.openChatFolderUpdates()
|
nodeInteraction?.openChatFolderUpdates()
|
||||||
@ -964,7 +964,7 @@ private func mappedUpdateEntries(context: AccountContext, nodeInteraction: ChatL
|
|||||||
nodeInteraction?.openStorageManagement()
|
nodeInteraction?.openStorageManagement()
|
||||||
case .setupPassword:
|
case .setupPassword:
|
||||||
nodeInteraction?.openPasswordSetup()
|
nodeInteraction?.openPasswordSetup()
|
||||||
case .premiumUpgrade, .premiumAnnualDiscount:
|
case .premiumUpgrade, .premiumAnnualDiscount, .premiumRestore:
|
||||||
nodeInteraction?.openPremiumIntro()
|
nodeInteraction?.openPremiumIntro()
|
||||||
case .chatFolderUpdates:
|
case .chatFolderUpdates:
|
||||||
nodeInteraction?.openChatFolderUpdates()
|
nodeInteraction?.openChatFolderUpdates()
|
||||||
@ -1492,6 +1492,7 @@ public final class ChatListNode: ListView {
|
|||||||
if let self {
|
if let self {
|
||||||
let _ = dismissServerProvidedSuggestion(account: self.context.account, suggestion: .annualPremium).start()
|
let _ = dismissServerProvidedSuggestion(account: self.context.account, suggestion: .annualPremium).start()
|
||||||
let _ = dismissServerProvidedSuggestion(account: self.context.account, suggestion: .upgradePremium).start()
|
let _ = dismissServerProvidedSuggestion(account: self.context.account, suggestion: .upgradePremium).start()
|
||||||
|
let _ = dismissServerProvidedSuggestion(account: self.context.account, suggestion: .restorePremium).start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let controller = self.context.sharedContext.makePremiumIntroController(context: self.context, source: .ads)
|
let controller = self.context.sharedContext.makePremiumIntroController(context: self.context, source: .ads)
|
||||||
@ -1612,7 +1613,7 @@ public final class ChatListNode: ListView {
|
|||||||
return .single(.setupPassword)
|
return .single(.setupPassword)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if suggestions.contains(.annualPremium) || suggestions.contains(.upgradePremium), let inAppPurchaseManager = context.inAppPurchaseManager {
|
if suggestions.contains(.annualPremium) || suggestions.contains(.upgradePremium) || suggestions.contains(.restorePremium), let inAppPurchaseManager = context.inAppPurchaseManager {
|
||||||
return inAppPurchaseManager.availableProducts
|
return inAppPurchaseManager.availableProducts
|
||||||
|> map { products -> ChatListNotice? in
|
|> map { products -> ChatListNotice? in
|
||||||
if products.count > 1 {
|
if products.count > 1 {
|
||||||
@ -1627,7 +1628,9 @@ public final class ChatListNode: ListView {
|
|||||||
let fraction = Float(product.priceCurrencyAndAmount.amount) / Float(12) / Float(shortestOptionPrice.0)
|
let fraction = Float(product.priceCurrencyAndAmount.amount) / Float(12) / Float(shortestOptionPrice.0)
|
||||||
let discount = Int32(round((1.0 - fraction) * 20.0) * 5.0)
|
let discount = Int32(round((1.0 - fraction) * 20.0) * 5.0)
|
||||||
if discount > 0 {
|
if discount > 0 {
|
||||||
if suggestions.contains(.annualPremium) {
|
if suggestions.contains(.restorePremium) {
|
||||||
|
return .premiumRestore(discount: discount)
|
||||||
|
} else if suggestions.contains(.annualPremium) {
|
||||||
return .premiumAnnualDiscount(discount: discount)
|
return .premiumAnnualDiscount(discount: discount)
|
||||||
} else if suggestions.contains(.upgradePremium) {
|
} else if suggestions.contains(.upgradePremium) {
|
||||||
return .premiumUpgrade(discount: discount)
|
return .premiumUpgrade(discount: discount)
|
||||||
|
@ -84,6 +84,7 @@ enum ChatListNotice: Equatable {
|
|||||||
case setupPassword
|
case setupPassword
|
||||||
case premiumUpgrade(discount: Int32)
|
case premiumUpgrade(discount: Int32)
|
||||||
case premiumAnnualDiscount(discount: Int32)
|
case premiumAnnualDiscount(discount: Int32)
|
||||||
|
case premiumRestore(discount: Int32)
|
||||||
case chatFolderUpdates(count: Int)
|
case chatFolderUpdates(count: Int)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,6 +173,16 @@ class ChatListStorageInfoItemNode: ItemListRevealOptionsItemNode {
|
|||||||
titleString = titleStringValue
|
titleString = titleStringValue
|
||||||
|
|
||||||
textString = NSAttributedString(string: item.strings.ChatList_PremiumAnnualDiscountText, font: textFont, textColor: item.theme.rootController.navigationBar.secondaryTextColor)
|
textString = NSAttributedString(string: item.strings.ChatList_PremiumAnnualDiscountText, font: textFont, textColor: item.theme.rootController.navigationBar.secondaryTextColor)
|
||||||
|
case let .premiumRestore(discount):
|
||||||
|
let discountString = "\(discount)%"
|
||||||
|
let rawTitleString = item.strings.ChatList_PremiumRestoreDiscountTitle(discountString)
|
||||||
|
let titleStringValue = NSMutableAttributedString(attributedString: NSAttributedString(string: rawTitleString.string, font: titleFont, textColor: item.theme.rootController.navigationBar.primaryTextColor))
|
||||||
|
if let range = rawTitleString.ranges.first {
|
||||||
|
titleStringValue.addAttribute(.foregroundColor, value: item.theme.rootController.navigationBar.accentTextColor, range: range.range)
|
||||||
|
}
|
||||||
|
titleString = titleStringValue
|
||||||
|
|
||||||
|
textString = NSAttributedString(string: item.strings.ChatList_PremiumRestoreDiscountText, font: textFont, textColor: item.theme.rootController.navigationBar.secondaryTextColor)
|
||||||
case let .chatFolderUpdates(count):
|
case let .chatFolderUpdates(count):
|
||||||
let rawTitleString = item.strings.ChatList_ChatFolderUpdateHintTitle(item.strings.ChatList_ChatFolderUpdateCount(Int32(count)))
|
let rawTitleString = item.strings.ChatList_ChatFolderUpdateHintTitle(item.strings.ChatList_ChatFolderUpdateCount(Int32(count)))
|
||||||
let titleStringValue = NSMutableAttributedString(attributedString: NSAttributedString(string: rawTitleString.string, font: titleFont, textColor: item.theme.rootController.navigationBar.primaryTextColor))
|
let titleStringValue = NSMutableAttributedString(attributedString: NSAttributedString(string: rawTitleString.string, font: titleFont, textColor: item.theme.rootController.navigationBar.primaryTextColor))
|
||||||
|
@ -47,6 +47,7 @@ CGSize TGPhotoEditorScreenImageMaxSize();
|
|||||||
|
|
||||||
extern const CGSize TGPhotoEditorResultImageMaxSize;
|
extern const CGSize TGPhotoEditorResultImageMaxSize;
|
||||||
extern const CGSize TGPhotoEditorResultImageWallpaperMaxSize;
|
extern const CGSize TGPhotoEditorResultImageWallpaperMaxSize;
|
||||||
|
extern const CGSize TGPhotoEditorResultImageAvatarMaxSize;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -498,7 +498,7 @@
|
|||||||
}] map:^UIImage *(UIImage *image)
|
}] map:^UIImage *(UIImage *image)
|
||||||
{
|
{
|
||||||
if (avatar) {
|
if (avatar) {
|
||||||
CGFloat maxSide = [GPUImageContext maximumTextureSizeForThisDevice];
|
CGFloat maxSide = MIN(TGPhotoEditorResultImageAvatarMaxSize.width, [GPUImageContext maximumTextureSizeForThisDevice]);
|
||||||
if (MAX(image.size.width, image.size.height) > maxSide) {
|
if (MAX(image.size.width, image.size.height) > maxSide) {
|
||||||
CGSize fittedSize = TGScaleToFit(image.size, CGSizeMake(maxSide, maxSide));
|
CGSize fittedSize = TGScaleToFit(image.size, CGSizeMake(maxSide, maxSide));
|
||||||
return TGScaleImageToPixelSize(image, fittedSize);
|
return TGScaleImageToPixelSize(image, fittedSize);
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
const CGSize TGPhotoEditorResultImageMaxSize = { 1280, 1280 };
|
const CGSize TGPhotoEditorResultImageMaxSize = { 1280, 1280 };
|
||||||
const CGSize TGPhotoEditorResultImageWallpaperMaxSize = { 2048, 2048 };
|
const CGSize TGPhotoEditorResultImageWallpaperMaxSize = { 2048, 2048 };
|
||||||
|
const CGSize TGPhotoEditorResultImageAvatarMaxSize = { 2048, 2048 };
|
||||||
const CGSize TGPhotoEditorScreenImageHardLimitSize = { 1280, 1280 };
|
const CGSize TGPhotoEditorScreenImageHardLimitSize = { 1280, 1280 };
|
||||||
const CGSize TGPhotoEditorScreenImageHardLimitLegacySize = { 750, 750 };
|
const CGSize TGPhotoEditorScreenImageHardLimitLegacySize = { 750, 750 };
|
||||||
|
|
||||||
|
@ -349,7 +349,7 @@ private func channelAdminsControllerEntries(presentationData: PresentationData,
|
|||||||
if case .group = peer.info {
|
if case .group = peer.info {
|
||||||
isGroup = true
|
isGroup = true
|
||||||
}
|
}
|
||||||
entries.append(.recentActions(presentationData.theme, presentationData.strings.Group_Info_AdminLog))
|
//entries.append(.recentActions(presentationData.theme, presentationData.strings.Group_Info_AdminLog))
|
||||||
|
|
||||||
if isGroup && peer.hasPermission(.deleteAllMessages) && (antiSpamAvailable || antiSpamEnabled) {
|
if isGroup && peer.hasPermission(.deleteAllMessages) && (antiSpamAvailable || antiSpamEnabled) {
|
||||||
entries.append(.antiSpam(presentationData.theme, presentationData.strings.Group_Management_AntiSpam, antiSpamEnabled))
|
entries.append(.antiSpam(presentationData.theme, presentationData.strings.Group_Management_AntiSpam, antiSpamEnabled))
|
||||||
|
@ -11,6 +11,7 @@ public enum ServerProvidedSuggestion: String {
|
|||||||
case setupPassword = "SETUP_PASSWORD"
|
case setupPassword = "SETUP_PASSWORD"
|
||||||
case upgradePremium = "PREMIUM_UPGRADE"
|
case upgradePremium = "PREMIUM_UPGRADE"
|
||||||
case annualPremium = "PREMIUM_ANNUAL"
|
case annualPremium = "PREMIUM_ANNUAL"
|
||||||
|
case restorePremium = "PREMIUM_RESTORE"
|
||||||
}
|
}
|
||||||
|
|
||||||
private var dismissedSuggestionsPromise = ValuePromise<[AccountRecordId: Set<ServerProvidedSuggestion>]>([:])
|
private var dismissedSuggestionsPromise = ValuePromise<[AccountRecordId: Set<ServerProvidedSuggestion>]>([:])
|
||||||
|
@ -177,12 +177,25 @@ public final class EditableBotInfo: PostboxCoding, Equatable {
|
|||||||
public static func ==(lhs: EditableBotInfo, rhs: EditableBotInfo) -> Bool {
|
public static func ==(lhs: EditableBotInfo, rhs: EditableBotInfo) -> Bool {
|
||||||
return lhs.name == rhs.name && lhs.about == rhs.about && lhs.description == rhs.description
|
return lhs.name == rhs.name && lhs.about == rhs.about && lhs.description == rhs.description
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func withUpdatedName(_ name: String) -> EditableBotInfo {
|
||||||
|
return EditableBotInfo(name: name, about: self.about, description: self.description)
|
||||||
|
}
|
||||||
|
|
||||||
|
public func withUpdatedAbout(_ about: String) -> EditableBotInfo {
|
||||||
|
return EditableBotInfo(name: self.name, about: about, description: self.description)
|
||||||
|
}
|
||||||
|
|
||||||
|
public func withUpdatedDescription(_ description: String) -> EditableBotInfo {
|
||||||
|
return EditableBotInfo(name: self.name, about: self.about, description: description)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public final class CachedUserData: CachedPeerData {
|
public final class CachedUserData: CachedPeerData {
|
||||||
public let about: String?
|
public let about: String?
|
||||||
public let botInfo: BotInfo?
|
public let botInfo: BotInfo?
|
||||||
|
public let editableBotInfo: EditableBotInfo?
|
||||||
public let peerStatusSettings: PeerStatusSettings?
|
public let peerStatusSettings: PeerStatusSettings?
|
||||||
public let pinnedMessageId: MessageId?
|
public let pinnedMessageId: MessageId?
|
||||||
public let isBlocked: Bool
|
public let isBlocked: Bool
|
||||||
@ -209,6 +222,7 @@ public final class CachedUserData: CachedPeerData {
|
|||||||
public init() {
|
public init() {
|
||||||
self.about = nil
|
self.about = nil
|
||||||
self.botInfo = nil
|
self.botInfo = nil
|
||||||
|
self.editableBotInfo = nil
|
||||||
self.peerStatusSettings = nil
|
self.peerStatusSettings = nil
|
||||||
self.pinnedMessageId = nil
|
self.pinnedMessageId = nil
|
||||||
self.isBlocked = false
|
self.isBlocked = false
|
||||||
@ -231,9 +245,10 @@ public final class CachedUserData: CachedPeerData {
|
|||||||
self.messageIds = Set()
|
self.messageIds = Set()
|
||||||
}
|
}
|
||||||
|
|
||||||
public init(about: String?, botInfo: BotInfo?, peerStatusSettings: PeerStatusSettings?, pinnedMessageId: MessageId?, isBlocked: Bool, commonGroupCount: Int32, voiceCallsAvailable: Bool, videoCallsAvailable: Bool, callsPrivate: Bool, canPinMessages: Bool, hasScheduledMessages: Bool, autoremoveTimeout: CachedPeerAutoremoveTimeout, themeEmoticon: String?, photo: CachedPeerProfilePhoto, personalPhoto: CachedPeerProfilePhoto, fallbackPhoto: CachedPeerProfilePhoto, premiumGiftOptions: [CachedPremiumGiftOption], voiceMessagesAvailable: Bool, wallpaper: TelegramWallpaper?, flags: CachedUserFlags) {
|
public init(about: String?, botInfo: BotInfo?, editableBotInfo: EditableBotInfo?, peerStatusSettings: PeerStatusSettings?, pinnedMessageId: MessageId?, isBlocked: Bool, commonGroupCount: Int32, voiceCallsAvailable: Bool, videoCallsAvailable: Bool, callsPrivate: Bool, canPinMessages: Bool, hasScheduledMessages: Bool, autoremoveTimeout: CachedPeerAutoremoveTimeout, themeEmoticon: String?, photo: CachedPeerProfilePhoto, personalPhoto: CachedPeerProfilePhoto, fallbackPhoto: CachedPeerProfilePhoto, premiumGiftOptions: [CachedPremiumGiftOption], voiceMessagesAvailable: Bool, wallpaper: TelegramWallpaper?, flags: CachedUserFlags) {
|
||||||
self.about = about
|
self.about = about
|
||||||
self.botInfo = botInfo
|
self.botInfo = botInfo
|
||||||
|
self.editableBotInfo = editableBotInfo
|
||||||
self.peerStatusSettings = peerStatusSettings
|
self.peerStatusSettings = peerStatusSettings
|
||||||
self.pinnedMessageId = pinnedMessageId
|
self.pinnedMessageId = pinnedMessageId
|
||||||
self.isBlocked = isBlocked
|
self.isBlocked = isBlocked
|
||||||
@ -265,6 +280,7 @@ public final class CachedUserData: CachedPeerData {
|
|||||||
public init(decoder: PostboxDecoder) {
|
public init(decoder: PostboxDecoder) {
|
||||||
self.about = decoder.decodeOptionalStringForKey("a")
|
self.about = decoder.decodeOptionalStringForKey("a")
|
||||||
self.botInfo = decoder.decodeObjectForKey("bi") as? BotInfo
|
self.botInfo = decoder.decodeObjectForKey("bi") as? BotInfo
|
||||||
|
self.editableBotInfo = decoder.decodeObjectForKey("ebi") as? EditableBotInfo
|
||||||
if let legacyValue = decoder.decodeOptionalInt32ForKey("pcs") {
|
if let legacyValue = decoder.decodeOptionalInt32ForKey("pcs") {
|
||||||
self.peerStatusSettings = PeerStatusSettings(flags: PeerStatusSettings.Flags(rawValue: legacyValue), geoDistance: nil)
|
self.peerStatusSettings = PeerStatusSettings(flags: PeerStatusSettings.Flags(rawValue: legacyValue), geoDistance: nil)
|
||||||
} else if let peerStatusSettings = decoder.decodeObjectForKey("pss", decoder: { PeerStatusSettings(decoder: $0) }) as? PeerStatusSettings {
|
} else if let peerStatusSettings = decoder.decodeObjectForKey("pss", decoder: { PeerStatusSettings(decoder: $0) }) as? PeerStatusSettings {
|
||||||
@ -316,6 +332,11 @@ public final class CachedUserData: CachedPeerData {
|
|||||||
} else {
|
} else {
|
||||||
encoder.encodeNil(forKey: "bi")
|
encoder.encodeNil(forKey: "bi")
|
||||||
}
|
}
|
||||||
|
if let editableBotInfo = self.editableBotInfo {
|
||||||
|
encoder.encodeObject(editableBotInfo, forKey: "ebi")
|
||||||
|
} else {
|
||||||
|
encoder.encodeNil(forKey: "ebi")
|
||||||
|
}
|
||||||
if let peerStatusSettings = self.peerStatusSettings {
|
if let peerStatusSettings = self.peerStatusSettings {
|
||||||
encoder.encodeObject(peerStatusSettings, forKey: "pss")
|
encoder.encodeObject(peerStatusSettings, forKey: "pss")
|
||||||
} else {
|
} else {
|
||||||
@ -372,86 +393,90 @@ public final class CachedUserData: CachedPeerData {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
return other.about == self.about && other.botInfo == self.botInfo && self.peerStatusSettings == other.peerStatusSettings && self.isBlocked == other.isBlocked && self.commonGroupCount == other.commonGroupCount && self.voiceCallsAvailable == other.voiceCallsAvailable && self.videoCallsAvailable == other.videoCallsAvailable && self.callsPrivate == other.callsPrivate && self.hasScheduledMessages == other.hasScheduledMessages && self.autoremoveTimeout == other.autoremoveTimeout && self.themeEmoticon == other.themeEmoticon && self.photo == other.photo && self.personalPhoto == other.personalPhoto && self.fallbackPhoto == other.fallbackPhoto && self.premiumGiftOptions == other.premiumGiftOptions && self.voiceMessagesAvailable == other.voiceMessagesAvailable && self.flags == other.flags && self.wallpaper == other.wallpaper
|
return other.about == self.about && other.botInfo == self.botInfo && other.editableBotInfo == self.editableBotInfo && self.peerStatusSettings == other.peerStatusSettings && self.isBlocked == other.isBlocked && self.commonGroupCount == other.commonGroupCount && self.voiceCallsAvailable == other.voiceCallsAvailable && self.videoCallsAvailable == other.videoCallsAvailable && self.callsPrivate == other.callsPrivate && self.hasScheduledMessages == other.hasScheduledMessages && self.autoremoveTimeout == other.autoremoveTimeout && self.themeEmoticon == other.themeEmoticon && self.photo == other.photo && self.personalPhoto == other.personalPhoto && self.fallbackPhoto == other.fallbackPhoto && self.premiumGiftOptions == other.premiumGiftOptions && self.voiceMessagesAvailable == other.voiceMessagesAvailable && self.flags == other.flags && self.wallpaper == other.wallpaper
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedAbout(_ about: String?) -> CachedUserData {
|
public func withUpdatedAbout(_ about: String?) -> CachedUserData {
|
||||||
return CachedUserData(about: about, botInfo: self.botInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
return CachedUserData(about: about, botInfo: self.botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedBotInfo(_ botInfo: BotInfo?) -> CachedUserData {
|
public func withUpdatedBotInfo(_ botInfo: BotInfo?) -> CachedUserData {
|
||||||
return CachedUserData(about: self.about, botInfo: botInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
return CachedUserData(about: self.about, botInfo: botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
||||||
|
}
|
||||||
|
|
||||||
|
public func withUpdatedEditableBotInfo(_ editableBotInfo: EditableBotInfo?) -> CachedUserData {
|
||||||
|
return CachedUserData(about: self.about, botInfo: self.botInfo, editableBotInfo: editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedPeerStatusSettings(_ peerStatusSettings: PeerStatusSettings) -> CachedUserData {
|
public func withUpdatedPeerStatusSettings(_ peerStatusSettings: PeerStatusSettings) -> CachedUserData {
|
||||||
return CachedUserData(about: self.about, botInfo: self.botInfo, peerStatusSettings: peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
return CachedUserData(about: self.about, botInfo: self.botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedPinnedMessageId(_ pinnedMessageId: MessageId?) -> CachedUserData {
|
public func withUpdatedPinnedMessageId(_ pinnedMessageId: MessageId?) -> CachedUserData {
|
||||||
return CachedUserData(about: self.about, botInfo: self.botInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
return CachedUserData(about: self.about, botInfo: self.botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedIsBlocked(_ isBlocked: Bool) -> CachedUserData {
|
public func withUpdatedIsBlocked(_ isBlocked: Bool) -> CachedUserData {
|
||||||
return CachedUserData(about: self.about, botInfo: self.botInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
return CachedUserData(about: self.about, botInfo: self.botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedCommonGroupCount(_ commonGroupCount: Int32) -> CachedUserData {
|
public func withUpdatedCommonGroupCount(_ commonGroupCount: Int32) -> CachedUserData {
|
||||||
return CachedUserData(about: self.about, botInfo: self.botInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
return CachedUserData(about: self.about, botInfo: self.botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedVoiceCallsAvailable(_ voiceCallsAvailable: Bool) -> CachedUserData {
|
public func withUpdatedVoiceCallsAvailable(_ voiceCallsAvailable: Bool) -> CachedUserData {
|
||||||
return CachedUserData(about: self.about, botInfo: self.botInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
return CachedUserData(about: self.about, botInfo: self.botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedVideoCallsAvailable(_ videoCallsAvailable: Bool) -> CachedUserData {
|
public func withUpdatedVideoCallsAvailable(_ videoCallsAvailable: Bool) -> CachedUserData {
|
||||||
return CachedUserData(about: self.about, botInfo: self.botInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
return CachedUserData(about: self.about, botInfo: self.botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedCallsPrivate(_ callsPrivate: Bool) -> CachedUserData {
|
public func withUpdatedCallsPrivate(_ callsPrivate: Bool) -> CachedUserData {
|
||||||
return CachedUserData(about: self.about, botInfo: self.botInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
return CachedUserData(about: self.about, botInfo: self.botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedCanPinMessages(_ canPinMessages: Bool) -> CachedUserData {
|
public func withUpdatedCanPinMessages(_ canPinMessages: Bool) -> CachedUserData {
|
||||||
return CachedUserData(about: self.about, botInfo: self.botInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
return CachedUserData(about: self.about, botInfo: self.botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedHasScheduledMessages(_ hasScheduledMessages: Bool) -> CachedUserData {
|
public func withUpdatedHasScheduledMessages(_ hasScheduledMessages: Bool) -> CachedUserData {
|
||||||
return CachedUserData(about: self.about, botInfo: self.botInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
return CachedUserData(about: self.about, botInfo: self.botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedAutoremoveTimeout(_ autoremoveTimeout: CachedPeerAutoremoveTimeout) -> CachedUserData {
|
public func withUpdatedAutoremoveTimeout(_ autoremoveTimeout: CachedPeerAutoremoveTimeout) -> CachedUserData {
|
||||||
return CachedUserData(about: self.about, botInfo: self.botInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
return CachedUserData(about: self.about, botInfo: self.botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedThemeEmoticon(_ themeEmoticon: String?) -> CachedUserData {
|
public func withUpdatedThemeEmoticon(_ themeEmoticon: String?) -> CachedUserData {
|
||||||
return CachedUserData(about: self.about, botInfo: self.botInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
return CachedUserData(about: self.about, botInfo: self.botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedPhoto(_ photo: CachedPeerProfilePhoto) -> CachedUserData {
|
public func withUpdatedPhoto(_ photo: CachedPeerProfilePhoto) -> CachedUserData {
|
||||||
return CachedUserData(about: self.about, botInfo: self.botInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
return CachedUserData(about: self.about, botInfo: self.botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedPersonalPhoto(_ personalPhoto: CachedPeerProfilePhoto) -> CachedUserData {
|
public func withUpdatedPersonalPhoto(_ personalPhoto: CachedPeerProfilePhoto) -> CachedUserData {
|
||||||
return CachedUserData(about: self.about, botInfo: self.botInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
return CachedUserData(about: self.about, botInfo: self.botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedFallbackPhoto(_ fallbackPhoto: CachedPeerProfilePhoto) -> CachedUserData {
|
public func withUpdatedFallbackPhoto(_ fallbackPhoto: CachedPeerProfilePhoto) -> CachedUserData {
|
||||||
return CachedUserData(about: self.about, botInfo: self.botInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
return CachedUserData(about: self.about, botInfo: self.botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedPremiumGiftOptions(_ premiumGiftOptions: [CachedPremiumGiftOption]) -> CachedUserData {
|
public func withUpdatedPremiumGiftOptions(_ premiumGiftOptions: [CachedPremiumGiftOption]) -> CachedUserData {
|
||||||
return CachedUserData(about: self.about, botInfo: self.botInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
return CachedUserData(about: self.about, botInfo: self.botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedVoiceMessagesAvailable(_ voiceMessagesAvailable: Bool) -> CachedUserData {
|
public func withUpdatedVoiceMessagesAvailable(_ voiceMessagesAvailable: Bool) -> CachedUserData {
|
||||||
return CachedUserData(about: self.about, botInfo: self.botInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
return CachedUserData(about: self.about, botInfo: self.botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: voiceMessagesAvailable, wallpaper: self.wallpaper, flags: self.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedWallpaper(_ wallpaper: TelegramWallpaper?) -> CachedUserData {
|
public func withUpdatedWallpaper(_ wallpaper: TelegramWallpaper?) -> CachedUserData {
|
||||||
return CachedUserData(about: self.about, botInfo: self.botInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: wallpaper, flags: self.flags)
|
return CachedUserData(about: self.about, botInfo: self.botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: wallpaper, flags: self.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdatedFlags(_ flags: CachedUserFlags) -> CachedUserData {
|
public func withUpdatedFlags(_ flags: CachedUserFlags) -> CachedUserData {
|
||||||
return CachedUserData(about: self.about, botInfo: self.botInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: flags)
|
return CachedUserData(about: self.about, botInfo: self.botInfo, editableBotInfo: self.editableBotInfo, peerStatusSettings: self.peerStatusSettings, pinnedMessageId: self.pinnedMessageId, isBlocked: self.isBlocked, commonGroupCount: self.commonGroupCount, voiceCallsAvailable: self.voiceCallsAvailable, videoCallsAvailable: self.videoCallsAvailable, callsPrivate: self.callsPrivate, canPinMessages: self.canPinMessages, hasScheduledMessages: self.hasScheduledMessages, autoremoveTimeout: self.autoremoveTimeout, themeEmoticon: self.themeEmoticon, photo: self.photo, personalPhoto: self.personalPhoto, fallbackPhoto: self.fallbackPhoto, premiumGiftOptions: self.premiumGiftOptions, voiceMessagesAvailable: self.voiceMessagesAvailable, wallpaper: self.wallpaper, flags: flags)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,9 +20,18 @@ func _internal_updateBotName(account: Account, peerId: PeerId, name: String) ->
|
|||||||
|> mapToSignal { result -> Signal<Void, UpdateBotInfoError> in
|
|> mapToSignal { result -> Signal<Void, UpdateBotInfoError> in
|
||||||
return account.postbox.transaction { transaction -> Void in
|
return account.postbox.transaction { transaction -> Void in
|
||||||
if case .boolTrue = result {
|
if case .boolTrue = result {
|
||||||
|
var previousBotName: String?
|
||||||
|
transaction.updatePeerCachedData(peerIds: Set([peerId]), update: { _, current in
|
||||||
|
if let current = current as? CachedUserData, let editableBotInfo = current.editableBotInfo {
|
||||||
|
previousBotName = editableBotInfo.name
|
||||||
|
return current.withUpdatedEditableBotInfo(editableBotInfo.withUpdatedName(name))
|
||||||
|
} else {
|
||||||
|
return current
|
||||||
|
}
|
||||||
|
})
|
||||||
updatePeers(transaction: transaction, peers: [peer]) { _, peer in
|
updatePeers(transaction: transaction, peers: [peer]) { _, peer in
|
||||||
var updatedPeer = peer
|
var updatedPeer = peer
|
||||||
if let user = peer as? TelegramUser {
|
if let user = peer as? TelegramUser, user.firstName == previousBotName {
|
||||||
updatedPeer = user.withUpdatedNames(firstName: name, lastName: nil)
|
updatedPeer = user.withUpdatedNames(firstName: name, lastName: nil)
|
||||||
}
|
}
|
||||||
return updatedPeer
|
return updatedPeer
|
||||||
@ -52,8 +61,12 @@ func _internal_updateBotAbout(account: Account, peerId: PeerId, about: String) -
|
|||||||
return account.postbox.transaction { transaction -> Void in
|
return account.postbox.transaction { transaction -> Void in
|
||||||
if case .boolTrue = result {
|
if case .boolTrue = result {
|
||||||
transaction.updatePeerCachedData(peerIds: Set([peerId]), update: { _, current in
|
transaction.updatePeerCachedData(peerIds: Set([peerId]), update: { _, current in
|
||||||
if let current = current as? CachedUserData {
|
if let current = current as? CachedUserData, let editableBotInfo = current.editableBotInfo {
|
||||||
return current.withUpdatedAbout(about)
|
var updatedAbout = current.about
|
||||||
|
if (current.about ?? "") == editableBotInfo.about {
|
||||||
|
updatedAbout = about
|
||||||
|
}
|
||||||
|
return current.withUpdatedEditableBotInfo(editableBotInfo.withUpdatedAbout(about)).withUpdatedAbout(updatedAbout)
|
||||||
} else {
|
} else {
|
||||||
return current
|
return current
|
||||||
}
|
}
|
||||||
@ -83,15 +96,21 @@ func _internal_updateBotDescription(account: Account, peerId: PeerId, descriptio
|
|||||||
|> mapToSignal { result -> Signal<Void, UpdateBotInfoError> in
|
|> mapToSignal { result -> Signal<Void, UpdateBotInfoError> in
|
||||||
return account.postbox.transaction { transaction -> Void in
|
return account.postbox.transaction { transaction -> Void in
|
||||||
if case .boolTrue = result {
|
if case .boolTrue = result {
|
||||||
// transaction.updatePeerCachedData(peerIds: Set([peerId]), update: { _, current in
|
transaction.updatePeerCachedData(peerIds: Set([peerId]), update: { _, current in
|
||||||
// if let current = current as? CachedChannelData {
|
if let current = current as? CachedUserData, let editableBotInfo = current.editableBotInfo {
|
||||||
// return current.withUpdatedAbout(description)
|
if let botInfo = current.botInfo {
|
||||||
// } else if let current = current as? CachedGroupData {
|
var updatedBotInfo = botInfo
|
||||||
// return current.withUpdatedAbout(description)
|
if botInfo.description == editableBotInfo.description {
|
||||||
// } else {
|
updatedBotInfo = BotInfo(description: description, photo: botInfo.photo, video: botInfo.video, commands: botInfo.commands, menuButton: botInfo.menuButton)
|
||||||
// return current
|
}
|
||||||
// }
|
return current.withUpdatedEditableBotInfo(editableBotInfo.withUpdatedDescription(description)).withUpdatedBotInfo(updatedBotInfo)
|
||||||
// })
|
} else {
|
||||||
|
return current.withUpdatedEditableBotInfo(editableBotInfo.withUpdatedDescription(description))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return current
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|> mapError { _ -> UpdateBotInfoError in }
|
|> mapError { _ -> UpdateBotInfoError in }
|
||||||
|
@ -294,6 +294,7 @@ func _internal_fetchAndUpdateCachedPeerData(accountPeerId: PeerId, peerId rawPee
|
|||||||
|
|
||||||
return previous.withUpdatedAbout(userFullAbout)
|
return previous.withUpdatedAbout(userFullAbout)
|
||||||
.withUpdatedBotInfo(botInfo)
|
.withUpdatedBotInfo(botInfo)
|
||||||
|
.withUpdatedEditableBotInfo(editableBotInfo)
|
||||||
.withUpdatedCommonGroupCount(userFullCommonChatsCount)
|
.withUpdatedCommonGroupCount(userFullCommonChatsCount)
|
||||||
.withUpdatedIsBlocked(isBlocked)
|
.withUpdatedIsBlocked(isBlocked)
|
||||||
.withUpdatedVoiceCallsAvailable(voiceCallsAvailable)
|
.withUpdatedVoiceCallsAvailable(voiceCallsAvailable)
|
||||||
|
@ -337,11 +337,10 @@ final class ManagedAudioRecorderContext {
|
|||||||
self.toneTimer?.invalidate()
|
self.toneTimer?.invalidate()
|
||||||
}
|
}
|
||||||
|
|
||||||
func start() {
|
private func setupAudioUnit() {
|
||||||
assert(self.queue.isCurrent())
|
guard self.audioUnit.with({ $0 }) == nil else {
|
||||||
|
return
|
||||||
self.paused = false
|
}
|
||||||
|
|
||||||
var desc = AudioComponentDescription()
|
var desc = AudioComponentDescription()
|
||||||
desc.componentType = kAudioUnitType_Output
|
desc.componentType = kAudioUnitType_Output
|
||||||
desc.componentSubType = kAudioUnitSubType_RemoteIO
|
desc.componentSubType = kAudioUnitSubType_RemoteIO
|
||||||
@ -395,6 +394,12 @@ final class ManagedAudioRecorderContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let _ = self.audioUnit.swap(audioUnit)
|
let _ = self.audioUnit.swap(audioUnit)
|
||||||
|
}
|
||||||
|
|
||||||
|
func start() {
|
||||||
|
assert(self.queue.isCurrent())
|
||||||
|
|
||||||
|
self.paused = false
|
||||||
|
|
||||||
if self.audioSessionDisposable == nil {
|
if self.audioSessionDisposable == nil {
|
||||||
let queue = self.queue
|
let queue = self.queue
|
||||||
@ -402,6 +407,7 @@ final class ManagedAudioRecorderContext {
|
|||||||
queue.async {
|
queue.async {
|
||||||
if let strongSelf = self, !strongSelf.paused {
|
if let strongSelf = self, !strongSelf.paused {
|
||||||
strongSelf.hasAudioSession = true
|
strongSelf.hasAudioSession = true
|
||||||
|
strongSelf.setupAudioUnit()
|
||||||
strongSelf.audioSessionAcquired(headset: state.isHeadsetConnected)
|
strongSelf.audioSessionAcquired(headset: state.isHeadsetConnected)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2160,7 +2160,13 @@ final class PeerInfoHeaderEditingContentNode: ASDisplayNode {
|
|||||||
var isMultiline = false
|
var isMultiline = false
|
||||||
switch key {
|
switch key {
|
||||||
case .firstName:
|
case .firstName:
|
||||||
updateText = (peer as? TelegramUser)?.firstName ?? ""
|
if let peer = peer as? TelegramUser {
|
||||||
|
if let editableBotInfo = (cachedData as? CachedUserData)?.editableBotInfo {
|
||||||
|
updateText = editableBotInfo.name
|
||||||
|
} else {
|
||||||
|
updateText = peer.firstName ?? ""
|
||||||
|
}
|
||||||
|
}
|
||||||
case .lastName:
|
case .lastName:
|
||||||
updateText = (peer as? TelegramUser)?.lastName ?? ""
|
updateText = (peer as? TelegramUser)?.lastName ?? ""
|
||||||
case .title:
|
case .title:
|
||||||
@ -2172,7 +2178,11 @@ final class PeerInfoHeaderEditingContentNode: ASDisplayNode {
|
|||||||
} else if let cachedData = cachedData as? CachedGroupData {
|
} else if let cachedData = cachedData as? CachedGroupData {
|
||||||
updateText = cachedData.about ?? ""
|
updateText = cachedData.about ?? ""
|
||||||
} else if let cachedData = cachedData as? CachedUserData {
|
} else if let cachedData = cachedData as? CachedUserData {
|
||||||
updateText = cachedData.about ?? ""
|
if let editableBotInfo = cachedData.editableBotInfo {
|
||||||
|
updateText = editableBotInfo.about
|
||||||
|
} else {
|
||||||
|
updateText = cachedData.about ?? ""
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
updateText = ""
|
updateText = ""
|
||||||
}
|
}
|
||||||
@ -2191,7 +2201,7 @@ final class PeerInfoHeaderEditingContentNode: ASDisplayNode {
|
|||||||
var isEnabled = true
|
var isEnabled = true
|
||||||
switch key {
|
switch key {
|
||||||
case .firstName:
|
case .firstName:
|
||||||
placeholder = presentationData.strings.UserInfo_FirstNamePlaceholder
|
placeholder = isEditableBot ? presentationData.strings.UserInfo_BotNamePlaceholder : presentationData.strings.UserInfo_FirstNamePlaceholder
|
||||||
isEnabled = isContact || isSettings || isEditableBot
|
isEnabled = isContact || isSettings || isEditableBot
|
||||||
case .lastName:
|
case .lastName:
|
||||||
placeholder = presentationData.strings.UserInfo_LastNamePlaceholder
|
placeholder = presentationData.strings.UserInfo_LastNamePlaceholder
|
||||||
@ -2597,6 +2607,8 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let isLandscape = containerInset > 16.0
|
||||||
|
|
||||||
let themeUpdated = self.presentationData?.theme !== presentationData.theme
|
let themeUpdated = self.presentationData?.theme !== presentationData.theme
|
||||||
self.presentationData = presentationData
|
self.presentationData = presentationData
|
||||||
|
|
||||||
@ -2754,7 +2766,7 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
|||||||
let avatarFrame = CGRect(origin: CGPoint(x: floor((width - avatarSize) / 2.0), y: statusBarHeight + 22.0), size: CGSize(width: avatarSize, height: avatarSize))
|
let avatarFrame = CGRect(origin: CGPoint(x: floor((width - avatarSize) / 2.0), y: statusBarHeight + 22.0), size: CGSize(width: avatarSize, height: avatarSize))
|
||||||
|
|
||||||
self.backgroundNode.updateColor(color: presentationData.theme.rootController.navigationBar.blurredBackgroundColor, transition: .immediate)
|
self.backgroundNode.updateColor(color: presentationData.theme.rootController.navigationBar.blurredBackgroundColor, transition: .immediate)
|
||||||
|
|
||||||
let headerBackgroundColor: UIColor = presentationData.theme.list.blocksBackgroundColor
|
let headerBackgroundColor: UIColor = presentationData.theme.list.blocksBackgroundColor
|
||||||
var effectiveSeparatorAlpha: CGFloat
|
var effectiveSeparatorAlpha: CGFloat
|
||||||
if let navigationTransition = self.navigationTransition {
|
if let navigationTransition = self.navigationTransition {
|
||||||
@ -2768,7 +2780,7 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
|||||||
transitionSourceAvatarFrame = avatarNavigationNode.avatarNode.view.convert(avatarNavigationNode.avatarNode.view.bounds, to: navigationTransition.sourceNavigationBar.view)
|
transitionSourceAvatarFrame = avatarNavigationNode.avatarNode.view.convert(avatarNavigationNode.avatarNode.view.bounds, to: navigationTransition.sourceNavigationBar.view)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if deviceMetrics.hasDynamicIsland {
|
if deviceMetrics.hasDynamicIsland && !isLandscape {
|
||||||
transitionSourceAvatarFrame = CGRect(origin: CGPoint(x: avatarFrame.minX, y: -20.0), size: avatarFrame.size).insetBy(dx: avatarSize * 0.4, dy: avatarSize * 0.4)
|
transitionSourceAvatarFrame = CGRect(origin: CGPoint(x: avatarFrame.minX, y: -20.0), size: avatarFrame.size).insetBy(dx: avatarSize * 0.4, dy: avatarSize * 0.4)
|
||||||
} else {
|
} else {
|
||||||
transitionSourceAvatarFrame = avatarFrame.offsetBy(dx: 0.0, dy: -avatarFrame.maxY).insetBy(dx: avatarSize * 0.4, dy: avatarSize * 0.4)
|
transitionSourceAvatarFrame = avatarFrame.offsetBy(dx: 0.0, dy: -avatarFrame.maxY).insetBy(dx: avatarSize * 0.4, dy: avatarSize * 0.4)
|
||||||
@ -3294,7 +3306,7 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
|||||||
controlsClippingFrame = apparentAvatarFrame
|
controlsClippingFrame = apparentAvatarFrame
|
||||||
}
|
}
|
||||||
|
|
||||||
let avatarClipOffset: CGFloat = !self.isAvatarExpanded && deviceMetrics.hasDynamicIsland && self.avatarClippingNode.clipsToBounds ? 48.0 : 0.0
|
let avatarClipOffset: CGFloat = !self.isAvatarExpanded && deviceMetrics.hasDynamicIsland && self.avatarClippingNode.clipsToBounds && !isLandscape ? 48.0 : 0.0
|
||||||
let clippingNodeTransition = ContainedViewLayoutTransition.immediate
|
let clippingNodeTransition = ContainedViewLayoutTransition.immediate
|
||||||
clippingNodeTransition.updateFrame(layer: self.avatarClippingNode.layer, frame: CGRect(origin: CGPoint(x: 0.0, y: avatarClipOffset), size: CGSize(width: width, height: 1000.0)))
|
clippingNodeTransition.updateFrame(layer: self.avatarClippingNode.layer, frame: CGRect(origin: CGPoint(x: 0.0, y: avatarClipOffset), size: CGSize(width: width, height: 1000.0)))
|
||||||
clippingNodeTransition.updateSublayerTransformOffset(layer: self.avatarClippingNode.layer, offset: CGPoint(x: 0.0, y: -avatarClipOffset))
|
clippingNodeTransition.updateSublayerTransformOffset(layer: self.avatarClippingNode.layer, offset: CGPoint(x: 0.0, y: -avatarClipOffset))
|
||||||
@ -3341,7 +3353,7 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
|||||||
transition.updateSublayerTransformScale(node: self.avatarListNode.listContainerTransformNode, scale: avatarListContainerScale)
|
transition.updateSublayerTransformScale(node: self.avatarListNode.listContainerTransformNode, scale: avatarListContainerScale)
|
||||||
}
|
}
|
||||||
|
|
||||||
if deviceMetrics.hasDynamicIsland && self.forumTopicThreadId == nil && self.navigationTransition == nil {
|
if deviceMetrics.hasDynamicIsland && self.forumTopicThreadId == nil && self.navigationTransition == nil && !isLandscape {
|
||||||
let maskValue = max(0.0, min(1.0, contentOffset / 120.0))
|
let maskValue = max(0.0, min(1.0, contentOffset / 120.0))
|
||||||
self.avatarListNode.containerNode.view.mask = self.avatarListNode.maskNode.view
|
self.avatarListNode.containerNode.view.mask = self.avatarListNode.maskNode.view
|
||||||
if maskValue > 0.03 {
|
if maskValue > 0.03 {
|
||||||
@ -3358,7 +3370,12 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
|||||||
|
|
||||||
self.avatarListNode.listContainerNode.topShadowNode.isHidden = !self.isAvatarExpanded
|
self.avatarListNode.listContainerNode.topShadowNode.isHidden = !self.isAvatarExpanded
|
||||||
|
|
||||||
self.avatarListNode.maskNode.position = CGPoint(x: 0.0, y: -self.avatarListNode.frame.minY + 48.0 + 85.5)
|
var avatarMaskOffset: CGFloat = 0.0
|
||||||
|
if contentOffset < 0.0 {
|
||||||
|
avatarMaskOffset -= contentOffset
|
||||||
|
}
|
||||||
|
|
||||||
|
self.avatarListNode.maskNode.position = CGPoint(x: 0.0, y: -self.avatarListNode.frame.minY + 48.0 + 85.5 + avatarMaskOffset)
|
||||||
self.avatarListNode.maskNode.bounds = CGRect(origin: .zero, size: CGSize(width: 171.0, height: 171.0))
|
self.avatarListNode.maskNode.bounds = CGRect(origin: .zero, size: CGSize(width: 171.0, height: 171.0))
|
||||||
|
|
||||||
self.avatarListNode.bottomCoverNode.position = self.avatarListNode.maskNode.position
|
self.avatarListNode.bottomCoverNode.position = self.avatarListNode.maskNode.position
|
||||||
|
@ -514,6 +514,7 @@ private final class PeerInfoInteraction {
|
|||||||
let editingOpenDiscussionGroupSetup: () -> Void
|
let editingOpenDiscussionGroupSetup: () -> Void
|
||||||
let editingToggleMessageSignatures: (Bool) -> Void
|
let editingToggleMessageSignatures: (Bool) -> Void
|
||||||
let openParticipantsSection: (PeerInfoParticipantsSection) -> Void
|
let openParticipantsSection: (PeerInfoParticipantsSection) -> Void
|
||||||
|
let openRecentActions: () -> Void
|
||||||
let editingOpenPreHistorySetup: () -> Void
|
let editingOpenPreHistorySetup: () -> Void
|
||||||
let editingOpenAutoremoveMesages: () -> Void
|
let editingOpenAutoremoveMesages: () -> Void
|
||||||
let openPermissions: () -> Void
|
let openPermissions: () -> Void
|
||||||
@ -564,6 +565,7 @@ private final class PeerInfoInteraction {
|
|||||||
editingOpenDiscussionGroupSetup: @escaping () -> Void,
|
editingOpenDiscussionGroupSetup: @escaping () -> Void,
|
||||||
editingToggleMessageSignatures: @escaping (Bool) -> Void,
|
editingToggleMessageSignatures: @escaping (Bool) -> Void,
|
||||||
openParticipantsSection: @escaping (PeerInfoParticipantsSection) -> Void,
|
openParticipantsSection: @escaping (PeerInfoParticipantsSection) -> Void,
|
||||||
|
openRecentActions: @escaping () -> Void,
|
||||||
editingOpenPreHistorySetup: @escaping () -> Void,
|
editingOpenPreHistorySetup: @escaping () -> Void,
|
||||||
editingOpenAutoremoveMesages: @escaping () -> Void,
|
editingOpenAutoremoveMesages: @escaping () -> Void,
|
||||||
openPermissions: @escaping () -> Void,
|
openPermissions: @escaping () -> Void,
|
||||||
@ -613,6 +615,7 @@ private final class PeerInfoInteraction {
|
|||||||
self.editingOpenDiscussionGroupSetup = editingOpenDiscussionGroupSetup
|
self.editingOpenDiscussionGroupSetup = editingOpenDiscussionGroupSetup
|
||||||
self.editingToggleMessageSignatures = editingToggleMessageSignatures
|
self.editingToggleMessageSignatures = editingToggleMessageSignatures
|
||||||
self.openParticipantsSection = openParticipantsSection
|
self.openParticipantsSection = openParticipantsSection
|
||||||
|
self.openRecentActions = openRecentActions
|
||||||
self.editingOpenPreHistorySetup = editingOpenPreHistorySetup
|
self.editingOpenPreHistorySetup = editingOpenPreHistorySetup
|
||||||
self.editingOpenAutoremoveMesages = editingOpenAutoremoveMesages
|
self.editingOpenAutoremoveMesages = editingOpenAutoremoveMesages
|
||||||
self.openPermissions = openPermissions
|
self.openPermissions = openPermissions
|
||||||
@ -1486,6 +1489,7 @@ private func editingItems(data: PeerInfoScreenData?, state: PeerInfoState, chatL
|
|||||||
let ItemMembers = 9
|
let ItemMembers = 9
|
||||||
let ItemMemberRequests = 10
|
let ItemMemberRequests = 10
|
||||||
let ItemBanned = 11
|
let ItemBanned = 11
|
||||||
|
let ItemRecentActions = 12
|
||||||
|
|
||||||
let isCreator = channel.flags.contains(.isCreator)
|
let isCreator = channel.flags.contains(.isCreator)
|
||||||
|
|
||||||
@ -1602,6 +1606,10 @@ private func editingItems(data: PeerInfoScreenData?, state: PeerInfoState, chatL
|
|||||||
items[.peerAdditionalSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemBanned, label: .text("\(bannedCount == 0 ? "" : "\(presentationStringsFormattedNumber(bannedCount, presentationData.dateTimeFormat.groupingSeparator))")"), text: presentationData.strings.GroupInfo_Permissions_Removed, icon: UIImage(bundleImageName: "Chat/Info/GroupRemovedIcon"), action: {
|
items[.peerAdditionalSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemBanned, label: .text("\(bannedCount == 0 ? "" : "\(presentationStringsFormattedNumber(bannedCount, presentationData.dateTimeFormat.groupingSeparator))")"), text: presentationData.strings.GroupInfo_Permissions_Removed, icon: UIImage(bundleImageName: "Chat/Info/GroupRemovedIcon"), action: {
|
||||||
interaction.openParticipantsSection(.banned)
|
interaction.openParticipantsSection(.banned)
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
items[.peerAdditionalSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemRecentActions, label: .none, text: presentationData.strings.Group_Info_AdminLog, icon: UIImage(bundleImageName: "Chat/Info/RecentActionsIcon"), action: {
|
||||||
|
interaction.openRecentActions()
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1621,13 +1629,14 @@ private func editingItems(data: PeerInfoScreenData?, state: PeerInfoState, chatL
|
|||||||
let ItemAdmins = 108
|
let ItemAdmins = 108
|
||||||
let ItemMemberRequests = 109
|
let ItemMemberRequests = 109
|
||||||
let ItemRemovedUsers = 110
|
let ItemRemovedUsers = 110
|
||||||
let ItemLocationHeader = 111
|
let ItemRecentActions = 111
|
||||||
let ItemLocation = 112
|
let ItemLocationHeader = 112
|
||||||
let ItemLocationSetup = 113
|
let ItemLocation = 113
|
||||||
let ItemDeleteGroup = 114
|
let ItemLocationSetup = 114
|
||||||
let ItemReactions = 115
|
let ItemDeleteGroup = 115
|
||||||
let ItemTopics = 116
|
let ItemReactions = 116
|
||||||
let ItemTopicsText = 117
|
let ItemTopics = 117
|
||||||
|
let ItemTopicsText = 118
|
||||||
|
|
||||||
let isCreator = channel.flags.contains(.isCreator)
|
let isCreator = channel.flags.contains(.isCreator)
|
||||||
let isPublic = channel.addressName != nil
|
let isPublic = channel.addressName != nil
|
||||||
@ -1832,6 +1841,10 @@ private func editingItems(data: PeerInfoScreenData?, state: PeerInfoState, chatL
|
|||||||
items[.peerSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemRemovedUsers, label: .text(cachedData.participantsSummary.kickedCount.flatMap { $0 > 0 ? "\(presentationStringsFormattedNumber($0, presentationData.dateTimeFormat.groupingSeparator))" : "" } ?? ""), text: presentationData.strings.GroupInfo_Permissions_Removed, icon: UIImage(bundleImageName: "Chat/Info/GroupRemovedIcon"), action: {
|
items[.peerSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemRemovedUsers, label: .text(cachedData.participantsSummary.kickedCount.flatMap { $0 > 0 ? "\(presentationStringsFormattedNumber($0, presentationData.dateTimeFormat.groupingSeparator))" : "" } ?? ""), text: presentationData.strings.GroupInfo_Permissions_Removed, icon: UIImage(bundleImageName: "Chat/Info/GroupRemovedIcon"), action: {
|
||||||
interaction.openParticipantsSection(.banned)
|
interaction.openParticipantsSection(.banned)
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
items[.peerSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemRecentActions, label: .none, text: presentationData.strings.Group_Info_AdminLog, icon: UIImage(bundleImageName: "Chat/Info/RecentActionsIcon"), action: {
|
||||||
|
interaction.openRecentActions()
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
if isCreator {
|
if isCreator {
|
||||||
@ -2207,6 +2220,9 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
|
|||||||
openParticipantsSection: { [weak self] section in
|
openParticipantsSection: { [weak self] section in
|
||||||
self?.openParticipantsSection(section: section)
|
self?.openParticipantsSection(section: section)
|
||||||
},
|
},
|
||||||
|
openRecentActions: { [weak self] in
|
||||||
|
self?.openRecentActions()
|
||||||
|
},
|
||||||
editingOpenPreHistorySetup: { [weak self] in
|
editingOpenPreHistorySetup: { [weak self] in
|
||||||
self?.editingOpenPreHistorySetup()
|
self?.editingOpenPreHistorySetup()
|
||||||
},
|
},
|
||||||
@ -3223,7 +3239,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
|
|||||||
} else {
|
} else {
|
||||||
strongSelf.headerNode.navigationButtonContainer.performAction?(.cancel, nil, nil)
|
strongSelf.headerNode.navigationButtonContainer.performAction?(.cancel, nil, nil)
|
||||||
}
|
}
|
||||||
} else if let botInfo = peer.botInfo, botInfo.flags.contains(.canEdit), let cachedData = data.cachedData as? CachedUserData {
|
} else if let botInfo = peer.botInfo, botInfo.flags.contains(.canEdit), let cachedData = data.cachedData as? CachedUserData, let editableBotInfo = cachedData.editableBotInfo {
|
||||||
let firstName = strongSelf.headerNode.editingContentNode.editingTextForKey(.firstName) ?? ""
|
let firstName = strongSelf.headerNode.editingContentNode.editingTextForKey(.firstName) ?? ""
|
||||||
let bio = strongSelf.headerNode.editingContentNode.editingTextForKey(.description)
|
let bio = strongSelf.headerNode.editingContentNode.editingTextForKey(.description)
|
||||||
if let bio = bio {
|
if let bio = bio {
|
||||||
@ -3235,12 +3251,13 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let peerBio = cachedData.about ?? ""
|
let peerName = editableBotInfo.name
|
||||||
|
let peerBio = editableBotInfo.about
|
||||||
|
|
||||||
if (peer.firstName ?? "") != firstName || (bio ?? "") != peerBio {
|
if firstName != peerName || (bio ?? "") != peerBio {
|
||||||
var updateNameSignal: Signal<Void, NoError> = .complete()
|
var updateNameSignal: Signal<Void, NoError> = .complete()
|
||||||
var hasProgress = false
|
var hasProgress = false
|
||||||
if peer.firstName != firstName {
|
if firstName != peerName {
|
||||||
updateNameSignal = context.engine.peers.updateBotName(peerId: peer.id, name: firstName)
|
updateNameSignal = context.engine.peers.updateBotName(peerId: peer.id, name: firstName)
|
||||||
|> `catch` { _ -> Signal<Void, NoError> in
|
|> `catch` { _ -> Signal<Void, NoError> in
|
||||||
return .complete()
|
return .complete()
|
||||||
@ -3248,7 +3265,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
|
|||||||
hasProgress = true
|
hasProgress = true
|
||||||
}
|
}
|
||||||
var updateBioSignal: Signal<Void, NoError> = .complete()
|
var updateBioSignal: Signal<Void, NoError> = .complete()
|
||||||
if let bio = bio, bio != cachedData.about {
|
if let bio = bio, bio != peerBio {
|
||||||
updateBioSignal = context.engine.peers.updateBotAbout(peerId: peer.id, about: bio)
|
updateBioSignal = context.engine.peers.updateBotAbout(peerId: peer.id, about: bio)
|
||||||
|> `catch` { _ -> Signal<Void, NoError> in
|
|> `catch` { _ -> Signal<Void, NoError> in
|
||||||
return .complete()
|
return .complete()
|
||||||
@ -6724,6 +6741,14 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func openRecentActions() {
|
||||||
|
guard let peer = self.data?.peer else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let controller = self.context.sharedContext.makeChatRecentActionsController(context: self.context, peer: peer, adminPeerId: nil)
|
||||||
|
self.controller?.push(controller)
|
||||||
|
}
|
||||||
|
|
||||||
private func editingOpenPreHistorySetup() {
|
private func editingOpenPreHistorySetup() {
|
||||||
guard let data = self.data, let peer = data.peer else {
|
guard let data = self.data, let peer = data.peer else {
|
||||||
return
|
return
|
||||||
|
@ -168,7 +168,7 @@ private final class WebAppLaunchConfirmationAlertContentNode: AlertContentNode {
|
|||||||
let maxActionWidth: CGFloat = floor(size.width / CGFloat(self.actionNodes.count))
|
let maxActionWidth: CGFloat = floor(size.width / CGFloat(self.actionNodes.count))
|
||||||
let actionTitleInsets: CGFloat = 8.0
|
let actionTitleInsets: CGFloat = 8.0
|
||||||
|
|
||||||
var effectiveActionLayout = TextAlertContentActionLayout.horizontal
|
var effectiveActionLayout = TextAlertContentActionLayout.vertical
|
||||||
for actionNode in self.actionNodes {
|
for actionNode in self.actionNodes {
|
||||||
let actionTitleSize = actionNode.titleNode.updateLayout(CGSize(width: maxActionWidth, height: actionButtonHeight))
|
let actionTitleSize = actionNode.titleNode.updateLayout(CGSize(width: maxActionWidth, height: actionButtonHeight))
|
||||||
if case .horizontal = effectiveActionLayout, actionTitleSize.height > actionButtonHeight * 0.6667 {
|
if case .horizontal = effectiveActionLayout, actionTitleSize.height > actionButtonHeight * 0.6667 {
|
||||||
@ -260,11 +260,11 @@ public func webAppLaunchConfirmationController(context: AccountContext, updatedP
|
|||||||
|
|
||||||
var dismissImpl: ((Bool) -> Void)?
|
var dismissImpl: ((Bool) -> Void)?
|
||||||
var contentNode: WebAppLaunchConfirmationAlertContentNode?
|
var contentNode: WebAppLaunchConfirmationAlertContentNode?
|
||||||
let actions: [TextAlertAction] = [TextAlertAction(type: .genericAction, title: presentationData.strings.Common_Cancel, action: {
|
let actions: [TextAlertAction] = [TextAlertAction(type: .defaultAction, title: presentationData.strings.WebApp_LaunchOpenApp, action: {
|
||||||
dismissImpl?(true)
|
|
||||||
}), TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {
|
|
||||||
dismissImpl?(true)
|
dismissImpl?(true)
|
||||||
commit()
|
commit()
|
||||||
|
}), TextAlertAction(type: .genericAction, title: presentationData.strings.Common_Cancel, action: {
|
||||||
|
dismissImpl?(true)
|
||||||
})]
|
})]
|
||||||
|
|
||||||
let title = peer.compactDisplayTitle
|
let title = peer.compactDisplayTitle
|
||||||
|
Loading…
x
Reference in New Issue
Block a user