diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 6fafaac47..209af1863 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -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 = 498; + CURRENT_PROJECT_VERSION = 500; 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 = 498; + CURRENT_PROJECT_VERSION = 500; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", diff --git a/Session/Home/HomeVC.swift b/Session/Home/HomeVC.swift index f9e5e732e..cc6a99633 100644 --- a/Session/Home/HomeVC.swift +++ b/Session/Home/HomeVC.swift @@ -354,6 +354,7 @@ final class HomeVC: BaseVC, LibSessionRespondingViewController, UITableViewDataS // Start polling if needed (i.e. if the user just created or restored their Session ID) if Identity.userExists(), let appDelegate: AppDelegate = UIApplication.shared.delegate as? AppDelegate { + SNLog("[HomeVC]: Starting pollers...") appDelegate.startPollersIfNeeded() } diff --git a/Session/Notifications/PushRegistrationManager.swift b/Session/Notifications/PushRegistrationManager.swift index 9b292d5f7..d1ed6c10d 100644 --- a/Session/Notifications/PushRegistrationManager.swift +++ b/Session/Notifications/PushRegistrationManager.swift @@ -300,39 +300,27 @@ public enum PushRegistrationError: Error { var call: SessionCall? = nil 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 + ) - 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 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) - SNLog("[Calls] control message inserted") + let interaction: Interaction? = try Interaction + .filter(Interaction.Columns.threadId == thread.id) + .filter(Interaction.Columns.messageUuid == uuid) + .fetchOne(db) - call?.callInteractionId = interaction.id + call?.callInteractionId = interaction?.id } catch { SNLog("[Calls] Failed to creat call due to error: \(error)") }