diff --git a/Telegram/SiriIntents/IntentHandler.swift b/Telegram/SiriIntents/IntentHandler.swift index 843eea96d7..edca26d9f6 100644 --- a/Telegram/SiriIntents/IntentHandler.swift +++ b/Telegram/SiriIntents/IntentHandler.swift @@ -793,7 +793,7 @@ class IntentHandler: INExtension, INSendMessageIntentHandling, INSearchForMessag if let searchTerm = searchTerm { if !searchTerm.isEmpty { for renderedPeer in transaction.searchPeers(query: searchTerm) { - if let peer = renderedPeer.peer, !(peer is TelegramSecretChat) { + if let peer = renderedPeer.peer, !(peer is TelegramSecretChat), !peer.isDeleted { peers.append(peer) } } @@ -804,7 +804,7 @@ class IntentHandler: INExtension, INSendMessageIntentHandling, INSearchForMessag } } else { for renderedPeer in transaction.getTopChatListEntries(groupId: .root, count: 50) { - if let peer = renderedPeer.peer, !(peer is TelegramSecretChat) { + if let peer = renderedPeer.peer, !(peer is TelegramSecretChat), !peer.isDeleted { peers.append(peer) } } diff --git a/Telegram/WidgetKitWidget/TodayViewController.swift b/Telegram/WidgetKitWidget/TodayViewController.swift index 969c96ad86..4550059a49 100644 --- a/Telegram/WidgetKitWidget/TodayViewController.swift +++ b/Telegram/WidgetKitWidget/TodayViewController.swift @@ -369,12 +369,12 @@ struct WidgetView: View { } } - private func linkForPeer(id: Int64) -> String { + private func linkForPeer(accountId: Int64, id: Int64) -> String { switch self.widgetFamily { case .systemSmall: return "\(buildConfig.appSpecificUrlScheme)://" default: - return "\(buildConfig.appSpecificUrlScheme)://localpeer?id=\(id)" + return "\(buildConfig.appSpecificUrlScheme)://localpeer?id=\(id)&accountId=\(accountId)" } } @@ -427,7 +427,7 @@ struct WidgetView: View { return ZStack { ForEach(0 ..< min(peers.peers.count, columnCount * rowCount), content: { i in - Link(destination: URL(string: linkForPeer(id: peers.peers[i].peer.id))!, label: { + Link(destination: URL(string: linkForPeer(accountId: peers.peers[i].accountId, id: peers.peers[i].peer.id))!, label: { AvatarItemView( peer: peers.peers[i], itemSize: itemSize @@ -507,13 +507,29 @@ struct WidgetView: View { case .text: break case .image: - text = "🖼 Photo" + if !message.text.isEmpty { + text = "🖼 \(message.text)" + } else { + text = "🖼 Photo" + } case .video: - text = "📹 Video" + if !message.text.isEmpty { + text = "📹 \(message.text)" + } else { + text = "📹 Video" + } case .gif: - text = "Gif" + if !message.text.isEmpty { + text = "\(message.text)" + } else { + text = "Gif" + } case let .file(file): - text = "📎 \(file.name)" + if !message.text.isEmpty { + text = "📹 \(message.text)" + } else { + text = "📎 \(file.name)" + } case let .music(music): if !music.title.isEmpty && !music.artist.isEmpty { text = "\(music.artist) — \(music.title)" @@ -611,9 +627,11 @@ struct WidgetView: View { func chatContentView(_ index: Int, size: CGSize) -> AnyView { let peers: ParsedPeers? + var isPlaceholder = false switch data { case let .peers(peersValue): if peersValue.peers.count <= index { + isPlaceholder = peersValue.peers.count != 0 peers = nil } else { peers = peersValue @@ -624,9 +642,15 @@ struct WidgetView: View { let itemHeight = (size.height - 22.0) / 2.0 + if isPlaceholder { + return AnyView(Spacer() + .frame(width: size.width, height: itemHeight, alignment: .leading) + ) + } + let url: URL if let peers = peers { - url = URL(string: linkForPeer(id: peers.peers[index].peer.id))! + url = URL(string: linkForPeer(accountId: peers.peers[index].accountId, id: peers.peers[index].peer.id))! } else { url = URL(string: "\(buildConfig.appSpecificUrlScheme)://")! } diff --git a/submodules/AnimatedStickerNode/Sources/AnimatedStickerNode.swift b/submodules/AnimatedStickerNode/Sources/AnimatedStickerNode.swift index 6c796857da..889af3cae8 100644 --- a/submodules/AnimatedStickerNode/Sources/AnimatedStickerNode.swift +++ b/submodules/AnimatedStickerNode/Sources/AnimatedStickerNode.swift @@ -60,6 +60,7 @@ public enum AnimatedStickerPlaybackPosition { public enum AnimatedStickerPlaybackMode { case once + case count(Int) case loop case still(AnimatedStickerPlaybackPosition) } @@ -757,6 +758,7 @@ public final class AnimatedStickerNode: ASDisplayNode { private var renderer: (AnimationRenderer & ASDisplayNode)? public var isPlaying: Bool = false + private var currentLoopCount: Int = 0 private var canDisplayFirstFrame: Bool = false private var playbackMode: AnimatedStickerPlaybackMode = .loop @@ -910,8 +912,14 @@ public final class AnimatedStickerNode: ASDisplayNode { private var isSetUpForPlayback = false public func play(firstFrame: Bool = false) { - if case .once = self.playbackMode { + switch self.playbackMode { + case .once: self.isPlaying = true + case .count: + self.currentLoopCount = 0 + self.isPlaying = true + default: + break } if self.isSetUpForPlayback { let directData = self.directData @@ -976,6 +984,11 @@ public final class AnimatedStickerNode: ASDisplayNode { var stopNow = false if case .once = strongSelf.playbackMode { stopNow = true + } else if case let .count(count) = strongSelf.playbackMode { + strongSelf.currentLoopCount += 1 + if count <= strongSelf.currentLoopCount { + stopNow = true + } } else if strongSelf.stopAtNearestLoop { stopNow = true } @@ -1061,6 +1074,11 @@ public final class AnimatedStickerNode: ASDisplayNode { var stopNow = false if case .once = strongSelf.playbackMode { stopNow = true + } else if case let .count(count) = strongSelf.playbackMode { + strongSelf.currentLoopCount += 1 + if count <= strongSelf.currentLoopCount { + stopNow = true + } } else if strongSelf.stopAtNearestLoop { stopNow = true } diff --git a/submodules/ChatListFilterSettingsHeaderItem/Sources/ChatListFilterSettingsHeaderItem.swift b/submodules/ChatListFilterSettingsHeaderItem/Sources/ChatListFilterSettingsHeaderItem.swift index 3463b324f1..1aa9ead2c4 100644 --- a/submodules/ChatListFilterSettingsHeaderItem/Sources/ChatListFilterSettingsHeaderItem.swift +++ b/submodules/ChatListFilterSettingsHeaderItem/Sources/ChatListFilterSettingsHeaderItem.swift @@ -106,11 +106,14 @@ class ChatListFilterSettingsHeaderItemNode: ListViewItemNode { let makeTitleLayout = TextNode.asyncLayout(self.titleNode) return { item, params, neighbors in + let isHidden = params.width > params.availableHeight && params.availableHeight < 400.0 + let leftInset: CGFloat = 32.0 + params.leftInset let animationName: String var size = 192 var insetDifference = 100 + var additionalBottomInset: CGFloat = 0.0 var playbackMode: AnimatedStickerPlaybackMode = .once switch item.animation { case .folders: @@ -123,7 +126,8 @@ class ChatListFilterSettingsHeaderItemNode: ListViewItemNode { animationName = "MessageAutoRemove" size = 260 insetDifference = 120 - playbackMode = .loop + playbackMode = .count(2) + additionalBottomInset = isHidden ? 8.0 : 16.0 } let topInset: CGFloat = CGFloat(size - insetDifference) @@ -132,9 +136,14 @@ class ChatListFilterSettingsHeaderItemNode: ListViewItemNode { let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: attributedText, backgroundColor: nil, maximumNumberOfLines: 0, truncationType: .end, constrainedSize: CGSize(width: params.width - params.rightInset - leftInset * 2.0, height: CGFloat.greatestFiniteMagnitude), alignment: .center, cutout: nil, insets: UIEdgeInsets())) let contentSize = CGSize(width: params.width, height: topInset + titleLayout.size.height) - let insets = itemListNeighborsGroupedInsets(neighbors) + var insets = itemListNeighborsGroupedInsets(neighbors) - let layout = ListViewItemNodeLayout(contentSize: contentSize, insets: insets) + if isHidden { + insets = UIEdgeInsets() + } + insets.bottom += additionalBottomInset + + let layout = ListViewItemNodeLayout(contentSize: isHidden ? CGSize(width: params.width, height: 0.0) : contentSize, insets: insets) return (layout, { [weak self] in if let strongSelf = self { @@ -154,6 +163,9 @@ class ChatListFilterSettingsHeaderItemNode: ListViewItemNode { let _ = titleApply() strongSelf.titleNode.frame = CGRect(origin: CGPoint(x: floor((layout.size.width - titleLayout.size.width) / 2.0), y: topInset + 8.0), size: titleLayout.size) + + strongSelf.animationNode.alpha = isHidden ? 0.0 : 1.0 + strongSelf.titleNode.alpha = isHidden ? 0.0 : 1.0 } }) } diff --git a/submodules/PeerInfoUI/Sources/PeerAutoremoveSetupScreen.swift b/submodules/PeerInfoUI/Sources/PeerAutoremoveSetupScreen.swift index 640e09279c..6ca28ef27c 100644 --- a/submodules/PeerInfoUI/Sources/PeerAutoremoveSetupScreen.swift +++ b/submodules/PeerInfoUI/Sources/PeerAutoremoveSetupScreen.swift @@ -32,13 +32,11 @@ private enum PeerAutoremoveSetupEntry: ItemListNodeEntry { case timeHeader(String) case timeValue(Int32, Int32, [Int32]) case timeComment(String) - case globalSwitch(String, Bool) + case globalSwitch(String, Bool, Bool) var section: ItemListSectionId { switch self { - case .header: - return PeerAutoremoveSetupSection.header.rawValue - case .timeHeader, .timeValue, .timeComment: + case .header, .timeHeader, .timeValue, .timeComment: return PeerAutoremoveSetupSection.time.rawValue case .globalSwitch: return PeerAutoremoveSetupSection.global.rawValue @@ -86,8 +84,8 @@ private enum PeerAutoremoveSetupEntry: ItemListNodeEntry { } else { return false } - case let .globalSwitch(lhsText, lhsValue): - if case let .globalSwitch(rhsText, rhsValue) = rhs, lhsText == rhsText, lhsValue == rhsValue { + case let .globalSwitch(lhsText, lhsValue, lhsEnable): + if case let .globalSwitch(rhsText, rhsValue, rhsEnable) = rhs, lhsText == rhsText, lhsValue == rhsValue, lhsEnable == rhsEnable { return true } else { return false @@ -112,8 +110,8 @@ private enum PeerAutoremoveSetupEntry: ItemListNodeEntry { }, tag: nil) case let .timeComment(text): return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) - case let .globalSwitch(text, value): - return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { value in + case let .globalSwitch(text, value, enabled): + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enabled: enabled, maximumNumberOfLines: 2, sectionId: self.section, style: .blocks, updated: { value in arguments.toggleGlobal(value) }) } @@ -150,9 +148,9 @@ private func peerAutoremoveSetupEntries(peer: Peer?, presentationData: Presentat 24 * 60 * 60 * 7, Int32.max ] - if isDebug { - availableValues[0] = 5 - availableValues[1] = 60 + if isDebug || true { + availableValues[0] = 60 + availableValues[1] = 5 * 60 } entries.append(.timeValue(resolvedValue, resolvedMaxValue, availableValues)) if let channel = peer as? TelegramChannel, case .broadcast = channel.info { @@ -165,7 +163,7 @@ private func peerAutoremoveSetupEntries(peer: Peer?, presentationData: Presentat } } if let user = peer as? TelegramUser { - entries.append(.globalSwitch("Also auto-delete for \(user.compactDisplayTitle)", globalValue)) + entries.append(.globalSwitch("Also auto-delete for \(user.compactDisplayTitle)", globalValue, resolvedValue != Int32.max)) } return entries diff --git a/submodules/TelegramApi/Sources/Api0.swift b/submodules/TelegramApi/Sources/Api0.swift index 28fba4c231..a318fc6070 100644 --- a/submodules/TelegramApi/Sources/Api0.swift +++ b/submodules/TelegramApi/Sources/Api0.swift @@ -142,7 +142,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[1511503333] = { return Api.InputEncryptedFile.parse_inputEncryptedFile($0) } dict[767652808] = { return Api.InputEncryptedFile.parse_inputEncryptedFileBigUploaded($0) } dict[-1456996667] = { return Api.messages.InactiveChats.parse_inactiveChats($0) } - dict[-817921892] = { return Api.GroupCallParticipant.parse_groupCallParticipant($0) } + dict[1690708501] = { return Api.GroupCallParticipant.parse_groupCallParticipant($0) } dict[1443858741] = { return Api.messages.SentEncryptedMessage.parse_sentEncryptedMessage($0) } dict[-1802240206] = { return Api.messages.SentEncryptedMessage.parse_sentEncryptedFile($0) } dict[1571494644] = { return Api.ExportedMessageLink.parse_exportedMessageLink($0) } @@ -460,6 +460,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-384910503] = { return Api.ChannelAdminLogEventAction.parse_channelAdminLogEventActionExportedInviteEdit($0) } dict[1557846647] = { return Api.ChannelAdminLogEventAction.parse_channelAdminLogEventActionParticipantJoinByInvite($0) } dict[1048537159] = { return Api.ChannelAdminLogEventAction.parse_channelAdminLogEventActionParticipantVolume($0) } + dict[1855199800] = { return Api.ChannelAdminLogEventAction.parse_channelAdminLogEventActionChangeHistoryTTL($0) } dict[-543777747] = { return Api.auth.ExportedAuthorization.parse_exportedAuthorization($0) } dict[2103482845] = { return Api.SecurePlainData.parse_securePlainPhone($0) } dict[569137759] = { return Api.SecurePlainData.parse_securePlainEmail($0) } diff --git a/submodules/TelegramApi/Sources/Api2.swift b/submodules/TelegramApi/Sources/Api2.swift index 7670b93131..c96f1350be 100644 --- a/submodules/TelegramApi/Sources/Api2.swift +++ b/submodules/TelegramApi/Sources/Api2.swift @@ -3638,13 +3638,13 @@ public extension Api { } public enum GroupCallParticipant: TypeConstructorDescription { - case groupCallParticipant(flags: Int32, userId: Int32, date: Int32, activeDate: Int32?, source: Int32, volume: Int32?, params: Api.DataJSON?) + case groupCallParticipant(flags: Int32, userId: Int32, date: Int32, activeDate: Int32?, source: Int32, volume: Int32?) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .groupCallParticipant(let flags, let userId, let date, let activeDate, let source, let volume, let params): + case .groupCallParticipant(let flags, let userId, let date, let activeDate, let source, let volume): if boxed { - buffer.appendInt32(-817921892) + buffer.appendInt32(1690708501) } serializeInt32(flags, buffer: buffer, boxed: false) serializeInt32(userId, buffer: buffer, boxed: false) @@ -3652,15 +3652,14 @@ public extension Api { if Int(flags) & Int(1 << 3) != 0 {serializeInt32(activeDate!, buffer: buffer, boxed: false)} serializeInt32(source, buffer: buffer, boxed: false) if Int(flags) & Int(1 << 7) != 0 {serializeInt32(volume!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 10) != 0 {params!.serialize(buffer, true)} break } } public func descriptionFields() -> (String, [(String, Any)]) { switch self { - case .groupCallParticipant(let flags, let userId, let date, let activeDate, let source, let volume, let params): - return ("groupCallParticipant", [("flags", flags), ("userId", userId), ("date", date), ("activeDate", activeDate), ("source", source), ("volume", volume), ("params", params)]) + case .groupCallParticipant(let flags, let userId, let date, let activeDate, let source, let volume): + return ("groupCallParticipant", [("flags", flags), ("userId", userId), ("date", date), ("activeDate", activeDate), ("source", source), ("volume", volume)]) } } @@ -3677,19 +3676,14 @@ public extension Api { _5 = reader.readInt32() var _6: Int32? if Int(_1!) & Int(1 << 7) != 0 {_6 = reader.readInt32() } - var _7: Api.DataJSON? - if Int(_1!) & Int(1 << 10) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.DataJSON - } } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 3) == 0) || _4 != nil let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 7) == 0) || _6 != nil - let _c7 = (Int(_1!) & Int(1 << 10) == 0) || _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.GroupCallParticipant.groupCallParticipant(flags: _1!, userId: _2!, date: _3!, activeDate: _4, source: _5!, volume: _6, params: _7) + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.GroupCallParticipant.groupCallParticipant(flags: _1!, userId: _2!, date: _3!, activeDate: _4, source: _5!, volume: _6) } else { return nil @@ -11095,6 +11089,7 @@ public extension Api { case channelAdminLogEventActionExportedInviteEdit(prevInvite: Api.ExportedChatInvite, newInvite: Api.ExportedChatInvite) case channelAdminLogEventActionParticipantJoinByInvite(invite: Api.ExportedChatInvite) case channelAdminLogEventActionParticipantVolume(participant: Api.GroupCallParticipant) + case channelAdminLogEventActionChangeHistoryTTL(prevValue: Int32, newValue: Int32) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { @@ -11297,6 +11292,13 @@ public extension Api { } participant.serialize(buffer, true) break + case .channelAdminLogEventActionChangeHistoryTTL(let prevValue, let newValue): + if boxed { + buffer.appendInt32(1855199800) + } + serializeInt32(prevValue, buffer: buffer, boxed: false) + serializeInt32(newValue, buffer: buffer, boxed: false) + break } } @@ -11364,6 +11366,8 @@ public extension Api { return ("channelAdminLogEventActionParticipantJoinByInvite", [("invite", invite)]) case .channelAdminLogEventActionParticipantVolume(let participant): return ("channelAdminLogEventActionParticipantVolume", [("participant", participant)]) + case .channelAdminLogEventActionChangeHistoryTTL(let prevValue, let newValue): + return ("channelAdminLogEventActionChangeHistoryTTL", [("prevValue", prevValue), ("newValue", newValue)]) } } @@ -11795,6 +11799,20 @@ public extension Api { return nil } } + public static func parse_channelAdminLogEventActionChangeHistoryTTL(_ reader: BufferReader) -> ChannelAdminLogEventAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeHistoryTTL(prevValue: _1!, newValue: _2!) + } + else { + return nil + } + } } public enum SecurePlainData: TypeConstructorDescription { diff --git a/submodules/TelegramApi/Sources/Api4.swift b/submodules/TelegramApi/Sources/Api4.swift index 4e87196749..0815918b9a 100644 --- a/submodules/TelegramApi/Sources/Api4.swift +++ b/submodules/TelegramApi/Sources/Api4.swift @@ -4707,6 +4707,20 @@ public extension Api { return result }) } + + public static func convertToGigagroup(channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(187239529) + channel.serialize(buffer, true) + return (FunctionDescription(name: "channels.convertToGigagroup", parameters: [("channel", channel)]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public struct payments { public static func getPaymentForm(msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { diff --git a/submodules/TelegramCore/Sources/ChannelAdminEventLogs.swift b/submodules/TelegramCore/Sources/ChannelAdminEventLogs.swift index 5cf71b940e..6edce82e14 100644 --- a/submodules/TelegramCore/Sources/ChannelAdminEventLogs.swift +++ b/submodules/TelegramCore/Sources/ChannelAdminEventLogs.swift @@ -247,6 +247,8 @@ public func channelAdminLogEvents(postbox: Postbox, network: Network, peerId: Pe case let .channelAdminLogEventActionParticipantVolume(participant): let parsedParticipant = GroupCallParticipantsContext.Update.StateUpdate.ParticipantUpdate(participant) action = .groupCallUpdateParticipantVolume(peerId: parsedParticipant.peerId, volume: parsedParticipant.volume ?? 10000) + case let .channelAdminLogEventActionChangeHistoryTTL(prevValue, newValue): + action = nil } let peerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: userId) if let action = action { diff --git a/submodules/TelegramCore/Sources/GroupCalls.swift b/submodules/TelegramCore/Sources/GroupCalls.swift index 1480e34a5d..b286058b6f 100644 --- a/submodules/TelegramCore/Sources/GroupCalls.swift +++ b/submodules/TelegramCore/Sources/GroupCalls.swift @@ -88,7 +88,7 @@ public func getCurrentGroupCall(account: Account, callId: Int64, accessHash: Int loop: for participant in participants { switch participant { - case let .groupCallParticipant(flags, userId, date, activeDate, source, volume, params): + case let .groupCallParticipant(flags, userId, date, activeDate, source, volume): let peerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: userId) let ssrc = UInt32(bitPattern: source) guard let peer = transaction.getPeer(peerId) else { @@ -104,12 +104,12 @@ public func getCurrentGroupCall(account: Account, callId: Int64, accessHash: Int muteState = GroupCallParticipantsContext.Participant.MuteState(canUnmute: false, mutedByYou: mutedByYou) } var jsonParams: String? - if let params = params { + /*if let params = params { switch params { case let .dataJSON(data): jsonParams = data } - } + }*/ parsedParticipants.append(GroupCallParticipantsContext.Participant( peer: peer, ssrc: ssrc, @@ -236,7 +236,7 @@ public func getGroupCallParticipants(account: Account, callId: Int64, accessHash loop: for participant in participants { switch participant { - case let .groupCallParticipant(flags, userId, date, activeDate, source, volume, params): + case let .groupCallParticipant(flags, userId, date, activeDate, source, volume): let peerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: userId) let ssrc = UInt32(bitPattern: source) guard let peer = transaction.getPeer(peerId) else { @@ -252,12 +252,12 @@ public func getGroupCallParticipants(account: Account, callId: Int64, accessHash muteState = GroupCallParticipantsContext.Participant.MuteState(canUnmute: false, mutedByYou: mutedByYou) } var jsonParams: String? - if let params = params { + /*if let params = params { switch params { case let .dataJSON(data): jsonParams = data } - } + }*/ parsedParticipants.append(GroupCallParticipantsContext.Participant( peer: peer, ssrc: ssrc, @@ -1363,7 +1363,7 @@ public final class GroupCallParticipantsContext { extension GroupCallParticipantsContext.Update.StateUpdate.ParticipantUpdate { init(_ apiParticipant: Api.GroupCallParticipant) { switch apiParticipant { - case let .groupCallParticipant(flags, userId, date, activeDate, source, volume, params): + case let .groupCallParticipant(flags, userId, date, activeDate, source, volume): let peerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: userId) let ssrc = UInt32(bitPattern: source) let muted = (flags & (1 << 0)) != 0 @@ -1388,12 +1388,12 @@ extension GroupCallParticipantsContext.Update.StateUpdate.ParticipantUpdate { } var jsonParams: String? - if let params = params { + /*if let params = params { switch params { case let .dataJSON(data): jsonParams = data } - } + }*/ self.init( peerId: peerId, @@ -1414,7 +1414,7 @@ extension GroupCallParticipantsContext.Update.StateUpdate { var participantUpdates: [GroupCallParticipantsContext.Update.StateUpdate.ParticipantUpdate] = [] for participant in participants { switch participant { - case let .groupCallParticipant(flags, userId, date, activeDate, source, volume, params): + case let .groupCallParticipant(flags, userId, date, activeDate, source, volume): let peerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: userId) let ssrc = UInt32(bitPattern: source) let muted = (flags & (1 << 0)) != 0 @@ -1439,12 +1439,12 @@ extension GroupCallParticipantsContext.Update.StateUpdate { } var jsonParams: String? - if let params = params { + /*if let params = params { switch params { case let .dataJSON(data): jsonParams = data } - } + }*/ participantUpdates.append(GroupCallParticipantsContext.Update.StateUpdate.ParticipantUpdate( peerId: peerId, diff --git a/submodules/TelegramCore/Sources/InvitationLinks.swift b/submodules/TelegramCore/Sources/InvitationLinks.swift index 308fbd7709..f24b0ceda1 100644 --- a/submodules/TelegramCore/Sources/InvitationLinks.swift +++ b/submodules/TelegramCore/Sources/InvitationLinks.swift @@ -6,6 +6,54 @@ import MtProtoKit import SyncCore + +public func revokePersistentPeerExportedInvitation(account: Account, peerId: PeerId) -> Signal { + return account.postbox.transaction { transaction -> Signal in + if let peer = transaction.getPeer(peerId), let inputPeer = apiInputPeer(peer) { + let flags: Int32 = (1 << 2) + if let _ = peer as? TelegramChannel { + return account.network.request(Api.functions.messages.exportChatInvite(flags: flags, peer: inputPeer, expireDate: nil, usageLimit: nil)) + |> retryRequest + |> mapToSignal { result -> Signal in + return account.postbox.transaction { transaction -> ExportedInvitation? in + let invitation = ExportedInvitation(apiExportedInvite: result) + transaction.updatePeerCachedData(peerIds: Set([peerId]), update: { _, current in + if let current = current as? CachedChannelData { + return current.withUpdatedExportedInvitation(invitation) + } else { + return CachedChannelData().withUpdatedExportedInvitation(invitation) + } + }) + return invitation + + } + } + } else if let _ = peer as? TelegramGroup { + return account.network.request(Api.functions.messages.exportChatInvite(flags: flags, peer: inputPeer, expireDate: nil, usageLimit: nil)) + |> retryRequest + |> mapToSignal { result -> Signal in + return account.postbox.transaction { transaction -> ExportedInvitation? in + let invitation = ExportedInvitation(apiExportedInvite: result) + transaction.updatePeerCachedData(peerIds: Set([peerId]), update: { _, current in + if let current = current as? CachedGroupData { + return current.withUpdatedExportedInvitation(invitation) + } else { + return current + } + }) + return invitation + } + } + } else { + return .complete() + } + } else { + return .complete() + } + } |> switchToLatest +} + + public enum CreatePeerExportedInvitationError { case generic } @@ -840,10 +888,13 @@ public func peerExportedInvitationsCreators(account: Account, peerId: PeerId) -> peersMap[telegramUser.id] = telegramUser } - for case let .chatAdminWithInvites(adminId, invitesCount, revokedInvitesCount) in admins { - let peerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: adminId) - if let peer = peersMap[peerId], peerId != account.peerId { - creators.append(ExportedInvitationCreator(peer: RenderedPeer(peer: peer), count: invitesCount, revokedCount: revokedInvitesCount)) + for admin in admins { + switch admin { + case let .chatAdminWithInvites(adminId, invitesCount, revokedInvitesCount): + let peerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: adminId) + if let peer = peersMap[peerId], peerId != account.peerId { + creators.append(ExportedInvitationCreator(peer: RenderedPeer(peer: peer), count: invitesCount, revokedCount: revokedInvitesCount)) + } } } diff --git a/submodules/TelegramCore/Sources/ReportPeer.swift b/submodules/TelegramCore/Sources/ReportPeer.swift index 38b49c778d..42ea988090 100644 --- a/submodules/TelegramCore/Sources/ReportPeer.swift +++ b/submodules/TelegramCore/Sources/ReportPeer.swift @@ -104,7 +104,7 @@ private extension ReportReason { return .inputReportReasonCopyright case .irrelevantLocation: return .inputReportReasonGeoIrrelevant - case let .custom: + case .custom: return .inputReportReasonOther } } diff --git a/submodules/TelegramCore/Sources/Serialization.swift b/submodules/TelegramCore/Sources/Serialization.swift index f0775e12ba..a6c8eed708 100644 --- a/submodules/TelegramCore/Sources/Serialization.swift +++ b/submodules/TelegramCore/Sources/Serialization.swift @@ -210,7 +210,7 @@ public class BoxedMessage: NSObject { public class Serialization: NSObject, MTSerialization { public func currentLayer() -> UInt { - return 125 + return 124 } public func parseMessage(_ data: Data!) -> Any! { diff --git a/submodules/TelegramUI/Resources/Animations/anim_autoremove_off.json b/submodules/TelegramUI/Resources/Animations/anim_autoremove_off.json new file mode 100644 index 0000000000..42051fa6ef --- /dev/null +++ b/submodules/TelegramUI/Resources/Animations/anim_autoremove_off.json @@ -0,0 +1 @@ +{"v":"5.5.7","meta":{"g":"LottieFiles AE 0.1.20","a":"","k":"","d":"","tc":""},"fr":60,"ip":0,"op":63,"w":512,"h":512,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":3,"nm":"Null 3","sr":1,"ks":{"o":{"a":0,"k":0,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[252,286,0],"ix":2},"a":{"a":0,"k":[50,50,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.3,0.3,0.3],"y":[1,1,1]},"o":{"x":[0.3,0.3,0.3],"y":[0,0,0]},"t":30,"s":[100,100,100]},{"i":{"x":[0.71,0.71,0.71],"y":[1,1,1]},"o":{"x":[0.5,0.5,0.5],"y":[0,0,0]},"t":38,"s":[95,95,100]},{"i":{"x":[0.71,0.71,0.71],"y":[1,1,1]},"o":{"x":[0.29,0.29,0.29],"y":[0,0,0]},"t":46,"s":[102,102,100]},{"t":53,"s":[100,100,100]}],"ix":6}},"ao":0,"ip":0,"op":180,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Fire 2","parent":4,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":2.193,"ix":10},"p":{"a":0,"k":[6.858,0.314,0],"ix":2},"a":{"a":0,"k":[-654.13,1.695,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.541,"y":0},"t":25,"s":[{"i":[[0,0],[-13,-35],[-58.2,-4.2],[-23.7,25.95]],"o":[[-28.7,62.6],[25.7,69.1],[39.65,2.75],[0,0]],"v":[[-785.3,-63.6],[-802.5,92.6],[-667.4,197.5],[-560.8,161.05]],"c":true}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":28,"s":[{"i":[[0,0],[-13.09,-34.706],[-58.441,-4.166],[-24.065,24.466]],"o":[[-28.262,60.287],[25.396,67.393],[40.161,2.755],[0,0]],"v":[[-786.813,-61.155],[-803.805,93.972],[-668.372,197.603],[-561.768,162.648]],"c":true}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":30,"s":[{"i":[[0,0],[-13.236,-34.231],[-58.83,-4.112],[-24.656,22.063]],"o":[[-27.552,56.542],[24.905,64.63],[40.987,2.764],[0,0]],"v":[[-793.928,-51.372],[-805.917,96.192],[-669.945,197.771],[-569.277,168.752]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.167,"y":0.167},"t":32,"s":[{"i":[[0,0],[-13.568,-33.15],[-59.715,-3.987],[-25.999,16.602]],"o":[[-25.94,48.031],[23.789,58.348],[42.865,2.783],[0,0]],"v":[[-796.535,-38.065],[-810.718,101.24],[-673.521,198.151],[-571.671,175.699]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.3,"y":0},"t":34,"s":[{"i":[[0,0],[-13.768,-32.5],[-60.247,-3.913],[-26.806,13.318]],"o":[[-24.97,42.912],[23.117,54.571],[43.995,2.795],[0,0]],"v":[[-798.229,-32.182],[-813.605,104.275],[-675.672,198.379],[-573.237,177.758]],"c":true}]},{"t":43,"s":[{"i":[[0,0],[-13.3,-34.887],[-58.2,-4.2],[-24.393,20.093]],"o":[[-20.508,51.07],[22.332,58.58],[42.5,3],[0,0]],"v":[[-796.399,-36.719],[-810.241,97.157],[-676.994,198.174],[-569.221,173.112]],"c":true}]}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.541,"y":0},"t":25,"s":[{"i":[[0,0],[1.8,36.65],[27.1,38.4],[58.5,26.6],[-0.6,-16.6],[0,0],[5.7,-26.8],[9.1,-17.5],[2.2,3.3],[0,0],[13.15,-45.1],[0,0],[0,0],[0,0],[0,0]],"o":[[39.95,-33.1],[-2.305,-46.933],[-21.139,-29.954],[-5,-2.2],[0,0],[-0.1,29],[-5.9,27.6],[-2.55,4.35],[0,0],[-6.1,-8.25],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[-560.95,161.1],[-508.8,22.1],[-550.1,-115.4],[-665,-213.1],[-683.15,-199.7],[-683.15,-199.7],[-690.1,-102.5],[-707.7,-37.85],[-717.6,-37.4],[-751.9,-91],[-785.4,-63.65],[-698.494,30.235],[-697.242,31.482],[-564.024,158.035],[-563.397,158.661]],"c":true}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":28,"s":[{"i":[[0,0],[1.802,35.68],[28.311,39.19],[57.865,26.165],[-0.602,-16.491],[0,0],[5.687,-26.753],[9.131,-17.385],[2.207,3.278],[0,0],[12.148,-41.455],[0,0],[0,0],[0,0],[0,0]],"o":[[40.422,-33.415],[-2.372,-46.622],[-21.326,-29.68],[-5.017,-2.186],[0,0],[-0.1,28.809],[-5.797,27.142],[-2.613,4.46],[0,0],[-5.852,-8.012],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[-561.773,162.518],[-507.395,23.599],[-550.168,-112.934],[-664.501,-208.459],[-682.961,-195.288],[-682.961,-195.288],[-689.93,-99.719],[-707.865,-35.167],[-717.886,-34.82],[-752.364,-87.722],[-786.821,-59.831],[-697.458,30.02],[-696.202,31.26],[-564.857,159.474],[-564.228,160.095]],"c":true}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":30,"s":[{"i":[[0,0],[1.809,32.912],[31.764,41.443],[56.053,24.925],[-0.608,-16.179],[0,0],[5.648,-26.619],[9.218,-17.057],[2.229,3.216],[0,0],[9.29,-31.056],[0,0],[0,0],[0,0],[0,0]],"o":[[41.77,-34.313],[-2.563,-45.733],[-21.859,-28.901],[-5.065,-2.144],[0,0],[-0.101,28.265],[-5.502,25.834],[-2.794,4.774],[0,0],[-5.145,-7.334],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[-550.594,155.609],[-503.389,27.876],[-550.362,-105.899],[-663.078,-195.222],[-682.421,-182.701],[-682.421,-182.701],[-689.443,-91.786],[-708.337,-27.515],[-718.702,-27.461],[-753.687,-78.37],[-778.418,-65.154],[-686.737,25.143],[-685.469,26.359],[-553.707,152.622],[-553.072,153.231]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.167,"y":0.167},"t":32,"s":[{"i":[[0,0],[1.819,28.76],[36.945,44.824],[53.336,23.065],[-0.616,-15.712],[0,0],[5.59,-26.419],[9.35,-16.564],[2.26,3.124],[0,0],[5.002,-15.459],[0,0],[0,0],[0,0],[0,0]],"o":[[43.791,-35.661],[-2.85,-44.4],[-22.659,-27.731],[-5.137,-2.082],[0,0],[-0.103,27.449],[-5.059,23.872],[-3.065,5.246],[0,0],[-4.084,-6.317],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[-543.507,156.769],[-497.379,34.291],[-550.653,-95.346],[-660.943,-175.365],[-681.612,-163.821],[-681.612,-163.821],[-688.714,-79.887],[-709.045,-16.036],[-719.925,-16.422],[-755.673,-64.343],[-774.213,-60.399],[-685.441,25.743],[-684.155,26.924],[-546.666,153.868],[-546.021,154.46]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.3,"y":0},"t":34,"s":[{"i":[[0,0],[1.824,26.552],[39.7,46.621],[51.891,22.076],[-0.621,-15.464],[0,0],[5.56,-26.312],[9.42,-16.302],[2.277,3.074],[0,0],[2.722,-7.163],[0,0],[0,0],[0,0],[0,0]],"o":[[44.867,-36.378],[-3.002,-43.691],[-23.084,-27.109],[-5.176,-2.049],[0,0],[-0.103,27.015],[-4.824,22.829],[-3.209,5.496],[0,0],[-3.52,-5.776],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[-540.631,157.399],[-494.183,37.703],[-550.807,-89.734],[-659.808,-164.804],[-681.182,-153.779],[-681.182,-153.779],[-688.326,-73.558],[-709.421,-9.932],[-720.576,-10.551],[-756.729,-56.883],[-773.692,-57.363],[-687.715,28.003],[-686.42,29.165],[-543.813,154.544],[-543.164,155.127]],"c":true}]},{"t":43,"s":[{"i":[[0,0],[1.8,28.5],[38.4,50],[50.128,23.698],[-0.6,-16.6],[0,0],[5.371,-28.245],[9.1,-17.5],[2.2,3.3],[0,0],[7.2,-17.3],[0,0],[0,0],[0,0],[0,0]],"o":[[43.342,-39.05],[-2.9,-46.9],[-22.3,-29.1],[-5,-2.2],[0,0],[-0.1,29],[-4.66,24.506],[-3.1,5.9],[0,0],[-3.4,-6.2],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[-542.391,150.884],[-501.672,25.695],[-554.874,-111.161],[-661.669,-191.689],[-682.317,-179.854],[-682.317,-179.854],[-689.218,-93.739],[-709.596,-25.439],[-720.372,-26.104],[-755.297,-75.839],[-781.297,-69.739],[-692.39,18.896],[-691.139,20.143],[-545.465,147.819],[-544.837,148.444]],"c":true}]}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 2","np":2,"cix":2,"bm":0,"ix":2,"mn":"ADBE Vector Group","hd":false}],"ip":25,"op":177,"st":-3,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Line","parent":2,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":-2,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.7,"y":1},"o":{"x":0.541,"y":0},"t":23,"s":[-712.833,-22.984,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.7,"y":1},"o":{"x":0.3,"y":0},"t":34,"s":[-655.767,32.752,0],"to":[0,0,0],"ti":[0,0,0]},{"t":43,"s":[-664.092,22.23,0]}],"ix":2},"a":{"a":0,"k":[-656.75,22.3,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-830.9,-151.3],[-482.6,195.9]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":31,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.69],"y":[1]},"o":{"x":[0.495],"y":[0]},"t":23,"s":[0]},{"t":34,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":20,"op":177,"st":-3,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Fire","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":19,"s":[0]},{"i":{"x":[0.3],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":28,"s":[-3]},{"i":{"x":[0.71],"y":[1]},"o":{"x":[0.5],"y":[0]},"t":36,"s":[11]},{"i":{"x":[0.71],"y":[1]},"o":{"x":[0.29],"y":[0]},"t":44,"s":[-8]},{"i":{"x":[0.71],"y":[1]},"o":{"x":[0.29],"y":[0]},"t":51,"s":[5]},{"i":{"x":[0.71],"y":[1]},"o":{"x":[0.29],"y":[0]},"t":57,"s":[-2]},{"t":62,"s":[0]}],"ix":10},"p":{"a":0,"k":[54,215.845,0],"ix":2},"a":{"a":0,"k":[0,195.845,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.3,0.3,0.3],"y":[1,1,1]},"o":{"x":[0.31,0.31,0.31],"y":[0,0,0]},"t":0,"s":[0,0,100]},{"t":6,"s":[100,100,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.4,"y":1},"o":{"x":0.29,"y":0},"t":0,"s":[{"i":[[-3.876,-0.374],[-21.728,-4.273],[-3.77,-0.898],[-2.945,-8.566],[150.67,1.932],[25.749,12.598],[-3.973,4.568],[-21.735,7.34],[-6.555,-0.642],[0,0],[-3.456,1.274],[-5.895,5.057],[-0.095,5.289],[0,0]],"o":[[37.346,3.603],[4.415,0.868],[38.285,9.121],[2.945,8.566],[-58.14,-0.746],[-7.055,-3.452],[4.908,-5.643],[3.515,-1.196],[7.584,0.888],[2.185,0.607],[8.835,-3.208],[5.7,-4.89],[0,0],[1.044,-3.038]],"v":[[4.737,132.854],[93.348,144.668],[105.626,147.315],[156.926,172.041],[-12.839,203.963],[-150.398,185.184],[-155.022,173.154],[-115.058,153.678],[-96.723,152.673],[-58.533,162.834],[-46.184,162.712],[-24.048,150.315],[-15.308,135.039],[-15.308,135.039]],"c":true}]},{"i":{"x":0.4,"y":1},"o":{"x":0.29,"y":0},"t":9,"s":[{"i":[[-2.024,-2.348],[-12.871,-24.747],[-2.229,-5.191],[-1.744,-49.603],[89.254,11.19],[15.26,72.996],[-2.353,26.452],[-12.874,42.505],[-3.883,-3.715],[0,0],[-2.047,7.38],[-3.496,29.319],[-3.65,28.666],[0,0]],"o":[[19.482,22.605],[2.615,5.029],[22.678,52.816],[1.744,49.603],[-34.439,-4.318],[-4.179,-19.99],[2.907,-32.675],[2.082,-6.928],[4.492,5.139],[1.294,3.514],[5.233,-18.576],[3.376,-28.316],[0,0],[2.678,-16.389]],"v":[[9.111,-215.809],[50.473,-147.648],[57.745,-132.322],[93.132,9.806],[-7.426,194.662],[-88.908,85.917],[-91.647,16.25],[-63.475,-96.528],[-51.614,-101.295],[-33.993,-65.179],[-26.678,-65.882],[-14.066,-116.008],[-4.144,-205.611],[-4.144,-205.611]],"c":true}]},{"i":{"x":0.468,"y":1},"o":{"x":0.29,"y":0},"t":17,"s":[{"i":[[-4.294,-1.226],[-23.654,-16.653],[-4.099,-3.496],[-3.206,-41.125],[164.025,9.277],[28.043,60.515],[-4.325,21.931],[-23.661,28.603],[-7.136,-2.5],[0,0],[-3.762,4.966],[-4.682,20.212],[-0.103,20.609],[0,0]],"o":[[26.883,7.673],[4.806,3.384],[41.678,35.542],[3.206,41.125],[-63.292,-3.58],[-7.68,-16.574],[5.342,-27.091],[3.827,-4.662],[8.256,3.459],[2.379,2.365],[9.618,-12.5],[4.718,-20.37],[0,0],[1.137,-11.841]],"v":[[5.117,-116.673],[101.582,-70.633],[114.948,-60.32],[177.794,55.318],[-14.015,196.581],[-167.765,111.421],[-171.798,48.66],[-125.294,-35.522],[-101.334,-38.441],[-61.259,20.155],[-47.815,19.682],[-22.718,-43.63],[-16.704,-108.159],[-16.704,-108.159]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.541,"y":0},"t":25,"s":[{"i":[[-3.708,-2.156],[-20.775,-24.628],[-3.599,-5.168],[-2.816,-49.363],[144.064,11.135],[24.631,72.64],[-3.799,26.324],[-20.781,42.299],[-6.267,-3.697],[0,0],[-3.304,7.344],[-5.643,29.176],[-0.091,30.477],[0,0]],"o":[[35.708,20.762],[4.221,5.004],[36.605,52.561],[2.816,49.363],[-55.589,-4.297],[-6.746,-19.893],[4.692,-32.517],[3.361,-6.895],[7.252,5.115],[2.089,3.497],[8.447,-18.486],[5.45,-28.179],[0,0],[0.998,-17.511]],"v":[[4.548,-215.08],[89.272,-146.995],[101.012,-131.742],[150.061,10.751],[-12.256,194.713],[-143.781,86.494],[-148.201,17.163],[-109.991,-95.07],[-92.461,-100.866],[-55.946,-42.309],[-44.138,-43.009],[-22.974,-114.455],[-14.618,-202.489],[-14.618,-202.489]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.3,"y":0},"t":34,"s":[{"i":[[-4.008,-1.905],[-22.46,-21.763],[-3.892,-4.568],[-3.044,-43.621],[155.746,9.84],[26.628,64.189],[-4.107,23.262],[-22.466,37.379],[-6.776,-3.267],[0,0],[-3.572,6.49],[-6.1,25.781],[-0.098,26.932],[0,0]],"o":[[38.604,18.347],[4.564,4.422],[39.574,46.447],[3.044,43.621],[-60.098,-3.797],[-7.293,-17.579],[5.073,-28.735],[3.633,-6.093],[7.84,4.52],[2.259,3.091],[9.132,-16.336],[5.892,-24.901],[0,0],[1.079,-15.474]],"v":[[4.881,-166.111],[96.477,-105.946],[109.168,-92.467],[162.195,33.451],[-13.286,196.015],[-155.477,100.384],[-160.256,39.117],[-118.947,-60.061],[-99.995,-65.182],[-60.519,-13.437],[-47.753,-14.055],[-24.873,-77.191],[-15.839,-154.985],[-15.839,-154.985]],"c":true}]},{"t":43,"s":[{"i":[[-3.876,-2.053],[-21.728,-23.414],[-3.77,-4.909],[-2.945,-46.93],[150.67,10.64],[25.745,69.065],[-3.973,25.027],[-21.735,40.214],[-6.555,-3.515],[0,0],[-3.456,6.982],[-5.89,27.74],[-0.095,28.975],[0,0]],"o":[[37.346,19.739],[4.415,4.758],[38.285,49.97],[2.945,46.93],[-58.14,-4.085],[-7.055,-18.913],[4.908,-30.914],[3.515,-6.555],[7.584,4.863],[2.185,3.325],[8.835,-17.575],[5.7,-26.79],[0,0],[1.044,-16.648]],"v":[[4.737,-194.33],[93.348,-129.601],[105.626,-115.1],[156.926,20.37],[-12.839,195.265],[-150.398,92.38],[-155.022,26.466],[-115.058,-80.235],[-96.723,-85.745],[-58.533,-30.075],[-46.184,-30.74],[-24.048,-98.665],[-15.308,-182.36],[-15.308,-182.36]],"c":true}]}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Path-Copy-8","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":25,"st":0,"bm":0}],"markers":[]} \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/Animations/anim_autoremove_on.json b/submodules/TelegramUI/Resources/Animations/anim_autoremove_on.json new file mode 100644 index 0000000000..d23f4737b5 --- /dev/null +++ b/submodules/TelegramUI/Resources/Animations/anim_autoremove_on.json @@ -0,0 +1 @@ +{"v":"5.5.7","meta":{"g":"LottieFiles AE 0.1.20","a":"","k":"","d":"","tc":""},"fr":60,"ip":0,"op":64,"w":512,"h":512,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":3,"nm":"Null 1","sr":1,"ks":{"o":{"a":0,"k":0,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":0,"s":[-3]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":14,"s":[-3]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":30,"s":[3]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":45,"s":[-2]},{"t":59,"s":[0]}],"ix":10},"p":{"a":0,"k":[256,452,0],"ix":2},"a":{"a":0,"k":[50,50,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":180,"st":0,"bm":0},{"ddd":0,"ind":6,"ty":4,"nm":"Fire","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":0,"s":[0]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":6,"s":[3]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":13,"s":[3]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":20,"s":[3]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":26,"s":[-3]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":32,"s":[3]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":38,"s":[-3]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":44,"s":[3]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":50,"s":[-3]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":56,"s":[2]},{"t":63,"s":[0]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.4,"y":1},"o":{"x":0.3,"y":0},"t":0,"s":[50,107.845,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.7,"y":1},"o":{"x":0.3,"y":0},"t":8,"s":[50,37.845,0],"to":[0,0,0],"ti":[0,0,0]},{"t":17,"s":[50,49.845,0]}],"ix":2},"a":{"a":0,"k":[0,195.845,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.3,0.3,0.3],"y":[1,1,1]},"o":{"x":[0.3,0.3,0.3],"y":[0,0,0]},"t":0,"s":[50,0,100]},{"i":{"x":[0.3,0.3,0.3],"y":[1,1,1]},"o":{"x":[0.3,0.3,0.3],"y":[0,0,0]},"t":8,"s":[95,109,100]},{"i":{"x":[0.7,0.7,0.7],"y":[1,1,1]},"o":{"x":[0.3,0.3,0.3],"y":[0,0,0]},"t":17,"s":[105,90,100]},{"i":{"x":[0.7,0.7,0.7],"y":[1,1,1]},"o":{"x":[0.3,0.3,0.3],"y":[0,0,0]},"t":23,"s":[95,105,100]},{"i":{"x":[0.7,0.7,0.7],"y":[1,1,1]},"o":{"x":[0.3,0.3,0.3],"y":[0,0,0]},"t":29,"s":[105,95,100]},{"i":{"x":[0.7,0.7,0.7],"y":[1,1,1]},"o":{"x":[0.3,0.3,0.3],"y":[0,0,0]},"t":35,"s":[95,105,100]},{"i":{"x":[0.7,0.7,0.7],"y":[1,1,1]},"o":{"x":[0.3,0.3,0.3],"y":[0,0,0]},"t":41,"s":[105,95,100]},{"i":{"x":[0.7,0.7,0.7],"y":[1,1,1]},"o":{"x":[0.3,0.3,0.3],"y":[0,0,0]},"t":47,"s":[95,107,100]},{"i":{"x":[0.7,0.7,0.7],"y":[1,1,1]},"o":{"x":[0.3,0.3,0.3],"y":[0,0,0]},"t":53,"s":[102,98,100]},{"t":61,"s":[100,100,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.3,"y":0},"t":0,"s":[{"i":[[-1.108,-1.357],[-5.487,-16.825],[-1.027,-4.504],[0.832,-40.786],[41.122,9.707],[7.03,63.314],[-0.937,22.993],[-4.557,28.938],[-2.515,-1.472],[0,0],[-1.26,6.501],[-3.777,19.921],[-0.454,19.918],[0,0]],"o":[[10.873,13.041],[1.386,3.612],[9.24,41.886],[-1.055,42.363],[-15.865,-3.745],[-1.925,-17.339],[1.031,-25.286],[1.122,-7.752],[2.351,2.556],[0.596,3.048],[3.11,-13.703],[2.781,-18.788],[0,0],[1.35,-12.055]],"v":[[9.663,-126.047],[33.18,-79.161],[39.952,-65.149],[49.69,55.454],[-1.662,196.15],[-42.41,109.493],[-44.091,49.065],[-35.909,-34.623],[-29.614,-45.184],[-16.156,-6.125],[-11.04,-7.692],[-3.394,-55.591],[1.331,-113.755],[2.483,-115.792]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.167,"y":0.167},"t":3,"s":[{"i":[[-3.37,-1.028],[-16.617,-13.287],[-2.988,-3.254],[-0.034,-29.976],[130.072,5.977],[21.692,45.671],[-3.126,16.574],[-12.783,17.224],[-6.298,-1.496],[0,0],[-3.222,4.665],[-7.932,15.736],[-1.142,13.784],[0,0]],"o":[[23.139,7.723],[3.782,2.791],[28.64,31.187],[-0.299,30.722],[-51.377,-2.33],[-5.941,-12.507],[3.671,-18.997],[3.039,-5.16],[6.452,2.315],[1.737,2.199],[8.071,-10.482],[6.364,-14.984],[0,0],[2.422,-9.491]],"v":[[19.532,-40.273],[81.72,-5.356],[96.599,4.574],[140.797,92.055],[-10.208,198.416],[-130.295,134.006],[-134.814,90.416],[-100.338,31.211],[-83.826,24.959],[-48.102,51.436],[-35.671,50.543],[-15.668,12.428],[-2.577,-31.837],[-0.854,-32.801]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.3,"y":0},"t":8,"s":[{"i":[[-2.387,-1.696],[-11.724,-23.414],[-2.031,-4.913],[-1.781,-46.93],[95.578,6.076],[15.581,69.06],[-2.403,25.027],[-8.319,15.504],[-3.537,-3.515],[0,0],[-1.865,6.982],[-3.184,27.738],[-0.645,19.158],[0,0]],"o":[[9.592,6.816],[2.382,4.758],[20.657,49.97],[1.781,46.93],[-38.539,-2.45],[-4.267,-18.913],[2.968,-30.914],[1.897,-6.555],[4.092,4.863],[1.179,3.325],[4.767,-17.575],[3.076,-26.79],[0,0],[0.563,-16.648]],"v":[[9.499,-183.78],[47.163,-127.815],[53.788,-113.315],[95.085,20.37],[-8.348,195.265],[-90.79,92.38],[-93.586,26.466],[-62.591,-59.7],[-52.698,-65.21],[-30.956,-30.075],[-24.292,-30.74],[-12.349,-98.665],[-3.949,-172.269],[-3.949,-172.269]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.3,"y":0},"t":15,"s":[{"i":[[-3.987,-2.031],[-22.851,-20.685],[-3.8,-4.44],[-3.358,-41.444],[158.458,9.352],[22.243,65.4],[-4.178,22.11],[-22.858,35.527],[-6.894,-3.105],[-8.82,-9.357],[-4.148,3.318],[-7.324,23.604],[-0.1,25.598],[0,0]],"o":[[30.741,15.658],[4.643,4.203],[31.068,36.303],[3.698,45.641],[-61.144,-3.609],[-5.847,-17.191],[5.161,-27.311],[3.697,-5.791],[7.976,4.296],[2.472,2.623],[8.757,-7.37],[7.265,-23.415],[0,0],[1.098,-14.707]],"v":[[10.529,-153.462],[99.29,-80.695],[112.202,-67.885],[166.961,42.049],[-13.492,196.498],[-158.232,109.168],[-163.021,47.375],[-115.361,-74.925],[-96.079,-79.793],[-61.142,-11.415],[-45.144,-11.543],[-26.176,-53.345],[-13.567,-143.837],[-13.567,-143.837]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.3,"y":0},"t":21,"s":[{"i":[[-3.67,-2.118],[-20.562,-24.196],[-3.562,-5.077],[-2.787,-48.497],[142.588,10.94],[24.379,71.366],[-3.76,25.863],[-10.653,16.216],[-6.203,-3.632],[0,0],[-3.27,7.216],[-5.585,28.664],[-0.09,29.943],[0,0]],"o":[[35.342,20.398],[4.178,4.917],[36.23,51.639],[2.787,48.497],[-55.02,-4.221],[-6.676,-19.545],[4.644,-31.947],[3.326,-6.774],[9.351,7.886],[2.97,2.211],[8.361,-18.162],[5.394,-27.685],[0,0],[0.988,-17.204]],"v":[[4.506,-207.698],[88.362,-140.806],[99.981,-125.821],[148.528,14.173],[-12.126,194.909],[-142.303,88.588],[-146.679,20.473],[-110.852,-59.221],[-93.501,-64.915],[-58.731,-37.342],[-43.681,-38.644],[-22.734,-108.838],[-14.463,-195.328],[-14.463,-195.328]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.3,"y":0},"t":27,"s":[{"i":[[-4.126,-1.956],[-22.851,-23.363],[-3.8,-5.015],[-3.358,-46.81],[158.458,10.563],[22.243,73.867],[-4.178,24.972],[-22.858,40.127],[-6.894,-3.507],[-8.82,-10.568],[-4.148,3.747],[-7.324,26.661],[-0.1,28.912],[0,0]],"o":[[32.496,15.406],[4.643,4.747],[31.068,41.003],[3.698,51.55],[-61.144,-4.076],[-5.847,-19.417],[5.161,-30.847],[3.697,-6.541],[7.976,4.852],[2.472,2.962],[8.757,-8.324],[7.265,-26.446],[0,0],[1.098,-16.611]],"v":[[9.115,-181.312],[99.29,-117.797],[112.202,-103.328],[166.961,20.84],[-13.492,195.288],[-158.232,96.65],[-163.021,26.856],[-115.361,-111.28],[-96.079,-116.778],[-61.142,-39.546],[-45.144,-39.69],[-26.176,-86.905],[-14.981,-170.441],[-14.981,-170.441]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.3,"y":0},"t":33,"s":[{"i":[[-3.67,-2.118],[-20.562,-24.196],[-3.562,-5.077],[-2.787,-48.497],[142.588,10.94],[24.379,71.366],[-3.76,25.863],[-10.653,16.216],[-6.203,-3.632],[0,0],[-3.27,7.216],[-5.585,28.664],[-0.09,29.943],[0,0]],"o":[[35.342,20.398],[4.178,4.917],[36.23,51.639],[2.787,48.497],[-55.02,-4.221],[-6.676,-19.545],[4.644,-31.947],[3.326,-6.774],[9.351,7.886],[2.97,2.211],[8.361,-18.162],[5.394,-27.685],[0,0],[0.988,-17.204]],"v":[[4.506,-207.698],[88.362,-140.806],[99.981,-125.821],[148.528,14.173],[-12.126,194.909],[-142.303,88.588],[-146.679,20.473],[-110.852,-59.221],[-93.501,-64.915],[-58.731,-37.342],[-43.681,-38.644],[-22.734,-108.838],[-14.463,-195.328],[-14.463,-195.328]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.3,"y":0},"t":39,"s":[{"i":[[-4.126,-1.956],[-22.851,-23.363],[-3.8,-5.015],[-3.358,-46.81],[158.458,10.563],[22.243,73.867],[-4.178,24.972],[-22.858,40.127],[-6.894,-3.507],[-8.82,-10.568],[-4.148,3.747],[-7.324,26.661],[-0.1,28.912],[0,0]],"o":[[32.496,15.406],[4.643,4.747],[31.068,41.003],[3.698,51.55],[-61.144,-4.076],[-5.847,-19.417],[5.161,-30.847],[3.697,-6.541],[7.976,4.852],[2.472,2.962],[8.757,-8.324],[7.265,-26.446],[0,0],[1.098,-16.611]],"v":[[9.115,-181.312],[99.29,-117.797],[112.202,-103.328],[166.961,20.84],[-13.492,195.288],[-158.232,96.65],[-163.021,26.856],[-115.361,-111.28],[-96.079,-116.778],[-61.142,-39.546],[-45.144,-39.69],[-26.176,-86.905],[-14.981,-170.441],[-14.981,-170.441]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.3,"y":0},"t":45,"s":[{"i":[[-3.876,-2.053],[-21.728,-23.414],[-3.77,-4.909],[-2.945,-46.93],[150.67,10.64],[25.745,69.065],[-3.973,25.027],[-11.257,15.692],[-6.555,-3.515],[0,0],[-3.456,6.982],[-5.89,27.74],[-0.095,28.975],[0,0]],"o":[[37.346,19.739],[4.415,4.758],[38.285,49.97],[2.945,46.93],[-58.14,-4.085],[-7.055,-18.913],[4.908,-30.914],[3.515,-6.555],[9.881,7.631],[3.139,2.139],[8.835,-17.575],[5.7,-26.79],[0,0],[1.044,-16.648]],"v":[[4.737,-194.33],[93.348,-129.601],[105.626,-115.1],[156.926,20.37],[-12.839,195.265],[-150.398,92.38],[-155.022,26.466],[-117.164,-50.652],[-98.829,-56.162],[-62.086,-29.48],[-46.184,-30.74],[-24.048,-98.665],[-15.308,-182.36],[-15.308,-182.36]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.3,"y":0},"t":51,"s":[{"i":[[-4.441,-1.817],[-24.598,-21.698],[-4.09,-4.658],[-3.615,-43.474],[170.569,9.811],[23.943,68.603],[-4.498,23.193],[-24.605,37.267],[-7.421,-3.257],[-9.494,-9.815],[-4.465,3.48],[-7.884,24.761],[-0.108,26.852],[0,0]],"o":[[34.979,14.309],[4.998,4.409],[33.443,38.081],[3.981,47.877],[-65.817,-3.786],[-6.294,-18.033],[5.556,-28.649],[3.979,-6.075],[8.586,4.506],[2.661,2.751],[9.426,-7.731],[7.821,-24.562],[0,0],[1.182,-15.428]],"v":[[9.679,-153.722],[106.746,-94.733],[120.646,-81.295],[179.59,34.024],[-14.655,196.04],[-170.458,104.432],[-175.613,39.611],[-124.31,-88.681],[-103.554,-93.787],[-65.948,-22.058],[-48.727,-22.193],[-28.309,-66.043],[-16.258,-143.626],[-16.258,-143.626]],"c":true}]},{"t":59,"s":[{"i":[[-3.876,-2.053],[-21.728,-23.414],[-3.77,-4.909],[-2.945,-46.93],[150.67,10.64],[25.745,69.065],[-3.973,25.027],[-21.735,40.214],[-6.555,-3.515],[0,0],[-3.456,6.982],[-5.89,27.74],[-0.095,28.975],[0,0]],"o":[[37.346,19.739],[4.415,4.758],[38.285,49.97],[2.945,46.93],[-58.14,-4.085],[-7.055,-18.913],[4.908,-30.914],[3.515,-6.555],[7.584,4.863],[2.185,3.325],[8.835,-17.575],[5.7,-26.79],[0,0],[1.044,-16.648]],"v":[[4.737,-194.33],[93.348,-129.601],[105.626,-115.1],[156.926,20.37],[-12.839,195.265],[-150.398,92.38],[-155.022,26.466],[-115.058,-80.235],[-96.723,-85.745],[-58.533,-30.075],[-46.184,-30.74],[-24.048,-98.665],[-15.308,-182.36],[-15.308,-182.36]],"c":true}]}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Path-Copy-8","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]} \ No newline at end of file diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index b2fd0b1c06..00cab4e8e7 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -5562,18 +5562,14 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G if case .creator = group.role { canSetupAutoremoveTimeout = true } else if case let .admin(rights, _) = group.role { - if rights.flags.contains(.canChangeInfo) { - canSetupAutoremoveTimeout = true - } - } else if let defaultBannedRights = group.defaultBannedRights { - if !defaultBannedRights.flags.contains(.banChangeInfo) { + if rights.flags.contains(.canDeleteMessages) { canSetupAutoremoveTimeout = true } } } else if let _ = peer as? TelegramUser { canSetupAutoremoveTimeout = true } else if let channel = peer as? TelegramChannel { - if channel.hasPermission(.changeInfo) { + if channel.hasPermission(.deleteAllMessages) { canSetupAutoremoveTimeout = true } } @@ -7466,6 +7462,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G if let currentButton = self.leftNavigationButton?.action, currentButton == button.action { animated = false } + animated = false self.navigationItem.setLeftBarButton(button.buttonItem, animated: animated) self.leftNavigationButton = button } @@ -7713,7 +7710,9 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G ], parseMarkdown: true), in: .window(.root)) })) } else { - items.append(ActionSheetTextItem(title: text)) + if !isClearCache { + items.append(ActionSheetTextItem(title: text)) + } items.append(ActionSheetButtonItem(title: isClearCache ? self.presentationData.strings.Conversation_ClearCache : self.presentationData.strings.Conversation_ClearAll, color: isClearCache ? .accent : .destructive, action: { [weak self, weak actionSheet] in actionSheet?.dismissAnimated() @@ -7745,18 +7744,14 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G if case .creator = group.role { canSetupAutoremoveTimeout = true } else if case let .admin(rights, _) = group.role { - if rights.flags.contains(.canChangeInfo) { - canSetupAutoremoveTimeout = true - } - } else if let defaultBannedRights = group.defaultBannedRights { - if !defaultBannedRights.flags.contains(.banChangeInfo) { + if rights.flags.contains(.canDeleteMessages) { canSetupAutoremoveTimeout = true } } } else if let _ = self.presentationInterfaceState.renderedPeer?.peer as? TelegramUser { canSetupAutoremoveTimeout = true } else if let channel = self.presentationInterfaceState.renderedPeer?.peer as? TelegramChannel { - if channel.hasPermission(.changeInfo) { + if channel.hasPermission(.deleteAllMessages) { canSetupAutoremoveTimeout = true } } @@ -7771,10 +7766,6 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G return } - Queue.mainQueue().after(0.8, { - self?.updateChatPresentationInterfaceState(animated: false, interactive: false, { $0.updatedInterfaceState({ $0.withoutSelectionState() }) }) - }) - actionSheet.dismissAnimated() strongSelf.presentAutoremoveSetup() @@ -11940,18 +11931,27 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G return } + strongSelf.updateChatPresentationInterfaceState(animated: false, interactive: false, { $0.updatedInterfaceState({ $0.withoutSelectionState() }) }) + + var isOn: Bool = true + var title: String? var text: String? if let myValue = value.myValue { if let limitedByValue = value.limitedByValue, limitedByValue < myValue { + title = "Auto-Delete On — \(timeIntervalString(strings: strongSelf.presentationData.strings, value: limitedByValue))" text = "\(peer.compactDisplayTitle) has set messages to auto-delete in \(timeIntervalString(strings: strongSelf.presentationData.strings, value: limitedByValue)). You can't cancel it or make this interval longer." } else { text = strongSelf.presentationData.strings.Conversation_AutoremoveChanged("\(timeIntervalString(strings: strongSelf.presentationData.strings, value: myValue))").0 } } else if let limitedByValue = value.limitedByValue { + title = "Auto-Delete On — \(timeIntervalString(strings: strongSelf.presentationData.strings, value: limitedByValue))" text = "\(peer.compactDisplayTitle) has set messages to auto-delete in \(timeIntervalString(strings: strongSelf.presentationData.strings, value: limitedByValue)). You can't cancel it or make this interval longer." + } else { + isOn = false + text = "Auto-Delete is now off." } if let text = text { - strongSelf.present(UndoOverlayController(presentationData: strongSelf.presentationData, content: .succeed(text: text), elevatedLayout: false, action: { _ in return false }), in: .current) + strongSelf.present(UndoOverlayController(presentationData: strongSelf.presentationData, content: .autoDelete(isOn: isOn, title: title, text: text), elevatedLayout: false, action: { _ in return false }), in: .current) } } }) diff --git a/submodules/TelegramUI/Sources/ChatInterfaceInputContexts.swift b/submodules/TelegramUI/Sources/ChatInterfaceInputContexts.swift index f86ae19de5..b75b308074 100644 --- a/submodules/TelegramUI/Sources/ChatInterfaceInputContexts.swift +++ b/submodules/TelegramUI/Sources/ChatInterfaceInputContexts.swift @@ -242,18 +242,14 @@ func inputTextPanelStateForChatPresentationInterfaceState(_ chatPresentationInte if case .creator = group.role { canSetupAutoremoveTimeout = true } else if case let .admin(rights, _) = group.role { - if rights.flags.contains(.canChangeInfo) { - canSetupAutoremoveTimeout = true - } - } else if let defaultBannedRights = group.defaultBannedRights { - if !defaultBannedRights.flags.contains(.banChangeInfo) { + if rights.flags.contains(.canDeleteMessages) { canSetupAutoremoveTimeout = true } } } else if let _ = chatPresentationInterfaceState.renderedPeer?.peer as? TelegramUser { canSetupAutoremoveTimeout = true } else if let channel = chatPresentationInterfaceState.renderedPeer?.peer as? TelegramChannel { - if channel.hasPermission(.changeInfo) { + if channel.hasPermission(.deleteAllMessages) { canSetupAutoremoveTimeout = true } } @@ -285,7 +281,7 @@ func inputTextPanelStateForChatPresentationInterfaceState(_ chatPresentationInte if !extendedSearchLayout { if let peer = chatPresentationInterfaceState.renderedPeer?.peer as? TelegramSecretChat { accessoryItems.append(.messageAutoremoveTimeout(peer.messageAutoremoveTimeout)) - } else if currentAutoremoveTimeout != nil { + } else if currentAutoremoveTimeout != nil && chatPresentationInterfaceState.interfaceState.composeInputState.inputText.length == 0 { accessoryItems.append(.messageAutoremoveTimeout(currentAutoremoveTimeout)) } } diff --git a/submodules/TelegramUI/Sources/OpenUrl.swift b/submodules/TelegramUI/Sources/OpenUrl.swift index e85b6a7b6f..a27728c279 100644 --- a/submodules/TelegramUI/Sources/OpenUrl.swift +++ b/submodules/TelegramUI/Sources/OpenUrl.swift @@ -236,18 +236,21 @@ func openExternalUrlImpl(context: AccountContext, urlContext: OpenURLContext, ur if parsedUrl.host == "localpeer" { if let components = URLComponents(string: "/?" + query) { var peerId: PeerId? + var accountId: Int64? if let queryItems = components.queryItems { for queryItem in queryItems { if let value = queryItem.value { if queryItem.name == "id", let intValue = Int64(value) { peerId = PeerId(intValue) + } else if queryItem.name == "accountId", let intValue = Int64(value) { + accountId = intValue } } } } - if let peerId = peerId, let navigationController = navigationController { + if let peerId = peerId, let accountId = accountId { context.sharedContext.applicationBindings.dismissNativeController() - context.sharedContext.navigateToChatController(NavigateToChatControllerParams(navigationController: navigationController, context: context, chatLocation: .peer(peerId))) + context.sharedContext.navigateToChat(accountId: AccountRecordId(rawValue: accountId), peerId: peerId, messageId: nil) } } } else if parsedUrl.host == "join" { diff --git a/submodules/UndoUI/Sources/UndoOverlayController.swift b/submodules/UndoUI/Sources/UndoOverlayController.swift index b74e02921d..d365606195 100644 --- a/submodules/UndoUI/Sources/UndoOverlayController.swift +++ b/submodules/UndoUI/Sources/UndoOverlayController.swift @@ -29,6 +29,7 @@ public enum UndoOverlayContent { case importedMessage(text: String) case audioRate(slowdown: Bool, text: String) case forward(savedMessages: Bool, text: String) + case autoDelete(isOn: Bool, title: String?, text: String) } public enum UndoOverlayAction { diff --git a/submodules/UndoUI/Sources/UndoOverlayControllerNode.swift b/submodules/UndoUI/Sources/UndoOverlayControllerNode.swift index 49afa599b1..7ce7123882 100644 --- a/submodules/UndoUI/Sources/UndoOverlayControllerNode.swift +++ b/submodules/UndoUI/Sources/UndoOverlayControllerNode.swift @@ -136,6 +136,18 @@ final class UndoOverlayControllerNode: ViewControllerTracingNode { self.textNode.attributedText = NSAttributedString(string: text, font: Font.regular(14.0), textColor: .white) displayUndo = undo self.originalRemainingSeconds = 3 + case let .autoDelete(isOn, title, text): + self.avatarNode = nil + self.iconNode = nil + self.iconCheckNode = nil + self.animationNode = AnimationNode(animation: isOn ? "anim_autoremove_on" : "anim_autoremove_off", colors: ["info1.info1.stroke": self.animationBackgroundColor, "info2.info2.Fill": self.animationBackgroundColor], scale: 1.0) + self.animatedStickerNode = nil + if let title = title { + self.titleNode.attributedText = NSAttributedString(string: title, font: Font.semibold(14.0), textColor: .white) + } + self.textNode.attributedText = NSAttributedString(string: text, font: Font.regular(14.0), textColor: .white) + displayUndo = false + self.originalRemainingSeconds = 3 case let .succeed(text): self.avatarNode = nil self.iconNode = nil @@ -537,7 +549,7 @@ final class UndoOverlayControllerNode: ViewControllerTracingNode { switch content { case .removedChat: self.panelWrapperNode.addSubnode(self.timerTextNode) - case .archivedChat, .hidArchive, .revealedArchive, .succeed, .emoji, .swipeToReply, .actionSucceeded, .stickersModified, .chatAddedToFolder, .chatRemovedFromFolder, .messagesUnpinned, .setProximityAlert, .invitedToVoiceChat, .linkCopied, .banned, .importedMessage, .audioRate, .forward: + case .archivedChat, .hidArchive, .revealedArchive, .autoDelete, .succeed, .emoji, .swipeToReply, .actionSucceeded, .stickersModified, .chatAddedToFolder, .chatRemovedFromFolder, .messagesUnpinned, .setProximityAlert, .invitedToVoiceChat, .linkCopied, .banned, .importedMessage, .audioRate, .forward: break case .dice: self.panelWrapperNode.clipsToBounds = true @@ -655,6 +667,9 @@ final class UndoOverlayControllerNode: ViewControllerTracingNode { } else if case .banned = self.content { let factor: CGFloat = 0.08 preferredSize = CGSize(width: floor(iconSize.width * factor), height: floor(iconSize.height * factor)) + } else if case .autoDelete = self.content { + let factor: CGFloat = 0.06 + preferredSize = CGSize(width: floor(iconSize.width * factor), height: floor(iconSize.height * factor)) } else { preferredSize = iconSize }