mirror of https://github.com/zulip/zulip.git
1b8a5a3344
Backend logic for handling user mention was cluttered because it was handled at two stages first in get_possible_mentions_info while fetching mention data based on the messsage and then later in UserMentionPattern which handles processing of text for mention. Ideally UserMentionPattern should depend on get_possible_mentions_info only for data but there was a shared logic between these two that made it hard to debug any possible bugs. Updates in this commit make both of these functions coherent in terms of logic and also add appropiate comments to improve readability of these functions. There was also a hidden bug that if a user A is mentioned in with @**name|id** then @**invalid|id** again mentioned A because of the way we handled mentions earlier. It is solved as a result of this refactor and appropiate test has been added for this. This has been tested manually as well as by adding new test to address missing case. |
||
---|---|---|
.. | ||
data_import | ||
lib | ||
management | ||
migrations | ||
openapi | ||
templatetags | ||
tests | ||
tornado | ||
views | ||
webhooks | ||
worker | ||
__init__.py | ||
apps.py | ||
context_processors.py | ||
decorator.py | ||
filters.py | ||
forms.py | ||
logging_handlers.py | ||
middleware.py | ||
models.py | ||
signals.py |