Make most requests use id instead of username
This commit is contained in:
parent
69ccfd3421
commit
9183651c4f
3 changed files with 32 additions and 29 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue