Don't send empty SecretRequest cancellation if there are only 2 devices
This commit is contained in:
parent
2769642d3c
commit
1bd2970c4d
1 changed files with 13 additions and 11 deletions
|
|
@ -398,17 +398,19 @@ handle_olm_message(const OlmMessage &msg, const UserKeyCache &otherUserDeviceKey
|
||||||
body[local_user][dev] = secretRequest;
|
body[local_user][dev] = secretRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
http::client()->send_to_device<mtx::events::msg::SecretRequest>(
|
if (!body.empty()) {
|
||||||
http::client()->generate_txn_id(),
|
http::client()->send_to_device<mtx::events::msg::SecretRequest>(
|
||||||
body,
|
http::client()->generate_txn_id(),
|
||||||
[secret_name](mtx::http::RequestErr err) {
|
body,
|
||||||
if (err) {
|
[secret_name](mtx::http::RequestErr err) {
|
||||||
nhlog::net()->error("Failed to send request cancellation "
|
if (err) {
|
||||||
"for secrect "
|
nhlog::net()->error("Failed to send request cancellation "
|
||||||
"'{}'",
|
"for secrect "
|
||||||
secret_name);
|
"'{}'",
|
||||||
}
|
secret_name);
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
nhlog::crypto()->info("Storing secret {}", secret_name);
|
nhlog::crypto()->info("Storing secret {}", secret_name);
|
||||||
cache::client()->storeSecret(secret_name, e->content.secret);
|
cache::client()->storeSecret(secret_name, e->content.secret);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue