mirror of https://github.com/zulip/zulip.git
3892a8afd8
Previously, we would naively set has_attachment just by searching the whole messages for strings like `/user_uploads/...`. We now prevent running do_claim_attachments for messages that obviously do not have an attachment in them that we previously ran. For example: attachments in codeblocks or attachments that otherwise do not match our link syntax. The new implementation runs that check on only the urls that bugdown determines should be rendered. We also refactor some Attachment tests in test_messages to test this change. The new method is: 1. Create a list of potential_attachment_urls in Bugdown while rendering. 2. Loop over this list in do_claim_attachments for the actual claiming. For saving: 3. If we claimed an attachment, set message.has_attachment to True. For updating: 3. If claimed_attachment != message.has_attachment: update has_attachment. We do not modify the logic for 'unclaiming' attachments when editing. |
||
---|---|---|
.. | ||
__init__.py | ||
api_arguments_table_generator.py | ||
api_code_examples.py | ||
fenced_code.py | ||
help_emoticon_translations_table.py | ||
help_relative_links.py | ||
help_settings_links.py | ||
include.py | ||
nested_code_blocks.py | ||
tabbed_sections.py | ||
testing_mocks.py | ||
tlds-alpha-by-domain.txt |