i dont even know what this PR is supposed to be about anymore, everyone lost the plot somewhere in the middle of act 2 #74
1 changed files with 3 additions and 6 deletions
OH, I'm SUCH an IDIOT!
This code runs in a loop. And it always starts with the root space. So it always finds a space. And it then never clears it out. Also, it was after the break;, so EVEN IF it somehow reached our room as false, and then was gonna update it to true because it was a space - it now would not have done that because the loop will had been ended. Fixed by moving the code to where it made any sense.
commit
f53190f186
|
|
@ -189,14 +189,11 @@ as.router.post("/api/link", defineEventHandler(async event => {
|
|||
// When finding a room during iteration, see if it was the requested room (to confirm that the room is in the space)
|
||||
if (room.room_id === parsedBody.matrix) {
|
||||
foundRoom = true
|
||||
// And also, now that we know that the room object is our intended room - we can test for its type.
|
||||
if (room.room_type && room.room_type === "m.space") foundSpace = true
|
||||
}
|
||||
|
||||
if (foundRoom && foundVia) break
|
||||
|
||||
if (room.room_type && room.room_type === "m.space") {
|
||||
foundSpace = true
|
||||
}
|
||||
console.log(room.room_type+"@"+room.room_id + " ==> "+ foundSpace)
|
||||
}
|
||||
if (!foundRoom) throw createError({status: 400, message: "Bad Request", data: "Matrix room needs to be part of the bridged space"})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue