Age | Commit message (Collapse) | Author |
|
|
|
Similar to hasFileContent(), allows to ascertain that an event has TextContent without checking against all possible msgtypes.
|
|
MSVC is not good at dealing with type parameter packs of member functions, which is what the whole mixin magic in UrlBasedContent<> relied on. So it's one more level of inheritance instead of mixins now.
|
|
The whole inheritance/templating structure has been considerably simplified by using a trick with mixin classes; thanks to that, *Info classes are no more templated, they are just mixed together by the almighty UrlBasedContent<> template (but the same can easily be done outside of it, as LocationContent implementation shows). RoomMessageEvent has gained hasFileContent(); it's also possible to easily get a FileInfo core object just by calling msgEvent->content()->fileInfo().
|
|
A RoomEvent now has an optional pointer to a RedactionEvent that is non-null if the room event is redacted. transactionId and serverTimestamp are only filled if the event is not redacted. There's no way to construct a redacted event as of yet.
|
|
Two changes to make EventContent hierarchy easier to understand and use:
- InfoBase is unbound from Base, and downstream classes use multiple inheritance
to work "info" objects
- MIME types are separated from Base into a separate TypedBase class because
MIME typing is not common to all content kinds.
|
|
ImageContent is usable outside of m.room.message (in particular, m.room.avatar
uses the same structure for content. And EventContent::Base is very suitable to
derive from even for standard event content structures (such as in room name
events), let alone non-standard ones.
Also, renamed MessageEventContent to EventContent (for obvious reasons).
|
|
|
|
QString msgType allows non-standard types (we don't want to restrict clients to types from the spec)
|
|
mimeType is relevant to most of the content types, and at the same time getting a MIME type in a generic way is handy for clients to uniformly detect whether they can display the content and what renderer to use for it.
|
|
RoomMessageEvent and MessageContentEvent::* classes have been massively overhauled to enable creation of m.room.message events locally instead of from JSON.
|
|
|
|
The biggest change is we have no pimpls in Event objects anymore - because it's two new's instead of one per Event, and we have thousands and even more of Events created during initial sync. The other big change is introduction of RoomEvent, so that now the structure of events almost precisely reflects the CS API spec. The refactoring made UnknownEvent unnecessary as a separate class; a respective base class (either RoomEvent or Event) is used for this purpose now. All the other changes are consequences of these (mostly of RoomEvent introduction).
|
|
The Dispatch<> template and dispatch(), a facility function for it, simplify dispatching to functions that have different signatures that still can be converted to the same std::function<> type. The case in point is in event.cpp; Event::fromJson calls make() that always returns the type we need; however, once we have several possible base types (Event, RoomEvent, StateEvent), we'd have to either write a specific make() incarnation for each of them, or mess with function return type conversions. Dispatch<> helps to keep the code clean.
REGISTER_ENUM is a cross-Qt versions approach to dumping enumeration values to qDebug() and the likes.
|
|
logging.h/logging.cpp is now a full-fledged pair for all things logging. Two more categories added, EPHEMERAL and SYNCJOB, that control logging for ephemeral events and SyncJob, respectively (in particular, switching off EPHEMERAL greatly reduces the logspam about moving read markers and how many users have read up to which event).
|
|
This greatly reduces the noise made by quaternion.
To enable full logging, export the following variable:
QT_LOGGING_RULES="libqmatrixclient.*.debug=true"
|
|
The previous code deviated from the spec, trying to guess on the content type of body as if there could be HTML in some cases. The spec openly states that 'body' value should always be in plain text.
|
|
there
Because these fall outside of SyncJob and Event context, respectively. In addition, Owning<> has gained a move assignment operator (because we have a move constructor) and assign() convenience method to take ownership over an existing container; also, Owning<>::release() is done the right way now (the previous version was copying the return value to a new container instead of releasing the old container).
|
|
|
|
|
|
Feel free to use whenever you need to convert another JSON key to some C++ object, or dispatch anything based on a JSON key.
|
|
The spec is told to allow any event to have a thumbnail in future, and the thumbnail will reside under "content" JSON key rather than "info".
|
|
|
|
TextContent is a class to deal with formatted (HTML, RTF, Markdown) text messages. Right now it only supports Vector's non-standard "formatted_body".
|
|
|
|
According to the spec, this key has the same status as msgtype: both should exist in any message. Besides, it's always supposed to be a plain text so there's no polymorphism allowed here.
|
|
|
|
Fortunately, the clients don't seem to use it atm.
|
|
|
|
|
|
|
|
|