diff --git a/frontends/src/quick_frontend/quick_blog.py b/frontends/src/quick_frontend/quick_blog.py index 18796ab6..62cce83a 100644 --- a/frontends/src/quick_frontend/quick_blog.py +++ b/frontends/src/quick_frontend/quick_blog.py @@ -25,6 +25,7 @@ log = getLogger(__name__) 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 @@ class Entry(EntriesManager): 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 @@ class QuickBlog(EntriesManager, quick_widgets.QuickWidget): 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")