Compare commits
67 Commits
338f85b6f6
...
main
Author | SHA1 | Date | |
---|---|---|---|
7707242d10 | |||
bd76603c54 | |||
9e764d72a1 | |||
b9faad742b | |||
370f5076a1 | |||
373311e826 | |||
67a8715a25 | |||
c773146b26 | |||
7b1b8bdc83 | |||
d06badfc96 | |||
8dbd023718 | |||
7cee6348fd | |||
14aa639a4b | |||
efe97a33c4 | |||
d77d04e9b1 | |||
db7ecc6d98 | |||
15174ea03f | |||
aae7607c7f | |||
825f5d90ed | |||
a95be7ee4b | |||
72947bc99d | |||
b511dd873b | |||
667eb3b3f6 | |||
cb463336bc | |||
1e481d4c9a | |||
e5e06c55f9 | |||
576fec63cd | |||
782662b82f | |||
1eefce4f1c | |||
b814a9aab0 | |||
49362a6606 | |||
7003b56ce6 | |||
09afdf51a4 | |||
a202dd84e8 | |||
0f9dcf476b | |||
54a73c8219 | |||
011ee98340 | |||
4a501b2e07 | |||
9473a13b65 | |||
9564a16aa2 | |||
52f13a3589 | |||
64bbaccc3a | |||
53bce50978 | |||
411f34e6ce | |||
169249b716 | |||
e08ec6b476 | |||
640948241a | |||
33d522779a | |||
c0e62ba6de | |||
41309d9f39 | |||
5eea970cf7 | |||
b6fbcfeeb8 | |||
ef43c81955 | |||
ef1342f372 | |||
2a565b3ee7 | |||
9151f64a6d | |||
ad0d95ab40 | |||
baafd12354 | |||
6d79491e32 | |||
04bf72637d | |||
1212ff20e4 | |||
6e3ad7383f | |||
ffb190385e | |||
c643c42fa5 | |||
c861f6fdd9 | |||
40ea57a0cc | |||
5328ae9bd6 |
3001
Cargo.lock
generated
3001
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
10
Cargo.toml
10
Cargo.toml
@@ -3,9 +3,17 @@ 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"
|
||||
dbus = "0.8.2"
|
||||
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
|
||||
|
174
README.md
174
README.md
@@ -14,15 +14,181 @@ 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
|
||||
|
||||
This project is written in Rust, just like the main Delta library, so you'll
|
||||
need a rust compiler to build it.
|
||||
### 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
|
||||
|
||||
It makes use of the `dbus-codegen-rust` crate to convert the
|
||||
[telepathy interface specs](https://github.com/TelepathyIM/telepathy-spec) into
|
||||
@@ -32,10 +198,10 @@ regenerated like so:
|
||||
```bash
|
||||
$ git submodule init telepathy-spec
|
||||
$ git submodule update telepathy-spec
|
||||
$ cargo install dbus-codegen-rust
|
||||
$ cargo install dbus-codegen
|
||||
$ ./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`.
|
||||
attribute is renamed to `tp:typehint`. This will be fixed in the next release.
|
||||
|
70
about.hbs
Normal file
70
about.hbs
Normal file
@@ -0,0 +1,70 @@
|
||||
<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>
|
11
about.toml
Normal file
11
about.toml
Normal file
@@ -0,0 +1,11 @@
|
||||
accepted = [
|
||||
"0BSD",
|
||||
"Apache-2.0",
|
||||
"BSD-2-Clause",
|
||||
"BSD-3-Clause",
|
||||
"ISC",
|
||||
"CC0-1.0",
|
||||
"MIT",
|
||||
"MPL-2.0",
|
||||
"Zlib"
|
||||
]
|
9555
license.html
Normal file
9555
license.html
Normal file
File diff suppressed because it is too large
Load Diff
1
rust-toolchain
Normal file
1
rust-toolchain
Normal file
@@ -0,0 +1 @@
|
||||
nightly-2020-03-12
|
@@ -12,7 +12,7 @@ rm -f "$dest.rs"
|
||||
rm -rf "$dest"
|
||||
mkdir -p "$dest"
|
||||
|
||||
echo "#![allow(unused)]\n#![allow(clippy::all)]" > "$modfile"
|
||||
echo "#![allow(unused)]" > "$modfile"
|
||||
|
||||
for file in $(ls -a $specs/*.xml); do
|
||||
sed -i 's/tp:type=/tp:typehint=/g' "$file"
|
||||
@@ -28,11 +28,12 @@ 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 "\nmod $name;\npub use self::$name::*;" >> "$modfile"
|
||||
echo "\n#[allow(clippy::all)]\nmod $name;\npub use self::$name::*;" >> "$modfile"
|
||||
done
|
||||
|
||||
git -C telepathy-spec checkout -- .
|
||||
|
@@ -0,0 +1,4 @@
|
||||
[D-BUS Service]
|
||||
Name=org.freedesktop.Telepathy.ConnectionManager.padfoot
|
||||
Exec=/usr/lib/telepathy/telepathy-padfoot
|
||||
//SystemdService=telepathy-padfoot.service
|
167
share/icons/hicolor/scalable/apps/im-delta.svg
Normal file
167
share/icons/hicolor/scalable/apps/im-delta.svg
Normal file
@@ -0,0 +1,167 @@
|
||||
<?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>
|
After Width: | Height: | Size: 7.0 KiB |
26
share/telepathy/managers/padfoot.manager
Normal file
26
share/telepathy/managers/padfoot.manager
Normal file
@@ -0,0 +1,26 @@
|
||||
[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;
|
@@ -1,5 +0,0 @@
|
||||
mod connection_manager;
|
||||
pub use self::connection_manager::*;
|
||||
|
||||
mod protocol;
|
||||
pub use self::protocol::*;
|
@@ -1,64 +0,0 @@
|
||||
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())
|
||||
}
|
||||
}
|
@@ -1,2 +0,0 @@
|
||||
pub struct Protocol {}
|
||||
|
91
src/main.rs
91
src/main.rs
@@ -1,67 +1,76 @@
|
||||
mod delta;
|
||||
mod padfoot;
|
||||
mod telepathy;
|
||||
|
||||
//use dbus::tree::{Interface, MTFn, MethodErr};
|
||||
use anyhow::{anyhow, Result};
|
||||
use dbus::{
|
||||
blocking::{stdintf::org_freedesktop_dbus::RequestNameReply, LocalConnection},
|
||||
tree::{Factory, Interface, MTFn, Tree},
|
||||
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,
|
||||
};
|
||||
|
||||
use delta::{CMData, ConnectionManager};
|
||||
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
// TODO: move this to the ConnectionManager?
|
||||
fn run() -> Result<()> {
|
||||
let (cm, msg_r) = ConnectionManager::new();
|
||||
let cm_rc = std::rc::Rc::new(cm);
|
||||
|
||||
const BUS_NAME: &'static str = "org.freedesktop.Telepathy.ConnectionManager.delta";
|
||||
const OBJECT_PATH: &'static str = "/org/freedesktop/Telepathy/ConnectionManager/delta";
|
||||
let proto = Protocol {};
|
||||
let proto_rc = std::rc::Rc::new(proto);
|
||||
|
||||
fn create_tree(cm: &Arc<ConnectionManager>) -> Tree<MTFn<CMData>, CMData> {
|
||||
let f = Factory::new_fn();
|
||||
let f = Factory::new_fn::<()>();
|
||||
let mut tree = f.tree(());
|
||||
|
||||
let iface = telepathy::connection_manager_server(&f, (), |m| {
|
||||
let a: &Arc<ConnectionManager> = m.path.get_data();
|
||||
let b: &ConnectionManager = &a;
|
||||
let cm_iface = telepathy::connection_manager_server(&f, (), move |_| cm_rc.clone());
|
||||
|
||||
b
|
||||
});
|
||||
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());
|
||||
|
||||
tree = tree.add(
|
||||
f.object_path(OBJECT_PATH, cm.clone())
|
||||
f.object_path(CM_OBJECT_PATH, ())
|
||||
.introspectable()
|
||||
.add(iface),
|
||||
.add(cm_iface),
|
||||
);
|
||||
tree = tree.add(
|
||||
f.object_path(PROTO_OBJECT_PATH, ())
|
||||
.introspectable()
|
||||
.add(proto_iface)
|
||||
.add(proto_presence_iface),
|
||||
);
|
||||
tree = tree.add(f.object_path("/", cm.clone()).introspectable());
|
||||
|
||||
tree
|
||||
}
|
||||
|
||||
fn run() -> Result<()> {
|
||||
let cm: ConnectionManager = ConnectionManager {};
|
||||
let tree = create_tree(&Arc::new(cm));
|
||||
tree = tree.add(f.object_path("/", ()).introspectable());
|
||||
|
||||
// Setup DBus connection
|
||||
let mut c = LocalConnection::new_session()?;
|
||||
|
||||
let result = c.request_name(BUS_NAME, false, false, true)?;
|
||||
match result {
|
||||
RequestNameReply::Exists => {
|
||||
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);
|
||||
|
||||
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)?;
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
loop {
|
||||
c.process(Duration::from_secs(1))?;
|
||||
println!("Tick");
|
||||
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!"),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
17
src/padfoot.rs
Normal file
17
src/padfoot.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
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::*;
|
197
src/padfoot/channel.rs
Normal file
197
src/padfoot/channel.rs
Normal file
@@ -0,0 +1,197 @@
|
||||
#[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);
|
||||
}
|
||||
}
|
||||
}
|
98
src/padfoot/channel/channel.rs
Normal file
98
src/padfoot/channel/channel.rs
Normal file
@@ -0,0 +1,98 @@
|
||||
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())
|
||||
}
|
||||
}
|
||||
}
|
139
src/padfoot/channel/messages.rs
Normal file
139
src/padfoot/channel/messages.rs
Normal file
@@ -0,0 +1,139 @@
|
||||
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
|
||||
}
|
||||
}
|
74
src/padfoot/channel/type_text.rs
Normal file
74
src/padfoot/channel/type_text.rs
Normal file
@@ -0,0 +1,74 @@
|
||||
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())
|
||||
}
|
||||
}
|
570
src/padfoot/connection.rs
Normal file
570
src/padfoot/connection.rs
Normal file
@@ -0,0 +1,570 @@
|
||||
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))
|
||||
}
|
||||
}
|
107
src/padfoot/connection/avatars.rs
Normal file
107
src/padfoot/connection/avatars.rs
Normal file
@@ -0,0 +1,107 @@
|
||||
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)
|
||||
}
|
||||
}
|
354
src/padfoot/connection/connection.rs
Normal file
354
src/padfoot/connection/connection.rs
Normal file
@@ -0,0 +1,354 @@
|
||||
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)
|
||||
}
|
||||
}
|
129
src/padfoot/connection/contact_list.rs
Normal file
129
src/padfoot/connection/contact_list.rs
Normal file
@@ -0,0 +1,129 @@
|
||||
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)
|
||||
}
|
||||
}
|
108
src/padfoot/connection/contacts.rs
Normal file
108
src/padfoot/connection/contacts.rs
Normal file
@@ -0,0 +1,108 @@
|
||||
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(),
|
||||
])
|
||||
}
|
||||
}
|
52
src/padfoot/connection/escape.rs
Normal file
52
src/padfoot/connection/escape.rs
Normal file
@@ -0,0 +1,52 @@
|
||||
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");
|
||||
}
|
||||
}
|
137
src/padfoot/connection/requests.rs
Normal file
137
src/padfoot/connection/requests.rs
Normal file
@@ -0,0 +1,137 @@
|
||||
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())
|
||||
}
|
||||
}
|
60
src/padfoot/connection/simple_presence.rs
Normal file
60
src/padfoot/connection/simple_presence.rs
Normal file
@@ -0,0 +1,60 @@
|
||||
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)
|
||||
}
|
||||
}
|
180
src/padfoot/connection_manager.rs
Normal file
180
src/padfoot/connection_manager.rs
Normal file
@@ -0,0 +1,180 @@
|
||||
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![])
|
||||
}
|
||||
}
|
138
src/padfoot/message.rs
Normal file
138
src/padfoot/message.rs
Normal file
@@ -0,0 +1,138 @@
|
||||
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])
|
||||
}
|
183
src/padfoot/protocol.rs
Normal file
183
src/padfoot/protocol.rs
Normal file
@@ -0,0 +1,183 @@
|
||||
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())
|
||||
}
|
||||
}
|
41
src/padfoot/var_arg.rs
Normal file
41
src/padfoot/var_arg.rs
Normal file
@@ -0,0 +1,41 @@
|
||||
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()
|
||||
}
|
122
src/telepathy.rs
122
src/telepathy.rs
@@ -1,365 +1,485 @@
|
||||
#![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::*;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -63,14 +63,15 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: Account,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn Account>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.remove()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -84,7 +85,8 @@ where
|
||||
let set: ::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>> =
|
||||
i.read()?;
|
||||
let unset: Vec<&str> = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let reconnect_required = d.update_parameters(set, unset)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(reconnect_required);
|
||||
@@ -98,7 +100,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.reconnect()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -111,7 +114,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.interfaces()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -122,14 +126,16 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
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 d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_display_name(iter.read()?)?;
|
||||
Ok(())
|
||||
});
|
||||
@@ -140,14 +146,16 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.icon()?);
|
||||
Ok(())
|
||||
});
|
||||
let fclone = f.clone();
|
||||
let p = p.on_set(move |iter, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_icon(iter.read()?)?;
|
||||
Ok(())
|
||||
});
|
||||
@@ -158,7 +166,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.valid()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -169,14 +178,16 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.enabled()?);
|
||||
Ok(())
|
||||
});
|
||||
let fclone = f.clone();
|
||||
let p = p.on_set(move |iter, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_enabled(iter.read()?)?;
|
||||
Ok(())
|
||||
});
|
||||
@@ -187,14 +198,16 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.nickname()?);
|
||||
Ok(())
|
||||
});
|
||||
let fclone = f.clone();
|
||||
let p = p.on_set(move |iter, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_nickname(iter.read()?)?;
|
||||
Ok(())
|
||||
});
|
||||
@@ -205,14 +218,16 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.service()?);
|
||||
Ok(())
|
||||
});
|
||||
let fclone = f.clone();
|
||||
let p = p.on_set(move |iter, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_service(iter.read()?)?;
|
||||
Ok(())
|
||||
});
|
||||
@@ -227,7 +242,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.parameters()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -238,14 +254,16 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
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 d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_automatic_presence(iter.read()?)?;
|
||||
Ok(())
|
||||
});
|
||||
@@ -256,14 +274,16 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
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 d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_connect_automatically(iter.read()?)?;
|
||||
Ok(())
|
||||
});
|
||||
@@ -274,7 +294,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.connection()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -285,7 +306,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.connection_status()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -296,7 +318,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.connection_status_reason()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -307,7 +330,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.connection_error()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -322,7 +346,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.connection_error_details()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -333,7 +358,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.current_presence()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -344,14 +370,16 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
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 d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_requested_presence(iter.read()?)?;
|
||||
Ok(())
|
||||
});
|
||||
@@ -362,7 +390,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.changing_presence()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -373,7 +402,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.normalized_name()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -384,7 +414,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.has_been_online()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -395,14 +426,16 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.supersedes()?);
|
||||
Ok(())
|
||||
});
|
||||
let fclone = f.clone();
|
||||
let p = p.on_set(move |iter, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_supersedes(iter.read()?)?;
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -21,8 +21,8 @@ where
|
||||
D: tree::DataType,
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
T: AccountInterfaceAddressing,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn AccountInterfaceAddressing>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Account.Interface.Addressing",
|
||||
@@ -34,7 +34,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let urischeme: &str = i.read()?;
|
||||
let association: bool = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_urischeme_association(urischeme, association)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -49,7 +50,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.urischemes()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -18,8 +18,8 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: AccountInterfaceAvatar,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn AccountInterfaceAvatar>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Account.Interface.Avatar", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -28,14 +28,16 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.avatar()?);
|
||||
Ok(())
|
||||
});
|
||||
let fclone = f.clone();
|
||||
let p = p.on_set(move |iter, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_avatar(iter.read()?)?;
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: AccountInterfaceExternalPasswordStorageDRAFT,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn AccountInterfaceExternalPasswordStorageDRAFT>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Account.Interface.ExternalPasswordStorage.DRAFT",
|
||||
@@ -27,7 +27,8 @@ where
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.forget_password()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -40,7 +41,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.password_saved()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -16,8 +16,8 @@ where
|
||||
D: tree::DataType,
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
T: AccountInterfaceHiddenDRAFT1,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn AccountInterfaceHiddenDRAFT1>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Account.Interface.Hidden.DRAFT1",
|
||||
@@ -29,7 +29,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.hidden()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -26,8 +26,8 @@ where
|
||||
D: tree::DataType,
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
T: AccountInterfaceStorage,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn AccountInterfaceStorage>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Account.Interface.Storage", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -36,7 +36,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.storage_provider()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -48,7 +49,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.storage_identifier()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -63,7 +65,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.storage_specific_information()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -74,7 +77,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.storage_restrictions()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -28,8 +28,8 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: AccountManager,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn AccountManager>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.AccountManager", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -43,7 +43,8 @@ where
|
||||
i.read()?;
|
||||
let properties: ::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>> =
|
||||
i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let account = d.create_account(
|
||||
connection_manager,
|
||||
protocol,
|
||||
@@ -69,7 +70,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.interfaces()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -80,7 +82,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.valid_accounts()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -91,7 +94,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.invalid_accounts()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -102,7 +106,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.supported_account_properties()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: AccountManagerInterfaceHiddenDRAFT1,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn AccountManagerInterfaceHiddenDRAFT1>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.AccountManager.Interface.Hidden.DRAFT1",
|
||||
@@ -31,7 +31,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.valid_hidden_accounts()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -42,7 +43,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.invalid_hidden_accounts()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -38,8 +38,8 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: AuthenticationTLSCertificate,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn AuthenticationTLSCertificate>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Authentication.TLSCertificate",
|
||||
@@ -48,7 +48,8 @@ where
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.accept()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -64,7 +65,8 @@ where
|
||||
&str,
|
||||
::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>,
|
||||
)> = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.reject(rejections)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -78,7 +80,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.state()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -93,7 +96,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.rejections()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -104,7 +108,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.certificate_type()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -115,7 +120,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.certificate_chain_data()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -22,14 +22,15 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: Call1Content,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn Call1Content>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.remove()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -42,7 +43,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.interfaces()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -53,7 +55,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.name()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -64,7 +67,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.type_()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -75,7 +79,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.disposition()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -86,7 +91,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.streams()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: Call1ContentInterfaceAudioControl,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn Call1ContentInterfaceAudioControl>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Call1.Content.Interface.AudioControl",
|
||||
@@ -31,7 +31,8 @@ where
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let volume: i32 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.report_input_volume(volume)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -44,7 +45,8 @@ where
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let volume: i32 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.report_output_volume(volume)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -58,7 +60,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.requested_input_volume()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -69,7 +72,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.requested_output_volume()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: Call1ContentInterfaceDTMF,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn Call1ContentInterfaceDTMF>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Call1.Content.Interface.DTMF",
|
||||
@@ -33,7 +33,8 @@ where
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let event: u8 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.start_tone(event)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -44,7 +45,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.stop_tone()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -56,7 +58,8 @@ where
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let tones: &str = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.multiple_tones(tones)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -70,7 +73,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.currently_sending_tones()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -81,7 +85,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.deferred_tones()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: Call1ContentInterfaceMedia,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn Call1ContentInterfaceMedia>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Call1.Content.Interface.Media",
|
||||
@@ -67,7 +67,8 @@ where
|
||||
&str,
|
||||
arg::Variant<Box<dyn arg::RefArg>>,
|
||||
> = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.update_local_media_description(media_description)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -81,7 +82,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let event: u8 = i.read()?;
|
||||
let state: u32 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.acknowledge_dtmfchange(event, state)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -95,7 +97,8 @@ 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.fail(reason)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -112,7 +115,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.remote_media_descriptions()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -126,7 +130,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.local_media_descriptions()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -140,7 +145,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.media_description_offer()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -151,7 +157,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.packetization()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -162,7 +169,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.current_dtmfevent()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -173,7 +181,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.current_dtmfstate()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: Call1ContentInterfaceVideoControl,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn Call1ContentInterfaceVideoControl>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl",
|
||||
@@ -34,7 +34,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.video_resolution()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -45,7 +46,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.bitrate()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -56,7 +58,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.framerate()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -67,7 +70,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.mtu()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -78,7 +82,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.manual_key_frames()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: Call1ContentMediaDescription,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn Call1ContentMediaDescription>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Call1.Content.MediaDescription",
|
||||
@@ -56,7 +56,8 @@ where
|
||||
&str,
|
||||
arg::Variant<Box<dyn arg::RefArg>>,
|
||||
> = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.accept(local_media_description)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -69,7 +70,8 @@ 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.reject(reason)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -83,7 +85,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.interfaces()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -94,7 +97,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.further_negotiation_required()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -105,7 +109,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.has_remote_information()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -123,7 +128,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.codecs()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -134,7 +140,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.remote_contact()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -146,7 +153,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.ssrcs()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: Call1ContentMediaDescriptionInterfaceRTCPExtendedReports,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn Call1ContentMediaDescriptionInterfaceRTCPExtendedReports>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTCPExtendedReports",
|
||||
@@ -35,7 +35,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.loss_rlemax_size()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -46,7 +47,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.duplicate_rlemax_size()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -57,7 +59,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.packet_receipt_times_max_size()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -68,7 +71,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.dlrrmax_size()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -79,7 +83,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.rttmode()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -90,7 +95,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.statistics_flags()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -101,7 +107,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.enable_metrics()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: Call1ContentMediaDescriptionInterfaceRTCPFeedback,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn Call1ContentMediaDescriptionInterfaceRTCPFeedback>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTCPFeedback",
|
||||
@@ -39,7 +39,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.feedback_messages()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -50,7 +51,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.does_avpf()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: Call1ContentMediaDescriptionInterfaceRTPHeaderExtensions,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn Call1ContentMediaDescriptionInterfaceRTPHeaderExtensions>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTPHeaderExtensions",
|
||||
@@ -30,7 +30,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.header_extensions()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -18,8 +18,8 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: Call1InterfaceMute,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn Call1InterfaceMute>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Call1.Interface.Mute", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -27,7 +27,8 @@ where
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let muted: bool = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.request_muted(muted)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -41,7 +42,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.local_mute_state()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -25,8 +25,8 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: Call1Stream,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn Call1Stream>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Call1.Stream", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -34,7 +34,8 @@ where
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let send: bool = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_sending(send)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -48,7 +49,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let contact: u32 = i.read()?;
|
||||
let receive: bool = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.request_receiving(contact, receive)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -63,7 +65,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.interfaces()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -75,7 +78,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.remote_members()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -89,7 +93,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.remote_member_identifiers()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -100,7 +105,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.local_sending_state()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -111,7 +117,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.can_request_receiving()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -98,8 +98,8 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: Call1StreamEndpoint,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn Call1StreamEndpoint>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Call1.Stream.Endpoint", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -118,7 +118,8 @@ where
|
||||
u32,
|
||||
::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>,
|
||||
) = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_selected_candidate_pair(local_candidate, remote_candidate)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -133,7 +134,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let component: u32 = i.read()?;
|
||||
let state: u32 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_endpoint_state_(component, state)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -158,7 +160,8 @@ where
|
||||
u32,
|
||||
::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>,
|
||||
) = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.accept_selected_candidate_pair(local_candidate, remote_candidate)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -183,7 +186,8 @@ where
|
||||
u32,
|
||||
::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>,
|
||||
) = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.reject_selected_candidate_pair(local_candidate, remote_candidate)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -197,7 +201,8 @@ where
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let controlling: bool = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_controlling_(controlling)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -211,7 +216,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.remote_credentials()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -227,7 +233,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.remote_candidates()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -251,7 +258,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.selected_candidate_pairs()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -263,7 +271,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.endpoint_state()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -274,7 +283,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.transport()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -285,7 +295,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.controlling()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -296,7 +307,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.is_icelite()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: Call1StreamInterfaceMedia,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn Call1StreamInterfaceMedia>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Call1.Stream.Interface.Media",
|
||||
@@ -79,7 +79,8 @@ where
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let state: u32 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.complete_sending_state_change(state)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -94,7 +95,8 @@ where
|
||||
let reason: u32 = i.read()?;
|
||||
let error: &str = i.read()?;
|
||||
let message: &str = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.report_sending_failure(reason, error, message)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -109,7 +111,8 @@ where
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let state: u32 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.complete_receiving_state_change(state)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -124,7 +127,8 @@ where
|
||||
let reason: u32 = i.read()?;
|
||||
let error: &str = i.read()?;
|
||||
let message: &str = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.report_receiving_failure(reason, error, message)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -140,7 +144,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let username: &str = i.read()?;
|
||||
let password: &str = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_credentials(username, password)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -159,7 +164,8 @@ where
|
||||
u32,
|
||||
::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>,
|
||||
)> = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.add_candidates(candidates)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -170,7 +176,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.finish_initial_candidates()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -182,7 +189,8 @@ 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.fail(reason)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -196,7 +204,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.sending_state()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -207,7 +216,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.receiving_state()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -218,7 +228,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.transport()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -234,7 +245,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.local_candidates()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -245,7 +257,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.local_credentials()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -256,7 +269,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.stunservers()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -271,7 +285,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.relay_info()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -282,7 +297,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.has_server_info()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -293,7 +309,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.endpoints()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -304,7 +321,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.icerestart_pending()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -28,14 +28,15 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: Channel,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn Channel>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.close()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -45,7 +46,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let channel_type = d.get_channel_type()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(channel_type);
|
||||
@@ -57,7 +59,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let (target_handle_type, target_handle) = d.get_handle()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(target_handle_type);
|
||||
@@ -71,7 +74,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let interfaces = d.get_interfaces()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(interfaces);
|
||||
@@ -86,7 +90,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.channel_type()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -97,7 +102,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.interfaces()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -108,7 +114,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.target_handle()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -119,7 +126,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.target_id()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -130,7 +138,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.target_handle_type()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -141,7 +150,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.requested()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -152,7 +162,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.initiator_handle()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -163,7 +174,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.initiator_id()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -16,8 +16,8 @@ where
|
||||
D: tree::DataType,
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
T: ChannelBundleDRAFT,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelBundleDRAFT>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.ChannelBundle.DRAFT", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -26,7 +26,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.interfaces()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -33,8 +33,8 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: ChannelDispatchOperation,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelDispatchOperation>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.ChannelDispatchOperation", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -42,7 +42,8 @@ where
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let handler: &str = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.handle_with(handler)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -53,7 +54,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.claim()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -66,7 +68,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let handler: &str = i.read()?;
|
||||
let user_action_time: i64 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.handle_with_time(handler, user_action_time)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -81,7 +84,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.interfaces()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -92,7 +96,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.connection()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -103,7 +108,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.account()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -117,7 +123,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.channels()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -128,7 +135,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.possible_handlers()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -64,8 +64,8 @@ where
|
||||
D: tree::DataType,
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
T: ChannelDispatcher,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelDispatcher>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.ChannelDispatcher", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -79,7 +79,8 @@ where
|
||||
> = i.read()?;
|
||||
let user_action_time: i64 = i.read()?;
|
||||
let preferred_handler: &str = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let request = d.create_channel(
|
||||
account,
|
||||
requested_properties,
|
||||
@@ -108,7 +109,8 @@ where
|
||||
> = i.read()?;
|
||||
let user_action_time: i64 = i.read()?;
|
||||
let preferred_handler: &str = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let request = d.ensure_channel(
|
||||
account,
|
||||
requested_properties,
|
||||
@@ -139,7 +141,8 @@ where
|
||||
let preferred_handler: &str = i.read()?;
|
||||
let hints: ::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>> =
|
||||
i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let request = d.create_channel_with_hints(
|
||||
account,
|
||||
requested_properties,
|
||||
@@ -172,7 +175,8 @@ where
|
||||
let preferred_handler: &str = i.read()?;
|
||||
let hints: ::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>> =
|
||||
i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let request = d.ensure_channel_with_hints(
|
||||
account,
|
||||
requested_properties,
|
||||
@@ -199,7 +203,8 @@ where
|
||||
let channels: Vec<dbus::Path> = i.read()?;
|
||||
let user_action_time: i64 = i.read()?;
|
||||
let preferred_handler: &str = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let (delegated, not_delegated) =
|
||||
d.delegate_channels(channels, user_action_time, preferred_handler)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
@@ -220,7 +225,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let channel: dbus::Path = i.read()?;
|
||||
let user_action_time: i64 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.present_channel(channel, user_action_time)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -235,7 +241,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.interfaces()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -246,7 +253,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.supports_request_hints()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: ChannelDispatcherInterfaceMessages1,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelDispatcherInterfaceMessages1>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.ChannelDispatcher.Interface.Messages1",
|
||||
@@ -37,7 +37,8 @@ where
|
||||
let message: Vec<::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>> =
|
||||
i.read()?;
|
||||
let flags: u32 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let token = d.send_message(account, target_id, message, flags)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(token);
|
||||
|
@@ -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 -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 -a AsRefClosure -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: ChannelDispatcherInterfaceOperationList,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelDispatcherInterfaceOperationList>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.ChannelDispatcher.Interface.OperationList",
|
||||
@@ -41,7 +41,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.dispatch_operations()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -16,8 +16,8 @@ where
|
||||
D: tree::DataType,
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
T: ChannelFUTURE,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelFUTURE>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Channel.FUTURE", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -26,7 +26,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.bundle()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
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: ChannelHandler,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelHandler>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.ChannelHandler", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -37,7 +37,8 @@ where
|
||||
let channel: dbus::Path = i.read()?;
|
||||
let handle_type: u32 = i.read()?;
|
||||
let handle: u32 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.handle_channel(
|
||||
bus_name,
|
||||
connection,
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -19,8 +19,8 @@ where
|
||||
D: tree::DataType,
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
T: ChannelInterfaceAddressing1,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceAddressing1>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Channel.Interface.Addressing1",
|
||||
@@ -32,7 +32,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.target_vcard_field()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -43,7 +44,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.target_urischeme()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -54,7 +56,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.target_vcard_address()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -65,7 +68,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.target_uri()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -18,8 +18,8 @@ where
|
||||
D: tree::DataType,
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
T: ChannelInterfaceAnonymity,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceAnonymity>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Channel.Interface.Anonymity",
|
||||
@@ -31,7 +31,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.anonymity_modes()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -42,7 +43,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.anonymity_mandatory()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -53,7 +55,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.anonymous_id()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: ChannelInterfaceCallState,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceCallState>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Channel.Interface.CallState",
|
||||
@@ -26,7 +26,8 @@ where
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let states = d.get_call_states()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(states);
|
||||
|
@@ -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 -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 -a AsRefClosure -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: ChannelInterfaceCaptchaAuthentication1,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceCaptchaAuthentication1>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Channel.Interface.CaptchaAuthentication1",
|
||||
@@ -43,7 +43,8 @@ where
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let (captcha_info, number_required, language) = d.get_captchas()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(captcha_info);
|
||||
@@ -62,7 +63,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let id: u32 = i.read()?;
|
||||
let mime_type: &str = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let captcha_data = d.get_captcha_data(id, mime_type)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(captcha_data);
|
||||
@@ -78,7 +80,8 @@ 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.answer_captchas(answers)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -92,7 +95,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let reason: u32 = i.read()?;
|
||||
let debug_message: &str = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.cancel_captcha(reason, debug_message)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -107,7 +111,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.can_retry_captcha()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -118,7 +123,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.captcha_status()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -129,7 +135,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.captcha_error()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -144,7 +151,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.captcha_error_details()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: ChannelInterfaceChatState,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceChatState>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Channel.Interface.ChatState",
|
||||
@@ -30,7 +30,8 @@ where
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let state: u32 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_chat_state(state)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -45,7 +46,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.chat_states()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -24,8 +24,8 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: ChannelInterfaceConference,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceConference>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Channel.Interface.Conference",
|
||||
@@ -37,7 +37,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.channels()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -48,7 +49,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.initial_channels()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -59,7 +61,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.initial_invitee_handles()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -70,7 +73,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.initial_invitee_ids()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -81,7 +85,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.invitation_message()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -95,7 +100,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.original_channels()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: ChannelInterfaceCredentialsStorageDRAFT,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceCredentialsStorageDRAFT>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Channel.Interface.CredentialsStorage.DRAFT",
|
||||
@@ -27,7 +27,8 @@ where
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let store: bool = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.store_credentials(store)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
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: ChannelInterfaceDestroyable,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceDestroyable>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Channel.Interface.Destroyable",
|
||||
@@ -25,7 +25,8 @@ where
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.destroy()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -22,8 +22,8 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: ChannelInterfaceDTMF,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceDTMF>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.DTMF", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -32,7 +32,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let stream_id: u32 = i.read()?;
|
||||
let event: u8 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.start_tone(stream_id, event)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -46,7 +47,8 @@ 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.stop_tone(stream_id)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -59,7 +61,8 @@ where
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let tones: &str = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.multiple_tones(tones)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -73,7 +76,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.currently_sending_tones()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -84,7 +88,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.initial_tones()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -95,7 +100,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.deferred_tones()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: ChannelInterfaceFileTransferMetadata,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceFileTransferMetadata>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Channel.Interface.FileTransfer.Metadata",
|
||||
@@ -36,14 +36,16 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
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 d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_service_name(iter.read()?)?;
|
||||
Ok(())
|
||||
});
|
||||
@@ -57,14 +59,16 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.metadata()?);
|
||||
Ok(())
|
||||
});
|
||||
let fclone = f.clone();
|
||||
let p = p.on_set(move |iter, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_metadata(iter.read()?)?;
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -43,8 +43,8 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: ChannelInterfaceGroup,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceGroup>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.Group", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -53,7 +53,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let contacts: Vec<u32> = i.read()?;
|
||||
let message: &str = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.add_members(contacts, message)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -65,7 +66,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let (members, local_pending, remote_pending) = d.get_all_members()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(members);
|
||||
@@ -81,7 +83,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let group_flags = d.get_group_flags()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(group_flags);
|
||||
@@ -95,7 +98,8 @@ 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let owners = d.get_handle_owners(handles)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(owners);
|
||||
@@ -108,7 +112,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let handles = d.get_local_pending_members()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(handles);
|
||||
@@ -120,7 +125,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let info = d.get_local_pending_members_with_info()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(info);
|
||||
@@ -132,7 +138,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let handles = d.get_members()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(handles);
|
||||
@@ -144,7 +151,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let handles = d.get_remote_pending_members()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(handles);
|
||||
@@ -156,7 +164,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let self_handle = d.get_self_handle()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(self_handle);
|
||||
@@ -171,7 +180,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let contacts: Vec<u32> = i.read()?;
|
||||
let message: &str = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.remove_members(contacts, message)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -187,7 +197,8 @@ where
|
||||
let contacts: Vec<u32> = i.read()?;
|
||||
let message: &str = i.read()?;
|
||||
let reason: u32 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.remove_members_with_reason(contacts, message, reason)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -203,7 +214,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.group_flags()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -215,7 +227,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.handle_owners()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -227,7 +240,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.local_pending_members()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -238,7 +252,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.members()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -249,7 +264,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.remote_pending_members()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -260,7 +276,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.self_handle()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -274,7 +291,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.member_identifiers()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -17,14 +17,15 @@ where
|
||||
D: tree::DataType,
|
||||
D::Method: Default,
|
||||
D::Signal: Default,
|
||||
T: ChannelInterfaceHold,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceHold>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let (hold_state, reason) = d.get_hold_state()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(hold_state);
|
||||
@@ -40,7 +41,8 @@ where
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let hold: bool = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.request_hold(hold)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
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: ChannelInterfaceHTMLDRAFT,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceHTMLDRAFT>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Channel.Interface.HTML.DRAFT",
|
||||
|
@@ -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 -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 -a AsRefClosure -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: ChannelInterfaceMediaSignalling,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceMediaSignalling>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Channel.Interface.MediaSignalling",
|
||||
@@ -26,7 +26,8 @@ where
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let session_handlers = d.get_session_handlers()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(session_handlers);
|
||||
|
@@ -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 -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 -a AsRefClosure -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: ChannelInterfaceMergeableConferenceDRAFT,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceMergeableConferenceDRAFT>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Channel.Interface.MergeableConference.DRAFT",
|
||||
@@ -27,7 +27,8 @@ 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.merge(channel)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -39,8 +39,8 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: ChannelInterfaceMessages,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceMessages>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.Messages", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -50,7 +50,8 @@ where
|
||||
let message: Vec<::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>> =
|
||||
i.read()?;
|
||||
let flags: u32 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let token = d.send_message(message, flags)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(token);
|
||||
@@ -67,7 +68,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let message_id: u32 = i.read()?;
|
||||
let parts: Vec<u32> = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let content = d.get_pending_message_content(message_id, parts)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(content);
|
||||
@@ -84,7 +86,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.supported_content_types()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -95,7 +98,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.message_types()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -106,7 +110,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.message_part_support_flags()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -117,7 +122,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.pending_messages()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -128,7 +134,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.delivery_reporting_support()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -17,14 +17,15 @@ where
|
||||
D: tree::DataType,
|
||||
D::Method: Default,
|
||||
D::Signal: Default,
|
||||
T: ChannelInterfacePassword,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfacePassword>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let password_flags = d.get_password_flags()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(password_flags);
|
||||
@@ -38,7 +39,8 @@ where
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let password: &str = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let correct = d.provide_password(password)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(correct);
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -29,8 +29,8 @@ where
|
||||
D: tree::DataType,
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
T: ChannelInterfacePicture1,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfacePicture1>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.Picture1", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -39,7 +39,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let picture: Vec<u8> = i.read()?;
|
||||
let mimetype: &str = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_picture(picture, mimetype)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -54,7 +55,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.picture()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -65,7 +67,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.actor()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -76,7 +79,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.actor_handle()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -87,7 +91,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.timestamp()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -98,7 +103,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.can_set()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -109,7 +115,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.supported_mimetypes()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -120,7 +127,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.minimum_height()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -131,7 +139,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.minimum_width()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -142,7 +151,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.recommended_height()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -153,7 +163,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.recommended_width()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -164,7 +175,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.maximum_height()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -175,7 +187,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.maximum_width()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -186,7 +199,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.maximum_bytes()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -20,8 +20,8 @@ where
|
||||
D: tree::DataType,
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
T: ChannelInterfaceRoom2,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceRoom2>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.Room2", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -30,7 +30,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.room_name()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -41,7 +42,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.server()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -52,7 +54,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.creator()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -63,7 +66,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.creator_handle()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -74,7 +78,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.creation_timestamp()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: ChannelInterfaceRoomConfig1,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceRoomConfig1>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Channel.Interface.RoomConfig1",
|
||||
@@ -46,7 +46,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let properties: ::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>> =
|
||||
i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.update_configuration(properties)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -60,7 +61,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.anonymous()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -71,7 +73,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.invite_only()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -82,7 +85,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.limit()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -93,7 +97,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.moderated()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -104,7 +109,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.title()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -115,7 +121,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.description()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -126,7 +133,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.persistent()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -137,7 +145,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.private()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -148,7 +157,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.password_protected()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -159,7 +169,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.password()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -170,7 +181,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.password_hint()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -181,7 +193,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.can_update_configuration()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -192,7 +205,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.mutable_properties()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -203,7 +217,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.configuration_retrieved()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: ChannelInterfaceSASLAuthentication,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceSASLAuthentication>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication",
|
||||
@@ -52,7 +52,8 @@ where
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let mechanism: &str = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.start_mechanism(mechanism)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -66,7 +67,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let mechanism: &str = i.read()?;
|
||||
let initial_data: Vec<u8> = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.start_mechanism_with_data(mechanism, initial_data)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -80,7 +82,8 @@ 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.respond(response_data)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -91,7 +94,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.accept_sasl()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -104,7 +108,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let reason: u32 = i.read()?;
|
||||
let debug_message: &str = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.abort_sasl(reason, debug_message)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -119,7 +124,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.available_mechanisms()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -130,7 +136,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.has_initial_data()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -141,7 +148,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.can_try_again()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -152,7 +160,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.saslstatus()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -163,7 +172,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.saslerror()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -178,7 +188,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.saslerror_details()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -189,7 +200,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.authorization_identity()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -200,7 +212,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.default_username()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -211,7 +224,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.default_realm()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -222,7 +236,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.may_save_response()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -17,8 +17,8 @@ where
|
||||
D: tree::DataType,
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
T: ChannelInterfaceSecurable,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceSecurable>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Channel.Interface.Securable",
|
||||
@@ -30,7 +30,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.encrypted()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -41,7 +42,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.verified()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: ChannelInterfaceServicePoint,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceServicePoint>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Channel.Interface.ServicePoint",
|
||||
@@ -31,7 +31,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.initial_service_point()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -42,7 +43,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.current_service_point()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -22,8 +22,8 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: ChannelInterfaceSMS,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceSMS>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.SMS", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -32,7 +32,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let message: Vec<::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>> =
|
||||
i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let (chunks_required, remaining_characters, estimated_cost) = d.get_smslength(message)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(chunks_required);
|
||||
@@ -52,7 +53,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.flash()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -63,7 +65,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.smschannel()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
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: ChannelInterfaceSplittableDRAFT,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceSplittableDRAFT>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Channel.Interface.Splittable.DRAFT",
|
||||
@@ -25,7 +25,8 @@ where
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.split()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -21,8 +21,8 @@ where
|
||||
D: tree::DataType,
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
T: ChannelInterfaceSubject2,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceSubject2>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.Subject2", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -30,7 +30,8 @@ where
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let subject: &str = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_subject(subject)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -44,7 +45,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.subject()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -55,7 +57,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.actor()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -66,7 +69,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.actor_handle()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -77,7 +81,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.timestamp()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -88,7 +93,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.can_set()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
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: ChannelInterfaceTransfer,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceTransfer>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.Transfer", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -25,7 +25,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let member: u32 = i.read()?;
|
||||
let destination: u32 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.transfer(member, destination)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -23,8 +23,8 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: ChannelInterfaceTube,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelInterfaceTube>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Channel.Interface.Tube", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -37,7 +37,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.parameters()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -48,7 +49,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.state()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -34,14 +34,15 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: ChannelRequest,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelRequest>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.proceed()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -51,7 +52,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.cancel()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -64,7 +66,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.account()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -75,7 +78,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.user_action_time()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -86,7 +90,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.preferred_handler()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -101,7 +106,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.requests()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -112,7 +118,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.interfaces()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -127,7 +134,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.hints()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// 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
|
||||
// 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
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -52,14 +52,15 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: ChannelTypeCall1,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelTypeCall1>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_ringing()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -69,7 +70,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_queued()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -79,7 +81,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.accept()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -93,7 +96,8 @@ where
|
||||
let reason: u32 = i.read()?;
|
||||
let detailed_hangup_reason: &str = i.read()?;
|
||||
let message: &str = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.hangup(reason, detailed_hangup_reason, message)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -110,7 +114,8 @@ where
|
||||
let content_name: &str = i.read()?;
|
||||
let content_type: u32 = i.read()?;
|
||||
let initial_direction: u32 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let content = d.add_content(content_name, content_type, initial_direction)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(content);
|
||||
@@ -128,7 +133,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.contents()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -143,7 +149,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.call_state_details()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -154,7 +161,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.call_state()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -165,7 +173,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.call_flags()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -176,7 +185,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.call_state_reason()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -187,7 +197,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.hardware_streaming()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -199,7 +210,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.call_members()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -213,7 +225,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.member_identifiers()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -224,7 +237,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.initial_transport()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -235,7 +249,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.initial_audio()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -246,7 +261,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.initial_video()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -257,7 +273,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.initial_audio_name()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -268,7 +285,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.initial_video_name()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -279,7 +297,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.mutable_contents()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: ChannelTypeContactList,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelTypeContactList>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Channel.Type.ContactList", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
|
@@ -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 -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 -a AsRefClosure -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: ChannelTypeContactSearch,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelTypeContactSearch>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Channel.Type.ContactSearch", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -33,7 +33,8 @@ 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.search(terms)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -44,7 +45,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.more()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -54,7 +56,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.stop()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -67,7 +70,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.search_state()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -78,7 +82,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.limit()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -89,7 +94,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.available_search_keys()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -100,7 +106,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.server()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: ChannelTypeDBusTube,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelTypeDBusTube>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Channel.Type.DBusTube", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -36,7 +36,8 @@ where
|
||||
let parameters: ::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>> =
|
||||
i.read()?;
|
||||
let access_control: u32 = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let address = d.offer(parameters, access_control)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(address);
|
||||
@@ -52,7 +53,8 @@ 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let address = d.accept(access_control)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(address);
|
||||
@@ -68,7 +70,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.service_name()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -80,7 +83,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.dbus_names()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -91,7 +95,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.supported_access_controls()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: ChannelTypeFileTransfer,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelTypeFileTransfer>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface("org.freedesktop.Telepathy.Channel.Type.FileTransfer", data);
|
||||
let f = ::std::sync::Arc::new(f);
|
||||
@@ -57,7 +57,8 @@ 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let address = d.accept_file(address_type, access_control, access_control_param, offset)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(address);
|
||||
@@ -77,7 +78,8 @@ 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let address = d.provide_file(address_type, access_control, access_control_param)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(address);
|
||||
@@ -95,7 +97,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.state()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -106,7 +109,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.content_type()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -117,7 +121,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.filename()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -128,7 +133,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.size()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -139,7 +145,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.content_hash_type()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -150,7 +157,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.content_hash()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -161,7 +169,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.description()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -172,7 +181,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.date()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -186,7 +196,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.available_socket_types()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -197,7 +208,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.transferred_bytes()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -208,7 +220,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.initial_offset()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -219,14 +232,16 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.uri()?);
|
||||
Ok(())
|
||||
});
|
||||
let fclone = f.clone();
|
||||
let p = p.on_set(move |iter, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_uri(iter.read()?)?;
|
||||
Ok(())
|
||||
});
|
||||
@@ -237,7 +252,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.file_collection()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -o src/telepathy/channel_type_room_list.rs`, see https://github.com/diwic/dbus-rs
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -20,14 +20,15 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: ChannelTypeRoomList,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelTypeRoomList>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> 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 d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let in_progress = d.get_listing_rooms()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(in_progress);
|
||||
@@ -39,7 +40,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.list_rooms()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -49,7 +51,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.stop_listing()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -62,7 +65,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.server()?);
|
||||
Ok(())
|
||||
});
|
||||
|
@@ -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 -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 -a AsRefClosure -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: ChannelTypeServerAuthentication,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ChannelTypeServerAuthentication>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Channel.Type.ServerAuthentication",
|
||||
@@ -29,7 +29,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.authentication_method()?);
|
||||
Ok(())
|
||||
});
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user