summaryrefslogtreecommitdiff
path: root/sleekxmpp/basexmpp.py
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/basexmpp.py')
-rw-r--r--sleekxmpp/basexmpp.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py
index 12dc2a1b..8489b24b 100644
--- a/sleekxmpp/basexmpp.py
+++ b/sleekxmpp/basexmpp.py
@@ -118,9 +118,11 @@ class basexmpp(object):
self.id += 1
return self.getId()
- def add_handler(self, mask, pointer, disposable=False, threaded=False, filter=False, instream=False):
- #logging.warning("Deprecated add_handler used for %s: %s." % (mask, pointer))
- self.registerHandler(XMLCallback('add_handler_%s' % self.getNewId(), MatchXMLMask(mask), pointer, threaded, disposable, instream))
+ def add_handler(self, mask, pointer, name=None, disposable=False, threaded=False, filter=False, instream=False):
+ # threaded is no longer needed, but leaving it for backwards compatibility for now
+ if name is None:
+ name = 'add_handler_%s' % self.getNewId()
+ self.registerHandler(XMLCallback(name, MatchXMLMask(mask), pointer, threaded, disposable, instream))
def getId(self):
return "%x".upper() % self.id