From ec3fcf43d2b99dce537fdeee1391aad62c9c97f4 Mon Sep 17 00:00:00 2001 From: overtake Date: Wed, 1 Mar 2017 01:21:47 +0300 Subject: [PATCH] stickers --- TelegramCore/EnqueueMessage.swift | 8 +++++++- TelegramCore/StickerSetInstallation.swift | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/TelegramCore/EnqueueMessage.swift b/TelegramCore/EnqueueMessage.swift index 52e84d666c..b9068a1b8b 100644 --- a/TelegramCore/EnqueueMessage.swift +++ b/TelegramCore/EnqueueMessage.swift @@ -118,7 +118,13 @@ func enqueueMessages(modifier: Modifier, account: Account, peerId: PeerId, messa if let sourceForwardInfo = sourceMessage.forwardInfo { forwardInfo = StoreMessageForwardInfo(authorId: sourceForwardInfo.author.id, sourceId: sourceForwardInfo.source?.id, sourceMessageId: sourceForwardInfo.sourceMessageId, date: sourceForwardInfo.date) } else { - forwardInfo = StoreMessageForwardInfo(authorId: author.id, sourceId: nil, sourceMessageId: nil, date: sourceMessage.timestamp) + var sourceId:PeerId? = nil + var sourceMessageId:MessageId? = nil + if let peer = messageMainPeer(sourceMessage) as? TelegramChannel, case .broadcast = peer.info { + sourceId = peer.id + sourceMessageId = sourceMessage.id + } + forwardInfo = StoreMessageForwardInfo(authorId: author.id, sourceId: sourceId, sourceMessageId: sourceMessageId, date: sourceMessage.timestamp) } storeMessages.append(StoreMessage(peerId: peerId, namespace: Namespaces.Message.Local, globallyUniqueId: randomId, timestamp: timestamp, flags: flags, tags: tagsForStoreMessage(sourceMessage.media), forwardInfo: forwardInfo, authorId: account.peerId, text: sourceMessage.text, attributes: attributes, media: sourceMessage.media)) } diff --git a/TelegramCore/StickerSetInstallation.swift b/TelegramCore/StickerSetInstallation.swift index 3c3cac92d7..f8ee12d645 100644 --- a/TelegramCore/StickerSetInstallation.swift +++ b/TelegramCore/StickerSetInstallation.swift @@ -214,8 +214,7 @@ public func installStickerSetInteractively(account:Account, info: StickerPackCol public func uninstallStickerSetInteractively(account:Account, info:StickerPackCollectionInfo) -> Signal { return account.network.request(Api.functions.messages.uninstallStickerSet(stickerset: .inputStickerSetID(id: info.id.id, accessHash: info.accessHash))) |> mapError {_ in - var bp:Int = 0 - bp += 1 + } |> mapToSignal { result-> Signal in switch result {