Conduit does not send count, if it didn't change
This commit is contained in:
parent
8f1fa2ae4e
commit
e035d1407a
@ -939,10 +939,7 @@ ChatPage::currentPresence() const
|
|||||||
void
|
void
|
||||||
ChatPage::ensureOneTimeKeyCount(const std::map<std::string, uint16_t> &counts)
|
ChatPage::ensureOneTimeKeyCount(const std::map<std::string, uint16_t> &counts)
|
||||||
{
|
{
|
||||||
uint16_t count = 0;
|
if (auto count = counts.find(mtx::crypto::SIGNED_CURVE25519); c != counts.end()) {
|
||||||
if (auto c = counts.find(mtx::crypto::SIGNED_CURVE25519); c != counts.end())
|
|
||||||
count = c->second;
|
|
||||||
|
|
||||||
if (count < MAX_ONETIME_KEYS) {
|
if (count < MAX_ONETIME_KEYS) {
|
||||||
const int nkeys = MAX_ONETIME_KEYS - count;
|
const int nkeys = MAX_ONETIME_KEYS - count;
|
||||||
|
|
||||||
@ -954,7 +951,8 @@ ChatPage::ensureOneTimeKeyCount(const std::map<std::string, uint16_t> &counts)
|
|||||||
olm::client()->create_upload_keys_request(),
|
olm::client()->create_upload_keys_request(),
|
||||||
[](const mtx::responses::UploadKeys &, mtx::http::RequestErr err) {
|
[](const mtx::responses::UploadKeys &, mtx::http::RequestErr err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
nhlog::crypto()->warn("failed to update one-time keys: {} {} {}",
|
nhlog::crypto()->warn(
|
||||||
|
"failed to update one-time keys: {} {} {}",
|
||||||
err->matrix_error.error,
|
err->matrix_error.error,
|
||||||
static_cast<int>(err->status_code),
|
static_cast<int>(err->status_code),
|
||||||
static_cast<int>(err->error_code));
|
static_cast<int>(err->error_code));
|
||||||
@ -967,6 +965,7 @@ ChatPage::ensureOneTimeKeyCount(const std::map<std::string, uint16_t> &counts)
|
|||||||
olm::mark_keys_as_published();
|
olm::mark_keys_as_published();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user