diff options
Diffstat (limited to 'filamento/src/avatar.rs')
-rw-r--r-- | filamento/src/avatar.rs | 34 |
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!(), + } + } +} |