aboutsummaryrefslogtreecommitdiff
path: root/lib/connection.cpp
AgeCommit message (Collapse)Author
2022-02-24Fix all testsTobias Fella
2022-02-16More cleanup, especially in EncryptedFileAlexey Rusakov
For EncryptedFile: - JSON converter bodies moved away to .cpp; - instead of C-style casts, reinterpret_cast is used to convert from (const) char* to (const) unsigned char*; - the size for the target plain text takes into account the case where the cipher block size can be larger than 1 (after reading https://www.openssl.org/docs/man1.1.1/man3/EVP_DecryptUpdate.html). - file decryption is wrapped in #ifdef Quotient_E2EE_ENABLED, to avoid OpenSSL linking errors when compiling without E2EE.
2022-02-16isSupportedAlgorithm()Alexey Rusakov
That's a better primitive than just exposing SupportedAlgorithms list.
2022-02-16Connection: guard device loading per-objectAlexey Rusakov
Using a static variable is incorrect as it doesn't load the device list for any subsequent created Connection object.
2022-02-16CleanupAlexey Rusakov
A note on switching to QLatin1String for JSON key constants - this is more concise and barely affects (if at all) runtime performance (padding each QChar with zeros is trivial for assignment; and comparison can be done directly with the same performance as for two QStrings).
2022-02-13Merge branch 'dev'Alexey Rusakov
The result is FTBFS as yet; next commits will fix that, along with a few other things.
2022-02-12Replace QPair with std::pairTobias Fella
2022-02-11Implement more suggestionsTobias Fella
2022-02-09Fix compilation without E2EETobias Fella
2022-02-07Remove encryptionmanager and various fixesTobias Fella
2022-02-06Only create one databaseTobias Fella
2022-01-30Port devices list to databaseTobias Fella
2022-01-30Use room() instead of provideRoom()Tobias Fella
2022-01-18AccountRegistry: derive from QVector and clean upAlexey Rusakov
Notably, Quotient::AccountRegistry::instance() is now deprecated in favour of Quotient::Accounts inline variable.
2022-01-02Add ImplPtr and makeImplAlexey Rusakov
The original (more complex and comprehensive) solution belongs to https://oliora.github.io/2015/12/29/pimpl-and-rule-of-zero.html - this commit only provides a small wrapper for non-copyable Private class implementations common throughout libQuotient. Unlike the original, default initialisation is made explicit - you have to pass ZeroImpl<Private>() instead (and I firmly believe it's a good thing: normally pointers to Private should not remain nullptr). The reason ZeroImpl<> is not a template variable is quite simple: unique_ptr is non-copyable and so cannot be initialised from; while a template function will initialise the value in-place thanks to copy elision.
2021-12-27Connection: Simplify room/user factory codeAlexey Rusakov
There's no need to return lambdas where pointers to specialised function templates would work just fine.
2021-12-25Apply suggestions from code reviewTobias Fella
Co-authored-by: Alexey Rusakov <Kitsune-Ral@users.sf.net>
2021-12-25Don't save olm account ón shutdownTobias Fella
It causes the program to crash for some reason
2021-12-24Cache deviceslist to binary when possibleTobias Fella
2021-12-10Use individual databases for each connectionTobias Fella
2021-12-10ifdef more thingsTobias Fella
2021-12-09Ifdef all the thingsTobias Fella
2021-12-09Update lib/connection.cppTobias Fella
Co-authored-by: Alexey Rusakov <Kitsune-Ral@users.sf.net>
2021-12-07Rename "crypto" -> "e2ee"Tobias Fella
2021-12-07Port E2EE to database instead of JSON filesTobias Fella
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-12-01Apply suggestions from code reviewTobias Fella
Co-authored-by: Alexey Rusakov <Kitsune-Ral@users.sf.net>
2021-12-01More improvementsTobias Fella
2021-12-01Apply suggestions from code reviewTobias Fella
Co-authored-by: Alexey Rusakov <Kitsune-Ral@users.sf.net>
2021-12-01Fix compilationCarl Schwan
2021-12-01Add function to decrypt notificationsTobias Fella
2021-12-01Move non-cache data to a non-cache locationTobias Fella
2021-12-01Save olm account on shutdownTobias Fella
2021-12-01Various improvements and fixesTobias Fella
2021-12-01Add mxc protocol to the networkaccessmanagerTobias Fella
2021-12-01Implement download and decryption of encrypted filesTobias Fella
2021-12-01Store pickling key in qtkeychain and pickle encryptedTobias Fella
2021-12-01Various fixesTobias Fella
2021-12-01Don't crash when ToDeviceEvent decryption failsTobias Fella
2021-12-01Implement (meg)olm key caching, megolm decrypting, EncryptedEventTobias Fella
decryption, handling of encrypted redactions and replies
2021-12-01Fix build without E2EETobias Fella
2021-12-01Emit needsSave when requiredTobias Fella
2021-12-01Remove unrelated changesTobias Fella
2021-12-01Update the OlmAccountPickle in the accountsettings when the olmaccountTobias Fella
changes
2021-12-01Uncomment some stuffCarl Schwan
2021-12-01ThingsTobias Fella
2021-12-01Cleanup and Refactor EncryptionManagerTobias Fella
2021-12-01Fix compilation without E2EETobias Fella
2021-12-01More fixesTobias Fella
2021-12-01Query for keys less and actually load users from cacheTobias Fella