Commit Graph

243 Commits (master)

Author SHA1 Message Date
Morgan Pretty 06eef99766 Cleared out some legacy code, fixed a few bugs, got typing indicators and mentions working
Got mentions working again
Got typing indicators working again
Got the notification sound and preview preferences working
Fixed a few issues with attachment image loading
Fixed an issue where enum settings weren't getting stored correctly
3 years ago
Morgan Pretty 0db74ce1e3 Working on the MediaGallery and ClosedGroup handling
Fixed a couple of issues around the duplicate messages handling
Fixed a few issues with ClosedGroup polling and ClosedGroup control message handling
Started working through updating the MediaGallery
3 years ago
Morgan Pretty f4ca219030 Re-added a bunch of functionality to the home and message requests screens
Cleared out some more legacy code which has been refactored
3 years ago
Morgan Pretty b541666ef0 Got the ability to send message working again and other tweaks
Tested and fixed a couple of issues with the disappearingMessages job
Added a simple dependency system for jobs (primarily for the AttachmentUploadJob, but will likely be others later)
Setup the AttachmentUploadJob again (looks like there are cases which use it)
Prevented a possible infinite job deferral loop from causing the app to crash (the loop is still technically possible but the app will continue to run now)
Updated the interactions unique constraints based on testing and discussions around how the serverHash works
Deleted the legacy ReadReceipt handling (now managed via the 'interaction.wasRead' flag and 'SendReadReceiptsJob')
Deleted the unused SSKIncrementingIdFinder
3 years ago
ryanzhao 4224a1fa3c tweaks for sending message to snode 3 years ago
Morgan Pretty 32304ae5dd Cleared out some of the legacy serialisation logic, further UI binding
Refactored the SignalApp class to Swift
Fixed a horizontal alignment issue in the ConversationTitleView
Fixed an issue where expiration timer update messages weren't migrated or rendering correctly
Fixed an issue where expiring messages weren't migrated correctly
Fixed an issue where closed groups which had been left were causing migration failures (due to data incorrectly being assumed to be required)
Shifted the Legacy Attachment types into the 'SMKLegacy' namespace
Moved all of the NSCoding logic for the TSMessage
3 years ago
Ryan Zhao 034f2ecc22 send messages with authentication 3 years ago
Morgan Pretty 3baeb981d9 Further work on the JobRunner
Moved the JobRunner into SessionUtilitiesKit so it can be used by SessionSnodeKit
Exposed a 'sharedLokiProject' value on UserDefaults to remove the hard-coded group name used everywhere
Added "blocking" job support for 'OnLaunch' and 'OnActive' jobs to the JobRunner (will retry until it succeeds)
Added the UpdateProfilePicture and RetrieveDefaultOpenGroupRooms jobs
3 years ago
Morgan Pretty 1c575e520d Merge remote-tracking branch 'upstream/voice-calls-2' into feature/session-id-blinding-part-2
# Conflicts:
#	Podfile.lock
#	Session.xcodeproj/project.pbxproj
#	Session/Conversations/ConversationVC+Interaction.swift
#	Session/Conversations/Views & Modals/JoinOpenGroupModal.swift
#	Session/Home/HomeVC.swift
#	Session/Open Groups/JoinOpenGroupVC.swift
#	Session/Utilities/BackgroundPoller.swift
#	SessionMessagingKit/Jobs/AttachmentUploadJob.swift
#	SessionMessagingKit/Open Groups/OpenGroupAPIV2.swift
#	SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift
#	SessionNotificationServiceExtension/NotificationServiceExtension.swift
3 years ago
Morgan Pretty ed9f4ea6c6 Fixed a few closed group and job issues
Fixed a few job migration issues
Fixed an issue with the closed group key pair management (wasn't storing keys correctly)
Refactored the OWSSound (now Preferences.Sound)
Added the logic for the AttachmentDownloadJob and enabled jobs to be cascade deleted via interactions
Optimised the HomeViewModel database observation query (fetch specific columns so changes outside those don't trigger updates)
Updated to the latest GRDB (ran into a deadlock which should be fixed in a newer version)
3 years ago
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
3 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)
3 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
3 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
3 years ago
Ryan Zhao 8b3d3fffb5 Merge branch 'dev' into voice-calls-2 3 years ago
Morgan Pretty 1492232224 Made some optimisations to open group deletion handling
Added a new OpenGroupServerIdLookup to make it easier to get a database id via an open group server id
Added a migration to generate the above data
Updated the handleCompactBody method to stop early if there are no messages to delete (would previously enumerate all interactions regardless)
Updated the handleCompactBody to fetch the mapping for the deleted message so we can avoid enumerating all interactions
3 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
3 years ago
Ryan Zhao a68ed28a7a Merge branch 'dev' into voice-calls-2 3 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
3 years ago
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
3 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)
3 years ago
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
3 years ago
Ryan Zhao 6b231316ee fix & improve voice message preview in home screen 3 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
3 years ago
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
3 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
3 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
3 years ago
Morgan Pretty 63e6cdd9ec Renamed OpenGroupAPIV2 to OpenGroupAPI
Added the inbox endpoints
3 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
3 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'
3 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
3 years ago
ryanzhao c38923cc2f Merge branch 'disappearing-message-fix' into voice-calls-2 3 years ago
ryanzhao e24ae60d71 fix duplicated disappearing message in closed groups 3 years ago
Ryan Zhao 35fc3ede9e Merge branch '1.11.19' into voice-calls-2 3 years ago
Ryan Zhao a6df6504c8 Prevent the same ExpirationTimerUpdate to be handled twice 3 years ago
Ryan Zhao e504e23f92 minor fix 4 years ago
Ryan Zhao 77e1f30bc9 fix sync message sending bug 4 years ago
Ryan Zhao 81dd4557a5 sync answer and end call message 4 years ago
ryanzhao e49431d2eb fix transaction crash 4 years ago
ryanzhao dd891063bd minor fix 4 years ago
ryanzhao 8a6be4fc5b notify pre-offer call message 4 years ago
ryanzhao 132ff0416f set server timestamp as open group message's sent timestamp 4 years ago
ryanzhao 1822c7df16 fix duplicated messages sent in closed groups 4 years ago
Ryan Zhao 6e45aed71b Merge branch 'dev' of https://github.com/oxen-io/session-ios into unsend-message 4 years ago
Niels Andriesse e311d2878f Fix message status indicator bug 4 years ago
Niels Andriesse 50d17be43b Fix animation glitch 4 years ago
Niels Andriesse b8c4e6aa93 Avoid unnecessary conversation screen updates 4 years ago
ryanzhao 9953451767 add comment 4 years ago
ryanzhao 8d53a775d2 Revert "delete real message and sync message together"
This reverts commit cc17a952e0.
4 years ago
ryanzhao cc17a952e0 delete real message and sync message together 4 years ago
Niels Andriesse 7f0b87a2b2 Avoid unnecessary conversation screen updates 4 years ago
Ryan Zhao c68350f3d8 store hash value for outgoing messages 4 years ago
Ryan Zhao b827b9e1ba make it work for multi device 4 years ago
Ryan Zhao 6aa865e7b7 delete locally and send unsend request 4 years ago
Niels Andriesse 8a29469eb5 Handle incorrect clock setting 4 years ago
Niels Andriesse ca862096b4 Rename profilePictureEncryptionKey → profileEncryptionKey 4 years ago
Niels Andriesse aa3a18fa7e Don't notify for closed group control messages
This addresses an issue where:

