# HG changeset patch # User Goffi # Date 1448378478 -3600 # Node ID 47224056ce5cf20bb8472705dfe3164d920e1e9b # Parent 9aa2a703e4607f77e6ab99feb78b18565921b2c6 quick_frontend(blog): groups blog sending is handled diff -r 9aa2a703e460 -r 47224056ce5c frontends/src/quick_frontend/quick_blog.py --- 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")