2020-05-16 23:05:14 +01:00
|
|
|
use crate::padfoot::VarArg;
|
|
|
|
use crate::telepathy;
|
|
|
|
|
|
|
|
use dbus::tree::MethodErr;
|
|
|
|
use std::collections::HashMap;
|
|
|
|
|
|
|
|
use super::{Channel, Result};
|
|
|
|
|
2020-05-17 03:01:21 +01:00
|
|
|
impl AsRef<dyn telepathy::ChannelInterfaceMessages + 'static> for std::sync::Arc<Channel> {
|
2020-05-16 23:05:14 +01:00
|
|
|
fn as_ref(&self) -> &(dyn telepathy::ChannelInterfaceMessages + 'static) {
|
|
|
|
&**self
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl telepathy::ChannelInterfaceMessages for Channel {
|
|
|
|
fn send_message(&self, message: Vec<HashMap<&str, VarArg>>, flags: u32) -> Result<String> {
|
2020-05-17 00:49:46 +01:00
|
|
|
println!("Channel::send_message({:?}, {})", message, flags);
|
|
|
|
Err(MethodErr::no_arg())
|
2020-05-16 23:05:14 +01:00
|
|
|
}
|
|
|
|
|
2020-05-17 00:49:46 +01:00
|
|
|
fn get_pending_message_content(
|
|
|
|
&self,
|
|
|
|
message_id: u32,
|
|
|
|
parts: Vec<u32>,
|
|
|
|
) -> Result<HashMap<u32, VarArg>> {
|
|
|
|
println!(
|
|
|
|
"Channel::get_pending_message_content({}, {:?})",
|
|
|
|
message_id, parts
|
|
|
|
);
|
|
|
|
Err(MethodErr::no_arg())
|
2020-05-16 23:05:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
fn supported_content_types(&self) -> Result<Vec<String>> {
|
2020-05-17 00:49:46 +01:00
|
|
|
println!("Channel::supported_content_types()");
|
|
|
|
Err(MethodErr::no_arg())
|
2020-05-16 23:05:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
fn message_types(&self) -> Result<Vec<u32>> {
|
2020-05-17 00:49:46 +01:00
|
|
|
println!("Channel::message_types()");
|
|
|
|
Err(MethodErr::no_arg())
|
2020-05-16 23:05:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
fn message_part_support_flags(&self) -> Result<u32> {
|
2020-05-17 00:49:46 +01:00
|
|
|
println!("Channel::message_part_support_flags()");
|
|
|
|
Err(MethodErr::no_arg())
|
2020-05-16 23:05:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
fn pending_messages(&self) -> Result<Vec<Vec<HashMap<String, VarArg>>>> {
|
2020-05-17 00:49:46 +01:00
|
|
|
println!("Channel::pending_messages()");
|
|
|
|
Err(MethodErr::no_arg())
|
2020-05-16 23:05:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
fn delivery_reporting_support(&self) -> Result<u32> {
|
2020-05-17 00:49:46 +01:00
|
|
|
println!("Channel::delivery_reporting_support()");
|
|
|
|
Err(MethodErr::no_arg())
|
2020-05-16 23:05:14 +01:00
|
|
|
}
|
|
|
|
}
|