Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If public room creation fails, retry without publishing it #6872

Merged
merged 6 commits into from
Oct 12, 2021
2 changes: 1 addition & 1 deletion src/createRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export default async function createRoom(opts: IOpts): Promise<string | null> {
return client.createRoom(createOpts).finally(function() {
if (modal) modal.close();
t3chguy marked this conversation as resolved.
Show resolved Hide resolved
}).catch(function(err) {
if (err.httpStatus === 403 && err.errcode == "M_UNKNOWN") {
if (err.httpStatus === 403 && err.errcode === "M_UNKNOWN" && err.data.error === "Not allowed to publish room") {
AndrewFerr marked this conversation as resolved.
Show resolved Hide resolved
console.warn("Failed to publish room, try again without publishing it");
createOpts.visibility = Visibility.Private;
return client.createRoom(createOpts);
Expand Down