gbin/err — pull request #244 by apophys (2014-03-04 23:49:48+00:00)
Title: Presence plugin - POC

Hi,
for some time I've been thinking about extending Err with [support for presence](https://github.com/gbin/err/issues/125#issuecomment-22819830https://github.com/gbin/err/issues/125#issuecomment-22819830).
I finally found time (stopped being lazy) this weekend and go through the code of Err to find the right place to add the functionality (not all code, just XMPP backend) and found out that it would be a little bit tricky because of the way the supported event handlers work and the amount of presence related events SleekXMPP provides.
So I decided to try to bypass this by installing my own event handlers for the SleekXMPP.ClientXMPP instance in Err itself. It seems to be pretty simple to do this.

What this PR does is that it implements another wrapper in the backend to pair the method for installing the handler in the backend scope.
There is also an extension to the test backend i intend to use to test this, the original push/pop mechanism for sending text/commands and reading bots output are not affected by this. The changes only provide another layer on top of it. Though it does not support presence at the moment. I'll have to think of a way how to put the presence right into sleekxmpp, if that's even possible.

The plugin I wrote to test this approach is here: https://github.com/apophys/err-chatroomgreeting
What it does is that it sends a greeting to every new participant of the room (after some config, hardcoded at the moment). Currently it should be working in multiple rooms and allows to turn off the greeting for a nick.

Please, review it, run it, break it, like it... :) or whatever. The plugin requires this change (*del_event_handler*). I'd like to hear your ideas on this.