Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Remove redundant store_room call (#6979)
Browse files Browse the repository at this point in the history
* commit '691659568':
  Remove redundant store_room call (#6979)
  • Loading branch information
anoadragon453 committed Mar 24, 2020
2 parents 698962a + 6916595 commit 4f819f0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
1 change: 1 addition & 0 deletions changelog.d/6979.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove redundant `store_room` call from `FederationHandler._process_received_pdu`.
23 changes: 0 additions & 23 deletions synapse/handlers/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
FederationDeniedError,
FederationError,
RequestSendFailed,
StoreError,
SynapseError,
)
from synapse.api.room_versions import KNOWN_ROOM_VERSIONS, RoomVersion, RoomVersions
Expand Down Expand Up @@ -711,28 +710,6 @@ async def _process_received_pdu(
except AuthError as e:
raise FederationError("ERROR", e.code, e.msg, affected=event.event_id)

room = await self.store.get_room(room_id)

if not room:
try:
prev_state_ids = await context.get_prev_state_ids()
create_event = await self.store.get_event(
prev_state_ids[(EventTypes.Create, "")]
)

room_version_id = create_event.content.get(
"room_version", RoomVersions.V1.identifier
)

await self.store.store_room(
room_id=room_id,
room_creator_user_id="",
is_public=False,
room_version=KNOWN_ROOM_VERSIONS[room_version_id],
)
except StoreError:
logger.exception("Failed to store room.")

if event.type == EventTypes.Member:
if event.membership == Membership.JOIN:
# Only fire user_joined_room if the user has acutally
Expand Down

0 comments on commit 4f819f0

Please sign in to comment.