Merge pull request 'feat: add k tag to gift wraps and process only chat message rumors' (#30) from only-nip17 into master
Reviewed-on: #30
This commit was merged in pull request #30.
This commit is contained in:
@@ -253,6 +253,13 @@ impl ChatRegistry {
|
|||||||
event_map.insert(rumor.id.unwrap(), (event.id, dekey));
|
event_map.insert(rumor.id.unwrap(), (event.id, dekey));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if rumor.kind != Kind::PrivateDirectMessage
|
||||||
|
|| rumor.kind != Kind::Custom(15)
|
||||||
|
{
|
||||||
|
log::info!("Rumor is not releated to NIP17");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if the rumor has a recipient
|
// Check if the rumor has a recipient
|
||||||
if rumor.tags.is_empty() {
|
if rumor.tags.is_empty() {
|
||||||
let signal =
|
let signal =
|
||||||
|
|||||||
@@ -400,6 +400,10 @@ impl Room {
|
|||||||
.await?
|
.await?
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(|event| UnsignedEvent::from_json(&event.content).ok())
|
.filter_map(|event| UnsignedEvent::from_json(&event.content).ok())
|
||||||
|
.filter(|event| {
|
||||||
|
// Only process private direct messages and file messages
|
||||||
|
event.kind == Kind::PrivateDirectMessage || event.kind == Kind::Custom(15)
|
||||||
|
})
|
||||||
.sorted_by_key(|message| message.created_at)
|
.sorted_by_key(|message| message.created_at)
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
@@ -598,7 +602,8 @@ async fn send_gift_wrap<T>(
|
|||||||
where
|
where
|
||||||
T: NostrSigner + 'static,
|
T: NostrSigner + 'static,
|
||||||
{
|
{
|
||||||
let mut extra_tags = vec![];
|
let k_tag = Tag::custom(TagKind::k(), vec!["14"]);
|
||||||
|
let mut extra_tags = vec![k_tag];
|
||||||
|
|
||||||
// Determine the receiver public key based on the config
|
// Determine the receiver public key based on the config
|
||||||
let receiver = match config {
|
let receiver = match config {
|
||||||
|
|||||||
Reference in New Issue
Block a user