Age | Commit message (Collapse) | Author |
|
KitsuneRal/api-generator project is a place where all the heavy lifting will (eventually) be implemented. This commit marks a point when the generated files at least compile (whether they work is not tested yet). Return values are so far entirely ignored.
|
|
We had a stupid situation when this class has less features when
compiled with newer Qt because we explicitly added a constructor from
std::initializer_list for older Qt versions but did not reuse the same
constructor from QJsonObject for newer versions.
|
|
Thanks to CII Best Practices Badge project for the hints and for the original CONTRIBUTING.md
|
|
|
|
Also: Query and Data constructors from initialization_list<> are no more explicit, as clang-tidy recommends.
|
|
|
|
|
|
|
|
|
|
|
|
Room event timestamp can also be undefined
|
|
|
|
|
|
Events creation and sending
|
|
|
|
1. PostMessageJob is now SendEventJob, which reflects two things: first, it's a PUT instead of a POST (POST for /send is not supported by the latest spec anyway), so that we could enable tracking transaction ids for local echo in the near future; second, it's no more just about messages, the job can support sending any room events (topic changes etc.).
2. Room::postMessage() now uses the new RoomMessageEvent API to send m.room.message events.
|
|
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.
|
|
This includes RoomEvent gaining transactionId property and addId() method so that it could gain ids when being/having been sent.
|
|
Use std::initializer_list instead of QList<> because we actually want to construct from initializer lists; and only enable Data(std::initializer_list) for older Qt's that don't have the same on the level of QJsonObject.
|
|
The generation algorithm doesn't support several Quaternions using the same accessToken, as of yet.
|
|
|
|
Split bridge name into a separate field in user model
|
|
|
|
|
|
Make markAllMessagesAsRead() Q_INVOKABLE
|
|
|
|
Expose userlist to QML
|
|
|
|
|
|
|
|
Events refactoring
|
|
|
|
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.
|
|
Enable OSX in Travis CI
|
|
|
|
Code tweaks and cleanup
|
|
After adding some profiling it became clear that to recalculate the room name and emit namesChanged() upon each member event is a waste, especially when there are thousands of those coming at initial sync (*cough* Matrix HQ room). So the room name is recalculated only once and unconditionally (in most cases this will boil down to checking whether name/canonicalAlias changed after processing the events batch), and namesChanged is only emitted once per batch, if any name or alias changed.
|
|
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).
|
|
Before the access token was added to Private::requestQuery on every sendRequest() invocation, leading to the same access token being added up to the request once more with each retry.
|
|
|
|
|
|
|
|
introduced; Connection and Room cleanup
Helps to better encapsulate Room
|
|
It's just natural, after all, Connection is a parent of Room. But seriously, this will be needed when we have rooms from different Connections living next to each other.
|
|
Mainly it's about const-ification (in particular, passing const-refs instead of values) and deleting unneeded declarations/#includes. Since the changes alter the external interface, this is submitted as a PR for peer review.
One of unneeded declarations/definitions is a virtual destructor in BaseJob descendants. Since a job object should be deleted through QObject::deleteLater() anyway (and it's the only correct way of disposing of the object), all deletions will call the stack of destructors through virtual QObject::~QObject(). Therefore even BaseJob could get on with a non-virtual destructor but for the sake of clarity BaseJob::~BaseJob() is still declared virtual.
|