Add block button to profiles

Fixes #152
This commit is contained in:
Henry Hiles 2026-11-02 12:44:41 -05:00
commit 979068fc3a
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -50,6 +50,22 @@ class AccountDataController extends Notifier<AccountData> {
);
}
Future<void> setIgnored(String userId, {required bool ignored}) =>
_sendAndWait(
() => ref
.read(ClientController.provider.notifier)
.setAccountData(
.new(
type: AccountData.ignoredUserListKey,
content: state.ignoredUserList.withUser(
userId,
ignored: ignored,
),
),
),
(data) => data.ignoredUserList.contains(userId) == ignored,
);
/// Saves [rule] of [kind], creating it if it's new, or otherwise changing only
/// its actions and whether it's enabled.
Future<void> savePushRule(PushRuleKind kind, PushRule rule) {