• someone would create a closed group
• on other peoples' devices this control message would be received through a background poll or a push notification
• the received message timestamps table would be updated
• processing wouldn't be finished (during a background poll or while handling a push notification the system can cut you off at any time)
• some of the added users don't see the new closed group because when they open the app and get the control message from their swarm it's considered a duplicate and isn't processed again
4 years ago
Niels Andriesse 3fda8daec9 Merge branch 'dev' into cleanup 4 years ago
Niels Andriesse bd04775cbf Implement open group invitations UI 4 years ago
nielsandriesse 06f795169b Merge branch 'dev' into cleanup 4 years ago
nielsandriesse 0c864454aa Remove duplicate message server ID tracking 4 years ago
Niels Andriesse d742fc1548 Delete V1 OGS & file server 4 years ago
Niels Andriesse 2763ee0d1a Clean 4 years ago
nielsandriesse a76c43973f Increase TTL & remove PoW 4 years ago
Niels Andriesse 516f815521 Debug 4 years ago
nielsandriesse e5764264b3 Debug 4 years ago
nielsandriesse 09b4b7d388 Update MessageSender for V2 open groups 4 years ago
nielsandriesse 81d091c43f Fail gracefully if the user doesn't have a name set 4 years ago
Niels Andriesse 82690259b2 Clean protobuf 4 years ago
Niels Andriesse dd0baf0d97 Unify contacts APIs 4 years ago
Niels Andriesse 73bbaf9ce7 Potentially fix attachment issue 4 years ago
nielsandriesse 2d6bf235d7 Sync expiration timer updates 4 years ago
nielsandriesse ece564988e Allow self-sending of closed group control messages 4 years ago
nielsandriesse 4803b96eb1 Only handle the first config sync message after restoration 4 years ago
Niels Andriesse 57f7bc88eb Fix leftover merge conflicts 4 years ago
Niels Andriesse 7acb6c9ac3 Merge branch 'dev' into multi-device 4 years ago
Niels Andriesse 804377c5a4 Minor refactoring 4 years ago
Niels Andriesse 585fabca03 Debug 4 years ago
Niels Andriesse 6b7b158000 Debug 4 years ago
Niels Andriesse cf333d5e3d Merge branch 'closed-groups' into multi-device 4 years ago
Niels Andriesse 867e9114a6
Merge branch 'dev' into multi-device 4 years ago
Niels Andriesse c9c83da3dc Rename ClosedGroupUpdateV2 → ClosedGroupControlMessage 4 years ago
Niels Andriesse 9ea1ccd0c2 Update ClosedGroupUpdate for new message types 4 years ago
Niels Andriesse 3e5baca72d Fix open group message deletion 4 years ago
Niels Andriesse eeef067f57 Implement message syncing 4 years ago
Niels Andriesse 0dd692cb42 Fix padding 4 years ago
Niels Andriesse 74fd3eb812 Partially implement message syncing 4 years ago
nielsandriesse 947287e42f Debug 4 years ago
Niels Andriesse a6e44ca0f0 Clean 4 years ago
Niels Andriesse d5228abea9 Update notification extension for V2 closed group updates 4 years ago
nielsandriesse d5e1237b0c Allow admins to leave & fix remaining issues 4 years ago
Niels Andriesse ee1d4b1bd5 Debug & make UI clearer 4 years ago
Niels Andriesse ce86d9a196 Debug 4 years ago
Niels Andriesse da503b0df1 Update Session protocol closed groups logic 4 years ago
Niels Andriesse ef1d6392a7 Activate the Session protocol 4 years ago
Niels Andriesse 2a4977d269 Implement Session protocol 4 years ago
nielsandriesse 97d0160138 Fix promise not completing 4 years ago
nielsandriesse f504965dfa Set group context
Android needs this
4 years ago
Niels Andriesse efe8f1c8bb Clean 4 years ago
Niels Andriesse 3f5bc18f6b Fix remaining TODOs 4 years ago
Niels Andriesse 21ec051016 Fix PN sending from share extension 4 years ago
Niels Andriesse 2396f22ede Also notify for newly created groups 4 years ago
Niels Andriesse 67b6162fb9 Fix open group attachment sharing 4 years ago
Niels Andriesse 00549a993f Debug 4 years ago
Niels Andriesse 7a8dbe1bf9 Tighten up error handling a bit more 4 years ago
Niels Andriesse f0cbdb8cda Fix share extension 4 years ago
nielsandriesse d6c115bc2a Fix module linking issue 4 years ago
nielsandriesse 71df0b84f0 Fix incorrect open group message timestamp 4 years ago
nielsandriesse e8661cf4d7 Debug 4 years ago
nielsandriesse f2572e4c91 Fix album message ID handling 4 years ago
nielsandriesse add2c467e4 Restructure 4 years ago
Niels Andriesse 2d8933901d Fix open group display name handling 4 years ago
Niels Andriesse 21810a0c4c Fix closed group message status handling 4 years ago
Niels Andriesse 3cf87d40ab Fix note to self 4 years ago
Niels Andriesse 993c673aad Clean 4 years ago
Niels Andriesse 8564c650a5 Parse open group attachments 4 years ago
Niels Andriesse b621bdc69a Partially fix open groups 4 years ago
Niels Andriesse a88ce33ee0 WIP 4 years ago
Niels Andriesse 3eae001202 Fix disappearing messages 4 years ago
Niels Andriesse 341782f255 Fix profile handling 4 years ago
Niels Andriesse d5dc33e619 Debug 4 years ago
nielsandriesse 5dfd4b1965 Restructure 5 years ago
nielsandriesse 178ab7e3e2 WIP 5 years ago
nielsandriesse ce7a23c401 Make sure sending errors bubble up to the user 5 years ago
nielsandriesse 921e2bced6 Debug 5 years ago
Niels Andriesse ac1bbb3de1 Handle open group message ID 5 years ago
Niels Andriesse 64cf19f461 Improve job error handling 5 years ago
nielsandriesse b218a16b05 Implement attachment downloading 5 years ago
Niels Andriesse 4a31a84daa Fix messages showing up as failed 5 years ago
Niels Andriesse 2e85d5fb41 Fix message sending status bar 5 years ago
Niels Andriesse 30370bf4d2 Make basic message sending work 5 years ago
Niels Andriesse b030b5999b Make messages show up again 5 years ago
nielsandriesse 15c6784f0f WIP 5 years ago
nielsandriesse c475f895e8 Create SignalUtilitiesKit 5 years ago
nielsandriesse 82127bfe4d Clean 5 years ago
nielsandriesse 505370f8d6 Implement open group message conversion 5 years ago
nielsandriesse a3382f41d4 Re-organize files 5 years ago
nielsandriesse a9755631e3 Re-implement Signal protocol encryption 5 years ago
nielsandriesse 8f443a38af Re-implement message wrapping 5 years ago
nielsandriesse d80804ca5a Create JobQueue 5 years ago
nielsandriesse 28172b4ed2 Create AttachmentUploadJob & AttachmentDownloadJob
Also conform SnodeMessage to NSCoding
5 years ago
nielsandriesse b4545903b1 Fix build 5 years ago
nielsandriesse 4b63588f1a Create MessageSendJob & MessageReceiveJob
Also implement message sending notifications & custom TTL for typing indicators
5 years ago