upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/lib/repo_ref.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/repo_ref.rs')
-rw-r--r--src/lib/repo_ref.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/repo_ref.rs b/src/lib/repo_ref.rs
index aa36bbb..bf52cda 100644
--- a/src/lib/repo_ref.rs
+++ b/src/lib/repo_ref.rs
@@ -76,6 +76,11 @@ impl TryFrom<(nostr::Event, Option<PublicKey>)> for RepoRef {
76 [t, name, ..] if t == "name" => r.name = name.clone(), 76 [t, name, ..] if t == "name" => r.name = name.clone(),
77 [t, description, ..] if t == "description" => r.description = description.clone(), 77 [t, description, ..] if t == "description" => r.description = description.clone(),
78 [t, clone @ ..] if t == "clone" => { 78 [t, clone @ ..] if t == "clone" => {
79 for git_server in clone {
80 if !r.git_server.contains(git_server) {
81 r.git_server.push(git_server.clone());
82 }
83 }
79 r.git_server = clone.to_vec(); 84 r.git_server = clone.to_vec();
80 } 85 }
81 [t, web @ ..] if t == "web" => { 86 [t, web @ ..] if t == "web" => {
@@ -99,14 +104,18 @@ impl TryFrom<(nostr::Event, Option<PublicKey>)> for RepoRef {
99 [t, relays @ ..] if t == "relays" => { 104 [t, relays @ ..] if t == "relays" => {
100 for relay in relays { 105 for relay in relays {
101 if let Ok(relay_url) = RelayUrl::parse(relay) { 106 if let Ok(relay_url) = RelayUrl::parse(relay) {
102 r.relays.push(relay_url); 107 if !r.relays.contains(&relay_url) {
108 r.relays.push(relay_url);
109 }
103 } 110 }
104 } 111 }
105 } 112 }
106 [t, blossoms @ ..] if t == "blossoms" => { 113 [t, blossoms @ ..] if t == "blossoms" => {
107 for b in blossoms { 114 for b in blossoms {
108 if let Ok(b) = Url::parse(b) { 115 if let Ok(b) = Url::parse(b) {
109 r.blossoms.push(b); 116 if !r.blossoms.contains(&b) {
117 r.blossoms.push(b);
118 }
110 } 119 }
111 } 120 }
112 } 121 }