Skip empty requests for cross-signing keys when user only has one device.

Cause: Request button pressed in user settings.

Result: Request body is jsNull; sendToDevice requires jsObject.
This commit is contained in:
Jason Volk 2023-01-21 20:06:57 -08:00 committed by Nicolas Werner
parent 7f9af9016d
commit 0253aa59c7
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -1613,6 +1613,9 @@ request_cross_signing_keys()
body[local_user][dev] = secretRequest;
}
if (body.empty())
return;
http::client()->send_to_device<mtx::events::msg::SecretRequest>(
http::client()->generate_txn_id(),
body,