Commit Graph

216 Commits (9e88405c44dfde7f12c1498ceab332f1c7702915)

Author SHA1 Message Date
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
2 years ago
Morgan Pretty 28553b218b Updated the migration to handle quotes and link previews 2 years ago
Morgan Pretty 4380f1975c Further work on the DB refactoring
Added the rest of the interaction structure to the database (testing some migration logic now - still needs to be finalised)
Updated the YDBToGRDB migrations to wrap their inserts in autorelease pools (helps memory slightly, unfortunately it's caching the YDB data which uses the most memory but we have opted for speed over RAM at the moment)
Updated the MockDataGenerator so it should now "chunk" the code generation (crazy large figures were previously resulting in excessive memory usage)
2 years ago
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)
2 years ago
Morgan Pretty 4ee4b3ffb3 Started adding migration logic for contacts
Updated the getUserHexEncodedPublicKey to take an optional db value so we can retrieve it during the initial migration
2 years ago
Morgan Pretty 72eeb1c796 Updated the Identity type to clear everything instead of just the x25519 pair 2 years ago
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
2 years ago
Morgan Pretty e65682ae9b Merge branch 'dev' into feature/database-refactor
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Backups/OWSBackup.m
#	Session/Backups/OWSBackupImportJob.m
#	SessionSnodeKit/SnodeAPI.swift
2 years ago
Morgan Pretty 529e416dd1 Started work on GRDB logic and migrations
Setup a migration pattern
Setup the database configuration and security
Started defining the database schema
Started working on the migrations for SessionSnodeKit
2 years ago
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
2 years ago
Ryan Zhao fdde7e4fe0 Merge branch 'fix/tweaks-to-config-message-generation' of https://github.com/mpretty-cyro/session-ios into bug-fix-for-call 2 years ago
Morgan Pretty 1214005c59 Updated the cachedEncodedPublicKey to be Atomic
Added the Atomic wrapper for thread safe variables
2 years ago
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
2 years ago
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
2 years ago
Ryan Zhao a68ed28a7a Merge branch 'dev' into voice-calls-2 2 years ago
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
2 years ago
Ryan Zhao 5762445128 Merge branch 'ipad-support-1' into voice-calls-2 2 years ago
Ryan Zhao 60e8da3bff Merge branch 'dev' into preformance-improvement 2 years ago
Morgan Pretty b6a6f77d4e Adding back code removed due to merge conflict 2 years ago
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
2 years ago
Morgan Pretty 17a9e510c5 Further work on unit tests (and a couple of bug fixes found when testing)
Removed a couple remaining TODOs
Added 'standardUserDefaults' to the 'Dependencies' type
Tweaked the OpenGroupAPI to only update the 'lastOpen' timestamp if it successfully polls
Refactored a couple of methods in the ConversationViewItem into swift so we can clean up the OpenGroupAPI more
Updated the OpenGroupAPI so it no longer has static variables for state (shifted to the OpenGroupManager and made them instance variables)
Fixed an encoding issue with the Capabilities.Capability
2 years ago
Morgan Pretty af543b980b Made a couple of changes to how the ConfigurationMessage is generated and handled
Stopped configuration messages from automatically creating threads for sync'ed contacts (now they will only be created if there are messages)
Updated the ConfigurationMessage to stop truncating the list of contacts but filter the full set (also update the logic to include previously approved contacts)
2 years ago
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)
2 years ago
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
2 years ago
Ryan Zhao 52407aec03 Merge branch 'ipad-support-1' into voice-calls-2 2 years ago
Morgan Pretty 6936f35f2a Fixed a few issues uncovered while testing and some cleanup
Fixed an incorrect optional in RoomPollInfo
Fixed an incorrect parameter name in the ClosedGroupRequestBody
Fixed a crash due to a change in the ContactUtilities
Cleaned up the duplicate code in the OnionRequestAPI, HTTP and SnodeAPI to all use 'Data' response types
Updated the SnodeAPI to casting types to Any (made it hard to catch breaking changes with HTTP and OnionRequestAPI)
2 years ago
Morgan Pretty 3e97782d18 Merge branch 'dev' into feature/session-id-blinding-part-2
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Conversations/ConversationVC.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
2 years ago
Ryan Zhao f22672ccd7 Merge branch 'dev' of https://github.com/oxen-io/session-ios into preformance-improvement 2 years ago
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
2 years ago
ryanzhao b2ab984586 refactor on timer and polling threading 2 years ago
Ryan Zhao eec3d31109 WIP: timer + main thread 2 years ago
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
2 years ago
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
2 years ago
Ryan Zhao cc1b1e8c51 poll for open groups in NSE 2 years ago
Morgan Pretty 999d4a1082 Merge branch 'dev' into feature/message-requests
# Conflicts:
#	Session/Conversations/ConversationVC+Interaction.swift
2 years ago
Morgan Pretty b655882cbd Started resolving TODOs
Added some new properties to the OpenGroupV2
Moved a number of methods and variables from OpenGroupAPI to OpenGroupManager (anything doing actual logic)
Moved the message signing into the OpenGroupAPI (since that's the only place it happens)
Renamed remaining old model classes to start with 'Legacy' to make clean up easier
Updated the OpenGroupAPI poll method to use the same logic as it previously did to determine if it should retrieve recent messages or messages since the last one
2 years ago
Ryan Zhao c32cc4d649 Merge branch 'feature/pdf-preview' of https://github.com/mpretty-cyro/session-ios into voice-calls-2 2 years ago
Morgan Pretty 4963a84ddd Added more unit tests for the OpenGroupAPI (fixed a couple bugs as well) 2 years ago
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
2 years ago
Morgan Pretty 1b820c48c6 Added support for Microsoft Word, Excel & Powerpoint previews 2 years ago
Morgan Pretty 161a90ad28 Updated the code to show the document interaction controller for text files as well 2 years ago
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'
2 years ago
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
2 years ago
Morgan Pretty 394b0646a3 Updated the code to support additional session id prefixes 2 years ago
Ryan Zhao 2d9f962a97 Merge branch 'dev' of https://github.com/oxen-io/session-ios into voice-calls-2 2 years ago
Morgan Pretty 185b2d2a97 Merge branch 'dev' into feature/pdf-preview
# Conflicts:
#	Session/Conversations/ConversationVC+Interaction.swift
2 years ago
Morgan Pretty cd61fb8df0 Merge branch 'dev' into feature/message-requests
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	SignalUtilitiesKit/Utilities/UIColor+Extensions.swift
2 years ago
Morgan Pretty 9db5083cc5 Built out the Message Request functionality
Added the MessageRequestsViewController
Added a 'Message Requests' button to the settings screen
Added accept/reject buttons for message requests to the ConversationVC
Added the ability to hide the message request item on the HomeVC (re-appears if you get a new message request)
Added code to handle an edge-case where the message request approval state wouldn't be returned to the sender due to the recipient running an old version of the app
Prevented contacts which aren't associated with an approved thread from appearing when creating a closed group
Disabled notifications for threads which aren't approved
Updated the app notification count to exclude unapproved messages
Updated the app to ignore closed group creation messages if the group has no admins which are approved contacts
Fixed up the keyboard avoidance behaviour in the ConversationVC
Fixed a couple of minor interaction issues which affected some devices
Fixed an issue where the database migrations would run on the 2nd launch when creating a new account (causing odd behaviours)
2 years ago
Morgan Pretty b85c113da6 Added code to preview PDF attachments 2 years ago
Morgan Pretty dd9eeb5d61 Added initial support for sharing URLs and text
Updated the share extension to load URL previews.
Updated the ThreadPickerVC to send plain text & URLs in the same way they are sent for normal messages.
3 years ago
Morgan Pretty 4f3faa28bc Refactored SessionShareExtension code to Swift 3 years ago
Ryan Zhao 0df2630a70 enable CBR 3 years ago
Ryan Zhao f3206416e0 WIP: show missed call tips 3 years ago
Ryan Zhao 570c3fbe3b add ringtone and other UI improvement 3 years ago
Ryan Zhao 78971b7d09 ignore call messages over 60s 3 years ago
ryanzhao bcf0ecfb69 show modal of ip exposure for calls 3 years ago
ryanzhao 3de81ef2a0 imporvements 3 years ago
ryanzhao 9b9a5d7a39 improve vibration for incoming calls 3 years ago
ryanzhao ccbc819cc4 include more info in logs 3 years ago
ryanzhao fde5083de8 improve link preview images 3 years ago
Niels Andriesse 5202bde4a4 Supply fake User-Agent & Accept-Language headers 3 years ago
nielsandriesse c98cfe420d Fix spacing 3 years ago
nielsandriesse bf9d860214 Batch thread updates 3 years ago
Niels Andriesse 601062c9ef Fix timeSinceLastOpen usage 3 years ago
Brice-W 51ba97827d open group polling limit implementation 3 years ago
nielsandriesse e1ad33e832 Clean 3 years ago
Niels Andriesse d742fc1548 Delete V1 OGS & file server 3 years ago
Niels Andriesse f552d51423 Remove unused code 3 years ago
Niels Andriesse e9df213bfe Put feature flags in one place 3 years ago
nielsandriesse f7a75a1b80 Debug 3 years ago
nielsandriesse 75f5591fe0 Store certificates in DER format 3 years ago
Niels Andriesse 2687d9c968 Use proper API 3 years ago
Niels Andriesse 8d2e81ddde Trust only self-signed seed node certificates 3 years ago
Niels Andriesse edc4a7a71b Move files 3 years ago
Niels Andriesse 58748471a4 Set up skeleton code 3 years ago
Niels Andriesse d4b745a322 Cache open group preview images 3 years ago
Niels Andriesse 7558e0b32a Re-enable joining V1 open groups 3 years ago
Niels Andriesse 34bbff1ab4 Implement OpenGroupAPIV2 3 years ago
Niels Andriesse 1a09ee3619 Scroll to last unread message upon opening a conversation 3 years ago
Niels Andriesse 10e6d114a0 Sync profile updates 3 years ago
Niels Andriesse e4aca65af0 Clean 3 years ago
nielsandriesse 810aa42f03 Finish link preview UI 3 years ago
nielsandriesse 1924e01edc Merge branch 'multi-device' into ui 3 years ago
nielsandriesse 4803b96eb1 Only handle the first config sync message after restoration 3 years ago
Niels Andriesse 90e53e5cef Redesign conversation screen part 1 3 years ago
Niels Andriesse 7acb6c9ac3 Merge branch 'dev' into multi-device 3 years ago
Niels Andriesse 54e902c848 Fix various warnings 3 years ago
Niels Andriesse be877bbeaf Improve onion request path loading efficiency 3 years ago
Niels Andriesse e38aaa4e0e Merge branch 'closed-groups' into multi-device 3 years ago
Niels Andriesse cf333d5e3d Merge branch 'closed-groups' into multi-device 3 years ago
Niels Andriesse bbac6cc5ed Attempt to fix extensions 3 years ago
nielsandriesse 9eefc21eb9 Periodically send configuration messages 4 years ago
nielsandriesse d6314c8d30 Handle configuration messages 4 years ago
nielsandriesse 28e3705f7e Implement multi device UI 4 years ago
Niels Andriesse 0d01480cd0 Debug 4 years ago
Niels Andriesse 6e673945c5 Re-organize files 4 years ago
Niels Andriesse 61a0672824 Merge branch 'dev' into link-previews 4 years ago
Niels Andriesse 7583661cca Implement auto-migration 4 years ago
Niels Andriesse a46e9e3eb5 Recommend that users migrate 4 years ago
Niels Andriesse 2a4977d269 Implement Session protocol 4 years ago
Niels Andriesse 905b829de2 Refresh snode pool at least once a day 4 years ago
nielsandriesse d6c115bc2a Fix module linking issue 4 years ago
nielsandriesse 5f2ec37db7 Fix message duplication bug 4 years ago
Niels Andriesse ac6baec6f2 Make things compile again 4 years ago
nielsandriesse 1037ce5113 WIP 4 years ago
nielsandriesse 5dfd4b1965 Restructure 4 years ago
Niels Andriesse d7c71a8c06 Make things compile again 4 years ago
nielsandriesse b218a16b05 Implement attachment downloading 4 years ago
Niels Andriesse a48fc40aa6 WIP 4 years ago
nielsandriesse f36f447bec Ditch unused Signal code 4 years ago
nielsandriesse 1c0b32af3c Fix ECKeyPair usage 4 years ago
nielsandriesse 000e907d47 Clean up Podfile 4 years ago
nielsandriesse c475f895e8 Create SignalUtilitiesKit 4 years ago
nielsandriesse 82127bfe4d Clean 4 years ago
nielsandriesse 362e2e9c03 Update SessionMessagingKit for open groups 4 years ago
nielsandriesse a3382f41d4 Re-organize files 4 years ago