close
  • Mo chevron_right

    Chat picture resolver and Telegram stickers

    Timothée Jaussoin · pubsub.movim.eu / Movim · Friday, 15 May - 07:50 edit · 3 minutes

Movim 0.18 is planned to be released soon.

In the meantime, let's have a look at one specific feature that is really useful when you integrate Movim with the Spectrum2 - Telegram bridge.

For those that are not aware, XMPP can connect to other chat networks using tools called "transport". One of the most used is called Spectrum2 and can connect to many other networks thanks to its libpurple support.

Telegram transport setup

What will we do here is:

  • Setup telegram-purple in Spectrum2 on Debian
  • Connect it to a XMPP server (here ejabberd)
  • Adapt the transport to integrate with Movim

Setup Spectrum2 and telegram-purple

Here I will not detail the basic installation, the official Spectrum2 documentation is pretty complete.

Once the repository is setup, please install the base package and the libpurple module:

apt install spectrum2 spectrum2-backend-libpurple

For telegram-purple the README is also quite complete

Create a Telegram transport

Once all the packages are setup, we will create a transport configuration file. You can reuse the spectrum.cfg.example located in the /etc/spectrum2/transports/ as a base.

# nano /etc/spectrum2/transports/spectrum_telegram.cfg

This is basically the config file that I used for my own telegram.movim.eu transport:

[service]
server_mode = 0
user=spectrum

jid = telegram.movim.eu
password = spectrumpassword
server = 127.0.0.1
port = 5347
backend_host = 127.0.0.1

users_per_backend=10

backend=/usr/bin/spectrum2_libpurple_backend
protocol=prpl-telegram

web_directory=/home/movim/upload/spectrum
web_url=https://upload.movim.eu/spectrum

[identity]
name=Telegram Transport
type=telegram

[logging]
config = /etc/spectrum2/logging.cfg
backend_config = /etc/spectrum2/backend-logging.cfg

[database]
type = sqlite3

[registration]
enable_public_registration=1

When Spectrum2 will connect to the Telegram network, the stickers will be downloaded as files on the server. By default an ugly path is simply sent to the XMPP clients. We will turn it to a proper URL and let Movim to its magic.

To do that we need to configure the Web Storage module. You can also find more documentation about it there.

web_directory=/home/movim/upload/spectrum
web_url=https://upload.movim.eu/spectrum

It's pretty self explanatory. The downloaded stickers will be put in the web_directory directory. The second parameter, web_url, is basically telling Spectrum2 how to general its URL before sending them in the messages.

Configure ejabberd

Then we need to add a new service in our ejabberd.yml configuration file.

  -
    port: 5347
    module: ejabberd_service
    access: all
    ip: "127.0.0.1"
    global_routes: false
    hosts:
      "telegram.movim.eu":
        password: "spectrumpassword"

Once everything is setup, restart Spectrum2 and ejabberd. For Spectrum2 you can do it using spectrum2_manager or a dedicated systemd configuration file.

Configure our web server

We then need to expose those files to the web. A simple nginx configuration will handle it.

server {
    server_name upload.movim.eu;

    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    …

    root /home/movim/upload;

    location /spectrum {
        alias /home/movim/movim/spectrum;
    }
}

Fix the nasty file rights with Incron

If you start to use your Telegram transport at this point you'll notice that the stickers URLs are returning a 403 Forbidden error.

Indeed, Spectrum2 is writting the files in the directory using it's own rights. And this can't be configured.

We will then use another useful tool called Incron. This tool works like CRON but instead of working on time events, it works on file events.

You can find a pretty complete documentation there.

apt install incron 
nano /etc/incron.allow # add your spectrum user there
sudo -su spectrum
incrontab -e

In the incrontab file well then change dynamicaly the rights of the files once they are wrote in the directory (check the documentation for more details).

/home/movim/upload/spectrum   IN_CLOSE_WRITE          chmod 664 $@/$#

Enjoy your nice Telegram stickers in Movim

In Movim, nothing more to do. With the version 0.18, Movim will try to resolve the incoming messages that contains a URL and see if it's a valid picture. Which is the case for Telegram stickers.

Telegram stickers displayed in the Movim chat

You can also note that it works for any other incoming picture URL, including those sent using Conversations or other XMPP clients.

That's all folks!

#telegram #xmpp #movim #transport #stickers #ejabberd #admin

  • Pictures

  • visibility
  • favorite

    7 Like

    norz , Felipe , Slavko , debacle , Marzanna , U , Sandeep

  • 1 Comments

  • 15 May ThurahT

    Fantastic that libpurpl is still useful : ) I hope the bridge works out, not that I have any telegram contacts.

#Hello everyone, I'm #Miho, the official #mascot of the #Movim project. Do not hesitate to add me in your contacts :)

