Add test dm accepting, revoking and declining
All checks were successful
Android Build / publish (push) Successful in 49s
Linux Build / publish (push) Successful in 53s

This commit is contained in:
olcxja 2026-05-27 08:53:24 +02:00
commit 2979881908
3 changed files with 41 additions and 16 deletions

View file

@ -94,7 +94,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 +136,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);