From 3a59d66626fac9f0a5b70f72a478ee8f0f3f77f0 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Thu, 13 Jul 2023 17:11:24 +1200 Subject: [PATCH] move namespace_prefix into a sub-object --- d2m/actions/register-user.js | 2 +- matrix/read-registration.test.js | 2 +- types.d.ts | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/d2m/actions/register-user.js b/d2m/actions/register-user.js index 1d1eb3d..ef6045a 100644 --- a/d2m/actions/register-user.js +++ b/d2m/actions/register-user.js @@ -20,7 +20,7 @@ const userToMxid = sync.require("../converters/user-to-mxid") async function createSim(user) { // Choose sim name const simName = userToMxid.userToSimName(user) - const localpart = reg.namespace_prefix + simName + const localpart = reg.ooye.namespace_prefix + simName const mxid = "@" + localpart + ":cadence.moe" // Save chosen name in the database forever diff --git a/matrix/read-registration.test.js b/matrix/read-registration.test.js index c5b3ac8..d402cfb 100644 --- a/matrix/read-registration.test.js +++ b/matrix/read-registration.test.js @@ -2,7 +2,7 @@ const {test} = require("supertape") const reg = require("./read-registration") test("reg: has necessary parameters", t => { - const propertiesToCheck = ["sender_localpart", "id", "as_token", "namespace_prefix"] + const propertiesToCheck = ["sender_localpart", "id", "as_token", "ooye"] t.deepEqual( propertiesToCheck.filter(p => p in reg), propertiesToCheck diff --git a/types.d.ts b/types.d.ts index 3ed3975..32aa21f 100644 --- a/types.d.ts +++ b/types.d.ts @@ -4,7 +4,6 @@ export type AppServiceRegistrationConfig = { hs_token: string url: string sender_localpart: string - namespace_prefix: string namespaces: { users: { exclusive: boolean @@ -17,6 +16,9 @@ export type AppServiceRegistrationConfig = { } protocols: [string] rate_limited: boolean + ooye: { + namespace_prefix: string + } } export type WebhookCreds = {