@@ -49,8 +49,11 @@ pub(super) fn lock_project_connections() -> MutexGuard<'static, ()> {
4949pub struct ProjectConnectionScope {
5050 pub relay_url : String ,
5151 pub operator_pubkey : String ,
52- /// Canonical NIP-34 repository coordinate (`30617:<owner>:<d-tag>`).
53- pub repo_address : String ,
52+ /// Canonical NIP-MP Project coordinate (`30621:<owner>:<d-tag>`).
53+ ///
54+ /// Legacy one-repository Projects use their NIP-34 repository coordinate
55+ /// (`30617:<owner>:<d-tag>`).
56+ pub project_address : String ,
5457}
5558
5659#[ derive( Debug , Clone , Serialize , Deserialize , PartialEq , Eq ) ]
@@ -241,11 +244,11 @@ pub(super) fn canonical_project_scope(
241244 {
242245 return Err ( "Buzz could not verify who owns these connections." . to_string ( ) ) ;
243246 }
244- let mut parts = scope. repo_address . splitn ( 3 , ':' ) ;
247+ let mut parts = scope. project_address . splitn ( 3 , ':' ) ;
245248 let kind = parts. next ( ) ;
246249 let owner = parts. next ( ) ;
247250 let d_tag = parts. next ( ) ;
248- if kind != Some ( "30617" )
251+ if ! matches ! ( kind, Some ( "30617" ) | Some ( "30621" ) )
249252 || !owner. is_some_and ( |value| {
250253 value. len ( ) == 64 && value. bytes ( ) . all ( |byte| byte. is_ascii_hexdigit ( ) )
251254 } )
@@ -261,8 +264,9 @@ pub(super) fn canonical_project_scope(
261264 Ok ( ProjectConnectionScope {
262265 relay_url,
263266 operator_pubkey : scope. operator_pubkey . to_ascii_lowercase ( ) ,
264- repo_address : format ! (
265- "30617:{}:{}" ,
267+ project_address : format ! (
268+ "{}:{}:{}" ,
269+ kind. unwrap_or_default( ) ,
266270 owner. unwrap_or_default( ) . to_ascii_lowercase( ) ,
267271 d_tag. unwrap_or_default( )
268272 ) ,
0 commit comments