Commit graph

15608 commits

Author SHA1 Message Date
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
Morgan Pretty faa8918cd4 Replaced the remaining non-file legacy methods with their non-legacy equivalents
Updated the OpenGroup polling to run on a non-main thread
Updated the TSGroupModel to store moderatorIds as well as the adminIds (new endpoint is only going to give diffs)
Updated the BatchRequest to support json, base64 encoded strings and raw bytes for it's body
Replaced the 'lastMessageServerID' methods with 'OpenGroupSequenceNumber' methods (since we have swapped the property over)
Added an alert when banning fails (previously it would fail silently)
Fixed a bug where sent blinded messages were appearing as incoming messages
Fixed a bug where the OpenGroup infoUpdates wasn't getting decoded correctly
Fixed an issue where the ConversationVC wouldn't become the first responder again after the ban alerts disappeared
Fixed an issue where I'd incorrectly used the message 'seqNo' in place of the message server id
Fixed an issue where open group messages were setting their `sentTimestamp` to seconds instead of milliseconds for incoming messages
2022-02-24 10:39:22 +11:00
Morgan Pretty f5e48cec01 Updated the project to use the Oxen fork of Sodium (instead of my one) 2022-02-21 14:59:51 +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 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
2022-02-16 10:31:08 +11:00
Morgan Pretty 8cc9caa0fd Renamed the OpenGroupPollerV2 and OpenGroupManagerV2 2022-02-15 16:44:10 +11:00
Morgan Pretty cd3dffcff9 Missed the renaming in the unit tests 2022-02-15 16:31:25 +11:00
Morgan Pretty 63e6cdd9ec Renamed OpenGroupAPIV2 to OpenGroupAPI
Added the inbox endpoints
2022-02-15 16:30:11 +11:00
Morgan Pretty 4963a84ddd Added more unit tests for the OpenGroupAPI (fixed a couple bugs as well) 2022-02-15 16:00:51 +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 394b0646a3 Updated the code to support additional session id prefixes 2022-02-08 16:37:01 +11:00
Morgan Pretty 27d9e41eaf Fixed a couple of build errors due to merging dev 2022-02-07 11:38:33 +11:00
Morgan Pretty 67d2a13dfb Ran pod install to update the Podfile.lock 2022-02-04 11:50:57 +11:00
Morgan Pretty cd61fb8df0 Merge branch 'dev' into feature/message-requests
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	SignalUtilitiesKit/Utilities/UIColor+Extensions.swift
2022-02-04 11:49:54 +11:00
Ryan Zhao 69e464e8ae bump up version & build number 2022-02-03 16:33:26 +11:00
RyanZhao a12ff0cbe2
Merge pull request #557 from RyanRory/1.11.21
Fix bugs and crashes for 1.11.21
2022-02-03 16:31:20 +11:00
Ryan Zhao e543f86c8b Merge branch 'dev' of https://github.com/oxen-io/session-ios into 1.11.21 2022-02-03 11:02:19 +11:00
RyanZhao 8afe5b0896
Merge pull request #548 from mpretty-cyro/fix/safari-sharing
Fix issues with sharing from Safari
2022-02-03 10:52:08 +11:00
Morgan Pretty 4d62ddbd77 Merge branch 'dev' into fix/safari-sharing
# Conflicts:
#	Podfile.lock
2022-02-03 08:32:17 +11:00
Morgan Pretty 7f479bbca4 Merge branch 'dev' into feature/message-requests 2022-02-02 17:00:40 +11:00
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)
2022-02-02 16:59:56 +11:00
Ryan Zhao ebb7507728 Merge branch 'dev' of https://github.com/oxen-io/session-ios into 1.11.21 2022-02-02 13:33:25 +11:00
RyanZhao b4782896b1
Merge pull request #555 from RyanRory/global-search
Global Search Phase 1
2022-02-02 13:31:30 +11:00
Ryan Zhao 166fbff26c improve selected message animation for global search 2022-02-02 11:32:37 +11:00
Ryan Zhao 5ce7aa49ee mark messages with undownloaded attachments as read as well 2022-02-01 15:12:48 +11:00
Morgan Pretty bee36423da Fixed a couple of issue with sharing large attachments
Added back localized attachment error messages
Fixed an issue where sending an attachment could fail and the screen would be dismissed before the user had a chance to read the error
2022-02-01 14:55:03 +11:00
Morgan Pretty c7e7d30dea Merge branch 'dev' into fix/safari-sharing 2022-02-01 13:57:34 +11:00
Ryan Zhao ce83de5c46 fix crash of dictionary.subscript.getter for closed groups 2022-01-31 14:09:56 +11:00
Morgan Pretty 0f20c37afa Regenerated the SessionProtos for message requests 2022-01-31 08:56:42 +11:00
Ryan Zhao c729967953 Merge branch 'dev' of https://github.com/oxen-io/session-ios into global-search 2022-01-28 15:56:16 +11:00
Ryan Zhao a101bfbf82 Merge branch 'dev' of https://github.com/oxen-io/session-ios into 1.11.21 2022-01-28 15:55:48 +11:00
RyanZhao 6aac2a9966
Merge pull request #550 from mpretty-cyro/fix/open-group-initial-mention-list
Fix open group initial mention list population
2022-01-28 15:55:21 +11:00
Ryan Zhao c81e0e517d fix ui issue after making unread message count 4 digits 2022-01-28 15:03:19 +11:00
Ryan Zhao 99022006da Make the unread message count 4 digits instead of 2 2022-01-28 14:21:54 +11:00
Ryan Zhao 2c7dfe6a37 fix conversation screen scrolling to bottom issue 2022-01-28 14:10:35 +11:00
Ryan Zhao 70a562344c minor issue fix 2022-01-28 14:09:57 +11:00
Ryan Zhao 8ed77435d8 update translation 2022-01-28 14:08:43 +11:00
Ryan Zhao d96d7468a4 fix read more button colour 2022-01-28 14:04:41 +11:00
Ryan Zhao 6ae84d3e37 update outgoing message text colour in light mode 2022-01-28 13:45:27 +11:00
Ryan Zhao d642d8a4ed improve image message ratio 2022-01-28 13:14:57 +11:00
Ryan Zhao bcc5da75b6 minor fix on debug mode to prevent crashing 2022-01-28 13:14:02 +11:00
RyanZhao 8a1e916bcc
Merge pull request #549 from mpretty-cyro/feature/more-link-previews
Default link previews to use HTTPS
2022-01-28 12:16:28 +11:00
Ryan Zhao 16f6d49cec add note to self to the default global search screen with empty search text 2022-01-28 09:59:05 +11:00
Ryan Zhao 124d908686 add author for group messages 2022-01-27 16:39:22 +11:00