mod connection_manager;
mod command; // now it exists
mod message_formatter;

use connection_manager::ConnectionManager;
use command::{
    connect, disconnect, join_channel, part_channel, send_message,
    list_channels, is_connected
};

use tokio::sync::Mutex;

#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
    tauri::Builder::default()
        .manage(Mutex::new(ConnectionManager::new()))
        .invoke_handler(tauri::generate_handler![
            connect,
            disconnect,
            join_channel,
            part_channel,
            send_message,
            list_channels,
            is_connected
        ])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

