Age | Commit message (Collapse) | Author |
|
|
|
Since there's no such thing as "unread messages flag" in the CS API spec, there's now a non-standard key-value in cached m.read receipts for that.
|
|
The property controls whether or not the rooms state is cached: if it's off, loadState() and saveState() become no-ops. Other changes:
* loadState/saveState properly deal with rooms in Invite state (this is not quite relevant to the current branch but very much is in the light of a concurrent kitsune-invite-kick PR);
* Profile loadState/saveState (because dumping and especially parsing JSON takes time);
* Use QJsonDocument::Compact layout, it's about 3 times smaller and quicker to parse than Indented, and we really don't care about the cache being human-friendly;
* Have a default path for the state cache, based on the connection's user id.
|
|
Your QT_LOGGING_RULES (especially useful with Qt 5.6 and newer) should
work a bit better now:
* "Job" prefix is no more needed because the Qt logging prefix
(libqmatrixclient.jobs) says it already;
* The "created" record didn't follow the logging category if overridden
from the concrete job class (see SyncJob); so instead of "created"
there's now much more useful "sending request" record.
|
|
It seems that some reply processing still might have happened after
BaseJob::abandon() (caused in turn by destroying a Connection object),
probably because the event from QNetworkReply landed in the event queue
after BaseJob::abandon() but before actual deletion of a job object. Now
countered by disconnecting from QNetworkReply signals in abandon() and
stop().
|
|
The previous version constructed QString from const char* and QByteArray
parts,
only to convert it back to QByteArray; the current version
does the whole thing in QByteArray terms.
|
|
* Event::originalJsonObject() exposes the original JSON for the event without converting it to QByteArray. This is useful to quickly dump an event into a bigger JSON without reconstructing a JSON object.
* Validations in RoomEvent::RoomEvent() do more harm than good. The rest of the library tolerates absence of those attributes pretty well (it wouldn't be able to do much with that anyway); at the same time, dumping JSON to logs turns out to be pretty heavy, and throwing many invalid events at a client is a good way to hit its performance.
|
|
|
|
|
|
Notably:
* setJoinState() invocation has been missing from the previous code
* processing invites did not take into account that a Leave state may already exist, thereby forcing clients that display left rooms to look through their records just in case they have to replace a Leave with Invite.
* joinedRoom() was emitted even when the room is not newly joined.
|
|
joinedRoom() and leftRoom() now pass the preempted Invite state of the
room as well; roomMap() only returns Invite and Join rooms, not Leave.
|
|
Also use scaledThumbnail() in User::requestAvatar()
|
|
Connection: Room and User factories are std::functions now
|
|
|
|
|
|
Kicking and inviting use generated job classes. Rooms in Invite state are stored separately in the hash from those in Join/Leave state because The Spec says so. For clients, this means that the same room may appear twice in the rooms map if it's been left and then the user was again invited to it. The code in Quaternion that properly processes this will arrive shortly.
|
|
Actual usage will come with the next commit.
|
|
A cherry-pick from the kitsune-apigen branch; a family of toJson() and fromJson<>() functions to unify conversion of data back and forth.
|
|
Instead of createUser() and createRoom() virtual functions, use std::function<> to store predefined lambdas that would create respective descendants from User and Room, respectively. No more need QuaternionConnection just for the sake of creating a QuaternionRoom.
|
|
This reverts commit da975f68f6a8503bf5466292dcdceed8c6f7fa6f.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Add Connection::leftRoom signal #80
|
|
|
|
|
|
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.
|