libkazv
Kazv::RoomModel Struct Reference

#include <room-model.hpp>

Public Types

using Membership = RoomMembership
 
using ReverseEventRelationshipMap = immer::map< std::string, immer::map< std::string, immer::flex_vector< std::string > >>
 
using Action = std::variant< AddStateEventsAction, AppendTimelineAction, PrependTimelineAction, AddToTimelineAction, AddAccountDataAction, ChangeMembershipAction, ChangeInviteStateAction, AddEphemeralAction, SetLocalDraftAction, SetRoomEncryptionAction, MarkMembersFullyLoadedAction, SetHeroIdsAction, AddLocalEchoAction, RemoveLocalEchoAction, AddPendingRoomKeyAction, RemovePendingRoomKeyAction, UpdateJoinedMemberCountAction, UpdateInvitedMemberCountAction >
 

Public Member Functions

immer::flex_vector< std::string > joinedMemberIds () const
 
immer::flex_vector< std::string > invitedMemberIds () const
 
immer::flex_vector< std::string > knockedMemberIds () const
 
immer::flex_vector< std::string > leftMemberIds () const
 
immer::flex_vector< std::string > bannedMemberIds () const
 
EventList joinedMemberEvents () const
 
EventList invitedMemberEvents () const
 
EventList knockedMemberEvents () const
 
EventList leftMemberEvents () const
 
EventList bannedMemberEvents () const
 
MegOlmSessionRotateDesc sessionRotateDesc () const
 
bool hasUser (std::string userId) const
 
std::optional< LocalEchoDescgetLocalEchoByTxnId (std::string txnId) const
 
std::optional< PendingRoomKeyEventgetPendingRoomKeyEventByTxnId (std::string txnId) const
 
immer::map< std::string, double > tags () const
 
Event makeAddTagEvent (std::string tagId, std::optional< double > order) const
 
Event makeRemoveTagEvent (std::string tagId) const
 
void generateRelationships (EventList newEvents)
 Fill in reverseEventRelationships by gathering the relationships specified in newEvents More...
 
void regenerateRelationships ()
 

Static Public Member Functions

static RoomModel update (RoomModel r, Action a)
 

Public Attributes

std::string roomId
 
immer::map< KeyOfState, EventstateEvents
 
immer::map< KeyOfState, EventinviteState
 
immer::flex_vector< std::string > timeline
 
immer::map< std::string, Eventmessages
 
immer::map< std::string, EventaccountData
 
Membership membership {}
 
std::string paginateBackToken
 
bool canPaginateBack {true}
 whether this room has earlier events to be fetched More...
 
immer::map< std::string, std::string > timelineGaps
 
immer::map< std::string, Eventephemeral
 
std::string localDraft
 
bool encrypted {false}
 
