From 1a679795e123a4a9c7d8322c0f9a1186ae8e2444 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Fri, 10 Jan 2014 16:35:14 -0500 Subject: [PATCH] Flatten the code for build_message_payload. (imported from commit b58c91468b36d33c163d4994b501eac796d10e8f) --- zerver/lib/actions.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index 775f5222a6..c39a6140dc 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -2020,9 +2020,13 @@ def build_message_list(user_profile, messages): return re.sub(r"\[(\S*)\]\((\S*)\)", r"\2", content) def build_message_payload(message): - return {'plain': relative_to_full_url( - fix_plaintext_image_urls(message.content)), - 'html': relative_to_full_url(message.rendered_content)} + plain = message.content + plain = fix_plaintext_image_urls(plain) + plain = relative_to_full_url(plain) + + html = message.rendered_content + html = relative_to_full_url(html) + return {'plain': plain, 'html': html} def build_sender_payload(message): sender = sender_string(message)