summaryrefslogtreecommitdiff
path: root/sleekxmpp
diff options
context:
space:
mode:
authorNathan Fritz <fritzy@netflint.net>2009-08-31 23:02:19 +0000
committerNathan Fritz <fritzy@netflint.net>2009-08-31 23:02:19 +0000
commit436841fa6faa1b9be5f40bb17f606366790ef5e8 (patch)
tree3595be042e8654cfd3bc44c7abc8434323a91d0c /sleekxmpp
parent05c9ea5c1d953637343c9fad07267e7f89b20561 (diff)
downloadslixmpp-436841fa6faa1b9be5f40bb17f606366790ef5e8.tar.gz
slixmpp-436841fa6faa1b9be5f40bb17f606366790ef5e8.tar.bz2
slixmpp-436841fa6faa1b9be5f40bb17f606366790ef5e8.tar.xz
slixmpp-436841fa6faa1b9be5f40bb17f606366790ef5e8.zip
brought components over to python 3.x
Diffstat (limited to 'sleekxmpp')
-rw-r--r--sleekxmpp/component_example.py1
-rwxr-xr-xsleekxmpp/componentxmpp.py4
2 files changed, 2 insertions, 3 deletions
diff --git a/sleekxmpp/component_example.py b/sleekxmpp/component_example.py
index 37b7e96e..f24216c2 100644
--- a/sleekxmpp/component_example.py
+++ b/sleekxmpp/component_example.py
@@ -17,7 +17,6 @@ class Example(sleekxmpp.componentxmpp.ComponentXMPP):
pass
def message(self, event):
- print event
self.sendMessage("%s/%s" % (event['jid'], event['resource']), "Thanks for sending me, \"%s\"." % event['message'], mtype=event['type'])
if __name__ == '__main__':
diff --git a/sleekxmpp/componentxmpp.py b/sleekxmpp/componentxmpp.py
index 28b58172..7f952413 100755
--- a/sleekxmpp/componentxmpp.py
+++ b/sleekxmpp/componentxmpp.py
@@ -39,7 +39,7 @@ import random
import copy
from . import plugins
from . import stanza
-import sha
+import hashlib
srvsupport = True
try:
import dns.resolver
@@ -96,7 +96,7 @@ class ComponentXMPP(basexmpp, XMLStream):
def start_stream_handler(self, xml):
sid = xml.get('id', '')
handshake = ET.Element('{jabber:component:accept}handshake')
- handshake.text = sha.new(u"%s%s" % (sid, self.secret)).hexdigest().lower()
+ handshake.text = hashlib.sha1.new(b"%s%s" % (sid, self.secret)).hexdigest().lower()
self.send(handshake)
def _handleHandshake(self, xml):