diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-26 08:45:16 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-26 09:56:44 +0000 |
| commit | a6edb42dfc653b6826b59b7f296e0d0c4ee74557 (patch) | |
| tree | 4355445d8d51672cbf1dd86af0a4bd2ffcde1a7a /src/git/authorization.rs | |
| parent | 30411a938d072a59d68815c975735d40366ad874 (diff) | |
fix: parsing maintainers from announcement event
Diffstat (limited to 'src/git/authorization.rs')
| -rw-r--r-- | src/git/authorization.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/git/authorization.rs b/src/git/authorization.rs index 06672c8..2fe81b0 100644 --- a/src/git/authorization.rs +++ b/src/git/authorization.rs | |||
| @@ -444,11 +444,16 @@ mod tests { | |||
| 444 | ) -> Event { | 444 | ) -> Event { |
| 445 | let mut tags = vec![Tag::custom(TagKind::d(), vec![identifier.to_string()])]; | 445 | let mut tags = vec![Tag::custom(TagKind::d(), vec![identifier.to_string()])]; |
| 446 | 446 | ||
| 447 | // Add maintainers as p tags | 447 | // Add maintainers as a single "maintainers" tag per NIP-34 |
| 448 | for maintainer_keys in maintainers { | 448 | // Format: ["maintainers", "<pubkey1-hex>", "<pubkey2-hex>", ...] |
| 449 | if !maintainers.is_empty() { | ||
| 450 | let maintainer_pubkeys: Vec<String> = maintainers | ||
| 451 | .iter() | ||
| 452 | .map(|k| k.public_key().to_hex()) | ||
| 453 | .collect(); | ||
| 449 | tags.push(Tag::custom( | 454 | tags.push(Tag::custom( |
| 450 | TagKind::p(), | 455 | TagKind::Custom("maintainers".into()), |
| 451 | vec![maintainer_keys.public_key().to_hex()], | 456 | maintainer_pubkeys, |
| 452 | )); | 457 | )); |
| 453 | } | 458 | } |
| 454 | 459 | ||