Commit Graph

214 Commits

Author SHA1 Message Date
Morgan Pretty f7fd15dae0 Finished removing usages to non-theme colour variables
Updated theming throughout
Fixed a couple of bugs with the media gallery
2022-09-20 16:06:01 +10:00
Morgan Pretty 1bc6b0bdba Merge remote-tracking branch 'upstream/dev' into feature/theming
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Conversations/ConversationVC+Interaction.swift
#	Session/Conversations/ConversationVC.swift
#	Session/Conversations/ConversationViewModel.swift
#	Session/Conversations/Message Cells/VisibleMessageCell.swift
#	Session/Home/HomeVC.swift
#	Session/Home/Message Requests/MessageRequestsViewController.swift
#	Session/Media Viewing & Editing/MediaTileViewController.swift
#	Session/Meta/AppDelegate.swift
#	Session/Meta/Translations/de.lproj/Localizable.strings
#	Session/Meta/Translations/en.lproj/Localizable.strings
#	Session/Meta/Translations/es.lproj/Localizable.strings
#	Session/Meta/Translations/fa.lproj/Localizable.strings
#	Session/Meta/Translations/fi.lproj/Localizable.strings
#	Session/Meta/Translations/fr.lproj/Localizable.strings
#	Session/Meta/Translations/hi.lproj/Localizable.strings
#	Session/Meta/Translations/hr.lproj/Localizable.strings
#	Session/Meta/Translations/id-ID.lproj/Localizable.strings
#	Session/Meta/Translations/it.lproj/Localizable.strings
#	Session/Meta/Translations/ja.lproj/Localizable.strings
#	Session/Meta/Translations/nl.lproj/Localizable.strings
#	Session/Meta/Translations/pl.lproj/Localizable.strings
#	Session/Meta/Translations/pt_BR.lproj/Localizable.strings
#	Session/Meta/Translations/ru.lproj/Localizable.strings
#	Session/Meta/Translations/si.lproj/Localizable.strings
#	Session/Meta/Translations/sk.lproj/Localizable.strings
#	Session/Meta/Translations/sv.lproj/Localizable.strings
#	Session/Meta/Translations/th.lproj/Localizable.strings
#	Session/Meta/Translations/vi-VN.lproj/Localizable.strings
#	Session/Meta/Translations/zh-Hant.lproj/Localizable.strings
#	Session/Meta/Translations/zh_CN.lproj/Localizable.strings
#	Session/Onboarding/LandingVC.swift
#	SessionMessagingKitTests/_TestUtilities/MockGeneralCache.swift
2022-09-15 14:22:11 +10:00
ryanzhao c121f99b22 Merge branch 'dev' into add-silence-audio 2022-09-13 15:54:36 +10:00
Morgan Pretty c707a2f80c Started refactoring the conversation image picker screens
Fixed a bug where returning from the background on the conversation screen would result in the input view being hidden
Refactored the PhotoCollectionPickerViewController to use the SettingsTableViewController convention
Updated the SettingsTableViewModel to worked based on Combine instead of the DatabaseObservable so it's more reusable for non-db cases
2022-09-08 11:22:36 +10:00
Morgan Pretty face9da02b Fixed search performance, started styling in-conversaiton settings
Fixed a bug where the scroll to bottom button wasn't working
Fixed an issue where searching was running on the main thread (which could cause UI issues)
Updated the searching to interrupt the previous query when the search term changes
Updated the in-conversation settings to be use the new config-based approach (deleted the OWSConversationSettingsViewController)
2022-09-07 17:37:01 +10:00
Morgan Pretty fc860e3957 Added fixes and defensive coding for a number of crashes
Fixed a crash which could occur due to multithreaded dependency access
Fixed a crash which could occur if the 'keyWindow' wasn't set on the LandingVC in time since we were force-unwrapping
Fixed a crash which could occur due to multithreaded swarm cache access
Fixed the broken unit tests
2022-08-30 09:45:40 +10:00
Morgan Pretty c82ee0c44b Finished off the updated settings sections and fixed a couple of bugs
Added the Blocked contacts screen
Added a setting to control whether concurrent audio messages should auto-play
Finished updating the settings screens
Fixed an issue where items that should be removed from the PagedDatabaseObserver due to filter logic weren't getting removed in some cases
2022-08-26 14:09:41 +10:00
Morgan Pretty a1e88329db Merge branch 'dev' into feature/theming
# Conflicts:
#	Podfile.lock
#	Session.xcodeproj/project.pbxproj
#	Session/Conversations/Message Cells/VisibleMessageCell.swift
#	Session/Meta/Translations/de.lproj/Localizable.strings
#	Session/Meta/Translations/en.lproj/Localizable.strings
#	Session/Meta/Translations/es.lproj/Localizable.strings
#	Session/Meta/Translations/fa.lproj/Localizable.strings
#	Session/Meta/Translations/fi.lproj/Localizable.strings
#	Session/Meta/Translations/fr.lproj/Localizable.strings
#	Session/Meta/Translations/hi.lproj/Localizable.strings
#	Session/Meta/Translations/hr.lproj/Localizable.strings
#	Session/Meta/Translations/id-ID.lproj/Localizable.strings
#	Session/Meta/Translations/it.lproj/Localizable.strings
#	Session/Meta/Translations/ja.lproj/Localizable.strings
#	Session/Meta/Translations/nl.lproj/Localizable.strings
#	Session/Meta/Translations/pl.lproj/Localizable.strings
#	Session/Meta/Translations/pt_BR.lproj/Localizable.strings
#	Session/Meta/Translations/ru.lproj/Localizable.strings
#	Session/Meta/Translations/si.lproj/Localizable.strings
#	Session/Meta/Translations/sk.lproj/Localizable.strings
#	Session/Meta/Translations/sv.lproj/Localizable.strings
#	Session/Meta/Translations/th.lproj/Localizable.strings
#	Session/Meta/Translations/vi-VN.lproj/Localizable.strings
#	Session/Meta/Translations/zh-Hant.lproj/Localizable.strings
#	Session/Meta/Translations/zh_CN.lproj/Localizable.strings
#	Session/Notifications/AppNotifications.swift
#	SessionMessagingKit/Shared Models/MessageViewModel.swift
#	SessionMessagingKit/Shared Models/SessionThreadViewModel.swift
#	SignalUtilitiesKit/Profile Pictures/ProfilePictureView.swift
2022-08-26 13:24:42 +10:00
Morgan Pretty 823006a892 Updated the colours to source from direct theme values (instead of individual)
Removed an unused notification
Refactored the PrivacySettingsViewController
Refactored the ScreenLock code to Swift
Fixed an issue where the match dark/light setting wasn't getting applied on launch
Update the modal styling for the various settings modals
2022-08-24 17:33:10 +10:00
Ryan Zhao c7c92f747c Merge branch 'various-bugs-and-optimisations' into emoji-reacts 2022-08-22 11:30:06 +10:00
Morgan Pretty 7097853d58 A few bugs fixes and some optimisations
Fixed a bug where notifications could incorrectly appear for messages in the current thread
Fixed a bug where swiping left/right on images in the MediaDetailViewController could load images from other threads
Fixed a bug where the unread count wouldn't appear correctly when opening a conversation
Fixed a bug where the unread count on the conversation cell could get truncated
Fixed a bug where notifications weren't working correctly when the app is in the foreground
Fixed a bug where we weren't clearing the 'received X new messages' count when in the foreground
Fixed a bug where outgoing messages could get marked as read in a very specific case
Updated the "group notification" logic to only apply to Open Groups (and always doing it rather than just in the background)
Added a placeholder person icon when you have a closed group with a single member
Added a couple of indexes to improve the HomeVC database query performance (reduce launch time by ~15% in some cases)
Added a background task to give message sending the chance to complete when sending the app to the background
Removed an unneeded query from the HomeViewModel init (reduce launch time by ~10% in some cases)
Optimised one of the queries used to load the data needed for the conversation screen
2022-08-19 16:58:47 +10:00
ryanzhao f93820362c add silence audio file 2022-08-17 14:19:14 +10:00
ryanzhao c26e6f7e9e Merge branch 'dev' into emoji-reacts 2022-08-17 11:00:06 +10:00
Morgan Pretty 20d63d106c Updated the app settings screens
Updated the MessageRequestViewModel to have the same page size as the HomeViewModel
Fixed a couple minor UI discrepancies
Refactored the old app settings child screens to be configuration based and all in Swift
2022-08-17 10:51:14 +10:00
Morgan Pretty 362986e73a Fixed a bug where the notification sound "preview" playing wasn't working 2022-08-17 10:02:23 +10:00
Morgan Pretty d56cee8234 Progressing on theming functionality
Created the ThemeManager and the system to control the dynamic theming
Started updating the main settings screens
Added the AppearanceViewController and connected it to the ThemeManager
Started adding theme values
Started applying theme values throughout
2022-08-12 13:35:17 +10:00
ryanzhao 8920cbdc28 Merge branch 'database-refactor' into emoji-reacts 2022-07-29 09:15:36 +10:00
Morgan Pretty 9859cf95a4 Attempted to fix the notification & call reporting issues
Fixed an issue where fileIds weren't correctly getting sent along with open group messages
Fixed an issue where the screens could miss updates if the device was locked with the app in the foreground and then later unlocked after receiving notifications
Added an optimisation to prevent attempting to send a message after it has been deleted
Added logic to report fake calls if the code goes down an invalid code path when handling a call (to prevent Apple blocking the app)
Delayed the core which clears notifications to increase the time the app has to handle interactions (just in case it was a race condition)
2022-07-25 17:03:09 +10:00
Morgan Pretty c25f378c54 Merge branch 'feature/database-refactor' into emoji-reacts
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Conversations/Context Menu/ContextMenuVC+Action.swift
#	Session/Conversations/Context Menu/ContextMenuVC+ActionView.swift
#	Session/Conversations/Context Menu/ContextMenuVC.swift
#	Session/Conversations/ConversationVC+Interaction.swift
#	Session/Conversations/ConversationVC.swift
#	Session/Conversations/ConversationViewItem.h
#	Session/Conversations/ConversationViewItem.m
#	Session/Conversations/Message Cells/Content Views/LinkPreviewView.swift
#	Session/Conversations/Message Cells/MessageCell.swift
#	Session/Conversations/Message Cells/VisibleMessageCell.swift
#	Session/Conversations/Views & Modals/BodyTextView.swift
#	Session/Meta/Translations/en.lproj/Localizable.strings
#	Session/Shared/UserCell.swift
#	SessionMessagingKit/Jobs/MessageSendJob.swift
#	SessionMessagingKit/Messages/Signal/TSMessage.h
#	SessionMessagingKit/Messages/Signal/TSMessage.m
#	SessionMessagingKit/Messages/Visible Messages/VisibleMessage.swift
#	SessionMessagingKit/Open Groups/OpenGroupAPIV2.swift
#	SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift
#	SessionMessagingKit/Sending & Receiving/Notifications/NotificationsProtocol.h
#	SessionMessagingKit/Sending & Receiving/Pollers/OpenGroupPollerV2.swift
#	SessionMessagingKit/Utilities/General.swift
#	SessionNotificationServiceExtension/NSENotificationPresenter.swift
#	SignalUtilitiesKit/Utilities/DisplayableText.swift
#	SignalUtilitiesKit/Utilities/NoopNotificationsManager.swift
#	SignalUtilitiesKit/Utilities/Notification+Loki.swift
2022-07-25 15:39:56 +10:00
Morgan Pretty 5b6be3912d Fixed an edge-case crash, a couple of minor bugs and made future-proofing tweaks
Fixed a bit of the OnionRequest error handling to better send through server error messages for debugging
Fixed a bug where the initial offset could be negative if the number of messages was less than the page size resulting in a crash
Fixed a crash due to a code path which was thought to be impossible exiting but is actually possible (so just erroring)
Added the 'expire' SnodeAPI endpoint
Removed the 'openGroupServerTimestamp' property (was unused and just added confusion)
Updated the logic to always handle the 'fileId' for uploads/downloads as a string instead of casting it to an Int64
Updated the OpenGroup room parsing to support either Int or String values for image ids
2022-07-12 17:43:52 +10:00
Morgan Pretty 4afddd6fbb Fixed a number of reported bugs, some cleanup, added animated profile support
Added support for animated profile images (no ability to crop/resize)
Updated the message trimming to only remove messages if the open group has 2000 messages or more
Updated the message trimming setting to default to be on
Updated the ContextMenu to fade out the snapshot as well (looked buggy if the device had even minor lag)
Updated the ProfileManager to delete and re-download invalid avatar images (and updated the conversation screen to reload when avatars complete downloading)
Updated the message request notification logic so it will show notifications when receiving a new message request as long as the user has read all the old ones (previously the user had to accept/reject all the old ones)
Fixed a bug where the "trim open group messages" toggle was accessing UI off the main thread
Fixed a bug where the "Chats" settings screen had a close button instead of a back button
Fixed a bug where the 'viewsToMove' for the reply UI was inconsistent in some places
Fixed an issue where the ProfileManager was doing all of it's validation (and writing to disk) within the database write closure which would block database writes unnecessarily
Fixed a bug where a message request wouldn't be identified as such just because it wasn't visible in the conversations list
Fixed a bug where opening a message request notification would result in the message request being in the wrong state (also wouldn't insert the 'MessageRequestsViewController' into the hierarchy)
Fixed a bug where the avatar image wouldn't appear beside incoming closed group message in some situations cases
Removed an error log that was essentially just spam
Remove the logic to delete old profile images when calling save on a Profile (wouldn't get called if the row was modified directly and duplicates GarbageCollection logic)
Remove the logic to send a notification when calling save on a Profile (wouldn't get called if the row was modified directly)
Tweaked the message trimming description to be more accurate
Cleaned up some duplicate logic used to determine if a notification should be shown
Cleaned up some onion request logic (was passing the version info in some cases when not needed)
Moved the push notification notify API call into the PushNotificationAPI class for consistency
2022-07-08 17:53:48 +10:00
Morgan Pretty 34fea96db3 Fixed a bunch more bugs around push notifications and avatars
Added code to prevent the garbage collection job from auto-running more often than once every 23 hours
Fixed a bug where if the first avatar you try to add is your own, it could fail due to the folder not getting created
Fixed a bug where updating your profile would store and send an invalid profile picture url against your profile
Fixed an issue where the closed group icon wouldn't appear as the double icon when it couldn't retrieve a second profile
Fixed a bug where the device might not correctly register for push notifications in some cases
Fixed a bug where interacting with a notification when the app is in the background (but not closed) wasn't doing anything
Fixed a bug where the SyncPushTokensJob wouldn't re-run correctly in some cases if the user was already registered
Updated the profile avatar downloading logic to only download avatars if they have been updated
Updated the migration and OpenGroupManager to force Session-run open groups to always use the OpenGroupAPI.defaultServer value
2022-07-04 17:36:48 +10:00
Morgan Pretty cdb211b72a Applied the "increase min version to iOS 13" changes 2022-07-01 13:33:00 +10:00
Morgan Pretty 8cf2a57fcc Renamed GRDBStorage to Storage (no use having the prefix anymore since the old DB is deprecated) 2022-07-01 13:08:45 +10:00
Morgan Pretty eb0118ac10 Fixed a few more bugs and tweaked attachment download logic
Updated the code to only auto-start attachment downloads when a user opens a conversation (and only for the current page of messages)
Updated the GarbageCollectionJob to default to handling all cases (instead of requiring the cases to be defined) - this means we can add future cases without having to recreate the default job
Added logic to remove approved blinded contact records as part of the GarbageCollectionJob
Added code to better handle "invalid" attachments when migrating
Added a mechanism to retrieve the details for currently running jobs (ie. allows us to check for duplicate concurrent jobs)
Resolved the remaining TODOs in the GRDB migration code
Cleaned up DB update logic to update only the targeted columns
Fixed a bug due to a typo in a localised string
Fixed a bug where link previews without images or with custom copy weren't being processed as link previews
Fixed a bug where Open Groups could display with an empty name value
2022-07-01 12:52:41 +10:00
Morgan Pretty f2bd72b3ae Fixed a couple more bugs
Fixed an issue with updating the users profile image
Fixed an annoying bug where the conversation screen would "bounce" when initial loading
2022-06-30 17:48:43 +10:00
Morgan Pretty c7e8071dd1 Fixed a large number of bugs and added a setting to control open group message deletion
Added a setting to control whether open group messages older than 6 months should be pruned
Added some defensive coding to prevent an edge-case which could cause a crash (wasn't filtering out a potential invalid row from the home screen data)
Fixed a bug where preOffer call messages weren't correctly sending push notifications
Fixed a bug where all incoming calls would be rejected and seen as calls disabled
Fixed a bug where the copy on call info messages was displaying the sender's name instead of the thread contact's name for outgoing calls
Fixed a bug where the input view wouldn't appear when creating new DM conversations
Fixed a bug where threads might not show the message request approval UI
Fixed an issue where some logic might not have run correctly when first registering an account
Fixed a bug where the note to self thread could incorrectly appear when restoring a device
Updated the GarbageCollectionJob to run onActive instead of onLaunch (since it's likely we will rarely launch)
Updated the logic for erasing an account from a device
2022-06-29 18:10:10 +10:00
Morgan Pretty 20dc74bc96 Added paging to the Home/MessageRequests screens and fix a bunch of bugs
Added a cache to the Identicon to prevent unneeded image generation
Replaced some 'withTint' calls to use the standard 'withRenderingMode' instead
Fixed a bug where the background would remain when swiping to reply
Fixed a crash which could occur with String-based settings
Fixed an issue where all messages in a thread wouldn't get marked as read when opening the thread (ie. existing behaviour)
Fixed a bug where going to the all media screen from a specific
Fixed a bug where the 'areCallsEnabled' preference wasn't getting migrated
Fixed a bug where you couldn't join any of the default open groups
Fixed a bug where it was polling for the invalid placeholder default open group
Fixed a few threading issues related to PromiseKit defaulting to run on the main thread
Updated and number of processes to run on "default" priority queues intead of "userInitiated" ones (since the docs suggest those are blocking)
Optimised the PagedDatabaseObserver to do a much more efficient count query
Updated the PagedDatabaseObserver to allow for triggering content updates when data changes outside of the paged or associated tables changes
Updated the HomeVC and MessageRequestsViewController to use paged queries
Made some optimisations to prevent unneeded database changes
2022-06-24 18:29:45 +10:00
Morgan Pretty a998cadbb7 Fixed the broken unit tests
Fixed a few bugs uncovered by the unit tests
2022-06-22 14:27:34 +10:00
ryanzhao 4934714eae feat: rate limit 2022-06-22 13:51:36 +10:00
Morgan Pretty 153880cf4d Fixed a few bugs and continued work on fixing unit tests
Fixed a bug where notifications might not work for messages
Fixed a bug where auto-playing audio messages wouldn't update the states correctly
Fixed a bug where a user wouldn't be able to join an open group with blinding enabled
2022-06-21 17:43:27 +10:00
Morgan Pretty 1720e85e8f Updated the Sodium library to fix a production linker error
Fixed a missing import/public modifier
2022-06-20 18:12:19 +10:00
Morgan Pretty 428cc95ec2 Started working on fixing the broken unit tests
Updated the GRDB storage to support custom writer injection
2022-06-16 14:30:14 +10:00
Morgan Pretty eeccfb47d5 Fixed all of the build errors from merge, migrated Call logic, started idBlinding migration and bug fixes
Fixed some broken file paths
Fixed a couple of bugs with closed groups
Fixed a few migration issues
Fixed a bug with the ProfilePictureView in open groups (was including the open parenthesis in the initials)
Migrated the Id Blinding changes to work with GRDB
Migrated the call logic to work with GRDB
Updated the code to work the with hard fork changes
2022-06-09 18:37:44 +10:00
Morgan Pretty 290bce5ce0 Merge branch 'feature/session-id-blinding-part-2' into feature/database-refactor
# Conflicts:
#	Podfile
#	Podfile.lock
#	Session.xcodeproj/project.pbxproj
#	Session/Closed Groups/EditClosedGroupVC.swift
#	Session/Closed Groups/NewClosedGroupVC.swift
#	Session/Conversations/Context Menu/ContextMenuVC+Action.swift
#	Session/Conversations/Context Menu/ContextMenuVC.swift
#	Session/Conversations/ConversationMessageMapping.swift
#	Session/Conversations/ConversationSearch.swift
#	Session/Conversations/ConversationVC+Interaction.swift
#	Session/Conversations/ConversationVC.swift
#	Session/Conversations/ConversationViewItem.h
#	Session/Conversations/ConversationViewItem.m
#	Session/Conversations/ConversationViewModel.m
#	Session/Conversations/Input View/InputView.swift
#	Session/Conversations/Input View/MentionSelectionView.swift
#	Session/Conversations/LongTextViewController.swift
#	Session/Conversations/Message Cells/Content Views/LinkPreviewView.swift
#	Session/Conversations/Message Cells/MessageCell.swift
#	Session/Conversations/Message Cells/VisibleMessageCell.swift
#	Session/Conversations/Settings/OWSConversationSettingsViewController.m
#	Session/Conversations/Views & Modals/ConversationTitleView.swift
#	Session/Conversations/Views & Modals/DownloadAttachmentModal.swift
#	Session/Conversations/Views & Modals/JoinOpenGroupModal.swift
#	Session/Conversations/Views & Modals/LinkPreviewModal.swift
#	Session/Conversations/Views & Modals/MessagesTableView.swift
#	Session/Conversations/Views & Modals/URLModal.swift
#	Session/Home/GlobalSearch/GlobalSearchViewController.swift
#	Session/Home/HomeVC.swift
#	Session/Home/Message Requests/MessageRequestsViewController.swift
#	Session/Media Viewing & Editing/MediaDetailViewController.m
#	Session/Media Viewing & Editing/MediaPageViewController.swift
#	Session/Meta/AppDelegate.m
#	Session/Meta/AppDelegate.swift
#	Session/Meta/AppEnvironment.swift
#	Session/Meta/Signal-Bridging-Header.h
#	Session/Meta/Translations/en.lproj/Localizable.strings
#	Session/Meta/Translations/hi.lproj/Localizable.strings
#	Session/Meta/Translations/si.lproj/Localizable.strings
#	Session/Meta/Translations/zh-Hant.lproj/Localizable.strings
#	Session/Notifications/AppNotifications.swift
#	Session/Open Groups/JoinOpenGroupVC.swift
#	Session/Settings/NukeDataModal.swift
#	Session/Settings/SeedModal.swift
#	Session/Settings/SettingsVC.swift
#	Session/Settings/ShareLogsModal.swift
#	Session/Shared/ConversationCell.swift
#	Session/Shared/UserSelectionVC.swift
#	Session/Utilities/BackgroundPoller.swift
#	Session/Utilities/MentionUtilities.swift
#	Session/Utilities/MockDataGenerator.swift
#	SessionMessagingKit/Database/OWSPrimaryStorage.m
#	SessionMessagingKit/Database/SSKPreferences.swift
#	SessionMessagingKit/Database/Storage+Contacts.swift
#	SessionMessagingKit/Database/Storage+Jobs.swift
#	SessionMessagingKit/Database/Storage+Messaging.swift
#	SessionMessagingKit/Database/Storage+OpenGroups.swift
#	SessionMessagingKit/Database/TSDatabaseView.m
#	SessionMessagingKit/File Server/FileServerAPIV2.swift
#	SessionMessagingKit/Jobs/AttachmentDownloadJob.swift
#	SessionMessagingKit/Jobs/AttachmentUploadJob.swift
#	SessionMessagingKit/Jobs/JobQueue.swift
#	SessionMessagingKit/Jobs/MessageReceiveJob.swift
#	SessionMessagingKit/Jobs/MessageSendJob.swift
#	SessionMessagingKit/Jobs/NotifyPNServerJob.swift
#	SessionMessagingKit/Messages/Control Messages/ClosedGroupControlMessage.swift
#	SessionMessagingKit/Messages/Control Messages/ConfigurationMessage+Convenience.swift
#	SessionMessagingKit/Messages/Message+Destination.swift
#	SessionMessagingKit/Messages/Signal/TSIncomingMessage.h
#	SessionMessagingKit/Messages/Signal/TSIncomingMessage.m
#	SessionMessagingKit/Messages/Signal/TSInfoMessage.h
#	SessionMessagingKit/Messages/Signal/TSInfoMessage.m
#	SessionMessagingKit/Messages/Signal/TSInteraction.h
#	SessionMessagingKit/Messages/Signal/TSInteraction.m
#	SessionMessagingKit/Messages/Signal/TSMessage.h
#	SessionMessagingKit/Messages/Signal/TSMessage.m
#	SessionMessagingKit/Open Groups/OpenGroupAPIV2+ObjC.swift
#	SessionMessagingKit/Open Groups/OpenGroupAPIV2.swift
#	SessionMessagingKit/Open Groups/OpenGroupManagerV2.swift
#	SessionMessagingKit/Open Groups/OpenGroupMessageV2.swift
#	SessionMessagingKit/Sending & Receiving/Mentions/MentionsManager.swift
#	SessionMessagingKit/Sending & Receiving/MessageReceiver+Decryption.swift
#	SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift
#	SessionMessagingKit/Sending & Receiving/MessageReceiver.swift
#	SessionMessagingKit/Sending & Receiving/MessageSender+ClosedGroups.swift
#	SessionMessagingKit/Sending & Receiving/MessageSender+Encryption.swift
#	SessionMessagingKit/Sending & Receiving/MessageSender.swift
#	SessionMessagingKit/Sending & Receiving/Notifications/NotificationsProtocol.h
#	SessionMessagingKit/Sending & Receiving/Pollers/ClosedGroupPoller.swift
#	SessionMessagingKit/Sending & Receiving/Pollers/OpenGroupPollerV2.swift
#	SessionMessagingKit/Sending & Receiving/Pollers/Poller.swift
#	SessionMessagingKit/Storage.swift
#	SessionMessagingKit/Threads/Notification+Thread.swift
#	SessionMessagingKit/Threads/TSContactThread.h
#	SessionMessagingKit/Threads/TSContactThread.m
#	SessionMessagingKit/Threads/TSGroupModel.h
#	SessionMessagingKit/Threads/TSGroupModel.m
#	SessionMessagingKit/Threads/TSGroupThread.m
#	SessionMessagingKit/Utilities/General.swift
#	SessionNotificationServiceExtension/NSENotificationPresenter.swift
#	SessionNotificationServiceExtension/NotificationServiceExtension.swift
#	SessionSnodeKit/OnionRequestAPI+Encryption.swift
#	SessionSnodeKit/OnionRequestAPI.swift
#	SessionSnodeKit/SnodeAPI.swift
#	SessionSnodeKit/SnodeMessage.swift
#	SessionSnodeKit/Storage+SnodeAPI.swift
#	SessionSnodeKit/Storage.swift
#	SessionUtilitiesKit/General/Array+Utilities.swift
#	SessionUtilitiesKit/General/Dictionary+Utilities.swift
#	SessionUtilitiesKit/General/SNUserDefaults.swift
#	SessionUtilitiesKit/General/Set+Utilities.swift
#	SessionUtilitiesKit/Meta/SessionUtilitiesKit.h
#	SessionUtilitiesKit/Utilities/Optional+Utilities.swift
#	SessionUtilitiesKit/Utilities/Sodium+Conversion.swift
#	SignalUtilitiesKit/Configuration.swift
#	SignalUtilitiesKit/Database/Migrations/OpenGroupServerIdLookupMigration.swift
#	SignalUtilitiesKit/Messaging/FullTextSearcher.swift
#	SignalUtilitiesKit/Messaging/Sending & Receiving/MessageSender+Convenience.swift
#	SignalUtilitiesKit/Profile Pictures/Identicon+ObjC.swift
#	SignalUtilitiesKit/To Do/OWSProfileManager.m
#	SignalUtilitiesKit/Utilities/NoopNotificationsManager.swift
#	SignalUtilitiesKit/Utilities/UIView+OWS.swift
2022-06-08 14:29:51 +10:00
Morgan Pretty 4dced25e85 Removed an initial request occurring when pushing the conversation screen (could hold up main thread)
Removed the old OWSPreferences file (everything left over seems to be unused)
2022-06-03 16:44:29 +10:00
Morgan Pretty cf1f1b0e1a Added code so the 'isUserMentioned' flag should support mentions within open groups
Added the new storage methods to MockStorage
Fixed an odd bug where the 'isBackgroundPoll' flag could have been coded incorrectly preventing the MessageReceiveJob from getting processed
2022-06-02 16:32:05 +10:00
Morgan Pretty 93b54a3b7d Added logic for the GarbageCollectionJob
Fixed a bug where the GalleryRailView wasn't appearing
Fixed a database reentrancy error
Fixed a bug where the threadId for migrated attachmentUpload jobs wasn't getting set to the non-legacy version
Deleted the buggy overwritten 'delete' methods to avoid confusion
Updated the GroupMember table to cascade delete if it's thread is deleted (can't do so for the Closed/Open group but they share the same id conveniently)
Updated the 'isRunningTests' to be based on the existence of XCInjectBundleInfo which seems to be more consistent than the old approach
2022-06-02 14:13:07 +10:00
Morgan Pretty 59696f7d2c Removed all the old Storage classes and YapDB extensions
Removed the AppUpdateNag code (unused)
Removed the Mantle dependency
2022-06-01 17:41:20 +10:00
Morgan Pretty 18d833f152 Optimised the home screen query (~50% speed improvement)
Updated to the latest version of GRDB
Renamed some variables for clarity
Updated the "seed viewed" banner on the HomeVC to be driven by a database setting to be consistent with other UI changes
2022-06-01 16:50:21 +10:00
Morgan Pretty 8ff542405c Finished of the Conversation screen and JobQueue concurrency
Updated the migrations to indicate progress (Potential to base progress for the "processing" sections on the file size of the legacy database)
Updated the JobRunner to properly support concurrent queues for sending/receiving (other queues are still serial)
Added the typing indicator logic into the ConversationVC
Put code into SUKLegacy for connecting to the YDB database
Fixed a couple of minor UI bugs with the GalleryRailView
Updated the media gallery selection screen to use the appropriate system theme colouring (was painful to randomly swap from dark mode to like for one screen...)
Added an alert for when the database migration fails
Deleted the legacy migrations (manually applying any unapplied changes as part of the YDB to GRDB migration process)
2022-05-31 17:41:02 +10:00
Morgan Pretty 26c7a5022a Added a simple migration progress indicator and animation (need timing tweaks)
Cleaned up the creation of the GRDBStorage instance
Fixed an issue where the launch screen wasn't setting it's background colour based on the system setting
Renamed the GRDBStorageError to StorageError (in preparation of legacy 'Storage' relocation)
Consolidated the two Environment classes (in Swift)
Refactored the AppSetup class to Swift
2022-05-30 13:04:26 +10:00
Morgan Pretty e2ee0e94ee Finished of the conversation screen and resolved a bug of bugs/TODOs
Fixed a number of scrolling behaviours in the ConversationVC
Fixed a bug with the PagedDataObserver when observing associated data (multiple associations with a single paged result were broken)
Fixed a bug with the PagedDataObserver where it would trigger updates for new entries even if the user is offset from the latest data
Fixed a bug where marking as read wasn't working properly
Fixed a bug where outgoing messages were being considered unread
Added an error state for a failed attachment send
Renamed a few types for clarity
Resolved a bunch of TODOs
2022-05-29 19:26:06 +10:00
Morgan Pretty 45d0faee6a Cleaned up the rest of the search functionality
Removed some debug text which appearing in the in-conversation search UI
Fixed a number of small UI glitches
2022-05-27 18:37:59 +10:00
Morgan Pretty cfb8f1615a Migrated a couple more preferences 2022-05-23 17:27:24 +10:00
Morgan Pretty c500d4c6ca Fixed a few bugs, resolved a number of TODOs and deleted more unused code
Fixed a couple of bugs with search term highlighting (updated the logic to make the highlighted content follow similar logic to what terms would have actually matched)
Fixed a bug where info messages in search results weren't rendering correctly
Shifted some duplicate query code for global search into variables
Fixed a small bug where sending attachments could incorrectly result in the mentions UI being visible
Fixed a bug where quote content was appearing incorrectly
Consolidated the ShareExtension Item and the ConversationCell.ViewModel into one type (with a more-limited query) to remove duplicate code
Added back a missing asset (deleted a long time ago)
2022-05-23 17:16:14 +10:00
Morgan Pretty 49dd341b6d Removed some more legacy code which has been refactored 2022-05-23 12:23:43 +10:00
Morgan Pretty 5de8d9c7a8 Removed a bunch of legacy database types
Removed the old OWSProfileManager and OWSUserProfile (refactored)
Removed all the old TSInteraction/etc. types (replaced with new database types)
Removed the old Quote models (refactored)
Removed the old Attachment models (refactored)
Removed the old recipient identity (unused)
Deleted a number of other unused files
2022-05-23 09:49:04 +10:00
Morgan Pretty 9ada8b84e0 Removed a bunch of legacy code
Renamed the 'Legacy' classes to have their library prefix (avoid confusion)
Removed the legacy Objective C Thread code (pulled only the NSCoding stuff into the 'SMKLegacy' type)
2022-05-21 12:25:10 +10:00
Morgan Pretty aabf656d89 Finished off the MediaGallery logic
Updated the config message generation for GRDB
Migrated more preferences into GRDB
Added paging to the MediaTileViewController and sorted out the various animations/transitions
Fixed an issue where the 'recipientState' for the 'baseQuery' on the ConversationCell.ViewModel wasn't grouping correctly
Fixed an issue where the MediaZoomAnimationController could fail if the contextual info wasn't available
Fixed an issue where the MediaZoomAnimationController bounce looked odd when returning to the detail screen from the tile screen
Fixed an issue where the MediaZoomAnimationController didn't work for videos
Fixed a bug where the YDB to GRDB migration wasn't properly handling video files
Fixed a number of minor UI bugs with the GalleryRailView
Deleted a bunch of legacy code
2022-05-20 17:58:39 +10:00
Morgan Pretty 3f062c044c Added back the majority of the ConversationVC interactions
Removed some more legacy code
Added back logic similar to the pre-processing de-duping logic (was resulting in "unsent" messages reappearing)
Added a number of updated view files
2022-05-12 17:28:27 +10:00
Morgan Pretty 06eef99766 Cleared out some legacy code, fixed a few bugs, got typing indicators and mentions working
Got mentions working again
Got typing indicators working again
Got the notification sound and preview preferences working
Fixed a few issues with attachment image loading
Fixed an issue where enum settings weren't getting stored correctly
2022-05-10 17:42:15 +10:00
Morgan Pretty f4ca219030 Re-added a bunch of functionality to the home and message requests screens
Cleared out some more legacy code which has been refactored
2022-05-06 18:07:57 +10:00
Morgan Pretty b541666ef0 Got the ability to send message working again and other tweaks
Tested and fixed a couple of issues with the disappearingMessages job
Added a simple dependency system for jobs (primarily for the AttachmentUploadJob, but will likely be others later)
Setup the AttachmentUploadJob again (looks like there are cases which use it)
Prevented a possible infinite job deferral loop from causing the app to crash (the loop is still technically possible but the app will continue to run now)
Updated the interactions unique constraints based on testing and discussions around how the serverHash works
Deleted the legacy ReadReceipt handling (now managed via the 'interaction.wasRead' flag and 'SendReadReceiptsJob')
Deleted the unused SSKIncrementingIdFinder
2022-05-06 12:44:26 +10:00
Morgan Pretty ed9f4ea6c6 Fixed a few closed group and job issues
Fixed a few job migration issues
Fixed an issue with the closed group key pair management (wasn't storing keys correctly)
Refactored the OWSSound (now Preferences.Sound)
Added the logic for the AttachmentDownloadJob and enabled jobs to be cascade deleted via interactions
Optimised the HomeViewModel database observation query (fetch specific columns so changes outside those don't trigger updates)
Updated to the latest GRDB (ran into a deadlock which should be fixed in a newer version)
2022-04-22 18:47:11 +10:00
Morgan Pretty 11231599db Further work on migrations and message pipeline refactoring
Refactored the AppDelegate from Objective C to Swift
Updated the HomeVC to use GRDB
Refactored a number of the Job types to be driven via GRDB and the new JobRunner
Fixed a bug where the LinkPreviewView wouldn't render correctly in dark mode
2022-04-21 16:42:35 +10:00
Morgan Pretty cf66edb723 Further work on SessionMessagingKit migrations
Added migrations for contacts and started working through thread migration (have contact and closed group threads migrating)
Deprecated usage of ECKeyPair in the migrations (want to be able to remove Curve25519Kit in the future)
2022-04-06 15:43:26 +10:00
Morgan Pretty 93f248d149 Merge branch 'dev' into feature/session-id-blinding-part-2
# Conflicts:
#	SessionMessagingKit/Open Groups/OpenGroupManagerV2.swift
#	SessionMessagingKit/Storage.swift
2022-04-04 13:33:27 +10:00
Morgan Pretty a1b4554cdb Migrated the SessionSnodeKit from YapDatabase to GRDB
Changed the min OS version to iOS 13.0 (support for 'Identifiable')
Removed the alternate approaches to fetching the userKeyPair and userPublicKeyHexString (no consistently routed through the caching method)
Migrated the 'OWSIdentityManager' logic to use the new 'Identity' type
Added the 'Setting' table and got the pattern working fairly nicely (unfortunately there isn't a good way to avoid key collision without proper enums)
Updated the SessionSnodeKit to migration it's data from YDB to GRDB
Updated the SessionSnodeKit to use GRDB throughout it's logic
2022-04-01 17:22:45 +11:00
Morgan Pretty c3b855646f Merge branch 'dev' into feature/session-id-blinding-part-2
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Conversations/Views & Modals/JoinOpenGroupModal.swift
#	Session/Open Groups/JoinOpenGroupVC.swift
#	Session/Settings/SettingsVC.swift
#	SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift
#	SessionMessagingKit/Sending & Receiving/MessageReceiver.swift
2022-03-31 12:03:00 +11:00
Morgan Pretty 1633105ce2 Merge branch 'dev' into feature/remove-unused-code
# Conflicts:
#	Session/Backups/OWSBackup.m
#	Session/Backups/OWSBackupImportJob.m
#	SignalUtilitiesKit/Sharing/SelectRecipientViewController.m
#	SignalUtilitiesKit/Sharing/SelectThreadViewController.m
2022-03-31 11:51:59 +11:00
Morgan Pretty f7091dca28 Removed an empty notification observer 2022-03-30 09:48:34 +11:00
Morgan Pretty 0842dbff1e Removed a bunch of unused code
Removed the legacy Theme code (replaced with SessionUIKit equivalents)
Removed the OWSOrphanDataCleaner (unused)
Removed the OWSReceiptType_Delivery from the OWSOutgoingReceiptManager (unused)
Removed the TSStorageKeys and TSStorageHeaders files (unused)
Removed the LKMessageIDCollection (unused - only had methods for deleting data from the collection)
Removed the OWSPrimaryStorageTrustedKeysCollection and OWSIdentityManager_QueuedVerificationStateSyncMessages (unused)
Removed collections and notifications from OWSProfileManager (unused)
2022-03-30 09:46:08 +11:00
Morgan Pretty 8344ed5d81 Fixed the unit tests broken by the merge
Added the ability to mock the GeneralCache data
Added a couple additional tests to validate some updated OpenGroupManager code
2022-03-29 10:15:22 +11:00
Morgan Pretty 5ca227434b Merge branch 'dev' into feature/session-id-blinding-part-2
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Utilities/BackgroundPoller.swift
#	SessionMessagingKit/Database/Storage+OpenGroups.swift
#	SessionMessagingKit/Messages/Control Messages/ConfigurationMessage+Convenience.swift
#	SessionMessagingKit/Open Groups/OpenGroupAPIV2.swift
#	SessionMessagingKit/Open Groups/OpenGroupManagerV2.swift
#	SessionMessagingKit/Sending & Receiving/MessageSender.swift
#	SessionMessagingKit/Sending & Receiving/Pollers/OpenGroupPollerV2.swift
#	SessionMessagingKit/Sending & Receiving/Pollers/Poller.swift
#	SessionMessagingKit/Storage.swift
#	SessionMessagingKit/Utilities/General.swift
#	SessionSnodeKit/SnodeAPI.swift
#	SessionUtilitiesKit/General/Atomic.swift
2022-03-29 09:15:32 +11:00
Morgan Pretty 7165b9e4f6 Merge branch 'dev' into feature/remove-OWSBlockingManager
# Conflicts:
#	Session/Conversations/ConversationVC+Interaction.swift
#	Session/Meta/AppDelegate.swift
#	SessionMessagingKit/Messages/Control Messages/ConfigurationMessage+Convenience.swift
#	SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift
2022-03-24 16:51:34 +11:00
Morgan Pretty 1214005c59 Updated the cachedEncodedPublicKey to be Atomic
Added the Atomic wrapper for thread safe variables
2022-03-24 14:42:25 +11:00
Morgan Pretty 78c0d000be Removed the OWSBlockingManager replacing it with the config sync
Fixed an issue where the "block" button would appear in the NoteToSelf swipe menu
Removed the OWSBlockingManager and supporting files
Removed a number of unused classes and methods
Refactored the BlockListUIUtils to Swift
2022-03-23 09:59:38 +11:00
Morgan Pretty c44256b1d6 Added more unit tests
Fixed a possible divide by zero error
Cleaned up some of the id blinding methods (ie. removing handling for impossible error states)
Added unit tests for the new Sodium methods (used for id blinding)
Added unit tests for some of the shared code
Added unit tests for the MessageSender+Encryption extension functions
Added unit tests for the MessageReceiver+Decryption extension functions
Updated the unit test key constants to be consistent with the SOGS auth-example keys for consistency
2022-03-18 16:39:25 +11:00
Morgan Pretty ff480a37d5 Added more unit tests for the OpenGroupManager
Added the ability to mock the identity manager (ie. return a mock key for the users key)
Swapped the Test Nonce16 & Nonce24 classes for Mock ones
Fixed an issue where the ContactUtilities call from the OpenGroupManager wasn't injecting the dependencies
Added unit tests for the handleDirectMessages and isUserModetatorOrAdmin methods
2022-03-17 12:05:04 +11:00
Morgan Pretty b1684f6b23 More unit tests, fixed a few issues uncovered by testing
Updated the OpenGroupManager to support injecting the cache for better unit testing
Updated the MessageReceiver to support Dependencies being passed as a parameter for visible message and storage purposes
Added a debugDescription to the OpenGroup for more accurate unit testing
Fixed an issue where the poll function would include the inbox and outbox endpoints even when the server was not blinded
Fixed some test compilation time issues
Fixed a bug where the OpenGroupAPI Room was using 'description' as a parameter name (used by Swift for other purposes)
Fixed a bug where then OpenGroup was incorrectly using the system 'description'  property in one place
Renamed the parseV2OpenGroup to parseOpenGroup for consistency
2022-03-16 15:55:56 +11:00
Morgan Pretty 2e10ccf99d Updated the code to cache the retrieval of the user public key 2022-03-15 16:06:53 +11:00
Morgan Pretty f9c2655df4 Finalised the OpenGroupAPI and more tests
Fixed an issue where messages where signed incorrectly when blinding wasn't enabled on a SOGS
Fixed an issue where a single invalid message would result in all messages in that request being dropped
Updated the final legacy endpoint (ban and delete all messages)
Moved the OpenGroupManager poller values into the 'Cache' (so they are thread safe)
Started adding unit tests for the OpenGroupManager
Removed some redundant parameters from the 'Request' type
2022-03-15 15:19:23 +11:00
Morgan Pretty 31ecd78737 Refactored the mocking code to use a better convention which also allows for call validation
Added a Nimble predicate for checking a function on a mock was called
Added the various remove methods to the Storage protocol
Updated the Ed25519Type to be an instance-based protocol (needed for mocking)
2022-03-11 16:57:28 +11:00
Morgan Pretty 3e0ccaea4c Merge branch 'dev' into feature/session-id-blinding-part-2
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Utilities/MentionUtilities.swift
#	SessionMessagingKit/Sending & Receiving/Pollers/OpenGroupPollerV2.swift
#	SessionMessagingKit/Sending & Receiving/Pollers/Poller.swift
#	SignalUtilitiesKit/Messaging/Sending & Receiving/MessageSender+Convenience.swift
2022-03-09 09:49:23 +11:00
Morgan Pretty 65f14cf0a1 Added more unit tests
Removed an unused endpoint
Moved 'Dependencies' into the Utilities folder (also out from being nested within 'OpenGroupAPI' since it can be broader than that)
Finished adding unit tests for the OpenGroupAPI
2022-03-08 16:16:36 +11:00
Morgan Pretty d298bcdb4e Merge branch 'dev' into feature/session-id-blinding-part-2
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Utilities/ContactUtilities.swift
#	SessionUtilitiesKit/General/Array+Utilities.swift
2022-03-08 10:41:05 +11:00
Morgan Pretty f9468219d9 Code cleanup and database transaction tweaks
Updated the OpenGroupManager to be a bit more thread safe
Updated the OpenGroupManager "isModOrAdmin" check to better support the various keys of the current user
Fixed some blinding code to use an existing transaction rather than create it's own ones
Removed the Legacy API calls, handling and types
2022-03-04 18:02:38 +11:00
Morgan Pretty 81f563229f Renamed FileServerAPIV2 to FileServerAPI
Updated the direct file upload/download to use the non-base64 approaches as well
Updated the attachment 'serverId' value to be a string instead of a UInt64 (future-proofing)
Updated the OnionRequest V4 response handling to avoid converting the "response body" part to a string and processing that, instead just slice the byte array (ie. stopped it from being broken from multiple conversions)
Removed the base64-based file upload/download endpoints (no use including them when they are inefficient and we don't want to use them)
2022-03-04 16:17:03 +11:00
Morgan Pretty 1c474955de File upload working, further code cleanup
Got the updated file upload working
Removed the legacy 'room' header
Consolidated a number of types between SOGS, FileServer and general requests
Updated the OnionRequestAPI to deal with a Data payload (rather than encoding it to a string and then back to data)
2022-03-04 13:33:06 +11:00
Morgan Pretty c04d4544f2 Added more unit tests
Refactored the existing unit tests to use Quick
Started adding unit tests for a number of the OpenGroupAPI network models
Added unit tests for the SessionId type
2022-03-02 17:11:18 +11:00
Morgan Pretty 8a7db1d48f Started adding logic for the outbox endpoint
Moved the BlindedIdMapping retrieval logic to ContactUtilities so it's reusable
Added the 'outbox' endpoints (need testing as they aren't deployed to test yet)
2022-03-02 14:44:56 +11:00
Morgan Pretty bdf5b3bc1b Started resolving more TODOs and fixing up unit tests
Updated the Dependencies to lazily create their fallback instances (optimisation to avoid unnecessary initialisations)
Reworked the Atomic type again to have a more consistent behaviour across types
Fixed the build issues with the unit tests (haven't fixed broken tests yet)
2022-03-02 11:24:08 +11:00
Morgan Pretty 3a75639285 Fixed a few of issues in the last commit
Fixed a couple of build issues where I missed a couple of calls to removed functions
Fixed a EXC_BAD_ACCESS issue where the 'poll' function could be called from multiple threads (which accesses and mutates variables)
Cleaned up the MessageRequestResponse handling a little
2022-03-01 17:30:35 +11:00
Morgan Pretty cc2a077a6c Started working on `MessageRequestResponse` handling for SOGS message requests
Pointing Curve25519 to use a fork that exposes an XEd25519 conversion method
Fixed an issue where I had broken all message sending due to the SnodeAPI casting Onion responses to `Any`
2022-02-25 17:48:09 +11:00
Morgan Pretty dbead5e3c8 Got the '/inbox' APIs and encryption/decryption/validation working
Added a few types to make the code more readable
Added the inbox request to the polling
Added a couple of properties to the TSContactThread to indicate the originating open group to support SOGS DMs
Added code to store the latest message id for an open group inbox
Added a bunch of documentation from the API docs into the OpenGroupAPI (and associated models)
Updated the OpenGroupAPI to match the latest docs
Fixed the incorrect structure of the SendDirectMessageRequest
Fixed an incorrect inbox endpoint path
Tweaked the batch response handling so it wouldn't fail to parse all responses if a single one failed
Renamed IdPrefix to SessionId.Prefix and cleaned up the type to be more readable & self-documenting
2022-02-25 11:59:29 +11:00
Ryan Zhao 7a677a1800 move pollers to one working queue to avoid race condition 2022-02-24 16:47:08 +11:00
ryanzhao 7c2e25e25a remove useless code 2022-02-23 15:31:06 +11:00
Ryan Zhao 16c9b7793a move pollers to background threads 2022-02-21 13:27:44 +11:00
Ryan Zhao a86310b0f5 improve global search performance 2022-02-21 13:20:34 +11:00
Morgan Pretty 1edd500dab Updated to the latest blinding behaviour
Added a couple more dependencies for unit testing injection
Updated the MessageSender to set the sender of the message to the appropriate blinded/unblinded key
Updated the OpenGroup Message to handle verification of both blinded and unblinded messages
Updated the MessageSender to use dependency injection for it's sendToOpenGroupDestination method
Updated the JSONDecoder to support getting dependencies (for signature verification)
Fixed tests broken by updating the signing logic
2022-02-21 10:01:53 +11:00
Morgan Pretty ef09d4d5aa Additional encryption work on id blinding
Got the updated blinding logic working (at least when authenticating a request - still need to deal with message signing and verification)
Storing the server capabilities in the database now so we can correctly blind requests based on them
Renamed the remaining 'v2' functions and classes to just be 'OpenGroup' since there isn't a 'V2' anymore
Cleaned up a few TODOs and functions
2022-02-17 18:33:23 +11:00
Morgan Pretty 63e6cdd9ec Renamed OpenGroupAPIV2 to OpenGroupAPI
Added the inbox endpoints
2022-02-15 16:30:11 +11:00
Morgan Pretty eb927c36a9 Started cleaning up some of the SOGS and Onion Requests structure
Cleaned up the OnionRequestAPI so we don't need the LegacyOnionRequestAPI
Added requests for the user endpoints
Added deprecated flags to the legacy endpoints and functions
Added some logic to start handling the new poll (batch) response
Started adding unit tests for the OpenGroupAPI functions
2022-02-15 13:55:59 +11:00
Morgan Pretty c90f346d6a Further SOGS V4 integration work
Added in the v4 onion requests logic
Added in the new pin/unpin APIs
Split up additional legacy methods to try and simplify the refactoring
Added a number of TODOs around usage of legacy request methods
2022-02-14 14:07:45 +11:00
Morgan Pretty 4f3900771e More work on getting SOGS V4 integrated
Updated the MessageSendJob to support V4 messages (V2 messages will be upgraded to V4 if they get re-encoded)
Renamed the Message+Destination from 'openGroup' & 'openGroupV2' to 'legacyOpenGroup' and 'openGroup'
Started plugging in more of the V4 APIs
Renamed a number of the V2 APIs to start with 'legacy'
2022-02-11 16:48:16 +11:00
Morgan Pretty 2284375fc0 Started work on updated SOGS support
Split the OpenGroupAPIV2 into separate files
Started working on the new auth and blinded-id approaches (new auth working with un-blinded id suggesting blinded-id code is incorrect)
Updated the SOGS request/response types to use Codable
Updated the SOGS Request type to use enums instead of strings for keys (to reduce likelihood of typos breaking things)
Updated SessionMessagingKit to use Codable and JSONEncoder/JSONDecoder instead of the legacy JSONSerialization
Cleaned up some naming conventions in the SessionMessagingKit (calling a URLRequest body 'parameters' is very confusing...)
Removed the custom TSRequest class (just using standard URLRequest everywhere instead)
Added a number of extension functions to enable some more functional-coding styles
Added extensions to Sodium methods to allow scalar multiplication and the ability to hash providing a salt and a personalisation value (both needed for new SOGS auth)
Fixed an issue where the legacy auth for SOGS could crash due to threading issues (multiple threads accessing the same variable)
Fixed an issue where if you were in two rooms in a single SOGS and deleted one of them, the other room would stop getting updates as the server public key was getting removed
2022-02-10 11:17:41 +11:00
Morgan Pretty 49dd52a1fb Added code to support generating a derived key for id blinding 2022-02-08 17:01:37 +11:00
Morgan Pretty 4d62ddbd77 Merge branch 'dev' into fix/safari-sharing
# Conflicts:
#	Podfile.lock
2022-02-03 08:32:17 +11:00
Ryan Zhao 18fea4ab73 Merge branch 'dev' into global-search 2022-01-27 15:43:54 +11:00