/**
     * Send a new text message to rori
     * @param self
     * @param body text to send
     * @return the interaction id if success. TODO, watch message status (if received)
     */
Send a new text message to rori
@param self
@param body text to send
@return the interaction id if success. TODO, watch message status (if received)
Send a new text message to rori @param self @param body text to send @return the interaction id if success . TODO watch message status ( if received )
fn send_interaction_to_rori(&self, body: &str, datatype: &str) -> u64 {
        let mut payloads: HashMap<&str, &str> = HashMap::new();
        payloads.insert(datatype, body);
        let payloads = Dict::new(payloads.iter());
        let dbus_msg = Message::new_method_call(self.ring_dbus, self.configuration_path, self.configuration_iface,
                                                "sendTextMessage");
        if !dbus_msg.is_ok() {
            error!("sendTextMessage fails. Please verify daemon's API.");
            return 0;
        }
        let conn = Connection::get_private(BusType::Session);
        if !conn.is_ok() {
            return 0;
        }
        let dbus = conn.unwrap();
        let response = dbus.send_with_reply_and_block(dbus_msg.unwrap().append3(&*self.account.id,
            self.rori_ring_id.clone(), payloads), 2000).unwrap();
        // sendTextMessage returns one argument, which is a u64.
        let interaction_id: u64  = match response.get1() {
            Some(interaction_id) => interaction_id,
            None => 0
        };
        interaction_id
    }
fn send_interaction_to_rori ( & self , body : & str , datatype : & str ) -> u64 { let mut payloads : HashMap < & str , & str > = HashMap :: new ( ) ; payloads . insert ( datatype , body ) ; let payloads = Dict :: new ( payloads . iter ( ) ) ; let dbus_msg = Message :: new_method_call ( self . ring_dbus , self . configuration_path , self . configuration_iface , " " ) ; if ! dbus_msg . is_ok ( ) { error ! ( " " ) ; return 0 ; } let conn = Connection :: get_private ( BusType :: Session ) ; if ! conn . is_ok ( ) { return 0 ; } let dbus = conn . unwrap ( ) ; let response = dbus . send_with_reply_and_block ( dbus_msg . unwrap ( ) . append3 ( & * self . account . id , self . rori_ring_id . clone ( ) , payloads ) , 2000 ) . unwrap ( ) ; // sendTextMessage returns one argument, which is a u64. let interaction_id : u64 = match response . get1 ( ) { Some ( interaction_id ) => interaction_id , None => 0 } ; interaction_id }
Send a new text message to rori
 @param self
 @param body text to send
 @return the interaction id if success.
Send a new text message to rori @param self @param body text to send @return the interaction id if success .
&self
body
&str
datatype
&str