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

  • image
  • favorite

    5 Like

    Felipe , Slavko , debacle , Marzanna , U

  • 1 Comments

  • 15 May ThurahT

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

Now that Saudi Arabia has allowed women to drive just as cars are becoming A.I. driverless (Nelson Muntz, "Ha Ha"), its time to put Movim into a carputer. One of the uses for this is to have the XMPP video conferencing streaming your dashcam footage to your home (or other remote location), probably to be captured in a stream to a remote home-computer maybe via FOSS software similar to OBS or miracast (even though the local carputer might be set up to be a video-recording 'blackbox' in the car itself too).

Carputer

It basically doesn't matter if Movim video-conferencing only does a video-call via just two computers linked in peer-to-peer at the moment. The carputer could have several cameras "mixed" into say 4 way split screen (like diddykong-racing or goldeneye 4-player on the N64 resembles). The 4 cameras could point out the windows in a Front, Back, Left and Right configuration (or something similar).

Of course, Movim in an HTPC could also have similar functionality. To build the carputer, it would be perfectly possible to choose either a MITX mainboard or to gut-out a laptop. The processing should be fine, as long as a computer is capable of playing Blu-Ray (usually dual-core 1.6Ghz with zacate or AMD graphics APU is fine, but double it to a rasperry-pi3bplus quad core of a 3GHz dual-core to be on the safe side and a little virtualisation ability might help, and future 3D collada support could capture physics from cameras acting as stereoscopic). Having opengl4.4 is nice but if you need opencl, something like a a6-6400k APU gives opencl 1.2 but an AMD 7400k gives opencl2.0 on the apu. Power efficient equivalents would need to be considered as alternatives. A 12volt car stereo can be powered from a modified xbox360 psu at home, if you want an htpc to match the carputer.

Fitting the carputer into a car-stereo bay so a DVDRW is included would be tidy and it also means, if a network fails, you could burn two 1GB DVD-R 8cm discs and pop them in a standard-letter-size (110 x 220 mm) envelope with a first class stamp to friends or family at a nearby postbox, so that within a day or three, at least some footage can get to them (and maybe have a folded Return Address SAE inside the envelope too). Or have the computer installed somewhere in the car it won't get stolen, and the DVDRW drive could simply be connected by a long cable to the car-stero bay. If the carputer is running Kodi many touchscreen options exist and so can voice-activation.

There is a myth that women drivers are safer drivers. The truth is, men drive more. The self-heating tin of all-day-breakfast exists because of men drivers. Necessity is the mother of invention, and hunger is the brother of indigestion. It is part of men in careers involving driving, as business not just residential. The majority of accidents happen 2 minutes from home. The flooding of women onto the roads as drivers is really just a quantitative easing, creating a hyperinflation of drivers. It is a way to launder funny money. Like alcohol-prohibition era America, more rules paves the way for more corruption. All roads lead to Rome, and when in Rome, the fall of Rome is by driving drunk on girl-powah. That'll put lead in your pencil. When women hold up half the sky, they take up your braking-distance. Women destroyed the environment in creating more roads by exceeding the capacity of those roads already existing. Carpooling spreads diseases. Arguing against it gets car companies and insurers calling you a male chauffeurnist. So with the abundance of falsehoods pre-emptively trying to find men autoguilty, don't get caught out by the social-distancing cameras that only put A.I. red-boxes around the chosen few, and don't get caught out by the establishment's electronic-line-judge or their equivalents to "HawkEye Cyclops" where corruption in sport is in court, found to be rigged. Driving is a sport, and could we be surprised if they'd employ their same tactics there on the main road? Speed cameras have been questioned in the past. Create your own data and have your own specialists, friends and back-ups at hand.

Movim RSS could keep you abreast of new changes on a road before the mainstream media or traffic reports get the information.

An automatic message over the XMPP chatroom or conferencing could send a message and a hash file of the video file you make such as a magnet link to a torrent. When the airbag goes off, a torrent is seeded, and an (atom) RSS published. War-driving with your IPFS could also be used, and could be a mobile Movim Pod. With that, finding driving routes via a route-finder can be done in a way that finds today's best war-driving route if the journey is tweaked, so maybe even coverage is mapped when microwave or other wireless comms are affected by weather or impaired communications masts.

