diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-10-31 16:38:15 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-10-31 18:47:58 +0100 |
commit | 7824c772346e13f26eb878ce6a945fbb707e2247 (patch) | |
tree | 373ac7850c6eb87c1b4da7a62ec24330277d18f0 /src/ChatPage.cpp | |
parent | 488a93575a152b9a538b0037bb1152c88cd8bbb6 (diff) |
Cleanup headers a bit more
Diffstat (limited to 'src/ChatPage.cpp')
-rw-r--r-- | src/ChatPage.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp index 03144faf..b756f486 100644 --- a/src/ChatPage.cpp +++ b/src/ChatPage.cpp @@ -778,7 +778,9 @@ ChatPage::handleSyncResponse(const mtx::responses::Sync &res, const std::string nhlog::net()->debug("sync completed: {}", res.next_batch); // Ensure that we have enough one-time keys available. - ensureOneTimeKeyCount(res.device_one_time_keys_count, res.device_unused_fallback_key_types); + std::map<std::string_view, std::uint16_t> counts{res.device_one_time_keys_count.begin(), + res.device_one_time_keys_count.end()}; + ensureOneTimeKeyCount(counts, res.device_unused_fallback_key_types); std::optional<mtx::events::account_data::IgnoredUsers> oldIgnoredUsers; if (auto ignoreEv = std::ranges::find_if( @@ -1194,7 +1196,7 @@ ChatPage::verifyOneTimeKeyCountAfterStartup() return; } - std::map<std::string, uint16_t> key_counts; + std::map<std::string_view, uint16_t> key_counts; std::uint64_t count = 0; if (auto c = res.one_time_key_counts.find(mtx::crypto::SIGNED_CURVE25519); c == res.one_time_key_counts.end()) { @@ -1215,7 +1217,7 @@ ChatPage::verifyOneTimeKeyCountAfterStartup() } void -ChatPage::ensureOneTimeKeyCount(const std::map<std::string, uint16_t> &counts, +ChatPage::ensureOneTimeKeyCount(const std::map<std::string_view, uint16_t> &counts, const std::optional<std::vector<std::string>> &unused_fallback_keys) { if (auto count = counts.find(mtx::crypto::SIGNED_CURVE25519); count != counts.end()) { |