aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-12-01More test but still failing in signing/signature verificationCarl Schwan
2021-12-01Add more test and use macro to remove duplicated codeCarl Schwan
2021-12-01Key verificationCarl Schwan
2021-12-01More testsCarl Schwan
2021-12-01More porting to new APICarl Schwan
2021-12-01Fix testCarl Schwan
2021-12-01E2EE: initial port to internal olm wrapperAlexey Andreyev
Remove qtolm git module. Update CMakeLists.txt. Rename olm to crypto subdir to prevent disambiguation. Rename internal files accordingly. Comment out not ported E2EE API usage.
2021-12-01Remove duplicated fileCarl Schwan
2021-12-01Move filesCarl Schwan
2021-12-01Add encrypted file structCarl Schwan
2021-12-01Fix CICarl Schwan
2021-12-01Add device key testCarl Schwan
2021-12-01Disable olm test when disabling encryptionCarl Schwan
2021-12-01Implement session sortingCarl Schwan
2021-12-01Add QOlmSession::decryptCarl Schwan
2021-12-01Add more test and methods in session handlingCarl Schwan
2021-12-01Add first session test and it fails :(Carl Schwan
2021-12-01Start adding test for session stuffCarl Schwan
2021-12-01Add hehlper functionsCarl Schwan
2021-12-01Add missing reinterpret_cast for session dataAlexey Andreyev
2021-12-01E2EE: Introduce session (WiP)Alexey Andreyev
2021-12-01Improve APICarl Schwan
2021-12-01Add group session decrypt/encrypt test and fix bug found by itCarl Schwan
2021-12-01Depends on OpenSSL for crypo randCarl Schwan
2021-12-01Update testCarl Schwan
2021-12-01Make it workCarl Schwan
2021-12-01Fix documentation typosCarl Schwan
Co-authored-by: Tobias Fella <9750016+TobiasFella@users.noreply.github.com>
2021-12-01ifdef everythingCarl Schwan
2021-12-01Implement outboundsessionCarl Schwan
2021-12-01Implement InboundsessionCarl Schwan
2021-12-01Start inboundsession wrapperCarl Schwan
2021-12-01Add destructorCarl Schwan
2021-12-01Add testsCarl Schwan
2021-12-01Start implementing Qt olm bindingCarl Schwan
2021-11-28Simplify converters.*Alexey Rusakov
There was a lot of excess redirection in fromJson() and toJson() with most of JsonConverter<> specialisations being unnecessary boilerplate. These have been replaced by overloads for toJson() and explicit specialisations for fromJson() wherever possible without breaking the conversion logic.
2021-11-28CMakeLists: drop obsolete -W from the warnings listAlexey Rusakov
Turns out it's been deprecated by -Wextra since before Quotient existed.
2021-11-28Comment on const return types in event.hAlexey Rusakov
Proper linters recognise that the returned types are not primitive, while people might still be confused a bit.
2021-11-28Don't std::move when the callee doesn't support itAlexey Rusakov
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.
2021-11-28One more small thing to actually fix CI breakageAlexey Rusakov
It's might look weird; but without making fromJson() a specialisation it becomes an overload next to an implicit specialisation of the template function defined just above, and then loses to that specialisation because it (also) has the perfect match. (would be great if the compiler shaded the implicit specialisation in such cases - alas it's not how the standard works.)
2021-11-28Fix CI breakage caused by the previous commitAlexey Rusakov
2021-11-28Event::unsignedPart()Alexey Rusakov
Similar to contentPart() - apparently there are enough places across the code that would benefit from it.
2021-11-27basicEventJson(): dismiss with the templateAlexey Rusakov
Given that QJsonObject only accepts QStrings in the list constructor, the template is useless cruft.
2021-11-27Code cleanupAlexey Rusakov
2021-11-27Event::content() -> contentPart()Alexey Rusakov
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 }
2021-11-27Add SonarCloud analysis to CIAlexey Rusakov
2021-11-27Delete ISSUE_TEMPLATE.mdAlexey Rusakov
New issue templates reside under .github/
2021-11-27Add issue templatesAlexey Rusakov
2021-11-27Merge pull request #518 from Smittyvb/room-stateEventsAlexey Rusakov
2021-11-26Add Room::{stateEventsOfType,currentState}Smitty
This is useful for implementing Spaces support, where all events of type `m.space.child` are needed, and we don't know their state keys in advance.
2021-11-26Fix crashing on invalid member and encryption eventsAlexey Rusakov
The problem is in Room::processStateEvent(): after potentially-inserting-nullptr into currentState, pre-check failure (that may occur on member and trigger events for now) leaves that nullptr in the hash map. Basically anything that uses currentState (e.g., Room::toJson) assumes that currentState has no nullptrs - which leads to either an assertion failure, or nullptr dereferencing. The fix removes the nullptr placeholder if the pre-checks failed.
ss="o">% stateKey); } static const auto GetRoomStateWithKeyJobName = QStringLiteral("GetRoomStateWithKeyJob"); GetRoomStateWithKeyJob::GetRoomStateWithKeyJob(const QString& roomId, const QString& eventType, const QString& stateKey) : BaseJob(HttpVerb::Get, GetRoomStateWithKeyJobName, basePath % "/rooms/" % roomId % "/state/" % eventType % "/" % stateKey) {} QUrl GetRoomStateByTypeJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& eventType) { return BaseJob::makeRequestUrl(std::move(baseUrl), basePath % "/rooms/" % roomId % "/state/" % eventType); } static const auto GetRoomStateByTypeJobName = QStringLiteral("GetRoomStateByTypeJob"); GetRoomStateByTypeJob::GetRoomStateByTypeJob(const QString& roomId, const QString& eventType) : BaseJob(HttpVerb::Get, GetRoomStateByTypeJobName, basePath % "/rooms/" % roomId % "/state/" % eventType) {} class GetRoomStateJob::Private { public: StateEvents data; }; QUrl GetRoomStateJob::makeRequestUrl(QUrl baseUrl, const QString& roomId) { return BaseJob::makeRequestUrl(std::move(baseUrl), basePath % "/rooms/" % roomId % "/state"); } static const auto GetRoomStateJobName = QStringLiteral("GetRoomStateJob"); GetRoomStateJob::GetRoomStateJob(const QString& roomId) : BaseJob(HttpVerb::Get, GetRoomStateJobName, basePath % "/rooms/" % roomId % "/state") , d(new Private) {} GetRoomStateJob::~GetRoomStateJob() = default; StateEvents&& GetRoomStateJob::data() { return std::move(d->data); } BaseJob::Status GetRoomStateJob::parseJson(const QJsonDocument& data) { fromJson(data, d->data); return Success; } class GetMembersByRoomJob::Private { public: EventsArray<RoomMemberEvent> chunk; }; BaseJob::Query queryToGetMembersByRoom(const QString& at, const QString& membership, const QString& notMembership) { BaseJob::Query _q; addParam<IfNotEmpty>(_q, QStringLiteral("at"), at); addParam<IfNotEmpty>(_q, QStringLiteral("membership"), membership); addParam<IfNotEmpty>(_q, QStringLiteral("not_membership"), notMembership); return _q; } QUrl GetMembersByRoomJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& at, const QString& membership, const QString& notMembership) { return BaseJob::makeRequestUrl( std::move(baseUrl), basePath % "/rooms/" % roomId % "/members", queryToGetMembersByRoom(at, membership, notMembership)); } static const auto GetMembersByRoomJobName = QStringLiteral("GetMembersByRoomJob"); GetMembersByRoomJob::GetMembersByRoomJob(const QString& roomId, const QString& at, const QString& membership, const QString& notMembership) : BaseJob(HttpVerb::Get, GetMembersByRoomJobName, basePath % "/rooms/" % roomId % "/members", queryToGetMembersByRoom(at, membership, notMembership)) , d(new Private) {} GetMembersByRoomJob::~GetMembersByRoomJob() = default; EventsArray<RoomMemberEvent>&& GetMembersByRoomJob::chunk() { return std::move(d->chunk); } BaseJob::Status GetMembersByRoomJob::parseJson(const QJsonDocument& data) { auto json = data.object(); fromJson(json.value("chunk"_ls), d->chunk); return Success; } // Converters namespace Quotient { template <> struct JsonObjectConverter<GetJoinedMembersByRoomJob::RoomMember> { static void fillFrom(const QJsonObject& jo, GetJoinedMembersByRoomJob::RoomMember& result) { fromJson(jo.value("display_name"_ls), result.displayName); fromJson(jo.value("avatar_url"_ls), result.avatarUrl); } }; } // namespace Quotient class GetJoinedMembersByRoomJob::Private { public: QHash<QString, RoomMember> joined; }; QUrl GetJoinedMembersByRoomJob::makeRequestUrl(QUrl baseUrl, const QString& roomId) { return BaseJob::makeRequestUrl( std::move(baseUrl), basePath % "/rooms/" % roomId % "/joined_members"); } static const auto GetJoinedMembersByRoomJobName = QStringLiteral("GetJoinedMembersByRoomJob"); GetJoinedMembersByRoomJob::GetJoinedMembersByRoomJob(const QString& roomId) : BaseJob(HttpVerb::Get, GetJoinedMembersByRoomJobName, basePath % "/rooms/" % roomId % "/joined_members") , d(new Private) {} GetJoinedMembersByRoomJob::~GetJoinedMembersByRoomJob() = default; const QHash<QString, GetJoinedMembersByRoomJob::RoomMember>& GetJoinedMembersByRoomJob::joined() const { return d->joined; } BaseJob::Status GetJoinedMembersByRoomJob::parseJson(const QJsonDocument& data) { auto json = data.object(); fromJson(json.value("joined"_ls), d->joined); return Success; }