43 Commits

Author SHA1 Message Date
Doug
b01070c6b6
Project updates. (#3837)
* Don't use the AppIdentifierPrefix as it breaks when re-signing.

* Generate entitlements using XcodeGen.

* Ignore Xcode Archives.

* Remove the (unused) NCE.

* Update submodule.
2025-02-26 18:29:20 +00:00
Stefan Ceriu
b122b02bee
Share extension (#3506)
* Setup simple share extension

* Switch the app url scheme to be the full bundle identifier

* Setup a share extension that show a SwiftUI view, uses rust tracing and redirects to the hosting aplication

* Move media as json through the custom scheme into the main app and deep link into the media upload preview screen

* Fix message forwarding and global search screen room summary provider filtering.

* Tweak the message forwarding and global search screen designs.

* Add a room selection screen to use after receiving a share request from the share extension

* Fix share extension entitlements

* Share the temporary directory between the main app and the extensions; rename the caches one.

* Remove the no longer needed notification avatar flipping fix.

* Extract the placeholder avatar image generator from the NSE

* Nest `AvatarSize` within the new `Avatars` enum

* Donate an `INSendMessageIntent` to the system every time we send a message so they appear as share suggestions

* Support suggestions in the share extension itself

* Improve sharing animations and fix presentation when room already on the stack

* Clear all routes when sharing without a preselected room.

* Fix broken unit tests

* Various initial tweaks following code review.

* Correctly clean up and dismiss the share extension for all paths.

* Move the share extension path to a constants enum

* Rename UserSessionFlowCoordinator specific share extension states and events

* Add UserSession and Room flow coordinator share route tests

* Tweak the share extension logic.
2024-11-13 14:02:47 +02:00
Stefan Ceriu
dc6d7f2985
Integration test improvements (#3330)
* Send a message from integration tests and check that it doesn't show up in the app logs
* Increase photo library timeout

* Wait for image tapping to process

* Send a message using the rich text editor too

* Wait for the various pickers to finish loading

* Set all logs to `trace` in integration tests

* Close formatting options after sending the second message

* Make sure logs are actually sent to tracing and get redirected to the right file

* Switch from using a custom `trace` log configuration to the lowest level `TracingConfiguration` we support
2024-09-26 10:15:09 +03:00
Stefan Ceriu
2f6fea29f3
Replace Prefire with a very similar but simpler and more direct approach (#3232)
* Replace Prefire with a very similar but simpler and more direct approach

* Move PreviewTest snapshots to their new location (snapshotting default, mirrors UITests)

* Update acknowledgements

* Switch snapshot configuration extensions to a custom version

* Exclude snapshots from the PreviewTests target

* Fix acknowledgements

* Rename snapshotting preference keys

* Remove `skipPackagePluginValidation`
2024-09-09 15:07:41 +03:00
Doug
812c5d5c61
Update the SDK (#3196)
* Update the SDK.

* Fix API breaks on send failures and propagate the new type.

* Handle new SDK ShieldState.

* Set up the ClientBuilder's `cachePath` option.

* Delete the cacheDirectory during logout/clearCache.

* Add unit tests for RestorationToken decoding and SessionDirectories generation.
2024-08-27 11:06:26 +01:00
Stefan Ceriu
f89c3e54b4
Automatically try reloading failed images on network changes (#3170)
* Add the networkMonitor to the NSE and delete the old MockMediaLoader

* Generate a MediaLoaderMock through AutoMockable and use it in the MediaProviderTests

* Implement an ImageProvider mechanism that automatically tries reloading images when connectivity is established again and use it for LoadableImages

* Merge the ImageProvider protocol back into the MediaProvider

* Address PR review comments

* Provide a default sdk client request configuration

* Address tasks not automatically cancelling themselves when views get deallocated
2024-08-15 18:20:19 +03:00
Doug
cdd763efd4
Add a certificate validator hook. (#3069)
* Add a certificate validator hook.

* General tidy up of AppHooks.

* Don't worry about the generic call links.
2024-07-19 17:05:54 +01:00
Doug
288d2c2fdc
Add a ClientBuilder hook. (#3056) 2024-07-18 09:47:37 +01:00
Stefan Ceriu
239afeb662 Fixes #3042 - Cancel ElementCall ringing as soon as the call ends 2024-07-17 10:24:30 +03:00
Doug
3465ea4cc1
Use a Client in AuthenticationService now that the Rust one has been removed. (#2954)
* Replace Rust's Authentication service by building a Client.

* Drop the Proxy from AuthenticationServiceProxy[Protocol].

* Make sure to call abortOIDCLogin.

* Centralise common ClientBuilder code.

* Update the SDK.
2024-06-24 15:05:00 +01:00
Stefan Ceriu
8bfd802793 Add support for showing the native OS incoming call screen when starting new Element Calls 2024-05-24 15:32:56 +03:00
Stefan Ceriu
8ba544bc44
Cleanup following the AppMediator introduction (#2723)
- stop using multiple background task, the appCoordinator sync one is enough for the whole app
- move the AppMeditor to the MainActor
- expose the WindowManager through the AppMediator
- hide sensitive WindowManager API behind a different protocol
- remove the now unnecessary `BackgroundTaskService`
2024-04-22 18:10:24 +03:00
Stefan Ceriu
9a172df7fd Introduce an AppMediator which will:
- combine multiple services to handle app wide requests
- remove direct UIApplication access from everywhere
- fix #2703 by combining UIApplication.applicationState with the WindowManager's main window appearance
- leave the door open for more app control in the future (especiall for the mac)
2024-04-19 15:43:56 +03:00
Stefan Ceriu
fcc25dd441 Adop the new SDK permalink detector and user builder 2024-04-12 18:04:41 +03:00
Doug
eda7d59518
Update strings and add productionAppName value for the new placeholder. (#2677)
* Update strings and add productionAppName value for the new placeholder.

* Fix snapshots.

* Fix more snapshots.
2024-04-10 16:58:00 +01:00
Stefan Ceriu
7a9e4819c1 Add .xcprivacy info files to the main app and the notification service extension 2024-03-18 17:31:46 +02:00
Mauro
a4bc7b8e36
Custom copy for notifications that contain mentions (#2050) 2023-11-09 18:12:11 +00:00
Mauro
ad0b2f114f
@room in user suggestions (#1880)
* for now I am using a local RTE solution, need to fix one test

* fixed a test

* new rte version

* pr suggestions

* @room added to the suggestions

* removed empty space

* revert

* code improvement

* project updated

* package
2023-10-12 16:15:47 +00:00
Doug
2c5662a278
Remove DesignKit package (#1886)
- Move button styles to Compound
- Rename text style to AuthenticationTextStyle as its only in the auth flow.
- Add the brand colour locally for now until its included in Compound.

* Update snapshots.

---------

Co-authored-by: Stefan Ceriu <stefan.ceriu@gmail.com>
2023-10-12 15:45:27 +01:00
Mauro
6bc5a440b2
Fixed a bug that prevented the mentions to be shown as plain text in the room list cell (#1835)
* fix a bug that made the room list not render mentions as plain text

* better naming
2023-09-29 14:49:20 +00:00
Mauro
b5ff6bb93e
Fix for reversed placeholder on notifications on iOS 17 (#1785)
* fix

* invalidating cached images only for iOS 17

* removed paranthesis

* better code

* fix
2023-09-25 09:46:43 +02:00
Mauro
9d91cd4fc0
Preview Tests (#1768)
* preview testing

* removed some views that are not really testabl in UnitTests and improved other tests
2023-09-20 17:33:31 +02:00
Stefan Ceriu
97aa930852
Parse markdown and html from push notifications (#1688)
* Extract notification content building outside of the NotificationItemProxy. First step in a bigger refactoring of the NSE

* Import the attributed string buider into the NSE, sort `sources` imports

* Extract message event string building into the RoomMessageEventStringBuilder and reuse it building content for push notifications

* Cleanup

* Add changelog
2023-09-13 12:30:41 +03:00
Mauro
8188fd2d2a
NSE user agent support (#1507) 2023-08-17 13:11:34 +00:00
Alfonso Grillo
1529b5b8ca
Update SDK to 1.0.102-alpha (#1408)
* Update SDK to 1.0.102-alpha

* Log error

* Notification Improvements API part 1 (#1410)

* changes

* WIP

* progress

* updated test

* removed unused

* code improvement

* Process diffs as batches provided by the SDK.

---------

Co-authored-by: Mauro <34335419+Velin92@users.noreply.github.com>
Co-authored-by: Doug <douglase@element.io>
2023-07-27 09:48:56 +00:00
Mauro
544d928287
Placeholders added in push notifications (#1176)
* placeholders added in push notifications

* this code is a bit easier to read

* code improvement
2023-06-27 11:44:19 +00:00
Mauro
afc4332716
Two sync loop experimental solution to decrypt push notifications (#1082)
* Experimental two sync loop solution

* better logging

* improved the code and handled invite notifications display better

* improved invite notifications

* new exerimental branch

* new sync loop

* code updated

* code improvements

* code improvements

* fix typo

* code improvements

* removed some unused code and added a respawn

* fixing some NSE issues

* code improvements

* new version of the branch

* more logging

* running the nse process ONLY IF necessary

* finally works! made also the feature flag

* also the encryption value of the room list api will depend on the flag now

* changelog

* code improvements

* code improvement

* updated proj

* fixing some compilation error after the rebase

* opt-in for the encryption sync

* fix
2023-06-22 17:23:33 +00:00
Stefan Ceriu
c7ee69d75d Change the bundle display name to Element X, keep the rest as ElementX 2023-06-08 12:49:09 +03:00
Mauro
ce6d68614a
Showing the iOS default silhoutte when the user/room avatar is missing (#965)
* fix

* Element X app name

* project update

* improvement
2023-05-29 08:41:01 +00:00
Mauro
f679c0ca2a
Remote Push Notifications can now be decrypted (#854)
* refactored the NSE to use the client function

* removed unused imports in the target.yml

* some code improvements

* changelog

* code improvement

* code improvement

* more code improvements

* separated the client and the media provider in a dedicated NSEUserSession

* Update ElementX/Sources/Services/Client/ClientProxy.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

* pr suggestions

* logging the error

---------

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
2023-05-05 15:29:46 +00:00
Mauro
95492d7e10
Avoid race and duplication conditions between local and remote notifications (#848)
* added timestamp control of the local notification

* improved the code, and implemented the solution, just needs some testing

* sdk bump

* UserPreference init with initialValue instead of defaultValue

* pr suggestions

* changelog

* notifications sliding sync view added
2023-05-03 14:28:07 +00:00
Mauro
ccccdce0fc
Notification Handler to handle notifications in foreground (#837)
* changed how the notifications are handled

* local notifications can be decrypted and shown!

* Improved the handling for the mock and for the normal messages

* Avatar images are also displayed

* pr ready, commented some code that is not supposed to be releaaed yet, adjusted some tests and added some source code in the targets

* fixing some swiftlint complaints and removed an unused function

* better swiftlint disable

* addressing PR comments
2023-04-28 12:36:16 +00:00
Stefan Ceriu
be8adb19b5
Structured logging (#831)
* Structured logging support

* Bump the SDK, fix breaking changes

* Enabled more logging of timeline diffs

* Keep only source file last path components in logs

* Bump the SDK, tweaks following code review
2023-04-25 14:48:20 +03:00
Stefan Ceriu
6700d4301d
#748 - Implement methods for processing various media types and prepa… (#772)
* #748 - Implement methods for processing various media types and preparing them for upload

* Various tweaks following code review:
- added blurhash generation
- changed thumbnails to jpeg
- throwing if file size cannot be retrieved
- move MediaProvider files to separate folder so they can cleanly be imported in the NSE
- added audio file processing
- switched all image resizing methods to ImageIO
- various renames

* Fix blurhash formatting issues, `swift-format-ignore-file` doesn't work

* Processing all media within unique folders to avoid conflicts

* Fix various warnings

* Rename `sizeForItemAt(_ url: URL)` to `sizeForItem(at url: URL)`

* Remove unnecessary resizeImage(UIImage) method, start by copying not moving the file to the unique location

* Add back warning for roomDetails.avatarURL
2023-04-21 12:13:36 +03:00
Mauro
3d0d883637
Notifications are now handled when the app is in a killed state (#801)
* WIP, added support for receiver id and managed a way to store the app router state

* WIP, added support for receiver id and managed a way to store the app router state

* Notification Manager is now becoming the UNUserNotificationDelegate ASAP

* code improvements + changelog

* fixed Unit Tests

* pr suggestions
2023-04-14 14:24:48 +02:00
Doug
efdb47a98a
Move media file loading logic to the SDK. (#702)
* Adopt getMediaFile for media previewing.
2023-03-20 14:51:33 +00:00
Stefan Ceriu
bd4c0b72cb
Media loading flow changes (#483)
* Use an imageProvider directly from the view in the home screen

* Add support for media request coalescing

* Rename MediaProxy to MediaLoader

* Add new image loading mechanism to the room details screen avatar.

* Use the `SettingsScreen` prefix for all settings screen related components

* Add new image loading mechanism to the room header

* Add new image loading mechanism to the room member details screen

* Introduce a LoadableImage SwiftUI view that will automatically handle image loading

* Adopt the new LoadableImage where possible

* Fix LoadableImage not using/storing loaded images properly

* Simplify media loader enqueueing

* Made LodableImage load content after mediaSource updates. Adopt it on the home and settings screens

* Introduce a LoadableAvatarImage component and reuse it throughout the app

* Small logging tweaks, made some LoadableImage properties private

* Fix redacted skeletons avatar background color

* Fix placeholder avatars changing when backgrounding the app

* PR comments.

- Trim the @ sign off of mxid placeholders.
- Only expose AvatarSize on the avatar image, use CGSize elsewhere.

Co-authored-by: Doug <douglase@element.io>
2023-01-25 17:45:01 +00:00
Doug
b8e2d6f823
Show the date on a room when the last message is older than today. (#484)
* Format the last message date correctly.
* Update room cell layout - fixes an issue where the longer the date got the smaller the last message width was.
2023-01-24 11:02:51 +00:00
Stefan Ceriu
ae8009d040
Various performance tweaks (#474)
* Store and reuse room list placeholder avatars and last messages

* Cache and reuse HomeScreenRooms

* Reduce RoomSummaryProvider diff collection time

* Promote more logs to info

* Slighty tweak RustTracing to make it easier to configure

* Move TimelineProvider and RoomTimelineController item processing to background queues

* Prevent the timeline from stopping an ogoing decelerating scroll when starting backpaginating
2023-01-20 14:40:23 +00:00
Stefan Ceriu
8f3f83167b
Timeline item sender profiles (#463)
* Adopt timeline item sender profiles for displaying user avatars and display names
* Prevent images from automatically being evicted from the in-memory cache when entering background
* Get rid of all the `urlString: String`s and start using proper URLs
* Add back manual display name loading as the sender profiles aren't working properly yet
* Implement a sender profile.
* Bump the RustSDK to v1.0.32-alpha

Co-authored-by: Doug <douglase@element.io>
2023-01-18 14:29:44 +00:00
Doug
b97e6f7a98
Fix keychain access on macOS. (#354) 2022-12-06 17:39:15 +00:00
Stefan Ceriu
83410aa660 Add missing NSE bundle display name
- ITMS-90360: Missing Info.plist value - A value for the key 'CFBundleDisplayName' in bundle ElementX.app/PlugIns/NSE.appex is required.
2022-11-24 10:35:53 +02:00
ismailgulek
d389ce7ad7
Notifications (#275) 2022-11-21 19:37:13 +03:00