Commit graph

37 commits

Author SHA1 Message Date
Morgan Pretty
cb27da48b7 Updated the code to handle a clock out of sync error (different error code from v2 & v3) 2022-03-15 16:51:10 +11:00
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
2022-03-07 17:43:30 +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
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)
2022-03-02 13:09:45 +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
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
Niels Andriesse
81820c0013 Remove unnecessary check 2021-07-23 14:10:44 +10:00
Niels Andriesse
8a29469eb5 Handle incorrect clock setting 2021-07-23 13:42:13 +10:00
Niels Andriesse
e84fc1aa04 Include destination info in error messages 2021-07-15 09:47:03 +10:00
Niels Andriesse
bea80c67b3 Make error more descriptive 2021-07-13 09:50:09 +10:00
Niels Andriesse
a774d5f004 Re-use existing build paths promise if possible 2021-07-09 16:19:27 +10:00
Niels Andriesse
be382a6031 Add fix for temporary path building issue 2021-05-03 08:35:15 +10:00
Niels Andriesse
1561b9436f Fix missing query parameters 2021-04-22 16:12:13 +10:00
nielsandriesse
fec4bfb836 Debug 2021-04-21 11:30:59 +10:00
Niels Andriesse
8375b598ad Don't hardcode scheme and port 2021-04-20 11:13:55 +10:00
Niels Andriesse
34bbff1ab4 Implement OpenGroupAPIV2 2021-03-24 10:54:38 +11:00
Niels Andriesse
4958d3d368 Implement ONS API 2021-03-03 11:16:34 +11:00
Niels Andriesse
cf07fc1b1a Implement nicknames 2021-03-01 13:15:54 +11:00
Niels Andriesse
8477f75426 Fix unnecessary path rebuilding 2021-02-08 10:21:02 +11:00
Niels Andriesse
647bdb0d10 Fix error copy 2021-01-28 15:03:45 +11:00
nielsandriesse
9ebb448b5f Fix crash 2020-12-14 09:00:50 +11:00
nielsandriesse
7ca3b73fd8 Fix crash 2020-12-14 08:57:59 +11:00
Niels Andriesse
efe8f1c8bb Clean 2020-12-07 16:00:21 +11:00
Niels Andriesse
557a851dce Enforce assumptions 2020-12-04 17:10:00 +11:00
nielsandriesse
d6c115bc2a Fix module linking issue 2020-12-02 16:25:16 +11:00
nielsandriesse
6dc3184b2a Merge branch 'dev' into refactor-3 2020-11-13 10:07:45 +11:00
nielsandriesse
a3382f41d4 Re-organize files 2020-11-09 10:58:47 +11:00
nielsandriesse
b9f2881c9d Implement destination coding 2020-11-08 16:31:48 +11:00
nielsandriesse
28172b4ed2 Create AttachmentUploadJob & AttachmentDownloadJob
Also conform SnodeMessage to NSCoding
2020-11-08 12:34:08 +11:00
nielsandriesse
4b63588f1a Create MessageSendJob & MessageReceiveJob
Also implement message sending notifications & custom TTL for typing indicators
2020-11-08 09:00:10 +11:00
nielsandriesse
48f166b893 Implement typing indicator proto conversion 2020-11-06 09:49:16 +11:00
nielsandriesse
74b104af45 Clean 2020-11-05 19:23:05 +11:00
nielsandriesse
2b1e322832 Create SessionSnodeKit 2020-11-05 12:07:21 +11:00