mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
[WIP] Stories
This commit is contained in:
@@ -579,6 +579,24 @@ private class AdMessagesHistoryContextImpl {
|
||||
}
|
||||
self.maskAsSeenDisposables.set(signal.start(), forKey: opaqueId)
|
||||
}
|
||||
|
||||
func markAction(opaqueId: Data) {
|
||||
let account = self.account
|
||||
let signal: Signal<Never, NoError> = account.postbox.transaction { transaction -> Api.InputChannel? in
|
||||
return transaction.getPeer(self.peerId).flatMap(apiInputChannel)
|
||||
}
|
||||
|> mapToSignal { inputChannel -> Signal<Never, NoError> in
|
||||
guard let inputChannel = inputChannel else {
|
||||
return .complete()
|
||||
}
|
||||
return account.network.request(Api.functions.channels.clickSponsoredMessage(channel: inputChannel, randomId: Buffer(data: opaqueId)))
|
||||
|> `catch` { _ -> Signal<Api.Bool, NoError> in
|
||||
return .single(.boolFalse)
|
||||
}
|
||||
|> ignoreValues
|
||||
}
|
||||
let _ = signal.start()
|
||||
}
|
||||
}
|
||||
|
||||
public class AdMessagesHistoryContext {
|
||||
@@ -612,4 +630,10 @@ public class AdMessagesHistoryContext {
|
||||
impl.markAsSeen(opaqueId: opaqueId)
|
||||
}
|
||||
}
|
||||
|
||||
public func markAction(opaqueId: Data) {
|
||||
self.impl.with { impl in
|
||||
impl.markAction(opaqueId: opaqueId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user