13 #include <immer/flex_vector.hpp>
14 #include <immer/map.hpp>
34 immer::map<std::string, immer::map<std::string, Event>>
messages;
45 template<
class Archive>
51 bool operator==(
const ReadReceipt &a,
const ReadReceipt &b);
52 bool operator!=(
const ReadReceipt &a,
const ReadReceipt &b);
188 template<
class Archive>
195 immer::map<std::string, immer::flex_vector<std::string>> devices;
196 ar & txnId &
event & devices;
198 std::move(txnId), std::move(event), std::move(devices));
221 immer::map<std::string , immer::flex_vector<std::string >>>;
300 bool hasUser(std::string userId)
const;
305 immer::map<std::string, double>
tags()
const;
399 immer::map<std::string, RoomModel>
rooms;
401 inline auto at(std::string
id)
const {
return rooms.at(
id); }
403 inline bool has(std::string
id)
const {
return rooms.find(
id); }
418 template<
class Archive>
458 if constexpr (
typename Archive::is_loading()) {
476 if constexpr (
typename Archive::is_loading()) {
485 template<
class Archive>
493 BOOST_CLASS_VERSION(
Kazv::ReadReceipt, 0)
494 BOOST_CLASS_VERSION(
Kazv::RoomModel, 8)
495 BOOST_CLASS_VERSION(
Kazv::RoomListModel, 0)
Definition: push-rules-desc.hpp:38
Definition: location.hpp:10
bool operator!=(BaseJob a, BaseJob b)
Definition: basejob.cpp:292
RoomModel::Action RoomAction
Definition: room-model.hpp:357
const double ROOM_TAG_DEFAULT_ORDER
Definition: room-model.hpp:186
std::int_fast64_t Timestamp
Definition: event.hpp:18
PendingRoomKeyEvent makePendingRoomKeyEventV0(std::string txnId, Event event, immer::map< std::string, immer::flex_vector< std::string >> devices)
Definition: room-model.cpp:40
auto sortKeyForTimelineEvent(Event e) -> std::tuple< Timestamp, std::string >
Get the sort key for a timeline event.
Definition: room-model.cpp:76
bool operator==(BaseJob a, BaseJob b)
Definition: basejob.cpp:280
RoomMembership
Definition: types.hpp:128
immer::flex_vector< Event > EventList
Definition: types.hpp:107
void serialize(Archive &ar, ClientModel &m, std::uint32_t const version)
Definition: client-model.hpp:582
RoomListModel::Action RoomListAction
Definition: room-model.hpp:411
Definition: room-model.hpp:86
immer::flex_vector< Event > events
Definition: room-model.hpp:87
Definition: room-model.hpp:101
EventList events
Definition: room-model.hpp:102
Definition: room-model.hpp:124
LocalEchoDesc localEcho
Definition: room-model.hpp:125
Update local notifications to include the new events.
Definition: room-model.hpp:157
std::string myUserId
Definition: room-model.hpp:160
EventList newEvents
Definition: room-model.hpp:158
PushRulesDesc pushRulesDesc
Definition: room-model.hpp:159
Definition: room-model.hpp:134
PendingRoomKeyEvent pendingRoomKeyEvent
Definition: room-model.hpp:135
Definition: room-model.hpp:64
immer::flex_vector< Event > stateEvents
Definition: room-model.hpp:65
Definition: room-model.hpp:77
std::optional< std::string > prevBatch
Definition: room-model.hpp:80
std::optional< std::string > gapEventId
Definition: room-model.hpp:82
std::optional< bool > limited
Definition: room-model.hpp:81
immer::flex_vector< Event > events
Events from oldest to latest.
Definition: room-model.hpp:79
Definition: room-model.hpp:96
immer::flex_vector< Event > events
Definition: room-model.hpp:97
Definition: room-model.hpp:91
RoomMembership membership
Definition: room-model.hpp:92
Definition: room-model.hpp:55
std::string userId
Definition: room-model.hpp:56
Timestamp timestamp
Definition: room-model.hpp:57
Describes a local echo.
Definition: local-echo.hpp:19
Definition: room-model.hpp:115
Go from the back of stateEvents to the beginning, adding the event to room state only if the room has...
Definition: room-model.hpp:72
immer::flex_vector< Event > stateEvents
Definition: room-model.hpp:73
Definition: crypto.hpp:27
Definition: room-model.hpp:32
immer::map< std::string, immer::map< std::string, Event > > messages
Definition: room-model.hpp:34
std::string txnId
Definition: room-model.hpp:33
Definition: room-model.hpp:40
Timestamp timestamp
Definition: room-model.hpp:42
std::string eventId
Definition: room-model.hpp:41
Definition: room-model.hpp:129
std::string txnId
Definition: room-model.hpp:130
Definition: room-model.hpp:139
std::string txnId
Definition: room-model.hpp:140
Remove local notifications that are already read.
Definition: room-model.hpp:165
std::string myUserId
Definition: room-model.hpp:166
Definition: room-model.hpp:398
std::variant< UpdateRoomAction > Action
Definition: room-model.hpp:407
auto at(std::string id) const
Definition: room-model.hpp:401
static RoomListModel update(RoomListModel l, Action a)
Definition: room-model.cpp:415
bool has(std::string id) const
Definition: room-model.hpp:403
immer::map< std::string, RoomModel > rooms
Definition: room-model.hpp:399
auto operator[](std::string id) const
Definition: room-model.hpp:402
Definition: room-model.hpp:217
immer::flex_vector< std::string > unreadNotificationEventIds
Definition: room-model.hpp:283
immer::map< KeyOfState, Event > stateEvents
Definition: room-model.hpp:224
EventList invitedMemberEvents() const
Definition: room-model.cpp:503
EventList knockedMemberEvents() const
Definition: room-model.cpp:508
Event makeRemoveTagEvent(std::string tagId) const
Definition: room-model.cpp:643
bool canPaginateBack
whether this room has earlier events to be fetched
Definition: room-model.hpp:234
immer::map< std::string, std::string > timelineGaps
Definition: room-model.hpp:236
immer::map< std::string, Event > ephemeral
Definition: room-model.hpp:238
bool encrypted
Definition: room-model.hpp:242
immer::map< std::string, double > tags() const
Definition: room-model.cpp:602
immer::flex_vector< std::string > timeline
Definition: room-model.hpp:228
std::string paginateBackToken
Definition: room-model.hpp:232
immer::map< std::string, immer::map< std::string, immer::flex_vector< std::string > >> ReverseEventRelationshipMap
Definition: room-model.hpp:221
Event makeAddTagEvent(std::string tagId, std::optional< double > order) const
Definition: room-model.cpp:631
MegOlmSessionRotateDesc sessionRotateDesc() const
Definition: room-model.cpp:543
EventList heroMemberEvents() const
Definition: room-model.cpp:523
void regenerateRelationships()
Definition: room-model.cpp:662
EventList bannedMemberEvents() const
Definition: room-model.cpp:518
immer::map< std::string, Event > messages
Definition: room-model.hpp:229
void generateRelationships(EventList newEvents)
Fill in reverseEventRelationships by gathering the relationships specified in newEvents
Definition: room-model.cpp:650
std::size_t localNotificationCount
The local unread notification count for this room.
Definition: room-model.hpp:268
std::size_t joinedMemberCount
Definition: room-model.hpp:258
void addToUndecryptedEvents(EventList newEvents)
Fill in undecryptedEvents by gathering the session ids specified in newEvents.
Definition: room-model.cpp:669
std::size_t localUnreadCount
The local unread count for this room.
Definition: room-model.hpp:265
std::string localDraft
Definition: room-model.hpp:240
immer::flex_vector< std::string > knockedMemberIds() const
Definition: room-model.cpp:483
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.
Definition: room-model.hpp:275
EventList leftMemberEvents() const
Definition: room-model.cpp:513
immer::flex_vector< std::string > heroIds
Definition: room-model.hpp:250
std::optional< PendingRoomKeyEvent > getPendingRoomKeyEventByTxnId(std::string txnId) const
Definition: room-model.cpp:581
std::variant< AddStateEventsAction, MaybeAddStateEventsAction, AddToTimelineAction, AddAccountDataAction, ChangeMembershipAction, ChangeInviteStateAction, AddEphemeralAction, SetLocalDraftAction, SetRoomEncryptionAction, MarkMembersFullyLoadedAction, SetHeroIdsAction, AddLocalEchoAction, RemoveLocalEchoAction, AddPendingRoomKeyAction, RemovePendingRoomKeyAction, UpdateJoinedMemberCountAction, UpdateInvitedMemberCountAction, AddLocalNotificationsAction, RemoveReadLocalNotificationsAction, UpdateLocalReadMarkerAction > Action
Definition: room-model.hpp:352
immer::flex_vector< LocalEchoDesc > localEchoes
Definition: room-model.hpp:252
std::optional< LocalEchoDesc > getLocalEchoByTxnId(std::string txnId) const
Definition: room-model.cpp:569
std::string roomId
Definition: room-model.hpp:223
EventList joinedMemberEvents() const
Definition: room-model.cpp:498
bool membersFullyLoaded
Definition: room-model.hpp:249
std::size_t invitedMemberCount
Definition: room-model.hpp:259
immer::flex_vector< std::string > invitedMemberIds() const
Definition: room-model.cpp:478
ReverseEventRelationshipMap reverseEventRelationships
Definition: room-model.hpp:256
bool hasUser(std::string userId) const
Definition: room-model.cpp:556
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.
Definition: room-model.hpp:281
immer::flex_vector< std::string > bannedMemberIds() const
Definition: room-model.cpp:493
immer::flex_vector< PendingRoomKeyEvent > pendingRoomKeyEvents
Definition: room-model.hpp:254
immer::map< std::string, Event > accountData
Definition: room-model.hpp:230
void recalculateUndecryptedEvents()
Definition: room-model.cpp:693
immer::map< std::string, ReadReceipt > readReceipts
Read receipts for all users.
Definition: room-model.hpp:270
bool shouldRotateSessionKey
a marker to indicate whether we need to rotate the session key earlier than it expires (e....
Definition: room-model.hpp:247
immer::flex_vector< std::string > joinedMemberIds() const
Definition: room-model.cpp:473
Membership membership
Definition: room-model.hpp:231
std::string localReadMarker
The local read marker for this room.
Definition: room-model.hpp:263
immer::map< KeyOfState, Event > inviteState
Definition: room-model.hpp:225
immer::flex_vector< std::string > leftMemberIds() const
Definition: room-model.cpp:488
static RoomModel update(RoomModel r, Action a)
Definition: room-model.cpp:81
Definition: room-model.hpp:119
immer::flex_vector< std::string > heroIds
Definition: room-model.hpp:120
Definition: room-model.hpp:106
std::string localDraft
Definition: room-model.hpp:107
Definition: room-model.hpp:111
Definition: room-model.hpp:149
std::size_t invitedMemberCount
Definition: room-model.hpp:150
Definition: room-model.hpp:144
std::size_t joinedMemberCount
Definition: room-model.hpp:145
Update the local read marker, removing any read notifications before it.
Definition: room-model.hpp:171
std::string myUserId
Definition: room-model.hpp:173
std::string localReadMarker
Definition: room-model.hpp:172
Definition: room-model.hpp:392
RoomAction roomAction
Definition: room-model.hpp:394
std::string roomId
Definition: room-model.hpp:393