This commit is contained in:
2026-08-19 03:01:56 +02:00
parent ad1cd151dc
commit 0da38dee53
5 changed files with 90 additions and 36 deletions
+2
View File
@@ -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,
+6
View File
@@ -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[] };
+2
View File
@@ -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;