Commit graph

459 commits

Author SHA1 Message Date
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
63469acd3b Merge branch 'dev' into feature/session-id-blinding-part-2
# Conflicts:
#	SessionMessagingKit/Database/Storage+Messaging.swift
#	SessionMessagingKit/Open Groups/OpenGroupManagerV2.swift
2022-03-15 15:22:36 +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
Ryan Zhao
b14e6af682 bump up build number 2022-03-15 14:35:38 +11:00
Ryan Zhao
e73fe4fe31 bump up build number 2022-03-15 14:34:22 +11:00
Morgan Pretty
c415fc9e06 Merge branch 'dev' into feature/session-id-blinding-part-2
# Conflicts:
#	Session/Open Groups/OpenGroupSuggestionGrid.swift
#	SessionMessagingKit/Open Groups/OpenGroupAPIV2+ObjC.swift
#	SessionMessagingKit/Open Groups/OpenGroupAPIV2.swift
#	SessionMessagingKit/Open Groups/OpenGroupManagerV2.swift
2022-03-11 17:15:55 +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
Ryan Zhao
1bdff5e461 bump up build number 2022-03-11 16:06:43 +11:00
Ryan Zhao
c9b9104e8a bump up build number 2022-03-11 15:56:37 +11:00
Ryan Zhao
5f9bc4c55f Merge branch 'unread-metion-fix' into voice-calls-2 2022-03-11 15:55:51 +11:00
Ryan Zhao
06958babcb fix unread mention indicator showing after the message is deleted 2022-03-11 11:43:21 +11:00
Ryan Zhao
fb9f6fa3ec bump up build number 2022-03-09 12:07:41 +11:00
Ryan Zhao
6bb951ecce bump up version & build number 2022-03-09 11:40:30 +11:00
Ryan Zhao
5326d925b8 add SessionUtilitiesKit frameworks to SessionMessagingKit 2022-03-09 11:37:06 +11:00
Ryan Zhao
a68ed28a7a Merge branch 'dev' into voice-calls-2 2022-03-09 11:33:18 +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
96338eacda Removed an incorrect dependency and fixed a bug from the last commit 2022-03-08 17:12:12 +11:00
Ryan Zhao
5762445128 Merge branch 'ipad-support-1' into voice-calls-2 2022-03-08 17:10:40 +11:00
Ryan Zhao
ce95b97f02 fix CFBundleIdentifier Collision 2022-03-08 17:02:34 +11:00
Ryan Zhao
da298756f8 bump up version & build number 2022-03-08 16:31:21 +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
Ryan Zhao
60e8da3bff Merge branch 'dev' into preformance-improvement 2022-03-08 11:08:45 +11:00
Ryan Zhao
bf6de99395 Merge branch 'dev' into ipad-support-1 2022-03-08 10:23:19 +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
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)
2022-03-07 10:22:46 +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
8ca00ca578 Fixed a number of bugs, resolved some TODOs and tested the outbox APIs
Updated the join open group method to retrieve the capabilities as part of the initial request
Updated the OpenGroupManager to require a transaction to be passed to the various 'handler' methods (allowing for everything to be processed within a single transaction)
Fixed a few issues where we weren't storing the timestamp for open group messages and DMs which could result in duplicate messages
Fixed an issue where we were setting the timestamp value for messages sent to an open group without converting it to be milliseconds to be consistent with other messages
Fixed an issue where the BatchRequestInfo could incorrectly flag it's response as failing to parse even though the type was optional
Fixed a bug where the open group would re-fetch all messages every other time
Fixed a bug where the long press context menu wouldn't appear after failing to delete a message
Fixed a bug where joining an open group would trigger the join behaviour and APIs twice
2022-03-03 17:46:35 +11:00
Ryan Zhao
e8f996306d show call permission required modal when calls are nor enabled 2022-03-03 13:25:53 +11:00
Ryan Zhao
952a3d3414 minor fix for merging 2022-03-02 14:46:23 +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
Ryan Zhao
52407aec03 Merge branch 'ipad-support-1' into voice-calls-2 2022-03-02 14:31:31 +11:00
Morgan Pretty
a26ee12f8d Further work on Id Blinding
Renamed the setter for the SOGS 'Server' object for consistency
Updated the Curve25519Kit repo to use an Oxen fork
Updated the MockDataGenerator to accomodate the latest changes
Updated the ConversationVC to better support getting replaced when the conversion from blinded to unblinded happens while on that screen
Added a cache for the mapping between blinded ids and standard ids (gets cached whenever a valid match is found)
Added a migration to remove the old 'authToken, 'lastMessageServerId' and 'lastDeletionServerId' collections (redundant in SOGS V4)
2022-03-01 14:06:37 +11:00
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
2022-02-28 10:46:45 +11:00
Ryan Zhao
f22672ccd7 Merge branch 'dev' of https://github.com/oxen-io/session-ios into preformance-improvement 2022-02-25 14:58:20 +11:00
Ryan Zhao
c0615fe11d Merge branch 'dev' of https://github.com/oxen-io/session-ios into ipad-support-1 2022-02-25 13:43:49 +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
a8c7f517eb clean 2022-02-24 15:39:07 +11:00
Ryan Zhao
ab0714af00 fix search bar cancel button for iPad 2022-02-24 12:03:46 +11:00
Morgan Pretty
582ff0997a Fixed a couple of crashes and added some mock data generation logic
Possibly fixed a crash due to a database deadlock
Fixed a crash when the first message requests gets added if there are no other threads
Added code to generate a bunch of random thread data (Needs some testing to ensure no data leaves the device)
2022-02-22 15:51:17 +11:00
Ryan Zhao
eec3d31109 WIP: timer + main thread 2022-02-21 17:22:58 +11:00
Ryan Zhao
6d99976a9c database migrate for unread mention 2022-02-21 15:28:51 +11:00
Morgan Pretty
47314bd639 Added a notification to indicate the user has a new message request
Fixed a bug where the notification count could be increased for message requests
Fixed a bug where an approved contact could be 'unapproved' due to an order of execution issue when generating the config sync message
Fixed a check to avoid registering for push notifications when on the simulator (old check didn't cater for M1 Macs)
Moved the 'hasHiddenMessageRequests' into the group user defaults so it can be accessed within the notification extension
Added code to handle an edge case where an old client could incorrectly un-approve a contact via a legacy configuration message
2022-02-21 14:48:53 +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
Ryan Zhao
cc1b1e8c51 poll for open groups in NSE 2022-02-17 14:55:32 +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
Ryan Zhao
56d4d8e674 bump up version & build number 2022-02-16 10:15:26 +11:00
Morgan Pretty
8cc9caa0fd Renamed the OpenGroupPollerV2 and OpenGroupManagerV2 2022-02-15 16:44:10 +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
051f03f4b4 PR comments and a few missed use cases
Disabled the attachments and voice message buttons for the first message
Disabled the Disappearing Messages flag for the until the conversation is approved
Fixed a bug where the recipient of a message request could incorrectly get the 'pending approval' state
Refactored some standard auto layout code to use the custom extension code
2022-02-14 17:49:08 +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
394b0646a3 Updated the code to support additional session id prefixes 2022-02-08 16:37:01 +11:00
Ryan Zhao
be1767a4ba clean 2022-02-08 14:14:33 +11:00
Ryan Zhao
80b18f0715 fix local video view weird rotation behaviour 2022-02-08 13:35:17 +11:00
Ryan Zhao
782dd20ddd implement screen rotation for video calls 2022-02-08 11:04:18 +11:00
Ryan Zhao
d8401165cc bump up version & build number 2022-02-04 14:23:27 +11:00
Ryan Zhao
2d9f962a97 Merge branch 'dev' of https://github.com/oxen-io/session-ios into voice-calls-2 2022-02-04 14:21:54 +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
b1c2802613 update pods 2022-02-04 10:03:23 +11:00
Ryan Zhao
69e464e8ae bump up version & build number 2022-02-03 16:33:26 +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
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
18fea4ab73 Merge branch 'dev' into global-search 2022-01-27 15:43:54 +11:00
Morgan Pretty
09d63456b6 Merge branch 'dev' into fix/safari-sharing
# Conflicts:
#	Podfile
#	Podfile.lock
#	Session.xcodeproj/project.pbxproj
2022-01-27 15:17:28 +11:00
Ryan Zhao
85c4b3d745 show recent search result as default for global search screen 2022-01-27 14:19:07 +11:00
Ryan Zhao
68ec1654e8 rebuild global search UI 2022-01-25 15:04:11 +11:00
Morgan Pretty
03fb5cbeeb Cleanup and tweaks
Fixed some compilation issues.
Removed an unused dependency.
Cleaned up the Podfile to minimise duplication.
Pointed at an oxen fork of SignalCoreKit instead of a personal one.
2022-01-25 12:05:45 +11:00
ryanzhao
fed1218538 WIP: global search UI 2022-01-14 16:41:36 +11:00
Morgan Pretty
61f809caee Fixed a couple of bugs and started UI refactoring
Refactored the UI creation and layout code in the attachments UI.
Started refactoring the UI in the MediaMessageView (converting the existing stuff and will then consolidate when done).
Fixed a bug where playing a video attachment would result in the zoom continually getting reset.
Fixed a bug where the attachment zoom scale would randomly change causing odd behaviours.
2022-01-12 16:57:04 +11:00
Morgan Pretty
4f3faa28bc Refactored SessionShareExtension code to Swift 2022-01-11 12:38:19 +11:00
Ryan Zhao
544881fa69 bump up build number 2021-12-20 12:25:32 +11:00
Ryan Zhao
ef2749d72d bump up build number 2021-12-20 09:38:14 +11:00
Ryan Zhao
7a22c9d329 update build number 2021-12-16 16:24:23 +11:00
Ryan Zhao
19cb916fa1 update version & build number 2021-12-16 13:28:28 +11:00
ryanzhao
44cf3c4d46 update build number 2021-12-09 14:31:30 +11:00
Ryan Zhao
6ac075fa5a update build number 2021-12-07 17:06:55 +11:00
Ryan Zhao
d754311395 update version & build number 2021-12-06 09:50:47 +11:00
Ryan Zhao
8443818020 bump up build number 2021-12-02 14:58:03 +11:00
Ryan Zhao
5e87e9ceeb bump up build number 2021-12-01 13:26:03 +11:00
Ryan Zhao
9e4e126ef3 add call missed tips 2021-11-30 15:51:15 +11:00
Ryan Zhao
570c3fbe3b add ringtone and other UI improvement 2021-11-29 16:32:02 +11:00
Ryan Zhao
9e6c81d28b improve call message UI 2021-11-29 12:10:33 +11:00
Ryan Zhao
0a3d84d5c8 WIP: Call message Ui improvements 2021-11-26 16:57:57 +11:00
Ryan Zhao
78971b7d09 ignore call messages over 60s 2021-11-25 16:50:30 +11:00
Ryan Zhao
75658e1720 update build number 2021-11-22 09:34:51 +11:00
Ryan Zhao
af16416898 update .gitignore 2021-11-19 16:14:46 +11:00
Ryan Zhao
74ef42558b add turn server info 2021-11-19 10:39:10 +11:00
Ryan Zhao
d3a2b456f1 handle permission request for voice and video calls 2021-11-18 10:39:50 +11:00
ryanzhao
bd0a89184b update build number 2021-11-15 16:05:25 +11:00
ryanzhao
a6e5eb6fd6 update version number 2021-11-11 16:19:50 +11:00
ryanzhao
bef20e2f9a refactor for CallKit 2021-11-08 09:12:18 +11:00
ryanzhao
4db87992b2 refactor for voip push notification 2021-10-29 15:22:23 +11:00
ryanzhao
0ef7bdc9ce refactor to plug in callkit 2021-10-28 17:02:41 +11:00
ryanzhao
365231f309 update build number 2021-10-27 13:51:56 +11:00