feat: add support for NIP-29 (#56)

Reviewed-on: reya/coop#56
This commit is contained in:
2026-10-01 04:23:18 +00:00
parent 21f96c7bbe
commit 1f350f511e
50 changed files with 6574 additions and 8181 deletions
+6 -6
View File
@@ -1,16 +1,16 @@
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SidebarTab {
Inbox,
Communities,
Groups,
}
impl SidebarTab {
pub const ALL: [SidebarTab; 2] = [Self::Inbox, Self::Communities];
pub const ALL: [SidebarTab; 2] = [Self::Inbox, Self::Groups];
pub fn label(self) -> &'static str {
match self {
Self::Inbox => "Inbox",
Self::Communities => "Communities",
Self::Groups => "Groups",
}
}
@@ -18,21 +18,21 @@ impl SidebarTab {
pub fn list_title(self) -> &'static str {
match self {
Self::Inbox => "Direct Messages",
Self::Communities => "Communities",
Self::Groups => "Groups",
}
}
pub fn list_id(self) -> &'static str {
match self {
Self::Inbox => "sidebar-inbox",
Self::Communities => "sidebar-communities",
Self::Groups => "sidebar-groups",
}
}
pub fn index(self) -> usize {
match self {
Self::Inbox => 0,
Self::Communities => 1,
Self::Groups => 1,
}
}
}