11 #include <immer/map.hpp>
12 #include <immer/flex_vector.hpp>
14 #include <boost/serialization/string.hpp>
43 bool operator==(DeviceKeyInfo a, DeviceKeyInfo b);
44 bool operator!=(DeviceKeyInfo a, DeviceKeyInfo b);
46 template<
class Archive>
64 template<
class RangeT>
66 for (
auto userId : std::forward<RangeT>(userIds)) {
72 template<
class RangeT>
74 for (
auto userId : std::forward<RangeT>(userIds)) {
87 std::optional<DeviceKeyInfo>
get(std::string userId, std::string deviceId)
const;
89 std::optional<DeviceKeyInfo>
findByEd25519Key(std::string userId, std::string ed25519Key)
const;
90 std::optional<DeviceKeyInfo>
findByCurve25519Key(std::string userId, std::string curve25519Key)
const;
96 template<
class Archive>
107 BOOST_CLASS_VERSION(
Kazv::DeviceListTracker, 0)
Definition: crypto.hpp:36
A RangeT is an ordered collection that can be iterated through.
Definition: range-t.hpp:21
Definition: location.hpp:10
bool operator!=(BaseJob a, BaseJob b)
Definition: basejob.cpp:292
DeviceTrustLevel
Definition: device-list-tracker.hpp:27
@ Unseen
Definition: device-list-tracker.hpp:29
@ Seen
Definition: device-list-tracker.hpp:30
@ Verified
Definition: device-list-tracker.hpp:31
@ Blocked
Definition: device-list-tracker.hpp:28
bool operator==(BaseJob a, BaseJob b)
Definition: basejob.cpp:280
void serialize(Archive &ar, ClientModel &m, std::uint32_t const version)
Definition: client-model.hpp:582
Definition: device-list-tracker.hpp:35
DeviceTrustLevel trustLevel
Definition: device-list-tracker.hpp:40
std::string curve25519Key
Definition: device-list-tracker.hpp:38
std::string deviceId
Definition: device-list-tracker.hpp:36
std::optional< std::string > displayName
Definition: device-list-tracker.hpp:39
std::string ed25519Key
Definition: device-list-tracker.hpp:37
Definition: device-list-tracker.hpp:59
void track(RangeT &&userIds)
Definition: device-list-tracker.hpp:65
bool addDevice(std::string userId, std::string deviceId, Api::QueryKeysJob::DeviceInformation deviceInfo, Crypto &crypto)
Definition: device-list-tracker.cpp:40
immer::map< std::string, DeviceMapT > deviceLists
Definition: device-list-tracker.hpp:62
immer::map< std::string, DeviceKeyInfo > DeviceMapT
Definition: device-list-tracker.hpp:60
immer::flex_vector< std::string > diff(DeviceListTracker that) const
returns a list of users whose device list has changed
Definition: device-list-tracker.cpp:153
DeviceMapT devicesFor(std::string userId) const
Definition: device-list-tracker.cpp:178
void untrack(RangeT &&userIds)
Definition: device-list-tracker.hpp:73
immer::map< std::string, bool > usersToTrackDeviceLists
Definition: device-list-tracker.hpp:61
void markUpToDate(std::string userId)
Definition: device-list-tracker.cpp:77
std::optional< DeviceKeyInfo > findByCurve25519Key(std::string userId, std::string curve25519Key) const
Definition: device-list-tracker.cpp:108
immer::flex_vector< std::string > outdatedUsers() const
Definition: device-list-tracker.cpp:24
std::optional< DeviceKeyInfo > get(std::string userId, std::string deviceId) const
Definition: device-list-tracker.cpp:82
std::optional< DeviceKeyInfo > findByEd25519Key(std::string userId, std::string ed25519Key) const
Definition: device-list-tracker.cpp:91