mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix call log sending
This commit is contained in:
parent
0562d606fc
commit
9df77b8d19
@ -1306,6 +1306,10 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
let (size, apply) = inputActivitiesLayout(CGSize(width: rawContentWidth - badgeSize, height: 40.0), item.presentationData, item.presentationData.theme.chatList.messageTextColor, item.index.messageIndex.id.peerId, inputActivities)
|
let (size, apply) = inputActivitiesLayout(CGSize(width: rawContentWidth - badgeSize, height: 40.0), item.presentationData, item.presentationData.theme.chatList.messageTextColor, item.index.messageIndex.id.peerId, inputActivities)
|
||||||
inputActivitiesSize = size
|
inputActivitiesSize = size
|
||||||
inputActivitiesApply = apply
|
inputActivitiesApply = apply
|
||||||
|
} else {
|
||||||
|
let (size, apply) = inputActivitiesLayout(CGSize(width: rawContentWidth - badgeSize, height: 40.0), item.presentationData, item.presentationData.theme.chatList.messageTextColor, item.index.messageIndex.id.peerId, [])
|
||||||
|
inputActivitiesSize = size
|
||||||
|
inputActivitiesApply = apply
|
||||||
}
|
}
|
||||||
|
|
||||||
var online = false
|
var online = false
|
||||||
|
@ -15,6 +15,9 @@ public func rateCall(account: Account, callId: CallId, starsCount: Int32, commen
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func saveCallDebugLog(network: Network, callId: CallId, log: String) -> Signal<Void, NoError> {
|
public func saveCallDebugLog(network: Network, callId: CallId, log: String) -> Signal<Void, NoError> {
|
||||||
|
if log.count > 1024 * 16 {
|
||||||
|
return .complete()
|
||||||
|
}
|
||||||
return network.request(Api.functions.phone.saveCallDebug(peer: Api.InputPhoneCall.inputPhoneCall(id: callId.id, accessHash: callId.accessHash), debug: .dataJSON(data: log)))
|
return network.request(Api.functions.phone.saveCallDebug(peer: Api.InputPhoneCall.inputPhoneCall(id: callId.id, accessHash: callId.accessHash), debug: .dataJSON(data: log)))
|
||||||
|> `catch` { _ -> Signal<Api.Bool, NoError> in
|
|> `catch` { _ -> Signal<Api.Bool, NoError> in
|
||||||
return .single(.boolFalse)
|
return .single(.boolFalse)
|
||||||
|
@ -717,6 +717,18 @@ public final class OngoingCallContext {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func withContextThenDeallocate(_ f: @escaping (OngoingCallThreadLocalContextProtocol) -> Void) {
|
||||||
|
self.queue.async {
|
||||||
|
if let contextRef = self.contextRef {
|
||||||
|
let context = contextRef.takeUnretainedValue()
|
||||||
|
f(context.context)
|
||||||
|
|
||||||
|
self.contextRef?.release()
|
||||||
|
self.contextRef = nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public func beginTermination() {
|
public func beginTermination() {
|
||||||
self.withContext { context in
|
self.withContext { context in
|
||||||
context.nativeBeginTermination()
|
context.nativeBeginTermination()
|
||||||
@ -727,7 +739,7 @@ public final class OngoingCallContext {
|
|||||||
let account = self.account
|
let account = self.account
|
||||||
let logPath = self.logPath
|
let logPath = self.logPath
|
||||||
|
|
||||||
self.withContext { context in
|
self.withContextThenDeallocate { context in
|
||||||
context.nativeStop { debugLog, bytesSentWifi, bytesReceivedWifi, bytesSentMobile, bytesReceivedMobile in
|
context.nativeStop { debugLog, bytesSentWifi, bytesReceivedWifi, bytesSentMobile, bytesReceivedMobile in
|
||||||
debugLogValue.set(.single(debugLog))
|
debugLogValue.set(.single(debugLog))
|
||||||
let delta = NetworkUsageStatsConnectionsEntry(
|
let delta = NetworkUsageStatsConnectionsEntry(
|
||||||
|
@ -515,6 +515,10 @@ static void (*InternalVoipLoggingFunction)(NSString *) = NULL;
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc {
|
- (void)dealloc {
|
||||||
|
if (InternalVoipLoggingFunction) {
|
||||||
|
InternalVoipLoggingFunction(@"OngoingCallThreadLocalContext: dealloc");
|
||||||
|
}
|
||||||
|
|
||||||
assert([_queue isCurrent]);
|
assert([_queue isCurrent]);
|
||||||
if (_tgVoip != NULL) {
|
if (_tgVoip != NULL) {
|
||||||
[self stop:nil];
|
[self stop:nil];
|
||||||
@ -530,7 +534,7 @@ static void (*InternalVoipLoggingFunction)(NSString *) = NULL;
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tgcalls::FinalState finalState = _tgVoip->stop();
|
tgcalls::FinalState finalState = _tgVoip->stop();
|
||||||
_tgVoip = nil;
|
_tgVoip.reset();
|
||||||
_terminationResult = [[OngoingCallThreadLocalContextWebrtcTerminationResult alloc] initWithFinalState:finalState];
|
_terminationResult = [[OngoingCallThreadLocalContextWebrtcTerminationResult alloc] initWithFinalState:finalState];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 9e425c1fbd34e544f831a612608fce1da1c73200
|
Subproject commit 44ec8cf45b267a0931bf52adb2d6a83f8aab3690
|
Loading…
x
Reference in New Issue
Block a user