about summary refs log tree commit diff
path: root/kittybox-rs/src/database
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2023-06-15 17:03:53 +0300
committerVika <vika@fireburn.ru>2023-06-15 17:03:53 +0300
commited7049048cc4d12422c07ddbaa15fbb3662c0260 (patch)
tree7dc37332b8868a7a7f067056026a8d662bc0571d /kittybox-rs/src/database
parenteca7687439c2b6f804603de75501b6737a82e5a2 (diff)
downloadkittybox-ed7049048cc4d12422c07ddbaa15fbb3662c0260.tar.zst
Add support for the IndieWeb Webring πŸ•ΈπŸ’
Optional at first. Onboarding UI not yet exposed.
Diffstat (limited to 'kittybox-rs/src/database')
-rw-r--r--kittybox-rs/src/database/mod.rs20
1 files changed, 20 insertions, 0 deletions
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<Settings> 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)
+        }
     }
 }