move namespace_prefix into a sub-object
This commit is contained in:
parent
f4bfe54850
commit
3a59d66626
3 changed files with 5 additions and 3 deletions
|
@ -20,7 +20,7 @@ const userToMxid = sync.require("../converters/user-to-mxid")
|
||||||
async function createSim(user) {
|
async function createSim(user) {
|
||||||
// Choose sim name
|
// Choose sim name
|
||||||
const simName = userToMxid.userToSimName(user)
|
const simName = userToMxid.userToSimName(user)
|
||||||
const localpart = reg.namespace_prefix + simName
|
const localpart = reg.ooye.namespace_prefix + simName
|
||||||
const mxid = "@" + localpart + ":cadence.moe"
|
const mxid = "@" + localpart + ":cadence.moe"
|
||||||
|
|
||||||
// Save chosen name in the database forever
|
// Save chosen name in the database forever
|
||||||
|
|
|
@ -2,7 +2,7 @@ const {test} = require("supertape")
|
||||||
const reg = require("./read-registration")
|
const reg = require("./read-registration")
|
||||||
|
|
||||||
test("reg: has necessary parameters", t => {
|
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(
|
t.deepEqual(
|
||||||
propertiesToCheck.filter(p => p in reg),
|
propertiesToCheck.filter(p => p in reg),
|
||||||
propertiesToCheck
|
propertiesToCheck
|
||||||
|
|
4
types.d.ts
vendored
4
types.d.ts
vendored
|
@ -4,7 +4,6 @@ export type AppServiceRegistrationConfig = {
|
||||||
hs_token: string
|
hs_token: string
|
||||||
url: string
|
url: string
|
||||||
sender_localpart: string
|
sender_localpart: string
|
||||||
namespace_prefix: string
|
|
||||||
namespaces: {
|
namespaces: {
|
||||||
users: {
|
users: {
|
||||||
exclusive: boolean
|
exclusive: boolean
|
||||||
|
@ -17,6 +16,9 @@ export type AppServiceRegistrationConfig = {
|
||||||
}
|
}
|
||||||
protocols: [string]
|
protocols: [string]
|
||||||
rate_limited: boolean
|
rate_limited: boolean
|
||||||
|
ooye: {
|
||||||
|
namespace_prefix: string
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type WebhookCreds = {
|
export type WebhookCreds = {
|
||||||
|
|
Loading…
Reference in a new issue