Skip to content

Commit

Permalink
feat(proxy): use entry guid instead of feed id
Browse files Browse the repository at this point in the history
  • Loading branch information
Asone committed Sep 16, 2023
1 parent 86940c8 commit 661ead6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions nostrss-core/src/scheduler/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ impl RssNostrJob {
let mut tags = Self::get_tags(&feed.tags);

// Declare NIP-48.
tags.push(Self::get_nip48(&tags, feed.id.clone()));
tags.push(Self::get_nip48(&tags, entry.id.clone()));

let message = match TemplateProcessor::parse(feed.clone(), entry.clone()) {
Ok(message) => message,
Expand Down Expand Up @@ -230,11 +230,11 @@ impl RssNostrJob {
tags
}

fn get_nip48(mut tags: &Vec<Tag>, feed_id: String) -> Tag {
fn get_nip48(mut tags: &Vec<Tag>, guid: String) -> Tag {
// Declare NIP-48.
// NIP-48 : declares to be a proxy from an external signal (rss,activityPub)
Tag::Proxy {
id: feed_id,
id: guid,
protocol: nostr_sdk::prelude::Protocol::Rss,
}
}
Expand Down Expand Up @@ -295,9 +295,9 @@ mod tests {

#[test]
fn test_nip_48() {
let feed_id = "https://www.test.com";
let guid = "https://www.test.com";
let mut tags: Vec<Tag> = [].to_vec();
let nip_48 = RssNostrJob::get_nip48(&tags, feed_id.clone().to_string());
let nip_48 = RssNostrJob::get_nip48(&tags, guid.clone().to_string());

assert_eq!(nip_48.kind(), TagKind::Proxy);
}
Expand Down

0 comments on commit 661ead6

Please sign in to comment.