dialtone_common 0.1.0

Dialtone Common Code
Documentation
use lazy_static::lazy_static;

use crate::ap::{create_actor_id, pun::create_preferred_user_name, ActorType};

pub const SYSTEM_MEDIA_USER_NAME: &str = "_system_media";

const SYSTEM_BANNERS_BASE: &str = "_system_banners";
const SYSTEM_ICONS_BASE: &str = "_system_icons";

lazy_static! {
    pub static ref SYSTEM_BANNERS_PUN_STRING: String =
        create_preferred_user_name(SYSTEM_BANNERS_BASE, &ActorType::Service);
    pub static ref SYSTEM_ICONS_PUN_STRING: String =
        create_preferred_user_name(SYSTEM_ICONS_BASE, &ActorType::Service);
    pub static ref SYSTEM_BANNERS_PUN: &'static str = SYSTEM_BANNERS_PUN_STRING.as_str();
    pub static ref SYSTEM_ICONS_PUN: &'static str = SYSTEM_ICONS_PUN_STRING.as_str();
}

pub fn system_banners_actor_id(host_name: &str) -> String {
    create_actor_id(host_name, *SYSTEM_BANNERS_PUN)
}

pub fn system_icons_actor_id(host_name: &str) -> String {
    create_actor_id(host_name, *SYSTEM_ICONS_PUN)
}