From ed7049048cc4d12422c07ddbaa15fbb3662c0260 Mon Sep 17 00:00:00 2001 From: Vika Date: Thu, 15 Jun 2023 17:03:53 +0300 Subject: Add support for the IndieWeb Webring πŸ•ΈπŸ’ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Optional at first. Onboarding UI not yet exposed. --- kittybox-rs/src/database/mod.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'kittybox-rs/src/database/mod.rs') diff --git a/kittybox-rs/src/database/mod.rs b/kittybox-rs/src/database/mod.rs index 2039ac0..db0e360 100644 --- a/kittybox-rs/src/database/mod.rs +++ b/kittybox-rs/src/database/mod.rs @@ -48,6 +48,11 @@ pub mod settings { fn from(settings: Settings) -> Self { settings.site_name } + } + impl From for Webring { + fn from(settings: Settings) -> Self { + settings.webring + } }*/ /// A trait for various settings that should be contained here. @@ -96,6 +101,21 @@ pub mod settings { } } + /// Participation status in the IndieWeb Webring: https://πŸ•ΈπŸ’.ws/dashboard + #[derive(Debug, Default, serde::Deserialize, serde::Serialize, Clone, Copy, PartialEq, Eq)] + pub struct Webring(bool); + impl private::Sealed for Webring {} + impl Setting<'_> for Webring { + type Data = bool; + const ID: &'static str = "webring"; + + fn into_inner(self) -> Self::Data { + self.0 + } + + fn new(data: Self::Data) -> Self { + Self(data) + } } } -- cgit 1.4.1