aboutsummaryrefslogtreecommitdiff
path: root/quotest/quotest.cpp
AgeCommit message (Collapse)Author
2022-09-04More cleanupAlexey Rusakov
2022-09-04DEFINE_SIMPLE_EVENT: support custom JSON keysAlexey Rusakov
2022-08-25CleanupAlexey Rusakov
2022-07-11Add QUOTIENT_API to RoomStateViewAlexey Rusakov
Fixing link errors at non-template RoomStateView::get() when building with libQuotient as a shared object. There's also a test in quotest.cpp now to cover that case.
2022-05-29Refactor EncryptedFile and EC::FileInfo::fileAlexey Rusakov
Besides having a misleading name (and it goes back to the spec), EncryptedFile under `file` key preempts the `url` (or `thumbnail_url`) string value so only one of the two should exist. This is a case for using std::variant<> - despite its clumsy syntax, it can actually simplify and streamline code when all the necessary bits are in place (such as conversion to JSON and getting the common piece - the URL - out of it). This commit replaces `FileInfo::url` and `FileInfo::file` with a common field `source` of type `FileSourceInfo` that is an alias for a variant type covering both underlying types; and `url()` is reintroduced as a function instead, to allow simplified access to whichever URL is available inside the variant. Oh, and EncryptedFile is EncryptedFileMetadata now, to clarify that it does not represent the file payload itself but rather the data necessary to obtain that payload.
2022-05-16Quotest: test checkResource()Alexey Rusakov
2022-05-08Generalise DEFINE_SIMPLE_EVENTAlexey Rusakov
This macro was defined in accountdataevents.h but adding one more parameter (base class) makes it applicable to pretty much any event with the content that has one key-value pair (though state events already have a non-macro solution in the form of `StateEvent<EventContent::SingleKeyValue>`). Now CustomEvent definition in quotest.cpp can be replaced with a single line.
2022-05-08basic*EventJson() -> *Event::basicJson()Alexey Rusakov
This makes it easier and more intuitive to build a minimal JSON payload for a given event type. A common basicJson() call point is also convenient in template contexts (see next commits).
2022-01-22Quotest: fix changeName testAlexey Rusakov
This test was very unreliable because memberRenamed() signal was emitted upon lazy-loading of past member renames. The new code connects to aboutToAddNewMessages() instead, which should only contain the latest renaming event (past events are delivered in the 'state' object).
2022-01-21Redo EventRelation; deprecate RelatesToAlexey Rusakov
RelatesTo and EventRelation have been two means to the same end in two different contexts. (Modernised) EventRelation is the one used now both for ReactionEvent and EventContent::TextContent. The modernisation mostly boils down to using inline variables instead of functions to return relation types and switching to QLatin1String from const char* (because we know exactly that those constants are Latin-1 and QLatin1String is more efficient than const char* to compare/convert to QString).
2021-12-29Quotest: test sending and receiving custom eventsAlexey Rusakov
This seems to be the crux of #413.
2021-12-21Quotest: add a missing \n in the outputAlexey Rusakov
2021-12-17RoomMemberEvent: fix an off-by-one errorAlexey Rusakov
Also: extended quotest to cover member renames, not just user profile renames.
2021-12-02visit(Event, ...) -> switchOnType()Alexey Rusakov
It has not much to do with the Visitor design pattern; also, std::visit() has different conventions on the order of parameters.
2021-10-05Quotest: return non-zero when things go really wrongAlexey Rusakov
...such as stuck login or failure to join the room. Closes #496.
2021-10-04Add tests for prettyPrint()Alexey Rusakov
2021-09-19Use C++ instead of commentingAlexey Rusakov
2021-09-12Fix a memory leak in DownloadRunnerAlexey Rusakov
2021-09-12Fix building with older QtAlexey Rusakov
2021-09-12Add a download test to quotestAlexey Rusakov
2021-07-30Clean up after the previous commitAlexey Rusakov
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().
2021-07-18Room::postFile(): adjust to the changed RoomMessageEvent APIAlexey Rusakov
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.
2021-02-21Uri: support abbreviated types in Matrix URIsAlexey Rusakov
As per the latest iteration of MSC2312, room/, user/ and event/ are only supported for parsing and replication but not for emitting from Matrix identifiers. (cherry picked from commit 86f24d1ecf300b82b3a7253b81a2c392669d2c2b)
2021-02-15Update quotest/quotest.cppCarl Schwan
Co-authored-by: Alexey Rusakov <Kitsune-Ral@users.sf.net>
2021-02-09UpdateCarl Schwan
2021-01-23Update testCarl Schwan
2021-01-23Add testCarl Schwan
2021-01-21Move testsCarl Schwan