summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2010-10-31 18:27:52 -0400
committerLance Stout <lancestout@gmail.com>2010-10-31 18:27:52 -0400
commit9e248bb8527c1903486756b4166e9e548a8eb8e2 (patch)
tree14f756361aab63326694c0c34fd89286c8db97bb /sleekxmpp/xmlstream
parent973890e2c913c466b3dfb48c8bd01c28a7baf6c5 (diff)
downloadslixmpp-9e248bb8527c1903486756b4166e9e548a8eb8e2.tar.gz
slixmpp-9e248bb8527c1903486756b4166e9e548a8eb8e2.tar.bz2
slixmpp-9e248bb8527c1903486756b4166e9e548a8eb8e2.tar.xz
slixmpp-9e248bb8527c1903486756b4166e9e548a8eb8e2.zip
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.
Diffstat (limited to 'sleekxmpp/xmlstream')
-rw-r--r--sleekxmpp/xmlstream/xmlstream.py12
1 files changed, 12 insertions, 0 deletions
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.