feat(social): local blocklist — hide blocked authors' offers, chats and incoming messages, with unblock management
This commit is contained in:
parent
cd9f09048d
commit
b41dfd4248
13 changed files with 399 additions and 4 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue