Fix #2754 (make /xhtml send a message with receipts, chatstates and display it properly)

(also make the message appear in PrivateTabs)
This commit is contained in:
mathieui 2014-12-08 23:50:16 +01:00
parent 122edc539e
commit 7b3265c636
No known key found for this signature in database
GPG key ID: C59F84CEEFD616E3
2 changed files with 14 additions and 8 deletions

View file

@ -746,6 +746,20 @@ class OneToOneTab(ChatTab):
self.text_win.modify_message(msg_id, new_msg)
self.core.refresh_window()
@command_args_parser.raw
def command_xhtml(self, xhtml_data):
message = self.generate_xhtml_message(xhtml_data)
if message:
if self.remote_supports_receipts:
message._add_receipt = True
if self.remote_wants_chatstates:
message['chat_sate'] = 'active'
message.send()
body = xhtml.xhtml_to_poezio_colors(xhtml_data, force=True)
self._text_buffer.add_message(body, nickname=self.core.own_nick,
identifier=message['id'],)
self.refresh()
def check_features(self):
"check the features supported by the other party"
if safeJID(self.get_dest_jid()).resource:

View file

@ -151,14 +151,6 @@ class ConversationTab(OneToOneTab):
self.text_win.refresh()
self.input.refresh()
@command_args_parser.raw
def command_xhtml(self, xhtml):
message = self.generate_xhtml_message(xhtml)
if message:
message.send()
self.core.add_message_to_text_buffer(self._text_buffer, message['body'], None, self.core.own_nick)
self.refresh()
@command_args_parser.quoted(0, 1)
def command_last_activity(self, args):
"""