And if all else fails, make your carputer's A.I. brain one of them #MGTOW wuvbots and you can just call anybody who disagrees with you sexist. If she crashes, she is the primary victim of wardriving for she is the one left behind.

  • Carputer

    A carputer is a computer with specializations to run in a car, such as compact size, low power requirement, and some customized components. The actual computing hardware is typically based on standard PCs or mobile devices. Because they are computer based they typically have many standard interfaces such as Bluetooth, USB, and WiFi. The first carputer was introduced by Clarion Co. on December 4, 1998, although on-board diagnostics have already been employed ever since the 1980s in order to measure precisely the amount of fuel entering the engine as the carburetors got too complex.A challenge to installing a computer in a car is the power supply. Energy is supplied as a nominal 12V DC in cars or 24V in some trucks. The real voltage varies according to whether the engine is on or off since the battery generally delivers less than 12V, while the generator supplies more. There can be peaks, and at ignition time the current supply drops. External DC/DC converters can help to regulate voltages so these can be used.Police cars often have Mobile data terminals in the form of a laptop swivel mounted where the driver's armrest would be. This can be used to log data...

  • image
  • person chevron_right

    Chris · Sunday, 3 May - 18:17

    J'ai essayé de télécharger l'application #movim sur mon téléphone. Je n'ai pas réussi. pas trouvé dans Google play et je n'arrive pas à avoir F-droid.

  • favorite

    1 Like

    preptorrent

  • 3 Comments

  • 3 May preptorrent

    https://nl.movim.eu/?contact/edhelas@movim.eu Vous pouvez poser des questions sur movim à cet hyperlien (conference). It took me a while to realise you need to ask questions about movim in the chatroom. Here at the hyperlink it says : "If you have any questions about Movim, XMPP or something related, please ask it in the official chatroom : movim@conference.movim.eu"

  • 4 May Timothée Jaussoin

    Movim n'est pas disponible sur Google Play mais est sur F-Droid, une version plutôt récente de Android est requise.

  • person

    5 May Chris

    Mon problème est que il faut f-droid est je ne sais pas comment faire pour l'avoir. J'ai l'impression qu'il faut être trés doué et informaticien. J'ai chercher sur google plais et pas trouvé.

  • Xm chevron_right

    XMPP eagle

    DebXWoody · pubsub.movim.eu / xmpp-messenger · Sunday, 3 May - 17:50 edit

Ich habe dieses Wochenende etwas mit gtk programmiert. Für die UI habe ich glade verwendet. Das lief eigentlich ganz gut.

Ich bin am überlegen, ob man eine Anwendung programmiert die Microblog via XMPP unterstützt, wie es auch bei Movim zum Einsatz kommt, aber auch OpenPGP integriert.

Die Nachrichten könnte man wie eine "E-Mail" aufbauen. Es ist somit mehr etwas für längere Texte anstatt viele kurze Nachrichten wie man es von IMs kennt.

Die GUI könnte auch gleich die Verwendung von OpenPGP etwas erleichtern.

#OpenPGP #XMPP #Movim #GTK #glade

  • favorite

    1 Like

    debacle

  • Lw chevron_right

    Website Revamp

    Marco Cirillo · pubsub.lightwitch.org / lw-org · Friday, 10 April - 14:57 edit

We recently revamped the website layout, to make it more modern and usable also we gave a solid improvement to the whole infrastructure, both hardware and software wise.

And it's perfectly usable with Movim also.

#xmpp #service #metronome #microblogging #movim

  • LW.Org - Home

    LW.Org is a free provider for mail and instant messaging services, join now. Founded 21 years ago, we grow to a full fledged communication platform aimed at respecting privacy and with strong security standards.

Hoci narážam s movim na menšie problémy, som s ním spokojný. Páči sa mi oveľa viac ako elgg, s ktorým som robil pokusy pred rokom. Práve po sklamaní s elgg som tentokrát zvolil iný postup -- najprv to vyskúšať a až potom riešiť slovenčinu.

Keďže som teda s prvotnými výsledkami toho sociálneho nástroja spokojný, dnes prišiel čas na slovenčinu. Preložil som viac ako 97 % textov (počiatočný stav bol okolo 4 %), takže budúca verzia (po 0.17.1) bude mať viac-menej plnú podporu slovenčiny. To, že používam verziu z Debian Buster (0.14.1), neznamená, že tu slovenčina nebude. Preklad som integroval (a vlastne aj testoval) aj do tejto verzie, a tak si stačí v nastavení profilu zvoliť náš jazyk. Okrem toho môže byť potrebné sa odhlásiť a znova prihlásiť, pretože niektoré reťazce sú načítané v pamäti.

Preklad má trochu problémy. Jednak tam mám niekoľko chýb, ktoré budem postupne opravovať, ale najmä, niektoré texty sú v angličtine, napriek tomu, že sú preložené. Niekde je jednoducho chyba, ale myslím, že sa s tým dá žiť...

  • favorite

    2 Like

    Corleone , kanuk

  • favorite

    5 Like

    preptorrent , dominik_h , bjoernfischer , Timothée Jaussoin , ericbuijs

  • 3 Comments

  • 1 April ericbuijs

    Welcome!

  • 2 May preptorrent

    #hello You're here just in time for David Icke to be banned from youtube. With any luck, Movim will expand the artistic "draw tool" to include 3D collada files (if I have my way) and then Mr Icke can come here and bring all his followers as he animates the archons putting their lizard hands into the lower-backs of those they control, anunnaki style.

  • person

    3 May Chris

    Congratulation