Support displaying emoji in digest and missed PM emails.

(imported from commit b440da2501ccb6dd95dc79c3fbce1e81b17c38f4)
This commit is contained in:
Jessica McKellar 2013-12-18 13:23:08 -05:00
parent 2f59f69a1f
commit 96ea91056e
1 changed files with 9 additions and 1 deletions

View File

@ -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