summaryrefslogblamecommitdiffstats
path: root/src/client.rs
blob: 02ee537997fe6e5901a0624be4c7ec354824cb8b (plain) (tree)
1
2
3
4
5
6
7
8



                                                      



                           



























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

use std::{
    ops::{Deref, DerefMut},
    sync::Arc,
};

use jid::BareJID;
use leptos::prelude::*;

use crate::files::Files;

#[derive(Clone)]
pub struct Client {
    // TODO: not pub
    pub client: filamento::Client<Files>,
    pub resource: ArcRwSignal<Option<String>>,
    pub jid: Arc<BareJID>,
    pub file_store: Files,
}

impl Deref for Client {
    type Target = filamento::Client<Files>;

    fn deref(&self) -> &Self::Target {
        &self.client
    }
}

impl DerefMut for Client {
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.client
    }
}