Remove mock storage

This commit is contained in:
Henrik Hüttemann 2023-05-26 15:27:38 +02:00
parent a93b2c68e0
commit 0dceec826e
No known key found for this signature in database
GPG Key ID: 9F7BD10E0A8A111E
2 changed files with 4 additions and 41 deletions

View File

@ -4,7 +4,6 @@ import fs from 'node:fs'
import log from './logger'
import readline from 'node:readline'
import { RcUser, createUser } from './users'
import { storage } from './storage'
import { whoami } from './synapse'
import 'reflect-metadata'
import { DataSource } from 'typeorm'
@ -45,7 +44,10 @@ function loadRcExport(entity: Entities): Promise<void> {
// Check for exclusion
if (
rcUser.roles.some((e) => ['app', 'bot'].includes(e)) ||
storage.exclusionsLists.users.includes(rcUser._id)
[
'rocket.cat',
'5kdLWNTys3u2MhB2H', // verdiadmin
].includes(rcUser._id)
) {
log.debug('User excluded. Skipping.')
break

View File

@ -1,39 +0,0 @@
export type storage = {
users: {
rcId: string
matrixId: string
}[]
rooms: {
rcId: string
matrixId: string
members: string[]
}[]
messages: {
rcId: string
matrixId: string
}[]
exclusionsLists: {
users: string[]
rooms: string[]
messages: string[]
}
}
export const storage: storage = {
users: [
{
rcId: '2ziHK8P748TeESitX',
matrixId: '@herhde:locahlost',
},
],
rooms: [],
messages: [],
exclusionsLists: {
users: [
'rocket.cat',
'5kdLWNTys3u2MhB2H', // verdiadmin
],
rooms: [],
messages: [],
},
}