chore: Add the repository to authorized issue status users
Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
@@ -54,6 +54,7 @@ pub async fn issue_status_command(
|
|||||||
.add_relays(&[naddrs.extract_relays(), issue_id.relays].concat())
|
.add_relays(&[naddrs.extract_relays(), issue_id.relays].concat())
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
|
let owners = naddrs.extract_owners();
|
||||||
let coordinates = naddrs.clone().into_coordinates();
|
let coordinates = naddrs.clone().into_coordinates();
|
||||||
let repos = client.fetch_repos(&coordinates).await?;
|
let repos = client.fetch_repos(&coordinates).await?;
|
||||||
let maintainers = repos.extract_maintainers();
|
let maintainers = repos.extract_maintainers();
|
||||||
@@ -68,7 +69,7 @@ pub async fn issue_status_command(
|
|||||||
let issue_status = client
|
let issue_status = client
|
||||||
.fetch_issue_status(
|
.fetch_issue_status(
|
||||||
issue_id.event_id,
|
issue_id.event_id,
|
||||||
[maintainers.as_slice(), &[issue_event.pubkey]].concat(),
|
[maintainers.as_slice(), &[issue_event.pubkey], &owners].concat(),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
@@ -83,6 +84,7 @@ pub async fn issue_status_command(
|
|||||||
))
|
))
|
||||||
.tag(Tag::public_key(issue_event.pubkey))
|
.tag(Tag::public_key(issue_event.pubkey))
|
||||||
.tags(maintainers.iter().map(|p| Tag::public_key(*p)))
|
.tags(maintainers.iter().map(|p| Tag::public_key(*p)))
|
||||||
|
.tags(owners.iter().map(|p| Tag::public_key(*p)))
|
||||||
.tags(
|
.tags(
|
||||||
coordinates
|
coordinates
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
|||||||
@@ -192,6 +192,11 @@ impl Vec<Nip19Coordinate> {
|
|||||||
self.into_iter().map(|n| n.coordinate).collect()
|
self.into_iter().map(|n| n.coordinate).collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns all repository owners' public keys from these coordinates.
|
||||||
|
pub fn extract_owners(&self) -> Vec<PublicKey> {
|
||||||
|
self.iter().map(|n| n.public_key).collect()
|
||||||
|
}
|
||||||
|
|
||||||
/// Extracts all relay URLs from these coordinates
|
/// Extracts all relay URLs from these coordinates
|
||||||
pub fn extract_relays(&self) -> Vec<RelayUrl> {
|
pub fn extract_relays(&self) -> Vec<RelayUrl> {
|
||||||
self.iter().flat_map(|n| n.relays.clone()).collect()
|
self.iter().flat_map(|n| n.relays.clone()).collect()
|
||||||
|
|||||||
Reference in New Issue
Block a user