Update features.py

This commit is contained in:
dev 2026-10-31 09:12:19 +00:00
parent 36482c425a
commit 6aeac4659c

View File

@ -38,7 +38,6 @@ REACTION_EMOJI_RE = re.compile(r"^.{1,16}$")
HEX_COLOR_RE = re.compile(r"^#[0-9a-fA-F]{6}$") HEX_COLOR_RE = re.compile(r"^#[0-9a-fA-F]{6}$")
PAGE_LINK_RE = re.compile(r"\]\((?:/teams/[^/]+/pages/)?([a-z0-9-]{1,48})\)", re.IGNORECASE) PAGE_LINK_RE = re.compile(r"\]\((?:/teams/[^/]+/pages/)?([a-z0-9-]{1,48})\)", re.IGNORECASE)
def valid_hex_color(value: object) -> bool: def valid_hex_color(value: object) -> bool:
return bool(isinstance(value, str) and HEX_COLOR_RE.fullmatch(value.strip())) return bool(isinstance(value, str) and HEX_COLOR_RE.fullmatch(value.strip()))
@ -112,7 +111,7 @@ def detect_website_brand(website: str) -> dict:
return {"host": host, "brand": brand, "label": label} return {"host": host, "brand": brand, "label": label}
return {"host": host, "brand": "web", "label": "website"} return {"host": host, "brand": "web", "label": "website"}
def attachment_kind_from_name_and_mime( def attachment_kind_from_name_and_mime(
original_name: Optional[str], original_name: Optional[str],
@ -424,6 +423,8 @@ def user_can_see_last_active(settings_row, viewer: Optional[dict], target_user_i
return False return False
def page_payload(app_module, page, user: Optional[dict]) -> dict: def page_payload(app_module, page, user: Optional[dict]) -> dict:
can_read = bool( can_read = bool(
page["visibility"] == "public" page["visibility"] == "public"