Don't display the only group in common if opened from the same group

This commit is contained in:
Ali
2020-03-01 23:39:32 +04:00
parent 171f4a76e9
commit 9fb963e3a6
5 changed files with 34 additions and 17 deletions

View File

@@ -7172,7 +7172,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
} else {
if let peerId = peerId {
switch self.chatLocation {
case .peer:
case let .peer(selfPeerId):
switch navigation {
case .info:
let peerSignal: Signal<Peer?, NoError>
@@ -7183,7 +7183,11 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
}
self.navigationActionDisposable.set((peerSignal |> take(1) |> deliverOnMainQueue).start(next: { [weak self] peer in
if let strongSelf = self, let peer = peer {
if let infoController = strongSelf.context.sharedContext.makePeerInfoController(context: strongSelf.context, peer: peer, mode: .generic, avatarInitiallyExpanded: expandAvatar, fromChat: false) {
var mode: PeerInfoControllerMode = .generic
if let _ = fromMessage {
mode = .group(selfPeerId)
}
if let infoController = strongSelf.context.sharedContext.makePeerInfoController(context: strongSelf.context, peer: peer, mode: mode, avatarInitiallyExpanded: expandAvatar, fromChat: false) {
strongSelf.effectiveNavigationController?.pushViewController(infoController)
}
}