# Telepathy Tank
###### tags: `kde` `telepathy` `matrix`
> **TL;DR**: [telepathy-tank](https://github.com/TelepathyIM/telepathy-tank) and Telepathy IM, in general, are here and not forgotten, few enthusiasts are still playing with it and even revived private matrix room as public for the telepathy developers and packagers: [#telepathy-im:matrix.org](https://matrix.to/#/%23telepathy-im:matrix.org). Sailfish OS, KDE, and PostmarketOS developers could be interested (and probably already know about it :D)
## Telepathy IM project
### General overview
First about Telepathy in general. [Telepathy IM](https://github.com/TelepathyIM/wiki/wiki) is a client-side specification and a framework for the desktop and mobile Linux real-time communications. It builds their modules as independent programs (Unix processes) and uses [IPC](https://en.wikipedia.org/wiki/Inter-process_communication) for coordination between them ([D-Bus](https://dbus.freedesktop.org/) precisely). The applications called [pidgin/libpurple](https://developer.pidgin.im/wiki/WhatIsLibpurple) and [weechat](https://weechat.org/) and [kopete](https://kde.org/applications/internet/org.kde.kopete) are probably predecessors of the telepathy project, but they're focused on the plugin subsystem approach, not IPC one.
The most beautiful and challenging thing about Telepathy is probably a client apps interoperability. For example, if you what to write an application with some new UI that shows contact list or shows and sends messages to some rooms, you don't have to rewrite an application that supports login and manages connections if it's already written for your system. The new applications could be implemented in different languages that could even not support your IM protocol directly, it just has to support dbus system protocol on the library side.
![Freedesktop: Telepathy Architecture Overview](https://telepathy.freedesktop.org/images/TelepathyArchitectureOverview.png)
Since pure D-Bus is quite low-level, additional wrappers are already there for convenience, such as [Qt D-Bus](https://doc.qt.io/qt-5/qtdbus-index.html) (Qt is well documented ❤ and also have a nice write-up about dbus), [python dbus](https://www.freedesktop.org/wiki/Software/DBusBindings), [haskell dbus](http://hackage.haskell.org/package/dbus), [lua dbus](https://luarocks.org/modules/dodo/lua-dbus), [npm dbus](https://www.npmjs.com/package/dbus), [dart dbus](https://pub.dev/packages/dbus_client).
In other words, the IM protocol client could be implemented in one language, UI applications in another, and they could communicate with each other via dbus following the Telepathy specification that describes IM subject matter. Even [Qt](https://github.com/TelepathyIM/telepathy-qt), [glib](https://github.com/TelepathyIM/telepathy-glib), and [python](https://telepathy.freedesktop.org/doc/book/sect.services.python.html) wrappers for the Telepathy protocol itself were introduced for more convenience (comparing to the dbus wrappers mentioned earlier).
### Matrix point-of-view
Matrix developer who is interested in Linux but not familiar with the Linux IPC and dbus could ask:
- Why do I need even more abstractions on the client-side, if I could just use bridges on the server-side and focus on the all-in-one application on the client side?
There're probably two reasons in my opinion:
- It makes an option to not to use bridges if it's not possible for some cases, and work on protocol support directly for the client-side
- It makes possible different system-side integrations. For example, not only the chat but also the PIM applications (adress book, calendar), media players, etc -- could share the same connection on the device. You probably have to re-invent Telepathy if you have to build something similar but in the all-in-one application.
So, while Matrix specification covers server-server and client-server side, Telepathy IM is more about client applications, while both describe real-time communications subject matter.
There's also known challenges with the current implementation:
+ DBus-specific solution. While dbus is native IPC for the Linux-based systems and [could be shared over the network](https://www.freedesktop.org/wiki/Software/DBusRemote/) or [ported](https://gist.github.com/berkin/b2139360393c93eebc35fa298fc859bc) to the target OS, it's not well-known across the other operating systems. Somebody could say that network connection could be used as IPC instead of some OS-specific mechanism. But the higher-level abstractions are a trick (which will remain the same probably) and should be evolved and maintained anyway. Which leads us to another currently weak side
+ Contributors flaw. Telepathy project roots are from the [good](https://translate.yandex.ru/translate?url=https%3A%2F%2Fhabr.com%2Fru%2Fpost%2F171325%2F&lang=ru-en)-[old](https://en.wikipedia.org/wiki/Peter_principle)-days of the Nokia N900/N9 Linux devices and [Collabora](https://mail.gnome.org/archives/desktop-devel-list/2017-September/msg00047.html) team development. A lot of contributors are needed to support such a level of standardization. Right now we have [Kaffeine](https://matrix.to/#/@kaffeine:matrix.org) maintainer who has "picked up the flag" and few other project sympathizers. It's the well known [chicken-or-the-egg](https://en.wikipedia.org/wiki/Chicken_or_the_egg) problem that could be solved step-by-step though.
## Matrix connection manager
[Telepathy-tank](https://github.com/TelepathyIM/telepathy-tank) is a matrix connection manager for the Telepathy. It uses [libQuotient](https://github.com/quotient-im/libQuotient) and mentioned Qt wrapper library for the Telepathy.
The Telepathy framework is the native messaging solution for the [Sailfish OS](https://sailfishos.org/wiki/Telepathy_Framework). There're also chances it could revive in the KDE project due to Plasma Mobile activities.
Sailfish OS 3.3.0 Rokua was released recently, where [gcc compiler updated 4.9 -> 8.3](https://together.jolla.com/question/222221/release-notes-330-rokua/#222221-contributions-from-aurora-os) thanks to Aurora OS developers' contribution.
> Don't be surprised it's not 9.3 like in your favorite vanilla rolling-release arch desktop distro, embedded devices state is [another story](https://medium.com/@tskho/why-my-phone-will-not-be-updated-to-upcoming-android-version-d6e4e9361287) currently ([PostmarketOS and Archlinux/ManjaroARM](https://nemomobile.net/pages/Packaging_Glacier_for_postmarketOS/) are nice exceptions though).
Compiler updates make it possible to drop super-cool [rinigus](https://github.com/rinigus) workaround to use [gcc from opt](https://build.merproject.org/package/show/home:rinigus:toolbox/opt-gcc) for Sailfish OS and compile libQuotient! Patches to support outdated Qt5.6 are [still needed](https://github.com/quotient-im/libQuotient/blob/aa13q-mer-0.6.x/rpm/mer-qt5.6-hacks.patch) though.
> Sailfish OS Qt update are still in 5.6 state also due to non-technical challenges about framework LGPL/GPL transition 2 -> 3; It bothers many developers (me too), but it's not something anyone forgot about
Recent activity from KDE and Sailfish users and personal interest of Kaffeine (telepathy maintainer, telegram-qt, and telepathy-morse developer) lead him to make [Telepathy IM](https://matrix.to/#/%23telepathy-im:matrix.org) room public.
While telepathy-tank is in the very early stage of development, it's already possible for the developers to play with it in KDE and Sailfish OS (thanks to Kaffeine again, since he also [provided a workaround](https://git.sailfishos.org/mer-core/commhistory-daemon/merge_requests/31) for the Sailfish notifications/history subsystem).
Here are some screenshots in fancy devices renders from the Sailfish with telepathy-tank. It's the first iteration, already working with the system apps like messages and contacts natively:
An infinite source of inspiration and all my wallpapers: [Simon Stålenhag](https://www.simonstalenhag.se/).
Alexey Andreyev ([aa13q](https://matrix.to/#/@aa13q:matrix.org)) for the [This Week in Matrix Digest](https://matrix.org/blog/2020/04/24/this-week-in-matrix-2020-04-24) (24.04.2020).