pub fn add_account(main_info: &str, password: &str, from_archive: bool) {
        let mut details: HashMap<&str, &str> = HashMap::new();
        if from_archive {
            details.insert("Account.archivePath", main_info);
        } else {
            details.insert("Account.alias", main_info);
        }
        details.insert("Account.type", "RING");
        details.insert("Account.archivePassword", password);
        let details = Dict::new(details.iter());
        let dbus_msg = Message::new_method_call("cx.ring.Ring", "/cx/ring/Ring/ConfigurationManager",
                                                "cx.ring.Ring.ConfigurationManager",
                                                "addAccount");
        if !dbus_msg.is_ok() {
            error!("addAccount fails. Please verify daemon's API.");
            return;
        }
        let conn = Connection::get_private(BusType::Session);
        if !conn.is_ok() {
            return;
        }
        let dbus = conn.unwrap();
        let response = dbus.send_with_reply_and_block(dbus_msg.unwrap()
                                                                .append1(details), 2000).unwrap();
        // addAccount returns one argument, which is a string.
        let account_added: &str  = match response.get1() {
            Some(account) => account,
            None => ""
        };
        info!("New account: {:?}", account_added);
    }
/**
     * Add a RING account
     * @param main_info path or alias
     * @param password
     * @param from_archive if main_info is a path
     */
Add a RING account
@param main_info path or alias
@param password
@param from_archive if main_info is a path
Add a RING account @param main_info path or alias @param password @param from_archive if main_info is a path
pub fn add_account(main_info: &str, password: &str, from_archive: bool) {
        let mut details: HashMap<&str, &str> = HashMap::new();
        if from_archive {
            details.insert("Account.archivePath", main_info);
        } else {
            details.insert("Account.alias", main_info);
        }
        details.insert("Account.type", "RING");
        details.insert("Account.archivePassword", password);
        let details = Dict::new(details.iter());
        let dbus_msg = Message::new_method_call("cx.ring.Ring", "/cx/ring/Ring/ConfigurationManager",
                                                "cx.ring.Ring.ConfigurationManager",
                                                "addAccount");
        if !dbus_msg.is_ok() {
            error!("addAccount fails. Please verify daemon's API.");
            return;
        }
        let conn = Connection::get_private(BusType::Session);
        if !conn.is_ok() {
            return;
        }
        let dbus = conn.unwrap();
        let response = dbus.send_with_reply_and_block(dbus_msg.unwrap()
                                                                .append1(details), 2000).unwrap();
        // addAccount returns one argument, which is a string.
        let account_added: &str  = match response.get1() {
            Some(account) => account,
            None => ""
        };
        info!("New account: {:?}", account_added);
    }
pub fn add_account ( main_info : & str , password : & str , from_archive : bool ) { let mut details : HashMap < & str , & str > = HashMap :: new ( ) ; if from_archive { details . insert ( " " , main_info ) ; } else { details . insert ( " " , main_info ) ; } details . insert ( " " , " " ) ; details . insert ( " " , password ) ; let details = Dict :: new ( details . iter ( ) ) ; let dbus_msg = Message :: new_method_call ( " " , " " , " " , " " ) ; if ! dbus_msg . is_ok ( ) { error ! ( " " ) ; return ; } let conn = Connection :: get_private ( BusType :: Session ) ; if ! conn . is_ok ( ) { return ; } let dbus = conn . unwrap ( ) ; let response = dbus . send_with_reply_and_block ( dbus_msg . unwrap ( ) . append1 ( details ) , 2000 ) . unwrap ( ) ; // addAccount returns one argument, which is a string. let account_added : & str = match response . get1 ( ) { Some ( account ) => account , None => " " } ; info ! ( " " account_added ) ; }
Add a RING account
 @param main_info path or alias
 @param password
 @param from_archive if main_info is a path
Add a RING account @param main_info path or alias @param password @param from_archive if main_info is a path
main_info
&str
password
&str
from_archive
bool
main_info
&str
password
&str
from_archive
bool