libkazv
Loading...
Searching...
No Matches
Kazv::DeviceListTracker Struct Reference

#include <device-list-tracker.hpp>

Public Types

enum  FindByOlmEventStatus { NotFound , InTracker , InEvent }
 
using DeviceMapT = immer::map< std::string, DeviceKeyInfo >
 

Public Member Functions

template<class RangeT >
void track (RangeT &&userIds)
 
template<class RangeT >
void untrack (RangeT &&userIds)
 
immer::flex_vector< std::string > outdatedUsers () const
 
std::optional< DeviceKeyInfoverifyDeviceInfo (std::string userId, std::string deviceId, Api::QueryKeysJob::DeviceInformation deviceInfo) const
 
bool addDevice (std::string userId, std::string deviceId, Api::QueryKeysJob::DeviceInformation deviceInfo)
 
void addVerifiedDeviceKeyInfo (std::string userId, std::string deviceId, DeviceKeyInfo info)
 
void markUpToDate (std::string userId)
 
DeviceMapT devicesFor (std::string userId) const
 
std::optional< DeviceKeyInfoget (std::string userId, std::string deviceId) const
 
std::optional< DeviceKeyInfofindByEd25519Key (std::string userId, std::string ed25519Key) const
 
std::optional< DeviceKeyInfofindByCurve25519Key (std::string userId, std::string curve25519Key) const
 
std::pair< FindByOlmEventStatus, DeviceKeyInfofindByOlmEvent (Event e) const
 
immer::flex_vector< std::string > diff (DeviceListTracker that) const
 returns a list of users whose device list has changed
 

Public Attributes

immer::map< std::string, bool > usersToTrackDeviceLists
 
immer::map< std::string, DeviceMapTdeviceLists
 

Member Typedef Documentation

◆ DeviceMapT

using Kazv::DeviceListTracker::DeviceMapT = immer::map<std::string , DeviceKeyInfo>

Member Enumeration Documentation

◆ FindByOlmEventStatus

Enumerator
NotFound 

The sending device info cannot be found.

InTracker 

The sending device info is already in tracker.

InEvent 

The sending device info is not in tracker, but it is in the event and ready to be added to the tracker.

Member Function Documentation

◆ addDevice()

bool Kazv::DeviceListTracker::addDevice ( std::string  userId,
std::string  deviceId,
Api::QueryKeysJob::DeviceInformation  deviceInfo 
)

◆ addVerifiedDeviceKeyInfo()

void Kazv::DeviceListTracker::addVerifiedDeviceKeyInfo ( std::string  userId,
std::string  deviceId,
DeviceKeyInfo  info 
)

◆ devicesFor()

auto Kazv::DeviceListTracker::devicesFor ( std::string  userId) const

◆ diff()

immer::flex_vector< std::string > Kazv::DeviceListTracker::diff ( DeviceListTracker  that) const

returns a list of users whose device list has changed

◆ findByCurve25519Key()

std::optional< DeviceKeyInfo > Kazv::DeviceListTracker::findByCurve25519Key ( std::string  userId,
std::string  curve25519Key 
) const

◆ findByEd25519Key()

std::optional< DeviceKeyInfo > Kazv::DeviceListTracker::findByEd25519Key ( std::string  userId,
std::string  ed25519Key 
) const

◆ findByOlmEvent()

auto Kazv::DeviceListTracker::findByOlmEvent ( Event  e) const

◆ get()

std::optional< DeviceKeyInfo > Kazv::DeviceListTracker::get ( std::string  userId,
std::string  deviceId 
) const

◆ markUpToDate()

void Kazv::DeviceListTracker::markUpToDate ( std::string  userId)

◆ outdatedUsers()

immer::flex_vector< std::string > Kazv::DeviceListTracker::outdatedUsers ( ) const

◆ track()

template<class RangeT >
void Kazv::DeviceListTracker::track ( RangeT &&  userIds)
inline

◆ untrack()

template<class RangeT >
void Kazv::DeviceListTracker::untrack ( RangeT &&  userIds)
inline

◆ verifyDeviceInfo()

std::optional< DeviceKeyInfo > Kazv::DeviceListTracker::verifyDeviceInfo ( std::string  userId,
std::string  deviceId,
Api::QueryKeysJob::DeviceInformation  deviceInfo 
) const

Member Data Documentation

◆ deviceLists

immer::map<std::string , DeviceMapT> Kazv::DeviceListTracker::deviceLists

◆ usersToTrackDeviceLists

immer::map<std::string , bool > Kazv::DeviceListTracker::usersToTrackDeviceLists

The documentation for this struct was generated from the following files: