plugin XEP-0277, group blogs: proper asynchronous methods for sending blogs.
This commit is contained in:
parent
86e9bf62c7
commit
e23ff9f8d1
1 changed files with 19 additions and 19 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue