Age | Commit message (Collapse) | Author |
|
|
|
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.
|
|
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).
|
|
|
|
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.
|
|
|
|
The Spec wasn't entirely consistent on this until recently but floats actually are used in the wild, rather than strings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
It's present on the vast minority of events so better be embedded into
JSON instead.
|
|
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.
|
|
[ci skip]
|
|
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.
|
|
If defined (value doesn't matter), it will suppress generation of
deprecated EventType constants. Not defined by default, as of 0.4.
|
|
Otherwise factory chaining doesn't work right (an unknown event returned
by a chained factory is treated as successful parsing).
|
|
|
|
|
|
|
|
|
|
|
|
Static storage initialisation fiasco, as it is...
|
|
MSVC struggles with template variables...
|
|
It confuses compilers and adds a mostly unneeded null check; it's dead easy
to just dereference a pointer before passing it to visit<>().
|
|
|
|
|
|
|
|
|
|
|
|
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().
|
|
|
|
We now have event.*, roomevent.*, stateevent.* and eventloader.h. If you only use event leaf-classes (such as RoomMemberEvent) you shouldn't notice anything.
|
|
code into blocks
A template member variable in it seemed to cause internal compiler error in MSVC 2017, let alone MSVC 2015...
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The latter one causes linkage errors when used from a template method (but not from a template class, puzzlingly).
|
|
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.
|
|
|
|
So that eventual switch from std::unique_ptr to some other pointer (as a
case - QSharedPointer) would be as painless as possible.
|
|
|