Age | Commit message (Collapse) | Author |
|
Co-authored-by: Alexey Rusakov <Kitsune-Ral@users.sf.net>
|
|
|
|
|
|
|
|
|
|
Also, RoomAliasesEvent is to be completely gone after 0.7.
|
|
Quotient::function_traits<> did not support member functions in a proper
way (i.e. the way std::invoke_result<> treats them, with the function's
owning class represented as the first parameter). Now that I gained
the skill and understanding in function_traits<> somewhat wicked
machinery, I could properly support member functions. Overloads and
generic lambdas are not supported but maybe we'll get to those one day.
|
|
It has not much to do with the Visitor design pattern; also,
std::visit() has different conventions on the order of parameters.
|
|
Co-authored-by: Alexey Rusakov <Kitsune-Ral@users.sf.net>
|
|
|
|
|
|
|
|
|
|
Proper linters recognise that the returned types are not primitive,
while people might still be confused a bit.
|
|
In both fixed cases the callee accepts a const reference, which makes
std::move() useless. Static analyzers apparently missed them because
the cases are inside a macro.
|
|
Similar to contentPart() - apparently there are enough places across
the code that would benefit from it.
|
|
Given that QJsonObject only accepts QStrings in the list constructor,
the template is useless cruft.
|
|
There's a clash between Event::content() (a template function) and
RoomMessageEvent::content() (plain member). Out of these two, the name
more fits to the RME's member function - strictly speaking,
Event::content() retrieves a part of content, and so is renamed.
In addition, contentPart() defaults to QJsonValue now, which is pretty
intuitive (the function returns values from a JSON object) and allows
to implement more elaborate logic such as
if (const auto v = contentPart<>("key"_ls); v.isObject()) {
// foo
} else if (v.isString()) {
// bar
} else {
// boo
}
|
|
Doesn't really help build times, instead breaking the build on older Qt.
|
|
The "original JSON" wording is misleading: the returned JSON can be and
is routinely edited as a part of event construction, redaction, editing.
Also, originalJson() name is misleading in that it returns a stringified
(in a very specific way) JSON and not an object. You have to call
fullJson() to get the object, and originalJsonObject(), confusingly,
returns exactly the same thing but as a value rather than as
a reference. The original intention of keeping originalJsonObject() was
to make it Q_INVOKABLE or use it as an accessor for a Q_PROPERTY.
unfortunately, this was never really practical as discussed in
the previous commit.
All that implies that clients have to handle passing event JSON to QML
themselves, in the form they prefer (as an object or a string). The
added complexity is negligible though; on the other hand, there's added
flexibility in, e.g., choosing a compact instead of default JSON layout
or even generate a highlighted JSON representation.
|
|
Makes compilation a tad lighter.
|
|
Q_GADGET is generally used to enable two things outside of QObject:
Q_PROPERTY/Q_INVOKABLE and Q_ENUM/Q_FLAG. While the latter can be used
in its own right in QML, the former requires Q_GADGET instances to be
passed to QML by value, which is not really possible with
uncopyable/unassignable classes. Bottom line is that Q_PROPERTY in
anything derived from Quotient::Event is not viable, making Q_GADGET
macro useless unless there's a Q_ENUM/Q_FLAG (as is the case with
RoomMessageEvent, e.g.).
|
|
|
|
Makes the Room::P::toJson() code more readable.
|
|
DISABLE_MOVE is no more; instead, the library provides Q_DISABLE_MOVE
(and also Q_DISABLE_COPY_MOVE while at it) for Qt pre-5.13 that don't
have it yet. Same for QT_IGNORE_DEPRECATIONS - it only arrived in 5.15
but all the building pieces existed prior so libQuotient has it
regardless of the Qt version used for building.
|
|
Closes #514.
|
|
|
|
|
|
|
|
EncryptionEvent constructor
|
|
Use originTimestamp(); the corresponding Q_PROPERTY was not renamed
(in error) so it is now.
|
|
BaseJob: StatusCode::JsonParseError
Connection: resolved() and reconnected() signals; roomMap(); postReceipt()
User: bridged() and rawName()
ConnectionData: setHost() and setPort()
StateEventBase: prev_content()
|
|
|
|
RoomAliasesEvent is no more even registered (meaning that the library
will load m.room.aliases as unknown state events); quotest code updated
to use historyEdge() instead of timelineEdge().
|
|
Namely memberCount(), localAliases(), remoteAliases(), timelineEdge().
|
|
|
|
|
|
Instead of being defined independently, JoinState now uses values from
the Membership enumeration (former MemberEventContent::MembershipType)
that was moved to quotient_common.h for that purpose. Both enumerations
gained a Q_FLAG_NS decoration and operator<< overrides that strip
"Quotient::" prefix when dumping member/join state values to the log -
obviating toCString(JoinState) along the way. Quotient::MembershipType
alias is deprecated from now.
|
|
Ok, it was stupid to delete #include <QtCore/QMetaType> in 004ebf8d and
then to expect that Qt macros would still work, given that I don't use
QObject. In my defense I can only say that with Qt 6 it still compiled.
|
|
Q_DECLARE_METATYPE is really unhappy about types without
a public default constructor.
|
|
TypedBase is an abstract class; constructing it doesn't make sense. But
even if it were not abstract, it's not supposed to be instantiated.
|
|
9a5fa623 dropped one of RoomMessageEvent constructors for Qt 6 in order
to address #483 - breaking the build with Qt 6 along the way, as
Room::postFile() relied on that constructor. This commit changes
Room::postFile() in turn, deprecating the current signature and adding
a new one that accepts an EventContent object rather than a path to
a file. In order to achieve that, FileInfo and ImageInfo classes have
gained new constructors that accept QFileInfo instead of the legacy
series of parameters, streamlining usage of EventContent structures.
|
|
Closes #483.
|
|
Now that QMetaType introspects into types, it reveals hidden problems
(which is very nice of it).
|
|
Waiting for the Multimedia arrival in Qt 6.2.
|
|
|
|
Fixes issue #188
|
|
(cherry picked from commit b25785d294669f2bab7dcd1e3cd1fba61991fe46)
|
|
Fix rich edits (transmit)
|
|
The new formatted_body was not included into new content on edit
due to badly constructed json.
|