We no longer need to factor in and fetch the join rules
This commit is contained in:
parent
53de3b64ad
commit
f750b4fcc2
|
@ -155,7 +155,6 @@ const fetchRoomData = traceFunction(async function (
|
|||
stateCanonicalAliasResDataOutcome,
|
||||
stateAvatarResDataOutcome,
|
||||
stateHistoryVisibilityResDataOutcome,
|
||||
stateJoinRulesResDataOutcome,
|
||||
predecessorInfoOutcome,
|
||||
successorInfoOutcome,
|
||||
] = await Promise.allSettled([
|
||||
|
@ -182,10 +181,6 @@ const fetchRoomData = traceFunction(async function (
|
|||
abortSignal,
|
||||
}
|
||||
),
|
||||
fetchEndpointAsJson(getStateEndpointForRoomIdAndEventType(roomId, 'm.room.join_rules'), {
|
||||
accessToken: matrixAccessToken,
|
||||
abortSignal,
|
||||
}),
|
||||
fetchPredecessorInfo(matrixAccessToken, roomId, { abortSignal }),
|
||||
fetchSuccessorInfo(matrixAccessToken, roomId, { abortSignal }),
|
||||
]);
|
||||
|
@ -220,12 +215,6 @@ const fetchRoomData = traceFunction(async function (
|
|||
historyVisibility = data?.content?.history_visibility;
|
||||
}
|
||||
|
||||
let joinRule;
|
||||
if (stateJoinRulesResDataOutcome.reason === undefined) {
|
||||
const { data } = stateJoinRulesResDataOutcome.value;
|
||||
joinRule = data?.content?.join_rule;
|
||||
}
|
||||
|
||||
let roomCreationTs;
|
||||
let predecessorRoomId;
|
||||
let predecessorLastKnownEventId;
|
||||
|
@ -251,7 +240,6 @@ const fetchRoomData = traceFunction(async function (
|
|||
canonicalAlias,
|
||||
avatarUrl,
|
||||
historyVisibility,
|
||||
joinRule,
|
||||
roomCreationTs,
|
||||
predecessorRoomId,
|
||||
predecessorLastKnownEventId,
|
||||
|
|
|
@ -833,7 +833,7 @@ router.get(
|
|||
if (!allowedToViewRoom) {
|
||||
throw new StatusError(
|
||||
403,
|
||||
`Only \`world_readable\` rooms can be viewed in the archive. ${roomData.id} has m.room.history_visiblity=${roomData.historyVisibility} m.room.join_rules=${roomData.joinRule}`
|
||||
`Only \`world_readable\` rooms can be viewed in the archive. ${roomData.id} has m.room.history_visiblity=${roomData.historyVisibility}`
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue