From 5b644e2dc8712d56931b410b9c46dae1ef36e691 Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Tue, 8 Apr 2025 10:38:18 +0100 Subject: feat(filamento): user avatar publishing and processing --- filamento/src/avatar.rs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 filamento/src/avatar.rs (limited to 'filamento/src/avatar.rs') 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); + +impl From for Metadata { + fn from(value: stanza::xep_0084::Info) -> Self { + Self { + bytes: value.bytes, + hash: value.id, + r#type: value.r#type, + } + } +} + +impl From for Data { + fn from(value: stanza::xep_0084::Data) -> Self { + Self { + hash: todo!(), + data_b64: todo!(), + } + } +} -- cgit