diff src/browser/libervia_main.py @ 752:9b57d117e8c5

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.
author Goffi <goffi@goffi.org>
date Mon, 23 Nov 2015 23:30:34 +0100
parents 108bb9d74fa2
children b392ea1514ee
line wrap: on
line diff
--- 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.<br />You'll only be able to talk publicly.")).show()
+
+        else:
+            dialog.InfoDialog(_(u"Blogging not available"), _(u"Your server can't handle (micro)blogging.<br />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():