add more logs

pull/1053/head
Ryan ZHAO 6 months ago
parent 83a0849f66
commit 5fb9a6621d

@ -7778,7 +7778,7 @@
CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 496;
CURRENT_PROJECT_VERSION = 498;
DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -7849,7 +7849,7 @@
CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 496;
CURRENT_PROJECT_VERSION = 498;
DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",

@ -985,6 +985,88 @@ SOFTWARE.
<key>License</key>
<string>The MIT License (MIT)
Copyright (c) 2016 swiftlyfalling (https://github.com/swiftlyfalling)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
</string>
<key>Title</key>
<string>session-grdb-swift</string>
</dict>
<dict>
<key>License</key>
<string>The author disclaims copyright to this source code. In place of
a legal notice, here is a blessing:
* May you do good and not evil.
* May you find forgiveness for yourself and forgive others.
* May you share freely, never taking more than you give.
</string>
<key>Title</key>
<string>session-grdb-swift</string>
</dict>
<dict>
<key>License</key>
<string>/*
** LICENSE for the sqlite3 WebAssembly/JavaScript APIs.
**
** This bundle (typically released as sqlite3.js or sqlite3.mjs)
** is an amalgamation of JavaScript source code from two projects:
**
** 1) https://emscripten.org: the Emscripten "glue code" is covered by
** the terms of the MIT license and University of Illinois/NCSA
** Open Source License, as described at:
**
** https://emscripten.org/docs/introducing_emscripten/emscripten_license.html
**
** 2) https://sqlite.org: all code and documentation labeled as being
** from this source are released under the same terms as the sqlite3
** C library:
**
** 2022-10-16
**
** The author disclaims copyright to this source code. In place of a
** legal notice, here is a blessing:
**
** * May you do good and not evil.
** * May you find forgiveness for yourself and forgive others.
** * May you share freely, never taking more than you give.
*/
</string>
<key>Title</key>
<string>session-grdb-swift</string>
</dict>
<dict>
<key>License</key>
<string>The author disclaims copyright to this source code. In place of
a legal notice, here is a blessing:
May you do good and not evil.
May you find forgiveness for yourself and forgive others.
May you share freely, never taking more than you give.
</string>
<key>Title</key>
<string>session-grdb-swift</string>
</dict>
<dict>
<key>License</key>
<string>The MIT License (MIT)
Copyright (c) 2015 ibireme &lt;ibireme@gmail.com&gt;
Permission is hereby granted, free of charge, to any person obtaining a copy

@ -297,40 +297,45 @@ public enum PushRegistrationError: Error {
LibSession.resumeNetworkAccess()
let maybeCall: SessionCall? = Storage.shared.write { db in
let messageInfo: CallMessage.MessageInfo = CallMessage.MessageInfo(
state: (caller == getUserHexEncodedPublicKey(db) ?
.outgoing :
.incoming
)
)
let messageInfoString: String? = {
if let messageInfoData: Data = try? JSONEncoder().encode(messageInfo) {
return String(data: messageInfoData, encoding: .utf8)
} else {
return "callsIncoming"
.put(key: "name", value: caller)
.localized()
}
}()
let call: SessionCall = SessionCall(db, for: caller, uuid: uuid, mode: .answer)
let thread: SessionThread = try SessionThread
.fetchOrCreate(db, id: caller, variant: .contact, shouldBeVisible: nil)
let interaction: Interaction = try Interaction(
messageUuid: uuid,
threadId: thread.id,
threadVariant: thread.variant,
authorId: caller,
variant: .infoCall,
body: messageInfoString,
timestampMs: timestampMs
)
.withDisappearingMessagesConfiguration(db, threadVariant: thread.variant)
.inserted(db)
var call: SessionCall? = nil
call.callInteractionId = interaction.id
do {
let messageInfo: CallMessage.MessageInfo = CallMessage.MessageInfo(state: .incoming)
SNLog("[Calls] messageInfo done")
let messageInfoString: String? = {
if let messageInfoData: Data = try? JSONEncoder().encode(messageInfo) {
return String(data: messageInfoData, encoding: .utf8)
} else {
return "callsIncoming"
.put(key: "name", value: caller)
.localized()
}
}()
SNLog("[Calls] messageInfoString done: \(messageInfoString ?? "nil")")
call = SessionCall(db, for: caller, uuid: uuid, mode: .answer)
SNLog("[Calls] call instance done")
let thread: SessionThread = try SessionThread.fetchOrCreate(db, id: caller, variant: .contact, shouldBeVisible: nil)
SNLog("[Calls] thread got")
let interaction: Interaction = try Interaction(
messageUuid: uuid,
threadId: thread.id,
threadVariant: thread.variant,
authorId: caller,
variant: .infoCall,
body: messageInfoString,
timestampMs: timestampMs
)
.withDisappearingMessagesConfiguration(db, threadVariant: thread.variant)
.inserted(db)
SNLog("[Calls] control message inserted")
call?.callInteractionId = interaction.id
} catch {
SNLog("[Calls] Failed to creat call due to error: \(error)")
}
return call
}

Loading…
Cancel
Save