diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-07-19 20:47:30 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-07-19 20:47:30 +0100 |
| commit | fca1d193a46eba17255b5372adffac2396e48c04 (patch) | |
| tree | 0bdb30e6cd0d12498fb3361182154892fc6b2b23 /src/repo_ref.rs | |
| parent | ab1214060a7a2d55068a7ccc9c7f6a04fd7d5aa2 (diff) | |
feat(send): add relay hints to link
to proposal which is displayed at the end of the functon
Diffstat (limited to 'src/repo_ref.rs')
| -rw-r--r-- | src/repo_ref.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/repo_ref.rs b/src/repo_ref.rs index 3e1fd22..5d754f2 100644 --- a/src/repo_ref.rs +++ b/src/repo_ref.rs | |||
| @@ -191,6 +191,25 @@ impl RepoRef { | |||
| 191 | } | 191 | } |
| 192 | res | 192 | res |
| 193 | } | 193 | } |
| 194 | |||
| 195 | /// coordinates without relay hints | ||
| 196 | pub fn coordinate_with_hint(&self) -> Coordinate { | ||
| 197 | Coordinate { | ||
| 198 | kind: Kind::Custom(REPO_REF_KIND), | ||
| 199 | public_key: *self | ||
| 200 | .maintainers | ||
| 201 | .first() | ||
| 202 | .context("no maintainers in repo ref") | ||
| 203 | .unwrap(), | ||
| 204 | identifier: self.identifier.clone(), | ||
| 205 | relays: if let Some(relay) = self.relays.first() { | ||
| 206 | vec![relay.to_string()] | ||
| 207 | } else { | ||
| 208 | vec![] | ||
| 209 | }, | ||
| 210 | } | ||
| 211 | } | ||
| 212 | |||
| 194 | /// coordinates without relay hints | 213 | /// coordinates without relay hints |
| 195 | pub fn coordinates_with_timestamps(&self) -> Vec<(Coordinate, Option<Timestamp>)> { | 214 | pub fn coordinates_with_timestamps(&self) -> Vec<(Coordinate, Option<Timestamp>)> { |
| 196 | self.coordinates() | 215 | self.coordinates() |