use uuid::Uuid;

use crate::token::ChannelTokenContext;

#[derive(Clone)]
pub struct WsUserCtx {
    pub user_id: Uuid,
    pub device_id: String,
    pub client_id: String,
    pub display_name: String,
}

impl From<ChannelTokenContext> for WsUserCtx {
    fn from(ctx: ChannelTokenContext) -> Self {
        Self {
            user_id: ctx.user_id,
            device_id: ctx.device_id,
            client_id: ctx.client_id,
            display_name: ctx.user_id.to_string(),
        }
    }
}
