Merge commit '5fb5c433bcd9c6b96f91f3ff25e3cec296906eed' into postbox-refactoring-1

This commit is contained in:
Ali
2021-09-13 20:40:18 +04:00
8 changed files with 63 additions and 31 deletions

View File

@@ -1254,7 +1254,7 @@ private func finalStateWithUpdatesAndServerTime(postbox: Postbox, network: Netwo
updatedState.readSecretOutbox(peerId: PeerId(namespace: Namespaces.Peer.SecretChat, id: PeerId.Id._internalFromInt64Value(Int64(chatId))), timestamp: maxDate, actionTimestamp: date)
case let .updateUserTyping(userId, type):
if let date = updatesDate, date + 60 > serverTime {
let activity = PeerInputActivity(apiType: type, timestamp: date)
let activity = PeerInputActivity(apiType: type, peerId: PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(userId)), timestamp: date)
var category: PeerActivitySpace.Category = .global
if case .speakingInGroupCall = activity {
category = .voiceChat
@@ -1264,7 +1264,7 @@ private func finalStateWithUpdatesAndServerTime(postbox: Postbox, network: Netwo
}
case let .updateChatUserTyping(chatId, userId, type):
if let date = updatesDate, date + 60 > serverTime {
let activity = PeerInputActivity(apiType: type, timestamp: date)
let activity = PeerInputActivity(apiType: type, peerId: nil, timestamp: date)
var category: PeerActivitySpace.Category = .global
if case .speakingInGroupCall = activity {
category = .voiceChat
@@ -1277,7 +1277,7 @@ private func finalStateWithUpdatesAndServerTime(postbox: Postbox, network: Netwo
let channelPeerId = PeerId(namespace: Namespaces.Peer.CloudChannel, id: PeerId.Id._internalFromInt64Value(channelId))
let threadId = topMsgId.flatMap { makeMessageThreadId(MessageId(peerId: channelPeerId, namespace: Namespaces.Message.Cloud, id: $0)) }
let activity = PeerInputActivity(apiType: type, timestamp: date)
let activity = PeerInputActivity(apiType: type, peerId: nil, timestamp: date)
var category: PeerActivitySpace.Category = .global
if case .speakingInGroupCall = activity {
category = .voiceChat