Commit Graph

61 Commits

Author SHA1 Message Date
Stefan Ceriu
af5b670bf3 Be more lenient with the power levels as they can still be missing at the time the various screens are created e.g. after accepting an invite.
The correct solution is to subscribe to update and update the UI accordingly when receiving them.
2025-06-26 18:57:46 +03:00
Stefan Ceriu
4b68d1caf3 Make the room power levels optional as they can be missing depending on what state events are requested 2025-06-25 17:23:22 +03:00
Stefan Ceriu
64f0d4cd01 Adopt new canOwnUser* power level methods instead of the throwing ones. 2025-06-25 17:23:22 +03:00
Stefan Ceriu
e5a49c568f Adopt room info power levels (#4245)
* Use the newly RoomInfo published PowerLevels; update permissions at the same time as the room info and avoid unnecessary async calls.

* Introduce a RoomInfoProxyProtocol and associated mock and move away from mocked SDK RoomInfos

* Bump the SDK to v25.06.23

* Expose new non-throwing methods for checking one's own user permissions

* Fix the unit and preview tests (except the TimelineMediaPreviewDetails for which simplified snapshots were generated)

* Converge on one single implementation for computing a room's avatar.

* Fix more unit tests

* Fix the TimelineMediaPreviewDetailsView snapshot tests

This reverts commit 9b6c819e611ad2fa3de2c34a4a7aa556fc9faadd.

---------

Co-authored-by: Doug <douglase@element.io>
2025-06-24 17:48:00 +01:00
Stefan Ceriu
46a066491d Better integrate RoomPowerLevelsProxyMock's own Configuration struct. 2025-06-20 18:10:45 +03:00
Stefan Ceriu
60f4228162 Adopt the lastest SDK APIs and refactor how we deal with user permissions.
This patch introduces a new RoomPowerLevelsProxy and its associated mock and adopts newer Rust APIs to make working with user power levels and permissions easier.
2025-06-20 18:10:45 +03:00
Stefan Ceriu
b9ad6ed557 Rename the TimelineProvider to TimelineItemProvider 2025-05-23 16:08:18 +03:00
Mauro
0154e10f98 Always open manage member sheet (#4110)
* always open manage member sheet

* Update ElementX/Sources/Screens/ManageRoomMemberSheet/ManageRoomMemberSheetModels.swift

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

* Update ElementX/Sources/Screens/ManageRoomMemberSheet/ManageRoomMemberSheetModels.swift

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

* pr suggestions and handled the buttons actions correctly

* Update ElementX/Sources/Screens/ManageRoomMemberSheet/View/ManageRoomMemberSheetView.swift

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

* fixed some compilation errors

* added some documentation

* using a struct instead of a protocol

* using arguments instead of a struct

---------

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
2025-05-19 14:17:57 +00:00
Mauro Romito
b3bff57ed9 refactor: manage member sheet in timeline
better implementation

updated tests

Update ElementX/Sources/Screens/Timeline/TimelineViewModel.swift

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

fix
2025-04-09 15:03:54 +02:00
Mauro Romito
58a3d0a7f3 feat: report a room
updated tests

updated tests

added a feature flag to report room

removed delay

rename
2025-04-07 17:17:08 +02:00
Mauro
302bc6c415 Add alerts with reason for kick and ban (#3967)
* feat: added alerts with reason for kick and ban

in the room members list screen

* fix tests
2025-04-01 16:06:40 +00:00
Stefan Ceriu
1ae6fc67c4 SDK update (#3891)
* Bump the RustSDK to v25.03.11

* Replace oidc login prompt with nil following the changes from https://github.com/matrix-org/matrix-rust-sdk/pull/4761

```
/// * `prompt` - The desired user experience in the web UI. No value means
///   that the user wishes to login into an existing account, and a value of
///   `Create` means that the user wishes to register a new account.
```

* Fix trailing closure warnings

* Update the client proxy after making `getNotificationSettings()` and  `cachedAvatarUrl()` async (they used to be blocking on the rust side).

* Move `Room.isEncrypted` to the info publisher and manually update the encryption state when creating the room.

* Bump the SDK again to v25.03.12 - This introduces a new way to configure the tokio runtime that we can use to have extensions use less memory
- introduce a new Target struct that takes care of setting up rust services (tracing and tokio) for our various targets
- cleanup MXLog and friends

* Address PR comments

* Bump the SDK again, switch back to using `.consent` as the OIDC login prompt (which was reintroduced in matrix-org/matrix-rust-sdk/pull/4791)
2025-03-13 11:17:37 +02:00
Stefan Ceriu
1e58795a65 User verification state indicators (#3793)
* Introduce a `UserIdentityProxy` and have it combine upstream methods into an easy to digest  `UserIdentityVerificationState`. Use it in a dedicated `VerificationBadge` UI component

* Show a DMs counterpart verification state in the room header

* Show a warning on the room details `People` entry when there are identity verification state violations on any of the members.

* Show verification badges in the room member list

* Show a withdraw verification section on the room member details for users that have pinning violations.

* Remove the verification section from the profile screen as there's no reliable way to keep it up to date
- the underlying Rust SDK Olm Machine can be rebuilt without notice which would break any existing user identity change streams.

* Update preview test snapshots
2025-02-18 08:37:34 +02:00
manuroe
c29f4cc9b4 Dual licensing: AGPL + Element Commercial (#3657)
* New LICENSE-COMMERCIAL file

* Apply dual licenses: AGPL + Element Commercial to file headers

* Update README with dual licensing
2025-01-06 11:27:37 +01:00
Stefan Ceriu
87169d9db5 Retrofit deferFulfillment onto snapshot tests. (#3641)
* Retrofit `deferFulfillment` onto snapshot tests.

* Convert a bunch of preview tests to the new fulfillment publisher

* Convert more tests

* Remove unneeded delays from the remaining tests

* Remove snapshotting delay option.
2024-12-20 15:30:59 +02:00
Doug
054da5b914 Add new development assets and use in mocks/previews. (#3581) 2024-12-03 17:14:05 +00:00
Doug
7980b4f464 Update the SDK. (#3565)
* Update the SDK.

* Add mockMXC URLs to fix all the crashes during tests.

* Refactor Voice Messages to not use a MediaSource for local files.
2024-11-28 08:34:38 +00:00
Doug
94daf13135 Replace individual RoomProxy properties with a stored RoomInfo. (#3445)
* Store RoomInfo updates in JoinedRoomProxy and read from them directly.

* Remove all RoomProxy properties that were reading from the RoomInfo.
2024-10-28 12:29:31 +00:00
Doug
33c172b0f2 MockMediaProvider → MediaProviderMock. 2024-10-03 10:58:59 +01:00
Stefan Ceriu
eff3dd7cc3 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
Stefan Ceriu
89eae00479 Switch license to AGPL (#3237)
* Switch license file to AGPL

* Update file copyright headers

* Update the default project file header
2024-09-06 16:34:30 +03:00
Stefan Ceriu
34eb596c1a Introduce a new RoomProxyType and treat rooms differently based on their membership state 2024-08-21 12:24:20 +03:00
Stefan Ceriu
40bf8a460d 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
Stefan Ceriu
d922d5ef09 Replace the old MockUserSession with the generated UserSessionMock 2024-05-27 17:05:01 +03:00
Doug
32ab65a10f Final design for pending members when changing roles. (#2668)
* Final design for pending users when changing role.

* Remove room moderation feature flag.

* Fix tests.

* Run periphery.

* Update snapshots.
2024-04-09 12:00:11 +01:00
Stefan Ceriu
77e28df1a8 Cleanup proxy errors
- proxy errors have been getting repetitive and not particularly useful
- differentiate between sdk and client errors and keep what provides value
- add error logs everywhere a failure occurs
2024-04-04 14:22:56 +03:00
Stefan Ceriu
85fd8f7710 Bump the RustSDK to v 1.1.54 2024-03-28 15:15:48 +02:00
Doug
9e523d2587 Fix various bugs in the moderation feature. (#2608)
* Fix search field string.

* Show your own user as an Admin when changing roles.

* Also show invited users when changing roles.

* Don't allow admin's to kick/ban other admins or themselves.

* Fix a bug when left members were counted as admins/moderators.

* Show when a member is pending.

* Add sections to the change role screen.
2024-03-27 10:33:40 +00:00
Doug
e9fa51b665 Add analytics for Room Moderation. (#2571)
* Add an option to use analytics locally.

* Add analytics for Room Moderation.

* Update tests.

* Include the role in the event where appropriate.

* Update the AnalyticsEvents package.
2024-03-14 15:55:37 +00:00
Doug
25c74a6bd6 Moderation tweaks (#2548)
* Only allow admins to see the roles and permissions screen.

* Hide the selection checkbox on Admins when changing roles.

* Show an empty state for banned users.

* Add separate actions for ban and remove.

* Implement reset permissions and demote self alerts.

* Add tests for resetting permissions and demoting self.

* Add a warning when promoting someone to administrator.
2024-03-11 14:19:53 +00:00
Doug
ec1e72c5ea Update the SDK and handle breaking changes. (#2527) 2024-03-05 15:08:34 +01:00
Stefan Ceriu
c55dddc081 Fixes #2486 - Implement blocked users management in the app settings 2024-02-28 13:21:54 +02:00
Doug
5ec121cff3 Kick/ban room members (#2501)
* Add a temporary membershipChangePublisher on the timeline.

* Kick/Ban users from a room.

* Unit tests.

* Disable autocorrection on the members list search field.
2024-02-27 13:02:35 +00:00
Doug
0399af52d9 Add RoomDetails for use (with RoomMemberDetails) in AvatarHeaderView. (#2490)
* Add RoomDetails and refactor AvatarHeaderView to use it.
* Remove old displayName property and use RoomDetails in the RoomDetailsScreenViewState
2024-02-21 14:19:05 +00:00
Doug
50e98aa174 Show banned members in the members list. (#2460)
Only shown to users with enough power to ban.
2024-02-16 12:49:35 +00:00
Doug
6e7fb7c677 Sort members in the member list by power level and show mods and admins. (#2448) 2024-02-12 10:39:06 +00:00
Stefan Ceriu
871471bbb0 Fixes #2414 - Move member loading to the room member detail screen, avoid blocking the whole application 2024-02-07 07:31:25 +00:00
Stefan Ceriu
61d0b8fdbb Fixes #2360 - Add support for manually marking rooms as unread (#2408)
* Fixes #2360 - Add support for manually marking rooms as unread

* Add analytics for marking rooms as (un)read

* Remove unnecessary analytics abstraction levels

* Fix breaking API changes following SDK bump

* Add changelog

* Handle PR comments

* Fix unit tests
2024-02-05 18:06:50 +02:00
Mauro
e44543fd84 User ID is shown also in the room members list (#2332) 2024-01-12 17:13:00 +00:00
Mauro
a705d18ba6 Removing dead code part 2 (#2235)
Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
2023-12-15 20:16:16 +01:00
Stefan Ceriu
67d30f490c Move presentation and coordination logic from the RoomDetailsScreenCoordinator and into the RoomFlowCoordinator 2023-11-29 18:31:29 +02:00
Doug
052db0d1f0 Add SwiftLint rule to enforce stack spacing. (#2080)
Xcode 15 changes the default behaviour and given we're always working from designs, we shouldn't rely on it for our layout.
2023-11-14 12:38:38 +00:00
Alfonso Grillo
2c33f9c5d5 Add scaledFrame/scaledPadding APIs (#2079)
* Add scaled frame and padding modifiers

* Refactor AppLockScreen

* Refactor FormattingToolbar

* Refactor RoomAttachmentPicker

* Refactor ComposerToolbar

* Refactor VoiceMessageRecordingButton

* More refactors

* Refine ScaledPaddingModifier

* Cleanup

* Fix preview tests

* Fix preview test

* Use CompoundIcon for custom image

* Add .scaledFrame(size:) overload

* Set fallback style to .body
2023-11-14 12:20:34 +01:00
Stefan Ceriu
7eda122d20 Fix various flakey unit tests (#1783)
* Fix flakey emoji provider tests

* Fix flakey RoomScreenViewModel tests

* Fix flakey HomeScreenViewModel tests

* Fix flakey RoomMemberListScreen tests, problem with bindings getting overriden and deferFulfillment cancellable not getting stored

* Fix flakey RoomNotificationSettingsScreen tests and crashes

* Fix flakey RoomMemberDetailsScreen tests

* Deprecate old `deferFulfillment` and `nextViewState` methods

* Convert more files to the new `deferFulfillment`

* Converted the rest of the tests to the new deferFulfillment

* Removed now unused `nextViewState` and `deferFulfillment`

* Remove automatic retries from unit tests

* Reset analytics flag after running unit tests

* Address PR comments

* Introduce a new `deferFulfillment(publisher, keyPath, transitionValues)` method and use it where appropiate
2023-09-26 13:28:29 +03:00
Mauro
3ccadba584 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
8ef51d4f10 Prevent mapping members on the main queue inside the room screen view model 2023-09-20 15:09:29 +03:00
Stefan Ceriu
ce1f213f42 Switch callbacks to combine (#1710)
* #750 - Convert the SoftLogoutScreen to combine

* #750 - Convert the UserSessionFlowCoordinator to Combine

* #750 - Convert the AnalyticsPromptScreen to Combine

* #750 - Convert the LoginScreen to Combine

* #750 - Convert the ServerSelectionScreen to Combine

* #750 - Convert the EmojiPickerScreen to Combine

* #750 - Convert the HomeScreen to Combine

* #750 - Convert the MediaUploadPreviewScreen to Combine

* #750 - Convert the OnboardingScreen to Combine

* Rename `Onboarding` to `OnboardingScreen`

* #750 - Convert the ReportContentScreen to Combine

* #750 - Convert the RoomDetailsSscreen to Combine

* #750 - Convert the RoomMemberDetailsScreen to Combine

* #750 - Convert the RoomMembersListScreen to Combine

* #750 - Convert the SessionVerificationScreen to Combine

* #750 - Convert the SettingsScreen to Combine

* #750 - Convert the AdvancedSettingsScreen to Combine

* #750 - Convert the DeveloperOptionsScreen to Combine

* Fix the unit tests

* Use .sink action and the same cancellables constructor everywhere

* Cleanup cancellables when setting up tests
2023-09-14 12:53:33 +03:00
Stefan Ceriu
e8116ae776 Display avatars full screen when tapping on them from the room or member detail screens 2023-08-04 17:45:24 +03:00
Mauro
87b38c9380 Updating members after an ignore/unignore action has been performed. (#1327)
* fix

* format

* update members
2023-07-17 10:57:47 +00:00
Stefan Ceriu
abe1df2524 Removed unused swipe gesture (+3 squashed commits)
Squashed commits:
[d64bb3bb] Stop using the ServiceLocator directly in the ScreenTrackerViewModifier
[37c46ab9] Rename Analytics to AnalyticsService
[8852a371] #920 - Cleanup ServiceLocator usages
2023-06-28 11:33:41 +03:00