aboutsummaryrefslogtreecommitdiff
path: root/lib/events
AgeCommit message (Collapse)Author
2018-11-17StateEventBase::replacedState()Kitsune Ral
Brings event id of the state event that was in effect before this one arrived. This key is not specced but it's used in the wild since forever.
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-14DEFINE_SIMPLE_STATE_EVENT: Add default constructorKitsune Ral
...that creates an "empty" event, i.e. an event with content initialised by a default constructor (not all content types support this but those for simple events do).
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-04StateEventKey and std::hash<StateEventKey> to arrange state events in hashmapsKitsune Ral
2018-11-04StateEvent::dumpTo: add state_key to the loglineKitsune Ral
2018-11-04Support dumping Events to QDebugKitsune Ral
2018-11-04DEFINE_SIMPLE_STATE_EVENT: fix construction from an rvalue QJsonObjectKitsune Ral
2018-11-04DEFINE_SIMPLE_STATE_EVENT: fix value_type mistakenly dubbed as content_typeKitsune Ral
2018-10-04events.h: #ifndef DISABLE_EVENTTYPE -> #ifdef ENABLE_EVENTTYPE_ALIASKitsune Ral
This turns off the legacy EventType namespace with event type aliases (EventType::RoomMessageEvent etc.). To still use it, pass - DENABLE_EVENTTYPE_ALIAS to the compiler.
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-30toJson(TagRecord): don't dump order if there's noneKitsune Ral
2018-09-29Prepare for CS API 0.4.0Kitsune Ral
This commit consists of two parts: upgrading the API infrastructure and trivial but sweeping update to the generated files. 1. The API infrastructure (converters.h, *.mustache and some other non-generated files) now can deal with top-level JSON arrays and response inlining; better supports property maps; and gets some formatting fixes in generated code. 2. Generated files now use QJsonValue instead of QJsonObject as a default type to (un)marshall Matrix API data structures, to match the change in the infrastructure above This commit is still using the old Matrix API definitions, before CS API 0.4.0. Getting to CS API 0.4.0 will come next.
2018-09-16Merge remote-tracking branch 'upstream/master'Josip Delic
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-25Set state eventJosip Delic
2018-08-25Update make it compileJosip Delic
2018-08-25Update marius voip to new libqtmcJosip Delic
2018-08-13accountdataevents.h: Drop useless(?) static declarations for tag namesKitsune Ral
2018-08-06RoomMemberEvent: a set of is*() facility methodsKitsune Ral
2018-08-05eventCast: add an assertionKitsune Ral
2018-08-03RoomEvent: fix wrong JSON key to pick/store transaction idKitsune Ral
2018-08-01Event: use Q_DISABLE_COPYKitsune Ral
2018-07-31RoomEvent: don't store transactionId separatelyKitsune Ral
It's present on the vast minority of events so better be embedded into JSON instead.
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-27makeEvent<>: Add a doc commentKitsune Ral
[ci skip]
2018-07-27event.h: drop eventCast for references; other cleanupKitsune Ral
Omittable<> doesn't work with reference types and returning an unknown event spoils the experience. It's much simpler to just deal with event pointers instead.
2018-07-11Introduce DISABLE_EVENTTYPE flagKitsune Ral
If defined (value doesn't matter), it will suppress generation of deprecated EventType constants. Not defined by default, as of 0.4.
2018-07-11EventFactory::make() should return nullptr in case of failureKitsune Ral
Otherwise factory chaining doesn't work right (an unknown event returned by a chained factory is treated as successful parsing).
2018-07-11Add missing #includesKitsune Ral
2018-07-11event.h: protect from readding factory methodsKitsune Ral
2018-07-11EventTypeRegistry::getMatrixType(): move implementation to .cppKitsune Ral
2018-07-10Room::postHtmlMessage() - a facility method to send HTML messagesKitsune Ral
2018-07-09Add a missing #includeKitsune Ral
2018-07-09Fix legacy EventType values being incorrectly initialisedKitsune Ral
Static storage initialisation fiasco, as it is...
2018-07-08Use constexpr functions instead of variablesKitsune Ral
MSVC struggles with template variables...
2018-07-08visit<>(): drop the overload for pointer-like objectsKitsune Ral
It confuses compilers and adds a mostly unneeded null check; it's dead easy to just dereference a pointer before passing it to visit<>().
2018-07-08visit<>(): support catch-all visitors on the tailKitsune Ral
2018-07-08eventCast(): generalize to smart pointersKitsune Ral
2018-07-08eventCast<>()Kitsune Ral
2018-07-08Generalize weakPtrCast<>()Kitsune Ral
2018-07-07visit<>(): Add an overload accepting a default valueKitsune Ral
2018-07-07Reinstate EventTypeRegistry, keeping EventTypeTraits<> aroundKitsune Ral
You can now get a (much more readable) Matrix type (event_mtype_t) for the internal event type code (event_type_t) using EventTypeRegistry::getMatrixType().
2018-07-04Add #include to fix FTBFS with qmakeKitsune Ral
2018-07-04Break down event.* into smaller filesKitsune Ral
We now have event.*, roomevent.*, stateevent.* and eventloader.h. If you only use event leaf-classes (such as RoomMemberEvent) you shouldn't notice anything.
2018-07-04Events: use a template structure instead of template variables; rearrange ↵Kitsune Ral
code into blocks A template member variable in it seemed to cause internal compiler error in MSVC 2017, let alone MSVC 2015...
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-02Fix FTBFSKitsune Ral
2018-07-01weakPtr -> weakPtrCastKitsune Ral
2018-07-01CleanupKitsune Ral