aboutsummaryrefslogtreecommitdiff
path: root/lib/events
AgeCommit message (Collapse)Author
2019-05-18event.h: add doc-comments; deprecate ptrCast()Kitsune Ral
2019-05-17Minor code refactoringKitsune Ral
2019-04-06Clean up on clang-tidy/clazy analysisKitsune Ral
2019-03-24RoomMemberEvent: sanitize user display namesKitsune Ral
MemberEventContent::displayName() will strip away Unicode text direction override characters. Direct access to JSON can still provide "raw" data.
2019-03-23Room::downloadFile(): Tighten URL validationsKitsune Ral
Check the URL before passing over to Connection::downloadFile(), not only the file name.
2019-03-02style: apply .clang-format to all .cpp and .h filesMarc Deop
2019-02-26Merge pull request #287 from a-andreyev/aa13q-fix-5.6-build-qhashKitsune Ral
Fix Qt<5.7 build for std::hash<StateEventKey>
2019-02-25RoomMessageEvent: support m.in_reply_to (not spec-compliant yet); optimise ↵Kitsune Ral
away TextContent when not needed 1. The spec says "if you support rich replies you MUST support fallbacks" - this commit only adds dealing with event JSON but not with textual fallbacks. 2. TextContent is only created if there's something on top of plain body (an HTML body or a reply).
2019-02-24Fix Qt<5.7 build for std::hash<StateEventKey>Alexey Andreyev
2019-02-22Merge remote-tracking branch 'remotes/origin/kitsune-simpler-simple-content'Kitsune Ral
2019-02-15Simplify RoomCreateEventKitsune Ral
2019-02-15RoomTombstoneEventKitsune Ral
2019-02-11RoomCreateEventKitsune Ral
Closes #234.
2019-02-11SimpleContent: don't derive from Base as it gives zero added valueKitsune Ral
Originally there was an idea to make a common base class for all event content. Aside from really trivial unification of toJson() this doesn't span across various types of events, and since state events use static, rather than dynamic, polymorphism (StateEvent<> is a template with the aggregated content vs. RoomMessageEvent with the aggregated pointer-to-content-base), there's no considerable value in using the base class. If state events start using the same approach as message events, this may be brought back but not until then.
2019-01-13Security fix: require that state events have state_keyKitsune Ral
This has been fixed in the past but got undone after the great remaking of the event types system. Further commits will introduce tests to make sure this does not get undone again.
2019-01-06Create StateEventBase events if state_key is thereKitsune Ral
This makes unknown state events to still be treated as state events.
2019-01-06visit(): pass decayed event types to is()Kitsune Ral
So that is<> could be specialised for some types.
2019-01-06RoomEvent: don't log transactionId anymoreKitsune Ral
It's already logged in Room - actually, several times at different stages.
2019-01-05API version++; use QMediaResource from QtMultimedia (new dep) to detect m.videoKitsune Ral
resolution The API version number should have been bumped long ago.
2019-01-05EventContent::ImageInfo: support originalFilename in POD constructorKitsune Ral
It's not mandated by the spec for anything except m.file but hey it's convenient.
2019-01-05RoomMessageEvent: easier creation of file-based eventsKitsune Ral
2019-01-05More defaults to construct LocationContent and PlayableContentKitsune Ral
2019-01-05EventContent: only dump to json non-empty/valid valuesKitsune Ral
2019-01-05Make content in events editableKitsune Ral
2019-01-05EventContent: use qint64 for the payload sizeKitsune Ral
2018-12-26EventContent: allow empty (default-constructed) thumbnailsKitsune Ral
2018-12-26RoomAvatarEvent: use correct #includesKitsune Ral
2018-12-11RoomMemberEvent: properly integrate with GetMembersByRoomJobKitsune Ral
GetMembersByRoomJob was dysfunctional so far, creating "unknown RoomMemberEvents" instead of proper ones. Now that we need it for lazy- loading, it's fixed!
2018-12-08EventContent: minor cleanupKitsune Ral
2018-12-08Refactor toJson/fillJsonKitsune Ral
Both now use through a common JsonConverter<> template class with its base definition tuned for structs/QJsonObjects and specialisations for non-object types. This new implementation doesn't work with virtual fillJson functions yet (so EventContent classes still use toJson as a member function) and does not cope quite well with non-constructible objects (you have to specialise JsonConverter<> rather than, more intuitively, JsonObjectConverter<>), but overall is more streamlined compared to the previous implementation. It also fixes one important issue that pushed for a rewrite: the previous implementation was not working with structure hierarchies at all so (in particular) the Filter part of CS API was totally disfunctional.
2018-12-08StateEvent<>: make data members privateKitsune Ral
Keeping them protected extends API surface with no reasonable use from it (and for now derived classes don't access StateEvent<> data members directly, anyway).
2018-12-08RoomMemberEvent: cleanupKitsune Ral
Don't make JSON for event content only to parse it again; drop extraneous constructs.
2018-11-20eventloader.h: drop unneeded #includeKitsune Ral
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