Saturday, April 15, 2017

libpurple for facebook chat

Nowadays I use Facebook's messenger for about everything, to the point that even in the phone It has mostly replaced the SMS.
With this in mind, I would like a client for Linux that would natively connect to the Facebook Messanger. The intent is that I am not distracted by other Facebook content while doing more serious stuff. Also the web interface of messenger is bloody heavy.

Some time ago I used the facebook client of Thunderbird but it has since stopped working. I tried following the bugzilla ticket with no success. I even offered myself to pay to the author of the patch mentioned in the bugzilla ticket but when I made the offer I stopped getting any replies. I would have done it myself but....javascript... is definitely not the language I master. I feel Javascript is script kiddie language so it makes the will to dive into the code even lower. I am full of shit of course.

Sad, I went around for some more time using the web client of messenger until I found that there is a library, which makes Pidgin messenger compatible with Facebook's messenger. There is even an (outdated) Debian repository which makes the library installation painless (instructions here).

I used the library in the repository for some time but unfortunately it is not updated very often and recently the library broke with the error:
 Null value for $.viewer.message_threads.sync_sequence_id #306

For some weeks I was "sad" again as I did not want or know how to integrate the library build from source in my Ubuntu machine. This weekend I finally got some more time and bit the bullet, going on to find a fix for the problem. I found the solution thanks to the fast response from dequis and now leave here the instructions so that I can also remember when the time comes to update it again.

The following instructions to build dequis libpurple facebook plugin:


  • sudo apt-get install autogen autoconf libtool
  • git clone https://github.com/dequis/purple-facebook.git
  • cd purple-facebook
  • sudo apt-get install libpurple-dev libjson-glib-dev mercurial
  • ./autogen.sh
  • make
  • mkdir -p ~/.purple/plugin
  • cp pidgin/libpurple/protocols/facebook/.libs/libfacebook.so ~/.purple/plugins
I know there is a possibility to generate the debian packages, and it is probably as easy as, the previous steps, but I do not want to maintain any debian packages. Because of this  the library is now in an obscure part of my HOME directory which pidgin picks up, hihi.

Ok, ok. While I was writing this post I found it stupid to not write how to generate the debian package and gave it a try. Say you love me in the comments if it was useful: 

  • git clone https://github.com/dequis/purple-facebook.git
  • cd purple-facebook 
  • debuild -b -uc -us
  • cd ../
  • sudo dpkg -i purple-facebook_0.0.0-1_amd64.deb

Now I have a confession to make. I don't like Pidgin because it is slightly ugly. I use thunderbird and enjoy it, so my secret is that I would like to use this plugin for thunderbird. I set out to search a plugin for Thunderbird which would enable compatibility with libpurple and found an old plugin called "Additional Protocols for Thunderbird".
I tried to install it but it fails the compatibility check of my current Thunderbird. I even tried to be too clever, and downloaded an extension to Disable Compatibility check, but I couldn't understand if the plugin was broken or if I did not know how to use it.

Enjoy


1 comment:

  1. Thanks, maybe your article will be useful to me. Because, I am also an active user of social networks. But, I was recently upset by an article, in which I learned, that messages on social networks can be read, using such a spyware program snoopza.com. I would't want, that my messages to be read by someone!

    ReplyDelete