File tree Expand file tree Collapse file tree 2 files changed +0
-327
lines changed Expand file tree Collapse file tree 2 files changed +0
-327
lines changed Original file line number Diff line number Diff line change 11// ignore_for_file: public_member_api_docs, sort_constructors_first
22import 'package:whitenoise/src/rust/api/metadata.dart' show FlutterMetadata;
3- import 'package:whitenoise/src/rust/api/users.dart' show User;
43import 'package:whitenoise/utils/public_key_validation_extension.dart' ;
54
65class ContactModel {
@@ -47,28 +46,6 @@ class ContactModel {
4746 );
4847 }
4948
50- factory ContactModel .fromUser ({
51- required User user,
52- }) {
53- final metadata = user.metadata;
54- final displayName = _sanitizeString (metadata.displayName);
55- final about = _sanitizeString (metadata.about);
56- final website = _sanitizeUrl (metadata.website);
57- final nip05 = _sanitizeString (metadata.nip05);
58- final lud16 = _sanitizeString (metadata.lud16);
59- final picture = _sanitizeUrl (metadata.picture);
60-
61- return ContactModel (
62- displayName: displayName.isNotEmpty ? displayName : 'Unknown User' ,
63- publicKey: user.pubkey,
64- imagePath: picture,
65- about: about,
66- website: website,
67- nip05: nip05,
68- lud16: lud16,
69- );
70- }
71-
7249 // Helper method to sanitize strings
7350 static String _sanitizeString (String ? input) {
7451 if (input == null ) return '' ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments