[WIP] Reaction UI improvements

This commit is contained in:
Ali
2022-09-14 00:03:32 +04:00
parent 8fe1e77376
commit ab76f8b02a
40 changed files with 1321 additions and 298 deletions

View File

@@ -91,13 +91,11 @@ func _internal_channelMembers(postbox: Postbox, network: Network, accountPeerId:
switch result {
case let .channelParticipants(_, participants, chats, users):
var peers: [PeerId: Peer] = [:]
var presences: [PeerId: PeerPresence] = [:]
var presences: [PeerId: Api.User] = [:]
for user in users {
let peer = TelegramUser(user: user)
peers[peer.id] = peer
if let presence = TelegramUserPresence(apiUser: user) {
presences[peer.id] = presence
}
presences[peer.id] = user
}
for chat in chats {
if let groupOrChannel = parseTelegramGroupOrChannel(chat: chat) {
@@ -111,7 +109,11 @@ func _internal_channelMembers(postbox: Postbox, network: Network, accountPeerId:
for participant in CachedChannelParticipants(apiParticipants: participants).participants {
if let peer = peers[participant.peerId] {
items.append(RenderedChannelParticipant(participant: participant, peer: peer, peers: peers, presences: presences))
var renderedPresences: [PeerId: PeerPresence] = [:]
if let presence = transaction.getPeerPresence(peerId: participant.peerId) {
renderedPresences[participant.peerId] = presence
}
items.append(RenderedChannelParticipant(participant: participant, peer: peer, peers: peers, presences: renderedPresences))
}
}
case .channelParticipantsNotModified: