Various fixes

This commit is contained in:
Ilya Laktyushin 2025-09-25 17:06:35 +04:00
parent 934ed73331
commit 6976839bfc
3 changed files with 55 additions and 36 deletions

View File

@ -520,10 +520,11 @@ final class VideoChatMicButtonComponent: Component {
var titleFrame = CGRect(origin: CGPoint(x: floor((size.width - titleSize.width) * 0.5), y: size.height + 16.0), size: titleSize)
if component.isCompact {
titleFrame.origin.y -= 11.0
}
} else {
if subtitleText != nil {
titleFrame.origin.y -= 5.0
}
}
if let titleView = self.title.view {
if titleView.superview == nil {
titleView.isUserInteractionEnabled = false

View File

@ -3065,7 +3065,7 @@ final class VideoChatScreenComponent: Component {
transition.setBounds(view: microphoneButtonView, bounds: CGRect(origin: CGPoint(), size: microphoneButtonFrame.size))
}
let videoButtonContent: VideoChatActionButtonComponent.Content
let videoButtonContent: VideoChatActionButtonComponent.Content?
let videoControlButtonContent: VideoChatActionButtonComponent.Content
var buttonAudio: VideoChatActionButtonComponent.Content.Audio = .speaker
@ -3097,7 +3097,7 @@ final class VideoChatScreenComponent: Component {
}
if let callState = self.callState, let muteState = callState.muteState, !muteState.canUnmute {
videoButtonContent = .audio(audio: buttonAudio, isEnabled: buttonIsEnabled)
videoButtonContent = nil
videoControlButtonContent = .audio(audio: buttonAudio, isEnabled: buttonIsEnabled)
} else {
let isVideoActive = self.callState?.isMyVideoActive ?? false
@ -3109,6 +3109,7 @@ final class VideoChatScreenComponent: Component {
}
}
if let videoButtonContent {
let _ = self.videoButton.update(
transition: transition,
component: AnyComponent(PlainButtonComponent(
@ -3134,7 +3135,6 @@ final class VideoChatScreenComponent: Component {
environment: {},
containerSize: CGSize(width: actionButtonDiameter, height: actionButtonDiameter)
)
if let videoButtonView = self.videoButton.view {
if videoButtonView.superview == nil {
self.containerView.addSubview(videoButtonView)
@ -3142,6 +3142,13 @@ final class VideoChatScreenComponent: Component {
transition.setPosition(view: videoButtonView, position: secondActionButtonFrame.center)
transition.setBounds(view: videoButtonView, bounds: CGRect(origin: CGPoint(), size: secondActionButtonFrame.size))
}
} else if let videoButtonView = self.videoButton.view {
let transition = ComponentTransition(animation: .curve(duration: 0.25, curve: .easeInOut))
transition.animateScale(view: videoButtonView, from: 1.0, to: 0.01)
transition.animateAlpha(view: videoButtonView, from: 1.0, to: 0.0, completion: { _ in
videoButtonView.removeFromSuperview()
})
}
let _ = self.speakerButton.update(
transition: transition,

View File

@ -1501,6 +1501,17 @@ private func infoItems(data: PeerInfoScreenData?, context: AccountContext, prese
}
if let note = cachedData.note, !note.text.isEmpty {
var entities = note.entities
if !context.isPremium {
entities = entities.filter { entity in
switch entity.type {
case .Url, .TextUrl:
return false
default:
return true
}
}
}
items[currentPeerInfoSection]!.append(PeerInfoScreenLabeledValueItem(id: 0, label: presentationData.strings.PeerInfo_Notes, rightLabel: presentationData.strings.PeerInfo_NotesInfo, text: note.text, entities: note.entities, textColor: .primary, textBehavior: .multiLine(maxLines: 100, enabledEntities: []), action: nil, linkItemAction: bioLinkAction, button: nil, contextAction: noteContextAction, requestLayout: { animated in
interaction.requestLayout(animated)
}))
@ -4577,7 +4588,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
let noteUpdateSignal: Signal<Never, ContactUpdateError>
if noteUpdated, let note {
let entities = generateChatInputTextEntities(note)
let entities = generateTextEntities(note.string, enabledTypes: [.mention, .hashtag, .allUrl], currentEntities: generateChatInputTextEntities(note))
noteUpdateSignal = context.engine.contacts.updateContactNote(peerId: peer.id, text: note.string, entities: entities)
|> mapError { _ -> ContactUpdateError in
return .generic