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, MaybeAddStateEventsAction, AddToTimelineAction, AddAccountDataAction, ChangeMembershipAction, ChangeInviteStateAction, AddEphemeralAction, SetLocalDraftAction, SetRoomEncryptionAction, MarkMembersFullyLoadedAction, SetHeroIdsAction, AddLocalEchoAction, RemoveLocalEchoAction, AddPendingRoomKeyAction, RemovePendingRoomKeyAction, UpdateJoinedMemberCountAction, UpdateInvitedMemberCountAction, AddLocalNotificationsAction, RemoveReadLocalNotificationsAction >
 

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
 
EventList heroMemberEvents () 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 ()
 
void addToUndecryptedEvents (EventList newEvents)
 Fill in undecryptedEvents by gathering the session ids specified in newEvents. More...
 
void recalculateUndecryptedEvents ()
 

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}
 
std::string localReadMarker
 The local read marker for this room. More...
 
std::size_t localUnreadCount {0}
 The local unread count for this room. More...
 
std::size_t localNotificationCount {0}
 The local unread notification count for this room. More...
 
immer::map< std::string, ReadReceiptreadReceipts
 Read receipts for all users. More...
 
immer::map< std::string, immer::flex_vector< std::string > > eventReadUsers
 A map from event id to a list of users that has read receipt at that point. More...
 
immer::map< std::string, immer::flex_vector< std::string > > undecryptedEvents
 A map from the session id to a list of event ids of events that cannot (yet) be decrypted. More...
 
immer::flex_vector< std::string > unreadNotificationEventIds
 

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

◆ addToUndecryptedEvents()

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

Fill in undecryptedEvents by gathering the session ids specified in newEvents.

Parameters
newEventsNew incoming events.

◆ 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

◆ heroMemberEvents()

EventList Kazv::RoomModel::heroMemberEvents ( ) 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

◆ recalculateUndecryptedEvents()

void Kazv::RoomModel::recalculateUndecryptedEvents ( )

◆ 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

◆ eventReadUsers

immer::map< std::string , immer::flex_vector<std::string > > Kazv::RoomModel::eventReadUsers

A map from event id to a list of users that has read receipt at that point.

◆ 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

◆ localNotificationCount

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

The local unread notification count for this room.

XXX this is never used.

◆ localReadMarker

std::string Kazv::RoomModel::localReadMarker

The local read marker for this room.

Indicates that you have read up to this event.

◆ localUnreadCount

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

The local unread count for this room.

◆ 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

◆ readReceipts

immer::map<std::string , ReadReceipt> Kazv::RoomModel::readReceipts

Read receipts for all users.

◆ 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

◆ undecryptedEvents

immer::map< std::string , immer::flex_vector<std::string > > Kazv::RoomModel::undecryptedEvents

A map from the session id to a list of event ids of events that cannot (yet) be decrypted.

◆ unreadNotificationEventIds

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

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