removeAllEventsByPubKey method

  1. @override
Future<void> removeAllEventsByPubKey(
  1. String pubKey
)
override

Implementation

@override
Future<void> removeAllEventsByPubKey(String pubKey) async {
  await dbRdy;
  final eventBox = _objectBox.store.box<DbNip01Event>();
  final events =
      eventBox.query(DbNip01Event_.pubKey.equals(pubKey)).build().find();
  final eventIds = events.map((e) => e.nostrId).toList();
  eventBox.removeMany(events.map((e) => e.dbId).toList());
  _removeEventSidecarsByIds(eventIds);
  await _syncUserRelayListProjection(pubKey);
}