aboutsummaryrefslogtreecommitdiff
path: root/lib/room.h
AgeCommit message (Collapse)Author
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/).