forked from olcxjas-softworks/LarpixClient
Switch to X25519 + ML-KEM-768 encryption
This commit is contained in:
parent
9e6d128839
commit
a660ba32bd
9 changed files with 180 additions and 76 deletions
|
|
@ -6,6 +6,7 @@
|
|||
<title>Miarven</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<link rel="icon" type="image/svg+xml" href="favicon.svg">
|
||||
<script src="crypto-pq.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<loading>
|
||||
|
|
@ -94,7 +95,9 @@
|
|||
{
|
||||
await updateProtocolAndUrl(window.location.hostname);
|
||||
}
|
||||
sidebarPfp.src = await getAvatarUrl(`${username}:${host}`);
|
||||
let localIdRes = await fetchAsync(`${url}/nametoid?u=${username}`);
|
||||
let localId = localIdRes.trim();
|
||||
sidebarPfp.src = await getAvatarUrl(localId, `${username}:${host}`);
|
||||
|
||||
showAction("action.auth", "startauth");
|
||||
let res = await Auth(username, password);
|
||||
|
|
@ -134,7 +137,15 @@
|
|||
async function addDm() {
|
||||
try {
|
||||
showAction("action.dm.adding", "dmadd");
|
||||
let res = await fetchEncrypted("user/dm/invite", document.getElementById("addchat-username").value);
|
||||
let username = document.getElementById("addchat-username").value;
|
||||
let idRes = await fetchAsync(`${url}/nametoid?u=${username}`);
|
||||
if (idRes.startsWith("error") || idRes.trim() === "0" || idRes.trim() === "") {
|
||||
clearAction("dmadd");
|
||||
showBlahNotification("error:user.not.found");
|
||||
return;
|
||||
}
|
||||
let targetId = idRes.trim();
|
||||
let res = await fetchEncrypted("user/dm/invite", targetId);
|
||||
|
||||
clearAction("dmadd");
|
||||
showBlahNotification(res);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue