diff src/plugins/plugin_xep_0277.py @ 704:3c304929af74

plugin XEP-0277, group blogs: proper asynchronous methods for sending blogs.
author Goffi <goffi@goffi.org>
date Thu, 14 Nov 2013 17:51:35 +0100
parents 69a8bfd266a5
children 80e9d3ecb272
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0277.py	Thu Nov 14 16:49:57 2013 +0100
+++ b/src/plugins/plugin_xep_0277.py	Thu Nov 14 17:51:35 2013 +0100
@@ -160,14 +160,13 @@
         @param profile: profile which send the mood"""
         if 'content' not in data:
             error(_("Microblog data must contain at least 'content' key"))
-            return 3
+            raise exceptions.DataError('no "content" key found')
         content = data['content']
         if not content:
             error(_("Microblog data's content value must not be empty"))
-            return 3
+            raise exceptions.DataError('empty content')
         item = self.data2entry(data, profile)
-        self.host.plugins["XEP-0060"].publish(None, NS_MICROBLOG, [item], profile_key=profile)
-        return 0
+        return self.host.plugins["XEP-0060"].publish(None, NS_MICROBLOG, [item], profile_key=profile)
 
     def getLastMicroblogs(self, pub_jid, max_items=10, profile_key='@DEFAULT@'):
         """Get the last published microblogs