mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 21:45:19 +00:00
Voice Chat UI fixes
This commit is contained in:
parent
f3c2187777
commit
9441f3999d
@ -6021,3 +6021,5 @@ Sorry for the inconvenience.";
|
||||
"Channel.AdminLog.MutedNewMembers" = "%1$@ muted new members";
|
||||
|
||||
"Group.GroupMembersHeader" = "GROUP MEMBERS";
|
||||
|
||||
"Conversation.VoiceChatMediaRecordingRestricted" = "You can't record voice and video messages during a voice chat.";
|
||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -5042,6 +5042,29 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
subjectFlags = .banSendMedia
|
||||
}
|
||||
|
||||
if case .mediaRecording = subject, let _ = strongSelf.presentationInterfaceState.activeGroupCallInfo {
|
||||
let rect = strongSelf.chatDisplayNode.frameForInputActionButton()
|
||||
if let rect = rect {
|
||||
strongSelf.mediaRestrictedTooltipController?.dismiss()
|
||||
let tooltipController = TooltipController(content: .text(strongSelf.presentationInterfaceState.strings.Conversation_VoiceChatMediaRecordingRestricted), baseFontSize: strongSelf.presentationData.listsFontSize.baseDisplaySize)
|
||||
strongSelf.mediaRestrictedTooltipController = tooltipController
|
||||
strongSelf.mediaRestrictedTooltipControllerMode = false
|
||||
tooltipController.dismissed = { [weak tooltipController] _ in
|
||||
if let strongSelf = self, let tooltipController = tooltipController, strongSelf.mediaRestrictedTooltipController === tooltipController {
|
||||
strongSelf.mediaRestrictedTooltipController = nil
|
||||
}
|
||||
}
|
||||
strongSelf.present(tooltipController, in: .window(.root), with: TooltipControllerPresentationArguments(sourceNodeAndRect: {
|
||||
if let strongSelf = self {
|
||||
return (strongSelf.chatDisplayNode, rect)
|
||||
}
|
||||
return nil
|
||||
}))
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
let bannedPermission: (Int32, Bool)?
|
||||
if let channel = strongSelf.presentationInterfaceState.renderedPeer?.peer as? TelegramChannel {
|
||||
bannedPermission = channel.hasBannedPermission(subjectFlags)
|
||||
|
@ -1365,7 +1365,9 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
|
||||
}
|
||||
|
||||
let mediaInputDisabled: Bool
|
||||
if let channel = interfaceState.renderedPeer?.peer as? TelegramChannel, channel.hasBannedPermission(.banSendMedia) != nil {
|
||||
if let _ = interfaceState.activeGroupCallInfo {
|
||||
mediaInputDisabled = true
|
||||
} else if let channel = interfaceState.renderedPeer?.peer as? TelegramChannel, channel.hasBannedPermission(.banSendMedia) != nil {
|
||||
mediaInputDisabled = true
|
||||
} else if let group = interfaceState.renderedPeer?.peer as? TelegramGroup, group.hasBannedPermission(.banSendMedia) {
|
||||
mediaInputDisabled = true
|
||||
@ -1485,7 +1487,7 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
|
||||
self.counterTextNode.attributedText = NSAttributedString(string: "", font: counterFont, textColor: .black)
|
||||
}
|
||||
|
||||
if let (width, leftInset, rightInset, additionalSideInsets, maxHeight, metrics, _) = self.validLayout {
|
||||
if let (width, leftInset, rightInset, _, maxHeight, metrics, _) = self.validLayout {
|
||||
var composeButtonsOffset: CGFloat = 0.0
|
||||
if self.extendedSearchLayout {
|
||||
composeButtonsOffset = 44.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user