mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Screen sharing in 1-to-1 calls
This commit is contained in:
@@ -720,19 +720,19 @@ private func settingsItems(data: PeerInfoScreenData?, context: AccountContext, p
|
||||
}
|
||||
|
||||
if !settings.accountsAndPeers.isEmpty {
|
||||
for (peerAccount, peer, badgeCount) in settings.accountsAndPeers {
|
||||
for (peerAccountContext, peer, badgeCount) in settings.accountsAndPeers {
|
||||
let member: PeerInfoMember = .account(peer: RenderedPeer(peer: peer))
|
||||
items[.accounts]!.append(PeerInfoScreenMemberItem(id: member.id, context: context.sharedContext.makeTempAccountContext(account: peerAccount), enclosingPeer: nil, member: member, badge: badgeCount > 0 ? "\(compactNumericCountString(Int(badgeCount), decimalSeparator: presentationData.dateTimeFormat.decimalSeparator))" : nil, action: { action in
|
||||
items[.accounts]!.append(PeerInfoScreenMemberItem(id: member.id, context: context.sharedContext.makeTempAccountContext(account: peerAccountContext.account), enclosingPeer: nil, member: member, badge: badgeCount > 0 ? "\(compactNumericCountString(Int(badgeCount), decimalSeparator: presentationData.dateTimeFormat.decimalSeparator))" : nil, action: { action in
|
||||
switch action {
|
||||
case .open:
|
||||
interaction.switchToAccount(peerAccount.id)
|
||||
interaction.switchToAccount(peerAccountContext.account.id)
|
||||
case .remove:
|
||||
interaction.logoutAccount(peerAccount.id)
|
||||
interaction.logoutAccount(peerAccountContext.account.id)
|
||||
default:
|
||||
break
|
||||
}
|
||||
}, contextAction: { node, gesture in
|
||||
interaction.accountContextMenu(peerAccount.id, node, gesture)
|
||||
interaction.accountContextMenu(peerAccountContext.account.id, node, gesture)
|
||||
}))
|
||||
}
|
||||
if settings.accountsAndPeers.count + 1 < maximumNumberOfAccounts {
|
||||
@@ -1549,7 +1549,7 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD
|
||||
|
||||
private let displayAsPeersPromise = Promise<[FoundPeer]>([])
|
||||
|
||||
fileprivate let accountsAndPeers = Promise<[(Account, Peer, Int32)]>()
|
||||
fileprivate let accountsAndPeers = Promise<[(AccountContext, Peer, Int32)]>()
|
||||
fileprivate let activeSessionsContextAndCount = Promise<(ActiveSessionsContext, Int, WebSessionsContext)?>()
|
||||
private let notificationExceptions = Promise<NotificationExceptionsList?>()
|
||||
private let privacySettings = Promise<AccountPrivacySettings?>()
|
||||
@@ -5559,8 +5559,8 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD
|
||||
|> take(1)
|
||||
|> deliverOnMainQueue).start(next: { accountsAndPeers in
|
||||
for (account, _, _) in accountsAndPeers {
|
||||
if account.id == id {
|
||||
selectedAccount = account
|
||||
if account.account.id == id {
|
||||
selectedAccount = account.account
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -6450,8 +6450,8 @@ public final class PeerInfoScreenImpl: ViewController, PeerInfoScreen {
|
||||
private var presentationData: PresentationData
|
||||
private var presentationDataDisposable: Disposable?
|
||||
|
||||
private let accountsAndPeers = Promise<((Account, Peer)?, [(Account, Peer, Int32)])>()
|
||||
private var accountsAndPeersValue: ((Account, Peer)?, [(Account, Peer, Int32)])?
|
||||
private let accountsAndPeers = Promise<((AccountContext, Peer)?, [(AccountContext, Peer, Int32)])>()
|
||||
private var accountsAndPeersValue: ((AccountContext, Peer)?, [(AccountContext, Peer, Int32)])?
|
||||
private var accountsAndPeersDisposable: Disposable?
|
||||
|
||||
private let activeSessionsContextAndCount = Promise<(ActiveSessionsContext, Int, WebSessionsContext)?>(nil)
|
||||
@@ -6545,7 +6545,7 @@ public final class PeerInfoScreenImpl: ViewController, PeerInfoScreen {
|
||||
let accountTabBarAvatar: Signal<(UIImage, UIImage)?, NoError> = combineLatest(self.accountsAndPeers.get(), context.sharedContext.presentationData)
|
||||
|> map { primaryAndOther, presentationData -> (Account, Peer, PresentationTheme)? in
|
||||
if let primary = primaryAndOther.0, !primaryAndOther.1.isEmpty {
|
||||
return (primary.0, primary.1, presentationData.theme)
|
||||
return (primary.0.account, primary.1, presentationData.theme)
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
@@ -6811,7 +6811,7 @@ public final class PeerInfoScreenImpl: ViewController, PeerInfoScreen {
|
||||
|
||||
let avatarSize = CGSize(width: 28.0, height: 28.0)
|
||||
|
||||
items.append(.action(ContextMenuActionItem(text: primary.1.displayTitle(strings: strings, displayOrder: presentationData.nameDisplayOrder), icon: { _ in nil }, iconSource: ContextMenuActionItemIconSource(size: avatarSize, signal: peerAvatarCompleteImage(account: primary.0, peer: primary.1, size: avatarSize)), action: { _, f in
|
||||
items.append(.action(ContextMenuActionItem(text: primary.1.displayTitle(strings: strings, displayOrder: presentationData.nameDisplayOrder), icon: { _ in nil }, iconSource: ContextMenuActionItemIconSource(size: avatarSize, signal: peerAvatarCompleteImage(account: primary.0.account, peer: primary.1, size: avatarSize)), action: { _, f in
|
||||
f(.default)
|
||||
})))
|
||||
|
||||
@@ -6820,8 +6820,8 @@ public final class PeerInfoScreenImpl: ViewController, PeerInfoScreen {
|
||||
}
|
||||
|
||||
for account in other {
|
||||
let id = account.0.id
|
||||
items.append(.action(ContextMenuActionItem(text: account.1.displayTitle(strings: strings, displayOrder: presentationData.nameDisplayOrder), badge: account.2 != 0 ? ContextMenuActionBadge(value: "\(account.2)", color: .accent) : nil, icon: { _ in nil }, iconSource: ContextMenuActionItemIconSource(size: avatarSize, signal: peerAvatarCompleteImage(account: account.0, peer: account.1, size: avatarSize)), action: { [weak self] _, f in
|
||||
let id = account.0.account.id
|
||||
items.append(.action(ContextMenuActionItem(text: account.1.displayTitle(strings: strings, displayOrder: presentationData.nameDisplayOrder), badge: account.2 != 0 ? ContextMenuActionBadge(value: "\(account.2)", color: .accent) : nil, icon: { _ in nil }, iconSource: ContextMenuActionItemIconSource(size: avatarSize, signal: peerAvatarCompleteImage(account: account.0.account, peer: account.1, size: avatarSize)), action: { [weak self] _, f in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
@@ -6830,7 +6830,7 @@ public final class PeerInfoScreenImpl: ViewController, PeerInfoScreen {
|
||||
})))
|
||||
}
|
||||
|
||||
let controller = ContextController(account: primary.0, presentationData: self.presentationData, source: .extracted(SettingsTabBarContextExtractedContentSource(controller: self, sourceNode: sourceNode)), items: .single(items), reactionItems: [], recognizer: nil, gesture: gesture)
|
||||
let controller = ContextController(account: primary.0.account, presentationData: self.presentationData, source: .extracted(SettingsTabBarContextExtractedContentSource(controller: self, sourceNode: sourceNode)), items: .single(items), reactionItems: [], recognizer: nil, gesture: gesture)
|
||||
self.context.sharedContext.mainWindow?.presentInGlobalOverlay(controller)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user