aboutsummaryrefslogtreecommitdiff
path: root/lib/events/event.h
AgeCommit message (Collapse)Author
2021-01-16Updated copyright statements upon Git auditKitsune Ral
After going through all the files and the history of commits on them it was clear that some copyright statements are obsolete (the code has been overwritten since) and some are missing. This commit tries best to remedy that, along with adding SPDX tags where they were still not used. Also, a minimal SPDX convention is documented for further contributions. Closes #426.
2021-01-15Merge pull request #428 from ognarb/licensingKitsune Ral
Port existing copyright statement to reuse using licensedigger
2020-12-28event.h: Fix breakage of AppVeyor CIKitsune Ral
The breakage was caused by 639f1d48.
2020-12-28event.h: Minor tweaks around visit<>Kitsune Ral
2020-12-26Port existing copyright statement to reuse using licensediggerCarl Schwan
2020-11-15Cleanup across event classesKitsune Ral
In particular: removed unnecessary #includes, deprecated and no more used constructs, replaced stored members with dynamic generation from JSON (TypingEvent and, especially promising for performance, ReceiptEvent)
2020-11-12More JSON key constantsKitsune Ral
2020-08-02Event::dumpTo: make protected, and RoomEvent overrideKitsune Ral
The override adds the event's origin timestamp
2020-03-26Refactoring around Connection::onSyncSuccess()Kitsune Ral
The method grew large and a bit unwieldy over the years.
2019-09-29Simplify visit() signatureKitsune Ral
Checking that BaseEventT descends from Event is really extraneous.
2019-08-11Now that we're C++17, remove old compatibility cruftKitsune Ral
2019-08-11Drop EventType namespace and DEFINE_EVENTTYPE_ALIAS macroKitsune Ral
They've been deprecated for almost a year by now.
2019-08-09Namespace: QMatrixClient -> Quotient (with back comp alias)Kitsune Ral
2019-08-02Apply the new brace wrapping to source filesKitsune Ral
2019-08-02Merge branch 'master' into use-clang-formatKitsune Ral
2019-08-01Merge branch 'master' into kitsune-relationsKitsune Ral
Unified *Key -> *KeyL identifiers in roommessageevent.cpp along the way.
2019-07-27E2EE: introduce EncryptedEventAlexey Andreyev
2019-07-09Merge branch 'master' into use-clang-formatKitsune Ral
2019-07-06Convenience: StateKeyKey, StateKeyKeyL, basicStateEventJson()Kitsune Ral
2019-07-06Fix clazy warningsKitsune Ral
2019-06-24Merge branch 'master' into clang-formatKitsune Ral
# Conflicts: # CMakeLists.txt # lib/avatar.cpp # lib/connection.cpp # lib/connection.h # lib/connectiondata.cpp # lib/csapi/account-data.cpp # lib/csapi/account-data.h # lib/csapi/capabilities.cpp # lib/csapi/capabilities.h # lib/csapi/content-repo.cpp # lib/csapi/create_room.cpp # lib/csapi/filter.cpp # lib/csapi/joining.cpp # lib/csapi/keys.cpp # lib/csapi/list_joined_rooms.cpp # lib/csapi/notifications.cpp # lib/csapi/openid.cpp # lib/csapi/presence.cpp # lib/csapi/pushrules.cpp # lib/csapi/registration.cpp # lib/csapi/room_upgrades.cpp # lib/csapi/room_upgrades.h # lib/csapi/search.cpp # lib/csapi/users.cpp # lib/csapi/versions.cpp # lib/csapi/whoami.cpp # lib/csapi/{{base}}.cpp.mustache # lib/events/accountdataevents.h # lib/events/eventcontent.h # lib/events/roommemberevent.cpp # lib/events/stateevent.cpp # lib/jobs/basejob.cpp # lib/jobs/basejob.h # lib/networkaccessmanager.cpp # lib/networksettings.cpp # lib/room.cpp # lib/room.h # lib/settings.cpp # lib/settings.h # lib/syncdata.cpp # lib/user.cpp # lib/user.h # lib/util.cpp
2019-05-18event.h: add doc-comments; deprecate ptrCast()Kitsune Ral
2019-03-02style: apply .clang-format to all .cpp and .h filesMarc Deop
2019-01-06visit(): pass decayed event types to is()Kitsune Ral
So that is<> could be specialised for some types.
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-04Support dumping Events to QDebugKitsune 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-08-05eventCast: add an assertionKitsune 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-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-11event.h: protect from readding factory methodsKitsune Ral
2018-07-11EventTypeRegistry::getMatrixType(): move implementation to .cppKitsune 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-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.