aboutsummaryrefslogblamecommitdiffstats
path: root/filamento/src/avatar.rs
blob: df30a6a654b67c9d258184103d27c316322040e4 (plain) (tree)
1
2
3
4



                                                      

































                                                    
// SPDX-FileCopyrightText: 2025 cel <cel@bunny.garden>
//
// SPDX-License-Identifier: AGPL-3.0-or-later

#[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!(),
        }
    }
}