From f8933f67e9f08fd96a67031e675e422dbeea5c87 Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Wed, 13 Apr 2011 01:17:58 -0400 Subject: 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 --- server/plugin.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'server/plugin.py') 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: -- cgit v1.2.3-70-g09d2