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,
|
stateCanonicalAliasResDataOutcome,
|
||||||
stateAvatarResDataOutcome,
|
stateAvatarResDataOutcome,
|
||||||
stateHistoryVisibilityResDataOutcome,
|
stateHistoryVisibilityResDataOutcome,
|
||||||
stateJoinRulesResDataOutcome,
|
|
||||||
predecessorInfoOutcome,
|
predecessorInfoOutcome,
|
||||||
successorInfoOutcome,
|
successorInfoOutcome,
|
||||||
] = await Promise.allSettled([
|
] = await Promise.allSettled([
|
||||||
|
@ -182,10 +181,6 @@ const fetchRoomData = traceFunction(async function (
|
||||||
abortSignal,
|
abortSignal,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
fetchEndpointAsJson(getStateEndpointForRoomIdAndEventType(roomId, 'm.room.join_rules'), {
|
|
||||||
accessToken: matrixAccessToken,
|
|
||||||
abortSignal,
|
|
||||||
}),
|
|
||||||
fetchPredecessorInfo(matrixAccessToken, roomId, { abortSignal }),
|
fetchPredecessorInfo(matrixAccessToken, roomId, { abortSignal }),
|
||||||
fetchSuccessorInfo(matrixAccessToken, roomId, { abortSignal }),
|
fetchSuccessorInfo(matrixAccessToken, roomId, { abortSignal }),
|
||||||
]);
|
]);
|
||||||
|
@ -220,12 +215,6 @@ const fetchRoomData = traceFunction(async function (
|
||||||
historyVisibility = data?.content?.history_visibility;
|
historyVisibility = data?.content?.history_visibility;
|
||||||
}
|
}
|
||||||
|
|
||||||
let joinRule;
|
|
||||||
if (stateJoinRulesResDataOutcome.reason === undefined) {
|
|
||||||
const { data } = stateJoinRulesResDataOutcome.value;
|
|
||||||
joinRule = data?.content?.join_rule;
|
|
||||||
}
|
|
||||||
|
|
||||||
let roomCreationTs;
|
let roomCreationTs;
|
||||||
let predecessorRoomId;
|
let predecessorRoomId;
|
||||||
let predecessorLastKnownEventId;
|
let predecessorLastKnownEventId;
|
||||||
|
@ -251,7 +240,6 @@ const fetchRoomData = traceFunction(async function (
|
||||||
canonicalAlias,
|
canonicalAlias,
|
||||||
avatarUrl,
|
avatarUrl,
|
||||||
historyVisibility,
|
historyVisibility,
|
||||||
joinRule,
|
|
||||||
roomCreationTs,
|
roomCreationTs,
|
||||||
predecessorRoomId,
|
predecessorRoomId,
|
||||||
predecessorLastKnownEventId,
|
predecessorLastKnownEventId,
|
||||||
|
|
|
@ -833,7 +833,7 @@ router.get(
|
||||||
if (!allowedToViewRoom) {
|
if (!allowedToViewRoom) {
|
||||||
throw new StatusError(
|
throw new StatusError(
|
||||||
403,
|
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