]> Untitled Git - lemmy.git/blobdiff - server/src/routes/nodeinfo.rs
Merge branch 'federation_add_fed_columns' of https://yerbamate.dev/dessalines/lemmy...
[lemmy.git] / server / src / routes / nodeinfo.rs
index 662089b3043d491c087c923e5778865e14b4a366..1fee54a8039f0b0e0817e2402f07a99ea0ce5408 100644 (file)
@@ -59,6 +59,13 @@ async fn node_info(
         local_comments: site_view.number_of_comments,
         open_registrations: site_view.open_registration,
       },
+      metadata: NodeInfoMetadata {
+        community_list_url: Some(format!(
+          "{}://{}/federation/communities",
+          get_apub_protocol_string(),
+          Settings::get().hostname
+        )),
+      },
     })
   })
   .await
@@ -84,6 +91,7 @@ pub struct NodeInfo {
   pub software: NodeInfoSoftware,
   pub protocols: Vec<String>,
   pub usage: NodeInfoUsage,
+  pub metadata: NodeInfoMetadata,
 }
 
 #[derive(Serialize, Deserialize, Debug)]
@@ -105,3 +113,8 @@ pub struct NodeInfoUsage {
 pub struct NodeInfoUsers {
   pub total: i64,
 }
+
+#[derive(Serialize, Deserialize, Debug)]
+pub struct NodeInfoMetadata {
+  pub community_list_url: Option<String>,
+}