Just over 5 years ago, I wrote a post on here showing how to connect to Facebook Chat (now rebranded as Facebook Messenger) on 3rd party Instant Messenger clients through Facebook’s XMPP endpoint. Unfortunately this relied on Facebook’s first API, which was deprecated last year, and support for the XMPP endpoint officially ended on 30th April 2015.

Facebook Messenger logo

Facebook Messenger logo

Update 2015-07-12: A change was added to GitHub a few hours after publishing this article which fixes the HTML appearing in messages bugs mentioned. I’m leaving them in for historic purposes.

Update 2015-07-13: Another change to the source seems to have resolved the Offline Message Emulation bug. It’s also been noted that Windows users may get better results if you compile from the latest source from GitHub, and/or using the latest version of libjson-glib-1.0.dll

For me, however, the XMPP endpoint was still happily accepting connections and use right up to 10th July, but sadly, it now looks like the life support system has finally been switched off. The question is, can you still connect to Facebook Messenger outside of your web browser? At the time of writing, no official Linux application has been released by Facebook. The reason for wanting to use a stand alone application is for tighter integration with the Operating System used. For example, Pidgin integrates with Ubuntu’s Unity desktop allowing unread notifications to go to the messaging applet, as well as notifications to integrate seamlessly into Unity’s pop up notifications with libnotify. Finally, you can enable Pidgin to trigger things on particular events with the help of buddy pounces.

Thankfully, there’s now a new plugin for Pidgin called “purple-facebook” hosted on GitHub which utilises Facebook’s API v2, and whilst there are a couple of bugs when using it, overall it’s quite stable, and far better than previous direct integrations with Facebook’s API.

Windows Users

The kind folks who’ve created this plugin have already pre-compiled glib and facebook DLLs, and these can simply be dropped into Pidgin’s program folder (more details can be found in the Installing on Windows section here).

Linux Users

Linux users will need to compile the plugin from source, either from the releases folder, or from the latest source on GitHub (see the section here) as compiling versions for every Linux flavour and architecture would be very time consuming. The instructions on doing this were quite clear on which dependencies were needed. I opted to use the latest code on GitHub. Finally after compiling, you can either use the “make install” command to install the plugin system wide, or copy the “libfacebook.so” file to “~/.purple/plugins”. I decided to go for the latter, as I expect to be rebuilding updated versions of the code on a regular basis, and copying them to a folder under my user is a bit quicker. Besides, I’m the only one using this machine.

The source files post compiling

The source files post compiling

Once installed, you simply need to create a new account in Pidgin and select “Facebook” (Note: do not select “Facebook (XMPP)”) input your username and password, ignore the local alias, and click Add.

Adding an account on Pidgin

Adding an account on Pidgin

After this, Pidgin should sign into Facebook and pull down your list of buddies online and will allow you to sent messages to them.

Pidgin showing who's online

Pidgin showing who’s online

So far, I’ve noticed this plugin seems a little more responsive than previous implementations, even outperforming Facebook’s official XMPP solution.

Important note on using 2FA

If you’re like me, you’ll have set up Facebook’s 2 Factor Authentication to keep your account more secure. Unfortunately, this plugin doesn’t support this, and requires you to go to Facebook’s security settings and set up an application specific password.

Adding an app password on Facebook on the security settings page.

Adding an app password on Facebook on the security settings page.

Current bugs

It’s important to note that this is an early implementation of compatibility with API v2, and bugs are to be expected, but here are a few I’ve noticed in the short time I’ve used the plugin:

HTML code can start wrapping your messages if copy and paste is used.

HTML code can start wrapping your messages if copy and paste is used.

First thing, when copying text from a web site to a conversation, the pasted text, and messages you send after that will attempt to be formatted with the same style of the text you copied. Facebook reacts to this by sanitising the HTML code to be readable. As the option to format text is disabled in this plugin, it’s very difficult to change this back. I worked around it by copying some unaffected text from the conversation window. This is most likely a bug in Pidgin itself as well as a bug in how the plugin reacts to formatted pasted text.

New lines also don't work correctly.

New lines also don’t work correctly.

Similarly, when creating a new line, the output is sanitised causing the HTML code for a new line to be printed instead. A minor inconvenience, but could lead to some confusion for someone not familiar with HTML code.

Issues with the offline message emulation plugin.

Issues with the offline message emulation plugin.

Finally, if you happen to use the “Offline Message Emulation” plugin (which was quite popular back in the days when MSN Messenger didn’t support the function natively), the Facebook plugin doesn’t play nicely with it. Often contacts appear offline when they’re not due to how Facebook Messenger works (or doesn’t), especially when they’re using a mobile device. Facebook has native offline messaging support, in that when you send a message, the recipient will receive the message when they get back online. Of course, the issue here is the Offline Message Emulation plugin is not aware of this and suggests you store the message as a pounce until they come back online. The easy workaround for this is to stop using the Offline Message Emulation plugin.

Conclusion

Overall, I’m impressed with the early work already done to make this plugin work. I much prefer using Facebook Messenger through Pidgin for reasons explained earlier, and I’m glad there’s still a way to be able to use it.

Cheers