mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
We want to avoid opening a DB connection in the markdown thread as its DB connection might live for a long time (imported from commit 7700b2ca793ee5e9add7f071b92f22a4bf576b3d)
14 lines
326 B
Python
14 lines
326 B
Python
import re
|
|
|
|
from django.db.models import F, Q
|
|
import zerver.models
|
|
|
|
# Match multi-word string between @** ** or match any one-word
|
|
# sequences after @
|
|
find_mentions = r'(?<![^\s\'\"\(,:<])@(?:\*\*([^\*]+)\*\*|(\w+))'
|
|
|
|
wildcards = ['all', 'everyone']
|
|
|
|
def user_mention_matches_wildcard(mention):
|
|
return mention in wildcards
|