Commit graph

1126 commits

Author SHA1 Message Date
Morgan Pretty
333849c32e Logic for interactions with user mentions and closed group tweaks
Added logic to flag interactions that mention the current user
Fixed up closed group member handling
2022-05-09 14:45:14 +10:00
Ryan Zhao
510d7c22a2 fix background poller updating last hash issue. 2022-05-09 14:15:08 +10:00
Ryan Zhao
627aba1650 clean up duplicated code 2022-05-09 10:03:54 +10:00
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
2022-05-08 22:01:39 +10:00
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
2022-05-06 18:07:57 +10:00
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
2022-05-06 12:44:26 +10:00
ryanzhao
dac3f10dd1 tweaks on closed group polling logic 2022-05-06 10:37:53 +10:00
ryanzhao
c46c75e4f0 clean 2022-05-04 17:18:03 +10:00
ryanzhao
86605dce08 update background poller for hardfork closed group message retrieve 2022-05-04 17:17:15 +10:00
ryanzhao
372e87e70f minor fix 2022-05-04 16:36:15 +10:00
ryanzhao
e540497724 update last hash persistence 2022-05-04 11:47:09 +10:00
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
2022-05-03 17:14:56 +10:00
Ryan Zhao
00c200d284 update translation 2022-05-02 16:41:14 +10:00
Ryan Zhao
f48cdd02ee fix an issue where current call implementation won't compile for simulators 2022-05-02 10:18:41 +10:00
ryanzhao
a12e86a36b fix an issue where new additions to group not appearing in mentions 2022-04-27 16:36:50 +10:00
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
2022-04-27 10:48:54 +10:00
Morgan Pretty
94742c80ec Further work on the JobRunner
Fixed an issue where the hash retrieved when fetching messages from the service node might not be the latest one
Updated the MessageReceiveJob to batch process messages (on failure only the failed messages will retry)
2022-04-26 17:31:50 +10:00
Ryan Zhao
bc9ff65659 fix for conversation screen title position with call button 2022-04-26 16:42:03 +10:00
Ryan Zhao
4da0ccdd44 fix an issue where current call implementation won't compile for simulators 2022-04-26 15:59:37 +10:00
Ryan Zhao
9c994ff176 Merge branch 'dev' into bug-fixes-1.11.25 2022-04-26 15:43:29 +10:00
Ryan Zhao
7b33c541a4 minor fix for conversation screen title position 2022-04-26 14:32:07 +10:00
Morgan Pretty
a154b56e22 Merge branch 'dev' into feature/session-id-blinding-part-2 2022-04-26 13:06:51 +10:00
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
2022-04-26 13:06:12 +10:00
Ryan Zhao
102a29b8e3 further fix for input view not scrollable issue 2022-04-26 11:51:55 +10:00
Ryan Zhao
f95fe15d46 add session turn server info 2022-04-26 10:57:01 +10:00
Ryan Zhao
5bb287f258 fix an issue where rejected message requests will come back on linked devices 2022-04-26 10:51:59 +10:00
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)
2022-04-22 18:47:11 +10:00
Ryan Zhao
8db281e42f hide disappearing message settings when current thread is blocked 2022-04-21 17:12:04 +10:00
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
2022-04-21 16:42:35 +10:00
Ryan Zhao
d0764adaf3 ask formic permission when enabled call for the first time & update build number 2022-04-21 14:28:36 +10:00
Ryan Zhao
95d120266d show incoming call banner for CallKit disabled cases 2022-04-21 12:17:00 +10:00
Ryan Zhao
fba6dbcf9b refactor to make CallKit disabled for China mainland 2022-04-21 12:07:21 +10:00
Ryan Zhao
e664cb8235 Merge branch 'bug-fixes-1.11.25' into bug-fix-for-calls 2022-04-21 09:39:54 +10:00
ryanzhao
8557604064 clean up 2022-04-20 15:09:33 +10:00
Ryan Zhao
37dc1631b5 fix an issue where the textview is not scrollable after the app goes into background and goes back in foreground. 2022-04-11 16:22:09 +10:00
Ryan Zhao
fa9de8c9c3 Merge branch 'dev' into bug-fixes-1.11.25 2022-04-11 15:42:00 +10:00
Ryan Zhao
ed0c2d1e52 Merge branch 'fix/linkPreviewDarkModeText' into voice-calls-2 2022-04-11 14:02:31 +10:00
Ryan Zhao
b23038087f try to fix a call issue when iOS is on lock screen 2022-04-11 10:36:21 +10:00
Morgan Pretty
dbb0cdf0cb Fixed an issue where the text on the LinkPreview in dark mode wasn't visible 2022-04-11 10:21:45 +10:00
Morgan Pretty
4380f1975c Further work on the DB refactoring
Added the rest of the interaction structure to the database (testing some migration logic now - still needs to be finalised)
Updated the YDBToGRDB migrations to wrap their inserts in autorelease pools (helps memory slightly, unfortunately it's caching the YDB data which uses the most memory but we have opted for speed over RAM at the moment)
Updated the MockDataGenerator so it should now "chunk" the code generation (crazy large figures were previously resulting in excessive memory usage)
2022-04-08 16:56:33 +10:00
ryanzhao
5ebb2ceee3 fix call duration label get hidden 2022-04-07 17:02:57 +10:00
ryanzhao
f1445a2191 add missed call notification 2022-04-07 15:10:38 +10:00
ryanzhao
343df684d9 fix race condition for callkit 2022-04-07 12:29:09 +10:00
ryanzhao
6cb3e1db22 add interaction for showing missed call tips if the permission is denied 2022-04-06 17:24:48 +10:00
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)
2022-04-06 15:43:26 +10:00
ryanzhao
5fa63286da refactor timeout logic for calls incoming and reconnecting 2022-04-06 15:41:38 +10:00
ryanzhao
f2cfa29b21 add call related logs to log file 2022-04-05 16:35:09 +10:00
ryanzhao
7d3df3a016 Merge branch 'bug-fixes-1.11.25' into voice-calls-2 2022-04-05 11:36:56 +10:00
ryanzhao
49b4c7b586 fix an edge case for callkit notification 2022-04-05 11:29:59 +10:00
Ryan Zhao
77c00b6c37 fix #456 2022-04-04 16:10:28 +10:00
Morgan Pretty
0f4df804ed Merge branch 'dev' into feature/database-refactor
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Meta/AppDelegate.m
#	SessionMessagingKit/Utilities/OWSIdentityManager.h
#	SessionMessagingKit/Utilities/OWSIdentityManager.m
#	SignalUtilitiesKit/Database/Storage+Conformances.swift
#	SignalUtilitiesKit/Database/TSStorageHeaders.h
#	SignalUtilitiesKit/To Do/OWSPrimaryStorage+Loki.m
2022-04-04 13:41:16 +10:00
Morgan Pretty
93f248d149 Merge branch 'dev' into feature/session-id-blinding-part-2
# Conflicts:
#	SessionMessagingKit/Open Groups/OpenGroupManagerV2.swift
#	SessionMessagingKit/Storage.swift
2022-04-04 13:33:27 +10:00
Ryan Zhao
a22dc15249 fix closed group poller unwrapping crash in background 2022-04-04 13:31:56 +10:00
Morgan Pretty
4ee4b3ffb3 Started adding migration logic for contacts
Updated the getUserHexEncodedPublicKey to take an optional db value so we can retrieve it during the initial migration
2022-04-04 13:18:14 +10:00
Ryan Zhao
36094eed7f Merge branch 'remove-unused-code' into voice-calls-2 2022-04-04 11:08:54 +10:00
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
2022-04-01 17:22:45 +11:00
Morgan Pretty
e65682ae9b Merge branch 'dev' into feature/database-refactor
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Backups/OWSBackup.m
#	Session/Backups/OWSBackupImportJob.m
#	SessionSnodeKit/SnodeAPI.swift
2022-03-31 12:09:04 +11:00
Morgan Pretty
c3b855646f Merge branch 'dev' into feature/session-id-blinding-part-2
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Conversations/Views & Modals/JoinOpenGroupModal.swift
#	Session/Open Groups/JoinOpenGroupVC.swift
#	Session/Settings/SettingsVC.swift
#	SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift
#	SessionMessagingKit/Sending & Receiving/MessageReceiver.swift
2022-03-31 12:03:00 +11:00
Morgan Pretty
1633105ce2 Merge branch 'dev' into feature/remove-unused-code
# Conflicts:
#	Session/Backups/OWSBackup.m
#	Session/Backups/OWSBackupImportJob.m
#	SignalUtilitiesKit/Sharing/SelectRecipientViewController.m
#	SignalUtilitiesKit/Sharing/SelectThreadViewController.m
2022-03-31 11:51:59 +11:00
Morgan Pretty
529e416dd1 Started work on GRDB logic and migrations
Setup a migration pattern
Setup the database configuration and security
Started defining the database schema
Started working on the migrations for SessionSnodeKit
2022-03-31 11:47:09 +11:00
Ryan Zhao
49d6a64194 Merge branch 'remove-OWSBlockingManager' into voice-calls-2 2022-03-31 11:09:09 +11:00
Morgan Pretty
0842dbff1e Removed a bunch of unused code
Removed the legacy Theme code (replaced with SessionUIKit equivalents)
Removed the OWSOrphanDataCleaner (unused)
Removed the OWSReceiptType_Delivery from the OWSOutgoingReceiptManager (unused)
Removed the TSStorageKeys and TSStorageHeaders files (unused)
Removed the LKMessageIDCollection (unused - only had methods for deleting data from the collection)
Removed the OWSPrimaryStorageTrustedKeysCollection and OWSIdentityManager_QueuedVerificationStateSyncMessages (unused)
Removed collections and notifications from OWSProfileManager (unused)
2022-03-30 09:46:08 +11:00
Morgan Pretty
9e3c02f79b Removed the unused legacy OWSBackup code 2022-03-30 09:05:07 +11:00
Morgan Pretty
8344ed5d81 Fixed the unit tests broken by the merge
Added the ability to mock the GeneralCache data
Added a couple additional tests to validate some updated OpenGroupManager code
2022-03-29 10:15:22 +11:00
Morgan Pretty
e3622088ad Fixed missed framework complication errors from merge 2022-03-29 09:30:32 +11:00
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
2022-03-29 09:15:32 +11:00
Morgan Pretty
21924ee81a Merge branch 'dev' into feature/remove-OWSBlockingManager
# Conflicts:
#	Session.xcodeproj/project.pbxproj
2022-03-29 08:45:48 +11:00
Ryan Zhao
8b3d3fffb5 Merge branch 'dev' into voice-calls-2 2022-03-28 14:29:32 +11:00
RyanZhao
7cd0079b37
Merge pull request #599 from mpretty-cyro/fix/update-last-message-hash-after-registering-jobs
Fix - Update last message hash after registering jobs
2022-03-28 14:06:03 +11:00
RyanZhao
f05c695756
Merge pull request #588 from mpretty-cyro/fix/message-request-count-bug
Performance: Count unread message requests thread-first rather than unread-message-first
2022-03-28 14:00:41 +11:00
Ryan Zhao
07c18927f2 minor fix to prevent redundant offer 2022-03-25 16:29:52 +11:00
Ryan Zhao
9df52a0a89 implement new approach for call reconnection 2022-03-25 13:26:26 +11:00
Morgan Pretty
7165b9e4f6 Merge branch 'dev' into feature/remove-OWSBlockingManager
# Conflicts:
#	Session/Conversations/ConversationVC+Interaction.swift
#	Session/Meta/AppDelegate.swift
#	SessionMessagingKit/Messages/Control Messages/ConfigurationMessage+Convenience.swift
#	SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift
2022-03-24 16:51:34 +11:00
Ryan Zhao
fc093a0157 Merge branch 'dev' into bug-fix-for-call 2022-03-24 16:37:29 +11:00
RyanZhao
8daf804fd5
Merge pull request #597 from mpretty-cyro/fix/ui-call-running-on-background-thread
Fix for a UI call running on background thread
2022-03-24 16:36:34 +11:00
RyanZhao
3e20519a6a
Merge pull request #603 from mpretty-cyro/fix/link-preview-crash
Fix link preview crash
2022-03-24 16:36:10 +11:00
Ryan Zhao
fdde7e4fe0 Merge branch 'fix/tweaks-to-config-message-generation' of https://github.com/mpretty-cyro/session-ios into bug-fix-for-call 2022-03-24 16:33:10 +11:00
Morgan Pretty
e4def22472 Moved the Storage.write call into the self.approveMessageRequestIfNeeded call 2022-03-24 15:46:53 +11:00
Morgan Pretty
212c5e87aa Re-added the transaction requirement when generating the current config message 2022-03-24 15:34:46 +11:00
Morgan Pretty
29c53223e0 More tweaks to fix crash
Wrapped the force sync calls within their own Storage.write blocks to ensure they have the latest data and aren't accessing a transaction completed in a different thread
Reverted a number of the unneeded changes
2022-03-24 15:25:47 +11:00
Morgan Pretty
b815a9f348 Fixed up a potential threading issue with the sync configuration logic
Moved all the sync configuration calls to be within the existing 'write' blocks instead of waiting until the completion
2022-03-24 15:08:24 +11:00
Ryan Zhao
e7c564914d makes more sense on call timeout 2022-03-24 15:05:00 +11:00
Morgan Pretty
1214005c59 Updated the cachedEncodedPublicKey to be Atomic
Added the Atomic wrapper for thread safe variables
2022-03-24 14:42:25 +11:00
Morgan Pretty
1a6c34e3b8 Removed the unused legacy OWSBackup code 2022-03-24 14:35:23 +11:00
Morgan Pretty
990edd20df Swapped a force-unwrap to an optional unwrap 2022-03-24 13:42:49 +11:00
Morgan Pretty
5bb3bd7bc1 Cleaned up some config sync logic and allowed migrations to trigger them
Updated the migrations so they can specify whether a configuration sync is required
Moved the config sync logic into a MessageSender extension (makes far more sense than AppDelegate)
Fixed a bug where the ShareVC was triggering the 'versionMigrationsDidComplete' twice
Removed a couple of imports for files that had been deleted
2022-03-24 10:03:51 +11:00
Morgan Pretty
78c0d000be Removed the OWSBlockingManager replacing it with the config sync
Fixed an issue where the "block" button would appear in the NoteToSelf swipe menu
Removed the OWSBlockingManager and supporting files
Removed a number of unused classes and methods
Refactored the BlockListUIUtils to Swift
2022-03-23 09:59:38 +11:00
Morgan Pretty
b90904ebbd Updated the code to only update the last message hash once the MessageReceiveJobs have been created 2022-03-22 14:09:47 +11:00
Ryan Zhao
c2ab454499 fix conversation screen title & button arrangement after message request is approved 2022-03-22 10:08:14 +11:00
Morgan Pretty
01742af16b Added an initial call to isRTL on the main thread to prevent a background thread calling it first 2022-03-21 17:18:12 +11:00
Ryan Zhao
37614fe3d8 Merge branch 'dev' into voice-calls-2 2022-03-21 14:21:51 +11:00
RyanZhao
9e020948d6
Merge pull request #594 from RyanRory/bug-fixes-1.11.23
Bug fixes for 1.11.22
2022-03-21 14:11:42 +11:00
RyanZhao
9eeec36cc6
Merge pull request #586 from mpretty-cyro/feature/conversation-menu-font-weight
Increased the conversation menu label font weights
2022-03-21 13:57:02 +11:00
RyanZhao
1b21951335
Merge pull request #585 from mpretty-cyro/feature/image-tinting-optimisations
Performance: Image tinting optimisations
2022-03-21 13:56:51 +11:00
Ryan Zhao
8652268557 add logs & fix PN 2022-03-21 13:55:51 +11:00
Ryan Zhao
7fb6726d43 refactor on media+text message cell 2022-03-17 16:08:45 +11:00
Ryan Zhao
81317db165 fix message with two links and a link preview, second link uses address of first 2022-03-17 15:48:33 +11:00
Morgan Pretty
1ed3328aac Updated how the HomeVC counts unread message request threads
Updated the HomeVC to count the threads with unread messages using the TSMessageRequestGroup instead of using the UnreadDatabaseView
Removed the OWSMessageUtils 'unreadMessageRequestCount' method
2022-03-17 13:40:32 +11:00
Ryan Zhao
95797d427c fix link preview text colour 2022-03-17 10:43:11 +11:00
Morgan Pretty
b1684f6b23 More unit tests, fixed a few issues uncovered by testing
Updated the OpenGroupManager to support injecting the cache for better unit testing
Updated the MessageReceiver to support Dependencies being passed as a parameter for visible message and storage purposes
Added a debugDescription to the OpenGroup for more accurate unit testing
Fixed an issue where the poll function would include the inbox and outbox endpoints even when the server was not blinded
Fixed some test compilation time issues
Fixed a bug where the OpenGroupAPI Room was using 'description' as a parameter name (used by Swift for other purposes)
Fixed a bug where then OpenGroup was incorrectly using the system 'description'  property in one place
Renamed the parseV2OpenGroup to parseOpenGroup for consistency
2022-03-16 15:55:56 +11:00