From 96ea91056e02d6c638b48f3bdf7a57dda0d1b9b1 Mon Sep 17 00:00:00 2001 From: Jessica McKellar Date: Wed, 18 Dec 2013 13:23:08 -0500 Subject: [PATCH] Support displaying emoji in digest and missed PM emails. (imported from commit b440da2501ccb6dd95dc79c3fbce1e81b17c38f4) --- zerver/lib/actions.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index 488b6ea4a5..0950ce3392 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -1894,9 +1894,17 @@ def build_message_list(user_profile, messages): # There's a small chance of colliding with non-Zulip URLs containing # "/user_uploads/", but we don't have much information about the # structure of the URL to leverage. - return re.sub( + content = re.sub( r"/user_uploads/(\S*)", settings.EXTERNAL_HOST + r"/user_uploads/\1", content) + # URLs for emoji are of the form + # "static/third/gemoji/images/emoji/snowflake.png". + content = re.sub( + r"static/third/gemoji/images/emoji/", + settings.EXTERNAL_HOST + r"/static/third/gemoji/images/emoji/", + content) + + return content def fix_plaintext_image_urls(content): # Replace image URLs in plaintext content of the form