def send_message(self, mess): super().send_message(mess) log.debug("send_message to %s", mess.to) # We need to unescape the unicode characters (not the markup incompatible ones) mhtml = xhtmlim.unescape(self.md_xhtml.convert(mess.body)) if self.xhtmlim else None self.conn.client.send_message(mto=str(mess.to), mbody=self.md_text.convert(mess.body), mhtml=mhtml, mtype='chat' if mess.is_direct else 'groupchat')
def send_message(self, mess): super().send_message(mess) log.debug("send_message to %s", mess.to) # We need to unescape the unicode characters (not the markup incompatible ones) mhtml = xhtmlim.unescape(self.md_xhtml.convert( mess.body)) if self.xhtmlim else None self.conn.client.send_message( mto=str(mess.to), mbody=self.md_text.convert(mess.body), mhtml=mhtml, mtype='chat' if mess.is_direct else 'groupchat')
def send_message(self, msg: Message) -> None: super().send_message(msg) log.debug("send_message to %s", msg.to) # We need to unescape the unicode characters (not the markup incompatible ones) mhtml = (xhtmlim.unescape(self.md_xhtml.convert(msg.body)) if self.xhtmlim else None) self.conn.client.send_message( mto=str(msg.to), mbody=self.md_text.convert(msg.body), mhtml=mhtml, mtype="chat" if msg.is_direct else "groupchat", )