diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2011-04-13 01:17:58 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2011-04-13 01:17:58 -0400 |
| commit | f8933f67e9f08fd96a67031e675e422dbeea5c87 (patch) | |
| tree | b6750e25d657bb7d82a40f06173553f2acba0486 /server/plugin.py | |
| parent | 3b8849a0437b56454a71b60976d9eb040235c242 (diff) | |
| download | alias-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.py | 9 |
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: |
