aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2019-07-06Be stricter on usage of stateKeyKitsune Ral
A few places in the library dealt with state events without any notion of state_key inside events, including StateEvent[Base] and relevant functions in Room. A number of workarounds have been made; e.g., Room::setMemberState() accepted userId as a separate parameter, ignoring the state key inside the RoomMemberEvent already passed to it, and Room::setLocalAliases() had a bug in the initial version where the function still tried to pass aliases in an event with an empty state key. This commit fixes this shortcoming: StateEventBase now gets stateKey as one more parameter, Room::Private::getCurrentState() respects stateKey and returns properly constructed stub events, and Room::setMemberState() gives way to a more generic Room::setState() that works uniformly with whatever state event you pass to it.
2019-07-06loadStateEvent()Kitsune Ral
2019-07-06Convenience: StateKeyKey, StateKeyKeyL, basicStateEventJson()Kitsune Ral
2019-07-06Fix clazy warningsKitsune Ral
2019-07-06Room::setLocalAliases: now actually working (with a caveat)Kitsune Ral
The caveat is that the library doesn't support .well-known yet, therefore will work not fully correctly (in particular - won't correctly set aliases) with servers that have serverpart different from the homeserver hostname used to connect to it.
2019-07-06Connection::serverPart: replace auto with QString because of QStringBuilderKitsune Ral
See https://github.com/KDE/clazy/blob/master/docs/checks/README-auto-unexpected-qstringbuilder.md Closes #613.
2019-07-04Connection::token() is no moreKitsune Ral
Use Connection::accessToken() instead.
2019-07-03Room/Connection: make room aliases work properlyKitsune Ral
Closes #301.
2019-07-02linkifyUrls: support matrix: scheme and relative URLsKitsune Ral
2019-07-01Merge branch 'master' into forget-rooms-reallyKitsune Ral
2019-07-01Handle M_UNKNOWN as The Spec says; factor out BaseJob::parseError()Kitsune Ral
2019-06-25Merge pull request #322 from a-andreyev/aa13q-fancy-colorsKitsune Ral
Move out the logic of the hue calculation to utils
2019-06-11Comment change as requestedVille Ranki
Co-Authored-By: Kitsune Ral <Kitsune-Ral@users.sf.net>
2019-06-11Remove unnecessary error checks in lib/connection.cppVille Ranki
Co-Authored-By: Kitsune Ral <Kitsune-Ral@users.sf.net>
2019-06-07Generated files in csapi/: switch from now-deprecated JsonParserError to ↵Kitsune Ral
IncorrectResponse
2019-06-07*.cpp.mustache: switch from now-deprecated JsonParseError to IncorrectResponseKitsune Ral
2019-06-07BaseJob::StatusCode: add Error-less synonyms; officially deprecate ↵Kitsune Ral
JsonParseError
2019-06-02lib/room.*: Spelling fixes in commentsKitsune Ral
[ci skip]
2019-05-31Ignore some errors on leaving rooms, add new error enum. Fixes #307Ville Ranki
2019-05-23Move out the logic of the hue calculation to utilsAlexey Andreyev
2019-05-20Connection: Fix a race condition in direct chats handling upon initial syncKitsune Ral
Closes #323.
2019-05-19Improve wording in a commentKitsune Ral
2019-05-19Connection: use QScopedPointer instead of unique_ptrKitsune Ral
While theoretically less robust (no equivalent of make_unique), QScopedPointer is navigable in Qt Creator debug views, unlike unique_ptr. Of course this will eventually be fixed; but given that inability to create an owning pointer object means sure abnormal termination of our code shortly afterwards, having make_unique in this particular case doesn't help in any way at all; so unique_ptr has zero advantages over QScopedPointer in this setting.
2019-05-19Move a doc-comment to its placeKitsune Ral
2019-05-18Connection::onSyncSuccess(): fix using after move()Kitsune Ral
Also rewrite the account data piece with visit().
2019-05-18event.h: add doc-comments; deprecate ptrCast()Kitsune Ral
2019-05-17Drop unneeded #includeKitsune Ral
2019-05-17Minor code refactoringKitsune Ral
2019-05-14User::Private::makeHueF: Fix trying to use the moved valueKitsune Ral
2019-05-14Merge pull request #298 from a-andreyev/aa13q-fancy-colorsKitsune Ral
Provide a colour code for the user
2019-05-14Provide a colour code for the userAlexey Andreyev
Contributes to #296
2019-05-13sanitized(): add object replacement character (0xfffc) to the blacklistKitsune Ral
2019-05-13linkifyUrls(): be more conservative in parsing serverpartsKitsune Ral
Closes #321.
2019-05-13prettyPrint(): First linkify, than add more tagsKitsune Ral
Otherwise the linkification gets confused by HTML tags being already there and doesn't linkify what has to be linkified if that occurs at the beginning of the message.
2019-05-04Room::allHistoryLoadedKitsune Ral
2019-05-03Connection::stateCacheDirKitsune Ral
Same as stateCachePath but returns QDir.
2019-04-24Make ignore-user related method Q_INVOKABLE.Black Hat
2019-04-24Connection::logout: ignore ContentAccessErrorKitsune Ral
Closes #316.
2019-04-24BaseJob: preserve the calculated error code if JSON error code is unknownKitsune Ral
Resetting the code to IncorrectRequestError has been a part of the cause for the incorrect Quaternion behaviour on expired tokens.
2019-04-24BaseJob: fix a possible crash upon logoutKitsune Ral
See https://github.com/QMatrixClient/Quaternion/issues/566 for details.
2019-04-06Room::processStateEvent: be more careful with signals handling at user renamesKitsune Ral
2019-04-06Clean up on clang-tidy/clazy analysisKitsune Ral
2019-04-03Room::postFile: initiate uploading the file even before adding a pending eventKitsune Ral
This is to make sure a pending event with file transfer already placed.
2019-04-03room.h: more doc-commentsKitsune Ral
2019-03-31Room: track invited users; polish the room naming algorithmKitsune Ral
It's no more entirely along the spec lines but gives better results with or without lazy-loading, across a wide range of cases. Closes #310.
2019-03-31Room::updateData(): recalculate room name only when state changes occurKitsune Ral
2019-03-31Room::refreshDisplayName() - for debugging purposes onlyKitsune Ral
Clients should not need to call this method explicitly.
2019-03-31User::nameForRoom(): null hint is not a hintKitsune Ral
This caused the library to erroneously believe that users with no representation in other rooms have no display name even if that display name is provided for the given room.
2019-03-30Connection: make sure to mark rooms supposed to be direct chats as suchKitsune Ral
Closes #305. Relies on correct tracking of Invite membership from the previous commit.
2019-03-30Room::processStateEvent, User: take the previous membership state from ↵Kitsune Ral
oldStateEvent memberJoinState() just happens to return the not-yet-updated state, making its use around state changes very sensitive to moving things around. The event's own prevContent is unsigned, therefore untrusted.