diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/client.rs | 4 | ||||
| -rw-r--r-- | src/git_remote_helper.rs | 3 | ||||
| -rw-r--r-- | src/sub_commands/list.rs | 7 | ||||
| -rw-r--r-- | src/sub_commands/send.rs | 18 |
4 files changed, 21 insertions, 11 deletions
diff --git a/src/client.rs b/src/client.rs index db41f99..abde217 100644 --- a/src/client.rs +++ b/src/client.rs | |||
| @@ -1182,12 +1182,12 @@ async fn process_fetched_events( | |||
| 1182 | } else if [Kind::RelayList, Kind::Metadata].contains(&event.kind()) { | 1182 | } else if [Kind::RelayList, Kind::Metadata].contains(&event.kind()) { |
| 1183 | if request | 1183 | if request |
| 1184 | .missing_contributor_profiles | 1184 | .missing_contributor_profiles |
| 1185 | .contains(event.author_ref()) | 1185 | .contains(&event.author()) |
| 1186 | { | 1186 | { |
| 1187 | report.contributor_profiles.insert(event.author()); | 1187 | report.contributor_profiles.insert(event.author()); |
| 1188 | } else if let Some((_, (metadata_timestamp, relay_list_timestamp))) = request | 1188 | } else if let Some((_, (metadata_timestamp, relay_list_timestamp))) = request |
| 1189 | .profiles_to_fetch_from_user_relays | 1189 | .profiles_to_fetch_from_user_relays |
| 1190 | .get_key_value(event.author_ref()) | 1190 | .get_key_value(&event.author()) |
| 1191 | { | 1191 | { |
| 1192 | if (Kind::Metadata.eq(&event.kind()) | 1192 | if (Kind::Metadata.eq(&event.kind()) |
| 1193 | && event.created_at().gt(metadata_timestamp)) | 1193 | && event.created_at().gt(metadata_timestamp)) |
diff --git a/src/git_remote_helper.rs b/src/git_remote_helper.rs index 2244383..4d34850 100644 --- a/src/git_remote_helper.rs +++ b/src/git_remote_helper.rs | |||
| @@ -366,7 +366,8 @@ async fn get_open_proposals( | |||
| 366 | .iter() | 366 | .iter() |
| 367 | .filter(|e| { | 367 | .filter(|e| { |
| 368 | status_kinds().contains(&e.kind()) | 368 | status_kinds().contains(&e.kind()) |
| 369 | && e.iter_tags() | 369 | && e.tags() |
| 370 | .iter() | ||
| 370 | .any(|t| t.as_vec()[1].eq(&proposal.id.to_string())) | 371 | .any(|t| t.as_vec()[1].eq(&proposal.id.to_string())) |
| 371 | }) | 372 | }) |
| 372 | .collect::<Vec<&nostr::Event>>() | 373 | .collect::<Vec<&nostr::Event>>() |
diff --git a/src/sub_commands/list.rs b/src/sub_commands/list.rs index 73ef107..ac1f4ab 100644 --- a/src/sub_commands/list.rs +++ b/src/sub_commands/list.rs | |||
| @@ -78,7 +78,8 @@ pub async fn launch() -> Result<()> { | |||
| 78 | .iter() | 78 | .iter() |
| 79 | .filter(|e| { | 79 | .filter(|e| { |
| 80 | status_kinds().contains(&e.kind()) | 80 | status_kinds().contains(&e.kind()) |
| 81 | && e.iter_tags() | 81 | && e.tags() |
| 82 | .iter() | ||
| 82 | .any(|t| t.as_vec()[1].eq(&proposal.id.to_string())) | 83 | .any(|t| t.as_vec()[1].eq(&proposal.id.to_string())) |
| 83 | }) | 84 | }) |
| 84 | .collect::<Vec<&nostr::Event>>() | 85 | .collect::<Vec<&nostr::Event>>() |
| @@ -873,7 +874,7 @@ pub async fn get_all_proposal_patch_events_from_cache( | |||
| 873 | .iter() | 874 | .iter() |
| 874 | .copied() | 875 | .copied() |
| 875 | .collect(); | 876 | .collect(); |
| 876 | commit_events.retain(|e| permissioned_users.contains(e.author_ref())); | 877 | commit_events.retain(|e| permissioned_users.contains(&e.author())); |
| 877 | 878 | ||
| 878 | let revision_roots: HashSet<nostr::EventId> = commit_events | 879 | let revision_roots: HashSet<nostr::EventId> = commit_events |
| 879 | .iter() | 880 | .iter() |
| @@ -899,7 +900,7 @@ pub async fn get_all_proposal_patch_events_from_cache( | |||
| 899 | 900 | ||
| 900 | Ok(commit_events | 901 | Ok(commit_events |
| 901 | .iter() | 902 | .iter() |
| 902 | .filter(|e| !event_is_cover_letter(e) && permissioned_users.contains(e.author_ref())) | 903 | .filter(|e| !event_is_cover_letter(e) && permissioned_users.contains(&e.author())) |
| 903 | .cloned() | 904 | .cloned() |
| 904 | .collect()) | 905 | .collect()) |
| 905 | } | 906 | } |
diff --git a/src/sub_commands/send.rs b/src/sub_commands/send.rs index 8369b10..3c4df9d 100644 --- a/src/sub_commands/send.rs +++ b/src/sub_commands/send.rs | |||
| @@ -806,8 +806,11 @@ pub fn event_is_cover_letter(event: &nostr::Event) -> bool { | |||
| 806 | // [PATCH v1 0/n ] or | 806 | // [PATCH v1 0/n ] or |
| 807 | // [PATCH subsystem v2 0/n ] | 807 | // [PATCH subsystem v2 0/n ] |
| 808 | event.kind.eq(&Kind::GitPatch) | 808 | event.kind.eq(&Kind::GitPatch) |
| 809 | && event.iter_tags().any(|t| t.as_vec()[1].eq("root")) | 809 | && event.tags().iter().any(|t| t.as_vec()[1].eq("root")) |
| 810 | && event.iter_tags().any(|t| t.as_vec()[1].eq("cover-letter")) | 810 | && event |
| 811 | .tags() | ||
| 812 | .iter() | ||
| 813 | .any(|t| t.as_vec()[1].eq("cover-letter")) | ||
| 811 | } | 814 | } |
| 812 | 815 | ||
| 813 | pub fn commit_msg_from_patch(patch: &nostr::Event) -> Result<String> { | 816 | pub fn commit_msg_from_patch(patch: &nostr::Event) -> Result<String> { |
| @@ -876,17 +879,22 @@ pub fn event_to_cover_letter(event: &nostr::Event) -> Result<CoverLetter> { | |||
| 876 | } | 879 | } |
| 877 | 880 | ||
| 878 | pub fn event_is_patch_set_root(event: &nostr::Event) -> bool { | 881 | pub fn event_is_patch_set_root(event: &nostr::Event) -> bool { |
| 879 | event.kind.eq(&Kind::GitPatch) && event.iter_tags().any(|t| t.as_vec()[1].eq("root")) | 882 | event.kind.eq(&Kind::GitPatch) && event.tags().iter().any(|t| t.as_vec()[1].eq("root")) |
| 880 | } | 883 | } |
| 881 | 884 | ||
| 882 | pub fn event_is_revision_root(event: &nostr::Event) -> bool { | 885 | pub fn event_is_revision_root(event: &nostr::Event) -> bool { |
| 883 | event.kind.eq(&Kind::GitPatch) && event.iter_tags().any(|t| t.as_vec()[1].eq("revision-root")) | 886 | event.kind.eq(&Kind::GitPatch) |
| 887 | && event | ||
| 888 | .tags() | ||
| 889 | .iter() | ||
| 890 | .any(|t| t.as_vec()[1].eq("revision-root")) | ||
| 884 | } | 891 | } |
| 885 | 892 | ||
| 886 | pub fn patch_supports_commit_ids(event: &nostr::Event) -> bool { | 893 | pub fn patch_supports_commit_ids(event: &nostr::Event) -> bool { |
| 887 | event.kind.eq(&Kind::GitPatch) | 894 | event.kind.eq(&Kind::GitPatch) |
| 888 | && event | 895 | && event |
| 889 | .iter_tags() | 896 | .tags() |
| 897 | .iter() | ||
| 890 | .any(|t| t.as_vec()[0].eq("commit-pgp-sig")) | 898 | .any(|t| t.as_vec()[0].eq("commit-pgp-sig")) |
| 891 | } | 899 | } |
| 892 | 900 | ||