bool shouldRotateSessionKey {true}
 a marker to indicate whether we need to rotate the session key earlier than it expires (e.g. More...
 
bool membersFullyLoaded {false}
 
immer::flex_vector< std::string > heroIds
 
immer::flex_vector< LocalEchoDesclocalEchoes
 
immer::flex_vector< PendingRoomKeyEventpendingRoomKeyEvents
 
ReverseEventRelationshipMap reverseEventRelationships
 
std::size_t joinedMemberCount {0}
 
std::size_t invitedMemberCount {0}
 

Member Typedef Documentation

◆ Action

◆ Membership

◆ ReverseEventRelationshipMap

using Kazv::RoomModel::ReverseEventRelationshipMap = immer::map< std::string , immer::map<std::string , immer::flex_vector<std::string > >>

Member Function Documentation

◆ bannedMemberEvents()

EventList Kazv::RoomModel::bannedMemberEvents ( ) const

◆ bannedMemberIds()

immer::flex_vector< std::string > Kazv::RoomModel::bannedMemberIds ( ) const

◆ generateRelationships()

void Kazv::RoomModel::generateRelationships ( EventList  newEvents)

Fill in reverseEventRelationships by gathering the relationships specified in newEvents

Parameters
newEventsThe events that just came in after last time event relationships are gathered.

◆ getLocalEchoByTxnId()

std::optional< LocalEchoDesc > Kazv::RoomModel::getLocalEchoByTxnId ( std::string  txnId) const

◆ getPendingRoomKeyEventByTxnId()

std::optional< PendingRoomKeyEvent > Kazv::RoomModel::getPendingRoomKeyEventByTxnId ( std::string  txnId) const

◆ hasUser()

bool Kazv::RoomModel::hasUser ( std::string  userId) const

◆ invitedMemberEvents()

EventList Kazv::RoomModel::invitedMemberEvents ( ) const

◆ invitedMemberIds()

immer::flex_vector< std::string > Kazv::RoomModel::invitedMemberIds ( ) const

◆ joinedMemberEvents()

EventList Kazv::RoomModel::joinedMemberEvents ( ) const

◆ joinedMemberIds()

immer::flex_vector< std::string > Kazv::RoomModel::joinedMemberIds ( ) const

◆ knockedMemberEvents()

EventList Kazv::RoomModel::knockedMemberEvents ( ) const

◆ knockedMemberIds()

immer::flex_vector< std::string > Kazv::RoomModel::knockedMemberIds ( ) const

◆ leftMemberEvents()

EventList Kazv::RoomModel::leftMemberEvents ( ) const

◆ leftMemberIds()

immer::flex_vector< std::string > Kazv::RoomModel::leftMemberIds ( ) const

◆ makeAddTagEvent()

Event Kazv::RoomModel::makeAddTagEvent ( std::string  tagId,
std::optional< double >  order 
) const

◆ makeRemoveTagEvent()

Event Kazv::RoomModel::makeRemoveTagEvent ( std::string  tagId) const

◆ regenerateRelationships()

void Kazv::RoomModel::regenerateRelationships ( )

◆ sessionRotateDesc()

MegOlmSessionRotateDesc Kazv::RoomModel::sessionRotateDesc ( ) const

◆ tags()

immer::map< std::string, double > Kazv::RoomModel::tags ( ) const

◆ update()

RoomModel Kazv::RoomModel::update ( RoomModel  r,
Action  a 
)
static

Member Data Documentation

◆ accountData

immer::map<std::string, Event> Kazv::RoomModel::accountData

◆ canPaginateBack

bool Kazv::RoomModel::canPaginateBack {true}

whether this room has earlier events to be fetched

◆ encrypted

bool Kazv::RoomModel::encrypted {false}

◆ ephemeral

immer::map<std::string, Event> Kazv::RoomModel::ephemeral

◆ heroIds

immer::flex_vector<std::string> Kazv::RoomModel::heroIds

◆ invitedMemberCount

std::size_t Kazv::RoomModel::invitedMemberCount {0}

◆ inviteState

immer::map<KeyOfState, Event> Kazv::RoomModel::inviteState

◆ joinedMemberCount

std::size_t Kazv::RoomModel::joinedMemberCount {0}

◆ localDraft

std::string Kazv::RoomModel::localDraft

◆ localEchoes

immer::flex_vector<LocalEchoDesc> Kazv::RoomModel::localEchoes

◆ membersFullyLoaded

bool Kazv::RoomModel::membersFullyLoaded {false}

◆ membership

Membership Kazv::RoomModel::membership {}

◆ messages

immer::map<std::string, Event> Kazv::RoomModel::messages

◆ paginateBackToken

std::string Kazv::RoomModel::paginateBackToken

◆ pendingRoomKeyEvents

immer::flex_vector<PendingRoomKeyEvent> Kazv::RoomModel::pendingRoomKeyEvents

◆ reverseEventRelationships

ReverseEventRelationshipMap Kazv::RoomModel::reverseEventRelationships

◆ roomId

std::string Kazv::RoomModel::roomId

◆ shouldRotateSessionKey

bool Kazv::RoomModel::shouldRotateSessionKey {true}

a marker to indicate whether we need to rotate the session key earlier than it expires (e.g.

when a user in the room's device list changed or when someone joins or leaves)

◆ stateEvents

immer::map<KeyOfState, Event> Kazv::RoomModel::stateEvents

◆ timeline

immer::flex_vector<std::string> Kazv::RoomModel::timeline

◆ timelineGaps

immer::map<std::string , std::string > Kazv::RoomModel::timelineGaps

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