mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Include user relays in repo announcement event
This commit is contained in:
2 files changed
+16
-5
No files matched your search
@@ -70,8 +70,17 @@ export function ConfigureRepoStep({
|
||||
const cloneUrl = new URL(`/${npub}/${projectId}.git`, `https://${relayUrl.host}`);
|
||||
|
||||
cloneUrls.add(cloneUrl.href);
|
||||
} catch (err) {
|
||||
console.warn(`Failed to parse Nostr git relay URL: ${graspRelay.url}`, err);
|
||||
} catch {
|
||||
// fallthrough
|
||||
}
|
||||
}
|
||||
|
||||
for (const relay of config.relayMetadata.relays.filter(r => r.write)) {
|
||||
try {
|
||||
const relayUrl = new URL(relay.url);
|
||||
relays.add(relayUrl.href);
|
||||
} catch {
|
||||
// fallthrough
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,8 +112,8 @@ export function ConfigureRepoStep({
|
||||
name,
|
||||
description,
|
||||
webUrls,
|
||||
cloneUrls: [...cloneUrls],
|
||||
relays: [...relays],
|
||||
cloneUrls: [...cloneUrls].slice(0, 10), // Limit to first 10 clone URLs
|
||||
relays: [...relays].slice(0, 10), // Limit to first 10 relays
|
||||
tTags: tTags.length > 0 ? tTags : undefined,
|
||||
earliestCommit,
|
||||
});
|
||||
|
||||
@@ -62,7 +62,7 @@ export function createRepositoryAnnouncementEvent(
|
||||
): EventTemplate {
|
||||
// Build tags array per NIP-34
|
||||
const tags: string[][] = [
|
||||
['d', data.repoId.trim()], // Required: repository identifier
|
||||
['d', data.repoId], // Required: repository identifier
|
||||
];
|
||||
|
||||
if (data.name?.trim()) {
|
||||
@@ -110,6 +110,8 @@ export function createRepositoryAnnouncementEvent(
|
||||
tags.push(['r', data.earliestCommit.trim(), 'euc']);
|
||||
}
|
||||
|
||||
tags.push(['alt', `git repository: ${data.repoId}`]);
|
||||
|
||||
// Create repository announcement event (kind 30617)
|
||||
return {
|
||||
kind: 30617,
|
||||
|
||||
Reference in new issue
Block a user