Sidebar
This commit is contained in:
@@ -73,6 +73,8 @@ export default class Enclave {
|
||||
getHTTPUrl(hostname, isSecure, "/meta"),
|
||||
);
|
||||
|
||||
this.server.meta = metaResponse.data as any;
|
||||
|
||||
this.serverList[hostname] = {
|
||||
meta: metaResponse.data as any,
|
||||
isSecure,
|
||||
|
||||
@@ -3,6 +3,7 @@ export interface ClientMeta {}
|
||||
export interface ServerMeta {
|
||||
name: string;
|
||||
description: string;
|
||||
channels: Channel[];
|
||||
}
|
||||
|
||||
export type ClientMethod =
|
||||
@@ -33,3 +34,8 @@ export type ServerMethod =
|
||||
method: "Error";
|
||||
error: string;
|
||||
};
|
||||
|
||||
export type Channel = { id: string; name: string } & ChannelKind;
|
||||
|
||||
export type ChannelKind =
|
||||
{ kind: "text" } | { kind: "category"; channels: Channel[] };
|
||||
|
||||
@@ -3,6 +3,7 @@ import * as ed from "@noble/ed25519";
|
||||
import EnclaveWebSocket from "./ws";
|
||||
import { sha512 } from "@noble/hashes/sha2.js";
|
||||
import { getWSUrl } from "@/lib/serverList";
|
||||
import { ServerMeta } from "./protocol";
|
||||
|
||||
ed.hashes.sha512 = sha512;
|
||||
|
||||
@@ -27,6 +28,7 @@ export default class EnclaveServer {
|
||||
public hostname: string;
|
||||
public isSecure: boolean;
|
||||
public websocket?: EnclaveWebSocket;
|
||||
public meta?: ServerMeta;
|
||||
|
||||
public constructor(hostname: string, isSecure: boolean) {
|
||||
this.hostname = hostname;
|
||||
|
||||
Reference in New Issue
Block a user