diff libervia.tac @ 1:0a7c685faa53

ContactPanel: first draft
author Goffi <goffi@goffi.org>
date Mon, 31 Jan 2011 20:31:25 +0100
parents 140cec48224a
children 669c531a857e
line wrap: on
line diff
--- a/libervia.tac	Sun Jan 30 21:50:22 2011 +0100
+++ b/libervia.tac	Mon Jan 31 20:31:25 2011 +0100
@@ -42,9 +42,9 @@
         self.sat_host=sat_host
 
     def render(self, request):
-        _session = request.getSession()
+        self.session = request.getSession()
         try:
-            profile = _session.sat_profile
+            profile = self.session.sat_profile
         except AttributeError:
             #user is not identified, we return a jsonrpc fault
             parsed = jsonrpclib.loads(request.content.read())
@@ -55,9 +55,8 @@
 
     def jsonrpc_getContacts(self):
         """Return all passed args."""
-        d = defer.Deferred()
-        reactor.callLater(10, d.callback, [unicode(contact[0]) for contact in self.sat_host.bridge.getContacts()])
-        return d
+        profile = self.session.sat_profile
+        return self.sat_host.bridge.getContacts(profile)
 
 class Register(jsonrpc.JSONRPC):
     """This class manage the registration procedure with SàT
@@ -232,13 +231,11 @@
 
     def startService(self):
         reactor.listenTCP(8080, self.site)
-
+    
     def run(self):
-        debug(_("running app"))
         reactor.run()
     
     def stop(self):
-        debug(_("stopping app"))
         reactor.stop()