Compare commits

..

1 Commits

Author SHA1 Message Date
338f85b6f6 Initial checkin 2020-05-09 01:32:35 +01:00
155 changed files with 1102 additions and 17364 deletions

2997
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,17 +3,9 @@ name = "telepathy-padfoot"
version = "0.1.0"
authors = ["Nick Thomas <me@ur.gs>"]
edition = "2018"
license = "MIT"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = "1.0"
async-std = "1.6"
dbus = "0.8"
deltachat = { git = "https://github.com/deltachat/deltachat-core-rust", tag="1.34.0" }
directories = "2.0"
rand = "0.7"
[profile.release]
lto = true
dbus = "0.8.2"

174
README.md
View File

@@ -14,181 +14,15 @@ Telepathy clients to send/receive Delta messages.
Telepathy CMs should have a name that is not the same as their protocol; so this
CM is hereby named "padfoot".
My first attempt was [purple-plugin-delta](https://code.ur.gs/lupine/purple-plugin-delta). This has some licensing issues (linking libpurple with OpenSSL)
that will be resolved with OpenSSL v3.0.0. At least until then, I've lost
interest in it; my efforts are going into this version instead.
## When
When it's ready.
## Where
Here's where we're at right now:
- [x] Connect to DBUS
- [x] Advertise enough properties / interfaces to become visible in Empathy
- [x] Connect to deltachat-core-rust
- [x] Set up an account via autoconfiguration
- [x] Appear as online in Empathy
- [x] Disconnect!
- [ ] Set up an account manually
- [~] Contacts handling
- [x] Text messages
- [ ] Multimedia messages
- [~] Setup messages
- [ ] Import/Export
- [ ] Group chats
- [ ] Geolocation messages
## Why
Mobile IM, mostly. Desktop IM, also. It's ideal for my pinephone, and lighter
than the electron desktop client.
At this point, I don't know Rust, I don't know DBUS, I don't know Telepathy, and
I don't know Deltachat particularly well either. So this also functions as a
learning exercise!
## How
### Compiling
This project is written in Rust, so you'll need a rust compiler to build it.
[Rustup](https://github.com/rust-lang/rustup) comes highly recommended.
There is a [`rust-toolchain`](rust-toolchain) file that I try to keep synced
with the version of rust that
[`deltachat-core-rust`](https://github.com/deltachat/deltachat-core-rust)
uses.
Once you have a working rust compiler, just:
```
$ cargo build --release
```
to get a `telepathy-padfoot binary. Drop the release flag to make it build fast.
### Cross-compiling amd64 -> i386
If you need a 32-bit binary and you're on an am64 bit system, this seems to
work, as long as you have 32-bit versions of `libdbus-1` and `libssl` installed.
On Debian, the full sequence looks like:
```
$ dpkg --print-architecture
amd64
# dpkg --add-architecture i386
$ dpkg --print-foreign-architectures
i386
# apt update
# apt install libdbus-1-dev:i386 libssl-dev:i386
$ rustup target install i686-unknown-linux-gnu
$ PKG_CONFIG_ALLOW_CROSS=1 cargo build --target=i686-unknown-linux-gnu --release
```
This creates a 32-bit executable at `target/i686-unknown-linux-gnu/release/telepathy-padfoot`
I don't have a 32-bit machine to test this on, but happy to take fixes for it.
### Cross-compiling amd64 -> aarch64
This is a handy thing to do for linux phones, most of which use telepathy. Rust
is quite heavy to compile - it's a pain even on a pinebook pro, which is the
same architecture. Setup on a Debian machine is quite simple:
```
$ dpkg --print-architecture
amd64
# dpkg --add-architecture arm64
$ dpkg --print-foreign-architectures
arm64
# apt update
# apt install libdbus-1-dev:arm64 libssl-dev:arm64 gcc-aarch64-linux-gnu
$ rustup target install aarch64-unknown-linux-gnu
$ RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc" PKG_CONFIG_ALLOW_CROSS=1 cargo build --target=aarch64-unknown-linux-gnu --release
```
We have to specify the linker because of [this bug](https://github.com/rust-lang/cargo/issues/4133).
Note that this doesn't create a static binary, so you'll need to match versions
for the shared libraries that are on the phone. In theory we can create static
binaries with musl, but openssl makes it hard. If you get it working, tell me
how!
UBTouch uses an ancient version of OpenSSL: 1.0.2g. KDE Neon does much better
with 1.1.1, so is easier to compile against.
An alternative approach to using multiarch (as above) is to use `debootstrap`
(or a similar tool) to get a sysroot containing libraries of all the right
versions. E.g. You can then add `-C link-args=--sysroot=/path/to/sysroot` to
`RUSTFLAGS` to use those libraries. Ufff. I've not got this working yet either.
...I'm compiling it directly on the phone. Not ideal. Add swap.
Compiling directly on the phone, using KDE Neon, I can get Padfoot running at
the same time as [Spacebar](https://invent.kde.org/plasma-mobile/spacebar),
which is a Telepathy client. I can see that Padfoot is checked for protocols,
but I don't see a way to start a connection with it yet. Next step for this is
to get Spacebar built and running locally, for a better debugging experience.
postmarketOS is more difficult. It's an `aarch64...musl` target. Rustup doesn't
support this, and the `rustc` included in the repositories is stable, not
nightly, so compiling directly on the phone is very difficult. Cross-compile is
likely the way to go here, in the end, but I need to get one of the two tries
above working first. Spacebar is available, but Empathy is not.
Phosh uses Chatty, which is based on libpurple, so doesn't work with Padfoot.
In the end, I tried Mobian. This is regular ordinary Debian Bullseye, plus a few
Phosh packages. Installing Empathy and Padfoot together (Chatty is bundled but
doesn't work), I have a working setup \o/ - although there are many warts, I can
use Deltachat on Linux Mobile in at least one configuration.
I'll probably keep Mobian for a while though, it's exactly what I want in a
mobile phone. Yes, I am peculiar.
### Installing
There is a `share/` directory in this project that contains a bunch of files.
They should be placed into `/usr/share`, following the same layout. Then put
the binary into `/usr/lib/telepathy/telepathy-padfoot`.
I should probably put this into the makefile.
### Running
D-Bus activation is not enabled yet, since it gets in the way of disaster-driven
development. Just run the `telepathy-padfoot` binary as the same user that your
chat client will be running as. It registers to the DBUS **session bus**, and
will be picked up next time your chat client scans (which may need a restart).
### Setup messages
If you send an autocrypt setup message while a padfoot connection is up, it will
notice it and open a channel asking you to reply with a message like:
```
IMEX: <id> nnnn-nnnn-nnnn-nnnn-nnnn-nnnn-nnnn-nnnn-nnnn
```
The ID is the delta-generated message ID, while the rest is the setup code. No
whitespace!
This bit is still extremely janky; it should instead be a magic channel type or
action button of some kind. It is, however, functional.
Delta wants us to enable the "Send copy to self" option in settings. That's
exposed as "Bcc self" in the advanced options in Empathy. Once enabled, messages
you send via Padfoot will appear in other clients. However, messages you send
from other clients don't appear in Padfoot yet because it mostly ignores self
messages as a dirty hack to avoid double-showing messages. Progess though.
### Autogenerated telepathy DBUS bindings
This project is written in Rust, just like the main Delta library, so you'll
need a rust compiler to build it.
It makes use of the `dbus-codegen-rust` crate to convert the
[telepathy interface specs](https://github.com/TelepathyIM/telepathy-spec) into
@@ -198,10 +32,10 @@ regenerated like so:
```bash
$ git submodule init telepathy-spec
$ git submodule update telepathy-spec
$ cargo install dbus-codegen
$ cargo install dbus-codegen-rust
$ ./scripts/dbus-codegen
```
`dbus-codegen-rust` doesn't seem to handle namespaced attributes properly, so
we modify the XML files in `telepathy-spec`... with `sed`. The `tp:type`
attribute is renamed to `tp:typehint`. This will be fixed in the next release.
attribute is renamed to `tp:typehint`.

View File

@@ -1,70 +0,0 @@
<html>
<head>
<style>
@media (prefers-color-scheme: dark) {
body {
background: #333;
color: white;
}
a {
color: skyblue;
}
}
.container {
font-family: sans-serif;
max-width: 800px;
margin: 0 auto;
}
.intro {
text-align: center;
}
.licenses-list {
list-style-type: none;
margin: 0;
padding: 0;
}
.license-used-by {
margin-top: -10px;
}
.license-text {
max-height: 200px;
overflow-y: scroll;
white-space: pre-wrap;
}
</style>
</head>
<body>
<main class="container">
<div class="intro">
<h1>Third Party Licenses</h1>
<p>This page lists the licenses of the projects used in telepathy-padfoot.</p>
</div>
<h2>Overview of licenses:</h2>
<ul class="licenses-overview">
{{#each overview}}
<li><a href="#{{id}}">{{name}}</a> ({{count}})</li>
{{/each}}
</ul>
<h2>All license text:</h2>
<ul class="licenses-list">
{{#each licenses}}
<li class="license">
<h3 id="{{id}}">{{name}}</h3>
<h4>Used by:</h4>
<ul class="license-used-by">
{{#each used_by}}
<li><a href="{{#if crate.repository}} {{crate.repository}} {{else}} https://crates.io/crates/{{crate.name}} {{/if}}">{{crate.name}} {{crate.version}}</a></li>
{{/each}}
</ul>
<pre class="license-text">{{text}}</pre>
</li>
{{/each}}
</ul>
</main>
</body>
</html>

View File

@@ -1,11 +0,0 @@
accepted = [
"0BSD",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause",
"ISC",
"CC0-1.0",
"MIT",
"MPL-2.0",
"Zlib"
]

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
nightly-2020-03-12

View File

@@ -12,7 +12,7 @@ rm -f "$dest.rs"
rm -rf "$dest"
mkdir -p "$dest"
echo "#![allow(unused)]" > "$modfile"
echo "#![allow(unused)]\n#![allow(clippy::all)]" > "$modfile"
for file in $(ls -a $specs/*.xml); do
sed -i 's/tp:type=/tp:typehint=/g' "$file"
@@ -28,12 +28,11 @@ for file in $(ls -a $specs/*.xml); do
dbus-codegen-rust \
--file "$file" \
-i "org.freedesktop.Telepathy" \
-a AsRefClosure \
-o "$out"
rustfmt "$out"
rustfmt $out
echo "\n#[allow(clippy::all)]\nmod $name;\npub use self::$name::*;" >> "$modfile"
echo "\nmod $name;\npub use self::$name::*;" >> "$modfile"
done
git -C telepathy-spec checkout -- .

View File

@@ -1,4 +0,0 @@
[D-BUS Service]
Name=org.freedesktop.Telepathy.ConnectionManager.padfoot
Exec=/usr/lib/telepathy/telepathy-padfoot
//SystemdService=telepathy-padfoot.service

View File

@@ -1,167 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="48px"
height="48px"
id="svg2985"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="delta-v7-pathed.svg"
inkscape:export-filename="/home/bpetersen/projects/messenger-android/MessengerProj/src/main/res/drawable-xhdpi/ic_launcher.png"
inkscape:export-xdpi="183.83"
inkscape:export-ydpi="183.83">
<defs
id="defs2987">
<linearGradient
id="linearGradient4409">
<stop
style="stop-color:#f9f9f9;stop-opacity:1"
offset="0"
id="stop4411" />
<stop
style="stop-color:#cccccc;stop-opacity:0;"
offset="1"
id="stop4413" />
</linearGradient>
<linearGradient
id="linearGradient4399">
<stop
style="stop-color:#f9f9f9;stop-opacity:1;"
offset="0"
id="stop4401" />
<stop
style="stop-color:#f9f9f9;stop-opacity:0;"
offset="1"
id="stop4403" />
</linearGradient>
<linearGradient
id="linearGradient4375">
<stop
style="stop-color:#364e59;stop-opacity:1;"
offset="0"
id="stop4377" />
<stop
style="stop-color:#364e59;stop-opacity:0;"
offset="1"
id="stop4379" />
</linearGradient>
<linearGradient
id="linearGradient4367">
<stop
style="stop-color:#dc000f;stop-opacity:1;"
offset="0"
id="stop4369" />
<stop
style="stop-color:#00ff00;stop-opacity:0;"
offset="1"
id="stop4371" />
</linearGradient>
<linearGradient
id="linearGradient4359">
<stop
style="stop-color:#dc000f;stop-opacity:1;"
offset="0"
id="stop4361" />
<stop
style="stop-color:#000000;stop-opacity:0;"
offset="1"
id="stop4363" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4375"
id="linearGradient4381"
x1="31.957268"
y1="29.751493"
x2="-45.041405"
y2="-18.591616"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.93766393,0,0,0.93766393,1.542566,1.7199693)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4409"
id="linearGradient4415"
x1="16.345125"
y1="3.8388948"
x2="36.001561"
y2="24.359164"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="9.8994949"
inkscape:cx="1.9547978"
inkscape:cy="28.000232"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:snap-global="false"
inkscape:snap-bbox="true"
inkscape:bbox-nodes="true"
inkscape:bbox-paths="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:window-width="1543"
inkscape:window-height="876"
inkscape:window-x="57"
inkscape:window-y="24"
inkscape:window-maximized="1" />
<metadata
id="metadata2990">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.57405078;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.43921569"
d="m 24.015419,1.2870249 c -12.549421,0 -22.7283936,10.1789711 -22.7283936,22.7283931 0,12.549422 10.1789726,22.728395 22.7283936,22.728395 14.337742,-0.342877 9.614352,-4.702705 23.697556,0.969161 -7.545453,-13.001555 -1.082973,-13.32964 -0.969161,-23.697556 0,-12.549422 -10.178973,-22.7283931 -22.728395,-22.7283931 z"
id="path3769"
inkscape:connector-curvature="0"
sodipodi:nodetypes="sscccs" />
<path
inkscape:connector-curvature="0"
id="path3799"
d="M 23.982249,5.3106163 C 13.645822,5.4364005 5.2618355,13.92999 5.2618355,24.275753 c 0,10.345764 8.3839865,18.635301 18.7204135,18.509516 9.827724,-0.03951 7.516769,-5.489695 18.380082,-0.443187 -5.950849,-9.296115 0.201753,-10.533667 0.340336,-18.521947 0,-10.345766 -8.383989,-18.6353031 -18.720418,-18.5095187 z"
style="fill:url(#linearGradient4381);fill-opacity:1;stroke:none"
sodipodi:nodetypes="sscccs" />
<g
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"
id="text4383" />
<g
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"
id="text4421" />
<g
transform="scale(1.1122373,0.89908874)"
style="font-style:normal;font-weight:normal;font-size:42.10587311px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none"
id="text3797">
<path
d="m 21.688854,23.636251 q -1.027975,-1.151333 -2.857771,-2.754974 -2.014832,-1.768118 -2.713855,-2.775534 -0.699024,-1.027975 -0.699024,-2.240986 0,-1.809237 1.68588,-2.837212 1.68588,-1.048535 4.399735,-1.048535 2.713855,0 4.728687,0.925178 2.035391,0.925177 2.035391,2.549379 0,0.781261 -0.493428,1.295249 -0.493428,0.513987 -1.151333,0.513987 -0.945737,0 -2.220426,-1.418606 -1.295249,-1.439165 -2.199868,-2.014832 -0.884059,-0.596225 -2.07651,-0.596225 -1.521404,0 -2.50826,0.678463 -0.966297,0.678464 -0.966297,1.726999 0,0.986857 0.801821,1.850356 0.801821,0.863499 4.132461,3.145605 3.556795,2.446581 5.01652,3.824068 1.480285,1.377487 2.405462,3.3512 0.925178,1.973713 0.925178,4.17358 0,3.865188 -2.734414,6.825757 -2.713855,2.94001 -6.352888,2.94001 -3.310081,0 -5.592187,-2.364344 -2.282105,-2.364343 -2.282105,-6.311769 0,-3.803509 2.50826,-6.352888 2.528819,-2.549379 6.208971,-3.083926 z m 0.904619,0.945737 q -5.900579,0.966297 -5.900579,8.100447 0,3.680152 1.459725,5.715543 1.480285,2.035391 3.433438,2.035391 2.035391,0 3.3512,-1.953153 1.315808,-1.973713 1.315808,-5.324913 0,-4.852044 -3.659592,-8.573315 z"
style="font-family:'Times New Roman';-inkscape-font-specification:'Times New Roman';fill:#ffffff;fill-opacity:1"
id="path4161" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 7.0 KiB

View File

@@ -1,26 +0,0 @@
[ConnectionManager]
Interfaces=
Name=padfoot
BusName=org.freedesktop.Telepathy.ConnectionManager.padfoot
ObjectPath=/org/freedesktop/Telepathy/ConnectionManager/padfoot
[Protocol delta]
param-account=s required
param-password=s required secret
param-bcc-self=b
status-available=2 settable
status-offline = 1 settable
AuthenticationTypes=org.freedesktop.Telepathy.Channel.Type.ServerTLSConnection;
ConnectionInterfaces=org.freedesktop.Telepathy.Connection.Interface.Avatars;org.freedesktop.Telepathy.Connection.Interface.Contacts;org.freedesktop.Telepathy.Connection.Interface.ContactList;org.freedesktop.Telepathy.Connection.Interface.Requests;org.freedesktop.Telepathy.Connection.Interface.SimplePresence;
EnglishName=Delta Chat
Icon=im-delta
Interfaces=org.freedesktop.Telepathy.Protocol;org.freedesktop.Telepathy.Protocol.Interface.Presence;
RequestableChannelClasses=text;
VCardField=email
[text]
Interfaces=org.freedesktop.Telepathy.Channel.Interface.Messages;
org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Text
org.freedesktop.Telepathy.Channel.TargetHandleType u=1
allowed=org.freedesktop.Telepathy.Channel.TargetHandle;org.freedesktop.Telepathy.Channel.TargetID;org.freedesktop.Telepathy.Channel.Interface.Messages;

5
src/delta.rs Normal file
View File

@@ -0,0 +1,5 @@
mod connection_manager;
pub use self::connection_manager::*;
mod protocol;
pub use self::protocol::*;

View File

@@ -0,0 +1,64 @@
use crate::telepathy;
use dbus::{arg, tree};
use std::collections::HashMap;
#[derive(Debug)]
pub struct ConnectionManager {}
#[derive(Copy, Clone, Default, Debug)]
pub struct CMData;
impl dbus::tree::DataType for CMData {
type Tree = ();
type Property = ();
type Interface = ();
type Method = ();
type Signal = ();
type ObjectPath = std::sync::Arc<ConnectionManager>;
}
const PROTO: &'static str = "delta";
pub type Dict = HashMap<String, arg::Variant<Box<dyn arg::RefArg + 'static>>>;
impl telepathy::ConnectionManager for ConnectionManager {
fn get_parameters(
&self,
protocol: &str,
) -> Result<
Vec<(
String,
u32,
String,
arg::Variant<Box<dyn arg::RefArg + 'static>>,
)>,
tree::MethodErr,
> {
Err(tree::MethodErr::no_arg()) // FIXME: should be NotImplemented
}
fn list_protocols(&self) -> Result<Vec<String>, tree::MethodErr> {
Ok(vec![PROTO.to_string()])
}
fn request_connection(
&self,
protocol: &str,
parameters: HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>,
) -> Result<(String, dbus::Path<'static>), tree::MethodErr> {
Err(tree::MethodErr::no_arg())
}
fn protocols(&self) -> Result<HashMap<String, Dict>, tree::MethodErr> {
let mut hm = HashMap::new();
let mut props = Dict::new();
hm.insert(PROTO.to_string(), props);
Ok(hm)
}
fn interfaces(&self) -> Result<Vec<String>, tree::MethodErr> {
Err(tree::MethodErr::no_arg())
}
}

2
src/delta/protocol.rs Normal file
View File

@@ -0,0 +1,2 @@
pub struct Protocol {}

View File

@@ -1,76 +1,67 @@
mod padfoot;
mod delta;
mod telepathy;
use anyhow::{anyhow, Result};
//use dbus::tree::{Interface, MTFn, MethodErr};
use dbus::{
blocking::{stdintf::org_freedesktop_dbus::RequestNameReply, LocalConnection},
channel::Sender,
tree::Factory,
};
use padfoot::{
ConnectionManager, Protocol, CM_BUS_NAME, CM_CONN_BUS_NAME, CM_OBJECT_PATH, CONN_BUS_NAME,
PROTO_BUS_NAME, PROTO_OBJECT_PATH,
tree::{Factory, Interface, MTFn, Tree},
};
use delta::{CMData, ConnectionManager};
use std::sync::Arc;
use std::time::Duration;
// TODO: move this to the ConnectionManager?
fn run() -> Result<()> {
let (cm, msg_r) = ConnectionManager::new();
let cm_rc = std::rc::Rc::new(cm);
use anyhow::{anyhow, Result};
let proto = Protocol {};
let proto_rc = std::rc::Rc::new(proto);
const BUS_NAME: &'static str = "org.freedesktop.Telepathy.ConnectionManager.delta";
const OBJECT_PATH: &'static str = "/org/freedesktop/Telepathy/ConnectionManager/delta";
let f = Factory::new_fn::<()>();
fn create_tree(cm: &Arc<ConnectionManager>) -> Tree<MTFn<CMData>, CMData> {
let f = Factory::new_fn();
let mut tree = f.tree(());
let cm_iface = telepathy::connection_manager_server(&f, (), move |_| cm_rc.clone());
let iface = telepathy::connection_manager_server(&f, (), |m| {
let a: &Arc<ConnectionManager> = m.path.get_data();
let b: &ConnectionManager = &a;
let proto_rc_1 = proto_rc.clone();
let proto_iface = telepathy::protocol_server(&f, (), move |_| proto_rc_1.clone());
let proto_presence_iface =
telepathy::protocol_interface_presence_server(&f, (), move |_| proto_rc.clone());
b
});
tree = tree.add(
f.object_path(CM_OBJECT_PATH, ())
f.object_path(OBJECT_PATH, cm.clone())
.introspectable()
.add(cm_iface),
);
tree = tree.add(
f.object_path(PROTO_OBJECT_PATH, ())
.introspectable()
.add(proto_iface)
.add(proto_presence_iface),
.add(iface),
);
tree = tree.add(f.object_path("/", cm.clone()).introspectable());
tree = tree.add(f.object_path("/", ()).introspectable());
tree
}
fn run() -> Result<()> {
let cm: ConnectionManager = ConnectionManager {};
let tree = create_tree(&Arc::new(cm));
// Setup DBus connection
let mut c = LocalConnection::new_session()?;
tree.start_receive(&c);
for name in &[CM_BUS_NAME, PROTO_BUS_NAME, CM_CONN_BUS_NAME, CONN_BUS_NAME] {
let result = c.request_name(*name, false, false, true)?;
let result = c.request_name(BUS_NAME, false, false, true)?;
match result {
RequestNameReply::Exists => {
return Err(anyhow!("Another process is already registered on {}", name))
}
_ => println!("{} listening on {}", c.unique_name(), name), // All other responses we can get are a success
}
return Err(anyhow!(
"Another process is already registered on {}",
BUS_NAME
))
}
_ => {} // All other responses we can get are a success
};
println!("Bus registered: {}", BUS_NAME);
tree.start_receive(&c);
loop {
c.process(Duration::from_millis(100))?;
// Spend a bit of time sending any outgoing messages - signals, mostly
for msg in msg_r.try_iter().take(10) {
print!("Sending message...");
match c.send(msg) {
Err(e) => println!("error! {:?}", e),
_ => println!("OK!"),
}
}
c.process(Duration::from_secs(1))?;
println!("Tick");
}
}

View File

@@ -1,17 +0,0 @@
mod channel;
pub use self::channel::*;
mod connection;
pub use self::connection::*;
mod connection_manager;
pub use self::connection_manager::*;
mod message;
pub use self::message::*;
mod protocol;
pub use self::protocol::*;
mod var_arg;
pub use self::var_arg::*;

View File

@@ -1,197 +0,0 @@
#[allow(clippy::module_inception)]
mod channel;
pub use channel::*;
mod messages;
pub use messages::*;
mod type_text;
pub use type_text::*;
use crate::padfoot::{var_bool, var_str, var_str_vec, var_u32, DbusAction, VarArg};
use crate::telepathy;
use async_std::task::block_on;
use deltachat as dc;
use std::collections::HashMap;
use std::sync::{mpsc, Arc};
type Result<T> = std::result::Result<T, dbus::tree::MethodErr>;
pub type HandleType = u32;
#[allow(dead_code)]
pub const HANDLE_TYPE_NONE: HandleType = 0;
pub const HANDLE_TYPE_CONTACT: HandleType = 1;
#[allow(dead_code)]
pub const HANDLE_TYPE_ROOM: HandleType = 2;
#[allow(dead_code)]
pub const HANDLE_TYPE_LIST: HandleType = 3; // Deprecated
#[allow(dead_code)]
pub const HANDLE_TYPE_GROUP: HandleType = 4; // Deprecated
// FIXME: I'm assuming that all channels will be of type text and 1-1 for now.
#[derive(Debug)]
pub struct Channel {
actq: mpsc::Sender<DbusAction>,
chat_id: dc::chat::ChatId,
ctx: Arc<dc::context::Context>,
initiator_handle: u32,
path: dbus::Path<'static>,
requested: bool,
target_handle: u32, // Who we're talking to
}
// "This SHOULD NOT include the channel type and channel interface itself"
pub fn channel_interfaces() -> Vec<String> {
vec!["org.freedesktop.Telepathy.Channel.Interface.Messages".to_string()]
}
impl Channel {
pub fn new(
actq: mpsc::Sender<DbusAction>,
chat_id: dc::chat::ChatId,
ctx: Arc<dc::context::Context>,
initiator_handle: u32,
path: dbus::Path<'static>,
requested: bool,
target_handle: u32,
) -> Self {
Channel {
actq,
chat_id,
ctx,
initiator_handle,
path,
requested,
target_handle,
}
}
// FIXME: we should be able to introspect this already???
pub fn chan_props(&self) -> HashMap<String, VarArg> {
let mut out = HashMap::<String, VarArg>::new();
out.insert(
"org.freedesktop.Telepathy.Channel.ChannelType".to_string(),
var_str(self.chan_type()),
);
out.insert(
"org.freedesktop.Telepathy.Channel.TargetHandleType".to_string(),
var_u32(self.handle_type()),
);
out.insert(
"org.freedesktop.Telepathy.Channel.InitiatorHandle".to_string(),
var_u32(self.initiator_handle),
);
out.insert(
"org.freedesktop.Telepathy.Channel.InitiatorID".to_string(),
var_str(self.initiator_contact().unwrap().get_addr().to_string()),
);
out.insert(
"org.freedesktop.Telepathy.Channel.TargetHandle".to_string(),
var_u32(self.target_handle),
);
out.insert(
"org.freedesktop.Telepathy.Channel.TargetID".to_string(),
var_str(self.target_contact().unwrap().get_addr().to_string()),
);
out.insert(
"org.freedesktop.Telepathy.Channel.Requested".to_string(),
var_bool(self.requested),
);
out.insert(
"org.freedesktop.Telepathy.Channel.Interfaces".to_string(),
var_str_vec(vec![
"org.freedesktop.Telepathy.Channel.Interface.Messages".to_string()
]),
);
out
}
pub fn path(&self) -> dbus::Path<'static> {
self.path.clone()
}
pub fn chan_type(&self) -> String {
"org.freedesktop.Telepathy.Channel.Type.Text".to_string() // FIXME: this shouldn't be hardcoded
}
pub fn handle_type(&self) -> HandleType {
HANDLE_TYPE_CONTACT // FIXME: this shouldn't be hardcoded
}
pub fn handle(&self) -> u32 {
self.target_handle
}
pub fn target_contact(&self) -> Option<dc::contact::Contact> {
block_on(dc::contact::Contact::get_by_id(&self.ctx, self.handle())).ok()
}
pub fn initiator_contact(&self) -> Option<dc::contact::Contact> {
block_on(dc::contact::Contact::get_by_id(
&self.ctx,
self.initiator_handle,
))
.ok() // FIXME: this will be wrong for outbound channels
}
pub fn requested(&self) -> bool {
self.requested
}
pub fn build_object_path(
channel: Arc<Channel>,
) -> dbus::tree::ObjectPath<dbus::tree::MTFn, ()> {
let f = dbus::tree::Factory::new_fn::<()>();
let c_rc1 = channel.clone();
let chan_iface = telepathy::channel_server(&f, (), move |_| c_rc1.clone());
let c_rc2 = channel.clone();
let messages_iface =
telepathy::channel_interface_messages_server(&f, (), move |_| c_rc2.clone());
let c_rc3 = channel.clone();
let type_text_iface = telepathy::channel_type_text_server(&f, (), move |_| c_rc3.clone());
f.object_path(channel.path.clone(), ())
.introspectable()
.add(chan_iface)
.add(messages_iface)
.add(type_text_iface)
}
fn try_process_setupmsg(self: &Self, text: String) {
if !text.starts_with("IMEX: ") {
return;
};
// Expected form: "IMEX: <msg-id> <setupcode>
let mut iter = text.split_whitespace();
iter.next(); // Ignore the prefix
let msg_id = match iter.next() {
Some(txt) => match txt.parse::<u32>() {
Ok(id) => id,
_ => return,
},
_ => return,
};
let setup_code = match iter.next() {
Some(txt) => txt,
_ => return,
};
if let Err(e) = block_on(dc::imex::continue_key_transfer(
&self.ctx,
dc::message::MsgId::new(msg_id),
&setup_code,
)) {
println!("Failed to apply setup code {}: {}", msg_id, e);
}
}
}

View File

@@ -1,98 +0,0 @@
use crate::padfoot::DbusAction;
use crate::telepathy;
use dbus::tree::MethodErr;
use super::{Channel, Result};
impl AsRef<dyn telepathy::Channel + 'static> for std::sync::Arc<Channel> {
fn as_ref(&self) -> &(dyn telepathy::Channel + 'static) {
&**self
}
}
impl telepathy::Channel for Channel {
fn close(&self) -> Result<()> {
println!("Channel::close()");
self.actq
.send(DbusAction::CloseChannel(self.path()))
.unwrap();
Ok(())
}
// Deprecated
fn get_channel_type(&self) -> Result<String> {
self.channel_type()
}
fn channel_type(&self) -> Result<String> {
println!("Channel::channel_type()");
Ok(self.chan_type())
}
// Deprecated
fn get_handle(&self) -> Result<(u32, u32)> {
println!("Channel::get_handle()");
Ok((self.handle_type(), self.handle()))
}
// Deprecated
fn get_interfaces(&self) -> Result<Vec<String>> {
println!("Channel::get_interfaces()");
self.interfaces()
}
fn interfaces(&self) -> Result<Vec<String>> {
println!("Channel::interfaces()");
Ok(super::channel_interfaces())
}
fn target_handle(&self) -> Result<u32> {
println!("Channel::target_handle()");
Ok(self.handle())
}
fn target_id(&self) -> Result<String> {
println!("Channel::target_id()");
if let Some(contact) = self.target_contact() {
Ok(contact.get_addr().to_string())
} else {
Err(MethodErr::no_arg())
}
}
fn target_handle_type(&self) -> Result<u32> {
println!("Channel::target_handle_type()");
Ok(self.handle_type())
}
fn requested(&self) -> Result<bool> {
println!("Channel::requested()");
Ok(self.requested) // FIXME: channels initiated by ourselves *will* be requested
}
fn initiator_handle(&self) -> Result<u32> {
println!("Channel::initiator_handle()");
self.target_handle() // FIXME: Not the case for channels initiated by ourselves
}
fn initiator_id(&self) -> Result<String> {
println!("Channel::initiator_id()");
if let Some(contact) = self.initiator_contact() {
Ok(contact.get_addr().to_string())
} else {
Err(MethodErr::no_arg())
}
}
}

View File

@@ -1,139 +0,0 @@
use crate::padfoot::{convert_msg, DbusAction, VarArg};
use crate::telepathy;
use async_std::task::block_on;
use dbus::message::SignalArgs;
use dbus::tree::MethodErr;
use dc::constants::Viewtype;
use dc::message::{Message, MessageState};
use deltachat as dc;
use std::collections::HashMap;
use super::{Channel, Result};
impl AsRef<dyn telepathy::ChannelInterfaceMessages + 'static> for std::sync::Arc<Channel> {
fn as_ref(&self) -> &(dyn telepathy::ChannelInterfaceMessages + 'static) {
&**self
}
}
impl telepathy::ChannelInterfaceMessages for Channel {
fn send_message(&self, parts: Vec<HashMap<&str, VarArg>>, flags: u32) -> Result<String> {
println!("Channel::send_message({:?}, {})", parts, flags);
if parts.len() != 2 {
return Err(MethodErr::no_arg());
}
let _meta = &parts[0];
let content = &parts[1];
let content_type = content["content-type"].0.as_str().unwrap();
if content_type != "text/plain" {
println!("FIXME: can only send text/plain messages right now");
return Err(MethodErr::no_arg());
}
let text_opt = content["content"].0.as_str().map(|s| s.to_string());
let mut delta_msg = Message::new(Viewtype::Text); // FIXME: this won't always be plaintext
delta_msg.set_text(text_opt.clone());
if let Some(text) = text_opt.clone() {
self.try_process_setupmsg(text);
};
let ctx = &self.ctx;
let blobdir = ctx.get_blobdir();
let msg_id = match block_on(dc::chat::send_msg(&ctx, self.chat_id, &mut delta_msg)) {
Ok(msg_id) => msg_id,
Err(e) => {
println!(" Failed to send message: {}", e);
return Err(MethodErr::no_arg());
}
};
let token = format!("{}", msg_id.to_u32());
let dbus_parts = convert_msg(blobdir, &delta_msg).map_err(|_| MethodErr::no_arg())?;
let messages_sig = telepathy::ChannelInterfaceMessagesMessageSent {
content: dbus_parts,
flags: 0,
message_token: token.clone(),
}
.to_emit_message(&self.path());
let text_sig = telepathy::ChannelTypeTextSent {
timestamp: delta_msg.get_timestamp() as u32,
type_: 0,
text: text_opt.or_else(|| Some("".to_string())).unwrap(),
}
.to_emit_message(&self.path());
self.actq.send(DbusAction::Signal(messages_sig)).unwrap();
self.actq.send(DbusAction::Signal(text_sig)).unwrap();
Ok(token)
}
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())
}
fn supported_content_types(&self) -> Result<Vec<String>> {
println!("Channel::supported_content_types()");
Ok(vec!["*/*".to_string()])
}
fn message_types(&self) -> Result<Vec<u32>> {
println!("Channel::message_types()");
Ok(vec![0]) // Normal messages. FIXME: MDNs too
}
fn message_part_support_flags(&self) -> Result<u32> {
println!("Channel::message_part_support_flags()");
Ok(0) // FIXME: support multipart messages
}
// Return value is an array of array of message parts
fn pending_messages(&self) -> Result<Vec<Vec<HashMap<String, VarArg>>>> {
println!("Channel::pending_messages()");
let mut out = Vec::<Vec<HashMap<String, VarArg>>>::new();
let ctx = &self.ctx;
let blobdir = ctx.get_blobdir();
for msg_id in block_on(dc::chat::get_chat_msgs(ctx, self.chat_id, 0, None)) {
if let Ok(msg) = block_on(dc::message::Message::load_from_db(ctx, msg_id)) {
match msg.get_state() {
MessageState::InFresh | MessageState::InNoticed => {
println!(" A message: {:?}", msg);
let parts = convert_msg(blobdir, &msg).map_err(|_| MethodErr::no_arg())?;
out.push(parts);
}
_ => continue,
}
}
}
Ok(out) // FIXME: check for pending messages
}
fn delivery_reporting_support(&self) -> Result<u32> {
println!("Channel::delivery_reporting_support()");
Ok(0) // FIXME: MDNs
}
}

View File

@@ -1,74 +0,0 @@
use crate::padfoot::DbusAction;
use crate::telepathy;
use crate::telepathy::ChannelInterfaceMessages;
use async_std::task::block_on;
use dbus::message::SignalArgs;
use dbus::tree::MethodErr;
use dc::message::MsgId;
use deltachat as dc;
use super::{Channel, Result};
impl AsRef<dyn telepathy::ChannelTypeText + 'static> for std::sync::Arc<Channel> {
fn as_ref(&self) -> &(dyn telepathy::ChannelTypeText + 'static) {
&**self
}
}
type PendingMessagesSpec = (
u32, // numeric identifier
u32, // Unix timestamp indicating when the message was received
u32, // contact handle for the contact who sent the message
u32, // message type, taken from ChannelTextMessageType
u32, // bitwise-OR of the message flags from ChannelTextMessageFlags
String, // text of the message
);
// Most of these methods are deprecated, so should be implemented in terms of
// the mandatory Messages interface.
impl telepathy::ChannelTypeText for Channel {
// ids is a list of deltachat msg_ids
fn acknowledge_pending_messages(&self, ids: Vec<u32>) -> Result<()> {
println!("Channel::acknowledge_pending_messages({:?})", ids);
let mut msg_ids = Vec::<MsgId>::new();
for msg_id in &ids {
msg_ids.push(MsgId::new(*msg_id));
}
print!(" Marking messages as seen...");
let result = block_on(dc::message::markseen_msgs(&self.ctx, msg_ids));
if result {
println!("OK!");
// Emit a PendingMessagesRemoved signal only if all have been removed
let sig =
telepathy::ChannelInterfaceMessagesPendingMessagesRemoved { message_ids: ids }
.to_emit_message(&self.path());
self.actq.send(DbusAction::Signal(sig)).unwrap();
} else {
println!("FAILED!");
}
Ok(())
}
fn get_message_types(&self) -> Result<Vec<u32>> {
println!("Channel::get_message_types()");
self.message_types()
}
fn list_pending_messages(&self, clear: bool) -> Result<Vec<PendingMessagesSpec>> {
println!("Channel::list_pending_messages({})", clear);
Err(MethodErr::no_arg())
}
fn send(&self, message_type: u32, text: &str) -> Result<()> {
println!("Channel::send({}, {})", message_type, text);
Err(MethodErr::no_arg())
}
}

View File

@@ -1,570 +0,0 @@
mod avatars;
pub use self::avatars::*;
#[allow(clippy::module_inception)]
mod connection;
pub use self::connection::*;
mod contacts;
pub use self::contacts::*;
mod contact_list;
pub use self::contact_list::*;
mod escape;
use self::escape::escape;
mod requests;
pub use self::requests::*;
mod simple_presence;
pub use self::simple_presence::*;
use crate::padfoot::{convert_msg, Channel, VarArg};
use crate::telepathy;
use async_std::task::block_on;
use dbus::blocking::{stdintf::org_freedesktop_dbus::RequestNameReply, LocalConnection};
use dbus::channel::{MatchingReceiver, Sender};
use dbus::message::SignalArgs;
use dbus::tree::MethodErr;
use dc::config::Config;
use dc::context::Context;
use dc::Event;
use deltachat as dc;
use std::collections::{HashMap, HashSet};
use std::sync::{mpsc, Arc, Mutex, RwLock};
use std::thread;
use std::time::Duration;
pub const CONN_BUS_NAME: &str = "org.freedesktop.Telepathy.Connection.padfoot.delta";
pub const CONN_OBJECT_PATH: &str = "/org/freedesktop/Telepathy/Connection/padfoot/delta";
// Only the main loop has access to the DBUS connection. Interacting with DBUS
// outside of method return values requires one of these to be added to actq
#[derive(Debug)]
pub enum DbusAction {
Signal(dbus::Message), // Generic signal to send
NewChannel(Channel), // Add this channel
CloseChannel(dbus::Path<'static>), // Close this channel
IncomingMessage(dc::chat::ChatId, dc::message::MsgId), // Look at this \o/
FreshMessages, // Hint that some messages need looking at
}
#[derive(Debug)]
// A connection uses delta database IDs as handles, and email addresses as IDs
pub struct Connection {
// Used for sending out messages
actq: mpsc::Sender<DbusAction>,
// actq: Arc<Mutex<VecDeque<DbusAction>>>,
// Channels we own
channels: Arc<RwLock<HashMap<dbus::Path<'static>, Arc<Channel>>>>,
// Owned by the CM. Remove ourselves from this when done
conns: Arc<Mutex<HashSet<dbus::Path<'static>>>>,
ctx: Arc<Context>, // Delta contexts are threadsafe
settings: ConnSettings,
state: Arc<RwLock<ConnState>>,
}
#[derive(Debug)]
pub struct ConnSettings {
account: String,
password: String,
bcc_self: bool,
id: String,
}
impl ConnSettings {
pub fn from_params(params: HashMap<&str, VarArg>) -> Result<Self, MethodErr> {
let err = Err(MethodErr::no_arg());
let account = match params.get("account") {
Some(variant) => match variant.0.as_str() {
Some(str) => str.to_string(),
None => return err,
},
None => return err,
};
let id = escape(account.to_owned());
let password = match params.get("password") {
Some(variant) => match variant.0.as_str() {
Some(str) => str.to_string(),
None => return err,
},
None => return err,
};
let bcc_self = match params.get("bcc-self") {
Some(variant) => match variant.0.as_u64() {
Some(i) => i != 0,
None => {
println!("0!");
return err;
}
},
None => {
println!("1!");
false
}
};
Ok(Self {
account,
password,
bcc_self,
id,
})
}
pub fn id(&self) -> String {
self.id.to_owned()
}
pub fn bus(&self) -> String {
CONN_BUS_NAME.to_owned() + "." + &self.id
}
pub fn path(&self) -> dbus::Path<'static> {
dbus::Path::new(format!("{}/{}", CONN_OBJECT_PATH, &self.id)).expect("Valid path")
}
}
impl Connection {
pub fn new(
settings: ConnSettings,
conns: Arc<Mutex<HashSet<dbus::Path<'static>>>>,
) -> Result<(Self, mpsc::Receiver<DbusAction>), MethodErr> {
let proj_dir = directories::ProjectDirs::from("gs", "ur", "telepathy-padfoot")
.ok_or_else(MethodErr::no_arg)?;
let mut dbfile = async_std::path::PathBuf::new();
dbfile.push(proj_dir.data_local_dir().to_str().unwrap());
dbfile.push(settings.id());
dbfile.push("db.sqlite3");
let (q_s, q_r) = mpsc::channel::<DbusAction>();
let id = settings.id();
let ctx = Arc::new(
block_on(Context::new("telepathy-padfoot".to_string(), dbfile)).map_err(|e| {
println!(
"Connection<{}>::new(): couldn't get delta context: {}",
settings.id(),
e
);
MethodErr::no_arg() // FIXME: better error handling
})?,
);
let e_ctx = ctx.clone();
let e_queue = q_s.clone();
thread::spawn(move || {
let emitter = e_ctx.get_event_emitter();
while let Some(e) = emitter.recv_sync() {
match e {
Event::Info(msg) => println!("Connection<{}>: INFO: {}", id, msg),
Event::Warning(msg) => println!("Connection<{}>: WARN : {}", id, msg),
Event::Error(msg)
| Event::ErrorNetwork(msg)
| Event::ErrorSelfNotInGroup(msg) => {
println!("Connection<{}>: ERR : {}", id, msg)
}
Event::ConfigureProgress(progress) => {
println!("Connection<{}>: Configuration progress: {}", id, progress)
}
Event::ImapConnected(msg) | Event::SmtpConnected(msg) => {
println!("Connection<{}>: Network: {}", id, msg);
}
Event::MsgsChanged { chat_id, msg_id } => {
println!(
"Connection<{}>: Messages changed for {}: {}",
id, chat_id, msg_id
);
e_queue
.send(DbusAction::IncomingMessage(chat_id, msg_id))
.unwrap();
}
Event::IncomingMsg { chat_id, msg_id } => {
println!(
"Connection<{}>: Incoming message for {}: {}",
id, chat_id, msg_id
);
e_queue
.send(DbusAction::IncomingMessage(chat_id, msg_id))
.unwrap();
}
/* Unhandled messages:
SmtpMessageSent(String),
ImapMessageDeleted(String),
ImapFolderEmptied(String),
NewBlobFile(String),
DeletedBlobFile(String),
MsgDelivered
MsgFailed
MsgRead
ChatModified(ChatId),
ContactsChanged(Option<u32>),
LocationChanged(Option<u32>),
ImexProgress(usize),
ImexFileWritten(PathBuf),
SecurejoinInviterProgress
SecurejoinJoinerProgress
*/
Event::ImapMessageMoved(_) | Event::ImapMessageDeleted(_) => {}
_ => println!("Connection<{}>: unhandled event received: {:?}", id, e),
};
}
});
block_on(ctx.set_config(Config::Addr, Some(&settings.account)))
.map_err(|_e| MethodErr::no_arg())?;
block_on(ctx.set_config(Config::MailPw, Some(&settings.password)))
.map_err(|_e| MethodErr::no_arg())?;
if settings.bcc_self {
block_on(ctx.set_config(Config::BccSelf, Some(&"1")))
.map_err(|_e| MethodErr::no_arg())?;
} else {
block_on(ctx.set_config(Config::BccSelf, Some(&"0")))
.map_err(|_e| MethodErr::no_arg())?;
}
if !block_on(ctx.is_configured()) {
block_on(ctx.configure()).unwrap();
};
Ok((
Connection {
actq: q_s,
channels: Arc::new(RwLock::new(
HashMap::<dbus::Path<'static>, Arc<Channel>>::new(),
)),
conns,
ctx,
settings,
state: Arc::new(RwLock::new(ConnState::Initial)),
},
q_r,
))
}
// This should be run inside its own thread. It will signal via the channel
// once the main loop is ready
//
// FIXME: running several +process+ loops sure is convenient, but it also
// seems inefficient...
pub fn run(
self,
done_signal: mpsc::Sender<Option<MethodErr>>,
queue_receiver: mpsc::Receiver<DbusAction>,
) {
let id = self.id();
let bus = self.bus();
let path = self.path();
let conns = self.conns.clone();
let chans = self.channels.clone();
let actq = self.actq.clone();
let ctx = self.ctx.clone();
let state = self.state.clone();
let tree = self.build_tree();
// Setup DBus connection
let mut c = match LocalConnection::new_session() {
Ok(c) => c,
Err(e) => {
println!("Failed to establish DBUS session for {}: {}", bus, e);
return; // Leave early
}
};
let tc = tree.clone();
c.start_receive(
dbus::message::MatchRule::new_method_call(),
Box::new(move |msg, c| {
let tree = tc.lock().unwrap();
if let Some(replies) = tree.handle(&msg) {
for r in replies {
let _ = c.send(r);
}
}
true
}),
);
match c.request_name(bus.clone(), false, false, true) {
Ok(RequestNameReply::Exists) => {
println!("Another process is already registered on {}", bus);
done_signal.send(Some(MethodErr::no_arg())).unwrap();
return;
}
Err(e) => {
println!("Failed to register {}: {}", bus, e);
done_signal.send(Some(MethodErr::no_arg())).unwrap();
return;
}
_ => {
// All other responses we can get are a success. We are now on
// the message bus, so the caller can proceed
println!("{} listening on {}", c.unique_name(), bus);
done_signal.send(None).unwrap();
}
};
// Set up delta jobs last in case registering to DBUS fails
// "Borrowed" from https://github.com/deltachat/deltachat-core-rust/blob/master/examples/simple.rs
while *state.read().unwrap() != ConnState::Disconnected {
if let Err(e) = c.process(Duration::from_millis(100)) {
println!("Error processing: {}", e);
break;
};
// Spend a bit of time sending any outgoing messages - signals, mostly
while let Some(act) = queue_receiver.try_recv().ok() {
match act {
DbusAction::Signal(msg) => {
print!("*** Connection<{}>: Sending signal: {:?}...", id, msg);
match c.send(msg) {
Err(e) => println!("error! {:?}", e), // FIXME: handle error better?
_ => println!("OK!"),
}
}
DbusAction::NewChannel(channel) => {
let chan_type = channel.chan_type();
let handle_type = channel.handle_type();
let handle = channel.handle();
let chan_path = channel.path().clone();
let chan_props = channel.chan_props();
let rc_channel = Arc::new(channel);
println!("*** Creating channel {}", chan_path);
Arc::clone(&chans)
.write()
.unwrap()
.insert(chan_path.clone(), rc_channel.clone());
let t2 = tree.clone();
let op = Channel::build_object_path(rc_channel);
t2.lock().unwrap().insert(op);
let requests_sig = telepathy::ConnectionInterfaceRequestsNewChannels {
channels: vec![(chan_path.clone(), chan_props)],
};
let legacy_sig = telepathy::ConnectionNewChannel {
object_path: chan_path.clone(),
channel_type: chan_type,
handle_type, // contact. FIXME: support other channel types
handle, // id of other contact
// TODO: initiator needs to be tracked
suppress_handler: false, // We'll need to start passing this
};
actq.send(DbusAction::Signal(requests_sig.to_emit_message(&path)))
.unwrap();
actq.send(DbusAction::Signal(legacy_sig.to_emit_message(&path)))
.unwrap();
}
DbusAction::CloseChannel(chan_path) => {
println!("*** Closing channel {}", chan_path.clone());
let _chan = Arc::clone(&chans).write().unwrap().remove(&chan_path);
let t2 = tree.clone();
t2.lock().unwrap().remove(&chan_path);
let requests_sig = telepathy::ConnectionInterfaceRequestsChannelClosed {
removed: chan_path.clone(),
};
let legacy_sig = telepathy::ChannelClosed {};
actq.send(DbusAction::Signal(requests_sig.to_emit_message(&path)))
.unwrap();
actq.send(DbusAction::Signal(legacy_sig.to_emit_message(&chan_path)))
.unwrap();
}
DbusAction::IncomingMessage(chat_id, msg_id) => {
println!("*** Incoming message: {} {}", chat_id, msg_id);
// TODO: check if we have a channel for the chat
let chan_path = Connection::build_channel_path(path.clone(), chat_id);
let c2 = Arc::clone(&chans);
let chans = c2.read().unwrap();
//let u_ctx = ctx.clone();
let ctx = ctx.clone();
let blobdir = ctx.get_blobdir();
// Autocreate channel if it doesn't already exist
// FIXME: unknown contacts need more care than this
if !chans.contains_key(&chan_path) {
print!("Channel for {} doesn't exist yet, creating it...", chat_id);
let contacts = block_on(dc::chat::get_chat_contacts(&ctx, chat_id));
if contacts.len() > 1 {
println!("...{} contacts in chat, ignoring!", contacts.len());
continue;
}
// FIXME: device-specific chat isn't really a self-chat
let handle = contacts
.first()
.unwrap_or(&dc::constants::DC_CONTACT_ID_SELF);
let chan = Channel::new(
actq.clone(),
chat_id,
ctx.clone(),
*handle, // initiator is the remote contact
chan_path,
false, // FIXME: this needs to handle requested channels
*handle, // target is always the other party
);
actq.send(DbusAction::NewChannel(chan)).unwrap();
actq.send(act).unwrap();
println!("OK");
continue;
}
// Since the channel exists, emit new message signals
print!("Message {} received for {}...", msg_id, chan_path);
let msg = match block_on(dc::message::Message::load_from_db(&ctx, msg_id)) {
Ok(m) => m,
Err(e) => {
println!("Can't load from database, skipping: {}", e);
continue;
}
};
// Ignore messages that are self-originated.
// FIXME: special-case self-chats
if msg.get_from_id() == dc::constants::DC_CONTACT_ID_SELF
&& !msg.is_setupmessage()
{
println!("from ourselves, skipping");
continue;
}
let parts = convert_msg(blobdir, &msg);
if parts.is_err() {
println!("can't convert, skipping: {}", parts.unwrap_err());
continue;
}
let sig = telepathy::ChannelInterfaceMessagesMessageReceived {
message: parts.unwrap(),
}
.to_emit_message(&chan_path);
actq.send(DbusAction::Signal(sig)).unwrap();
// FIXME: We MUST also send a Text.Received signal
println!("OK!");
}
DbusAction::FreshMessages => {
println!("*** FRESH MESSAGES");
let ctx = ctx.clone();
for msg_id in block_on(dc::context::Context::get_fresh_msgs(&ctx)) {
println!(" FRESH MESSAGE: {}", msg_id);
match block_on(dc::message::Message::load_from_db(&ctx, msg_id)) {
Ok(msg) => {
actq.send(DbusAction::IncomingMessage(
msg.get_chat_id(),
msg_id,
))
.unwrap();
}
Err(e) => println!("Couldn't load fresh message {}: {}", msg_id, e),
}
}
}
}
}
}
// TODO: join on threads started in connect!
let mut conns = conns.lock().expect("Mutex access");
conns.remove(&path);
}
pub fn id(&self) -> String {
self.settings.id.to_string()
}
pub fn bus(&self) -> String {
self.settings.bus()
}
pub fn path(&self) -> dbus::Path<'static> {
self.settings.path()
}
fn build_channel_path(
path: dbus::Path<'static>,
chat_id: dc::chat::ChatId,
) -> dbus::strings::Path<'static> {
let path = format!("{}/{}", path, chat_id.to_u32());
dbus::strings::Path::new(path).expect("Must be valid")
}
fn build_tree(self) -> Arc<Mutex<dbus::tree::Tree<dbus::tree::MTFn, ()>>> {
let path = self.path();
let c_rc = std::rc::Rc::new(self);
let f = dbus::tree::Factory::new_fn::<()>();
let mut tree = f.tree(());
let c_rc1 = c_rc.clone();
let conn_iface = telepathy::connection_server(&f, (), move |_| c_rc1.clone());
let c_rc2 = c_rc.clone();
let avatars_iface =
telepathy::connection_interface_avatars_server(&f, (), move |_| c_rc2.clone());
let c_rc3 = c_rc.clone();
let contacts_iface =
telepathy::connection_interface_contacts_server(&f, (), move |_| c_rc3.clone());
let _c_rc4 = c_rc.clone();
let contact_list_iface =
telepathy::connection_interface_contact_list_server(&f, (), move |_| _c_rc4.clone());
let c_rc5 = c_rc.clone();
let requests_iface =
telepathy::connection_interface_requests_server(&f, (), move |_| c_rc5.clone());
let simple_presence_iface =
telepathy::connection_interface_simple_presence_server(&f, (), move |_| c_rc.clone());
tree = tree.add(
f.object_path(path, ())
.introspectable()
.add(conn_iface)
.add(avatars_iface)
.add(contacts_iface)
.add(contact_list_iface)
.add(requests_iface)
.add(simple_presence_iface),
);
tree = tree.add(f.object_path("/", ()).introspectable());
Arc::new(Mutex::new(tree))
}
}

View File

@@ -1,107 +0,0 @@
use crate::telepathy;
use dbus::tree::MethodErr;
use std::collections::HashMap;
use super::Connection;
impl AsRef<dyn telepathy::ConnectionInterfaceAvatars + 'static> for std::rc::Rc<Connection> {
fn as_ref(&self) -> &(dyn telepathy::ConnectionInterfaceAvatars + 'static) {
&**self
}
}
type AvatarRequirementSpec = (Vec<String>, u16, u16, u16, u16, u32);
// TODO: come back and do this properly, I'm just putting it in for consistency
impl telepathy::ConnectionInterfaceAvatars for Connection {
fn get_avatar_requirements(&self) -> Result<AvatarRequirementSpec, MethodErr> {
println!("Connection<{}>::get_avatar_requirements()", self.id());
Ok((vec![], 0, 0, 0, 0, 0))
}
fn get_avatar_tokens(&self, contacts: Vec<u32>) -> Result<Vec<String>, MethodErr> {
println!(
"Connection<{}>::get_avatar_tokens({:?})",
self.id(),
contacts
);
Ok(vec![])
}
fn get_known_avatar_tokens(
&self,
contacts: Vec<u32>,
) -> Result<::std::collections::HashMap<u32, String>, MethodErr> {
println!(
"Connection<{}>::get_known_avatar_tokens({:?})",
self.id(),
contacts
);
Ok(HashMap::<u32, String>::new())
}
fn request_avatar(&self, contact: u32) -> Result<(Vec<u8>, String), MethodErr> {
println!("Connection<{}>::request_avatar({})", self.id(), contact);
Ok((vec![], "".to_string()))
}
fn request_avatars(&self, contacts: Vec<u32>) -> Result<(), MethodErr> {
println!("Connection<{}>::request_avatar({:?})", self.id(), contacts);
Ok(())
}
fn set_avatar(&self, _avatar: Vec<u8>, mimetype: &str) -> Result<String, MethodErr> {
println!(
"Connection<{}>::set_avatar((data), {:?})",
self.id(),
mimetype
);
Ok("".to_string())
}
fn clear_avatar(&self) -> Result<(), MethodErr> {
println!("Connection<{}>::clear_avatar()", self.id());
Ok(())
}
fn supported_avatar_mimetypes(&self) -> Result<Vec<String>, MethodErr> {
println!("Connection<{}>::supported_avatar_mimetypes()", self.id());
Ok(vec![])
}
fn minimum_avatar_height(&self) -> Result<u32, MethodErr> {
println!("Connection<{}>::minimum_avatar_height()", self.id());
Ok(0)
}
fn minimum_avatar_width(&self) -> Result<u32, MethodErr> {
println!("Connection<{}>::minimum_avatar_width()", self.id());
Ok(0)
}
fn recommended_avatar_height(&self) -> Result<u32, MethodErr> {
println!("Connection<{}>::recommended_avatar_height()", self.id());
Ok(0)
}
fn recommended_avatar_width(&self) -> Result<u32, MethodErr> {
println!("Connection<{}>::recommended_avatar_width()", self.id());
Ok(0)
}
fn maximum_avatar_height(&self) -> Result<u32, MethodErr> {
println!("Connection<{}>::maximum_avatar_height()", self.id());
Ok(0)
}
fn maximum_avatar_width(&self) -> Result<u32, MethodErr> {
println!("Connection<{}>::maximum_avatar_width()", self.id());
Ok(0)
}
fn maximum_avatar_bytes(&self) -> Result<u32, MethodErr> {
println!("Connection<{}>::maximum_avatar_bytes()", self.id());
Ok(0)
}
}

View File

@@ -1,354 +0,0 @@
use crate::telepathy;
use crate::telepathy::{ConnectionInterfaceContacts, ConnectionInterfaceRequests}; // Non-deprecated channel methods
use async_std::task::block_on;
use dbus::message::SignalArgs;
use dbus::tree::MethodErr;
use dc::contact::Contact;
use deltachat as dc;
use std::collections::HashMap;
use std::convert::TryInto;
use std::thread;
use super::{Connection, DbusAction};
#[derive(Debug, PartialEq, Eq)]
pub enum ConnState {
Initial,
Connected,
Disconnected,
}
type Result<T> = std::result::Result<T, dbus::tree::MethodErr>;
// Deprecated channel information. Replaced by Requests.ChannelSpec
type ChannelInfo = (
dbus::Path<'static>, // Object path
String, // Channel type
u32, // Handle type
u32, // Handle
);
type ContactSubscription = (
u32, // Subscribe state
u32, // Publish state
String, // Publish-request message
);
pub fn connection_interfaces() -> Vec<String> {
vec![
"org.freedesktop.Telepathy.Connection".to_string(),
"org.freedesktop.Telepathy.Connection.Interface.Avatars".to_string(),
"org.freedesktop.Telepathy.Connection.Interface.Contacts".to_string(),
"org.freedesktop.Telepathy.Connection.Interface.ContactList".to_string(),
"org.freedesktop.Telepathy.Connection.Interface.Requests".to_string(),
"org.freedesktop.Telepathy.Connection.Interface.SimplePresence".to_string(),
]
}
impl AsRef<dyn telepathy::Connection + 'static> for std::rc::Rc<Connection> {
fn as_ref(&self) -> &(dyn telepathy::Connection + 'static) {
&**self
}
}
impl telepathy::Connection for Connection {
// In connect(), we start the threads that drive the deltachat context
fn connect(&self) -> Result<()> {
println!("Connection<{}>::connect()", self.id());
let io_ctx = self.ctx.clone();
let io_id = self.id();
let _io_thread = thread::spawn(move || {
block_on(io_ctx.start_io());
println!("Connection<{}>::connect(): I/O thread exited", io_id);
});
// Just pretend to be connected all the time for now. Tracking IMAP+SMTP
// state is a pain
let state = self.state.clone();
let mut w = state.write().unwrap();
*w = ConnState::Connected;
let ctx = self.ctx.clone();
// Emit a StatusChanged signal for the benefit of others, but the caller
// learns from our RPC response
let connected_sig = telepathy::ConnectionStatusChanged {
status: 0, // Connected
reason: 1, // Requested
}
.to_emit_message(&self.path());
self.actq.send(DbusAction::Signal(connected_sig)).unwrap();
self.actq.send(DbusAction::FreshMessages).unwrap();
// If we can, emit signals on connect about the contact list
if let Ok(handles) = block_on(Contact::get_all(
&ctx,
(dc::constants::DC_GCL_ADD_SELF as usize)
.try_into()
.unwrap(),
None::<String>,
)) {
println!(" HANDLES: {:?}", handles);
let mut changes = HashMap::<u32, ContactSubscription>::new();
for handle in handles {
println!(" *** Handle: {}", handle);
changes.insert(handle, (4, 4, "".to_string())); // FIXME: hardcoded lies
}
// TODO: the old signal is deprecated. The new signal requires us to
// send identifiers with it, which is a bit of a lookup here.
// let cl_sig_new = telepathy::ConnectionInterfaceContactsChangedWithID {
// }.to_emit_message(&self.path());
let cl_sig_old = telepathy::ConnectionInterfaceContactListContactsChanged {
changes,
removals: Vec::new(),
}
.to_emit_message(&self.path());
// self.actq.send(DbusAction::Signal(cl_sig_new)).unwrap();
self.actq.send(DbusAction::Signal(cl_sig_old)).unwrap();
};
Ok(())
}
fn disconnect(&self) -> Result<()> {
println!("Connection<{}>::disconnect()", self.id());
block_on(self.ctx.stop_io());
let state = self.state.clone();
let mut w = state.write().unwrap();
*w = ConnState::Disconnected;
// FIXME: we need to signal to the CM that they should remove the
// connection from the active list
Ok(())
}
fn interfaces(&self) -> Result<Vec<String>> {
println!("Connection<{}>::interfaces()", self.id());
self.get_interfaces()
}
fn get_interfaces(&self) -> Result<Vec<String>> {
println!("Connection<{}>::get_interfaces()", self.id());
Ok(connection_interfaces())
}
fn get_protocol(&self) -> Result<String> {
println!("Connection<{}>::get_protocol()", self.id());
Ok(crate::padfoot::PROTO_NAME.to_string())
}
fn self_handle(&self) -> Result<u32> {
println!("Connection<{}>::self_handle()", self.id());
Ok(dc::constants::DC_CONTACT_ID_SELF)
}
// Deprecated in favour of the self_handle DBUS property
fn get_self_handle(&self) -> Result<u32> {
println!("Connection<{}>::get_self_handle()", self.id());
self.self_handle()
}
fn status(&self) -> Result<u32> {
println!("Connection<{}>::status()", self.id());
self.get_status()
}
fn get_status(&self) -> Result<u32> {
match *self.state.clone().read().unwrap() {
ConnState::Initial | ConnState::Disconnected => Ok(2),
ConnState::Connected => Ok(0),
}
}
fn hold_handles(&self, handle_type: u32, handles: Vec<u32>) -> Result<()> {
println!(
"Connection<{}>::hold_handles({}, {:?})",
self.id(),
handle_type,
handles
);
// Since HasImmortalHandles is true, this doesn't need to do anything
Ok(())
}
fn inspect_handles(&self, handle_type: u32, handles: Vec<u32>) -> Result<Vec<String>> {
println!(
"Connection<{}>::inspect_handles({}, {:?})",
self.id(),
handle_type,
handles
);
match handle_type {
crate::padfoot::HANDLE_TYPE_CONTACT => {
let mut out = Vec::<String>::new();
for (_handle, attrs) in self.get_contact_attributes(handles, vec![], true)? {
if let Some(contact_id) =
attrs.get("org.freedesktop.Telepathy.Connection/contact-id")
{
out.push(contact_id.0.as_str().unwrap().to_string());
} else {
return Err(MethodErr::no_arg()); // FIXME: should be InvalidHandle
}
}
Ok(out)
}
_ => Err(MethodErr::no_arg()), // FIXME: should be NotImplemented?
}
}
// Deprecated in favour of Requests.Channels
fn list_channels(&self) -> Result<Vec<ChannelInfo>> {
println!("Connection<{}>::list_channels()", self.id());
let data = self.channels()?;
let mut out = Vec::<ChannelInfo>::new();
for (path, _props) in data {
// FIXME: pull correct details from the properties hash
out.push((
path,
"org.freedesktop.Telepathy.Channel.Type.Text".to_string(),
0,
0,
))
}
Ok(out)
}
fn release_handles(&self, handle_type: u32, handles: Vec<u32>) -> Result<()> {
println!(
"Connection<{}>::release_handles({}, {:?})",
self.id(),
handle_type,
handles
);
// Since HasImmortalHandles is true, we don't need to do anything
Ok(())
}
// RequestChannel is deprecated in favour of the Requests interface.
fn request_channel(
&self,
channel_type: &str,
handle_type: u32,
handle: u32,
suppress_handler: bool,
) -> Result<dbus::Path<'static>> {
println!(
"Connection<{}>::request_channel({}, {}, {}, {})",
self.id(),
channel_type,
handle_type,
handle,
suppress_handler
);
Err(MethodErr::no_arg()) // FIXME: should be NotImplemented?
}
fn request_handles(&self, handle_type: u32, identifiers: Vec<&str>) -> Result<Vec<u32>> {
println!(
"Connection<{}>::request_handles({}, {:?})",
self.id(),
handle_type,
identifiers
);
match handle_type {
crate::padfoot::HANDLE_TYPE_CONTACT => {
let ctx = &self.ctx;
let mut out = Vec::<u32>::new();
// Identifiers is a list of email addresses. These can be
// contact IDs, although we may have to create contacts to get
// the ID.
//
// FIXME: will it be faster to get all and filter?
for addr in identifiers {
let id = block_on(Contact::lookup_id_by_addr(
ctx,
addr,
dc::contact::Origin::Unknown,
));
match id {
0 => {
// No contact exists for this address yet. Try to
// add one so we can have an ID.
match block_on(Contact::create(ctx, &addr, &addr)) {
Ok(new_id) => out.push(new_id),
Err(e) => {
println!("Failed to add contact {}: {}", addr, e);
return Err(MethodErr::no_arg());
}
}
}
_ => out.push(id),
}
}
Ok(out)
}
_ => Err(MethodErr::no_arg()), // FIXME: should be NotImplemented?
}
}
fn add_client_interest(&self, tokens: Vec<&str>) -> Result<()> {
println!(
"Connection<{}>::add_client_interest({:?})",
self.id(),
tokens
);
Err(MethodErr::no_arg()) // FIXME: should be NotImplemented?
}
fn remove_client_interest(&self, tokens: Vec<&str>) -> Result<()> {
println!(
"Connection<{}>::remove_client_interest({:?})",
self.id(),
tokens
);
Err(MethodErr::no_arg()) // FIXME: should be NotImplemented?
}
fn self_id(&self) -> Result<String> {
println!("Connection<{}>::self_id()", self.id());
let contact = match block_on(dc::contact::Contact::get_by_id(
&self.ctx,
dc::constants::DC_CONTACT_ID_SELF,
)) {
Ok(c) => c,
Err(e) => {
println!(" err: {}", e);
return Err(MethodErr::no_arg());
}
};
Ok(contact.get_addr().to_string())
}
fn has_immortal_handles(&self) -> Result<bool> {
println!("Connection<{}>::has_immortal_handles()", self.id());
Ok(true)
}
}

View File

@@ -1,129 +0,0 @@
use crate::padfoot::VarArg;
use crate::telepathy;
use async_std::task::block_on;
use dbus::tree::MethodErr;
use dc::constants::DC_GCL_ADD_SELF;
use dc::contact::Contact;
use deltachat as dc;
use std::collections::HashMap;
use std::convert::TryInto;
use telepathy::ConnectionInterfaceContacts; // for get_contact_attributes
use super::Connection;
impl AsRef<dyn telepathy::ConnectionInterfaceContactList + 'static> for std::rc::Rc<Connection> {
fn as_ref(&self) -> &(dyn telepathy::ConnectionInterfaceContactList + 'static) {
&**self
}
}
// FIXME: come back and do this properly later
impl telepathy::ConnectionInterfaceContactList for Connection {
fn get_contact_list_attributes(
&self,
interfaces: Vec<&str>,
hold: bool,
) -> Result<HashMap<u32, HashMap<String, VarArg>>, MethodErr> {
println!(
"Connection<{}>::get_contact_list_attributes({:?}, {})",
self.id(),
interfaces,
hold
);
let ids = match block_on(Contact::get_all(
&self.ctx,
DC_GCL_ADD_SELF.try_into().unwrap(),
None::<String>,
)) {
Ok(c) => c,
Err(e) => {
println!(" err: {}", e);
return Err(MethodErr::no_arg());
}
};
// FIXME: swap implementations so Contacts depends on ContactList?
self.get_contact_attributes(ids, vec![], true)
}
fn request_subscription(&self, contacts: Vec<u32>, message: &str) -> Result<(), MethodErr> {
println!(
"Connection<{}>::request_subscription({:?}, {})",
self.id(),
contacts,
message
);
Ok(())
}
fn authorize_publication(&self, contacts: Vec<u32>) -> Result<(), MethodErr> {
println!(
"Connection<{}>::authorize_publication({:?})",
self.id(),
contacts
);
Ok(())
}
fn remove_contacts(&self, contacts: Vec<u32>) -> Result<(), MethodErr> {
println!("Connection<{}>::remove_contacts({:?})", self.id(), contacts);
for contact_id in contacts {
// FIXME: don't ignore errors
if let Err(e) = block_on(Contact::delete(&self.ctx, contact_id)) {
println!(" Deleting contact {} failed: {}", contact_id, e);
}
}
// FIXME: signals MUST be emitted before this method returns
// FIXME: emitting signals at all would be great
Ok(())
}
fn unsubscribe(&self, contacts: Vec<u32>) -> Result<(), MethodErr> {
println!("Connection<{}>::unsubscribe({:?})", self.id(), contacts);
Ok(())
}
fn unpublish(&self, contacts: Vec<u32>) -> Result<(), MethodErr> {
println!("Connection<{}>::unpublish({:?})", self.id(), contacts);
Ok(())
}
fn download(&self) -> Result<(), MethodErr> {
println!("Connection<{}>::download()", self.id());
// This can be a no-op since we store the contacts list in delta's DB
Ok(())
}
fn contact_list_state(&self) -> Result<u32, MethodErr> {
println!("Connection<{}>::contact_list_state()", self.id());
Ok(3) // Success
}
fn contact_list_persists(&self) -> Result<bool, MethodErr> {
println!("Connection<{}>::contact_list_persists()", self.id());
Ok(true)
}
fn can_change_contact_list(&self) -> Result<bool, MethodErr> {
println!("Connection<{}>::can_change_contact_list()", self.id());
Ok(true)
}
fn request_uses_message(&self) -> Result<bool, MethodErr> {
println!("Connection<{}>::request_uses_message()", self.id());
Ok(false)
}
fn download_at_connection(&self) -> Result<bool, MethodErr> {
println!("Connection<{}>::download_at_connection()", self.id());
// TODO: https://telepathy.freedesktop.org/spec/Connection_Interface_Contact_List.html#Property:DownloadAtConnection
// Connections ... SHOULD provide a corresponding parameter named
// org.freedesktop.Telepathy.Connection.Interface.ContactList.DownloadAtConnection
// with the DBus_Property flag
Ok(true)
}
}

View File

@@ -1,108 +0,0 @@
use crate::padfoot::{var_str, var_u32, VarArg};
use crate::telepathy;
use async_std::task::block_on;
use dbus::tree::MethodErr;
use deltachat::contact::{Contact, Origin};
use std::collections::HashMap;
use super::Connection;
impl AsRef<dyn telepathy::ConnectionInterfaceContacts + 'static> for std::rc::Rc<Connection> {
fn as_ref(&self) -> &(dyn telepathy::ConnectionInterfaceContacts + 'static) {
&**self
}
}
impl telepathy::ConnectionInterfaceContacts for Connection {
fn get_contact_attributes(
&self,
handles: Vec<u32>,
interfaces: Vec<&str>,
hold: bool,
) -> Result<HashMap<u32, HashMap<String, VarArg>>, MethodErr> {
println!(
"Connection<{}>::get_contact_attributes({:?}, {:?}, {})",
self.id(),
handles,
interfaces,
hold
);
let mut out = HashMap::<u32, HashMap<String, VarArg>>::new();
for id in handles.iter() {
// FIXME: work out how to use get_all
let contact = match block_on(Contact::get_by_id(&self.ctx, *id)) {
Ok(c) => c,
Err(_e) => continue, // Invalid IDs are silently ignored
};
let mut props = HashMap::<String, VarArg>::new();
// This is mandatory
props.insert(
"org.freedesktop.Telepathy.Connection/contact-id".to_string(),
var_str(contact.get_addr().to_string()),
);
// The empty string means "no avatar"
props.insert(
"org.freedesktop.Telepathy.Connection.Interface.Avatars/token".to_string(),
var_str("".to_string()),
);
props.insert(
"org.freedesktop.Telepathy.Connection.Interface.ContactList/publish".to_string(),
var_u32(4), // YES (faking it for now)
);
props.insert(
"org.freedesktop.Telepathy.Connection.Interface.ContactList/subscribe".to_string(),
var_u32(4), // YES (faking it for now)
);
out.insert(*id, props);
}
Ok(out)
}
fn get_contact_by_id(
&self,
identifier: &str,
interfaces: Vec<&str>,
) -> Result<(u32, HashMap<String, VarArg>), MethodErr> {
println!(
"Connection<{}>::get_contact_by_id({}, {:?})",
self.id(),
identifier,
interfaces
);
let id = block_on(Contact::lookup_id_by_addr(
&self.ctx,
identifier,
Origin::Unknown,
));
if id == 0 {
return Err(MethodErr::no_arg()); // FIXME: should be InvalidHandle
};
let mut contacts = self.get_contact_attributes(vec![id], interfaces, true)?;
if let Some(contact) = contacts.remove(&id) {
Ok((id, contact))
} else {
Err(MethodErr::no_arg()) // FIXME: should be InvalidHandle
}
}
fn contact_attribute_interfaces(&self) -> Result<Vec<String>, MethodErr> {
println!("Connection<{}>::contact_attribute_interfaces()", self.id());
Ok(vec![
"org.freedesktop.Telepathy.Connection".to_string(),
"org.freedesktop.Telepathy.Connection.Interface.Avatars".to_string(),
"org.freedesktop.Telepathy.Connection.Interface.ContactList".to_string(),
])
}
}

View File

@@ -1,52 +0,0 @@
fn escape_one(b: u8) -> String {
format!("_{:0<2x}", b)
}
// Some non-empty sequence of ASCII letters, digits and underscores
pub fn escape(s: String) -> String {
// Special-case the empty string
if s.is_empty() {
return "_".to_string();
}
let bytes = s.into_bytes();
let mut iter = bytes.iter();
let mut out = String::new();
// Only alphanumeric in the first byte
let x = *iter.next().expect("Already checked len > 0");
let first = match x {
b'a'..=b'z' | b'A'..=b'Z' => unsafe { String::from_utf8_unchecked(vec![x]) },
_ => escape_one(x),
};
out.push_str(&first);
for x in iter {
let next = match x {
b'a'..=b'z' | b'A'..=b'Z' | b'0'..=b'9' => unsafe {
String::from_utf8_unchecked(vec![*x])
},
_ => escape_one(*x),
};
out.push_str(&next);
}
out
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_escape() {
assert_eq!(escape("".to_string()), "_");
assert_eq!(escape("foo".to_string()), "foo");
assert_eq!(escape("foo@bar".to_string()), "foo_40bar");
assert_eq!(escape("foo_bar".to_string()), "foo_5fbar");
assert_eq!(escape("foo__@__bar".to_string()), "foo_5f_5f_40_5f_5fbar");
assert_eq!(escape("1foo".to_string()), "_31foo");
}
}

View File

@@ -1,137 +0,0 @@
use crate::padfoot::{get_var_str, get_var_u32, requestables, Channel, DbusAction, VarArg};
use crate::telepathy;
use async_std::task::block_on;
use dbus::tree::MethodErr;
use dc::contact::Contact;
use deltachat as dc;
use std::collections::HashMap;
use super::Connection;
type ChannelSpec = (
dbus::Path<'static>, // Object path on this connection
HashMap<String, VarArg>, // Map of channel property -> value
);
type RequestableChannelSpec = (HashMap<String, VarArg>, Vec<String>);
type Result<T> = std::result::Result<T, MethodErr>;
impl AsRef<dyn telepathy::ConnectionInterfaceRequests + 'static> for std::rc::Rc<Connection> {
fn as_ref(&self) -> &(dyn telepathy::ConnectionInterfaceRequests + 'static) {
&**self
}
}
impl telepathy::ConnectionInterfaceRequests for Connection {
fn create_channel(
&self,
request: HashMap<&str, VarArg>,
) -> Result<(dbus::Path<'static>, HashMap<String, VarArg>)> {
println!("Connection<{}>::create_channel({:?})", self.id(), request);
Err(MethodErr::no_arg()) // FIXME: should be NotImplemented?
}
fn ensure_channel(
&self,
request: HashMap<&str, VarArg>,
) -> Result<(bool, dbus::Path<'static>, HashMap<String, VarArg>)> {
let path = self.path().clone();
println!("Connection<{}>::ensure_channel({:?})", self.id(), request);
// Empathy sends this for the request:
//
// {
// "org.freedesktop.Telepathy.Channel.TargetID": Variant("me@example.com"),
// "org.freedesktop.Telepathy.Channel.TargetHandleType": Variant(1),
// "org.freedesktop.Telepathy.Channel.ChannelType": Variant("org.freedesktop.Telepathy.Channel.Type.Text")
// }
// FIXME: life would be easier with TargetHandle
let target_id = request
.get("org.freedesktop.Telepathy.Channel.TargetID")
.map(|va| get_var_str(va))
.unwrap();
let target_handle_type = request
.get("org.freedesktop.Telepathy.Channel.TargetHandleType")
.map(|va| get_var_u32(va))
.unwrap();
let channel_type = request
.get("org.freedesktop.Telepathy.Channel.ChannelType")
.map(|va| get_var_str(va))
.unwrap();
// Text only
if channel_type != "org.freedesktop.Telepathy.Channel.Type.Text" {
println!(" Wrong channel type: {:?}", channel_type);
return Err(MethodErr::no_arg());
};
// IMs only
if target_handle_type != 1 {
println!(" Wrong target handle type: {:?}", target_handle_type);
return Err(MethodErr::no_arg());
};
let target_handle = block_on(Contact::lookup_id_by_addr(
&self.ctx,
target_id.clone(),
dc::contact::Origin::Unknown,
));
if target_handle == 0 {
println!("Couldn't find target handle for {}", target_id);
return Err(MethodErr::no_arg());
};
let chat_id = dc::chat::ChatId::new(target_handle);
let channel_path = Connection::build_channel_path(path, chat_id);
// Return an existing channel if it already exists
let chans = self.channels.read().unwrap();
if let Some(channel) = chans.get(&channel_path) {
return Ok((false, channel_path, channel.chan_props()));
}
// Now we need to discover or create a chat id for the contact
let chat_id = block_on(dc::chat::create_by_contact_id(&self.ctx, target_handle)).unwrap();
let channel = Channel::new(
self.actq.clone(),
chat_id,
self.ctx.clone(),
dc::constants::DC_CONTACT_ID_SELF, // initiator is self in this case
channel_path.clone(),
true, // requested
target_handle,
);
let response = channel.chan_props(); // FIXME: fill with data about the channel
// Send signal
self.actq.send(DbusAction::NewChannel(channel)).unwrap();
Ok((true, channel_path, response))
}
fn channels(&self) -> Result<Vec<ChannelSpec>> {
println!("Connection<{}>::channels()", self.id());
let mut out = Vec::<ChannelSpec>::new();
for channel in self.channels.read().unwrap().values() {
out.push((
channel.path(),
HashMap::<String, VarArg>::new(), // FIXME: work out what props should be shown
));
}
Ok(out)
}
fn requestable_channel_classes(&self) -> Result<Vec<RequestableChannelSpec>> {
println!("Connection<{}>::requestable_channel_classes()", self.id());
Ok(requestables())
}
}

View File

@@ -1,60 +0,0 @@
use crate::padfoot::{statuses, SimpleStatusSpec};
use crate::telepathy;
use dbus::tree::MethodErr;
use std::collections::HashMap;
use super::Connection;
pub type SimplePresenceSpec = (
u32, // connection presence type
String, // status
String, // status message
);
impl AsRef<dyn telepathy::ConnectionInterfaceSimplePresence + 'static> for std::rc::Rc<Connection> {
fn as_ref(&self) -> &(dyn telepathy::ConnectionInterfaceSimplePresence + 'static) {
&**self
}
}
impl telepathy::ConnectionInterfaceSimplePresence for Connection {
fn set_presence(&self, status: &str, status_message: &str) -> Result<(), MethodErr> {
println!(
"Connection<{}>::set_presence({}, {:?})",
self.id(),
status,
status_message
);
// FIXME: emit a presence changed signal
Ok(())
}
fn get_presences(
&self,
contacts: Vec<u32>,
) -> Result<HashMap<u32, SimplePresenceSpec>, MethodErr> {
println!("Connection<{}>::get_presences({:?})", self.id(), contacts);
let mut out = HashMap::<u32, SimplePresenceSpec>::new();
for id in contacts {
out.insert(id, (2, "available".to_string(), "".to_string())); // Available
}
Ok(out)
}
fn statuses(&self) -> Result<HashMap<String, SimpleStatusSpec>, MethodErr> {
println!("Connection<{}>::statuses()", self.id());
Ok(statuses())
}
fn maximum_status_message_length(&self) -> Result<u32, MethodErr> {
println!("Connection<{}>::maximum_status_message_length()", self.id());
Ok(0)
}
}

View File

@@ -1,180 +0,0 @@
use crate::padfoot::{var_arg, var_str, var_str_vec, VarArg};
use crate::telepathy;
use dbus::message::SignalArgs;
use dbus::tree::MethodErr;
use std::collections::{HashMap, HashSet};
use std::sync::{mpsc, Arc, Mutex};
use super::{ConnSettings, Connection};
pub const CM_BUS_NAME: &str = "org.freedesktop.Telepathy.ConnectionManager.padfoot";
pub const CM_CONN_BUS_NAME: &str = "org.freedesktop.Telepathy.Connection.padfoot";
pub const CM_OBJECT_PATH: &str = "/org/freedesktop/Telepathy/ConnectionManager/padfoot";
#[derive(Debug)]
pub struct ConnectionManager {
conns: Arc<Mutex<HashSet<dbus::Path<'static>>>>,
sender: mpsc::Sender<dbus::Message>,
}
impl AsRef<dyn telepathy::ConnectionManager + 'static> for std::rc::Rc<ConnectionManager> {
fn as_ref(&self) -> &(dyn telepathy::ConnectionManager + 'static) {
&**self
}
}
impl ConnectionManager {
pub fn new() -> (Self, mpsc::Receiver<dbus::Message>) {
let (msg_s, msg_r) = mpsc::channel::<dbus::Message>();
(
ConnectionManager {
conns: Arc::new(Mutex::new(HashSet::<dbus::Path<'static>>::new())),
sender: msg_s,
},
msg_r,
)
}
fn create_connection(
&self,
settings: ConnSettings,
) -> Result<(String, dbus::Path<'static>), MethodErr> {
let bus = settings.bus();
let path = settings.path();
let mut conns = self.conns.lock().expect("Mutex access");
// We can't call connect() multiple times on the connection yet
if conns.contains(&path) {
return Err(MethodErr::no_arg());
}
// It would be nice to have a single main loop, but thread-per-conn is
// is easy enough for me to understand in Rust at the moment.
let conns_clone = self.conns.clone();
let (ok_s, ok_r) = mpsc::channel();
std::thread::spawn(move || {
let (conn, receiver) = Connection::new(settings, conns_clone).unwrap();
conn.run(ok_s, receiver);
});
// Emit a NewConnection signal for the benefit of others, but the caller
// learns from our RPC response
let sig = telepathy::ConnectionManagerNewConnection {
bus_name: bus.to_owned(),
object_path: path.clone(),
protocol: super::PROTO_NAME.to_string(),
};
// We must wait for the new name to appear on the bus, otherwise the
// client can race
if let Ok(opt) = ok_r.recv() {
if let Some(e) = opt {
return Err(e);
}
// Otherwise OK
} else {
return Err(MethodErr::no_arg());
}
conns.insert(path.clone());
let dbus_cm_path = dbus::strings::Path::new(CM_OBJECT_PATH.to_string())
.expect("Object path should meet DBUS requirements");
self.sender
.send(sig.to_emit_message(&dbus_cm_path))
.expect("send signal");
// The bus name *must* be org.freedesktop.Telepathy.Connection.padfoot.delta.<name>
Ok((bus, path))
}
}
impl telepathy::ConnectionManager for ConnectionManager {
fn get_parameters(&self, protocol: &str) -> Result<Vec<super::ParamSpec>, MethodErr> {
println!("CM::get_parameters({})", protocol);
match protocol {
super::PROTO_NAME => Ok(super::parameters()),
_ => Err(MethodErr::no_arg()), // FIXME: should be NotImplemented?
}
}
fn list_protocols(&self) -> Result<Vec<String>, MethodErr> {
println!("CM::list_protocols()");
Ok(vec![super::PROTO_NAME.to_string()])
}
fn request_connection(
&self,
protocol: &str,
params: HashMap<&str, VarArg>,
) -> Result<(String, dbus::Path<'static>), MethodErr> {
println!("CM::request_connection({}, ...)", protocol);
match protocol {
super::PROTO_NAME => self.create_connection(super::ConnSettings::from_params(params)?),
_ => Err(MethodErr::no_arg()), // FIXME: should be NotImplemented?
}
}
fn protocols(&self) -> Result<HashMap<String, HashMap<String, VarArg>>, MethodErr> {
println!("CM::protocols()");
// FIXME: so much duplication. It would be good if we could get the
// properties from the Protocol instead
let mut out = HashMap::<String, HashMap<String, VarArg>>::new();
let mut props = HashMap::<String, VarArg>::new();
props.insert(
"org.freedesktop.Telepathy.Protocol.AuthenticationTypes".to_string(),
var_str_vec(vec![
"org.freedesktop.Telepathy.Channel.Type.ServerTLSConnection".to_string(),
]),
);
props.insert(
"org.freedesktop.Telepathy.Protocol.ConnectionInterfaces".to_string(),
var_str_vec(super::connection_interfaces()),
);
props.insert(
"org.freedesktop.Telepathy.Protocol.EnglishName".to_string(),
var_str("Delta Chat".to_string()),
);
props.insert(
"org.freedesktop.Telepathy.Protocol.Icon".to_string(),
var_str("im-delta".to_string()),
);
props.insert(
"org.freedesktop.Telepathy.Protocol.Interfaces".to_string(),
var_str_vec(super::protocol_interfaces()),
);
props.insert(
"org.freedesktop.Telepathy.Protocol.Parameters".to_string(),
var_arg(Box::new(super::parameters())),
);
props.insert(
"org.freedesktop.Telepathy.Protocol.RequestableChannelClasses".to_string(),
var_arg(Box::new(super::requestables())),
);
props.insert(
"org.freedesktop.Telepathy.Protocol.VCardField".to_string(),
var_str("email".to_string()),
);
out.insert(super::PROTO_NAME.to_string(), props);
Ok(out)
}
fn interfaces(&self) -> Result<Vec<String>, MethodErr> {
println!("CM::interfaces()");
Ok(vec![])
}
}

View File

@@ -1,138 +0,0 @@
use crate::padfoot::{var_bytearray, var_i64, var_str, var_u32, VarArg};
use async_std::path::{Path, PathBuf};
use dc::constants::Viewtype as Vt;
use dc::message::Message;
use deltachat as dc;
use std::collections::HashMap;
type Part = HashMap<String, VarArg>;
type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>;
// Turns a deltachat::message::Message into a Telepathy Message_Part_List
pub fn convert_msg(blobdir: &Path, msg: &Message) -> Result<Vec<Part>> {
if msg.is_setupmessage() {
return Ok(convert_setupmessage(msg));
}
let mut parts = vec![make_props(msg)];
// TODO: Check. Can a deltachat message have multiple parts? Can an image
// viewtype have text as well?
let result = match msg.get_viewtype() {
Vt::Text => build_txt(msg),
Vt::Unknown => build_unknown(msg),
Vt::Audio | Vt::Voice => build_snd(msg),
Vt::Video => build_vid(msg),
_ => build_attachment(blobdir, msg),
};
result.map(|mut more| {
parts.append(&mut more);
parts
})
}
fn convert_setupmessage(msg: &Message) -> Vec<Part> {
let msg_id = msg.get_id();
vec![
make_props(msg),
make_plain(&format!("Setup message received. To apply it, reply with:\nIMEX: {} nnnn-nnnn-nnnn-nnnn-nnnn-nnnn-nnnn-nnnn-nnnn\nNo whitespace in the setup-code!", msg_id.to_u32())),
]
}
fn make_props(msg: &Message) -> Part {
let msg_id = msg.get_id();
let mut out = HashMap::new();
out.insert(
"message-token".to_string(),
var_str(format!("{}", msg_id.to_u32())),
);
out.insert("message-sent".to_string(), var_i64(msg.get_timestamp()));
out.insert(
"message-received".to_string(),
var_i64(msg.get_received_timestamp()),
);
out.insert("message-sender".to_string(), var_u32(msg.get_from_id()));
// props.insert("message-sender-id", var_str()); // This doesn't need to be sent
// props.insert("sender-nickname", var_str()); // Can we get away without this one?
out.insert("message-type".to_string(), var_u32(0)); // normal
// These relate to superseded messages
// props.insert("supersedes", var_str());
// props.insert("original-message-sent", var_i64());
// props.insert("original-message-received", var_i64());
out.insert("pending-message-id".to_string(), var_u32(msg_id.to_u32()));
// Don't need these
// props.insert("interface", var_str());
// props.insert("scrollback", var_vool());
// props.insert("silent", var_bool());
// props.insert("rescued", var_bool());
out
}
fn make_plain(text: &str) -> Part {
make_content("text/plain", None, var_str(text.to_string()))
}
fn make_content(type_: &str, id: Option<&str>, content: VarArg) -> Part {
let mut out = HashMap::new();
out.insert("content-type".to_string(), var_str(type_.to_string()));
out.insert("content".to_string(), content);
id.map(|txt| out.insert("identifier".to_string(), var_str(txt.to_string())));
out
}
fn build_snd(_msg: &Message) -> Result<Vec<Part>> {
Ok(vec![make_plain("(a sound file was received)")])
}
fn build_txt(msg: &Message) -> Result<Vec<Part>> {
Ok(vec![make_plain(
&msg.get_text().unwrap_or_else(|| "".to_string()),
)])
}
fn build_unknown(_msg: &Message) -> Result<Vec<Part>> {
Ok(vec![make_plain("(a message of unknown type was received)")])
}
fn build_vid(_msg: &Message) -> Result<Vec<Part>> {
Ok(vec![make_plain("(a video was received)")])
}
// The message contains a file. Detect the content-type and construct a part
// containing the data in full.
fn build_attachment(blobdir: &Path, msg: &Message) -> Result<Vec<Part>> {
let mime = msg
.get_filemime()
.unwrap_or_else(|| "application/octet-stream".to_string());
let filename = msg.get_filename().ok_or("Failed to get filename")?;
let path: PathBuf = [blobdir, &Path::new(&filename)].iter().collect();
let data =
std::fs::read(&path).map_err(|e| format!("Failed to read file {:?}: {}", path, e))?;
println!("MIME type for attachment: {}", mime);
let html = make_content(
"text/html",
None,
var_str("<img src=\"cid:picture\" />".to_string()),
);
let txt = make_plain("(an image was sent but cannot be displayed)");
let blob = make_content(&mime, Some("picture"), var_bytearray(data));
Ok(vec![html, txt, blob])
}

View File

@@ -1,183 +0,0 @@
use crate::padfoot::{var_bool, var_str, var_u32, VarArg};
use crate::telepathy;
use dbus::tree::MethodErr;
use deltachat as dc;
use std::collections::HashMap;
use super::ConnSettings;
pub const PROTO_OBJECT_PATH: &str = "/org/freedesktop/Telepathy/ConnectionManager/padfoot/delta";
pub const PROTO_BUS_NAME: &str = "org.freedesktop.Telepathy.ConnectionManager.padfoot.delta";
pub const PROTO_NAME: &str = "delta";
#[derive(Debug)]
pub struct Protocol {}
pub type ParamSpec = (
String, // Name
u32, // Flags (Conn_Mgr_Param_Flags)
String, // Signature
VarArg, // Default value
);
// Requestable_Channel_Class
pub type RequestableChannelSpec = (
HashMap<String, VarArg>, // Fixed properties
Vec<String>, // Allowed properties
);
// FIXME: these should come from codegen
//const FLAG_NONE: u32 = 0;
const FLAG_REQUIRED: u32 = 1;
//const FLAG_REGISTER: u32 = 2;
//const FLAG_HAS_DEFAULT: u32 = 4;
const FLAG_SECRET: u32 = 8;
//const FLAG_DBUS_PROP: u32 = 16;
pub fn parameters() -> Vec<ParamSpec> {
vec![
(
"account".to_string(),
FLAG_REQUIRED,
"s".to_string(),
var_str("".to_string()),
),
(
"password".to_string(),
FLAG_REQUIRED | FLAG_SECRET,
"s".to_string(),
var_str("".to_string()),
),
("bcc-self".to_string(), 0, "b".to_string(), var_bool(false)),
]
}
pub fn protocol_interfaces() -> Vec<String> {
vec![
"org.freedesktop.Telepathy.Protocol".to_string(),
"org.freedesktop.Telepathy.Protocol.Interface.Presence".to_string(),
]
}
pub fn requestables() -> Vec<RequestableChannelSpec> {
let mut rf = HashMap::<String, VarArg>::new();
rf.insert(
"org.freedesktop.Telepathy.Channel.ChannelType".to_string(),
var_str("org.freedesktop.Telepathy.Channel.Type.Text".to_string()),
);
rf.insert(
"org.freedesktop.Telepathy.Channel.TargetHandleType".to_string(),
var_u32(1),
);
let ra = vec![
"org.freedesktop.Telepathy.Channel.TargetHandle".to_string(),
"org.freedesktop.Telepathy.Channel.TargetID".to_string(),
];
vec![(rf, ra)]
}
impl AsRef<dyn telepathy::Protocol + 'static> for std::rc::Rc<Protocol> {
fn as_ref(&self) -> &(dyn telepathy::Protocol + 'static) {
&**self
}
}
impl telepathy::Protocol for Protocol {
fn identify_account(&self, params: HashMap<&str, VarArg>) -> Result<String, MethodErr> {
println!("Protocol::identify_account(...)");
let settings = ConnSettings::from_params(params)?;
Ok(settings.id())
}
fn normalize_contact(&self, contact_id: &str) -> Result<String, MethodErr> {
println!("Protocol::normalize_contact({})", contact_id);
Ok(dc::contact::addr_normalize(contact_id).to_string())
}
fn interfaces(&self) -> Result<Vec<String>, MethodErr> {
println!("Protocol::interfaces()");
Ok(protocol_interfaces())
}
fn parameters(&self) -> Result<Vec<ParamSpec>, MethodErr> {
println!("Protocol::parameters()");
Ok(parameters())
}
fn connection_interfaces(&self) -> Result<Vec<String>, MethodErr> {
println!("Protocol::connection_interfaces()");
Ok(super::connection_interfaces())
}
fn requestable_channel_classes(&self) -> Result<Vec<RequestableChannelSpec>, MethodErr> {
println!("Protocol::requestable_channel_classes()");
Ok(requestables())
}
fn vcard_field(&self) -> Result<String, MethodErr> {
println!("Protocol::vcard_field()");
Ok("email".to_string())
}
fn english_name(&self) -> Result<String, MethodErr> {
println!("Protocol::english_name()");
Ok("Delta Chat".to_string())
}
fn icon(&self) -> Result<String, MethodErr> {
println!("Protocol::icon()");
Ok("im-delta".to_string())
}
fn authentication_types(&self) -> Result<Vec<String>, MethodErr> {
println!("Protocol::authentication_types()");
Ok(vec![
"org.freedesktop.Telepathy.Channel.Type.ServerTLSConnection".to_string(),
])
}
}
pub type SimpleStatusSpec = (
u32, // connection presence type
bool, // may set on self?
bool, // can have message?
);
pub fn statuses() -> HashMap<String, SimpleStatusSpec> {
let mut out = HashMap::<String, SimpleStatusSpec>::new();
out.insert("available".to_string(), (2, true, false));
out.insert("offline".to_string(), (1, true, false));
out
}
impl AsRef<dyn telepathy::ProtocolInterfacePresence + 'static> for std::rc::Rc<Protocol> {
fn as_ref(&self) -> &(dyn telepathy::ProtocolInterfacePresence + 'static) {
&**self
}
}
impl telepathy::ProtocolInterfacePresence for Protocol {
fn statuses(&self) -> Result<HashMap<String, SimpleStatusSpec>, MethodErr> {
println!("Protocol::presences()");
Ok(statuses())
}
}

View File

@@ -1,41 +0,0 @@
use dbus::arg::{RefArg, Variant};
use std::convert::TryInto;
pub type VarArg = Variant<Box<dyn RefArg + 'static>>;
pub fn var_arg(item: Box<dyn RefArg + 'static>) -> VarArg {
Variant(item)
}
pub fn var_str(item: String) -> VarArg {
var_arg(Box::new(item))
}
pub fn var_str_vec(item: Vec<String>) -> VarArg {
var_arg(Box::new(item))
}
pub fn var_bool(item: bool) -> VarArg {
var_arg(Box::new(item))
}
pub fn var_bytearray(item: std::vec::Vec<u8>) -> VarArg {
var_arg(Box::new(item))
}
pub fn var_u32(item: u32) -> VarArg {
var_arg(Box::new(item))
}
pub fn var_i64(item: i64) -> VarArg {
var_arg(Box::new(item))
}
pub fn get_var_str(from: &VarArg) -> String {
from.0.as_str().unwrap().to_string()
}
pub fn get_var_u32(from: &VarArg) -> u32 {
from.0.as_u64().unwrap().try_into().unwrap()
}

View File

@@ -1,485 +1,365 @@
#![allow(unused)]
#![allow(clippy::all)]
#[allow(clippy::all)]
mod account_interface_addressing;
pub use self::account_interface_addressing::*;
#[allow(clippy::all)]
mod account_interface_avatar;
pub use self::account_interface_avatar::*;
#[allow(clippy::all)]
mod account_interface_external_password_storage;
pub use self::account_interface_external_password_storage::*;
#[allow(clippy::all)]
mod account_interface_hidden;
pub use self::account_interface_hidden::*;
#[allow(clippy::all)]
mod account_interface_storage;
pub use self::account_interface_storage::*;
#[allow(clippy::all)]
mod account_manager_interface_hidden;
pub use self::account_manager_interface_hidden::*;
#[allow(clippy::all)]
mod account_manager;
pub use self::account_manager::*;
#[allow(clippy::all)]
mod account;
pub use self::account::*;
#[allow(clippy::all)]
mod all;
pub use self::all::*;
#[allow(clippy::all)]
mod authentication_tls_certificate;
pub use self::authentication_tls_certificate::*;
#[allow(clippy::all)]
mod call_content_interface_audio_control;
pub use self::call_content_interface_audio_control::*;
#[allow(clippy::all)]
mod call_content_interface_dtmf;
pub use self::call_content_interface_dtmf::*;
#[allow(clippy::all)]
mod call_content_interface_media;
pub use self::call_content_interface_media::*;
#[allow(clippy::all)]
mod call_content_interface_video_control;
pub use self::call_content_interface_video_control::*;
#[allow(clippy::all)]
mod call_content_media_description_interface_rtcp_extended_reports;
pub use self::call_content_media_description_interface_rtcp_extended_reports::*;
#[allow(clippy::all)]
mod call_content_media_description_interface_rtcp_feedback;
pub use self::call_content_media_description_interface_rtcp_feedback::*;
#[allow(clippy::all)]
mod call_content_media_description_interface_rtp_header_extensions;
pub use self::call_content_media_description_interface_rtp_header_extensions::*;
#[allow(clippy::all)]
mod call_content_media_description;
pub use self::call_content_media_description::*;
#[allow(clippy::all)]
mod call_content;
pub use self::call_content::*;
#[allow(clippy::all)]
mod call_interface_mute;
pub use self::call_interface_mute::*;
#[allow(clippy::all)]
mod call_stream_endpoint;
pub use self::call_stream_endpoint::*;
#[allow(clippy::all)]
mod call_stream_interface_media;
pub use self::call_stream_interface_media::*;
#[allow(clippy::all)]
mod call_stream;
pub use self::call_stream::*;
#[allow(clippy::all)]
mod channel_bundle;
pub use self::channel_bundle::*;
#[allow(clippy::all)]
mod channel_dispatcher_interface_messages1;
pub use self::channel_dispatcher_interface_messages1::*;
#[allow(clippy::all)]
mod channel_dispatcher_interface_operation_list;
pub use self::channel_dispatcher_interface_operation_list::*;
#[allow(clippy::all)]
mod channel_dispatcher;
pub use self::channel_dispatcher::*;
#[allow(clippy::all)]
mod channel_dispatch_operation;
pub use self::channel_dispatch_operation::*;
#[allow(clippy::all)]
mod channel_future;
pub use self::channel_future::*;
#[allow(clippy::all)]
mod channel_handler;
pub use self::channel_handler::*;
#[allow(clippy::all)]
mod channel_interface_addressing;
pub use self::channel_interface_addressing::*;
#[allow(clippy::all)]
mod channel_interface_anonymity;
pub use self::channel_interface_anonymity::*;
#[allow(clippy::all)]
mod channel_interface_call_state;
pub use self::channel_interface_call_state::*;
#[allow(clippy::all)]
mod channel_interface_captcha_authentication;
pub use self::channel_interface_captcha_authentication::*;
#[allow(clippy::all)]
mod channel_interface_chat_state;
pub use self::channel_interface_chat_state::*;
#[allow(clippy::all)]
mod channel_interface_conference;
pub use self::channel_interface_conference::*;
#[allow(clippy::all)]
mod channel_interface_credentials_storage;
pub use self::channel_interface_credentials_storage::*;
#[allow(clippy::all)]
mod channel_interface_destroyable;
pub use self::channel_interface_destroyable::*;
#[allow(clippy::all)]
mod channel_interface_dtmf;
pub use self::channel_interface_dtmf::*;
#[allow(clippy::all)]
mod channel_interface_file_transfer_metadata;
pub use self::channel_interface_file_transfer_metadata::*;
#[allow(clippy::all)]
mod channel_interface_group;
pub use self::channel_interface_group::*;
#[allow(clippy::all)]
mod channel_interface_hold;
pub use self::channel_interface_hold::*;
#[allow(clippy::all)]
mod channel_interface_html;
pub use self::channel_interface_html::*;
#[allow(clippy::all)]
mod channel_interface_media_signalling;
pub use self::channel_interface_media_signalling::*;
#[allow(clippy::all)]
mod channel_interface_mergeable_conference;
pub use self::channel_interface_mergeable_conference::*;
#[allow(clippy::all)]
mod channel_interface_messages;
pub use self::channel_interface_messages::*;
#[allow(clippy::all)]
mod channel_interface_password;
pub use self::channel_interface_password::*;
#[allow(clippy::all)]
mod channel_interface_picture;
pub use self::channel_interface_picture::*;
#[allow(clippy::all)]
mod channel_interface_room_config;
pub use self::channel_interface_room_config::*;
#[allow(clippy::all)]
mod channel_interface_room;
pub use self::channel_interface_room::*;
#[allow(clippy::all)]
mod channel_interface_sasl_authentication;
pub use self::channel_interface_sasl_authentication::*;
#[allow(clippy::all)]
mod channel_interface_securable;
pub use self::channel_interface_securable::*;
#[allow(clippy::all)]
mod channel_interface_service_point;
pub use self::channel_interface_service_point::*;
#[allow(clippy::all)]
mod channel_interface_sms;
pub use self::channel_interface_sms::*;
#[allow(clippy::all)]
mod channel_interface_splittable;
pub use self::channel_interface_splittable::*;
#[allow(clippy::all)]
mod channel_interface_subject;
pub use self::channel_interface_subject::*;
#[allow(clippy::all)]
mod channel_interface_transfer;
pub use self::channel_interface_transfer::*;
#[allow(clippy::all)]
mod channel_interface_tube;
pub use self::channel_interface_tube::*;
#[allow(clippy::all)]
mod channel_request;
pub use self::channel_request::*;
#[allow(clippy::all)]
mod channel_type_call;
pub use self::channel_type_call::*;
#[allow(clippy::all)]
mod channel_type_contact_list;
pub use self::channel_type_contact_list::*;
#[allow(clippy::all)]
mod channel_type_contact_search;
pub use self::channel_type_contact_search::*;
#[allow(clippy::all)]
mod channel_type_dbus_tube;
pub use self::channel_type_dbus_tube::*;
#[allow(clippy::all)]
mod channel_type_file_transfer;
pub use self::channel_type_file_transfer::*;
#[allow(clippy::all)]
mod channel_type_room_list;
pub use self::channel_type_room_list::*;
#[allow(clippy::all)]
mod channel_type_server_authentication;
pub use self::channel_type_server_authentication::*;
#[allow(clippy::all)]
mod channel_type_server_tls_connection;
pub use self::channel_type_server_tls_connection::*;
#[allow(clippy::all)]
mod channel_type_streamed_media;
pub use self::channel_type_streamed_media::*;
#[allow(clippy::all)]
mod channel_type_stream_tube;
pub use self::channel_type_stream_tube::*;
#[allow(clippy::all)]
mod channel_type_text;
pub use self::channel_type_text::*;
#[allow(clippy::all)]
mod channel_type_tubes;
pub use self::channel_type_tubes::*;
#[allow(clippy::all)]
mod channel;
pub use self::channel::*;
#[allow(clippy::all)]
mod client_approver;
pub use self::client_approver::*;
#[allow(clippy::all)]
mod client_handler_future;
pub use self::client_handler_future::*;
#[allow(clippy::all)]
mod client_handler;
pub use self::client_handler::*;
#[allow(clippy::all)]
mod client_interface_requests;
pub use self::client_interface_requests::*;
#[allow(clippy::all)]
mod client_observer;
pub use self::client_observer::*;
#[allow(clippy::all)]
mod client;
pub use self::client::*;
#[allow(clippy::all)]
mod connection_interface_addressing;
pub use self::connection_interface_addressing::*;
#[allow(clippy::all)]
mod connection_interface_aliasing;
pub use self::connection_interface_aliasing::*;
#[allow(clippy::all)]
mod connection_interface_anonymity;
pub use self::connection_interface_anonymity::*;
#[allow(clippy::all)]
mod connection_interface_avatars;
pub use self::connection_interface_avatars::*;
#[allow(clippy::all)]
mod connection_interface_balance;
pub use self::connection_interface_balance::*;
#[allow(clippy::all)]
mod connection_interface_capabilities;
pub use self::connection_interface_capabilities::*;
#[allow(clippy::all)]
mod connection_interface_cellular;
pub use self::connection_interface_cellular::*;
#[allow(clippy::all)]
mod connection_interface_client_types;
pub use self::connection_interface_client_types::*;
#[allow(clippy::all)]
mod connection_interface_communication_policy;
pub use self::connection_interface_communication_policy::*;
#[allow(clippy::all)]
mod connection_interface_contact_blocking;
pub use self::connection_interface_contact_blocking::*;
#[allow(clippy::all)]
mod connection_interface_contact_capabilities;
pub use self::connection_interface_contact_capabilities::*;
#[allow(clippy::all)]
mod connection_interface_contact_groups;
pub use self::connection_interface_contact_groups::*;
#[allow(clippy::all)]
mod connection_interface_contact_info;
pub use self::connection_interface_contact_info::*;
#[allow(clippy::all)]
mod connection_interface_contact_list;
pub use self::connection_interface_contact_list::*;
#[allow(clippy::all)]
mod connection_interface_contacts;
pub use self::connection_interface_contacts::*;
#[allow(clippy::all)]
mod connection_interface_forwarding;
pub use self::connection_interface_forwarding::*;
#[allow(clippy::all)]
mod connection_interface_irc_command1;
pub use self::connection_interface_irc_command1::*;
#[allow(clippy::all)]
mod connection_interface_keepalive;
pub use self::connection_interface_keepalive::*;
#[allow(clippy::all)]
mod connection_interface_location;
pub use self::connection_interface_location::*;
#[allow(clippy::all)]
mod connection_interface_mail_notification;
pub use self::connection_interface_mail_notification::*;
#[allow(clippy::all)]
mod connection_interface_power_saving;
pub use self::connection_interface_power_saving::*;
#[allow(clippy::all)]
mod connection_interface_presence;
pub use self::connection_interface_presence::*;
#[allow(clippy::all)]
mod connection_interface_privacy;
pub use self::connection_interface_privacy::*;
#[allow(clippy::all)]
mod connection_interface_renaming;
pub use self::connection_interface_renaming::*;
#[allow(clippy::all)]
mod connection_interface_requests;
pub use self::connection_interface_requests::*;
#[allow(clippy::all)]
mod connection_interface_resources;
pub use self::connection_interface_resources::*;
#[allow(clippy::all)]
mod connection_interface_service_point;
pub use self::connection_interface_service_point::*;
#[allow(clippy::all)]
mod connection_interface_sidecars1;
pub use self::connection_interface_sidecars1::*;
#[allow(clippy::all)]
mod connection_interface_simple_presence;
pub use self::connection_interface_simple_presence::*;
#[allow(clippy::all)]
mod connection_manager_interface_account_storage;
pub use self::connection_manager_interface_account_storage::*;
#[allow(clippy::all)]
mod connection_manager;
pub use self::connection_manager::*;
#[allow(clippy::all)]
mod connection;
pub use self::connection::*;
#[allow(clippy::all)]
mod debug;
pub use self::debug::*;
#[allow(clippy::all)]
mod errors;
pub use self::errors::*;
#[allow(clippy::all)]
mod generic_types;
pub use self::generic_types::*;
#[allow(clippy::all)]
mod media_session_handler;
pub use self::media_session_handler::*;
#[allow(clippy::all)]
mod media_stream_handler;
pub use self::media_stream_handler::*;
#[allow(clippy::all)]
mod properties_interface;
pub use self::properties_interface::*;
#[allow(clippy::all)]
mod protocol_interface_addressing;
pub use self::protocol_interface_addressing::*;
#[allow(clippy::all)]
mod protocol_interface_avatars;
pub use self::protocol_interface_avatars::*;
#[allow(clippy::all)]
mod protocol_interface_presence;
pub use self::protocol_interface_presence::*;
#[allow(clippy::all)]
mod protocol;
pub use self::protocol::*;
#[allow(clippy::all)]
mod template;
pub use self::template::*;

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Account.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/account.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Account.xml -i org.freedesktop.Telepathy -o src/telepathy/account.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -63,15 +63,14 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn Account>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: Account,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Account", data);
let f = ::std::sync::Arc::new(f);
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.remove()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -85,8 +84,7 @@ where
let set: ::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>> =
i.read()?;
let unset: Vec<&str> = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let reconnect_required = d.update_parameters(set, unset)?;
let rm = minfo.msg.method_return();
let rm = rm.append1(reconnect_required);
@@ -100,8 +98,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.reconnect()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -114,8 +111,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.interfaces()?);
Ok(())
});
@@ -126,16 +122,14 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.display_name()?);
Ok(())
});
let fclone = f.clone();
let p = p.on_set(move |iter, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
d.set_display_name(iter.read()?)?;
Ok(())
});
@@ -146,16 +140,14 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.icon()?);
Ok(())
});
let fclone = f.clone();
let p = p.on_set(move |iter, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
d.set_icon(iter.read()?)?;
Ok(())
});
@@ -166,8 +158,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.valid()?);
Ok(())
});
@@ -178,16 +169,14 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.enabled()?);
Ok(())
});
let fclone = f.clone();
let p = p.on_set(move |iter, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
d.set_enabled(iter.read()?)?;
Ok(())
});
@@ -198,16 +187,14 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.nickname()?);
Ok(())
});
let fclone = f.clone();
let p = p.on_set(move |iter, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
d.set_nickname(iter.read()?)?;
Ok(())
});
@@ -218,16 +205,14 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.service()?);
Ok(())
});
let fclone = f.clone();
let p = p.on_set(move |iter, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
d.set_service(iter.read()?)?;
Ok(())
});
@@ -242,8 +227,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.parameters()?);
Ok(())
});
@@ -254,16 +238,14 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.automatic_presence()?);
Ok(())
});
let fclone = f.clone();
let p = p.on_set(move |iter, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
d.set_automatic_presence(iter.read()?)?;
Ok(())
});
@@ -274,16 +256,14 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.connect_automatically()?);
Ok(())
});
let fclone = f.clone();
let p = p.on_set(move |iter, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
d.set_connect_automatically(iter.read()?)?;
Ok(())
});
@@ -294,8 +274,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.connection()?);
Ok(())
});
@@ -306,8 +285,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.connection_status()?);
Ok(())
});
@@ -318,8 +296,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.connection_status_reason()?);
Ok(())
});
@@ -330,8 +307,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.connection_error()?);
Ok(())
});
@@ -346,8 +322,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.connection_error_details()?);
Ok(())
});
@@ -358,8 +333,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.current_presence()?);
Ok(())
});
@@ -370,16 +344,14 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.requested_presence()?);
Ok(())
});
let fclone = f.clone();
let p = p.on_set(move |iter, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
d.set_requested_presence(iter.read()?)?;
Ok(())
});
@@ -390,8 +362,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.changing_presence()?);
Ok(())
});
@@ -402,8 +373,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.normalized_name()?);
Ok(())
});
@@ -414,8 +384,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.has_been_online()?);
Ok(())
});
@@ -426,16 +395,14 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.supersedes()?);
Ok(())
});
let fclone = f.clone();
let p = p.on_set(move |iter, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
d.set_supersedes(iter.read()?)?;
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Account_Interface_Addressing.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/account_interface_addressing.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Account_Interface_Addressing.xml -i org.freedesktop.Telepathy -o src/telepathy/account_interface_addressing.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -21,8 +21,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn AccountInterfaceAddressing>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: AccountInterfaceAddressing,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Account.Interface.Addressing",
@@ -34,8 +34,7 @@ where
let mut i = minfo.msg.iter_init();
let urischeme: &str = i.read()?;
let association: bool = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.set_urischeme_association(urischeme, association)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -50,8 +49,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.urischemes()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Account_Interface_Avatar.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/account_interface_avatar.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Account_Interface_Avatar.xml -i org.freedesktop.Telepathy -o src/telepathy/account_interface_avatar.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -18,8 +18,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn AccountInterfaceAvatar>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: AccountInterfaceAvatar,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Account.Interface.Avatar", data);
let f = ::std::sync::Arc::new(f);
@@ -28,16 +28,14 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.avatar()?);
Ok(())
});
let fclone = f.clone();
let p = p.on_set(move |iter, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
d.set_avatar(iter.read()?)?;
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Account_Interface_External_Password_Storage.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/account_interface_external_password_storage.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Account_Interface_External_Password_Storage.xml -i org.freedesktop.Telepathy -o src/telepathy/account_interface_external_password_storage.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -17,8 +17,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn AccountInterfaceExternalPasswordStorageDRAFT>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: AccountInterfaceExternalPasswordStorageDRAFT,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Account.Interface.ExternalPasswordStorage.DRAFT",
@@ -27,8 +27,7 @@ where
let f = ::std::sync::Arc::new(f);
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.forget_password()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -41,8 +40,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.password_saved()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Account_Interface_Hidden.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/account_interface_hidden.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Account_Interface_Hidden.xml -i org.freedesktop.Telepathy -o src/telepathy/account_interface_hidden.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -16,8 +16,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn AccountInterfaceHiddenDRAFT1>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: AccountInterfaceHiddenDRAFT1,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Account.Interface.Hidden.DRAFT1",
@@ -29,8 +29,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.hidden()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Account_Interface_Storage.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/account_interface_storage.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Account_Interface_Storage.xml -i org.freedesktop.Telepathy -o src/telepathy/account_interface_storage.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -26,8 +26,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn AccountInterfaceStorage>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: AccountInterfaceStorage,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Account.Interface.Storage", data);
let f = ::std::sync::Arc::new(f);
@@ -36,8 +36,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.storage_provider()?);
Ok(())
});
@@ -49,8 +48,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.storage_identifier()?);
Ok(())
});
@@ -65,8 +63,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.storage_specific_information()?);
Ok(())
});
@@ -77,8 +74,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.storage_restrictions()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Account_Manager.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/account_manager.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Account_Manager.xml -i org.freedesktop.Telepathy -o src/telepathy/account_manager.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -28,8 +28,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn AccountManager>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: AccountManager,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.AccountManager", data);
let f = ::std::sync::Arc::new(f);
@@ -43,8 +43,7 @@ where
i.read()?;
let properties: ::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>> =
i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let account = d.create_account(
connection_manager,
protocol,
@@ -70,8 +69,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.interfaces()?);
Ok(())
});
@@ -82,8 +80,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.valid_accounts()?);
Ok(())
});
@@ -94,8 +91,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.invalid_accounts()?);
Ok(())
});
@@ -106,8 +102,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.supported_account_properties()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Account_Manager_Interface_Hidden.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/account_manager_interface_hidden.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Account_Manager_Interface_Hidden.xml -i org.freedesktop.Telepathy -o src/telepathy/account_manager_interface_hidden.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -18,8 +18,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn AccountManagerInterfaceHiddenDRAFT1>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: AccountManagerInterfaceHiddenDRAFT1,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.AccountManager.Interface.Hidden.DRAFT1",
@@ -31,8 +31,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.valid_hidden_accounts()?);
Ok(())
});
@@ -43,8 +42,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.invalid_hidden_accounts()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/all.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/all.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/all.xml -i org.freedesktop.Telepathy -o src/telepathy/all.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Authentication_TLS_Certificate.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/authentication_tls_certificate.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Authentication_TLS_Certificate.xml -i org.freedesktop.Telepathy -o src/telepathy/authentication_tls_certificate.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -38,8 +38,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn AuthenticationTLSCertificate>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: AuthenticationTLSCertificate,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Authentication.TLSCertificate",
@@ -48,8 +48,7 @@ where
let f = ::std::sync::Arc::new(f);
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.accept()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -65,8 +64,7 @@ where
&str,
::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>,
)> = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.reject(rejections)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -80,8 +78,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.state()?);
Ok(())
});
@@ -96,8 +93,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.rejections()?);
Ok(())
});
@@ -108,8 +104,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.certificate_type()?);
Ok(())
});
@@ -120,8 +115,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.certificate_chain_data()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Content.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/call_content.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Content.xml -i org.freedesktop.Telepathy -o src/telepathy/call_content.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -22,15 +22,14 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn Call1Content>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: Call1Content,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Call1.Content", data);
let f = ::std::sync::Arc::new(f);
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.remove()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -43,8 +42,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.interfaces()?);
Ok(())
});
@@ -55,8 +53,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.name()?);
Ok(())
});
@@ -67,8 +64,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.type_()?);
Ok(())
});
@@ -79,8 +75,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.disposition()?);
Ok(())
});
@@ -91,8 +86,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.streams()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Content_Interface_Audio_Control.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/call_content_interface_audio_control.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Content_Interface_Audio_Control.xml -i org.freedesktop.Telepathy -o src/telepathy/call_content_interface_audio_control.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -19,8 +19,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn Call1ContentInterfaceAudioControl>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: Call1ContentInterfaceAudioControl,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Call1.Content.Interface.AudioControl",
@@ -31,8 +31,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let volume: i32 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.report_input_volume(volume)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -45,8 +44,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let volume: i32 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.report_output_volume(volume)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -60,8 +58,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.requested_input_volume()?);
Ok(())
});
@@ -72,8 +69,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.requested_output_volume()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Content_Interface_DTMF.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/call_content_interface_dtmf.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Content_Interface_DTMF.xml -i org.freedesktop.Telepathy -o src/telepathy/call_content_interface_dtmf.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -21,8 +21,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn Call1ContentInterfaceDTMF>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: Call1ContentInterfaceDTMF,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Call1.Content.Interface.DTMF",
@@ -33,8 +33,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let event: u8 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.start_tone(event)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -45,8 +44,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.stop_tone()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -58,8 +56,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let tones: &str = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.multiple_tones(tones)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -73,8 +70,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.currently_sending_tones()?);
Ok(())
});
@@ -85,8 +81,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.deferred_tones()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Content_Interface_Media.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/call_content_interface_media.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Content_Interface_Media.xml -i org.freedesktop.Telepathy -o src/telepathy/call_content_interface_media.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -52,8 +52,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn Call1ContentInterfaceMedia>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: Call1ContentInterfaceMedia,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Call1.Content.Interface.Media",
@@ -67,8 +67,7 @@ where
&str,
arg::Variant<Box<dyn arg::RefArg>>,
> = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.update_local_media_description(media_description)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -82,8 +81,7 @@ where
let mut i = minfo.msg.iter_init();
let event: u8 = i.read()?;
let state: u32 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.acknowledge_dtmfchange(event, state)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -97,8 +95,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let reason: (u32, u32, &str, &str) = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.fail(reason)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -115,8 +112,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.remote_media_descriptions()?);
Ok(())
});
@@ -130,8 +126,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.local_media_descriptions()?);
Ok(())
});
@@ -145,8 +140,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.media_description_offer()?);
Ok(())
});
@@ -157,8 +151,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.packetization()?);
Ok(())
});
@@ -169,8 +162,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.current_dtmfevent()?);
Ok(())
});
@@ -181,8 +173,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.current_dtmfstate()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Content_Interface_Video_Control.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/call_content_interface_video_control.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Content_Interface_Video_Control.xml -i org.freedesktop.Telepathy -o src/telepathy/call_content_interface_video_control.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -21,8 +21,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn Call1ContentInterfaceVideoControl>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: Call1ContentInterfaceVideoControl,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl",
@@ -34,8 +34,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.video_resolution()?);
Ok(())
});
@@ -46,8 +45,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.bitrate()?);
Ok(())
});
@@ -58,8 +56,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.framerate()?);
Ok(())
});
@@ -70,8 +67,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.mtu()?);
Ok(())
});
@@ -82,8 +78,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.manual_key_frames()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Content_Media_Description.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/call_content_media_description.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Content_Media_Description.xml -i org.freedesktop.Telepathy -o src/telepathy/call_content_media_description.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -41,8 +41,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn Call1ContentMediaDescription>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: Call1ContentMediaDescription,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Call1.Content.MediaDescription",
@@ -56,8 +56,7 @@ where
&str,
arg::Variant<Box<dyn arg::RefArg>>,
> = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.accept(local_media_description)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -70,8 +69,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let reason: (u32, u32, &str, &str) = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.reject(reason)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -85,8 +83,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.interfaces()?);
Ok(())
});
@@ -97,8 +94,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.further_negotiation_required()?);
Ok(())
});
@@ -109,8 +105,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.has_remote_information()?);
Ok(())
});
@@ -128,8 +123,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.codecs()?);
Ok(())
});
@@ -140,8 +134,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.remote_contact()?);
Ok(())
});
@@ -153,8 +146,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.ssrcs()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Content_Media_Description_Interface_RTCP_Extended_Reports.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/call_content_media_description_interface_rtcp_extended_reports.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Content_Media_Description_Interface_RTCP_Extended_Reports.xml -i org.freedesktop.Telepathy -o src/telepathy/call_content_media_description_interface_rtcp_extended_reports.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -22,8 +22,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn Call1ContentMediaDescriptionInterfaceRTCPExtendedReports>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: Call1ContentMediaDescriptionInterfaceRTCPExtendedReports,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTCPExtendedReports",
@@ -35,8 +35,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.loss_rlemax_size()?);
Ok(())
});
@@ -47,8 +46,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.duplicate_rlemax_size()?);
Ok(())
});
@@ -59,8 +57,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.packet_receipt_times_max_size()?);
Ok(())
});
@@ -71,8 +68,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.dlrrmax_size()?);
Ok(())
});
@@ -83,8 +79,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.rttmode()?);
Ok(())
});
@@ -95,8 +90,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.statistics_flags()?);
Ok(())
});
@@ -107,8 +101,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.enable_metrics()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Content_Media_Description_Interface_RTCP_Feedback.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/call_content_media_description_interface_rtcp_feedback.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Content_Media_Description_Interface_RTCP_Feedback.xml -i org.freedesktop.Telepathy -o src/telepathy/call_content_media_description_interface_rtcp_feedback.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -22,8 +22,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn Call1ContentMediaDescriptionInterfaceRTCPFeedback>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: Call1ContentMediaDescriptionInterfaceRTCPFeedback,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTCPFeedback",
@@ -39,8 +39,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.feedback_messages()?);
Ok(())
});
@@ -51,8 +50,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.does_avpf()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Content_Media_Description_Interface_RTP_Header_Extensions.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/call_content_media_description_interface_rtp_header_extensions.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Content_Media_Description_Interface_RTP_Header_Extensions.xml -i org.freedesktop.Telepathy -o src/telepathy/call_content_media_description_interface_rtp_header_extensions.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -16,8 +16,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn Call1ContentMediaDescriptionInterfaceRTPHeaderExtensions>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: Call1ContentMediaDescriptionInterfaceRTPHeaderExtensions,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTPHeaderExtensions",
@@ -30,8 +30,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.header_extensions()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Interface_Mute.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/call_interface_mute.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Interface_Mute.xml -i org.freedesktop.Telepathy -o src/telepathy/call_interface_mute.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -18,8 +18,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn Call1InterfaceMute>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: Call1InterfaceMute,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Call1.Interface.Mute", data);
let f = ::std::sync::Arc::new(f);
@@ -27,8 +27,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let muted: bool = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.request_muted(muted)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -42,8 +41,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.local_mute_state()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Stream.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/call_stream.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Stream.xml -i org.freedesktop.Telepathy -o src/telepathy/call_stream.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -25,8 +25,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn Call1Stream>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: Call1Stream,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Call1.Stream", data);
let f = ::std::sync::Arc::new(f);
@@ -34,8 +34,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let send: bool = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.set_sending(send)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -49,8 +48,7 @@ where
let mut i = minfo.msg.iter_init();
let contact: u32 = i.read()?;
let receive: bool = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.request_receiving(contact, receive)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -65,8 +63,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.interfaces()?);
Ok(())
});
@@ -78,8 +75,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.remote_members()?);
Ok(())
});
@@ -93,8 +89,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.remote_member_identifiers()?);
Ok(())
});
@@ -105,8 +100,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.local_sending_state()?);
Ok(())
});
@@ -117,8 +111,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.can_request_receiving()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Stream_Endpoint.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/call_stream_endpoint.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Stream_Endpoint.xml -i org.freedesktop.Telepathy -o src/telepathy/call_stream_endpoint.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -98,8 +98,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn Call1StreamEndpoint>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: Call1StreamEndpoint,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Call1.Stream.Endpoint", data);
let f = ::std::sync::Arc::new(f);
@@ -118,8 +118,7 @@ where
u32,
::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>,
) = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.set_selected_candidate_pair(local_candidate, remote_candidate)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -134,8 +133,7 @@ where
let mut i = minfo.msg.iter_init();
let component: u32 = i.read()?;
let state: u32 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.set_endpoint_state_(component, state)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -160,8 +158,7 @@ where
u32,
::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>,
) = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.accept_selected_candidate_pair(local_candidate, remote_candidate)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -186,8 +183,7 @@ where
u32,
::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>,
) = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.reject_selected_candidate_pair(local_candidate, remote_candidate)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -201,8 +197,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let controlling: bool = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.set_controlling_(controlling)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -216,8 +211,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.remote_credentials()?);
Ok(())
});
@@ -233,8 +227,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.remote_candidates()?);
Ok(())
});
@@ -258,8 +251,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.selected_candidate_pairs()?);
Ok(())
});
@@ -271,8 +263,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.endpoint_state()?);
Ok(())
});
@@ -283,8 +274,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.transport()?);
Ok(())
});
@@ -295,8 +285,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.controlling()?);
Ok(())
});
@@ -307,8 +296,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.is_icelite()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Stream_Interface_Media.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/call_stream_interface_media.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Call_Stream_Interface_Media.xml -i org.freedesktop.Telepathy -o src/telepathy/call_stream_interface_media.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -67,8 +67,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn Call1StreamInterfaceMedia>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: Call1StreamInterfaceMedia,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Call1.Stream.Interface.Media",
@@ -79,8 +79,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let state: u32 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.complete_sending_state_change(state)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -95,8 +94,7 @@ where
let reason: u32 = i.read()?;
let error: &str = i.read()?;
let message: &str = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.report_sending_failure(reason, error, message)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -111,8 +109,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let state: u32 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.complete_receiving_state_change(state)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -127,8 +124,7 @@ where
let reason: u32 = i.read()?;
let error: &str = i.read()?;
let message: &str = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.report_receiving_failure(reason, error, message)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -144,8 +140,7 @@ where
let mut i = minfo.msg.iter_init();
let username: &str = i.read()?;
let password: &str = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.set_credentials(username, password)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -164,8 +159,7 @@ where
u32,
::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>,
)> = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.add_candidates(candidates)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -176,8 +170,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.finish_initial_candidates()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -189,8 +182,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let reason: (u32, u32, &str, &str) = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.fail(reason)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -204,8 +196,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.sending_state()?);
Ok(())
});
@@ -216,8 +207,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.receiving_state()?);
Ok(())
});
@@ -228,8 +218,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.transport()?);
Ok(())
});
@@ -245,8 +234,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.local_candidates()?);
Ok(())
});
@@ -257,8 +245,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.local_credentials()?);
Ok(())
});
@@ -269,8 +256,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.stunservers()?);
Ok(())
});
@@ -285,8 +271,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.relay_info()?);
Ok(())
});
@@ -297,8 +282,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.has_server_info()?);
Ok(())
});
@@ -309,8 +293,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.endpoints()?);
Ok(())
});
@@ -321,8 +304,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.icerestart_pending()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel.xml -i org.freedesktop.Telepathy -o src/telepathy/channel.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -28,15 +28,14 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn Channel>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: Channel,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Channel", data);
let f = ::std::sync::Arc::new(f);
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.close()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -46,8 +45,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let channel_type = d.get_channel_type()?;
let rm = minfo.msg.method_return();
let rm = rm.append1(channel_type);
@@ -59,8 +57,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let (target_handle_type, target_handle) = d.get_handle()?;
let rm = minfo.msg.method_return();
let rm = rm.append1(target_handle_type);
@@ -74,8 +71,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let interfaces = d.get_interfaces()?;
let rm = minfo.msg.method_return();
let rm = rm.append1(interfaces);
@@ -90,8 +86,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.channel_type()?);
Ok(())
});
@@ -102,8 +97,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.interfaces()?);
Ok(())
});
@@ -114,8 +108,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.target_handle()?);
Ok(())
});
@@ -126,8 +119,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.target_id()?);
Ok(())
});
@@ -138,8 +130,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.target_handle_type()?);
Ok(())
});
@@ -150,8 +141,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.requested()?);
Ok(())
});
@@ -162,8 +152,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.initiator_handle()?);
Ok(())
});
@@ -174,8 +163,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.initiator_id()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Bundle.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_bundle.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Bundle.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_bundle.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -16,8 +16,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn ChannelBundleDRAFT>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelBundleDRAFT,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.ChannelBundle.DRAFT", data);
let f = ::std::sync::Arc::new(f);
@@ -26,8 +26,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.interfaces()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Dispatch_Operation.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_dispatch_operation.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Dispatch_Operation.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_dispatch_operation.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -33,8 +33,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn ChannelDispatchOperation>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelDispatchOperation,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.ChannelDispatchOperation", data);
let f = ::std::sync::Arc::new(f);
@@ -42,8 +42,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let handler: &str = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.handle_with(handler)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -54,8 +53,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.claim()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -68,8 +66,7 @@ where
let mut i = minfo.msg.iter_init();
let handler: &str = i.read()?;
let user_action_time: i64 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.handle_with_time(handler, user_action_time)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -84,8 +81,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.interfaces()?);
Ok(())
});
@@ -96,8 +92,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.connection()?);
Ok(())
});
@@ -108,8 +103,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.account()?);
Ok(())
});
@@ -123,8 +117,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.channels()?);
Ok(())
});
@@ -135,8 +128,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.possible_handlers()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Dispatcher.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_dispatcher.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Dispatcher.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_dispatcher.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -64,8 +64,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn ChannelDispatcher>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelDispatcher,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.ChannelDispatcher", data);
let f = ::std::sync::Arc::new(f);
@@ -79,8 +79,7 @@ where
> = i.read()?;
let user_action_time: i64 = i.read()?;
let preferred_handler: &str = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let request = d.create_channel(
account,
requested_properties,
@@ -109,8 +108,7 @@ where
> = i.read()?;
let user_action_time: i64 = i.read()?;
let preferred_handler: &str = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let request = d.ensure_channel(
account,
requested_properties,
@@ -141,8 +139,7 @@ where
let preferred_handler: &str = i.read()?;
let hints: ::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>> =
i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let request = d.create_channel_with_hints(
account,
requested_properties,
@@ -175,8 +172,7 @@ where
let preferred_handler: &str = i.read()?;
let hints: ::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>> =
i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let request = d.ensure_channel_with_hints(
account,
requested_properties,
@@ -203,8 +199,7 @@ where
let channels: Vec<dbus::Path> = i.read()?;
let user_action_time: i64 = i.read()?;
let preferred_handler: &str = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let (delegated, not_delegated) =
d.delegate_channels(channels, user_action_time, preferred_handler)?;
let rm = minfo.msg.method_return();
@@ -225,8 +220,7 @@ where
let mut i = minfo.msg.iter_init();
let channel: dbus::Path = i.read()?;
let user_action_time: i64 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.present_channel(channel, user_action_time)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -241,8 +235,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.interfaces()?);
Ok(())
});
@@ -253,8 +246,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.supports_request_hints()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Dispatcher_Interface_Messages1.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_dispatcher_interface_messages1.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Dispatcher_Interface_Messages1.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_dispatcher_interface_messages1.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -21,8 +21,8 @@ pub fn channel_dispatcher_interface_messages1_server<F, T, D>(
where
D: tree::DataType,
D::Method: Default,
T: AsRef<dyn ChannelDispatcherInterfaceMessages1>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelDispatcherInterfaceMessages1,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.ChannelDispatcher.Interface.Messages1",
@@ -37,8 +37,7 @@ where
let message: Vec<::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>> =
i.read()?;
let flags: u32 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let token = d.send_message(account, target_id, message, flags)?;
let rm = minfo.msg.method_return();
let rm = rm.append1(token);

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Dispatcher_Interface_Operation_List.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_dispatcher_interface_operation_list.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Dispatcher_Interface_Operation_List.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_dispatcher_interface_operation_list.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -25,8 +25,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn ChannelDispatcherInterfaceOperationList>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelDispatcherInterfaceOperationList,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.ChannelDispatcher.Interface.OperationList",
@@ -41,8 +41,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.dispatch_operations()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Future.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_future.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Future.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_future.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -16,8 +16,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn ChannelFUTURE>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelFUTURE,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Channel.FUTURE", data);
let f = ::std::sync::Arc::new(f);
@@ -26,8 +26,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.bundle()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Handler.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_handler.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Handler.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_handler.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -23,8 +23,8 @@ pub fn channel_handler_server<F, T, D>(
where
D: tree::DataType,
D::Method: Default,
T: AsRef<dyn ChannelHandler>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelHandler,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.ChannelHandler", data);
let f = ::std::sync::Arc::new(f);
@@ -37,8 +37,7 @@ where
let channel: dbus::Path = i.read()?;
let handle_type: u32 = i.read()?;
let handle: u32 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.handle_channel(
bus_name,
connection,

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Addressing.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_addressing.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Addressing.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_addressing.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -19,8 +19,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn ChannelInterfaceAddressing1>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceAddressing1,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Channel.Interface.Addressing1",
@@ -32,8 +32,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.target_vcard_field()?);
Ok(())
});
@@ -44,8 +43,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.target_urischeme()?);
Ok(())
});
@@ -56,8 +54,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.target_vcard_address()?);
Ok(())
});
@@ -68,8 +65,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.target_uri()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Anonymity.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_anonymity.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Anonymity.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_anonymity.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -18,8 +18,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn ChannelInterfaceAnonymity>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceAnonymity,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Channel.Interface.Anonymity",
@@ -31,8 +31,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.anonymity_modes()?);
Ok(())
});
@@ -43,8 +42,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.anonymity_mandatory()?);
Ok(())
});
@@ -55,8 +53,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.anonymous_id()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Call_State.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_call_state.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Call_State.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_call_state.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -16,8 +16,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Signal: Default,
T: AsRef<dyn ChannelInterfaceCallState>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceCallState,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Channel.Interface.CallState",
@@ -26,8 +26,7 @@ where
let f = ::std::sync::Arc::new(f);
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let states = d.get_call_states()?;
let rm = minfo.msg.method_return();
let rm = rm.append1(states);

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Captcha_Authentication.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_captcha_authentication.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Captcha_Authentication.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_captcha_authentication.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -33,8 +33,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn ChannelInterfaceCaptchaAuthentication1>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceCaptchaAuthentication1,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Channel.Interface.CaptchaAuthentication1",
@@ -43,8 +43,7 @@ where
let f = ::std::sync::Arc::new(f);
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let (captcha_info, number_required, language) = d.get_captchas()?;
let rm = minfo.msg.method_return();
let rm = rm.append1(captcha_info);
@@ -63,8 +62,7 @@ where
let mut i = minfo.msg.iter_init();
let id: u32 = i.read()?;
let mime_type: &str = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let captcha_data = d.get_captcha_data(id, mime_type)?;
let rm = minfo.msg.method_return();
let rm = rm.append1(captcha_data);
@@ -80,8 +78,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let answers: ::std::collections::HashMap<u32, &str> = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.answer_captchas(answers)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -95,8 +92,7 @@ where
let mut i = minfo.msg.iter_init();
let reason: u32 = i.read()?;
let debug_message: &str = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.cancel_captcha(reason, debug_message)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -111,8 +107,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.can_retry_captcha()?);
Ok(())
});
@@ -123,8 +118,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.captcha_status()?);
Ok(())
});
@@ -135,8 +129,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.captcha_error()?);
Ok(())
});
@@ -151,8 +144,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.captcha_error_details()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Chat_State.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_chat_state.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Chat_State.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_chat_state.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -18,8 +18,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn ChannelInterfaceChatState>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceChatState,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Channel.Interface.ChatState",
@@ -30,8 +30,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let state: u32 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.set_chat_state(state)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -46,8 +45,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.chat_states()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Conference.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_conference.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Conference.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_conference.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -24,8 +24,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn ChannelInterfaceConference>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceConference,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Channel.Interface.Conference",
@@ -37,8 +37,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.channels()?);
Ok(())
});
@@ -49,8 +48,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.initial_channels()?);
Ok(())
});
@@ -61,8 +59,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.initial_invitee_handles()?);
Ok(())
});
@@ -73,8 +70,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.initial_invitee_ids()?);
Ok(())
});
@@ -85,8 +81,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.invitation_message()?);
Ok(())
});
@@ -100,8 +95,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.original_channels()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Credentials_Storage.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_credentials_storage.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Credentials_Storage.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_credentials_storage.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -15,8 +15,8 @@ pub fn channel_interface_credentials_storage_draft_server<F, T, D>(
where
D: tree::DataType,
D::Method: Default,
T: AsRef<dyn ChannelInterfaceCredentialsStorageDRAFT>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceCredentialsStorageDRAFT,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Channel.Interface.CredentialsStorage.DRAFT",
@@ -27,8 +27,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let store: bool = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.store_credentials(store)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Destroyable.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_destroyable.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Destroyable.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_destroyable.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -15,8 +15,8 @@ pub fn channel_interface_destroyable_server<F, T, D>(
where
D: tree::DataType,
D::Method: Default,
T: AsRef<dyn ChannelInterfaceDestroyable>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceDestroyable,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Channel.Interface.Destroyable",
@@ -25,8 +25,7 @@ where
let f = ::std::sync::Arc::new(f);
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.destroy()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_DTMF.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_dtmf.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_DTMF.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_dtmf.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -22,8 +22,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn ChannelInterfaceDTMF>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceDTMF,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.DTMF", data);
let f = ::std::sync::Arc::new(f);
@@ -32,8 +32,7 @@ where
let mut i = minfo.msg.iter_init();
let stream_id: u32 = i.read()?;
let event: u8 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.start_tone(stream_id, event)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -47,8 +46,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let stream_id: u32 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.stop_tone(stream_id)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -61,8 +59,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let tones: &str = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.multiple_tones(tones)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -76,8 +73,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.currently_sending_tones()?);
Ok(())
});
@@ -88,8 +84,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.initial_tones()?);
Ok(())
});
@@ -100,8 +95,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.deferred_tones()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_File_Transfer_Metadata.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_file_transfer_metadata.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_File_Transfer_Metadata.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_file_transfer_metadata.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -23,8 +23,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn ChannelInterfaceFileTransferMetadata>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceFileTransferMetadata,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Channel.Interface.FileTransfer.Metadata",
@@ -36,16 +36,14 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.service_name()?);
Ok(())
});
let fclone = f.clone();
let p = p.on_set(move |iter, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
d.set_service_name(iter.read()?)?;
Ok(())
});
@@ -59,16 +57,14 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.metadata()?);
Ok(())
});
let fclone = f.clone();
let p = p.on_set(move |iter, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
d.set_metadata(iter.read()?)?;
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Group.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_group.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Group.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_group.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -43,8 +43,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn ChannelInterfaceGroup>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceGroup,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.Group", data);
let f = ::std::sync::Arc::new(f);
@@ -53,8 +53,7 @@ where
let mut i = minfo.msg.iter_init();
let contacts: Vec<u32> = i.read()?;
let message: &str = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.add_members(contacts, message)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -66,8 +65,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let (members, local_pending, remote_pending) = d.get_all_members()?;
let rm = minfo.msg.method_return();
let rm = rm.append1(members);
@@ -83,8 +81,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let group_flags = d.get_group_flags()?;
let rm = minfo.msg.method_return();
let rm = rm.append1(group_flags);
@@ -98,8 +95,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let handles: Vec<u32> = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let owners = d.get_handle_owners(handles)?;
let rm = minfo.msg.method_return();
let rm = rm.append1(owners);
@@ -112,8 +108,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let handles = d.get_local_pending_members()?;
let rm = minfo.msg.method_return();
let rm = rm.append1(handles);
@@ -125,8 +120,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let info = d.get_local_pending_members_with_info()?;
let rm = minfo.msg.method_return();
let rm = rm.append1(info);
@@ -138,8 +132,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let handles = d.get_members()?;
let rm = minfo.msg.method_return();
let rm = rm.append1(handles);
@@ -151,8 +144,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let handles = d.get_remote_pending_members()?;
let rm = minfo.msg.method_return();
let rm = rm.append1(handles);
@@ -164,8 +156,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let self_handle = d.get_self_handle()?;
let rm = minfo.msg.method_return();
let rm = rm.append1(self_handle);
@@ -180,8 +171,7 @@ where
let mut i = minfo.msg.iter_init();
let contacts: Vec<u32> = i.read()?;
let message: &str = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.remove_members(contacts, message)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -197,8 +187,7 @@ where
let contacts: Vec<u32> = i.read()?;
let message: &str = i.read()?;
let reason: u32 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.remove_members_with_reason(contacts, message, reason)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -214,8 +203,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.group_flags()?);
Ok(())
});
@@ -227,8 +215,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.handle_owners()?);
Ok(())
});
@@ -240,8 +227,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.local_pending_members()?);
Ok(())
});
@@ -252,8 +238,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.members()?);
Ok(())
});
@@ -264,8 +249,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.remote_pending_members()?);
Ok(())
});
@@ -276,8 +260,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.self_handle()?);
Ok(())
});
@@ -291,8 +274,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.member_identifiers()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Hold.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_hold.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Hold.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_hold.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -17,15 +17,14 @@ where
D: tree::DataType,
D::Method: Default,
D::Signal: Default,
T: AsRef<dyn ChannelInterfaceHold>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceHold,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.Hold", data);
let f = ::std::sync::Arc::new(f);
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let (hold_state, reason) = d.get_hold_state()?;
let rm = minfo.msg.method_return();
let rm = rm.append1(hold_state);
@@ -41,8 +40,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let hold: bool = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.request_hold(hold)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_HTML.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_html.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_HTML.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_html.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -13,8 +13,8 @@ pub fn channel_interface_htmldraft_server<F, T, D>(
where
D: tree::DataType,
D::Method: Default,
T: AsRef<dyn ChannelInterfaceHTMLDRAFT>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceHTMLDRAFT,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Channel.Interface.HTML.DRAFT",

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Media_Signalling.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_media_signalling.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Media_Signalling.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_media_signalling.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -16,8 +16,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Signal: Default,
T: AsRef<dyn ChannelInterfaceMediaSignalling>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceMediaSignalling,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Channel.Interface.MediaSignalling",
@@ -26,8 +26,7 @@ where
let f = ::std::sync::Arc::new(f);
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let session_handlers = d.get_session_handlers()?;
let rm = minfo.msg.method_return();
let rm = rm.append1(session_handlers);

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Mergeable_Conference.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_mergeable_conference.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Mergeable_Conference.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_mergeable_conference.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -15,8 +15,8 @@ pub fn channel_interface_mergeable_conference_draft_server<F, T, D>(
where
D: tree::DataType,
D::Method: Default,
T: AsRef<dyn ChannelInterfaceMergeableConferenceDRAFT>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceMergeableConferenceDRAFT,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Channel.Interface.MergeableConference.DRAFT",
@@ -27,8 +27,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let channel: dbus::Path = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.merge(channel)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Messages.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_messages.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Messages.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_messages.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -39,8 +39,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn ChannelInterfaceMessages>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceMessages,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.Messages", data);
let f = ::std::sync::Arc::new(f);
@@ -50,8 +50,7 @@ where
let message: Vec<::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>> =
i.read()?;
let flags: u32 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let token = d.send_message(message, flags)?;
let rm = minfo.msg.method_return();
let rm = rm.append1(token);
@@ -68,8 +67,7 @@ where
let mut i = minfo.msg.iter_init();
let message_id: u32 = i.read()?;
let parts: Vec<u32> = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let content = d.get_pending_message_content(message_id, parts)?;
let rm = minfo.msg.method_return();
let rm = rm.append1(content);
@@ -86,8 +84,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.supported_content_types()?);
Ok(())
});
@@ -98,8 +95,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.message_types()?);
Ok(())
});
@@ -110,8 +106,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.message_part_support_flags()?);
Ok(())
});
@@ -122,8 +117,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.pending_messages()?);
Ok(())
});
@@ -134,8 +128,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.delivery_reporting_support()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Password.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_password.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Password.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_password.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -17,15 +17,14 @@ where
D: tree::DataType,
D::Method: Default,
D::Signal: Default,
T: AsRef<dyn ChannelInterfacePassword>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfacePassword,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.Password", data);
let f = ::std::sync::Arc::new(f);
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let password_flags = d.get_password_flags()?;
let rm = minfo.msg.method_return();
let rm = rm.append1(password_flags);
@@ -39,8 +38,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let password: &str = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let correct = d.provide_password(password)?;
let rm = minfo.msg.method_return();
let rm = rm.append1(correct);

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Picture.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_picture.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Picture.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_picture.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -29,8 +29,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn ChannelInterfacePicture1>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfacePicture1,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.Picture1", data);
let f = ::std::sync::Arc::new(f);
@@ -39,8 +39,7 @@ where
let mut i = minfo.msg.iter_init();
let picture: Vec<u8> = i.read()?;
let mimetype: &str = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.set_picture(picture, mimetype)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -55,8 +54,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.picture()?);
Ok(())
});
@@ -67,8 +65,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.actor()?);
Ok(())
});
@@ -79,8 +76,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.actor_handle()?);
Ok(())
});
@@ -91,8 +87,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.timestamp()?);
Ok(())
});
@@ -103,8 +98,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.can_set()?);
Ok(())
});
@@ -115,8 +109,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.supported_mimetypes()?);
Ok(())
});
@@ -127,8 +120,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.minimum_height()?);
Ok(())
});
@@ -139,8 +131,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.minimum_width()?);
Ok(())
});
@@ -151,8 +142,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.recommended_height()?);
Ok(())
});
@@ -163,8 +153,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.recommended_width()?);
Ok(())
});
@@ -175,8 +164,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.maximum_height()?);
Ok(())
});
@@ -187,8 +175,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.maximum_width()?);
Ok(())
});
@@ -199,8 +186,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.maximum_bytes()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Room.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_room.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Room.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_room.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -20,8 +20,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn ChannelInterfaceRoom2>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceRoom2,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.Room2", data);
let f = ::std::sync::Arc::new(f);
@@ -30,8 +30,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.room_name()?);
Ok(())
});
@@ -42,8 +41,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.server()?);
Ok(())
});
@@ -54,8 +52,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.creator()?);
Ok(())
});
@@ -66,8 +63,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.creator_handle()?);
Ok(())
});
@@ -78,8 +74,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.creation_timestamp()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Room_Config.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_room_config.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Room_Config.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_room_config.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -33,8 +33,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn ChannelInterfaceRoomConfig1>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceRoomConfig1,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Channel.Interface.RoomConfig1",
@@ -46,8 +46,7 @@ where
let mut i = minfo.msg.iter_init();
let properties: ::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>> =
i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.update_configuration(properties)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -61,8 +60,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.anonymous()?);
Ok(())
});
@@ -73,8 +71,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.invite_only()?);
Ok(())
});
@@ -85,8 +82,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.limit()?);
Ok(())
});
@@ -97,8 +93,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.moderated()?);
Ok(())
});
@@ -109,8 +104,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.title()?);
Ok(())
});
@@ -121,8 +115,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.description()?);
Ok(())
});
@@ -133,8 +126,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.persistent()?);
Ok(())
});
@@ -145,8 +137,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.private()?);
Ok(())
});
@@ -157,8 +148,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.password_protected()?);
Ok(())
});
@@ -169,8 +159,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.password()?);
Ok(())
});
@@ -181,8 +170,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.password_hint()?);
Ok(())
});
@@ -193,8 +181,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.can_update_configuration()?);
Ok(())
});
@@ -205,8 +192,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.mutable_properties()?);
Ok(())
});
@@ -217,8 +203,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.configuration_retrieved()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_SASL_Authentication.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_sasl_authentication.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_SASL_Authentication.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_sasl_authentication.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -40,8 +40,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn ChannelInterfaceSASLAuthentication>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceSASLAuthentication,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication",
@@ -52,8 +52,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let mechanism: &str = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.start_mechanism(mechanism)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -67,8 +66,7 @@ where
let mut i = minfo.msg.iter_init();
let mechanism: &str = i.read()?;
let initial_data: Vec<u8> = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.start_mechanism_with_data(mechanism, initial_data)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -82,8 +80,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let response_data: Vec<u8> = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.respond(response_data)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -94,8 +91,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.accept_sasl()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -108,8 +104,7 @@ where
let mut i = minfo.msg.iter_init();
let reason: u32 = i.read()?;
let debug_message: &str = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.abort_sasl(reason, debug_message)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -124,8 +119,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.available_mechanisms()?);
Ok(())
});
@@ -136,8 +130,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.has_initial_data()?);
Ok(())
});
@@ -148,8 +141,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.can_try_again()?);
Ok(())
});
@@ -160,8 +152,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.saslstatus()?);
Ok(())
});
@@ -172,8 +163,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.saslerror()?);
Ok(())
});
@@ -188,8 +178,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.saslerror_details()?);
Ok(())
});
@@ -200,8 +189,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.authorization_identity()?);
Ok(())
});
@@ -212,8 +200,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.default_username()?);
Ok(())
});
@@ -224,8 +211,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.default_realm()?);
Ok(())
});
@@ -236,8 +222,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.may_save_response()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Securable.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_securable.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Securable.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_securable.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -17,8 +17,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn ChannelInterfaceSecurable>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceSecurable,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Channel.Interface.Securable",
@@ -30,8 +30,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.encrypted()?);
Ok(())
});
@@ -42,8 +41,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.verified()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Service_Point.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_service_point.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Service_Point.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_service_point.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -18,8 +18,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn ChannelInterfaceServicePoint>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceServicePoint,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Channel.Interface.ServicePoint",
@@ -31,8 +31,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.initial_service_point()?);
Ok(())
});
@@ -43,8 +42,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.current_service_point()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_SMS.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_sms.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_SMS.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_sms.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -22,8 +22,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn ChannelInterfaceSMS>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceSMS,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.SMS", data);
let f = ::std::sync::Arc::new(f);
@@ -32,8 +32,7 @@ where
let mut i = minfo.msg.iter_init();
let message: Vec<::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>> =
i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let (chunks_required, remaining_characters, estimated_cost) = d.get_smslength(message)?;
let rm = minfo.msg.method_return();
let rm = rm.append1(chunks_required);
@@ -53,8 +52,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.flash()?);
Ok(())
});
@@ -65,8 +63,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.smschannel()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Splittable.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_splittable.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Splittable.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_splittable.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -15,8 +15,8 @@ pub fn channel_interface_splittable_draft_server<F, T, D>(
where
D: tree::DataType,
D::Method: Default,
T: AsRef<dyn ChannelInterfaceSplittableDRAFT>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceSplittableDRAFT,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Channel.Interface.Splittable.DRAFT",
@@ -25,8 +25,7 @@ where
let f = ::std::sync::Arc::new(f);
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.split()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Subject.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_subject.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Subject.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_subject.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -21,8 +21,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn ChannelInterfaceSubject2>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceSubject2,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.Subject2", data);
let f = ::std::sync::Arc::new(f);
@@ -30,8 +30,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let subject: &str = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.set_subject(subject)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -45,8 +44,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.subject()?);
Ok(())
});
@@ -57,8 +55,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.actor()?);
Ok(())
});
@@ -69,8 +66,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.actor_handle()?);
Ok(())
});
@@ -81,8 +77,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.timestamp()?);
Ok(())
});
@@ -93,8 +88,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.can_set()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Transfer.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_transfer.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Transfer.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_transfer.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -15,8 +15,8 @@ pub fn channel_interface_transfer_server<F, T, D>(
where
D: tree::DataType,
D::Method: Default,
T: AsRef<dyn ChannelInterfaceTransfer>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceTransfer,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.Transfer", data);
let f = ::std::sync::Arc::new(f);
@@ -25,8 +25,7 @@ where
let mut i = minfo.msg.iter_init();
let member: u32 = i.read()?;
let destination: u32 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.transfer(member, destination)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Tube.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_interface_tube.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Tube.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_tube.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -23,8 +23,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn ChannelInterfaceTube>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelInterfaceTube,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.Tube", data);
let f = ::std::sync::Arc::new(f);
@@ -37,8 +37,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.parameters()?);
Ok(())
});
@@ -49,8 +48,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.state()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Request.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_request.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Request.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_request.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -34,15 +34,14 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn ChannelRequest>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelRequest,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.ChannelRequest", data);
let f = ::std::sync::Arc::new(f);
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.proceed()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -52,8 +51,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.cancel()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -66,8 +64,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.account()?);
Ok(())
});
@@ -78,8 +75,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.user_action_time()?);
Ok(())
});
@@ -90,8 +86,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.preferred_handler()?);
Ok(())
});
@@ -106,8 +101,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.requests()?);
Ok(())
});
@@ -118,8 +112,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.interfaces()?);
Ok(())
});
@@ -134,8 +127,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.hints()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Type_Call.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_type_call.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Type_Call.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_type_call.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -52,15 +52,14 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn ChannelTypeCall1>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelTypeCall1,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Channel.Type.Call1", data);
let f = ::std::sync::Arc::new(f);
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.set_ringing()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -70,8 +69,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.set_queued()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -81,8 +79,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.accept()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -96,8 +93,7 @@ where
let reason: u32 = i.read()?;
let detailed_hangup_reason: &str = i.read()?;
let message: &str = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.hangup(reason, detailed_hangup_reason, message)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -114,8 +110,7 @@ where
let content_name: &str = i.read()?;
let content_type: u32 = i.read()?;
let initial_direction: u32 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let content = d.add_content(content_name, content_type, initial_direction)?;
let rm = minfo.msg.method_return();
let rm = rm.append1(content);
@@ -133,8 +128,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.contents()?);
Ok(())
});
@@ -149,8 +143,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.call_state_details()?);
Ok(())
});
@@ -161,8 +154,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.call_state()?);
Ok(())
});
@@ -173,8 +165,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.call_flags()?);
Ok(())
});
@@ -185,8 +176,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.call_state_reason()?);
Ok(())
});
@@ -197,8 +187,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.hardware_streaming()?);
Ok(())
});
@@ -210,8 +199,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.call_members()?);
Ok(())
});
@@ -225,8 +213,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.member_identifiers()?);
Ok(())
});
@@ -237,8 +224,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.initial_transport()?);
Ok(())
});
@@ -249,8 +235,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.initial_audio()?);
Ok(())
});
@@ -261,8 +246,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.initial_video()?);
Ok(())
});
@@ -273,8 +257,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.initial_audio_name()?);
Ok(())
});
@@ -285,8 +268,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.initial_video_name()?);
Ok(())
});
@@ -297,8 +279,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.mutable_contents()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Type_Contact_List.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_type_contact_list.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Type_Contact_List.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_type_contact_list.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -13,8 +13,8 @@ pub fn channel_type_contact_list_server<F, T, D>(
where
D: tree::DataType,
D::Method: Default,
T: AsRef<dyn ChannelTypeContactList>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelTypeContactList,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Channel.Type.ContactList", data);
let f = ::std::sync::Arc::new(f);

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Type_Contact_Search.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_type_contact_search.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Type_Contact_Search.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_type_contact_search.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -24,8 +24,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn ChannelTypeContactSearch>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelTypeContactSearch,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Channel.Type.ContactSearch", data);
let f = ::std::sync::Arc::new(f);
@@ -33,8 +33,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let terms: ::std::collections::HashMap<&str, &str> = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.search(terms)?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -45,8 +44,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.more()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -56,8 +54,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.stop()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -70,8 +67,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.search_state()?);
Ok(())
});
@@ -82,8 +78,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.limit()?);
Ok(())
});
@@ -94,8 +89,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.available_search_keys()?);
Ok(())
});
@@ -106,8 +100,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.server()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Type_DBus_Tube.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_type_dbus_tube.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Type_DBus_Tube.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_type_dbus_tube.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -25,8 +25,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn ChannelTypeDBusTube>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelTypeDBusTube,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Channel.Type.DBusTube", data);
let f = ::std::sync::Arc::new(f);
@@ -36,8 +36,7 @@ where
let parameters: ::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>> =
i.read()?;
let access_control: u32 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let address = d.offer(parameters, access_control)?;
let rm = minfo.msg.method_return();
let rm = rm.append1(address);
@@ -53,8 +52,7 @@ where
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let mut i = minfo.msg.iter_init();
let access_control: u32 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let address = d.accept(access_control)?;
let rm = minfo.msg.method_return();
let rm = rm.append1(address);
@@ -70,8 +68,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.service_name()?);
Ok(())
});
@@ -83,8 +80,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.dbus_names()?);
Ok(())
});
@@ -95,8 +91,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.supported_access_controls()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Type_File_Transfer.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_type_file_transfer.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Type_File_Transfer.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_type_file_transfer.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -45,8 +45,8 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn ChannelTypeFileTransfer>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelTypeFileTransfer,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Channel.Type.FileTransfer", data);
let f = ::std::sync::Arc::new(f);
@@ -57,8 +57,7 @@ where
let access_control: u32 = i.read()?;
let access_control_param: arg::Variant<Box<dyn arg::RefArg>> = i.read()?;
let offset: u64 = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let address = d.accept_file(address_type, access_control, access_control_param, offset)?;
let rm = minfo.msg.method_return();
let rm = rm.append1(address);
@@ -78,8 +77,7 @@ where
let address_type: u32 = i.read()?;
let access_control: u32 = i.read()?;
let access_control_param: arg::Variant<Box<dyn arg::RefArg>> = i.read()?;
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let address = d.provide_file(address_type, access_control, access_control_param)?;
let rm = minfo.msg.method_return();
let rm = rm.append1(address);
@@ -97,8 +95,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.state()?);
Ok(())
});
@@ -109,8 +106,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.content_type()?);
Ok(())
});
@@ -121,8 +117,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.filename()?);
Ok(())
});
@@ -133,8 +128,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.size()?);
Ok(())
});
@@ -145,8 +139,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.content_hash_type()?);
Ok(())
});
@@ -157,8 +150,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.content_hash()?);
Ok(())
});
@@ -169,8 +161,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.description()?);
Ok(())
});
@@ -181,8 +172,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.date()?);
Ok(())
});
@@ -196,8 +186,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.available_socket_types()?);
Ok(())
});
@@ -208,8 +197,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.transferred_bytes()?);
Ok(())
});
@@ -220,8 +208,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.initial_offset()?);
Ok(())
});
@@ -232,16 +219,14 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.uri()?);
Ok(())
});
let fclone = f.clone();
let p = p.on_set(move |iter, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
d.set_uri(iter.read()?)?;
Ok(())
});
@@ -252,8 +237,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.file_collection()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Type_Room_List.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_type_room_list.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Type_Room_List.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_type_room_list.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -20,15 +20,14 @@ where
D::Method: Default,
D::Property: Default,
D::Signal: Default,
T: AsRef<dyn ChannelTypeRoomList>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelTypeRoomList,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.Channel.Type.RoomList", data);
let f = ::std::sync::Arc::new(f);
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
let in_progress = d.get_listing_rooms()?;
let rm = minfo.msg.method_return();
let rm = rm.append1(in_progress);
@@ -40,8 +39,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.list_rooms()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -51,8 +49,7 @@ where
let fclone = f.clone();
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
let dd = fclone(minfo);
let d = dd.as_ref();
let d = fclone(minfo);
d.stop_listing()?;
let rm = minfo.msg.method_return();
Ok(vec![rm])
@@ -65,8 +62,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.server()?);
Ok(())
});

View File

@@ -1,4 +1,4 @@
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Type_Server_Authentication.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_type_server_authentication.rs`, see https://github.com/diwic/dbus-rs
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Type_Server_Authentication.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_type_server_authentication.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
@@ -16,8 +16,8 @@ where
D: tree::DataType,
D::Method: Default,
D::Property: Default,
T: AsRef<dyn ChannelTypeServerAuthentication>,
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
T: ChannelTypeServerAuthentication,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface(
"org.freedesktop.Telepathy.Channel.Type.ServerAuthentication",
@@ -29,8 +29,7 @@ where
let fclone = f.clone();
let p = p.on_get(move |a, pinfo| {
let minfo = pinfo.to_method_info();
let dd = fclone(&minfo);
let d = dd.as_ref();
let d = fclone(&minfo);
a.append(d.authentication_method()?);
Ok(())
});

Some files were not shown because too many files have changed in this diff Show More