Commit graph

213 commits

Author SHA1 Message Date
Ryan Zhao 6f927a5003 minor refactor 2022-03-15 14:27:11 +11:00
Ryan Zhao b920dbcc10 check if the incoming message is already in database before persisting 2022-03-15 14:00:36 +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 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 a31fb7f957 Merge branch 'dev' into voice-calls-2 2022-03-11 09:35:51 +11:00
Morgan Pretty 0e15c63e6b Fixed a case where a the share extension wasn't using a transaction version of a method 2022-03-10 16:58:08 +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 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 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 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
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
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
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 4c89c165d8 Fixed a few bugs uncovered by QA
Fixed a bug where the ConfigurationMessage was getting generated before the contact state was persisted to the database in the message request flow causing odd behaviours (now generating the ConfigurationMessage within the same transaction)
Fixed a bug where sending a message to an existing message request thread once the message requests item has been hidden would show the message requests notification and trigger the section to re-appear on the home screen
Fixed a bug where blocked contacts weren't getting excluded from the contacts list in the configuration message
2022-02-23 17:12:57 +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 a86310b0f5 improve global search performance 2022-02-21 13:20:34 +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 4963a84ddd Added more unit tests for the OpenGroupAPI (fixed a couple bugs as well) 2022-02-15 16:00:51 +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
Ryan Zhao 63e0a5285c minor refactor to prevent dead lock 2022-02-14 16:34:22 +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
RyanZhao 2a26eda36b
Merge pull request #531 from RyanRory/1.11.19
1.11.19 bug fixes and improvements
2021-12-06 09:48:08 +11:00
Ryan Zhao a6a297048c Merge branch 'pin-chats' into voice-calls-2 2021-11-23 14:34:19 +11:00
Ryan Zhao 1cc2f17469 pin conversations 2021-11-17 15:51:53 +11:00
ryanzhao e49431d2eb fix transaction crash 2021-11-15 16:47:12 +11:00
ryanzhao dd891063bd minor fix 2021-11-15 16:02:24 +11:00
ryanzhao 336c694b52 refactoring on showing call ip exposure 2021-11-11 12:12:12 +11:00
ryanzhao f51651ce8e minor fix on conversation ordering 2021-10-05 15:09:11 +11:00
ryanzhao 204fe789ed fix sync message in open group won't be marked as sent 2021-10-04 11:56:05 +11:00
ryanzhao ceb88f3d00 prevent disappearing message affecting the order of conversations 2021-10-01 16:29:02 +10:00
ryanzhao b7c6eafa87 fix notification preview type nested transaction crash 2021-09-30 14:24:04 +10:00
ryanzhao e91469fe0e fix nested transaction crash 2021-09-30 09:30:30 +10:00
ryanzhao 3c4a19e30d fix nested transaction crash 2021-09-13 14:37:10 +10:00
Niels Andriesse 7f0b87a2b2 Avoid unnecessary conversation screen updates 2021-08-03 15:36:54 +10:00
Niels Andriesse 6bf25e28f7 Debug 2021-07-23 09:00:28 +10:00
Niels Andriesse 9d605c03f0 Debug 2021-07-22 15:23:35 +10:00
Niels Andriesse 519ffa4405 Fully switch to the new contact API
This should improve performance significantly as it avoids many unnecessary sync transactions. It also makes the code more readable.
2021-07-22 14:41:27 +10:00
nielsandriesse ff1d2d2f28 Remove (seemingly) unnecessary hack 2021-05-28 09:24:03 +10:00
Niels Andriesse 3fda8daec9 Merge branch 'dev' into cleanup 2021-05-20 16:25:59 +10:00
Niels Andriesse c84a942478 Fix push notification handling
This was crashing every time the extension started
2021-05-20 13:57:42 +10:00
nielsandriesse 06f795169b Merge branch 'dev' into cleanup 2021-05-05 14:10:19 +10:00
nielsandriesse 964cb8b326 Fix new deletion method 2021-05-05 13:49:24 +10:00
nielsandriesse 47daf16d5c Merge branch 'dev' into deletion-handling 2021-05-05 13:30:59 +10:00
nielsandriesse 0c864454aa Remove duplicate message server ID tracking 2021-05-05 13:30:37 +10:00
nielsandriesse b3a6d90a1b Add missing strings 2021-05-05 13:18:45 +10:00
nielsandriesse 49f3b9f7db Rename contactIdentifier → contactSessionID 2021-05-05 10:00:39 +10:00
nielsandriesse 21acdfc835 Clean up thread model 2021-05-05 09:53:18 +10:00
Niels Andriesse d742fc1548 Delete V1 OGS & file server 2021-05-04 15:46:48 +10:00
Niels Andriesse edd9139fe0 Manually vacuum the DB every time the app is started 2021-04-19 15:58:46 +10:00
Niels Andriesse beabf0c9c0 Implement closed group logic changes 2021-04-16 10:56:10 +10:00
Niels Andriesse 209882fb3e Correctly handle multiple untrusted attachments 2021-04-08 16:24:54 +10:00
Niels Andriesse aa68e91a4d Fix attachment download resumption 2021-04-08 09:51:52 +10:00
nielsandriesse a360fa7721 Merge branch 'dev' into deferred-attachment-downloads 2021-04-07 14:58:57 +10:00
Niels Andriesse d4b745a322 Cache open group preview images 2021-03-30 09:54:40 +11:00
Niels Andriesse 5504f74659 Show V2 open group member count 2021-03-26 16:31:15 +11:00
Niels Andriesse 516f815521 Debug 2021-03-26 10:39:51 +11:00
nielsandriesse 717fe32a73 Fix build 2021-03-24 15:12:58 +11:00
nielsandriesse 4c9728b4fe Update other APIs for V2 open groups 2021-03-24 12:37:33 +11:00
nielsandriesse a5f831fd6c Keep track of last message & last deletion server IDs 2021-03-24 12:07:02 +11:00
nielsandriesse 1d65f717b5 Add auth token handling 2021-03-24 11:12:08 +11:00
Niels Andriesse 76e5515610 Quick fix missing username bug 2021-03-05 13:06:35 +11:00
Niels Andriesse 960e500acd Don't auto-download attachments from untrusted contacts 2021-03-05 11:48:31 +11:00
Niels Andriesse 92304fa590 Clean & debug 2021-03-04 13:50:13 +11:00
Niels Andriesse b023b1be94 Fix profile updating issue 2021-03-04 11:11:58 +11:00
Niels Andriesse cf07fc1b1a Implement nicknames 2021-03-01 13:15:54 +11:00
Niels Andriesse dd0baf0d97 Unify contacts APIs 2021-03-01 09:36:18 +11:00
nielsandriesse 1924e01edc Merge branch 'multi-device' into ui 2021-02-10 11:27:39 +11:00
Niels Andriesse 90e53e5cef Redesign conversation screen part 1 2021-02-09 15:14:18 +11:00
Niels Andriesse b721794a51 Fix closed group update handling from before it was created 2021-02-08 09:37:39 +11:00
Niels Andriesse f84f94de60 Fix synced messages not being marked as sent 2021-01-27 11:04:29 +11:00
Niels Andriesse afd7a5a3dc Fix open group message syncing 2021-01-25 16:48:14 +11:00
Niels Andriesse 6b7b158000 Debug 2021-01-25 14:46:47 +11:00
Niels Andriesse 867e9114a6
Merge branch 'dev' into multi-device 2021-01-22 13:29:13 +11:00
Niels Andriesse 3e5baca72d Fix open group message deletion 2021-01-21 11:27:52 +11:00
Niels Andriesse eeef067f57 Implement message syncing 2021-01-14 14:57:32 +11:00
Niels Andriesse c1cba59a75 Debug 2021-01-14 10:18:26 +11:00
nielsandriesse e38dae5a05 Replace PublicChatManager 2021-01-14 09:42:52 +11:00
Niels Andriesse 4c4ec0c039 Remove unused code 2021-01-11 14:15:26 +11:00
Niels Andriesse a6e44ca0f0 Clean 2021-01-11 14:12:07 +11:00
nielsandriesse f5786a11fe Fix migration 2021-01-08 15:21:46 +11:00
nielsandriesse d5e1237b0c Allow admins to leave & fix remaining issues 2021-01-08 14:54:27 +11:00
Niels Andriesse 28963e252e Debug 2021-01-07 14:39:07 +11:00
Niels Andriesse da503b0df1 Update Session protocol closed groups logic 2021-01-05 14:54:37 +11:00
Niels Andriesse 71758b0c00 Remove the Signal protocol 2021-01-04 13:59:21 +11:00
Niels Andriesse ec2d784c20 Update contact model when legacy update methods are invoked 2021-01-04 10:36:18 +11:00
Niels Andriesse 9901f04dc3 Implement contacts migration 2020-12-18 09:47:18 +11:00
Niels Andriesse 9b3f71172b Implement contact storage 2020-12-17 16:32:39 +11:00
Niels Andriesse 2a4977d269 Implement Session protocol 2020-12-14 09:49:02 +11:00
Niels Andriesse efe8f1c8bb Clean 2020-12-07 16:00:21 +11:00
Niels Andriesse ec1d79ca63 Fix message duplication bug 2020-12-04 11:05:19 +11:00
nielsandriesse 5f2ec37db7 Fix message duplication bug 2020-12-01 11:40:37 +11:00
nielsandriesse f2572e4c91 Fix album message ID handling 2020-12-01 09:03:13 +11:00
Niels Andriesse 2d8933901d Fix open group display name handling 2020-11-30 15:44:07 +11:00
Niels Andriesse b621bdc69a Partially fix open groups 2020-11-30 11:00:28 +11:00
nielsandriesse d39e155e1c Make link previews work again 2020-11-28 11:48:08 +11:00
nielsandriesse 20faa8e914 Debug 2020-11-27 16:22:15 +11:00
nielsandriesse addc859c84 Fix duplicate messages & debug 2020-11-27 15:13:42 +11:00
nielsandriesse 2a57b8ab5b Fix disappearing messages 2020-11-27 11:08:48 +11:00
nielsandriesse c59fe05f8e Cancel message send job(s) if associated message/thread is deleted 2020-11-27 10:08:46 +11:00
nielsandriesse 77c1f721b9 Further debug attachment sending 2020-11-27 09:07:24 +11:00
Niels Andriesse 341782f255 Fix profile handling 2020-11-26 15:16:35 +11:00
Niels Andriesse c8e63019ab Debug 2020-11-26 12:56:08 +11:00
Niels Andriesse ac6baec6f2 Make things compile again 2020-11-26 10:37:56 +11:00
nielsandriesse 1037ce5113 WIP 2020-11-25 16:21:04 +11:00
nielsandriesse 5dfd4b1965 Restructure 2020-11-25 16:15:16 +11:00