Send choosing sticker activity

This commit is contained in:
Ilya Laktyushin
2021-08-25 18:30:43 +03:00
parent 6e1b35a2e3
commit 9d265ef420
4 changed files with 53 additions and 1 deletions

View File

@@ -340,6 +340,8 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
private let recordingActivityPromise = ValuePromise<ChatRecordingActivity>(.none, ignoreRepeated: true)
private var recordingActivityDisposable: Disposable?
private var acquiredRecordingActivityDisposable: Disposable?
private let choosingStickerActivityPromise = Promise<Bool>(false)
private var choosingStickerActivityDisposable: Disposable?
private var searchDisposable: MetaDisposable?
@@ -3821,6 +3823,13 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
}
})
self.choosingStickerActivityDisposable = (self.choosingStickerActivityPromise.get()
|> deliverOnMainQueue).start(next: { [weak self] value in
if let strongSelf = self {
strongSelf.context.account.updateLocalInputActivity(peerId: activitySpace, activity: .choosingSticker, isPresent: value)
}
})
self.recordingActivityDisposable = (self.recordingActivityPromise.get()
|> deliverOnMainQueue).start(next: { [weak self] value in
if let strongSelf = self {
@@ -4400,6 +4409,8 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
self.chatDisplayNode.historyNode.voicePlaylistItemChanged(nil, currentItem)
}
self.choosingStickerActivityPromise.set(self.chatDisplayNode.choosingSticker)
self.chatDisplayNode.historyNode.didScrollWithOffset = { [weak self] offset, transition, itemNode in
guard let strongSelf = self else {
return