Mercurial > libervia-backend
comparison src/plugins/plugin_xep_0085.py @ 698:d731ae066158
core: sendMessage's options parameter has been renamed to extra to be consistent with newMessage
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 13 Nov 2013 13:58:10 +0100 |
parents | 0c84fb112d70 |
children | 6edd9bda4e3f |
comparison
equal
deleted
inserted
replaced
697:0c84fb112d70 | 698:d731ae066158 |
---|---|
183 domish.generateElementsNamed(message.elements(), name="body").next() | 183 domish.generateElementsNamed(message.elements(), name="body").next() |
184 message.addElement('active', NS_CHAT_STATES) | 184 message.addElement('active', NS_CHAT_STATES) |
185 # launch the chat state machine (init the timer) | 185 # launch the chat state machine (init the timer) |
186 self.__chatStateActive(to_jid, mess_data["type"], profile) | 186 self.__chatStateActive(to_jid, mess_data["type"], profile) |
187 except StopIteration: | 187 except StopIteration: |
188 if "chat_state" in mess_data["options"]: | 188 if "chat_state" in mess_data["extra"]: |
189 state = mess_data["options"]["chat_state"] | 189 state = mess_data["extra"].pop("chat_state") |
190 assert(state in CHAT_STATES) | 190 assert(state in CHAT_STATES) |
191 message.addElement(state, NS_CHAT_STATES) | 191 message.addElement(state, NS_CHAT_STATES) |
192 return mess_data | 192 return mess_data |
193 | 193 |
194 treatments.addCallback(treatment) | 194 treatments.addCallback(treatment) |
301 # send a new message without body | 301 # send a new message without body |
302 self.host.sendMessage(self.to_jid, | 302 self.host.sendMessage(self.to_jid, |
303 '', | 303 '', |
304 '', | 304 '', |
305 self.mess_type, | 305 self.mess_type, |
306 options={"chat_state": state}, | 306 extra={"chat_state": state}, |
307 profile_key=self.profile) | 307 profile_key=self.profile) |
308 self.state = state | 308 self.state = state |
309 if not self.timer is None: | 309 if not self.timer is None: |
310 self.timer.cancel() | 310 self.timer.cancel() |
311 | 311 |