@@ -6,7 +6,6 @@ use std::collections::HashMap;
6
6
use std:: ops:: Deref ;
7
7
use std:: sync:: Arc ;
8
8
9
- use nostr:: util:: EventIdOrCoordinate ;
10
9
use nostr:: { RelayUrl , Url } ;
11
10
use uniffi:: Object ;
12
11
@@ -15,6 +14,7 @@ use crate::error::Result;
15
14
use crate :: protocol:: event:: { PublicKey , Tag , Timestamp , UnsignedEvent } ;
16
15
use crate :: protocol:: key:: Keys ;
17
16
use crate :: protocol:: nips:: nip01:: { Coordinate , Metadata } ;
17
+ use crate :: protocol:: nips:: nip09:: EventDeletionRequest ;
18
18
use crate :: protocol:: nips:: nip15:: { ProductData , StallData } ;
19
19
use crate :: protocol:: nips:: nip34:: { GitIssue , GitPatch , GitRepositoryAnnouncement } ;
20
20
use crate :: protocol:: nips:: nip46:: NostrConnectMessage ;
@@ -253,29 +253,13 @@ impl EventBuilder {
253
253
} )
254
254
}
255
255
256
- /// Event deletion
256
+ /// Event deletion request
257
257
///
258
258
/// <https://github.com/nostr-protocol/nips/blob/master/09.md>
259
- #[ uniffi:: constructor( default ( ids = [ ] , coordinates = [ ] , reason = None ) ) ]
260
- pub fn delete (
261
- ids : & [ Arc < EventId > ] ,
262
- coordinates : & [ Arc < Coordinate > ] ,
263
- reason : Option < String > ,
264
- ) -> Self {
265
- let coordinates = coordinates
266
- . iter ( )
267
- . map ( |c| c. as_ref ( ) . deref ( ) . clone ( ) )
268
- . map ( EventIdOrCoordinate :: from) ;
269
- let ids = ids
270
- . iter ( )
271
- . map ( |e| * * * e)
272
- . map ( EventIdOrCoordinate :: from)
273
- . chain ( coordinates) ;
274
- Self {
275
- inner : match reason {
276
- Some ( reason) => nostr:: EventBuilder :: delete_with_reason ( ids, reason) ,
277
- None => nostr:: EventBuilder :: delete ( ids) ,
278
- } ,
259
+ #[ uniffi:: constructor]
260
+ pub fn delete ( request : EventDeletionRequest ) -> Self {
261
+ Self {
262
+ inner : nostr:: EventBuilder :: delete ( request. into ( ) ) ,
279
263
}
280
264
}
281
265
0 commit comments