Verified Commit 7b3265c6 authored by mathieui's avatar mathieui

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

(also make the message appear in PrivateTabs)
parent 122edc53
......@@ -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:
......
......@@ -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):
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment