typo fixes

This commit is contained in:
Mike Renoir 2022-11-08 12:38:05 +04:00
parent 45e50a68d7
commit 72b83e4cf8
3 changed files with 12 additions and 8 deletions

View File

@ -14,17 +14,17 @@ public enum InternalUpdaterError {
public func requestUpdatesXml(account: Account, source: String) -> Signal<Data, InternalUpdaterError> { public func requestUpdatesXml(account: Account, source: String) -> Signal<Data, InternalUpdaterError> {
return TelegramEngine(account: account).peers.resolvePeerByName(name: source) return TelegramEngine(account: account).peers.resolvePeerByName(name: source)
|> castError(InternalUpdaterError.self) |> castError(InternalUpdaterError.self)
|> mapToSignal { peer -> Signal<Peer?, InternalUpdaterError> in |> map { peer -> Peer? in
return .single(peer?._asPeer()) return peer?._asPeer()
} }
|> mapToSignal { peer in |> mapToSignal { peer -> Signal<Data, InternalUpdaterError> in
if let peer = peer, let inputPeer = apiInputPeer(peer) { if let peer = peer, let inputPeer = apiInputPeer(peer) {
return account.network.request(Api.functions.messages.getHistory(peer: inputPeer, offsetId: 0, offsetDate: 0, addOffset: 0, limit: 1, maxId: Int32.max, minId: 0, hash: 0)) return account.network.request(Api.functions.messages.getHistory(peer: inputPeer, offsetId: 0, offsetDate: 0, addOffset: 0, limit: 1, maxId: Int32.max, minId: 0, hash: 0))
|> retryRequest |> retryRequest
|> castError(InternalUpdaterError.self) |> castError(InternalUpdaterError.self)
|> mapToSignal { result in |> mapToSignal { result in
switch result { switch result {
case let .channelMessages(_, _, _, _, apiMessages, apiChats, apiUsers): case let .channelMessages(_, _, _, _, apiMessages, _, apiChats, apiUsers):
if let apiMessage = apiMessages.first, let storeMessage = StoreMessage(apiMessage: apiMessage) { if let apiMessage = apiMessages.first, let storeMessage = StoreMessage(apiMessage: apiMessage) {
var peers: [PeerId: Peer] = [:] var peers: [PeerId: Peer] = [:]
@ -89,7 +89,7 @@ public func downloadAppUpdate(account: Account, source: String, messageId: Int32
|> castError(InternalUpdaterError.self) |> castError(InternalUpdaterError.self)
|> mapToSignal { messages in |> mapToSignal { messages in
switch messages { switch messages {
case let .channelMessages(_, _, _, _, apiMessages, apiChats, apiUsers): case let .channelMessages(_, _, _, _, apiMessages, _, apiChats, apiUsers):
var peers: [PeerId: Peer] = [:] var peers: [PeerId: Peer] = [:]
for chat in apiChats { for chat in apiChats {

View File

@ -576,10 +576,12 @@ public final class OngoingGroupCallContext {
self.audioSessionActiveDisposable.set((audioSessionActive self.audioSessionActiveDisposable.set((audioSessionActive
|> deliverOn(queue)).start(next: { [weak self] isActive in |> deliverOn(queue)).start(next: { [weak self] isActive in
guard let self else { guard let `self` = self else {
return return
} }
#if os(iOS)
self.context.setManualAudioSessionIsActive(isActive) self.context.setManualAudioSessionIsActive(isActive)
#endif
})) }))
} }

View File

@ -579,7 +579,9 @@ extension OngoingCallThreadLocalContextWebrtc: OngoingCallThreadLocalContextProt
} }
func nativeSetIsAudioSessionActive(isActive: Bool) { func nativeSetIsAudioSessionActive(isActive: Bool) {
#if os(iOS)
self.setManualAudioSessionIsActive(isActive) self.setManualAudioSessionIsActive(isActive)
#endif
} }
} }
@ -1482,7 +1484,7 @@ private final class CallSignalingConnectionManager {
let connection = CallSignalingConnectionImpl(queue: queue, host: host, port: port, peerTag: self.peerTag, dataReceived: { data in let connection = CallSignalingConnectionImpl(queue: queue, host: host, port: port, peerTag: self.peerTag, dataReceived: { data in
dataReceived(data) dataReceived(data)
}, isClosed: { [weak self] in }, isClosed: { [weak self] in
guard let self else { guard let `self` = self else {
return return
} }
self.handleConnectionFailed(id: id) self.handleConnectionFailed(id: id)