From 6ce9cb6c416a457cf186551951e06aaa0c0cfbe9 Mon Sep 17 00:00:00 2001 From: overtake <> Date: Thu, 16 Apr 2020 22:49:39 +0400 Subject: [PATCH 1/3] fix typo [skip ci] --- .../TelegramCore/Sources/PendingMessageUploadedContent.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/submodules/TelegramCore/Sources/PendingMessageUploadedContent.swift b/submodules/TelegramCore/Sources/PendingMessageUploadedContent.swift index 2634addfe3..7bbc7ab7f9 100644 --- a/submodules/TelegramCore/Sources/PendingMessageUploadedContent.swift +++ b/submodules/TelegramCore/Sources/PendingMessageUploadedContent.swift @@ -187,8 +187,8 @@ func mediaContentToUpload(network: Network, postbox: Postbox, auxiliaryMethods: } let inputPoll = Api.InputMedia.inputMediaPoll(flags: pollMediaFlags, poll: Api.Poll.poll(id: 0, flags: pollFlags, question: poll.text, answers: poll.options.map({ $0.apiOption }), closePeriod: poll.deadlineTimeout, closeDate: nil), correctAnswers: correctAnswers, solution: mappedSolution, solutionEntities: mappedSolutionEntities) return .single(.content(PendingMessageUploadedContentAndReuploadInfo(content: .media(inputPoll, text), reuploadInfo: nil))) - } else if let _ = media as? TelegramMediaDice { - let input = Api.InputMedia.inputMediaDice + } else if let media = media as? TelegramMediaDice { + let input = Api.InputMedia.inputMediaDice(emoticon: media.emoji) return .single(.content(PendingMessageUploadedContentAndReuploadInfo(content: .media(input, text), reuploadInfo: nil))) } else { return nil From 885000d9ea4796b4b2fab1c62c50083b778a7891 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Thu, 16 Apr 2020 23:12:04 +0400 Subject: [PATCH 2/3] Don't hide trending panel when no unread packs exist --- .../TelegramUI/Sources/ChatMediaInputNode.swift | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/submodules/TelegramUI/Sources/ChatMediaInputNode.swift b/submodules/TelegramUI/Sources/ChatMediaInputNode.swift index cf7e3b573c..f0bf594d35 100644 --- a/submodules/TelegramUI/Sources/ChatMediaInputNode.swift +++ b/submodules/TelegramUI/Sources/ChatMediaInputNode.swift @@ -796,14 +796,12 @@ final class ChatMediaInputNode: ChatInputNode { var hasUnreadTrending: Bool? for pack in trendingPacks { - if !installedPacks.contains(pack.info.id) { - if hasUnreadTrending == nil { - hasUnreadTrending = false - } - if pack.unread { - hasUnreadTrending = true - break - } + if hasUnreadTrending == nil { + hasUnreadTrending = false + } + if pack.unread { + hasUnreadTrending = true + break } } From 6b80ad7b31c9dd035b37ebb2f0c793c092c95dcc Mon Sep 17 00:00:00 2001 From: Ali <> Date: Thu, 16 Apr 2020 23:21:17 +0400 Subject: [PATCH 3/3] Fix build --- submodules/TelegramUI/Sources/ChatControllerNode.swift | 2 +- submodules/TelegramUI/Sources/ChatHistoryListNode.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/submodules/TelegramUI/Sources/ChatControllerNode.swift b/submodules/TelegramUI/Sources/ChatControllerNode.swift index bccf062bc7..6d1fc7153f 100644 --- a/submodules/TelegramUI/Sources/ChatControllerNode.swift +++ b/submodules/TelegramUI/Sources/ChatControllerNode.swift @@ -2261,7 +2261,7 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate { let effectiveInputText = effectivePresentationInterfaceState.interfaceState.composeInputState.inputText if case let .peer(peerId) = effectivePresentationInterfaceState.chatLocation, peerId.namespace != Namespaces.Peer.SecretChat, effectiveInputText.string.trimmingCharacters(in: .whitespacesAndNewlines) == "🎲" { - messages.append(.message(text: "", attributes: [], mediaReference: AnyMediaReference.standalone(media: TelegramMediaDice()), replyToMessageId: self.chatPresentationInterfaceState.interfaceState.replyMessageId, localGroupingKey: nil)) + messages.append(.message(text: "", attributes: [], mediaReference: AnyMediaReference.standalone(media: TelegramMediaDice(emoji: "🎲")), replyToMessageId: self.chatPresentationInterfaceState.interfaceState.replyMessageId, localGroupingKey: nil)) } else { let inputText = convertMarkdownToAttributes(effectiveInputText) diff --git a/submodules/TelegramUI/Sources/ChatHistoryListNode.swift b/submodules/TelegramUI/Sources/ChatHistoryListNode.swift index ffbddae509..f8e76c0191 100644 --- a/submodules/TelegramUI/Sources/ChatHistoryListNode.swift +++ b/submodules/TelegramUI/Sources/ChatHistoryListNode.swift @@ -614,7 +614,7 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode { } |> distinctUntilChanged - let animatedEmojiStickers = combineLatest(loadedStickerPack(postbox: context.account.postbox, network: context.account.network, reference: .animatedEmoji, forceActualized: false), loadedStickerPack(postbox: context.account.postbox, network: context.account.network, reference: .dice, forceActualized: false)) + let animatedEmojiStickers = combineLatest(loadedStickerPack(postbox: context.account.postbox, network: context.account.network, reference: .animatedEmoji, forceActualized: false), loadedStickerPack(postbox: context.account.postbox, network: context.account.network, reference: .dice("🎲"), forceActualized: false)) |> map { animatedEmoji, dice -> [String: [StickerPackItem]] in var animatedEmojiStickers: [String: [StickerPackItem]] = [:] switch animatedEmoji {