-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into tobias/cross-signing
- Loading branch information
Showing
43 changed files
with
1,105 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/****************************************************************************** | ||
* THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <Quotient/converters.h> | ||
|
||
namespace Quotient { | ||
/// The key data | ||
struct KeyBackupData { | ||
/// The index of the first message in the session that the key can decrypt. | ||
int firstMessageIndex; | ||
|
||
/// The number of times this key has been forwarded via key-sharing between | ||
/// devices. | ||
int forwardedCount; | ||
|
||
/// Whether the device backing up the key verified the device that the key | ||
/// is from. | ||
bool isVerified; | ||
|
||
/// Algorithm-dependent data. See the documentation for the backup | ||
/// algorithms in [Server-side key | ||
/// backups](/client-server-api/#server-side-key-backups) for more | ||
/// information on the expected format of the data. | ||
QJsonObject sessionData; | ||
}; | ||
|
||
template <> | ||
struct JsonObjectConverter<KeyBackupData> { | ||
static void dumpTo(QJsonObject& jo, const KeyBackupData& pod) | ||
{ | ||
addParam<>(jo, QStringLiteral("first_message_index"), | ||
pod.firstMessageIndex); | ||
addParam<>(jo, QStringLiteral("forwarded_count"), pod.forwardedCount); | ||
addParam<>(jo, QStringLiteral("is_verified"), pod.isVerified); | ||
addParam<>(jo, QStringLiteral("session_data"), pod.sessionData); | ||
} | ||
static void fillFrom(const QJsonObject& jo, KeyBackupData& pod) | ||
{ | ||
fillFromJson(jo.value("first_message_index"_ls), pod.firstMessageIndex); | ||
fillFromJson(jo.value("forwarded_count"_ls), pod.forwardedCount); | ||
fillFromJson(jo.value("is_verified"_ls), pod.isVerified); | ||
fillFromJson(jo.value("session_data"_ls), pod.sessionData); | ||
} | ||
}; | ||
|
||
} // namespace Quotient |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/****************************************************************************** | ||
* THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <Quotient/csapi/definitions/key_backup_data.h> | ||
|
||
#include <Quotient/converters.h> | ||
|
||
namespace Quotient { | ||
/// The backed up keys for a room. | ||
struct RoomKeyBackup { | ||
/// A map of session IDs to key data. | ||
QHash<QString, KeyBackupData> sessions; | ||
}; | ||
|
||
template <> | ||
struct JsonObjectConverter<RoomKeyBackup> { | ||
static void dumpTo(QJsonObject& jo, const RoomKeyBackup& pod) | ||
{ | ||
addParam<>(jo, QStringLiteral("sessions"), pod.sessions); | ||
} | ||
static void fillFrom(const QJsonObject& jo, RoomKeyBackup& pod) | ||
{ | ||
fillFromJson(jo.value("sessions"_ls), pod.sessions); | ||
} | ||
}; | ||
|
||
} // namespace Quotient |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.