feat(social): local blocklist — hide blocked authors' offers, chats and incoming messages, with unblock management

This commit is contained in:
vjrj 2026-07-13 01:03:10 +02:00
parent 5d25f65f76
commit 11b242edbf
13 changed files with 399 additions and 4 deletions

View file

@ -61,6 +61,23 @@ void main() {
text: text,
at: DateTime.fromMillisecondsSinceEpoch(atMs));
test('messages from a blocked peer are dropped before storage', () async {
final settings = SocialSettings(InMemorySecretStore());
await settings.block('mallory');
inbox = InboxService(
connection: await offlineConnection(),
selfPubkey: 'me',
store: store,
settings: settings,
);
await inbox.ingest(msg('mallory', 'spam', 1000));
await inbox.ingest(msg('alice', 'hola', 2000));
final convos = await store.conversations();
expect(convos.single.peerPubkey, 'alice'); // mallory never landed
});
test('an incoming message is persisted into its conversation', () async {
await inbox.ingest(msg('alice', 'got seeds?', 1000));
final convos = await store.conversations();