aboutsummaryrefslogtreecommitdiffstats
path: root/filamento/src/avatar.rs
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@bunny.garden>2025-04-08 10:38:18 +0100
committerLibravatar cel 🌸 <cel@bunny.garden>2025-04-08 10:38:18 +0100
commit5b644e2dc8712d56931b410b9c46dae1ef36e691 (patch)
tree2290b3ab2a5829c3b8406ce073a95474e146a680 /filamento/src/avatar.rs
parentc24541b129a14a598afe00ed4244d49d27513310 (diff)
downloadluz-5b644e2dc8712d56931b410b9c46dae1ef36e691.tar.gz
luz-5b644e2dc8712d56931b410b9c46dae1ef36e691.tar.bz2
luz-5b644e2dc8712d56931b410b9c46dae1ef36e691.zip
feat(filamento): user avatar publishing and processing
Diffstat (limited to '')
-rw-r--r--filamento/src/avatar.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/filamento/src/avatar.rs b/filamento/src/avatar.rs
new file mode 100644
index 0000000..a6937df
--- /dev/null
+++ b/filamento/src/avatar.rs
@@ -0,0 +1,34 @@
+#[derive(Clone, Debug)]
+pub struct Metadata {
+ pub bytes: u32,
+ pub hash: String,
+ pub r#type: String,
+}
+
+#[derive(Clone, Debug)]
+pub struct Data {
+ pub hash: String,
+ pub data_b64: String,
+}
+
+#[derive(Clone, Debug)]
+pub struct Avatar(Vec<u8>);
+
+impl From<stanza::xep_0084::Info> for Metadata {
+ fn from(value: stanza::xep_0084::Info) -> Self {
+ Self {
+ bytes: value.bytes,
+ hash: value.id,
+ r#type: value.r#type,
+ }
+ }
+}
+
+impl From<stanza::xep_0084::Data> for Data {
+ fn from(value: stanza::xep_0084::Data) -> Self {
+ Self {
+ hash: todo!(),
+ data_b64: todo!(),
+ }
+ }
+}