comparison src/plugins/plugin_xep_0163.py @ 410:ef9a4453959b

plugin XEP-0163: user event mood with no item fix
author Goffi <goffi@goffi.org>
date Sat, 08 Oct 2011 20:27:15 +0200
parents f964dcec1611
children cf005701624b
comparison
equal deleted inserted replaced
409:2e0dc5299bce 410:ef9a4453959b
99 error (_('Trying to send personal event for an unknown type')) 99 error (_('Trying to send personal event for an unknown type'))
100 return 2 100 return 2
101 return self.pep_out_cb[event_type](data, profile) 101 return self.pep_out_cb[event_type](data, profile)
102 102
103 def userMoodCB(self, itemsEvent, profile): 103 def userMoodCB(self, itemsEvent, profile):
104 if not itemsEvent.items:
105 debug(_("No item found"))
106 return
104 try: 107 try:
105 mood_elem = filter(lambda x:x.name == "mood", itemsEvent.items[0].children)[0] 108 mood_elem = filter(lambda x:x.name == "mood", itemsEvent.items[0].children)[0]
106 except KeyError: 109 except KeyError:
107 error(_("Can't find mood element in mood event")) 110 error(_("Can't find mood element in mood event"))
108 return 111 return