diff options
Diffstat (limited to 'src/sub_commands/send.rs')
| -rw-r--r-- | src/sub_commands/send.rs | 18 |
1 files changed, 13 insertions, 5 deletions
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 | ||