diff frontends/src/quick_frontend/quick_blog.py @ 1663:47224056ce5c

quick_frontend(blog): groups blog sending is handled
author Goffi <goffi@goffi.org>
date Tue, 24 Nov 2015 16:21:18 +0100
parents b08b828a87c9
children dbac3cb19159
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_blog.py	Tue Nov 24 16:21:18 2015 +0100
+++ b/frontends/src/quick_frontend/quick_blog.py	Tue Nov 24 16:21:18 2015 +0100
@@ -25,6 +25,7 @@
 from sat_frontends.quick_frontend.constants import Const as C
 from sat_frontends.quick_frontend import quick_widgets
 from sat_frontends.tools import jid
+from sat.tools import common
 
 try:
     # FIXME: to be removed when an acceptable solution is here
@@ -262,12 +263,15 @@
 
         mb_data.update(tags2mbdata(self.item.tags))
 
+        if self.blog.new_message_target not in (C.PUBLIC, C.GROUP):
+            raise NotImplementedError
+
         if self.level == 0:
-            if self.blog.new_message_target == C.PUBLIC:
-                if self.new:
-                    mb_data["allow_comments"] = C.BOOL_TRUE
-            else:
-                raise NotImplementedError
+            if self.new:
+                mb_data["allow_comments"] = C.BOOL_TRUE
+
+        if self.blog.new_message_target == C.GROUP:
+            common.iter2dict('group', self.blog.targets, mb_data)
 
         self.blog.host.bridge.mbSend(
             unicode(self.service or ''),
@@ -339,7 +343,7 @@
         if self._targets_type == C.ALL:
             return C.PUBLIC
         elif self._targets_type == C.GROUP:
-            return self.targets
+            return C.GROUP
         else:
             raise ValueError("Unkown targets type")