//! Room presence snapshot builders for [`crate::protocol::PresenceSnapshot`].

use athena_chat::ids::RoomId;

use crate::protocol::{PresenceSnapshot, PresenceUser};

/// Builds a room-scoped presence snapshot marking each `user_id` as online.
pub fn snapshot(room_id: RoomId, user_ids: Vec<String>) -> PresenceSnapshot {
    PresenceSnapshot {
        room_id: Some(room_id),
        users: user_ids
            .into_iter()
            .map(|user_id| PresenceUser {
                user_id,
                state: "online".to_string(),
            })
            .collect(),
    }
}
