'Add a stream event handler that will be executed when a matching
stanza is received.
:param handler:
The :class:`~sleekxmpp.xmlstream.handler.base.BaseHandler`
derived object to execute.'

def register_handler(self, handler, before=None, after=None):

    if (handler.stream is None):
        self.__handlers.append(handler)
        handler.stream = weakref.ref(self)
