summaryrefslogtreecommitdiff
path: root/src/tabs
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-12-08 23:50:16 +0100
committermathieui <mathieui@mathieui.net>2014-12-08 23:50:16 +0100
commit7b3265c636baef56e0468891cff236a462dad0a2 (patch)
treefacfa9de2ef1f5bb03d46a1b811b7bd44266f3e4 /src/tabs
parent122edc539ec09f659a6218a3d032a4b421eb552c (diff)
downloadpoezio-7b3265c636baef56e0468891cff236a462dad0a2.tar.gz
poezio-7b3265c636baef56e0468891cff236a462dad0a2.tar.bz2
poezio-7b3265c636baef56e0468891cff236a462dad0a2.tar.xz
poezio-7b3265c636baef56e0468891cff236a462dad0a2.zip
Fix #2754 (make /xhtml send a message with receipts, chatstates and display it properly)
(also make the message appear in PrivateTabs)
Diffstat (limited to 'src/tabs')
-rw-r--r--src/tabs/basetabs.py14
-rw-r--r--src/tabs/conversationtab.py8
2 files changed, 14 insertions, 8 deletions
diff --git a/src/tabs/basetabs.py b/src/tabs/basetabs.py
index 81a14253..c238bbd4 100644
--- a/src/tabs/basetabs.py
+++ b/src/tabs/basetabs.py
@@ -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:
diff --git a/src/tabs/conversationtab.py b/src/tabs/conversationtab.py
index 2ab33bb9..f4c10301 100644
--- a/src/tabs/conversationtab.py
+++ b/src/tabs/conversationtab.py
@@ -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):
"""