aboutsummaryrefslogtreecommitdiff
path: root/lib/room.cpp
AgeCommit message (Collapse)Author
2018-11-22Room: Change enum, Changes flag set, and changed() signalKitsune Ral
This allows to batch updates into signals being emitted only once per sync. Also supercedes emitNamesChanged flag used in a few places.
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-19Don't cache empty events; prepare for lazy-loadingKitsune Ral
These two are intermingled in Room::addHistoricalMessageEvents because processing empty events found in a historical batch is no different from discovering (not lazy-loaded) members.
2018-11-19Room: process new state events after applying redactionsKitsune Ral
This was one more cause of #257 - the case when a redaction on a state event arrives in the same batch as the redacted event.
2018-11-19Room: expose eventsHistoryJob as a Q_PROPERTYKitsune Ral
2018-11-19Room: profile addHistoricalMessageEvents (+cleanup)Kitsune Ral
2018-11-17Room: cleanupKitsune Ral
2018-11-17Room::processStateEvent: process banning correctlyKitsune Ral
Closes #258.
2018-11-14Room: fix incorrect handling of state event redactionsKitsune Ral
Also: use Matrix type instead of internal type id in StateEventKey (Because internal type id maps to the library type system which will not discern between Unknown events and therefore will mix together events of different types in Room::Private::baseState/currentState. The Room code is updated accordingly (bonus: more asserts there).) Closes #255.
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-11-14Room: ensure proper error signalling on event sending failuresKitsune Ral
2018-11-05isEchoEvent: check the pending event for ids, not the synced oneKitsune Ral
Synced events always have their event ids, so checking those for event id renders most of the function useless (and returns an incorrect result). Closes #248.
2018-11-04Profiler logging fixes and improvementsKitsune Ral
2018-11-04Room: store state events in a unified wayKitsune Ral
Closes #194.
2018-10-26Use tr() for pluralsKitsune Ral
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-05Room: fix a blunder leading to accessing data after moveKitsune Ral
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-30Room: Unify tags both when getting and settingKitsune Ral
2018-09-30Room: use csapi/tags.h; fix tagsChanged() double-emissionKitsune Ral
Instead of overwriting the entire set of tags even on single-tag operations, SetRoomTagJob and DeleteRoomTagJob are used now. (Room::setTags() still uses SetRoomAccountDataJob).
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-12Merge pull request #1 from QMatrixClient/masterBlack Hat
Merge to latest commit.
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-30Remove unused check.Black Hat
2018-08-29Use QMultiHash.Black Hat
2018-08-29Use local QHash.Black Hat
2018-08-25Update make it compileJosip Delic
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-05Room: add redaction events to the timelineKitsune Ral
Not that it felt right but Riot does it and so should we. Closes #220.
2018-08-05Room: rework processing redactionsKitsune Ral
Redaction events are now processed before, not after/along with normal events. This complicates logistics a bit but makes sure to-be-redacted events get redacted even before the client is notified about new arrivals. Also, redaction events are unconditionally out of the timeline for the moment (the non-starter KEEP_REDACTIONS_IN_TIMELINE macro is gone). This reinstates #196 for now, which will be addressed separately.
2018-08-04Room: avoid overloading postMessage, as QML is bad at resolving overloaded slotsKitsune Ral
Closes #227.
2018-08-03Room: improve logging, add an assertionKitsune Ral
2018-08-03Room::Private::doSendEvent: more logsKitsune Ral
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-23Fix rooms tags being incorrectly setKitsune Ral
Many thanks to @encombhat for pinpointing.