Skip to content

Commit

Permalink
better naming
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-lox committed Nov 22, 2024
1 parent 87b95ae commit db6da75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
29 changes: 6 additions & 23 deletions lib/data_layer/repositories/nostr_list_repository_impl.dart
Original file line number Diff line number Diff line change
@@ -1,40 +1,23 @@
import 'dart:developer';

import 'package:camelus/domain_layer/entities/nostr_list.dart';
import 'package:ndk/entities.dart' as ndk_entities;
import 'package:ndk/ndk.dart' as ndk;
import 'package:rxdart/rxdart.dart';

import '../../domain_layer/entities/nostr_note.dart';
import '../../domain_layer/entities/nostr_list.dart';
import '../../domain_layer/repositories/nostr_list_repository.dart';
import '../data_sources/dart_ndk_source.dart';
import '../models/nostr_lists_model.dart';
import '../models/nostr_note_model.dart';

class NostrListRepositoryImpl implements NostrListRepository {
final DartNdkSource dartNdkSource;
final ndk.EventVerifier eventVerifier;

NostrListRepositoryImpl(
{required this.dartNdkSource, required this.eventVerifier, r});
NostrListRepositoryImpl({
required this.dartNdkSource,
required this.eventVerifier,
});

@override
Stream<NostrNote> getAllNotes() {
ndk.Filter filter = ndk.Filter(
authors: [],
kinds: [ndk_entities.Nip01Event.TEXT_NODE_KIND],
);

final response = dartNdkSource.dartNdk.requests
.query(filters: [filter], name: 'getAllNotes-');

return response.stream.map(
(event) => NostrNoteModel.fromNDKEvent(event),
);
}

@override
Future<NostrSet?> getNostrFollowSet({
Future<NostrSet?> getPublicNostrFollowSet({
required String pubKey,
required String name,
}) async {
Expand Down
2 changes: 1 addition & 1 deletion lib/domain_layer/repositories/nostr_list_repository.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '../entities/nostr_list.dart';

abstract class NostrListRepository {
Future<NostrSet?> getNostrFollowSet({
Future<NostrSet?> getPublicNostrFollowSet({
required String pubKey,
required String name,
});
Expand Down

0 comments on commit db6da75

Please sign in to comment.