# HG changeset patch # User Goffi # Date 1448317834 -3600 # Node ID 9b57d117e8c511b645508422da3647c390ae8a29 # Parent 2ddd85551612ba7ef05df632cbc30191466dc70b browser side: features are checked for microblogging and group blogging. If one of them is not available, a pop-up warns it, and it is not possible to write a new entry. diff -r 2ddd85551612 -r 9b57d117e8c5 src/browser/libervia_main.py --- a/src/browser/libervia_main.py Mon Nov 23 23:30:34 2015 +0100 +++ b/src/browser/libervia_main.py Mon Nov 23 23:30:34 2015 +0100 @@ -363,10 +363,26 @@ contact_list = self.contact_list contact_list.update() + try: + self.mblog_available = C.bool(self.features['XEP-0277']['available']) + except KeyError: + self.mblog_available = False + + try: + self.groupblog_available = C.bool(self.features['GROUPBLOG']['available']) + except KeyError: + self.groupblog_available = False blog_widget = self.displayWidget(blog.Blog, ()) self.setSelected(blog_widget) + if self.mblog_available: + if not self.groupblog_available: + dialog.InfoDialog(_(u"Group blogging not available"), _(u"Your server can manage (micro)blogging, but not fine permissions.
You'll only be able to talk publicly.")).show() + + else: + dialog.InfoDialog(_(u"Blogging not available"), _(u"Your server can't handle (micro)blogging.
You'll be able to see your contacts (micro)blogs, but not to post yourself.")).show() + # we fill the panels already here # for wid in self.widgets.getWidgets(blog.MicroblogPanel): # if wid.accept_all(): diff -r 2ddd85551612 -r 9b57d117e8c5 src/browser/sat_browser/blog.py --- a/src/browser/sat_browser/blog.py Mon Nov 23 23:30:34 2015 +0100 +++ b/src/browser/sat_browser/blog.py Mon Nov 23 23:30:34 2015 +0100 @@ -396,7 +396,9 @@ self.vpanel = VerticalPanel() self.vpanel.setStyleName('microblogPanel') self.setWidget(self.vpanel) - self.addEntry(editable=True, first=True) + if ((self._targets_type == C.ALL and self.host.mblog_available) or + (self._targets_type == C.GROUP and self.host.groupblog_available)): + self.addEntry(editable=True, first=True) self.getAll()