aboutsummaryrefslogtreecommitdiffstats
path: root/server/plugin.py
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2011-04-13 01:17:58 -0400
committerGuillaume Horel <guillaume.horel@gmail.com>2011-04-13 01:17:58 -0400
commitf8933f67e9f08fd96a67031e675e422dbeea5c87 (patch)
treeb6750e25d657bb7d82a40f06173553f2acba0486 /server/plugin.py
parent3b8849a0437b56454a71b60976d9eb040235c242 (diff)
downloadalias-f8933f67e9f08fd96a67031e675e422dbeea5c87.tar.gz
Rewrite of the object classes and various fixes
- splitted the Object class into ObjectWriter and ObjectReader - in the UserHandler class, the root object is now automatically created when registering with the component server. - use of os.join.path everywhere to make the code more robust
Diffstat (limited to 'server/plugin.py')
-rw-r--r--server/plugin.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/server/plugin.py b/server/plugin.py
index 393e675..8d2e8c2 100644
--- a/server/plugin.py
+++ b/server/plugin.py
@@ -9,7 +9,7 @@ from sleekxmpp.xmlstream.handler.callback import Callback
from sleekxmpp.xmlstream.matcher.xpath import MatchXPath
from sleekxmpp.stanza.iq import Iq
-from object import Object, ObjectError
+from object import ObjectReader, ObjectError
from permission import PermissionError
class AliasQuery(ElementBase):
@@ -58,7 +58,7 @@ class AliasPlugin(base.base_plugin):
caller = iq['from'].bare
if iq['alias']['type'] == 'keys':
- key, salt = Object(caller).get_private_key();
+ key, salt = ObjectReader(caller).get_private_key();
iq.reply()
iq['alias']['type'] = 'keys'
iq['alias']['key'] = key
@@ -71,10 +71,7 @@ class AliasPlugin(base.base_plugin):
logging.error("callee field not base64 encoded")
node = iq['alias']['node']
- if not node:
- node = hashlib.sha1(callee).hexdigest()
-
- node = Object(callee, node)
+ node = ObjectReader(callee, node)
if iq['alias']['type'] == 'items':
try: