},
protocols,
usage: NodeInfoUsage {
- // TODO get these again
- users: NodeInfoUsers { total: 0 },
- local_posts: 0,
- local_comments: 0,
- open_registrations: site_view.site.open_registration,
+ users: NodeInfoUsers {
+ total: site_view.counts.users,
+ },
+ local_posts: site_view.counts.posts,
+ local_comments: site_view.counts.comments,
},
+ open_registrations: site_view.site.open_registration,
};
Ok(HttpResponse::Ok().json(json))
}
#[derive(Serialize, Deserialize, Debug)]
+#[serde(rename_all = "camelCase")]
struct NodeInfo {
pub version: String,
pub software: NodeInfoSoftware,
pub protocols: Vec<String>,
pub usage: NodeInfoUsage,
+ pub open_registrations: bool,
}
#[derive(Serialize, Deserialize, Debug)]
pub users: NodeInfoUsers,
pub local_posts: i64,
pub local_comments: i64,
- pub open_registrations: bool,
}
#[derive(Serialize, Deserialize, Debug)]