comparison src/plugins/plugin_xep_0277.py @ 309:f1a3db8ee04a

plugin xep-0277: fixed bad data check
author Goffi <goffi@goffi.org>
date Sat, 09 Apr 2011 13:17:31 +0200
parents 169e7386650a
children 53adec87d1d7
comparison
equal deleted inserted replaced
308:ce3607b7198d 309:f1a3db8ee04a
131 @param profile: profile which send the mood""" 131 @param profile: profile which send the mood"""
132 if not data.has_key('content'): 132 if not data.has_key('content'):
133 error(_("Microblog data must contain at least 'content' key")) 133 error(_("Microblog data must contain at least 'content' key"))
134 return 3 134 return 3
135 content = data['content'] 135 content = data['content']
136 if not content.has_key("content"): 136 if not content:
137 error(_("Microblog data's content value must not be empty")) 137 error(_("Microblog data's content value must not be empty"))
138 return 3 138 return 3
139 item = self.data2entry(data, profile) 139 item = self.data2entry(data, profile)
140 self.host.plugins["XEP-0060"].publish(None, NS_MICROBLOG, [item], profile_key = profile) 140 self.host.plugins["XEP-0060"].publish(None, NS_MICROBLOG, [item], profile_key = profile)
141 return 0 141 return 0