Telepathy for Delta Chat

Who

Authored by Nick Thomas under the MIT License.

What

Delta Chat is IM over email. Telepathy is a framework for abstracting over multiple IM protocols. This project glues the two together, allowing 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. 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:

  • Connect to DBUS
  • Advertise enough properties / interfaces to become visible in Empathy
  • Connect to deltachat-core-rust
  • Set up an account via autoconfiguration
  • Appear as online in Empathy
  • Disconnect!
  • Set up an account manually
  • [~] Contacts handling
  • Text messages
  • Multimedia messages
  • Setup messages
  • Import/Export
  • Group chats
  • Geolocation messages

Why

Mobile IM, mostly. Desktop IM, also. It's ideal for my pinephone, and lighter than the electron desktop client.

At this point, I don't know Rust, I don't know DBUS, I don't know Telepathy, and I don't know Deltachat particularly well either. So this also functions as a learning exercise!

How

Compiling

This project is written in Rust, so you'll need a rust compiler to build it. Rustup comes highly recommended.

There is a rust-toolchain file that I try to keep synced with the version of rust that 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.

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).

Autogenerated telepathy DBUS bindings

It makes use of the dbus-codegen-rust crate to convert the telepathy interface specs into the executable code in src/telepathy. This is checked in, but can be regenerated like so:

$ git submodule init telepathy-spec
$ git submodule update telepathy-spec
$ 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.

Description
Deltachat connection manager for Telepathy
Readme 1.3 MiB
Languages
Rust 99.6%
Handlebars 0.3%