aboutsummaryrefslogtreecommitdiff
path: root/lib/room.h
AgeCommit message (Collapse)Author
2018-11-20Make SyncData more self-contained and prepare for cache splittingKitsune Ral
SyncData now resides in its own pair of files and is capable to load either from file or from JSON. There is also (yet untested) capability to load rooms from files if a file name stands is the value for a given room id. This allows to store the master cache file separately from cache files for each room, massively easing the problem of bulky accounts that can overflow the poor capacity of Qt's JSON engine.
2018-11-19Room: expose eventsHistoryJob as a Q_PROPERTYKitsune Ral
2018-11-14Room: historyEdge(), syncEdge, Private::timelineBase()Kitsune Ral
Also: make moveEventsToTimeline() always put historical events from position -1 rather than 0 so that Private::baseState could always correspond to the before-0 position.
2018-11-14Improvements in commentsKitsune Ral
- registerEventType(): comment the cryptic _ variable - Room::postEvent: document the return value - Room::Private: upgrade comments to doc-comments - even though in Private, they still are helpful to show hints in IDEs. - General cleanup
2018-10-12Room::addTag: use float instead of Omittable<float>Kitsune Ral
No-order is already modelled with the other overload, and Omittable<> breaks interfacing with QML.
2018-10-04Modernise and fix code dealing with call eventsKitsune Ral
Call events no more store deserialised values; instead they deserialise values on the fly, same as all other events. They are no more treated as state events (The Spec doesn't define them as state events in the first place). A common base class, CallEventBase, is introduced that defines data pieces common to all call events (call id and version).
2018-09-25Room::addTag: fix the QML-friendly overload's parameterKitsune Ral
TagRecord::order_type is float now, not QString.
2018-09-17return false in processStateEvent; make processCall privateJosip Delic
2018-09-16Merge remote-tracking branch 'upstream/master'Josip Delic
2018-09-16Introduce Room::displaynameAboutToChange()Kitsune Ral
2018-09-16Use the right header file for QImageKitsune Ral
2018-09-12Merge pull request #1 from QMatrixClient/masterBlack Hat
Merge to latest commit.
2018-09-09Room::beforeDestruction()Kitsune Ral
This is to allow connecting to before-destruction of one specific room, rather than any room under a connection (for which Connection::aboutToDeleteRoom() still exists).
2018-09-09room.h: Unify doc-commentsKitsune Ral
Doxygen/Qt style is preferred from now on.
2018-09-09CleanupKitsune Ral
2018-09-02Switch tag order from strings to floats, as The Spec preachesKitsune Ral
The Spec wasn't entirely consistent on this until recently but floats actually are used in the wild, rather than strings.
2018-08-30Add signal for read receipt.Black Hat
2018-08-29Use local QHash.Black Hat
2018-08-25Update marius voip to new libqtmcJosip Delic
2018-08-20Room::displaynameChanged() should pass the old name tooKitsune Ral
Also: general cleanup.
2018-08-13Room::tagsChanged(): elaborate additions/removals along with the signalKitsune Ral
2018-08-11Reverse direct chats mapKitsune Ral
Speeds up lookup of user(s) in a direct chat room. Also: "The other one's" avatar is used to set the avatar of direct chats only, not any room with 2 participants.
2018-08-06Room: addedMessages passes timeline indicesKitsune Ral
2018-08-04Room: avoid overloading postMessage, as QML is bad at resolving overloaded slotsKitsune Ral
Closes #227.
2018-08-03Room::retryMessage and Room::discardMessageKitsune Ral
2018-08-03Refactor event itemsKitsune Ral
* TimelineItem and a newly introduced PendingEventItem are now inheriting from the common EventItemBase class * PendingEventItem has its own status and annotation, serving to track transition of the item through pending states
2018-07-31Room::readMarkerMoved: pass 'from' and 'to' ids with the signalKitsune Ral
2018-07-28Room: validate tags before sending them to the serverKitsune Ral
See https://github.com/matrix-org/matrix-doc/pull/1457 for the background.
2018-07-27Make Room::postMessage and Room::postHtmlMessage return transactionIdKitsune Ral
This is at least some (actually, not even that bad) identification of a message. Ideally it would probably be to return some handler that would allow to track the end-to-end status of the event - from getting sent to landing in the timeline. Right now the experience is crippled - transactionId always exists but only works for message events and Room has no way to give the event status by transactionId. pendingEvent* signals are somewhat helping, though.
2018-07-27Provide a way to match the echo against the synced eventKitsune Ral
This needed to split the container with the freshly arrived events into parts that don't have local echo and echo'ed events, and add them to the timeline emitting two different pairs of signals. Instead of being removed, pending events are now merged (effectively they are removed from unsyncedEvents container anyway but models can represent this as an echo event being "transformed" into a full-fledged one on a timeline).
2018-07-27Initial support for local echoKitsune Ral
The Room class has gained a new internal container, unsyncedEvents, storing locally-created Event objects that are about to be sent or are sent but not yet synced. These objects are supposed to be complete enough to be displayed by clients in a usual way; access to them is provided by Room::pendingEvents() accessor. A set of pendingEvent* signals has been added to notify clients about changes in this container (adding, removal, status update). Yet unsent events don't have Event::id() at all; sent but yet unsynced ones have Event::id() but have almost nothing else except the content for now (probably a sender and an (at least local) timestamp are worth adding). Also: SendEventJob is removed in favor of GTAD-generated SendMessageJob.
2018-07-22Change order data type.Black Hat
2018-07-21Overload Room:addTag.Black Hat
2018-07-21Mark Room::addTag() and Room::removeTag() as Q_INVOKABLE.Black Hat
2018-07-10Room::postHtmlMessage() - a facility method to send HTML messagesKitsune Ral
2018-07-08TimelineItem::viewAs(): fix a typoKitsune Ral
2018-07-08TimelineItem: get(); validating viewAs<>()Kitsune Ral
Having get() allows to work with TimelineItem as a smart pointer.
2018-07-04TimelineItem::operator*()Kitsune Ral
2018-07-04Event types system remade to be extensibleKitsune Ral
There were two common points that had to be updated every time a new event is introduced: the EventType enumeration and one of 3 doMakeEvent<> specialisations. The new code has a template class, EventFactory<>, that uses a list of static factory methods to create events instead of typelists used in doMakeEvent<>(); the EventType enumeration is replaced with a namespace populated with constants as necessary. In general, EventType is considered a deprecated mechanism altogether; instead, a set of facilities is provided: is<>() to check if an event has a certain type (to replace comparison against an EventType value) and visit<>() to execute actions based on the event type (replacing switch statements over EventType values). Closes #129.
2018-07-01weakPtr -> weakPtrCastKitsune Ral
2018-05-28Move out prettyPrint() from Room to util.hKitsune Ral
So that it could be used outside of room context.
2018-05-24Room: Make isFavourite/LowPriority/DirectChat accessible from QMLKitsune Ral
The first two as Q_PROPERTYs, the last one as Q_INVOKABLE.
2018-05-04Preempt job/setroomstatejob.* with jobs/generated/room_state.*Kitsune Ral
The template part (not exposed in the auto-generated class) goes to Room::Private::requestSetState(). Also, Room::setMemberState() to interface with User class.
2018-05-03GetRoomEventsJob (replaces RoomMessagesJob) + refactoringKitsune Ral
1. Updates in this commit (see further) allow to generate and build GetRoomEventsJob from message_pagination.yaml; this job completely preempts RoomMessagesJob. 2. EventsBatch<> is no more a thing; there's EventsArray<> to replace it but it's loaded from a JSON array rather than an event batch (a JSON array inside another JSON object). SyncJob that used it extensively has been moved to "conventional" containers (Events, RoomEvents and the newly introduced StateEvents). RoomMessagesJob that also used EventsBatch<> is decommissioned (see above). 3. RoomEventsRange is now an alias for Range<RoomEvents>, defined in util.h (otherwise almost the same). 4. Connection::getMessages() is no more. Use Room::getPreviousContent() and Connection::callApi<GetRooMEventsJob>() instead. 5. Moving things around in Room, since SyncJob now supplies state events in more specific StateEvents, rather than RoomEvents.
2018-05-01Event and Room: further abstract event pointersKitsune Ral
So that eventual switch from std::unique_ptr to some other pointer (as a case - QSharedPointer) would be as painless as possible.
2018-04-13Support Qt 5.4Kitsune Ral
That is until ubports move to xenial.
2018-04-02Room/Connection: accountData()/accountDataChanged()Kitsune Ral
Generic account data are at least readable now (you can get, say, pushers from the library without it even being aware of what a pusher is).
2018-03-31Move source files to a separate folderKitsune Ral
It's been long overdue to separate them from the rest of the stuff (docs etc.). Also, this allows installing to a directory within the checked out git tree (say, ./install/, similar to ./build/).