aboutsummaryrefslogtreecommitdiff
path: root/lib/syncdata.h
AgeCommit message (Collapse)Author
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.
2021-12-29Add QUOTIENT_API throughout non-generated codeAlexey Rusakov
This include all (hopefully) classes/structures and functions that have non-inline definitions, as well as namespaces with Q_NAMESPACE since those have non-inline (as of Qt 5.15) QMetaObject - for that a new macro, QUO_NAMESPACE, has been devised to accommodate the lack of Q_NAMESPACE_EXPORT in Qt before 5.14.
2021-12-01Start implementing device key trackingTobias Fella
2021-11-21SyncData: support MSC2654; partiallyReadCountAlexey Rusakov
Since MSC2654's unread count is counted from the m.read receipt, and the course is to follow the spec's terminology and use "unread count" for the number of notable events since m.read, this required to move the existing number of notable events since m.fully_read to another field, henceforth called partiallyReadCount. At the same time, SyncData::notificationCount is dropped completely since MSC2654 claims to supersede it. Also: Room::resetNotificationCount() and Room::resetHighlightCount() are deprecated, as these never worked properly overwriting values that can be calculated or sourced from the server, only for these values to be set back again the next time the room is updated from /sync.
2021-07-28SyncData: minor update to the cache versionAlexey Rusakov
The minor component is now updated in .cpp, not in .h.
2021-07-24Wrap SyncRoomData counters into OmittablesAlexey Rusakov
Also: introduce a merge(T1&, const Omittable<T2>&) that does pretty much the same as Omittable<T1>::merge(const Omittable<T2>&) except it works on non-omittables as the left/first operand. The change removes the need for a clumsy -2 fallback in unreadCount, and makes the logic loading those counters cleaner along the way.
2021-07-18MembershipType -> Membership, also used for JoinStateAlexey Rusakov
Instead of being defined independently, JoinState now uses values from the Membership enumeration (former MemberEventContent::MembershipType) that was moved to quotient_common.h for that purpose. Both enumerations gained a Q_FLAG_NS decoration and operator<< overrides that strip "Quotient::" prefix when dumping member/join state values to the log - obviating toCString(JoinState) along the way. Quotient::MembershipType alias is deprecated from now.
2021-01-16Updated copyright statements upon Git auditKitsune Ral
After going through all the files and the history of commits on them it was clear that some copyright statements are obsolete (the code has been overwritten since) and some are missing. This commit tries best to remedy that, along with adding SPDX tags where they were still not used. Also, a minimal SPDX convention is documented for further contributions. Closes #426.
2020-12-26Port existing copyright statement to reuse using licensediggerCarl Schwan
2020-06-10syncdata.h: fix an old warning about operator<<Kitsune Ral
The warning has been that it is declared as a friend but not exactly in namespace Quotient (though all compilers still could find and link it but only as long as it is defined in the namespace). Now instead of being declared as a friend it's just declared in the namespace :)
2020-06-05Use CBOR for binary JSON caching on Qt 5.15+Kitsune Ral
Qt 5.15 deprecates binary JSON format in favour of CBOR now used as a backend for its JSON classes.
2020-05-31Move around and format codeKitsune Ral
No functional changes here.
2020-02-25E2EE: implement SyncData::deviceOneTimeKeysCountAlexey Andreyev
Signed-off-by: Alexey Andreev <aa13q@ya.ru>
2019-08-09Namespace: QMatrixClient -> Quotient (with back comp alias)Kitsune Ral
2019-08-02Apply the new brace wrapping to source filesKitsune Ral
2019-07-09Merge branch 'master' into use-clang-formatKitsune Ral
2019-06-24Merge branch 'master' into clang-formatKitsune Ral
# Conflicts: # CMakeLists.txt # lib/avatar.cpp # lib/connection.cpp # lib/connection.h # lib/connectiondata.cpp # lib/csapi/account-data.cpp # lib/csapi/account-data.h # lib/csapi/capabilities.cpp # lib/csapi/capabilities.h # lib/csapi/content-repo.cpp # lib/csapi/create_room.cpp # lib/csapi/filter.cpp # lib/csapi/joining.cpp # lib/csapi/keys.cpp # lib/csapi/list_joined_rooms.cpp # lib/csapi/notifications.cpp # lib/csapi/openid.cpp # lib/csapi/presence.cpp # lib/csapi/pushrules.cpp # lib/csapi/registration.cpp # lib/csapi/room_upgrades.cpp # lib/csapi/room_upgrades.h # lib/csapi/search.cpp # lib/csapi/users.cpp # lib/csapi/versions.cpp # lib/csapi/whoami.cpp # lib/csapi/{{base}}.cpp.mustache # lib/events/accountdataevents.h # lib/events/eventcontent.h # lib/events/roommemberevent.cpp # lib/events/stateevent.cpp # lib/jobs/basejob.cpp # lib/jobs/basejob.h # lib/networkaccessmanager.cpp # lib/networksettings.cpp # lib/room.cpp # lib/room.h # lib/settings.cpp # lib/settings.h # lib/syncdata.cpp # lib/user.cpp # lib/user.h # lib/util.cpp
2019-03-02style: apply .clang-format to all .cpp and .h filesMarc Deop
2018-12-13Bump room state cache version to reset the cacheKitsune Ral
2018-12-09MSC 688: MSC-compliant RoomSummary; update Room::calculateDisplayname()Kitsune Ral
The members of the summary can be omitted in the payload; this change fixes calculation of the roomname from hero names passed in room summary. Also: RoomSummary can be dumped to QDebug now.
2018-12-08Room summariesKitsune Ral
2018-11-22Save state cache per-roomKitsune Ral
Closes #257.
2018-11-20Make SyncData more self-contained and prepare for cache splittingKitsune Ral
SyncData now resides in its own pair of files and is capable to load either from file or from JSON. There is also (yet untested) capability to load rooms from files if a file name stands is the value for a given room id. This allows to store the master cache file separately from cache files for each room, massively easing the problem of bulky accounts that can overflow the poor capacity of Qt's JSON engine.