Story location picking

This commit is contained in:
Ilya Laktyushin
2023-07-30 15:01:25 +02:00
parent b3146436dc
commit b70586eb28
43 changed files with 2397 additions and 133 deletions

View File

@@ -1326,7 +1326,7 @@ private func finalStateWithUpdatesAndServerTime(accountPeerId: PeerId, postbox:
channelsToPoll[peerId] = nil
}
}
case let .updatePeerBlocked(peerId, blocked):
case let .updatePeerBlocked(flags, peerId):
let userPeerId = peerId.peerId
updatedState.updateCachedPeerData(userPeerId, { current in
let previous: CachedUserData
@@ -1335,7 +1335,13 @@ private func finalStateWithUpdatesAndServerTime(accountPeerId: PeerId, postbox:
} else {
previous = CachedUserData()
}
return previous.withUpdatedIsBlocked(blocked == .boolTrue)
var userFlags = previous.flags
if (flags & (1 << 1)) != 0 {
userFlags.insert(.isBlockedFromMyStories)
} else {
userFlags.remove(.isBlockedFromMyStories)
}
return previous.withUpdatedIsBlocked((flags & (1 << 0)) != 0).withUpdatedFlags(userFlags)
})
case let .updateUserStatus(userId, status):
updatedState.mergePeerPresences([PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(userId)): status], explicit: true)