mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-11 22:24:18 -05:00
Fix detecting unknown devices from remote encrypted events. (#6848)
We were looking at the wrong event type (`m.room.encryption` vs `m.room.encrypted`). Also fixup the duplicate `EvenTypes` entries. Introduced in #6776.
This commit is contained in:
parent
68ef7ebbef
commit
6475382d80
1
changelog.d/6848.bugfix
Normal file
1
changelog.d/6848.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix detecting unknown devices from remote encrypted events.
|
@ -77,12 +77,11 @@ class EventTypes(object):
|
|||||||
Aliases = "m.room.aliases"
|
Aliases = "m.room.aliases"
|
||||||
Redaction = "m.room.redaction"
|
Redaction = "m.room.redaction"
|
||||||
ThirdPartyInvite = "m.room.third_party_invite"
|
ThirdPartyInvite = "m.room.third_party_invite"
|
||||||
Encryption = "m.room.encryption"
|
|
||||||
RelatedGroups = "m.room.related_groups"
|
RelatedGroups = "m.room.related_groups"
|
||||||
|
|
||||||
RoomHistoryVisibility = "m.room.history_visibility"
|
RoomHistoryVisibility = "m.room.history_visibility"
|
||||||
CanonicalAlias = "m.room.canonical_alias"
|
CanonicalAlias = "m.room.canonical_alias"
|
||||||
Encryption = "m.room.encryption"
|
Encrypted = "m.room.encrypted"
|
||||||
RoomAvatar = "m.room.avatar"
|
RoomAvatar = "m.room.avatar"
|
||||||
RoomEncryption = "m.room.encryption"
|
RoomEncryption = "m.room.encryption"
|
||||||
GuestAccess = "m.room.guest_access"
|
GuestAccess = "m.room.guest_access"
|
||||||
|
@ -752,7 +752,7 @@ class FederationHandler(BaseHandler):
|
|||||||
|
|
||||||
# For encrypted messages we check that we know about the sending device,
|
# For encrypted messages we check that we know about the sending device,
|
||||||
# if we don't then we mark the device cache for that user as stale.
|
# if we don't then we mark the device cache for that user as stale.
|
||||||
if event.type == EventTypes.Encryption:
|
if event.type == EventTypes.Encrypted:
|
||||||
device_id = event.content.get("device_id")
|
device_id = event.content.get("device_id")
|
||||||
if device_id is not None:
|
if device_id is not None:
|
||||||
cached_devices = await self.store.get_cached_devices_for_user(
|
cached_devices = await self.store.get_cached_devices_for_user(
|
||||||
|
@ -360,7 +360,7 @@ class RoomCreationHandler(BaseHandler):
|
|||||||
(EventTypes.RoomHistoryVisibility, ""),
|
(EventTypes.RoomHistoryVisibility, ""),
|
||||||
(EventTypes.GuestAccess, ""),
|
(EventTypes.GuestAccess, ""),
|
||||||
(EventTypes.RoomAvatar, ""),
|
(EventTypes.RoomAvatar, ""),
|
||||||
(EventTypes.Encryption, ""),
|
(EventTypes.RoomEncryption, ""),
|
||||||
(EventTypes.ServerACL, ""),
|
(EventTypes.ServerACL, ""),
|
||||||
(EventTypes.RelatedGroups, ""),
|
(EventTypes.RelatedGroups, ""),
|
||||||
(EventTypes.PowerLevels, ""),
|
(EventTypes.PowerLevels, ""),
|
||||||
|
@ -286,7 +286,7 @@ class StatsHandler(StateDeltasHandler):
|
|||||||
room_state["history_visibility"] = event_content.get(
|
room_state["history_visibility"] = event_content.get(
|
||||||
"history_visibility"
|
"history_visibility"
|
||||||
)
|
)
|
||||||
elif typ == EventTypes.Encryption:
|
elif typ == EventTypes.RoomEncryption:
|
||||||
room_state["encryption"] = event_content.get("algorithm")
|
room_state["encryption"] = event_content.get("algorithm")
|
||||||
elif typ == EventTypes.Name:
|
elif typ == EventTypes.Name:
|
||||||
room_state["name"] = event_content.get("name")
|
room_state["name"] = event_content.get("name")
|
||||||
|
@ -744,7 +744,7 @@ class StatsStore(StateDeltasStore):
|
|||||||
EventTypes.Create,
|
EventTypes.Create,
|
||||||
EventTypes.JoinRules,
|
EventTypes.JoinRules,
|
||||||
EventTypes.RoomHistoryVisibility,
|
EventTypes.RoomHistoryVisibility,
|
||||||
EventTypes.Encryption,
|
EventTypes.RoomEncryption,
|
||||||
EventTypes.Name,
|
EventTypes.Name,
|
||||||
EventTypes.Topic,
|
EventTypes.Topic,
|
||||||
EventTypes.RoomAvatar,
|
EventTypes.RoomAvatar,
|
||||||
@ -816,7 +816,7 @@ class StatsStore(StateDeltasStore):
|
|||||||
room_state["history_visibility"] = event.content.get(
|
room_state["history_visibility"] = event.content.get(
|
||||||
"history_visibility"
|
"history_visibility"
|
||||||
)
|
)
|
||||||
elif event.type == EventTypes.Encryption:
|
elif event.type == EventTypes.RoomEncryption:
|
||||||
room_state["encryption"] = event.content.get("algorithm")
|
room_state["encryption"] = event.content.get("algorithm")
|
||||||
elif event.type == EventTypes.Name:
|
elif event.type == EventTypes.Name:
|
||||||
room_state["name"] = event.content.get("name")
|
room_state["name"] = event.content.get("name")
|
||||||
|
Loading…
Reference in New Issue
Block a user