diff frontends/src/quick_frontend/quick_blog.py @ 1650:b08b828a87c9

quick frontend (blog): fixed group blog panels (displaying only, sending is not working yet)
author Goffi <goffi@goffi.org>
date Mon, 23 Nov 2015 16:21:32 +0100
parents 9e17690fb187
children 47224056ce5c
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_blog.py	Mon Nov 23 15:51:19 2015 +0100
+++ b/frontends/src/quick_frontend/quick_blog.py	Mon Nov 23 16:21:32 2015 +0100
@@ -375,10 +375,13 @@
         def gotSession(rt_session):
             self._getResults(rt_session)
 
-        if self._targets_type == C.ALL:
-            self.host.bridge.mbGetFromManyWithComments(C.ALL, (), 10, 10, {}, {"subscribe":C.BOOL_TRUE}, profile=self.profile, callback=gotSession)
+        if self._targets_type in (C.ALL, C.GROUP):
+            targets = tuple(self.targets) if self._targets_type is C.GROUP else ()
+            self.host.bridge.mbGetFromManyWithComments(self._targets_type, targets, 10, 10, {}, {"subscribe":C.BOOL_TRUE}, profile=self.profile, callback=gotSession)
             own_pep = self.host.whoami.bare
             self.host.bridge.mbGetFromManyWithComments(C.JID, (unicode(own_pep),), 10, 10, {}, {}, profile=self.profile, callback=gotSession)
+        else:
+            raise NotImplementedError(u'{} target type is not managed'.format(self._targets_type))
 
     def isJidAccepted(self, jid_):
         """Tell if a jid is actepted and must be shown in this panel
@@ -458,15 +461,15 @@
 
 def mbdata2tags(mb_data):
     """Parse the tags in microblog data.
-    
+
     @param mb_data (dict): microblog data as return by bridge methods
     @return list[unicode]
     """
     return [tag for key, tag in mb_data.iteritems() if (key == "tag" or key.startswith("tag#")) and tag]
-    
+
 def tags2mbdata(tags):
     """Build from the tags a dict using the microblog data format.
-    
+
     @param tags (list[unicode]): list of tags
     @return dict
     """