diff --git a/App/client-ios.xcodeproj/project.pbxproj b/App/client-ios.xcodeproj/project.pbxproj index 95dbf04121acad50caa29de4f69bcd25c2c680f7..dfd5b05c8fcf692955fa486070a4f32fd3273940 100644 --- a/App/client-ios.xcodeproj/project.pbxproj +++ b/App/client-ios.xcodeproj/project.pbxproj @@ -448,7 +448,7 @@ CODE_SIGN_ENTITLEMENTS = "client-ios/Resources/client-ios.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 242; + CURRENT_PROJECT_VERSION = 251; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = S6JDM2WW29; ENABLE_BITCODE = NO; @@ -487,7 +487,7 @@ CODE_SIGN_ENTITLEMENTS = "client-ios/Resources/client-ios.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 242; + CURRENT_PROJECT_VERSION = 251; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = S6JDM2WW29; ENABLE_BITCODE = NO; @@ -522,7 +522,7 @@ CODE_SIGN_ENTITLEMENTS = NotificationExtension/NotificationExtension.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 242; + CURRENT_PROJECT_VERSION = 251; DEVELOPMENT_TEAM = S6JDM2WW29; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -553,7 +553,7 @@ CODE_SIGN_ENTITLEMENTS = NotificationExtension/NotificationExtension.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 242; + CURRENT_PROJECT_VERSION = 251; DEVELOPMENT_TEAM = S6JDM2WW29; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( diff --git a/App/client-ios/Resources/Info.plist b/App/client-ios/Resources/Info.plist index d8cb845b40392068f453251c9c0aa72cd00979db..ee4d813d2e0ccc94a932d66a36070d80705cab5b 100644 --- a/App/client-ios/Resources/Info.plist +++ b/App/client-ios/Resources/Info.plist @@ -105,6 +105,6 @@ <key>UIViewControllerBasedStatusBarAppearance</key> <true/> <key>isReportingOptional</key> - <false/> + <true/> </dict> </plist> diff --git a/Package.swift b/Package.swift index 5823f35ee5eadb38b56a952dff1bf9db464dc6fc..9f9655715f895cf4b582ef6a6b9bd2cc56d4311e 100644 --- a/Package.swift +++ b/Package.swift @@ -115,8 +115,9 @@ let package = Package( .upToNextMajor(from: "1.6.0") ), .package( - url: "https://git.xx.network/elixxir/elixxir-dapps-sdk-swift", - branch: "development" + path: "../elixxir-dapps-sdk-swift" +// url: "https://git.xx.network/elixxir/elixxir-dapps-sdk-swift", +// branch: "development" ), .package( url: "https://git.xx.network/elixxir/client-ios-db.git", diff --git a/Sources/ChatFeature/ViewModels/GroupChatViewModel.swift b/Sources/ChatFeature/ViewModels/GroupChatViewModel.swift index a5f8e18dbc49fb6de2dd607bf2b1107416f478af..1329609d408d1fb1f262aa4cc4883b7cf1d5b9bd 100644 --- a/Sources/ChatFeature/ViewModels/GroupChatViewModel.swift +++ b/Sources/ChatFeature/ViewModels/GroupChatViewModel.swift @@ -110,17 +110,36 @@ final class GroupChatViewModel { replyMessageId: stagedReply?.messageId ) + print("") + print("Outgoing GroupMessage:") + print("- groupId: \(info.group.id.base64EncodedString().prefix(10))...") + print("- senderId: \(myId.base64EncodedString().prefix(10))...") + print("- payload.text: \(message.text)") + do { - try database.saveMessage(message) + message = try database.saveMessage(message) + + let payload = Payload( + text: text.trimmingCharacters(in: .whitespacesAndNewlines), + reply: stagedReply + ).asData() let report = try groupManager.send( groupId: info.group.id, - message: Payload( - text: text.trimmingCharacters(in: .whitespacesAndNewlines), - reply: stagedReply - ).asData() + message: payload ) + print("- messageId: \(report.messageId.base64EncodedString().prefix(10))...") + + if let foo = stagedReply { + print("- payload.reply.messageId: \(foo.messageId.base64EncodedString().prefix(10))...") + print("- payload.reply.senderId: \(foo.senderId.base64EncodedString().prefix(10))...") + } else { + print("- payload.reply: ∅") + } + + message.networkId = report.messageId + try messenger.cMix.get()!.waitForRoundResult( roundList: try report.encode(), timeoutMS: 15_000, @@ -128,8 +147,9 @@ final class GroupChatViewModel { switch $0 { case .delivered: message.status = .sent - _ = try? self.database.saveMessage(message) - + if let foo = try? self.database.saveMessage(message) { + message = foo + } case .notDelivered(timedOut: let timedOut): if timedOut { message.status = .sendingTimedOut @@ -137,17 +157,23 @@ final class GroupChatViewModel { message.status = .sendingFailed } - _ = try? self.database.saveMessage(message) + if let foo = try? self.database.saveMessage(message) { + message = foo + } } }) ) - message.networkId = report.messageId + print("") + + message.roundURL = report.roundURL message.date = Date.fromTimestamp(Int(report.timestamp)) - try database.saveMessage(message) + message = try database.saveMessage(message) } catch { message.status = .sendingFailed - _ = try? database.saveMessage(message) + if let foo = try? database.saveMessage(message) { + message = foo + } } stagedReply = nil @@ -181,8 +207,9 @@ final class GroupChatViewModel { switch $0 { case .delivered: message.status = .sent - _ = try? self.database.saveMessage(message) - + if let foo = try? self.database.saveMessage(message) { + message = foo + } case .notDelivered(timedOut: let timedOut): if timedOut { message.status = .sendingTimedOut @@ -190,7 +217,9 @@ final class GroupChatViewModel { message.status = .sendingFailed } - _ = try? self.database.saveMessage(message) + if let foo = try? self.database.saveMessage(message) { + message = foo + } } }) ) @@ -200,7 +229,9 @@ final class GroupChatViewModel { message = try database.saveMessage(message) } catch { message.status = .sendingFailed - _ = try? database.saveMessage(message) + if let foo = try? database.saveMessage(message) { + message = foo + } } } diff --git a/Sources/ChatFeature/ViewModels/SingleChatViewModel.swift b/Sources/ChatFeature/ViewModels/SingleChatViewModel.swift index 9a2b59fcd87059f9e7f47d9cf39305aab608685b..78df0880e642e306fc512a71abc0bfdff25b61fa 100644 --- a/Sources/ChatFeature/ViewModels/SingleChatViewModel.swift +++ b/Sources/ChatFeature/ViewModels/SingleChatViewModel.swift @@ -153,7 +153,7 @@ final class SingleChatViewModel: NSObject { ), recipientId: contact.id, retry: 1, - period: "" + period: 1_000 ), callback: .init(handle: { switch $0 { @@ -189,7 +189,7 @@ final class SingleChatViewModel: NSObject { ), recipientId: contact.id, retry: 10, - period: "" + period: 1_000 ), callback: .init(handle: { switch $0 { diff --git a/Sources/ChatListFeature/ViewModel/ChatListViewModel.swift b/Sources/ChatListFeature/ViewModel/ChatListViewModel.swift index c01169dd2144bbcbaaea549952c3a54eb19dc2b0..ac787dd2ea58eeaaa584114991a83f0ca8c88dca 100644 --- a/Sources/ChatListFeature/ViewModel/ChatListViewModel.swift +++ b/Sources/ChatListFeature/ViewModel/ChatListViewModel.swift @@ -185,6 +185,7 @@ final class ChatListViewModel { do { try groupManager.leaveGroup(groupId: group.id) try database.deleteMessages(.init(chat: .group(group.id))) + try database.deleteGroup(group) hudSubject.send(.none) } catch { hudSubject.send(.error(.init(with: error))) diff --git a/Sources/ContactListFeature/Controllers/CreateGroupController.swift b/Sources/ContactListFeature/Controllers/CreateGroupController.swift index a1b276859131ba26ff0bbafaf88aa5ac3c2a777f..cde81579a6e17aa0688f2061949a83e8668b5456 100644 --- a/Sources/ContactListFeature/Controllers/CreateGroupController.swift +++ b/Sources/ContactListFeature/Controllers/CreateGroupController.swift @@ -30,7 +30,10 @@ public final class CreateGroupController: UIViewController { let attString = NSMutableAttributedString(string: text) attString.addAttribute(.font, value: Fonts.Mulish.semiBold.font(size: 18.0) as Any) attString.addAttribute(.foregroundColor, value: Asset.neutralActive.color) - attString.addAttribute(name: .foregroundColor, value: Asset.neutralDisabled.color, betweenCharacters: "#") + attString.addAttributes(attributes: [ + .foregroundColor: Asset.neutralDisabled.color, + .font: Fonts.Mulish.regular.font(size: 15.0) as Any + ], betweenCharacters: "#") titleLabel.attributedText = attString } @@ -162,9 +165,13 @@ public final class CreateGroupController: UIViewController { .receive(on: DispatchQueue.main) .sink { [unowned self] in coordinator.toGroupDrawer( - with: count + 1, + with: count, from: self, { (name, welcome) in - self.viewModel.create(name: name, welcome: welcome, members: self.selectedElements) + self.viewModel.create( + name: name, + welcome: welcome, + members: self.selectedElements + ) } ) }.store(in: &cancellables) diff --git a/Sources/ContactListFeature/ViewModels/CreateDrawerViewModel.swift b/Sources/ContactListFeature/ViewModels/CreateDrawerViewModel.swift index 7369fe9d06625d5e59aa7666d184ea0ae4fc90dc..b47569594d82edaf5b9b92dc9ab0fc6d6fef040a 100644 --- a/Sources/ContactListFeature/ViewModels/CreateDrawerViewModel.swift +++ b/Sources/ContactListFeature/ViewModels/CreateDrawerViewModel.swift @@ -43,7 +43,7 @@ final class CreateDrawerViewModel { return } - guard value.count < 32 else { + guard value.count < 21 else { stateSubject.value.status = .invalid(Localized.CreateGroup.Drawer.maximum) return } diff --git a/Sources/DrawerFeature/Items/DrawerTable.swift b/Sources/DrawerFeature/Items/DrawerTable.swift index 726dae9fe28ccd5720167a7b4ed1944eebf419e5..665b660ea6656c3ad1ddb5a786cdbe7e508be61d 100644 --- a/Sources/DrawerFeature/Items/DrawerTable.swift +++ b/Sources/DrawerFeature/Items/DrawerTable.swift @@ -49,6 +49,7 @@ public final class DrawerTable: DrawerItem { tableView.register(DrawerTableCell.self) tableView.dataSource = dataSource tableView.separatorStyle = .none + tableView.backgroundColor = UIColor.white view.addSubview(tableView) diff --git a/Sources/LaunchFeature/LaunchViewModel.swift b/Sources/LaunchFeature/LaunchViewModel.swift index 37bb82f93d89d4c20d2400ac74bd7642723ff9e5..d1ebfb8c60363001b6b159aeea464ba80c39cadb 100644 --- a/Sources/LaunchFeature/LaunchViewModel.swift +++ b/Sources/LaunchFeature/LaunchViewModel.swift @@ -106,7 +106,7 @@ final class LaunchViewModel { do { try self.setupDatabase() - _ = try SetLogLevel.live(.error) + _ = try SetLogLevel.live(.fatal) RegisterLogWriter.live(.init(handle: { XXLogger.live().debug($0) @@ -210,7 +210,6 @@ final class LaunchViewModel { networkCallbacksCancellable = messenger.cMix.get()!.addHealthCallback(.init(handle: { [weak self] in guard let self = self else { return } - print(">>> healthCallback: \($0)") self.networkMonitor.update($0) })) @@ -476,9 +475,53 @@ extension LaunchViewModel { e2eId: messenger.e2e()!.getId(), groupRequest: .init(handle: { [weak self] group in guard let self = self else { return } - self.handleGroupRequest(from: group) + self.handleGroupRequest(from: group, messenger: messenger) }), - groupChatProcessor: .init(handle: { print(String(data: $0.msg, encoding: .utf8)) }) + groupChatProcessor: .init(handle: { result in + switch result { + case .success(let cb): + + print("Incoming GroupMessage:") + print("- groupId: \(cb.decryptedMessage.groupId.base64EncodedString().prefix(10))...") + print("- senderId: \(cb.decryptedMessage.senderId.base64EncodedString().prefix(10))...") + print("- messageId: \(cb.decryptedMessage.messageId.base64EncodedString().prefix(10))...") + + if let payload = try? Payload(with: cb.decryptedMessage.payload) { + print("- payload.text: \(payload.text)") + + if let reply = payload.reply { + print("- payload.reply.senderId: \(reply.senderId.base64EncodedString().prefix(10))...") + print("- payload.reply.messageId: \(reply.messageId.base64EncodedString().prefix(10))...") + } else { + print("- payload.reply: ∅") + } + } + print("") + + guard let payload = try? Payload(with: cb.decryptedMessage.payload) else { + fatalError("Couldn't decode payload: \(String(data: cb.decryptedMessage.payload, encoding: .utf8) ?? "nil")") + } + + let msg = Message( + networkId: cb.decryptedMessage.messageId, + senderId: cb.decryptedMessage.senderId, + recipientId: nil, + groupId: cb.decryptedMessage.groupId, + date: Date.fromTimestamp(Int(cb.decryptedMessage.timestamp)), + status: .received, + isUnread: true, + text: payload.text, + replyMessageId: payload.reply?.messageId, + roundURL: "https://google.com.br", + fileTransferId: nil + ) + + _ = try? self.database.saveMessage(msg) + + case .failure(let error): + break + } + }) ) DependencyInjection.Container.shared.register(manager) @@ -502,10 +545,7 @@ extension LaunchViewModel { private func generateTrafficManager(messenger: Messenger) throws { let manager = try NewDummyTrafficManager.live( - cMixId: messenger.e2e()!.getId(), - maxNumMessages: 1, - avgSendDeltaMS: 1, - randomRangeMS: 1 + cMixId: messenger.e2e()!.getId() ) DependencyInjection.Container.shared.register(manager) @@ -543,18 +583,23 @@ extension LaunchViewModel { )) do { - if let messenger: Messenger = try? DependencyInjection.Container.shared.resolve() { - if try messenger.verifyContact(contact) { - model.authStatus = .verified - try database.saveContact(model) - } else { - try database.deleteContact(model) - } + let messenger: Messenger = try DependencyInjection.Container.shared.resolve() + print(">>> [messenger.verifyContact] will start") + + if try messenger.verifyContact(contact) { + print(">>> [messenger.verifyContact] verified") + + model.authStatus = .verified + model = try database.saveContact(model) + } else { + print(">>> [messenger.verifyContact] is fake") + try database.deleteContact(model) } } catch { + print(">>> [messenger.verifyContact] thrown an exception: \(error.localizedDescription)") + model.authStatus = .verificationFailed - try! database.saveContact(model) - print(">>> Error \(#file):\(#line): \(error.localizedDescription)") + model = try! database.saveContact(model) } } @@ -580,7 +625,7 @@ extension LaunchViewModel { } } - private func handleGroupRequest(from group: XXClient.Group) { + private func handleGroupRequest(from group: XXClient.Group, messenger: Messenger) { if let _ = try? database.fetchGroups(.init(id: [group.getId()])).first { print(">>> Tried to handle a group request that is already handled") return @@ -594,22 +639,23 @@ extension LaunchViewModel { id: group.getId(), name: String(data: group.getName(), encoding: .utf8)!, leaderId: leader.id, - createdAt: Date.fromTimestamp(Int(group.getCreatedMS())), + createdAt: Date.fromMSTimestamp(group.getCreatedMS()), authStatus: .pending, serialized: group.serialize() )) -// if let initialMessage = String(data: group.getInitMessage(), encoding: .utf8) { -// try! database.saveMessage(.init( -// senderId: leader.id, -// recipientId: nil, -// groupId: group.getId(), -// date: Date.fromTimestamp(Int(group.getCreatedMS())), -// status: .received, -// isUnread: true, -// text: initialMessage -// )) -// } + if let initMessageData = group.getInitMessage(), + let initMessage = String(data: initMessageData, encoding: .utf8) { + try! database.saveMessage(.init( + senderId: leader.id, + recipientId: nil, + groupId: group.getId(), + date: Date.fromMSTimestamp(group.getCreatedMS()), + status: .received, + isUnread: true, + text: initMessage + )) + } let friends = try! database.fetchContacts(.init(id: Set(members.map(\.id)))) let strangers = members.filter { !friends.map(\.id).contains($0.id) } @@ -628,7 +674,7 @@ extension LaunchViewModel { isRecent: false, isBlocked: false, isBanned: false, - createdAt: Date() + createdAt: Date.fromMSTimestamp(group.getCreatedMS()) )) } } @@ -638,9 +684,34 @@ extension LaunchViewModel { _ = try? database.saveGroupMember(model) } -// DispatchQueue.global().async { [weak self] in -// guard let self = self else { return } -// // Multilookup on strangers -// } + print(">>> Performing a multi-lookup for group strangers:") + strangers.enumerated().forEach { + print("- Stranger N\($0.offset): \($0.element.id.base64EncodedString().prefix(10))...") + } + + do { + let multiLookup = try messenger.lookupContacts(ids: strangers.map(\.id)) + + for user in multiLookup.contacts { + print("+ Found stranger w/ id: \(try! user.getId().base64EncodedString().prefix(10))...") + + if var foo = try? self.database.fetchContacts(.init(id: [user.getId()])).first, + let username = try? user.getFact(.username)?.value { + foo.username = username + print("+ Set username: \(username) for \(try! user.getId().base64EncodedString().prefix(10))...") + _ = try? self.database.saveContact(foo) + } + } + + for error in multiLookup.errors { + print("+ Failure on Multilookup: \(error.localizedDescription)") + } + + for failedId in multiLookup.failedIds { + print("+ Failed id: \(failedId.base64EncodedString().prefix(10))...") + } + } catch { + print(">>> Exception on multilookup: \(error.localizedDescription)") + } } } diff --git a/Sources/RequestsFeature/ViewModels/RequestsReceivedViewModel.swift b/Sources/RequestsFeature/ViewModels/RequestsReceivedViewModel.swift index a2e801aa3acc542a5366862fb06212d4a5bd1f6d..7eacdc19544448e73ddcd75ce64f90e0f78364c4 100644 --- a/Sources/RequestsFeature/ViewModels/RequestsReceivedViewModel.swift +++ b/Sources/RequestsFeature/ViewModels/RequestsReceivedViewModel.swift @@ -154,63 +154,21 @@ final class RequestsReceivedViewModel { contact.authStatus = .verificationInProgress try self.database.saveContact(contact) - if contact.email == nil && contact.phone == nil { - let _ = try LookupUD.live( - e2eId: self.messenger.e2e.get()!.getId(), - udContact: self.messenger.ud.get()!.getContact(), - lookupId: contact.id, - callback: .init(handle: { - switch $0 { - case .success(let secondContact): - let ownershipResult = try! self.messenger.e2e.get()!.verifyOwnership( - received: XXClient.Contact.live(contact.marshaled!), - verified: secondContact, - e2eId: self.messenger.e2e.get()!.getId() - ) - - if ownershipResult == true { - contact.authStatus = .verified - _ = try? self.database.saveContact(contact) - } else { - _ = try? self.database.deleteContact(contact) - } - case .failure(let error): - print("^^^ \(#file):\(#line) \(error.localizedDescription)") - contact.authStatus = .verificationFailed - _ = try? self.database.saveContact(contact) - } - }) - ) + print(">>> [messenger.verifyContact] will start") + + if try self.messenger.verifyContact(XXClient.Contact.live(contact.marshaled!)) { + print(">>> [messenger.verifyContact] verified") + + contact.authStatus = .verified + contact = try self.database.saveContact(contact) } else { - let _ = try SearchUD.live( - e2eId: self.messenger.e2e.get()!.getId(), - udContact: self.messenger.ud.get()!.getContact(), - facts: XXClient.Contact.live(contact.marshaled!).getFacts(), - callback: .init(handle: { - switch $0 { - case .success(let results): - let ownershipResult = try! self.messenger.e2e.get()!.verifyOwnership( - received: XXClient.Contact.live(contact.marshaled!), - verified: results.first!, - e2eId: self.messenger.e2e.get()!.getId() - ) - - if ownershipResult == true { - contact.authStatus = .verified - _ = try? self.database.saveContact(contact) - } else { - _ = try? self.database.deleteContact(contact) - } - case .failure(let error): - print("^^^ \(#file):\(#line) \(error.localizedDescription)") - contact.authStatus = .verificationFailed - _ = try? self.database.saveContact(contact) - } - }) - ) + print(">>> [messenger.verifyContact] is fake") + + try self.database.deleteContact(contact) } } catch { - print("^^^ \(#file):\(#line) \(error.localizedDescription)") + print(">>> [messenger.verifyContact] thrown an exception: \(error.localizedDescription)") + contact.authStatus = .verificationFailed _ = try? self.database.saveContact(contact) } @@ -234,11 +192,7 @@ final class RequestsReceivedViewModel { guard let self = self else { return } do { - let trackedId = try self.groupManager - .getGroup(groupId: group.id) - .getTrackedID() - - try self.groupManager.joinGroup(trackedGroupId: trackedId) + try self.groupManager.joinGroup(serializedGroupData: group.serialized) var group = group group.authStatus = .participating diff --git a/Sources/SearchFeature/ViewModels/SearchLeftViewModel.swift b/Sources/SearchFeature/ViewModels/SearchLeftViewModel.swift index 9dbfe2b36b73fca6d5b72fd1d2784240ba2a9a90..9158e35987aba9cb085862328ed5e4e7b2d8daea 100644 --- a/Sources/SearchFeature/ViewModels/SearchLeftViewModel.swift +++ b/Sources/SearchFeature/ViewModels/SearchLeftViewModel.swift @@ -156,14 +156,16 @@ final class SearchLeftViewModel { do { let report = try SearchUD.live( - e2eId: self.messenger.e2e.get()!.getId(), - udContact: self.messenger.ud.get()!.getContact(), - facts: [.init(type: factType, value: content)], + params: .init( + e2eId: self.messenger.e2e.get()!.getId(), + udContact: self.messenger.ud.get()!.getContact(), + facts: [.init(type: factType, value: content)] + ), callback: .init(handle: { switch $0 { case .success(let results): - self.hudSubject.send(.none) - self.appendToLocalSearch( + self.hudSubject.send(.none) + self.appendToLocalSearch( XXModels.Contact( id: try! results.first!.getId(), marshaled: results.first!.data, @@ -178,19 +180,19 @@ final class SearchLeftViewModel { isBanned: false, createdAt: Date() ) - ) - + ) case .failure(let error): - print("^^^ searchUD error: \(error.localizedDescription)") + print(">>> SearchUD error: \(error.localizedDescription)") + self.appendToLocalSearch(nil) self.hudSubject.send(.error(.init(with: error))) } }) ) - print("^^^ report: \(report))") + print(">>> UDSearch.Report: \(report))") } catch { - print("^^^ exception: \(error.localizedDescription)") + print(">>> UDSearch.Exception: \(error.localizedDescription)") } } } diff --git a/Sources/SettingsFeature/ViewModels/AccountDeleteViewModel.swift b/Sources/SettingsFeature/ViewModels/AccountDeleteViewModel.swift index 817c9311a50f3bbe4ac27fc42d20cee0259a9809..fa7592a96e4bc61a26b4ba011f88e19331d33f74 100644 --- a/Sources/SettingsFeature/ViewModels/AccountDeleteViewModel.swift +++ b/Sources/SettingsFeature/ViewModels/AccountDeleteViewModel.swift @@ -28,48 +28,37 @@ final class AccountDeleteViewModel { guard isCurrentlyDeleting == false else { return } isCurrentlyDeleting = true - DispatchQueue.main.async { [weak self] in - guard let self = self else { return } - self.hudSubject.send(.on) - } - - DispatchQueue.global().async { [weak self] in - guard let self = self else { return } - - do { - print(">>> try self.cleanUD()") - try self.cleanUD() + hudSubject.send(.on) - print(">>> try self.messenger.destroy()") - try self.messenger.destroy() + do { + print(">>> try self.cleanUD()") + try cleanUD() - print(">>> try self.keychain.clear()") - try self.keychain.clear() + print(">>> try self.messenger.destroy()") + try messenger.destroy() - print(">>> try database.drop()") - try self.database.drop() + print(">>> try self.keychain.clear()") + try keychain.clear() - print(">>> try self.deleteDatabase()") + print(">>> try database.drop()") + try database.drop() - try self.deleteDatabase() + print(">>> try self.deleteDatabase()") + try deleteDatabase() - UserDefaults.resetStandardUserDefaults() - UserDefaults.standard.removePersistentDomain(forName: Bundle.main.bundleIdentifier!) - UserDefaults.standard.synchronize() + UserDefaults.resetStandardUserDefaults() + UserDefaults.standard.removePersistentDomain(forName: Bundle.main.bundleIdentifier!) + UserDefaults.standard.synchronize() - DispatchQueue.main.async { [weak self] in - guard let self = self else { return } - self.hudSubject.send(.error(.init( - content: "Now kill the app and re-open", - title: "Account deleted", - dismissable: false - ))) - } - } catch { - DispatchQueue.main.async { [weak self] in - guard let self = self else { return } - self.hudSubject.send(.error(.init(with: error))) - } + hudSubject.send(.error(.init( + content: "Now kill the app and re-open", + title: "Account deleted", + dismissable: false + ))) + } catch { + DispatchQueue.main.async { [weak self] in + guard let self = self else { return } + self.hudSubject.send(.error(.init(with: error))) } } } diff --git a/Sources/Shared/AutoGenerated/Strings.swift b/Sources/Shared/AutoGenerated/Strings.swift index 3177da720c32c5e4209fa4dc0c9c1211d6e65b5e..207d794348897f39bcbbf7f0d0278ad933a8ca75 100644 --- a/Sources/Shared/AutoGenerated/Strings.swift +++ b/Sources/Shared/AutoGenerated/Strings.swift @@ -617,7 +617,7 @@ public enum Localized { public static let otherPlaceholder = Localized.tr("Localizable", "createGroup.drawer.otherPlaceholder") /// Secret Family public static let placeholder = Localized.tr("Localizable", "createGroup.drawer.placeholder") - /// You are about to create a group message with %@ users. The information below will be visible to all members of the group. + /// You are about to create a group message with other %@ users. The information below will be visible to all members of the group. public static func subtitle(_ p1: Any) -> String { return Localized.tr("Localizable", "createGroup.drawer.subtitle", String(describing: p1)) } diff --git a/Sources/Shared/Extensions/Date.swift b/Sources/Shared/Extensions/Date.swift index dd0fc91aaa80cfb18e028721d1ae617fd311354b..b88b81b5afcaa830c153f6be4d6af2bf67e74bec 100644 --- a/Sources/Shared/Extensions/Date.swift +++ b/Sources/Shared/Extensions/Date.swift @@ -43,6 +43,10 @@ public extension Date { static func fromTimestamp(_ timestamp: Int) -> Date { Date(timeIntervalSince1970: TimeInterval(timestamp.nanoToSeconds())) } + + static func fromMSTimestamp(_ timestampMS: Int64) -> Date { + Date(timeIntervalSince1970: TimeInterval(timestampMS) / 1000) + } } private extension Int { diff --git a/Sources/Shared/Resources/en.lproj/Localizable.strings b/Sources/Shared/Resources/en.lproj/Localizable.strings index a82b151e1ff1fb0a65ddffb5060c922057679532..0f0ebae69110ac84168b49e9579bc87d02073dc5 100644 --- a/Sources/Shared/Resources/en.lproj/Localizable.strings +++ b/Sources/Shared/Resources/en.lproj/Localizable.strings @@ -983,7 +983,7 @@ "createGroup.drawer.title" = "Create Group"; "createGroup.drawer.subtitle" -= "You are about to create a group message with %@ users. The information below will be visible to all members of the group."; += "You are about to create a group message with other %@ users. The information below will be visible to all members of the group."; "createGroup.drawer.input" = "Group Name"; "createGroup.drawer.otherInput" diff --git a/client-ios.xcworkspace/xcshareddata/swiftpm/Package.resolved b/client-ios.xcworkspace/xcshareddata/swiftpm/Package.resolved index d3858a43bd13a0e810a8b9c2db8ed5858dcaf12b..04bc2eac29e0142717c1064a139755b2e83cf40d 100644 --- a/client-ios.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/client-ios.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -23,8 +23,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/openid/AppAuth-iOS.git", "state" : { - "revision" : "33660c271c961f8ce1084cc13f2ea8195e864f7d", - "version" : "1.5.0" + "revision" : "3d36a58a2b736f7bc499453e996a704929b25080", + "version" : "1.6.0" } }, { @@ -50,8 +50,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/ekazaev/ChatLayout", "state" : { - "revision" : "88cbfc1c5c371be5fd51eaded329eb61386495dc", - "version" : "1.2.5" + "revision" : "5c448c6b14a4c2755b96341b709352654e3d2115", + "version" : "1.2.6" } }, { @@ -68,8 +68,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/combine-schedulers", "state" : { - "revision" : "11973960af9c5426f22d337628cec4342c5e660d", - "version" : "0.7.4" + "revision" : "aa3e575929f2bcc5bad012bd2575eae716cbcdf7", + "version" : "0.8.0" } }, { @@ -99,15 +99,6 @@ "version" : "1.3.0" } }, - { - "identity" : "elixxir-dapps-sdk-swift", - "kind" : "remoteSourceControl", - "location" : "https://git.xx.network/elixxir/elixxir-dapps-sdk-swift", - "state" : { - "branch" : "development", - "revision" : "5b190dca4d200203cbe371a6f8e179842d459176" - } - }, { "identity" : "fileprovider", "kind" : "remoteSourceControl", @@ -158,8 +149,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleSignIn-iOS", "state" : { - "revision" : "5ce850448e89500aca5b095af7247eb46dc0ca18", - "version" : "6.2.3" + "revision" : "9c9b36af86a4dd3da16048a36cf37351e63ccfe1", + "version" : "6.2.4" } }, { @@ -167,8 +158,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleUtilities.git", "state" : { - "revision" : "f4abe56ce62a779e64b525eb133c8fc2a84bbc1f", - "version" : "7.7.1" + "revision" : "22907832079d808e82f1182b21af58ef3880666f", + "version" : "7.8.0" } }, { @@ -203,8 +194,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GTMAppAuth.git", "state" : { - "revision" : "b9d1683be336ba8c8d1c6867bafeb056a5399700", - "version" : "1.3.0" + "revision" : "6dee0cde8a1b223737a5159e55e6b4ec16bbbdd9", + "version" : "1.3.1" } }, { @@ -310,8 +301,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-case-paths", "state" : { - "revision" : "a09839348486db8866f85a727b8550be1d671c50", - "version" : "0.9.1" + "revision" : "7346701ea29da0a85d4403cf3d7a589a58ae3dee", + "version" : "0.9.2" } }, { @@ -328,8 +319,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-composable-architecture.git", "state" : { - "revision" : "cbe013b42b3c368957f8f882c960b93845e1589d", - "version" : "0.40.1" + "revision" : "9ea8c763061287052a68d5e6723fed45e898b7d9", + "version" : "0.40.2" } }, { @@ -337,8 +328,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-custom-dump.git", "state" : { - "revision" : "21ec1d717c07cea5a026979cb0471dd95c7087e7", - "version" : "0.5.0" + "revision" : "c9b6b940d95c0a925c63f6858943415714d8a981", + "version" : "0.5.2" } }, { @@ -346,8 +337,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-identified-collections", "state" : { - "revision" : "2d6b7ffcc67afd9077fac5e5a29bcd6d39b71076", - "version" : "0.4.0" + "revision" : "bfb0d43e75a15b6dfac770bf33479e8393884a36", + "version" : "0.4.1" } }, { @@ -391,8 +382,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay.git", "state" : { - "revision" : "38bc9242e4388b80bd23ddfdf3071428859e3260", - "version" : "0.4.0" + "revision" : "30314f1ece684dd60679d598a9b89107557b67d9", + "version" : "0.4.1" } } ],