adminconnection
This commit is contained in:
1 parent
e185d04039
commit
5a19bf62fd
1 file changed
+13
@@ -109,7 +109,18 @@ export default function createRpc(log: Log, pg: Pg, user: User, ws, discogs, off
|
||||
throw new Error(`Invalid parameters for message type ${msgType}: ${JSON.stringify(message)}`);
|
||||
}
|
||||
|
||||
async function anonConnection() {
|
||||
|
||||
}
|
||||
|
||||
async function adminConnection() {
|
||||
// don't need it, requested on route
|
||||
// send(await acpOffers());
|
||||
}
|
||||
|
||||
async function onConnection() {
|
||||
if (!user) return anonConnection();
|
||||
|
||||
const userMsg: UserMessage = [RpcMessageType.User, user];
|
||||
send(userMsg);
|
||||
|
||||
@@ -120,6 +131,8 @@ export default function createRpc(log: Log, pg: Pg, user: User, ws, discogs, off
|
||||
const wants = await pg.userWants(user);
|
||||
const wantsMsg: WantsMessage = [RpcMessageType.Wants, wants];
|
||||
send(wantsMsg);
|
||||
|
||||
if (isAdmin(user)) return adminConnection();
|
||||
}
|
||||
|
||||
function send(msg: RpcMessage) {
|
||||
|
||||
Reference in new issue
Block a user