diff sat_frontends/jp/cmd_blog.py @ 2910:b2f323237fce

jp, plugin merge-requests: used u'' as default for item id in pubsub arguments + fixed some required arguments: u"" is now used as defaut item id instead of node, as it needs to be serialised anyway. This is temporary solution, as empty string can be used for item id (not forbidden by XEP-0060), but for now this is not handled correctly in jp/SàT (see https://bugs.goffi.org/bugs/view/289). Correct solution will probably need to use a special key in extra to mark empty string in id. Added/removed some required values for node or item when it made sense.
author Goffi <goffi@goffi.org>
date Sun, 14 Apr 2019 08:21:51 +0200
parents 84f82d014d06
children 781b5b6a33ee
line wrap: on
line diff
--- a/sat_frontends/jp/cmd_blog.py	Sun Apr 14 08:21:51 2019 +0200
+++ b/sat_frontends/jp/cmd_blog.py	Sun Apr 14 08:21:51 2019 +0200
@@ -183,7 +183,7 @@
         self.pubsub_item = self.args.item
         mb_data = {}
         self.setMbDataFromArgs(mb_data)
-        if self.pubsub_item is not None:
+        if self.pubsub_item:
             mb_data["id"] = self.pubsub_item
         content = codecs.getreader("utf-8")(sys.stdin).read()
         self.setMbDataContent(content, mb_data)
@@ -541,7 +541,7 @@
     def publish(self, content, mb_data):
         self.setMbDataContent(content, mb_data)
 
-        if self.pubsub_item is not None:
+        if self.pubsub_item:
             mb_data["id"] = self.pubsub_item
 
         mb_data = data_format.serialise(mb_data)