comparison src/plugins/plugin_exp_command_export.py @ 636:7ea6d5a86e58

plugin XEP-0085: Chat State Notifications - new "options" parameter to send chat states - plugin command export: messages without body are now delivered (since all the chat states other than "active" need them)
author souliane <souliane@mailoo.org>
date Thu, 05 Sep 2013 20:48:47 +0200
parents 84a6e83157c2
children 8004c7d4aba7
comparison
equal deleted inserted replaced
635:eff8772fd472 636:7ea6d5a86e58
105 from_jid = jid.JID(message["from"]) 105 from_jid = jid.JID(message["from"])
106 spawned_key = (from_jid.userhostJID(), profile) 106 spawned_key = (from_jid.userhostJID(), profile)
107 try: 107 try:
108 body = [e for e in message.elements() if e.name == 'body'][0] 108 body = [e for e in message.elements() if e.name == 'body'][0]
109 except IndexError: 109 except IndexError:
110 warning("Received message without body") 110 # do not block message without body (chat state notification...)
111 return False 111 warning("No body element found in message, following normal behaviour")
112 return True
112 113
113 mess_data = unicode(body) + '\n' 114 mess_data = unicode(body) + '\n'
114 115
115 if spawned_key in self.spawned: 116 if spawned_key in self.spawned:
116 processes_set = self.spawned[spawned_key] 117 processes_set = self.spawned[spawned_key]