This commit is contained in:
Ali 2020-12-15 20:22:47 +04:00
parent af29a873c3
commit 53b762dab0
4 changed files with 46 additions and 13 deletions

View File

@ -1319,7 +1319,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
} }
badgeSize = max(badgeSize, reorderInset) badgeSize = max(badgeSize, reorderInset)
let (authorLayout, authorApply) = authorLayout(TextNodeLayoutArguments(attributedString: hideAuthor ? nil : authorAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: rawContentWidth - badgeSize, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets(top: 2.0, left: 1.0, bottom: 2.0, right: 1.0))) let (authorLayout, authorApply) = authorLayout(TextNodeLayoutArguments(attributedString: (hideAuthor && !hasDraft) ? nil : authorAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: rawContentWidth - badgeSize, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets(top: 2.0, left: 1.0, bottom: 2.0, right: 1.0)))
var textCutout: TextNodeCutout? var textCutout: TextNodeCutout?
if !textLeftCutout.isZero { if !textLeftCutout.isZero {

View File

@ -263,6 +263,16 @@ class ChannelMembersSearchControllerNode: ASDisplayNode {
} }
var entries: [ChannelMembersSearchEntry] = [] var entries: [ChannelMembersSearchEntry] = []
if case .inviteToCall = mode, !filters.contains(where: { filter in
if case .excludeNonMembers = filter {
return true
} else {
return false
}
}) {
entries.append(.copyInviteLink)
}
var index = 0 var index = 0
for participant in participants.participants { for participant in participants.participants {
guard let peer = peerView.peers[participant.peerId] else { guard let peer = peerView.peers[participant.peerId] else {

View File

@ -1114,13 +1114,27 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
self._canBeRemoved.set(.single(true)) self._canBeRemoved.set(.single(true))
if self.didConnectOnce { if self.didConnectOnce {
let toneRenderer = PresentationCallToneRenderer(tone: .groupLeft) if let callManager = self.accountContext.sharedContext.callManager {
self.toneRenderer = toneRenderer let _ = (callManager.currentGroupCallSignal
toneRenderer.setAudioSessionActive(self.isAudioSessionActive) |> take(1)
|> deliverOnMainQueue).start(next: { [weak self] call in
Queue.mainQueue().after(1.0, { guard let strongSelf = self else {
self.wasRemoved.set(.single(true)) return
}) }
if let call = call, call !== strongSelf {
strongSelf.wasRemoved.set(.single(true))
return
}
let toneRenderer = PresentationCallToneRenderer(tone: .groupLeft)
strongSelf.toneRenderer = toneRenderer
toneRenderer.setAudioSessionActive(strongSelf.isAudioSessionActive)
Queue.mainQueue().after(1.0, {
strongSelf.wasRemoved.set(.single(true))
})
})
}
} }
} }

View File

@ -575,7 +575,7 @@ public final class VoiceChatController: ViewController {
filters.append(.excludeNonMembers) filters.append(.excludeNonMembers)
} }
} else if let groupPeer = groupPeer as? TelegramGroup { } else if let groupPeer = groupPeer as? TelegramGroup {
if !groupPeer.hasBannedPermission(.banAddMembers) { if groupPeer.hasBannedPermission(.banAddMembers) {
filters.append(.excludeNonMembers) filters.append(.excludeNonMembers)
} }
} }
@ -984,11 +984,20 @@ public final class VoiceChatController: ViewController {
strongSelf.accountPeer = accountPeer strongSelf.accountPeer = accountPeer
strongSelf.updateMembers(muteState: strongSelf.effectiveMuteState, callMembers: strongSelf.currentCallMembers ?? [], invitedPeers: strongSelf.currentInvitedPeers ?? [], speakingPeers: strongSelf.currentSpeakingPeers ?? Set()) strongSelf.updateMembers(muteState: strongSelf.effectiveMuteState, callMembers: strongSelf.currentCallMembers ?? [], invitedPeers: strongSelf.currentInvitedPeers ?? [], speakingPeers: strongSelf.currentSpeakingPeers ?? Set())
if let peer = peerViewMainPeer(view), let channel = peer as? TelegramChannel { if let peer = peerViewMainPeer(view) {
let addressName = channel.addressName ?? "" if let channel = peer as? TelegramChannel {
if channel.flags.contains(.isCreator) || channel.hasPermission(.inviteMembers) { let addressName = channel.addressName ?? ""
if addressName.isEmpty { if channel.flags.contains(.isCreator) || channel.hasPermission(.inviteMembers) {
if addressName.isEmpty {
let _ = ensuredExistingPeerExportedInvitation(account: strongSelf.context.account, peerId: call.peerId).start()
}
}
} else if let group = peer as? TelegramGroup {
switch group.role {
case .creator, .admin:
let _ = ensuredExistingPeerExportedInvitation(account: strongSelf.context.account, peerId: call.peerId).start() let _ = ensuredExistingPeerExportedInvitation(account: strongSelf.context.account, peerId: call.peerId).start()
default:
break
} }
} }
} }