!vxTmkuJzhGPsMdkAOc:transformierende-gesellschaft.org

NixOS Matrix Subsystem

134 Members
Coordination and discussion about the matrix subsystem in NixOS - https://nixos.wiki/wiki/Matrix66 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
26 Sep 2022
@hexa:lossy.networkhexa
--- a/src/datastore/postgres/PgDataStore.ts
+++ b/src/datastore/postgres/PgDataStore.ts
@@ -661,8 +661,9 @@ export class PgDataStore implements DataStore {
 
     public async getRoomsVisibility(roomIds: string[]) {
         const map: {[roomId: string]: "public"|"private"} = {};
-        const list = `('${roomIds.join("','")}')`;
-        const res = await this.pgPool.query(`SELECT room_id, visibility FROM room_visibility WHERE room_id IN ${list}`);
+        const res = await this.pgPool.query("SELECT room_id, visibility FROM room_visibility WHERE room_id IN $1", [
+            roomIds,
+        ]);
         for (const row of res.rows) {
             map[row.room_id] = row.visibility ? "public" : "private";
         }
11:28:53
@piegames:matrix.org@piegames:matrix.orgGood thing that I still haven't updated my bridge from last time, so now I only need to update once 🙈11:28:57
@hexa:lossy.networkhexaonly with postgres, prevents injection apparently11:29:01
@hexa:lossy.networkhexaaren't you on heisenbridge anyhow?11:29:14
@piegames:matrix.org@piegames:matrix.orgI have both, for legacy reasons11:29:38

Show newer messages


Back to Room ListRoom Version: 4