Make most requests use id instead of username
All checks were successful
Server Build / publish (push) Successful in 28s
Voice Build / publish (push) Successful in 25s

This commit is contained in:
olcxja 2026-05-27 19:41:56 +02:00
commit 9183651c4f
3 changed files with 32 additions and 29 deletions

View file

@ -128,6 +128,11 @@ public class Requests
return "error:user.not.found";
}
Universal2String keys = JsonSerializer.Deserialize( //we need to pull keys before we do anything, because if user do NOT have them, dm creation will crash
await Account.Utils.GetUserKeys(id),
AppJsonSerializerContext.Default.Universal2String
);
if (isUserLocal)
{
@ -180,10 +185,7 @@ public class Requests
Encoding.UTF8.GetBytes(serializedBody.string2));
Universal2String keys = JsonSerializer.Deserialize(
await Account.Utils.GetUserKeys(id),
AppJsonSerializerContext.Default.Universal2String
);
await Fs.WriteFile($"{ROOMS_DIR}/dms/{DOMAIN}/{dmId}/keys/0/{id2};{domain}",
Encoding.UTF8.GetBytes($"SETUP:{keys.string2};{serializedBody.string3}")); //jezeli mamy setup to [1] to jest publiczny klucz drugiej osoby,
//a string 3 to zaszyfrowany klucz pokoju ktory musi odszyfrowac za pomoca swoich kluczy i tego publicznego