diff server_side/blog.py @ 149:f78761e1be8e

server side: fixed public microblog
author Goffi <goffi@goffi.org>
date Mon, 10 Dec 2012 00:35:37 +0100
parents ddfcc4cb6cee
children 9763dec220ed
line wrap: on
line diff
--- a/server_side/blog.py	Sun Dec 09 23:42:08 2012 +0100
+++ b/server_side/blog.py	Mon Dec 10 00:35:37 2012 +0100
@@ -56,10 +56,15 @@
             if not prof_found or prof_found=='libervia':
                 return MicroBlog.ERROR_TEMPLATE % "Invalid nickname"
             else:
-                pub_jid=JID(self.host.bridge.getParamA('JabberID','Connection','value',prof_found))
-                d = defer.Deferred()
-                d.addCallbacks(self.render_html_blog, self.render_error_blog, [request, prof_found], None, [request, prof_found], None)
-                self.host.bridge.getLastMicroblogs(pub_jid.userhost(), 10, 'libervia', d.callback, d.errback)
+                def got_jid(pub_jid_s):
+                    pub_jid = JID(pub_jid_s)
+                    d2 = defer.Deferred()
+                    d2.addCallbacks(self.render_html_blog, self.render_error_blog, [request, prof_found], None, [request, prof_found], None)
+                    self.host.bridge.getLastGroupBlogs(pub_jid.userhost(), 10, 'libervia', d2.callback, d2.errback)
+                
+                d1 = defer.Deferred()
+                JID(self.host.bridge.asyncGetParamA('JabberID', 'Connection', 'value', prof_found, callback=d1.callback, errback=d1.errback))
+                d1.addCallbacks(got_jid)
 
                 return server.NOT_DONE_YET