summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/plugins')
-rw-r--r--sleekxmpp/plugins/xep_0009.py2
-rw-r--r--sleekxmpp/plugins/xep_0030.py10
-rw-r--r--sleekxmpp/plugins/xep_0045.py2
-rw-r--r--sleekxmpp/plugins/xep_0050.py3
-rw-r--r--sleekxmpp/plugins/xep_0060.py1
-rw-r--r--sleekxmpp/plugins/xep_0078.py6
-rw-r--r--sleekxmpp/plugins/xep_0086.py2
-rw-r--r--sleekxmpp/plugins/xep_0199.py4
8 files changed, 12 insertions, 18 deletions
diff --git a/sleekxmpp/plugins/xep_0009.py b/sleekxmpp/plugins/xep_0009.py
index c6b7b5df..e0da8296 100644
--- a/sleekxmpp/plugins/xep_0009.py
+++ b/sleekxmpp/plugins/xep_0009.py
@@ -2,7 +2,7 @@
XEP-0009 XMPP Remote Procedure Calls
"""
from __future__ import with_statement
-import base
+from . import base
import logging
from xml.etree import cElementTree as ET
import copy
diff --git a/sleekxmpp/plugins/xep_0030.py b/sleekxmpp/plugins/xep_0030.py
index d3795308..fc921020 100644
--- a/sleekxmpp/plugins/xep_0030.py
+++ b/sleekxmpp/plugins/xep_0030.py
@@ -17,11 +17,9 @@
along with SleekXMPP; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""
-from __future__ import absolute_import, with_statement
from . import base
import logging
from xml.etree import cElementTree as ET
-import thread
class xep_0030(base.base_plugin):
"""
@@ -36,13 +34,11 @@ class xep_0030(base.base_plugin):
self.items = {'main': []}
self.xmpp.add_handler("<iq type='get' xmlns='%s'><query xmlns='http://jabber.org/protocol/disco#info' /></iq>" % self.xmpp.default_ns, self.info_handler)
self.xmpp.add_handler("<iq type='get' xmlns='%s'><query xmlns='http://jabber.org/protocol/disco#items' /></iq>" % self.xmpp.default_ns, self.item_handler)
- self.lock = thread.allocate_lock()
def add_feature(self, feature, node='main'):
- with self.lock:
- if not self.features.has_key(node):
- self.features[node] = []
- self.features[node].append(feature)
+ if not self.features.has_key(node):
+ self.features[node] = []
+ self.features[node].append(feature)
def add_identity(self, category=None, itype=None, name=None, node='main'):
if not self.identities.has_key(node):
diff --git a/sleekxmpp/plugins/xep_0045.py b/sleekxmpp/plugins/xep_0045.py
index a85bfec8..b0523755 100644
--- a/sleekxmpp/plugins/xep_0045.py
+++ b/sleekxmpp/plugins/xep_0045.py
@@ -18,7 +18,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""
from __future__ import with_statement
-import base
+from . import base
import logging
from xml.etree import cElementTree as ET
diff --git a/sleekxmpp/plugins/xep_0050.py b/sleekxmpp/plugins/xep_0050.py
index 80025c8b..20e10570 100644
--- a/sleekxmpp/plugins/xep_0050.py
+++ b/sleekxmpp/plugins/xep_0050.py
@@ -18,12 +18,11 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""
from __future__ import with_statement
-import base
+from . import base
import logging
from xml.etree import cElementTree as ET
import traceback
import time
-import thread
class xep_0050(base.base_plugin):
"""
diff --git a/sleekxmpp/plugins/xep_0060.py b/sleekxmpp/plugins/xep_0060.py
index b5e338ad..68c391f6 100644
--- a/sleekxmpp/plugins/xep_0060.py
+++ b/sleekxmpp/plugins/xep_0060.py
@@ -190,7 +190,6 @@ class xep_0060(base.base_plugin):
id = iq.get('id')
result = self.xmpp.send(iq, "<iq id='%s'/>" % id)
if result is None or result.get('type') == 'error':
- print "---------- returning false, apparently"
return False
return True
diff --git a/sleekxmpp/plugins/xep_0078.py b/sleekxmpp/plugins/xep_0078.py
index 28aaeb20..24afc875 100644
--- a/sleekxmpp/plugins/xep_0078.py
+++ b/sleekxmpp/plugins/xep_0078.py
@@ -20,8 +20,8 @@
from __future__ import with_statement
from xml.etree import cElementTree as ET
import logging
-import sha
-import base
+import hashlib
+from . import base
class xep_0078(base.base_plugin):
@@ -66,7 +66,7 @@ class xep_0078(base.base_plugin):
else:
logging.debug("Authenticating via jabber:iq:auth Digest")
digest = ET.Element('digest')
- digest.text = sha.sha("%s%s" % (self.streamid, self.xmpp.password)).hexdigest()
+ digest.text = hashlib.sha1(b"%s%s" % (self.streamid, self.xmpp.password)).hexdigest()
query.append(digest)
attempt.append(query)
result = self.xmpp.send(attempt, self.xmpp.makeIq(self.xmpp.id))
diff --git a/sleekxmpp/plugins/xep_0086.py b/sleekxmpp/plugins/xep_0086.py
index 6871ef3f..e6c18c77 100644
--- a/sleekxmpp/plugins/xep_0086.py
+++ b/sleekxmpp/plugins/xep_0086.py
@@ -1,6 +1,6 @@
from __future__ import with_statement
-import base
+from . import base
import logging
from xml.etree import cElementTree as ET
import copy
diff --git a/sleekxmpp/plugins/xep_0199.py b/sleekxmpp/plugins/xep_0199.py
index cab84ac9..57d56c02 100644
--- a/sleekxmpp/plugins/xep_0199.py
+++ b/sleekxmpp/plugins/xep_0199.py
@@ -31,8 +31,8 @@ class xep_0199(base.base_plugin):
self.xep = "0199"
self.xmpp.add_handler("<iq type='get' xmlns='%s'><ping xmlns='http://www.xmpp.org/extensions/xep-0199.html#ns'/></iq>" % self.xmpp.default_ns, self.handler_ping)
self.running = False
- if self.config.get('keepalive', True):
- self.xmpp.add_event_handler('session_start', self.handler_pingserver, threaded=True)
+ #if self.config.get('keepalive', True):
+ #self.xmpp.add_event_handler('session_start', self.handler_pingserver, threaded=True)
def post_init(self):
self.xmpp['xep_0030'].add_feature('http://www.xmpp.org/extensions/xep-0199.html#ns')