plugin XEP-0277, group blogs: proper asynchronous methods for sending blogs.

This commit is contained in:
Goffi 2013-11-14 17:51:35 +01:00
commit e23ff9f8d1

View file

@ -160,14 +160,13 @@ class XEP_0277(object):
@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