diff --git a/submodules/TelegramBaseController/Sources/TelegramBaseController.swift b/submodules/TelegramBaseController/Sources/TelegramBaseController.swift index d5b6c140a0..8e19d8f15c 100644 --- a/submodules/TelegramBaseController/Sources/TelegramBaseController.swift +++ b/submodules/TelegramBaseController/Sources/TelegramBaseController.swift @@ -270,7 +270,7 @@ open class TelegramBaseController: ViewController, KeyShortcutResponder { return lhs?.internalId == rhs?.internalId }) |> map { call -> PresentationGroupCall? in - guard let call = call, call.peerId == peerId else { + guard let call = call, call.peerId == peerId && call.account.peerId == context.account.peerId else { return nil } return call @@ -312,78 +312,6 @@ open class TelegramBaseController: ViewController, KeyShortcutResponder { } } |> runOn(.mainQueue()) - - /*let updatedData: Signal = getGroupCallParticipants(account: context.account, callId: activeCall.id, accessHash: activeCall.accessHash, offset: "", limit: 10) - |> map(Optional.init) - |> `catch` { _ -> Signal in - return .single(nil) - } - |> mapToSignal { initialState -> Signal in - guard let initialState = initialState else { - return .single(nil) - } - - return Signal { subscriber in - let participantsContext = QueueLocalObject(queue: .mainQueue(), generate: { - return GroupCallParticipantsContext( - account: context.account, - peerId: peerId, - id: activeCall.id, - accessHash: activeCall.accessHash, - state: initialState - ) - }) - - let disposable = MetaDisposable() - participantsContext.with { participantsContext in - disposable.set(combineLatest(queue: .mainQueue(), - participantsContext.state, - participantsContext.numberOfActiveSpeakers - ).start(next: { state, numberOfActiveSpeakers in - var topParticipants: [GroupCallParticipantsContext.Participant] = [] - for participant in state.participants { - if topParticipants.count >= 3 { - break - } - topParticipants.append(participant) - } - let data = GroupCallPanelData( - peerId: peerId, - info: GroupCallInfo(id: activeCall.id, accessHash: activeCall.accessHash, participantCount: state.totalCount, clientParams: nil), - topParticipants: topParticipants, - participantCount: state.totalCount, - numberOfActiveSpeakers: numberOfActiveSpeakers, - groupCall: nil - ) - subscriber.putNext(data) - })) - } - - return ActionDisposable { - disposable.dispose() - participantsContext.with { _ in - } - } - } - |> runOn(.mainQueue()) - } - - let initialData: Signal = .single(GroupCallPanelData( - peerId: peerId, - info: GroupCallInfo( - id: activeCall.id, - accessHash: activeCall.accessHash, - participantCount: 0, - clientParams: nil - ), - topParticipants: [], - participantCount: 0, - numberOfActiveSpeakers: 0, - groupCall: nil - )) - - return initialData - |> then(updatedData)*/ } } else { availableGroupCall = .single(nil) diff --git a/submodules/TelegramCallsUI/Sources/VoiceChatActionButton.swift b/submodules/TelegramCallsUI/Sources/VoiceChatActionButton.swift index fe32961abd..ea4885774c 100644 --- a/submodules/TelegramCallsUI/Sources/VoiceChatActionButton.swift +++ b/submodules/TelegramCallsUI/Sources/VoiceChatActionButton.swift @@ -548,8 +548,10 @@ private final class VoiceChatActionButtonBackgroundNode: ASDisplayNode { } else { let initialScale: CGFloat = ((self.maskGradientLayer.value(forKeyPath: "presentationLayer.transform.scale.x") as? NSNumber)?.floatValue).flatMap({ CGFloat($0) }) ?? (((self.maskGradientLayer.value(forKeyPath: "transform.scale.x") as? NSNumber)?.floatValue).flatMap({ CGFloat($0) }) ?? (0.89)) let targetScale: CGFloat = self.isActive ? 0.89 : 0.85 - self.maskGradientLayer.transform = CATransform3DMakeScale(targetScale, targetScale, 1.0) - self.maskGradientLayer.animateScale(from: initialScale, to: targetScale, duration: 0.3) + if abs(targetScale - initialScale) > 0.03 { + self.maskGradientLayer.transform = CATransform3DMakeScale(targetScale, targetScale, 1.0) + self.maskGradientLayer.animateScale(from: initialScale, to: targetScale, duration: 0.3) + } } } @@ -566,11 +568,11 @@ private final class VoiceChatActionButtonBackgroundNode: ASDisplayNode { if active { targetColors = [blue.cgColor, green.cgColor] targetScale = 0.89 - outerColor = UIColor(rgb: 0x005720) + outerColor = UIColor(rgb: 0x21674f) } else { targetColors = [lightBlue.cgColor, blue.cgColor] targetScale = 0.85 - outerColor = UIColor(rgb: 0x00274d) + outerColor = UIColor(rgb: 0x1d588d) } } else { targetColors = [lightBlue.cgColor, blue.cgColor]