diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2022-04-27 09:00:07 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-27 09:00:07 -0400 |
commit | 8a23bde82352f18d7d6f098e3f3f0ce7099efb86 (patch) | |
tree | 69f616cbc1b195490d8c82650db705fc5ea9bfc7 /synapse/handlers | |
parent | Add option to enable token registration without requiring 3pids (#12526) (diff) | |
download | synapse-8a23bde82352f18d7d6f098e3f3f0ce7099efb86.tar.xz |
Consistently use collections.abc.Mapping to check frozendict. (#12564)
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/relations.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/handlers/relations.py b/synapse/handlers/relations.py index 5efb561273..b5dc9f74b3 100644 --- a/synapse/handlers/relations.py +++ b/synapse/handlers/relations.py @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +import collections.abc import logging from typing import ( TYPE_CHECKING, @@ -24,7 +25,6 @@ from typing import ( ) import attr -from frozendict import frozendict from synapse.api.constants import RelationTypes from synapse.api.errors import SynapseError @@ -380,7 +380,7 @@ class RelationsHandler: # Do not bundle aggregations for an event which represents an edit or an # annotation. It does not make sense for them to have related events. relates_to = event.content.get("m.relates_to") - if isinstance(relates_to, (dict, frozendict)): + if isinstance(relates_to, collections.abc.Mapping): relation_type = relates_to.get("rel_type") if relation_type in (RelationTypes.ANNOTATION, RelationTypes.REPLACE): continue |