File tree Expand file tree Collapse file tree 4 files changed +1
-67
lines changed
crates/nostr-sdk/src/client Expand file tree Collapse file tree 4 files changed +1
-67
lines changed Original file line number Diff line number Diff line change 70
70
* nostr: remove support for ` nrelay ` NIP-19 entity ([ Yuki Kishimoto] )
71
71
* nostr: remove support for NIP-44 v1 ([ Yuki Kishimoto] )
72
72
* nostr: remove ` EventBuilder::encrypted_direct_msg ` ([ Yuki Kishimoto] )
73
+ * sdk: remove ` Client::send_direct_msg ` ([ Yuki Kishimoto] )
73
74
* cli: remove ` tracing-subscriber ` dep
74
75
75
76
## [ v0.33.0]
Original file line number Diff line number Diff line change @@ -474,25 +474,6 @@ impl Client {
474
474
. into ( ) )
475
475
}
476
476
477
- /// Encrypted direct msg
478
- ///
479
- /// <div class="warning"><strong>Unsecure!</strong> Use `send_private_msg` instead!</div>
480
- ///
481
- /// <https://github.com/nostr-protocol/nips/blob/master/04.md>
482
- pub async fn send_direct_msg (
483
- & self ,
484
- receiver : & PublicKey ,
485
- msg : String ,
486
- reply : Option < Arc < EventId > > ,
487
- ) -> Result < SendEventOutput > {
488
- #[ allow( deprecated) ]
489
- Ok ( self
490
- . inner
491
- . send_direct_msg ( * * receiver, msg, reply. map ( |r| * * r) )
492
- . await ?
493
- . into ( ) )
494
- }
495
-
496
477
/// Send private direct message to all relays
497
478
///
498
479
/// <https://github.com/nostr-protocol/nips/blob/master/17.md>
Original file line number Diff line number Diff line change @@ -517,26 +517,6 @@ impl JsClient {
517
517
. map ( |id| id. into ( ) )
518
518
}
519
519
520
- /// Send encrypted direct message
521
- ///
522
- /// <div class="warning"><strong>Unsecure!</strong> Use `sendPrivateMsg` instead!</div>
523
- ///
524
- /// <https://github.com/nostr-protocol/nips/blob/master/04.md>
525
- #[ wasm_bindgen( js_name = sendDirectMsg) ]
526
- pub async fn send_direct_msg (
527
- & self ,
528
- receiver : & JsPublicKey ,
529
- msg : & str ,
530
- reply : Option < JsEventId > ,
531
- ) -> Result < JsSendEventOutput > {
532
- #[ allow( deprecated) ]
533
- self . inner
534
- . send_direct_msg ( * * receiver, msg, reply. map ( |id| id. into ( ) ) )
535
- . await
536
- . map_err ( into_err)
537
- . map ( |id| id. into ( ) )
538
- }
539
-
540
520
/// Send private direct message to all relays
541
521
///
542
522
/// <https://github.com/nostr-protocol/nips/blob/master/17.md>
Original file line number Diff line number Diff line change @@ -1215,34 +1215,6 @@ impl Client {
1215
1215
Ok ( contacts)
1216
1216
}
1217
1217
1218
- /// Send encrypted direct message
1219
- ///
1220
- /// <https://github.com/nostr-protocol/nips/blob/master/04.md>
1221
- #[ deprecated( note = "Unsecure! Use `send_private_msg` instead." ) ]
1222
- #[ cfg( feature = "nip04" ) ]
1223
- pub async fn send_direct_msg < S > (
1224
- & self ,
1225
- receiver : PublicKey ,
1226
- msg : S ,
1227
- reply_to : Option < EventId > ,
1228
- ) -> Result < Output < EventId > , Error >
1229
- where
1230
- S : Into < String > ,
1231
- {
1232
- let signer = self . signer ( ) . await ?;
1233
- let content: String = signer. nip04_encrypt ( receiver, msg. into ( ) ) . await ?;
1234
-
1235
- let mut tags: Vec < Tag > = Vec :: with_capacity ( 1 + usize:: from ( reply_to. is_some ( ) ) ) ;
1236
- tags. push ( Tag :: public_key ( receiver) ) ;
1237
- if let Some ( id) = reply_to {
1238
- tags. push ( Tag :: event ( id) ) ;
1239
- }
1240
-
1241
- let builder: EventBuilder = EventBuilder :: new ( Kind :: EncryptedDirectMessage , content, tags) ;
1242
-
1243
- self . send_event_builder ( builder) . await
1244
- }
1245
-
1246
1218
/// Send private direct message to all relays
1247
1219
///
1248
1220
/// <https://github.com/nostr-protocol/nips/blob/master/17.md>
You can’t perform that action at this time.
0 commit comments