From 9e248bb8527c1903486756b4166e9e548a8eb8e2 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Sun, 31 Oct 2010 18:27:52 -0400 Subject: Fix bug in XEP-0030 plugin. xep_0030 still referenced event_handlers. Added the method event_handled which will return the number of registered handlers for an event to resolve the issue. --- sleekxmpp/xmlstream/xmlstream.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sleekxmpp/xmlstream') diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index cc192715..546654dd 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -379,6 +379,7 @@ class XMLStream(object): """ if self.ssl_support: logging.info("Negotiating TLS") + logging.info("Using SSL version: %s" % str(self.ssl_version)) ssl_socket = ssl.wrap_socket(self.socket, ssl_version=self.ssl_version, do_handshake_on_connect=False) @@ -527,6 +528,17 @@ class XMLStream(object): self.__event_handlers[name] = filter(filter_pointers, self.__event_handlers[name]) + def event_handled(self, name): + """ + Indicates if an event has any associated handlers. + + Returns the number of registered handlers. + + Arguments: + name -- The name of the event to check. + """ + return len(self.__event_handlers.get(name, [])) + def event(self, name, data={}, direct=False): """ Manually trigger a custom event. -- cgit v1.2.3