Skip to content

Commit

Permalink
ffi: add missing RelayMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
yukibtc committed Sep 28, 2023
1 parent e99733f commit 4c5a376
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
22 changes: 22 additions & 0 deletions bindings/nostr-ffi/src/message/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ pub enum RelayMessage {
subscription_id: String,
count: u64,
},
NegMsg {
subscription_id: String,
message: String,
},
NegErr {
subscription_id: String,
code: String,
},
}

impl From<NRelayMessage> for RelayMessage {
Expand Down Expand Up @@ -59,6 +67,20 @@ impl From<NRelayMessage> for RelayMessage {
subscription_id: subscription_id.to_string(),
count: count as u64,
},
NRelayMessage::NegMsg {
subscription_id,
message,
} => Self::NegMsg {
subscription_id: subscription_id.to_string(),
message,
},
NRelayMessage::NegErr {
subscription_id,
code,
} => Self::NegErr {
subscription_id: subscription_id.to_string(),
code: code.to_string(),
},
}
}
}
2 changes: 2 additions & 0 deletions bindings/nostr-ffi/src/nostr.udl
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ interface RelayMessage {
Ok(string event_id, boolean status, string message);
Auth(string challenge);
Count(string subscription_id, u64 count);
NegMsg(string subscription_id, string message);
NegErr(string subscription_id, string code);
};

interface ZapRequestData {
Expand Down
2 changes: 2 additions & 0 deletions bindings/nostr-sdk-ffi/src/nostr_sdk.udl
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ interface RelayMessage {
Ok(string event_id, boolean status, string message);
Auth(string challenge);
Count(string subscription_id, u64 count);
NegMsg(string subscription_id, string message);
NegErr(string subscription_id, string code);
};

interface ZapRequestData {
Expand Down

0 comments on commit 4c5a376

Please sign in to comment.