diff --git a/submodules/TelegramCore/Sources/Network/NetworkFrameworkTcpConnectionInterface.swift b/submodules/TelegramCore/Sources/Network/NetworkFrameworkTcpConnectionInterface.swift index 8ff07267bc..7cd4f87958 100644 --- a/submodules/TelegramCore/Sources/Network/NetworkFrameworkTcpConnectionInterface.swift +++ b/submodules/TelegramCore/Sources/Network/NetworkFrameworkTcpConnectionInterface.swift @@ -239,7 +239,7 @@ final class NetworkFrameworkTcpConnectionInterface: NSObject, MTTcpConnectionInt if data.count != 0 && data.count <= currentReadRequest.request.length - currentReadRequest.readyLength { currentReadRequest.data.withUnsafeMutableBytes { currentBuffer in - guard let currentBytes = currentBuffer.assumingMemoryBound(to: UInt8.self).baseAddress else { + guard let currentBytes = currentBuffer.baseAddress?.assumingMemoryBound(to: UInt8.self) else { return } data.copyBytes(to: currentBytes.advanced(by: currentReadRequest.readyLength), count: data.count) diff --git a/submodules/TelegramCore/Sources/Utils/MessageUtils.swift b/submodules/TelegramCore/Sources/Utils/MessageUtils.swift index 8f6a87d262..c2ff906576 100644 --- a/submodules/TelegramCore/Sources/Utils/MessageUtils.swift +++ b/submodules/TelegramCore/Sources/Utils/MessageUtils.swift @@ -225,7 +225,7 @@ func locallyRenderedMessage(message: StoreMessage, peers: [PeerId: Peer], associ public extension Message { func effectivelyIncoming(_ accountPeerId: PeerId) -> Bool { - if self.id.peerId == accountPeerId { + if self.author?.id == accountPeerId, self.id.peerId != accountPeerId { if self.forwardInfo != nil { return true } else {