mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-05-06 14:55:05 -04:00
Support icons for Identity Providers (#9154)
This commit is contained in:
parent
6c0dfd2e8e
commit
0cd2938bc8
19 changed files with 146 additions and 91 deletions
|
@ -16,7 +16,6 @@
|
|||
|
||||
import collections
|
||||
import logging
|
||||
import re
|
||||
from abc import abstractmethod
|
||||
from enum import Enum
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
@ -30,6 +29,7 @@ from synapse.storage.databases.main.search import SearchStore
|
|||
from synapse.types import JsonDict, ThirdPartyInstanceID
|
||||
from synapse.util import json_encoder
|
||||
from synapse.util.caches.descriptors import cached
|
||||
from synapse.util.stringutils import MXC_REGEX
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -660,8 +660,6 @@ class RoomWorkerStore(SQLBaseStore):
|
|||
The local and remote media as a lists of tuples where the key is
|
||||
the hostname and the value is the media ID.
|
||||
"""
|
||||
mxc_re = re.compile("^mxc://([^/]+)/([^/#?]+)")
|
||||
|
||||
sql = """
|
||||
SELECT stream_ordering, json FROM events
|
||||
JOIN event_json USING (room_id, event_id)
|
||||
|
@ -688,7 +686,7 @@ class RoomWorkerStore(SQLBaseStore):
|
|||
for url in (content_url, thumbnail_url):
|
||||
if not url:
|
||||
continue
|
||||
matches = mxc_re.match(url)
|
||||
matches = MXC_REGEX.match(url)
|
||||
if matches:
|
||||
hostname = matches.group(1)
|
||||
media_id = matches.group(2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue