element-hq / element-meta

Shared/meta documentation and project artefacts for Element clients
68 stars 11 forks source link

[Story] Show blocked users #2198

Closed VolkerJunginger closed 5 months ago

VolkerJunginger commented 9 months ago

Description

As a user that has blocked other users I want to have a place where I can access these user so that I can unblock them.

Acceptance criteria

Leads

Designs

Designs for iOS

Designs for Android

Size estimate

S

Dependencies

Out of scope

Open questions

### Questions

Subtasks

### Android
- [ ] https://github.com/element-hq/element-x-android/issues/2418
- [ ] https://github.com/element-hq/element-x-android/issues/2469
- [ ] https://github.com/element-hq/element-x-android-rageshakes/issues/1656
### iOS
- [ ] https://github.com/element-hq/element-x-ios/issues/2486
- [ ] https://github.com/element-hq/element-x-ios/issues/2516
### Rust
- [ ] https://github.com/matrix-org/matrix-rust-sdk/issues/3141
### Other

Sign-off

Android

iOS

jmartinesp commented 6 months ago

Ruma has an API for ignored (blocked) user list: https://docs.rs/ruma-events/latest/ruma_events/ignored_user_list/index.html

AccountData.global contains a list of global account data events that should contain this info, although the only info available at the moment would be a list of ignored user ids, with no actual user info, so we'd have to find a way to fetch that user data.

daniellekirkwood commented 6 months ago

Just a note... On Web you see this by: Settings > Security & Privacy > Advanced > Ignored Users

Screenshot 2024-01-31 at 13 02 18
jmartinesp commented 6 months ago

After taking another look, it seems like most of the data we need is already there: we have the blocked user ids and we can call /_matrix/client/v3/profile/{userId} to get the name and avatar of each ignored user. Since this should be done every time we want to retrieve the list of ignored users, we should probably create a cache, but doing so seems quite trivial as long as we don't expect it to survive app restarts.

With a very naive implementation I got:

// The names and ids here are fine, they were users who were spamming some public rooms:
Ignored users: [
    IgnoredUser(
        id=@eogziyjjfwvqogtunxwqttypsixqowtpkjxafcrundbqvdmsggobqoafzkgqqsejqipmmftibnafourxmkzodhbiihbronbiruxfnxqucbfmczduipnkmwczepvzhikw:matrix.org, 
        avatarUrl=mxc://matrix.org/uXpgyUWGlOofhoXiOfKOgrGA, 
        displayname=eogziyjjfwvqogtunxwqttypsixqowtpkjxafcrundbqvdmsggobqoafzkgqqsejqipmmftibnafourxmkzodhbiihbronbiruxfnxqucbfmczduipnkmwczepvzhikw, 
        blurhash=null
    ), 
    IgnoredUser(
        id=@qdpkfmxruncufovojpuectwshoxcuoomjinoscnhqfywxdyauodwqfosjvazrxqanftwvrjupxfhyifrxphksgeogevijqvbgxrraoiuimfbibvhodmekgjtpxnctmvd:matrix.org, 
        avatarUrl=mxc://matrix.org/nJwXVCUphecoPpGHLEfPhyAb, 
        displayname=qdpkfmxruncufovojpuectwshoxcuoomjinoscnhqfywxdyauodwqfosjvazrxqanftwvrjupxfhyifrxphksgeogevijqvbgxrraoiuimfbibvhodmekgjtpxnctmvd,
        blurhash=null
    )
]
amshakal commented 6 months ago

Designs for iOS

Designs for Android

VolkerJunginger commented 5 months ago

@bmarty Is the Android Design for the prompt when unblocking right? The buttons are right-aligned?

jmartinesp commented 5 months ago

@bmarty Is the Android Design for the prompt when unblocking right? The buttons are right-aligned?

Do you mean in the actual implementation? Android dialog buttons are always right-aligned.

VolkerJunginger commented 5 months ago

Ah - ok. Looks weird but ok.

VolkerJunginger commented 5 months ago

On Android unblocking is stuck in a Spinner. The person is already unblocked. Rageshake send

jmartinesp commented 5 months ago

On Android unblocking is stuck in a Spinner. The person is already unblocked. Rageshake send

It should be fixed by https://github.com/element-hq/element-x-android/pull/2554

VolkerJunginger commented 5 months ago

Feature has been handed over to the customer.

VolkerJunginger commented 5 months ago

Customer gives a go for the feature.