mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 21:45:19 +00:00
UI fixes
This commit is contained in:
parent
af29a873c3
commit
53b762dab0
@ -1319,7 +1319,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
||||
}
|
||||
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?
|
||||
if !textLeftCutout.isZero {
|
||||
|
@ -263,6 +263,16 @@ class ChannelMembersSearchControllerNode: ASDisplayNode {
|
||||
}
|
||||
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
|
||||
for participant in participants.participants {
|
||||
guard let peer = peerView.peers[participant.peerId] else {
|
||||
|
@ -1114,13 +1114,27 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
||||
self._canBeRemoved.set(.single(true))
|
||||
|
||||
if self.didConnectOnce {
|
||||
let toneRenderer = PresentationCallToneRenderer(tone: .groupLeft)
|
||||
self.toneRenderer = toneRenderer
|
||||
toneRenderer.setAudioSessionActive(self.isAudioSessionActive)
|
||||
|
||||
Queue.mainQueue().after(1.0, {
|
||||
self.wasRemoved.set(.single(true))
|
||||
})
|
||||
if let callManager = self.accountContext.sharedContext.callManager {
|
||||
let _ = (callManager.currentGroupCallSignal
|
||||
|> take(1)
|
||||
|> deliverOnMainQueue).start(next: { [weak self] call in
|
||||
guard let strongSelf = self else {
|
||||
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))
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -575,7 +575,7 @@ public final class VoiceChatController: ViewController {
|
||||
filters.append(.excludeNonMembers)
|
||||
}
|
||||
} else if let groupPeer = groupPeer as? TelegramGroup {
|
||||
if !groupPeer.hasBannedPermission(.banAddMembers) {
|
||||
if groupPeer.hasBannedPermission(.banAddMembers) {
|
||||
filters.append(.excludeNonMembers)
|
||||
}
|
||||
}
|
||||
@ -984,11 +984,20 @@ public final class VoiceChatController: ViewController {
|
||||
strongSelf.accountPeer = accountPeer
|
||||
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 {
|
||||
let addressName = channel.addressName ?? ""
|
||||
if channel.flags.contains(.isCreator) || channel.hasPermission(.inviteMembers) {
|
||||
if addressName.isEmpty {
|
||||
if let peer = peerViewMainPeer(view) {
|
||||
if let channel = peer as? TelegramChannel {
|
||||
let addressName = channel.addressName ?? ""
|
||||
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()
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user