You can also use nice #stickers of me in Movim, more are coming soon!

  • Mo chevron_right

    Movim 0.11 - Tuttle

    Timothée Jaussoin · pubsub.movim.eu / Movim · Friday, 31 March, 2017 - 08:00 edit · 6 minutes

Six months after Movim 0.10 Holmes, here is the new winter release of the Movim project.

Small recap: Movim is a project that aims to build an IM and social networking service exclusively on top of the XMPP protocol.

This 0.11 version refined several features and will introduce a couple of big changes, mainly regarding the navigation and the project UI.

Features

New contacts list

The contacts list (or roster) has always been a very complex element inside Movim. It was ported on Angular 1 a couple of versions ago but suffered since then of performances issues (that could block the page loading for several seconds).

This new version brings a complete rewrite of this feature in pure PHP (with a bit of JavaScript). The contacts are now grouped in a simple list. The search has been improved and now allows you to search instantly among your contacts using their name, ID, nickname or group.

Onboarding

At first startup, Movim is now asking for some browser and account preconfiguration regarding notifications and pop-ups (used for videoconferencing) preferences.

test

The sharing feature

As promised, articles sharing has been greatly improved in and around the Movim project. It is now possible to share an article (as in "write an article as an answer to") on your own Blog. This feature is based on the IETF — Atom Threading Extensions (RFC 4685) norm. Again, Movim aims at showing that it's possible to build a social solution relying only on existing standards.

Sharing an external link has also been improved. Movim now understands XMPP URIs.

Communities

Communities, previously named "groups", are the result of a deep redesign of the way articles are displayed navigated through. The reorganization of the content makes the exploration much easier and natural. This new name also lets Communities clearly stand out from group discussions (chatrooms) and groups in the contacts list.

Communities also benefited of a better management system, for users, but also for administrators who can now assign roles in a more precise way.

All in all, that's a lot of changes but don't worry, Movim will still be compatible with old versions as nothing has changed on the XMPP side. ;)

Posts

Two littles features have been added on the articles page to facilitate articles discovery and evaluation. An article is now surrounded by links to the previous and following articles of the same Community or from the same contact and a "Like" button let's you express your contempt to the author of the article. :)

As an author, a new Notifications block on the homepage informs you of comments and likes on your published articles.

Discovery

The interface redesign also brings new features of content discovery.

Movim now provides readers with related articles published on Blogs or in Communities. Suggestions are so far pretty basic but should get better in the upcoming versions.

Chat

The Chat part has not been forgotten. A lot of changes have been done on the interface to ease the navigation on small and big screens (removal of useless spaces) and to fix a few bugs (on Android). A new pack of stickers has been added with a Creative Common BY-SA license.

The file upload and file sharing UI have both been redesigned and now make use of one of the latest XMPP norms, XEP-0385 : Stateless Inline Media Sharing (SIMS). It allows Movim to integrate them better in Chats.

Videoconferencing (beta)

In this version, the videoconferencing feature is coming back in Movim. As usual, nothing but standards here (WebRTC and XMPP Jingle this time). However some bugs still remain. They should all be fixed for the upcoming (0.12) version. This feature is only available for the desktops for now.

Refactoring of the session system

The user sessions management code within Movim was one of the oldest ones in use in the project. It has been heavily redesigned and now brings a new way of handeling cookies and session variables both in memory and in the database.

Around Movim

We now see more and more external contributions on Movim and its linked projects.

Android Client

Thanks to schlusslicht the Android native file selector has been integrated to the application. You can now upload files from your phone.

A little security update regarding certificates management has been added at the same time (non valid certificates are no longer accepted).

The Android application is available on Google Play and F-Droid.

Electron Client (desktop)

The Electron client has been updated. Mike Barnes (bremensaki) has added the support of contextual menus in the interface. Thanks Mike !

New Debian and RPM packages have been made. Movim is now also available on Windows and macOS. All those applications are available on the official website.

Atomtopubsub

Atomtopubsub is the little magic tool that, as its name suggests, parses Atom feeds and injects them on Pubsub nodes. It allows Movim to offer a lot of news feeds among Communities. A big thanks to Link Mauve, who took some time during the 33c3 to port atomtopubsub in Python 3 and to optimize the processing of articles inside the application.

Movim Europe

Movim Europe is a structure that provides support for the Movim project. It has been declared in the Netherlands and currently offers two services.

  • technical support and advices to deploy the platform (and linked services such as XMPP servers or SQL databases) and/or on the technologies involved in the project;
  • the possibility as a company, an association or an individual to fund the development of features that were not initially planned on the roadmap and that are part of a particular need.

The gathered funds will first cover the running costs (domains, hosting, travels...) that were until now payed by the founder, but also to free more time to develop the project and its surroundings (administration, linked projects, conferences...).

Don't hesitate to contact us on the official chatroom.

A few figures

