mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Conference update
This commit is contained in:
parent
0a499f4e2b
commit
157692bc48
@ -658,6 +658,8 @@ public final class PresentationCallImpl: PresentationCall {
|
|||||||
self.sharedAudioContext = nil
|
self.sharedAudioContext = nil
|
||||||
self.sessionState = nil
|
self.sessionState = nil
|
||||||
self.callContextState = nil
|
self.callContextState = nil
|
||||||
|
let debugLogValue = Promise<String?>()
|
||||||
|
self.ongoingContext?.stop(sendDebugLogs: false, debugLogValue: debugLogValue)
|
||||||
self.ongoingContext = nil
|
self.ongoingContext = nil
|
||||||
self.ongoingContextStateDisposable?.dispose()
|
self.ongoingContextStateDisposable?.dispose()
|
||||||
self.ongoingContextStateDisposable = nil
|
self.ongoingContextStateDisposable = nil
|
||||||
|
@ -973,10 +973,6 @@ public final class PresentationCallManagerImpl: PresentationCallManager {
|
|||||||
return .joined
|
return .joined
|
||||||
}
|
}
|
||||||
|
|
||||||
public func switchToConference(call: PresentationCall) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private func startGroupCall(
|
private func startGroupCall(
|
||||||
accountContext: AccountContext,
|
accountContext: AccountContext,
|
||||||
peerId: PeerId,
|
peerId: PeerId,
|
||||||
|
@ -5,6 +5,7 @@ import ComponentFlow
|
|||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import LottieComponent
|
import LottieComponent
|
||||||
|
import BundleIconComponent
|
||||||
|
|
||||||
final class VideoChatParticipantStatusComponent: Component {
|
final class VideoChatParticipantStatusComponent: Component {
|
||||||
let muteState: GroupCallParticipantsContext.Participant.MuteState?
|
let muteState: GroupCallParticipantsContext.Participant.MuteState?
|
||||||
@ -222,3 +223,74 @@ final class VideoChatParticipantStatusComponent: Component {
|
|||||||
return view.update(component: self, availableSize: availableSize, state: state, environment: environment, transition: transition)
|
return view.update(component: self, availableSize: availableSize, state: state, environment: environment, transition: transition)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final class VideoChatParticipantInvitedStatusComponent: Component {
|
||||||
|
let theme: PresentationTheme
|
||||||
|
|
||||||
|
init(theme: PresentationTheme) {
|
||||||
|
self.theme = theme
|
||||||
|
}
|
||||||
|
|
||||||
|
static func ==(lhs: VideoChatParticipantInvitedStatusComponent, rhs: VideoChatParticipantInvitedStatusComponent) -> Bool {
|
||||||
|
if lhs.theme !== rhs.theme {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
final class View: UIView {
|
||||||
|
private var icon = ComponentView<Empty>()
|
||||||
|
|
||||||
|
private var component: VideoChatParticipantInvitedStatusComponent?
|
||||||
|
private var isUpdating: Bool = false
|
||||||
|
|
||||||
|
override init(frame: CGRect) {
|
||||||
|
super.init(frame: frame)
|
||||||
|
}
|
||||||
|
|
||||||
|
required init?(coder: NSCoder) {
|
||||||
|
fatalError("init(coder:) has not been implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
deinit {
|
||||||
|
}
|
||||||
|
|
||||||
|
func update(component: VideoChatParticipantInvitedStatusComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment<Empty>, transition: ComponentTransition) -> CGSize {
|
||||||
|
self.isUpdating = true
|
||||||
|
defer {
|
||||||
|
self.isUpdating = false
|
||||||
|
}
|
||||||
|
|
||||||
|
let size = CGSize(width: 44.0, height: 44.0)
|
||||||
|
|
||||||
|
let iconTintColor = UIColor(white: 1.0, alpha: 0.4)
|
||||||
|
let iconSize = self.icon.update(
|
||||||
|
transition: transition,
|
||||||
|
component: AnyComponent(BundleIconComponent(
|
||||||
|
name: "Call/GroupPeerInvited",
|
||||||
|
tintColor: iconTintColor
|
||||||
|
)),
|
||||||
|
environment: {},
|
||||||
|
containerSize: size
|
||||||
|
)
|
||||||
|
|
||||||
|
let iconFrame = CGRect(origin: CGPoint(x: floor((size.width - iconSize.width) * 0.5) - 2.0, y: floor((size.height - iconSize.height) * 0.5)), size: iconSize)
|
||||||
|
if let iconView = self.icon.view {
|
||||||
|
if iconView.superview == nil {
|
||||||
|
self.addSubview(iconView)
|
||||||
|
}
|
||||||
|
transition.setFrame(view: iconView, frame: iconFrame)
|
||||||
|
}
|
||||||
|
|
||||||
|
return size
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeView() -> View {
|
||||||
|
return View()
|
||||||
|
}
|
||||||
|
|
||||||
|
func update(view: View, availableSize: CGSize, state: EmptyComponentState, environment: Environment<Empty>, transition: ComponentTransition) -> CGSize {
|
||||||
|
return view.update(component: self, availableSize: availableSize, state: state, environment: environment, transition: transition)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1258,7 +1258,7 @@ final class VideoChatParticipantsComponent: Component {
|
|||||||
subtitle: subtitle,
|
subtitle: subtitle,
|
||||||
subtitleAccessory: .none,
|
subtitleAccessory: .none,
|
||||||
presence: nil,
|
presence: nil,
|
||||||
rightAccessoryComponent: rightAccessoryComponent,
|
rightAccessoryComponent: AnyComponentWithIdentity(id: 0, component: rightAccessoryComponent),
|
||||||
selectionState: .none,
|
selectionState: .none,
|
||||||
hasNext: false,
|
hasNext: false,
|
||||||
extractedTheme: PeerListItemComponent.ExtractedTheme(
|
extractedTheme: PeerListItemComponent.ExtractedTheme(
|
||||||
@ -1295,6 +1295,10 @@ final class VideoChatParticipantsComponent: Component {
|
|||||||
subtitle = PeerListItemComponent.Subtitle(text: "invited", color: .neutral)
|
subtitle = PeerListItemComponent.Subtitle(text: "invited", color: .neutral)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let rightAccessoryComponent: AnyComponent<Empty> = AnyComponent(VideoChatParticipantInvitedStatusComponent(
|
||||||
|
theme: component.theme
|
||||||
|
))
|
||||||
|
|
||||||
peerItemComponent = PeerListItemComponent(
|
peerItemComponent = PeerListItemComponent(
|
||||||
context: component.call.accountContext,
|
context: component.call.accountContext,
|
||||||
theme: component.theme,
|
theme: component.theme,
|
||||||
@ -1313,7 +1317,7 @@ final class VideoChatParticipantsComponent: Component {
|
|||||||
subtitle: subtitle,
|
subtitle: subtitle,
|
||||||
subtitleAccessory: .none,
|
subtitleAccessory: .none,
|
||||||
presence: nil,
|
presence: nil,
|
||||||
rightAccessoryComponent: nil,
|
rightAccessoryComponent: AnyComponentWithIdentity(id: 1, component: rightAccessoryComponent),
|
||||||
selectionState: .none,
|
selectionState: .none,
|
||||||
hasNext: false,
|
hasNext: false,
|
||||||
extractedTheme: PeerListItemComponent.ExtractedTheme(
|
extractedTheme: PeerListItemComponent.ExtractedTheme(
|
||||||
|
@ -271,11 +271,17 @@ extension VideoChatScreenComponent.View {
|
|||||||
guard let self, case let .group(groupCall) = self.currentCall else {
|
guard let self, case let .group(groupCall) = self.currentCall else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
guard let peerId = groupCall.peerId else {
|
|
||||||
return
|
let chatPeer: Signal<EnginePeer?, NoError>
|
||||||
|
if let peerId = groupCall.peerId {
|
||||||
|
chatPeer = groupCall.accountContext.engine.data.get(
|
||||||
|
TelegramEngine.EngineData.Item.Peer.Peer(id: peerId)
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
chatPeer = .single(nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
let _ = (groupCall.accountContext.account.postbox.loadedPeerWithId(peerId)
|
let _ = (chatPeer
|
||||||
|> deliverOnMainQueue).start(next: { [weak self] chatPeer in
|
|> deliverOnMainQueue).start(next: { [weak self] chatPeer in
|
||||||
guard let self, let environment = self.environment, case let .group(groupCall) = self.currentCall else {
|
guard let self, let environment = self.environment, case let .group(groupCall) = self.currentCall else {
|
||||||
return
|
return
|
||||||
@ -286,7 +292,9 @@ extension VideoChatScreenComponent.View {
|
|||||||
var items: [ActionSheetItem] = []
|
var items: [ActionSheetItem] = []
|
||||||
|
|
||||||
let nameDisplayOrder = presentationData.nameDisplayOrder
|
let nameDisplayOrder = presentationData.nameDisplayOrder
|
||||||
items.append(DeleteChatPeerActionSheetItem(context: groupCall.accountContext, peer: EnginePeer(peer), chatPeer: EnginePeer(chatPeer), action: .removeFromGroup, strings: environment.strings, nameDisplayOrder: nameDisplayOrder))
|
if let chatPeer {
|
||||||
|
items.append(DeleteChatPeerActionSheetItem(context: groupCall.accountContext, peer: EnginePeer(peer), chatPeer: chatPeer, action: .removeFromGroup, strings: environment.strings, nameDisplayOrder: nameDisplayOrder))
|
||||||
|
}
|
||||||
|
|
||||||
items.append(ActionSheetButtonItem(title: environment.strings.VoiceChat_RemovePeerRemove, color: .destructive, action: { [weak self, weak actionSheet] in
|
items.append(ActionSheetButtonItem(title: environment.strings.VoiceChat_RemovePeerRemove, color: .destructive, action: { [weak self, weak actionSheet] in
|
||||||
actionSheet?.dismissAnimated()
|
actionSheet?.dismissAnimated()
|
||||||
@ -294,15 +302,14 @@ extension VideoChatScreenComponent.View {
|
|||||||
guard let self, let environment = self.environment, case let .group(groupCall) = self.currentCall else {
|
guard let self, let environment = self.environment, case let .group(groupCall) = self.currentCall else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
guard let callPeerId = groupCall.peerId else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
let _ = groupCall.accountContext.peerChannelMemberCategoriesContextsManager.updateMemberBannedRights(engine: groupCall.accountContext.engine, peerId: callPeerId, memberId: peer.id, bannedRights: TelegramChatBannedRights(flags: [.banReadMessages], untilDate: Int32.max)).start()
|
|
||||||
if groupCall.isConference {
|
if groupCall.isConference {
|
||||||
groupCall.kickPeer(id: peer.id)
|
groupCall.kickPeer(id: peer.id)
|
||||||
} else {
|
} else {
|
||||||
groupCall.removedPeer(peer.id)
|
if let callPeerId = groupCall.peerId {
|
||||||
|
let _ = groupCall.accountContext.peerChannelMemberCategoriesContextsManager.updateMemberBannedRights(engine: groupCall.accountContext.engine, peerId: callPeerId, memberId: peer.id, bannedRights: TelegramChatBannedRights(flags: [.banReadMessages], untilDate: Int32.max)).start()
|
||||||
|
groupCall.removedPeer(peer.id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.presentUndoOverlay(content: .banned(text: environment.strings.VoiceChat_RemovedPeerText(EnginePeer(peer).displayTitle(strings: environment.strings, displayOrder: nameDisplayOrder)).string), action: { _ in return false })
|
self.presentUndoOverlay(content: .banned(text: environment.strings.VoiceChat_RemovedPeerText(EnginePeer(peer).displayTitle(strings: environment.strings, displayOrder: nameDisplayOrder)).string), action: { _ in return false })
|
||||||
|
@ -235,7 +235,7 @@ public final class PeerListItemComponent: Component {
|
|||||||
let subtitleAccessory: SubtitleAccessory
|
let subtitleAccessory: SubtitleAccessory
|
||||||
let presence: EnginePeer.Presence?
|
let presence: EnginePeer.Presence?
|
||||||
let rightAccessory: RightAccessory
|
let rightAccessory: RightAccessory
|
||||||
let rightAccessoryComponent: AnyComponent<Empty>?
|
let rightAccessoryComponent: AnyComponentWithIdentity<Empty>?
|
||||||
let reaction: Reaction?
|
let reaction: Reaction?
|
||||||
let story: EngineStoryItem?
|
let story: EngineStoryItem?
|
||||||
let message: EngineMessage?
|
let message: EngineMessage?
|
||||||
@ -266,7 +266,7 @@ public final class PeerListItemComponent: Component {
|
|||||||
subtitleAccessory: SubtitleAccessory,
|
subtitleAccessory: SubtitleAccessory,
|
||||||
presence: EnginePeer.Presence?,
|
presence: EnginePeer.Presence?,
|
||||||
rightAccessory: RightAccessory = .none,
|
rightAccessory: RightAccessory = .none,
|
||||||
rightAccessoryComponent: AnyComponent<Empty>? = nil,
|
rightAccessoryComponent: AnyComponentWithIdentity<Empty>? = nil,
|
||||||
reaction: Reaction? = nil,
|
reaction: Reaction? = nil,
|
||||||
story: EngineStoryItem? = nil,
|
story: EngineStoryItem? = nil,
|
||||||
message: EngineMessage? = nil,
|
message: EngineMessage? = nil,
|
||||||
@ -763,9 +763,14 @@ public final class PeerListItemComponent: Component {
|
|||||||
height = 40.0 + verticalInset * 2.0
|
height = 40.0 + verticalInset * 2.0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let rightAccessoryComponentView = self.rightAccessoryComponentView, component.rightAccessoryComponent?.id != previousComponent?.rightAccessoryComponent?.id {
|
||||||
|
self.rightAccessoryComponentView = nil
|
||||||
|
rightAccessoryComponentView.view?.removeFromSuperview()
|
||||||
|
}
|
||||||
|
|
||||||
var rightAccessoryComponentSize: CGSize?
|
var rightAccessoryComponentSize: CGSize?
|
||||||
if let rightAccessoryComponent = component.rightAccessoryComponent {
|
if let rightAccessoryComponent = component.rightAccessoryComponent?.component {
|
||||||
var rightAccessoryComponentTransition = transition
|
var rightAccessoryComponentTransition = transition
|
||||||
let rightAccessoryComponentView: ComponentView<Empty>
|
let rightAccessoryComponentView: ComponentView<Empty>
|
||||||
if let current = self.rightAccessoryComponentView {
|
if let current = self.rightAccessoryComponentView {
|
||||||
|
12
submodules/TelegramUI/Images.xcassets/Call/GroupPeerInvited.imageset/Contents.json
vendored
Normal file
12
submodules/TelegramUI/Images.xcassets/Call/GroupPeerInvited.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "invited.pdf",
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
BIN
submodules/TelegramUI/Images.xcassets/Call/GroupPeerInvited.imageset/invited.pdf
vendored
Normal file
BIN
submodules/TelegramUI/Images.xcassets/Call/GroupPeerInvited.imageset/invited.pdf
vendored
Normal file
Binary file not shown.
@ -1 +1 @@
|
|||||||
Subproject commit fd1cfbd8151b2c32d5471a4f5431faa6274ce421
|
Subproject commit 579cae3c3c70c6ed8bc0d88cc41de28bd50a7f1b
|
Loading…
x
Reference in New Issue
Block a user