mirror of
https://github.com/zulip/zulip.git
synced 2026-06-24 21:08:25 +08:00
Given typeahed and the fact that this only worked if the person had a full name that didn't contain whitespace, this side effect of the original @shortname mentionfeature that we removed was experienced by users as a bug. Fixes #6142.
13 lines
344 B
Python
13 lines
344 B
Python
from __future__ import absolute_import
|
|
|
|
from typing import Text
|
|
# 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):
|
|
# type: (Text) -> bool
|
|
return mention in wildcards
|