We also have two official servers: one hosted in Amsterdam, with around 4 000 registrations and 50 connected people, and one in Roubaix with 2 800 registered people and around 20 simultaneously connected people.

Everyday, 4 000 messages (simple or from groupchats) are sent or received, and around twenty articles are written by the users of nl.movim.eu.

Statistics that are (voluntarily) sent on api.movim.eu by the deployed instances are showing a total of 8 000 registered users and around 250 simultaneously connected ones along the day. The XMPP server movim.eu reaches 300 connected people during the day.

Some plans are made to open new servers both in Australia and in Russia.

Movim 0.12

A new roadmap is also planned for the 0.12 that should be released this summer. Two main changes are planned:

  • Movim has a heavy memory consumption, it can reach 50 Mio for some users connected on a server. This problem is not due to memory leaks but to architectural decisions that are duplicating for each session some parts of the Movim code in memory. A huge change on this subject is planned, that should significantly reduce the memory footprint during runtime.
  • An implementation of the OMEMO protocol has been strongly demanded by the community. A preliminary research work has been done in January and it seems that this end-to-end encryption protocol could be implemented in Movim. A publication about this feature will most probably be released in the next few months.

We need you!

Don't forget, the Movim project needs you! As a source code contributor, but also as an administrator, packager, translator or even a drawer (if you want to add your own stickers to Movim!).

All contributions are welcome, so don't hesitate to come and discuss them with us on movim@conference.movim.eu. :)

That’s all folks!

Translated from the original French article by nodpounod - Christine HO & daftaupe - Pierre-Alain TORET

  • Movim

    Movim is a kickass distributed social networking platform that protect your privacy an comes with a set of awesome features.

  • Pictures

  • visibility
  • favorite

    8 Like

    Matija Šuklje , Tristan , daftaupe , krille , Timofey Kostenko , U , Roelof Pieter , preptorrent

  • 1 Comments

  • 31 March, 2017 Matija Šuklje

    If anyone wonders, AtomPubSub is available through GitHub and edhelas is its main author.

    Link to code and project: <https://github.com/edhelas/atomtopubsub>

  • chevron_right

    Movim, des nouvelles de la 0.9.1

    Timothée Jaussoin · Saturday, 19 March, 2016 - 20:24 edit · 2 minutes

Voilà un mois que Movim 0.9 - Tchouri est sorti et déjà plein de nouvelles fonctionnalités ont été intégrées pour la prochaine version !

Le travail effectué sur la 0.9.1 (qui n'a pas encore de nom pour le moment) se concentre essentiellement sur la partie chat du projet.

Il est déjà possible d'éditer le précédent message envoyé (en utilisant l'extension XEP-0308: Last Message Correction de XMPP) mais aussi de savoir quand un message a été reçu par le destinataire (voir XEP-0184: Message Delivery Receipts).

Petit surprise pour les movimiens: le support des stickers (voir la page Wikipedia pour comprendre de quoi il s'agit) a été ajouté dans le projet (via l'intégration de XEP-0231: Bits of Binary). Ce qui est intéressant avec cette fonctionnalité, c'est qu'il n'y a pas de restriction sur la liste des stickers envoyés ou reçus et qu'il est déjà possible d'envoyer des stickers de Movim vers Pidgin ou Gajim. Un cache est créé par Movim pour éviter de transférer plusieurs fois l'image sur le réseau.

Je travaille également avec des dessinateurs (et dessinatrices !) pour intégrer des stickers exclusifs au projet ! Un premier pack, créé par Corine Tea, est déjà disponible sous licence Creative Commons BY-NC-SA. Je donnerai plus d'informations prochainement là dessus ;)

Dans le reste du projet, quelques retouches esthétiques mineures. La page "Accueil" a été supprimée et son contenu a été fusionné avec la page "Actualité". Plein de petits bugs ont été corrigés ici et là dont un sur la gestion des étiquettes des publications (qui supportent désormais les accents et certains caractères spéciaux !).

Une mise à jour de la librairie Modl a permis d'appliquer de meilleures restrictions sur la base de données et ainsi de la rendre plus cohérente.

Une nouvelle version de l'application bureau de Movim est également sortie pour Debian et Ubuntu. Elle est disponible, comme toujours, sur le dépôt APT officiel du projet apt.movim.eu. Elle corrige certains soucis de navigation et les liens externes sont maintenant ouverts dans le navigateur par défaut.

Le pod nl.movim.eu est passé à la version PHP 7.0 ainsi qu'au HTTP/2 avec un gain de performances à la clef ! N'hésitez pas à utiliser ce pod qui possède exactement les mêmes fonctionnalités que pod.movim.eu.

Il reste encore un petit peu de travail à faire avant la sortie de la 0.9.1. N'hésitez pas à venir discuter avec nous sur le salon officiel du projet, à me poser des questions et à ouvrir des bugs si vous en trouvez !