Refactoring

This commit is contained in:
Ali
2022-05-27 22:33:40 +04:00
parent e69e0a33dd
commit 3edd84cf95
11 changed files with 116 additions and 41 deletions

View File

@@ -498,11 +498,9 @@ func openExternalUrlImpl(context: AccountContext, urlContext: OpenURLContext, ur
}
if let id = id, !id.isEmpty, let idValue = Int64(id), idValue > 0 {
let _ = (context.account.postbox.transaction { transaction -> Peer? in
return transaction.getPeer(PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(idValue)))
}
let _ = (context.engine.data.get(TelegramEngine.EngineData.Item.Peer.Peer(id: PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(idValue))))
|> deliverOnMainQueue).start(next: { peer in
if let peer = peer, let controller = context.sharedContext.makePeerInfoController(context: context, updatedPresentationData: nil, peer: peer, mode: .generic, avatarInitiallyExpanded: false, fromChat: false, requestsContext: nil) {
if let peer = peer, let controller = context.sharedContext.makePeerInfoController(context: context, updatedPresentationData: nil, peer: peer._asPeer(), mode: .generic, avatarInitiallyExpanded: false, fromChat: false, requestsContext: nil) {
navigationController?.pushViewController(controller)
}
})