Fix replies/forwards to/of images

This commit is contained in:
Tulir Asokan
2018-03-08 18:01:58 +02:00
parent 3eefbc4e34
commit 150321a4d7
2 changed files with 13 additions and 8 deletions
+7 -1
View File
@@ -120,11 +120,17 @@ async def _add_reply_header(source, text, html, evt, relates_to, main_intent, is
return text_with_quote, html
async def telegram_to_matrix(evt, source, main_intent=None, is_edit=False):
async def telegram_to_matrix(evt, source, main_intent=None, is_edit=False, prefix_text=None,
prefix_html=None):
text = add_surrogates(evt.message)
html = _telegram_entities_to_matrix_catch(text, evt.entities) if evt.entities else None
relates_to = {}
if prefix_html:
html = prefix_html + (html or escape(text))
if prefix_text:
text = prefix_text + text
if evt.fwd_from:
text, html = await _add_forward_header(source, text, html, evt.fwd_from.from_id)