summaryrefslogtreecommitdiffstats
path: root/src/roster.rs
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@bunny.garden>2025-06-01 16:10:26 +0100
committerLibravatar cel 🌸 <cel@bunny.garden>2025-06-01 17:27:40 +0100
commit6ee4190a26f32bfa953302ee363ad3bb6c384ebb (patch)
tree2c3182c29d5780a0ad9c9770b5e546312bea49b4 /src/roster.rs
parentf76c80c1d23177ab00c81240ee3a75d3bcda0e3b (diff)
downloadmacaw-web-6ee4190a26f32bfa953302ee363ad3bb6c384ebb.tar.gz
macaw-web-6ee4190a26f32bfa953302ee363ad3bb6c384ebb.tar.bz2
macaw-web-6ee4190a26f32bfa953302ee363ad3bb6c384ebb.zip
refactor: reorganise code
Diffstat (limited to 'src/roster.rs')
-rw-r--r--src/roster.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/roster.rs b/src/roster.rs
new file mode 100644
index 0000000..75f4c3b
--- /dev/null
+++ b/src/roster.rs
@@ -0,0 +1,21 @@
+use std::collections::HashMap;
+
+use jid::BareJID;
+use reactive_stores::Store;
+
+use crate::contact::MacawContact;
+
+#[derive(Store, Clone)]
+pub struct Roster {
+ #[store(key: BareJID = |(jid, _)| jid.clone())]
+ contacts: HashMap<BareJID, MacawContact>,
+}
+
+impl Roster {
+ pub fn new() -> Self {
+ Self {
+ contacts: HashMap::new(),
+ }
+ }
+}
+