From 3890e5726db67886415ca19a1b0221508892a262 Mon Sep 17 00:00:00 2001 From: doylet Date: Thu, 31 Jul 2025 15:27:35 +1000 Subject: [PATCH 01/59] Add Session Pro master key derivation --- include/session/ed25519.h | 20 ++++++++++++++ include/session/ed25519.hpp | 16 +++++++++-- src/ed25519.cpp | 42 ++++++++++++++++++++++++++++ tests/test_ed25519.cpp | 55 +++++++++++++++++++++++++++++++++++++ 4 files changed, 131 insertions(+), 2 deletions(-) diff --git a/include/session/ed25519.h b/include/session/ed25519.h index 82abd521..932dc2e2 100644 --- a/include/session/ed25519.h +++ b/include/session/ed25519.h @@ -95,6 +95,26 @@ LIBSESSION_EXPORT bool session_ed25519_verify( const unsigned char* msg, size_t msg_len); +/// API: crypto/session_ed25519_pro_key_pair_for_ed25519_seed +/// +/// Generate the deterministic Master Session Pro key for signing requests to interact with the +/// Session Pro features of the protocol. +/// +/// Inputs: +/// - `ed25519_seed` -- [in] the seed to the long-term key for the Session account to derive the +/// deterministic key from. +/// - `ed25519_pk_out` -- [out] pointer to a buffer of 32 bytes where the public key will be +/// written. +/// - `ed25519_sk_out` -- [out] pointer to a buffer of 64 bytes where the private key will be +/// written. +/// +/// Outputs: +/// - `bool` -- True if the key pair was successfully derived, false if failed. +LIBSESSION_EXPORT bool session_ed25519_pro_key_pair_for_ed25519_seed( + const unsigned char* ed25519_seed, /* 32 bytes */ + unsigned char *ed25519_pk_out, /*32 byte output buffer*/ + unsigned char *ed25519_sk_out /*64 byte output buffer*/); + #ifdef __cplusplus } #endif diff --git a/include/session/ed25519.hpp b/include/session/ed25519.hpp index 264b2000..d4e599db 100644 --- a/include/session/ed25519.hpp +++ b/include/session/ed25519.hpp @@ -4,8 +4,6 @@ #include #include -#include "types.hpp" - namespace session::ed25519 { /// Generates a random Ed25519 key pair @@ -58,4 +56,18 @@ bool verify( std::span pubkey, std::span msg); +/// API: ed25519/ed25519_pro_key_pair_for_ed25519_seed +/// +/// Generate the deterministic Master Session Pro key for signing requests to interact with the +/// Session Pro features of the protocol. +/// +/// Inputs: +/// - `ed25519_seed` -- the seed to the long-term key for the Session account to derive the +/// deterministic key from. +/// +/// Outputs: +/// - The Master Session Pro ed25519 key +std::pair, std::array> +ed25519_pro_key_pair_for_ed25519_seed(std::span ed25519_seed); + } // namespace session::ed25519 diff --git a/src/ed25519.cpp b/src/ed25519.cpp index 0cde00e3..3ed15be5 100644 --- a/src/ed25519.cpp +++ b/src/ed25519.cpp @@ -1,5 +1,6 @@ #include "session/ed25519.hpp" +#include #include #include @@ -14,6 +15,8 @@ template using cleared_array = sodium_cleared>; using uc32 = std::array; +using uc64 = std::array; +using cleared_uc32 = cleared_array<32>; using cleared_uc64 = cleared_array<64>; std::pair, std::array> ed25519_key_pair() { @@ -86,6 +89,29 @@ bool verify( crypto_sign_ed25519_verify_detached(sig.data(), msg.data(), msg.size(), pubkey.data())); } +std::pair, std::array> +ed25519_pro_key_pair_for_ed25519_seed(std::span ed25519_seed) { + if (ed25519_seed.size() != 32) + throw std::invalid_argument{"Invalid ed25519_seed: expected 32 bytes"}; + + // Construct master key + // s2 = Blake2b32(s, key="SessionProRandom") + // b/B = Ed25519FromSeed(s2) + constexpr std::string_view BLAKE2B_KEY = "SessionProRandom"; + uc32 s2 = {}; + int hash_result = crypto_generichash_blake2b( + s2.data(), + s2.size(), + ed25519_seed.data(), + ed25519_seed.size(), + reinterpret_cast(BLAKE2B_KEY.data()), + BLAKE2B_KEY.size()); + assert(hash_result == 0); // This function can't return 0 unless misused + + std::pair result = ed25519_key_pair(s2); + return result; +} + } // namespace session::ed25519 using namespace session; @@ -157,3 +183,19 @@ LIBSESSION_C_API bool session_ed25519_verify( std::span{pubkey, 32}, std::span{msg, msg_len}); } + +LIBSESSION_C_API bool session_ed25519_pro_key_pair_for_ed25519_seed( + const unsigned char* ed25519_seed, + unsigned char* ed25519_pk_out, + unsigned char* ed25519_sk_out) { + try { + auto seed = std::span(ed25519_seed, 32); + auto result = session::ed25519::ed25519_pro_key_pair_for_ed25519_seed(seed); + auto [ed_pk, ed_sk] = result; + std::memcpy(ed25519_pk_out, ed_pk.data(), ed_pk.size()); + std::memcpy(ed25519_sk_out, ed_sk.data(), ed_sk.size()); + return true; + } catch (...) { + return false; + } +} diff --git a/tests/test_ed25519.cpp b/tests/test_ed25519.cpp index fa715b27..ad31097c 100644 --- a/tests/test_ed25519.cpp +++ b/tests/test_ed25519.cpp @@ -67,6 +67,61 @@ TEST_CASE("Ed25519 seed for private key", "[ed25519][seed]") { "5ea34e72bb044654a6a23675690ef5ffaaf1656b02f93fb76655f9cbdbe89876"); } +TEST_CASE("Ed25519 pro key pair generation seed", "[ed25519][keypair]") { + using namespace session; + + // Test vectors generated from Python + // + // clang-format off + // + // import nacl.bindings + // import hashlib + // import os + // + // seed0 = os.urandom(32) + // seed1 = hashlib.blake2b(seed0, key=b'SessionProRandom', digest_size=32).digest() + // (pkey, skey) = nacl.bindings.crypto_sign_seed_keypair(seed=seed0) + // (pro_pkey, pro_skey) = nacl.bindings.crypto_sign_seed_keypair(seed=seed1) + // + // print(f'Seed1: {seed1.hex()}') + // print(f'Pro: {bytes(pro_skey)[:32].hex()} / {bytes(pro_pkey).hex()}') + // + // Output + // + // Seed0: e5481635020d6f7b327e94e6d63e33a431fccabc4d2775845c43a8486a9f2884 + // Pro: a4ec87e2346b25ee6394211cb682640a09dd8d297016fe241fe5b06fefef416c / b6d20c075eddd2edb69d4d7da9b7e580f187ce0537585da2b5e454b77980d0c8 + // + // Seed0: 743d646706b6b04b97b752036dd6cf5f2adc4b339fcfdfb4b496f0764bb93a84 + // Pro: 7da256ba427cf5419cefea81f8ebb3395c261e4dfc2c91ee4d3ce9def67aa21c / 539d0a3be9658ebb6ba3ce97b25d4f6b716f7ef6d6ae6343bd0733519f5a51e8 + // + // clang-format on + + auto ed_seed1 = "e5481635020d6f7b327e94e6d63e33a431fccabc4d2775845c43a8486a9f2884"_hexbytes; + auto ed_seed2 = "743d646706b6b04b97b752036dd6cf5f2adc4b339fcfdfb4b496f0764bb93a84"_hexbytes; + auto ed_seed_invalid = "010203040506070809"_hexbytes; + + auto kp1 = session::ed25519::ed25519_pro_key_pair_for_ed25519_seed(to_span(ed_seed1)); + auto kp2 = session::ed25519::ed25519_pro_key_pair_for_ed25519_seed(to_span(ed_seed2)); + CHECK_THROWS(session::ed25519::ed25519_pro_key_pair_for_ed25519_seed(to_span(ed_seed_invalid))); + + CHECK(kp1.first.size() == 32); + CHECK(kp1.second.size() == 64); + CHECK(kp1.first != kp2.first); + CHECK(kp1.second != kp2.second); + CHECK(oxenc::to_hex(kp1.first) == "b6d20c075eddd2edb69d4d7da9b7e580f187ce0537585da2b5e454b77980d0c8"); + CHECK(oxenc::to_hex(kp2.first) == "539d0a3be9658ebb6ba3ce97b25d4f6b716f7ef6d6ae6343bd0733519f5a51e8"); + + auto kp_sk1 = + "a4ec87e2346b25ee6394211cb682640a09dd8d297016fe241fe5b06fefef416c" + "b6d20c075eddd2edb69d4d7da9b7e580f187ce0537585da2b5e454b77980d0c8"; + auto kp_sk2 = + "7da256ba427cf5419cefea81f8ebb3395c261e4dfc2c91ee4d3ce9def67aa21c" + "539d0a3be9658ebb6ba3ce97b25d4f6b716f7ef6d6ae6343bd0733519f5a51e8"; + + CHECK(oxenc::to_hex(kp1.second) == kp_sk1); + CHECK(oxenc::to_hex(kp2.second) == kp_sk2); +} + TEST_CASE("Ed25519", "[ed25519][signature]") { using namespace session; From 558232970916a441d3fa8e5a2a4c391b99326302 Mon Sep 17 00:00:00 2001 From: doylet Date: Fri, 1 Aug 2025 11:17:52 +1000 Subject: [PATCH 02/59] Only give 64b skey from session pro keygen This simplifies the API and minimises the API surface with code interacting with it since the public key is already bundled with the secret. - Add helper function to derive keys from the original seed - Use _hex_u literals to simplify test construction code --- include/session/ed25519.h | 7 ++-- include/session/ed25519.hpp | 6 ++-- src/ed25519.cpp | 66 ++++++++++++++++++++----------------- tests/test_ed25519.cpp | 26 +++++++-------- 4 files changed, 51 insertions(+), 54 deletions(-) diff --git a/include/session/ed25519.h b/include/session/ed25519.h index 932dc2e2..9418154d 100644 --- a/include/session/ed25519.h +++ b/include/session/ed25519.h @@ -103,17 +103,14 @@ LIBSESSION_EXPORT bool session_ed25519_verify( /// Inputs: /// - `ed25519_seed` -- [in] the seed to the long-term key for the Session account to derive the /// deterministic key from. -/// - `ed25519_pk_out` -- [out] pointer to a buffer of 32 bytes where the public key will be -/// written. /// - `ed25519_sk_out` -- [out] pointer to a buffer of 64 bytes where the private key will be -/// written. +/// written. /// /// Outputs: /// - `bool` -- True if the key pair was successfully derived, false if failed. LIBSESSION_EXPORT bool session_ed25519_pro_key_pair_for_ed25519_seed( const unsigned char* ed25519_seed, /* 32 bytes */ - unsigned char *ed25519_pk_out, /*32 byte output buffer*/ - unsigned char *ed25519_sk_out /*64 byte output buffer*/); + unsigned char* ed25519_sk_out /*64 byte output buffer*/); #ifdef __cplusplus } diff --git a/include/session/ed25519.hpp b/include/session/ed25519.hpp index d4e599db..d4a7b892 100644 --- a/include/session/ed25519.hpp +++ b/include/session/ed25519.hpp @@ -66,8 +66,8 @@ bool verify( /// deterministic key from. /// /// Outputs: -/// - The Master Session Pro ed25519 key -std::pair, std::array> -ed25519_pro_key_pair_for_ed25519_seed(std::span ed25519_seed); +/// - The libsodium-style Master Session Pro Ed25519 secret key, 64 bytes. +std::array ed25519_pro_key_pair_for_ed25519_seed( + std::span ed25519_seed); } // namespace session::ed25519 diff --git a/src/ed25519.cpp b/src/ed25519.cpp index 3ed15be5..d537e39a 100644 --- a/src/ed25519.cpp +++ b/src/ed25519.cpp @@ -7,18 +7,44 @@ #include #include "session/export.h" -#include "session/sodium_array.hpp" -namespace session::ed25519 { +#include "session/sodium_array.hpp" template -using cleared_array = sodium_cleared>; +using cleared_array = session::sodium_cleared>; using uc32 = std::array; using uc64 = std::array; using cleared_uc32 = cleared_array<32>; using cleared_uc64 = cleared_array<64>; +namespace { +uc64 derived_ed25519_keypair( + std::span ed25519_seed, std::string_view key) { + if (ed25519_seed.size() != 32 && ed25519_seed.size() != 64) + throw std::invalid_argument{ + "Invalid ed25519_seed: expected 32 bytes or libsodium style 64 bytes seed"}; + + // Construct seed for derived key + // new_seed = Blake2b32(ed25519_seed, key=) + // b/B = Ed25519FromSeed(new_seed) + cleared_uc32 s2 = {}; + int hash_result = crypto_generichash_blake2b( + s2.data(), + s2.size(), + ed25519_seed.data(), + ed25519_seed.size(), + reinterpret_cast(key.data()), + key.size()); + assert(hash_result == 0); // This function can't return 0 unless misused + + auto [pubkey, privkey] = session::ed25519::ed25519_key_pair(s2); + return privkey; +} +} + +namespace session::ed25519 { + std::pair, std::array> ed25519_key_pair() { std::array ed_pk; std::array ed_sk; @@ -89,29 +115,11 @@ bool verify( crypto_sign_ed25519_verify_detached(sig.data(), msg.data(), msg.size(), pubkey.data())); } -std::pair, std::array> -ed25519_pro_key_pair_for_ed25519_seed(std::span ed25519_seed) { - if (ed25519_seed.size() != 32) - throw std::invalid_argument{"Invalid ed25519_seed: expected 32 bytes"}; - - // Construct master key - // s2 = Blake2b32(s, key="SessionProRandom") - // b/B = Ed25519FromSeed(s2) - constexpr std::string_view BLAKE2B_KEY = "SessionProRandom"; - uc32 s2 = {}; - int hash_result = crypto_generichash_blake2b( - s2.data(), - s2.size(), - ed25519_seed.data(), - ed25519_seed.size(), - reinterpret_cast(BLAKE2B_KEY.data()), - BLAKE2B_KEY.size()); - assert(hash_result == 0); // This function can't return 0 unless misused - - std::pair result = ed25519_key_pair(s2); +std::array ed25519_pro_key_pair_for_ed25519_seed( + std::span ed25519_seed) { + auto result = derived_ed25519_keypair(ed25519_seed, "SessionProRandom"); return result; } - } // namespace session::ed25519 using namespace session; @@ -185,15 +193,11 @@ LIBSESSION_C_API bool session_ed25519_verify( } LIBSESSION_C_API bool session_ed25519_pro_key_pair_for_ed25519_seed( - const unsigned char* ed25519_seed, - unsigned char* ed25519_pk_out, - unsigned char* ed25519_sk_out) { + const unsigned char* ed25519_seed, unsigned char* ed25519_sk_out) { try { auto seed = std::span(ed25519_seed, 32); - auto result = session::ed25519::ed25519_pro_key_pair_for_ed25519_seed(seed); - auto [ed_pk, ed_sk] = result; - std::memcpy(ed25519_pk_out, ed_pk.data(), ed_pk.size()); - std::memcpy(ed25519_sk_out, ed_sk.data(), ed_sk.size()); + uc64 sk = session::ed25519::ed25519_pro_key_pair_for_ed25519_seed(seed); + std::memcpy(ed25519_sk_out, sk.data(), sk.size()); return true; } catch (...) { return false; diff --git a/tests/test_ed25519.cpp b/tests/test_ed25519.cpp index ad31097c..4fcddddc 100644 --- a/tests/test_ed25519.cpp +++ b/tests/test_ed25519.cpp @@ -83,7 +83,7 @@ TEST_CASE("Ed25519 pro key pair generation seed", "[ed25519][keypair]") { // (pkey, skey) = nacl.bindings.crypto_sign_seed_keypair(seed=seed0) // (pro_pkey, pro_skey) = nacl.bindings.crypto_sign_seed_keypair(seed=seed1) // - // print(f'Seed1: {seed1.hex()}') + // print(f'Seed0: {seed0.hex()}') // print(f'Pro: {bytes(pro_skey)[:32].hex()} / {bytes(pro_pkey).hex()}') // // Output @@ -96,20 +96,16 @@ TEST_CASE("Ed25519 pro key pair generation seed", "[ed25519][keypair]") { // // clang-format on - auto ed_seed1 = "e5481635020d6f7b327e94e6d63e33a431fccabc4d2775845c43a8486a9f2884"_hexbytes; - auto ed_seed2 = "743d646706b6b04b97b752036dd6cf5f2adc4b339fcfdfb4b496f0764bb93a84"_hexbytes; - auto ed_seed_invalid = "010203040506070809"_hexbytes; + constexpr auto seed1 = "e5481635020d6f7b327e94e6d63e33a431fccabc4d2775845c43a8486a9f2884"_hex_u; + constexpr auto seed2 = "743d646706b6b04b97b752036dd6cf5f2adc4b339fcfdfb4b496f0764bb93a84"_hex_u; + constexpr auto seed_invalid = "010203040506070809"_hex_u; - auto kp1 = session::ed25519::ed25519_pro_key_pair_for_ed25519_seed(to_span(ed_seed1)); - auto kp2 = session::ed25519::ed25519_pro_key_pair_for_ed25519_seed(to_span(ed_seed2)); - CHECK_THROWS(session::ed25519::ed25519_pro_key_pair_for_ed25519_seed(to_span(ed_seed_invalid))); + auto sk1 = session::ed25519::ed25519_pro_key_pair_for_ed25519_seed(seed1); + auto sk2 = session::ed25519::ed25519_pro_key_pair_for_ed25519_seed(seed2); + CHECK_THROWS(session::ed25519::ed25519_pro_key_pair_for_ed25519_seed(seed_invalid)); - CHECK(kp1.first.size() == 32); - CHECK(kp1.second.size() == 64); - CHECK(kp1.first != kp2.first); - CHECK(kp1.second != kp2.second); - CHECK(oxenc::to_hex(kp1.first) == "b6d20c075eddd2edb69d4d7da9b7e580f187ce0537585da2b5e454b77980d0c8"); - CHECK(oxenc::to_hex(kp2.first) == "539d0a3be9658ebb6ba3ce97b25d4f6b716f7ef6d6ae6343bd0733519f5a51e8"); + CHECK(sk1.size() == 64); + CHECK(sk1 != sk2); auto kp_sk1 = "a4ec87e2346b25ee6394211cb682640a09dd8d297016fe241fe5b06fefef416c" @@ -118,8 +114,8 @@ TEST_CASE("Ed25519 pro key pair generation seed", "[ed25519][keypair]") { "7da256ba427cf5419cefea81f8ebb3395c261e4dfc2c91ee4d3ce9def67aa21c" "539d0a3be9658ebb6ba3ce97b25d4f6b716f7ef6d6ae6343bd0733519f5a51e8"; - CHECK(oxenc::to_hex(kp1.second) == kp_sk1); - CHECK(oxenc::to_hex(kp2.second) == kp_sk2); + CHECK(oxenc::to_hex(sk1) == kp_sk1); + CHECK(oxenc::to_hex(sk2) == kp_sk2); } TEST_CASE("Ed25519", "[ed25519][signature]") { From f241f8607411090d1e71d07a521c705119d6b8fe Mon Sep 17 00:00:00 2001 From: doylet Date: Fri, 1 Aug 2025 11:32:15 +1000 Subject: [PATCH 03/59] Apply _hex_u changes to rest of ed25519 tests --- tests/test_ed25519.cpp | 84 +++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 43 deletions(-) diff --git a/tests/test_ed25519.cpp b/tests/test_ed25519.cpp index 4fcddddc..eb5f4ec1 100644 --- a/tests/test_ed25519.cpp +++ b/tests/test_ed25519.cpp @@ -3,40 +3,36 @@ #include #include -#include "session/ed25519.h" #include "session/ed25519.hpp" -#include "utils.hpp" TEST_CASE("Ed25519 key pair generation", "[ed25519][keypair]") { // Generate two random key pairs and make sure they don't match - auto kp1 = session::ed25519::ed25519_key_pair(); - auto kp2 = session::ed25519::ed25519_key_pair(); + auto [pk1, sk1] = session::ed25519::ed25519_key_pair(); + auto [pk2, sk2] = session::ed25519::ed25519_key_pair(); - CHECK(kp1.first.size() == 32); - CHECK(kp1.second.size() == 64); - CHECK(kp1.first != kp2.first); - CHECK(kp1.second != kp2.second); + CHECK(pk1.size() == 32); + CHECK(sk1.size() == 64); + CHECK(pk1 != pk2); + CHECK(sk1 != sk2); } TEST_CASE("Ed25519 key pair generation seed", "[ed25519][keypair]") { using namespace session; - auto ed_seed1 = "4cb76fdc6d32278e3f83dbf608360ecc6b65727934b85d2fb86862ff98c46ab7"_hexbytes; - auto ed_seed2 = "5ea34e72bb044654a6a23675690ef5ffaaf1656b02f93fb76655f9cbdbe89876"_hexbytes; - auto ed_seed_invalid = "010203040506070809"_hexbytes; + constexpr auto ed_seed1 = "4cb76fdc6d32278e3f83dbf608360ecc6b65727934b85d2fb86862ff98c46ab7"_hex_u; + constexpr auto ed_seed2 = "5ea34e72bb044654a6a23675690ef5ffaaf1656b02f93fb76655f9cbdbe89876"_hex_u; + constexpr auto ed_seed_invalid = "010203040506070809"_hex_u; - auto kp1 = session::ed25519::ed25519_key_pair(to_span(ed_seed1)); - auto kp2 = session::ed25519::ed25519_key_pair(to_span(ed_seed2)); - CHECK_THROWS(session::ed25519::ed25519_key_pair(to_span(ed_seed_invalid))); + auto [pk1, sk1] = session::ed25519::ed25519_key_pair(ed_seed1); + auto [pk2, sk2] = session::ed25519::ed25519_key_pair(ed_seed2); + CHECK_THROWS(session::ed25519::ed25519_key_pair(ed_seed_invalid)); - CHECK(kp1.first.size() == 32); - CHECK(kp1.second.size() == 64); - CHECK(kp1.first != kp2.first); - CHECK(kp1.second != kp2.second); - CHECK(oxenc::to_hex(kp1.first.begin(), kp1.first.end()) == - "8862834829a87e0afadfed763fa8785e893dbde7f2c001ff1071aa55005c347f"); - CHECK(oxenc::to_hex(kp2.first.begin(), kp2.first.end()) == - "cd83ca3d13ad8a954d5011aa7861abe3a29ac25b70c4ed5234aff74d34ef5786"); + CHECK(pk1.size() == 32); + CHECK(sk1.size() == 64); + CHECK(pk1 != pk2); + CHECK(sk1 != sk2); + CHECK(oxenc::to_hex(pk1) == "8862834829a87e0afadfed763fa8785e893dbde7f2c001ff1071aa55005c347f"); + CHECK(oxenc::to_hex(pk2) == "cd83ca3d13ad8a954d5011aa7861abe3a29ac25b70c4ed5234aff74d34ef5786"); auto kp_sk1 = "4cb76fdc6d32278e3f83dbf608360ecc6b65727934b85d2fb86862ff98c46ab78862834829a" @@ -44,26 +40,27 @@ TEST_CASE("Ed25519 key pair generation seed", "[ed25519][keypair]") { auto kp_sk2 = "5ea34e72bb044654a6a23675690ef5ffaaf1656b02f93fb76655f9cbdbe89876cd83ca3d13a" "d8a954d5011aa7861abe3a29ac25b70c4ed5234aff74d34ef5786"; - CHECK(oxenc::to_hex(kp1.second.begin(), kp1.second.end()) == kp_sk1); - CHECK(oxenc::to_hex(kp2.second.begin(), kp2.second.end()) == kp_sk2); + CHECK(oxenc::to_hex(sk1) == kp_sk1); + CHECK(oxenc::to_hex(sk2) == kp_sk2); } TEST_CASE("Ed25519 seed for private key", "[ed25519][seed]") { using namespace session; - auto ed_sk1 = + constexpr auto ed_sk1 = "4cb76fdc6d32278e3f83dbf608360ecc6b65727934b85d2fb86862ff98c46ab78862834829a" - "87e0afadfed763fa8785e893dbde7f2c001ff1071aa55005c347f"_hexbytes; - auto ed_sk2 = "5ea34e72bb044654a6a23675690ef5ffaaf1656b02f93fb76655f9cbdbe89876"_hexbytes; - auto ed_sk_invalid = "010203040506070809"_hexbytes; + "87e0afadfed763fa8785e893dbde7f2c001ff1071aa55005c347f"_hex_u; + constexpr auto ed_sk2 = + "5ea34e72bb044654a6a23675690ef5ffaaf1656b02f93fb76655f9cbdbe89876"_hex_u; + constexpr auto ed_sk_invalid = "010203040506070809"_hex_u; - auto seed1 = session::ed25519::seed_for_ed_privkey(to_span(ed_sk1)); - auto seed2 = session::ed25519::seed_for_ed_privkey(to_span(ed_sk2)); - CHECK_THROWS(session::ed25519::seed_for_ed_privkey(to_span(ed_sk_invalid))); + auto seed1 = session::ed25519::seed_for_ed_privkey(ed_sk1); + auto seed2 = session::ed25519::seed_for_ed_privkey(ed_sk2); + CHECK_THROWS(session::ed25519::seed_for_ed_privkey(ed_sk_invalid)); - CHECK(oxenc::to_hex(seed1.begin(), seed1.end()) == + CHECK(oxenc::to_hex(seed1) == "4cb76fdc6d32278e3f83dbf608360ecc6b65727934b85d2fb86862ff98c46ab7"); - CHECK(oxenc::to_hex(seed2.begin(), seed2.end()) == + CHECK(oxenc::to_hex(seed2) == "5ea34e72bb044654a6a23675690ef5ffaaf1656b02f93fb76655f9cbdbe89876"); } @@ -108,11 +105,11 @@ TEST_CASE("Ed25519 pro key pair generation seed", "[ed25519][keypair]") { CHECK(sk1 != sk2); auto kp_sk1 = - "a4ec87e2346b25ee6394211cb682640a09dd8d297016fe241fe5b06fefef416c" - "b6d20c075eddd2edb69d4d7da9b7e580f187ce0537585da2b5e454b77980d0c8"; + "a4ec87e2346b25ee6394211cb682640a09dd8d297016fe241fe5b06fefef416c" + "b6d20c075eddd2edb69d4d7da9b7e580f187ce0537585da2b5e454b77980d0c8"; auto kp_sk2 = - "7da256ba427cf5419cefea81f8ebb3395c261e4dfc2c91ee4d3ce9def67aa21c" - "539d0a3be9658ebb6ba3ce97b25d4f6b716f7ef6d6ae6343bd0733519f5a51e8"; + "7da256ba427cf5419cefea81f8ebb3395c261e4dfc2c91ee4d3ce9def67aa21c" + "539d0a3be9658ebb6ba3ce97b25d4f6b716f7ef6d6ae6343bd0733519f5a51e8"; CHECK(oxenc::to_hex(sk1) == kp_sk1); CHECK(oxenc::to_hex(sk2) == kp_sk2); @@ -121,17 +118,18 @@ TEST_CASE("Ed25519 pro key pair generation seed", "[ed25519][keypair]") { TEST_CASE("Ed25519", "[ed25519][signature]") { using namespace session; - auto ed_seed = "4cb76fdc6d32278e3f83dbf608360ecc6b65727934b85d2fb86862ff98c46ab7"_hexbytes; - auto ed_pk = "8862834829a87e0afadfed763fa8785e893dbde7f2c001ff1071aa55005c347f"_hexbytes; - auto ed_invalid = "010203040506070809"_hexbytes; + constexpr auto ed_seed = + "4cb76fdc6d32278e3f83dbf608360ecc6b65727934b85d2fb86862ff98c46ab7"_hex_u; + constexpr auto ed_pk = "8862834829a87e0afadfed763fa8785e893dbde7f2c001ff1071aa55005c347f"_hex_u; + constexpr auto ed_invalid = "010203040506070809"_hex_u; - auto sig1 = session::ed25519::sign(to_span(ed_seed), to_span("hello")); - CHECK_THROWS(session::ed25519::sign(to_span(ed_invalid), to_span("hello"))); + auto sig1 = session::ed25519::sign(ed_seed, to_span("hello")); + CHECK_THROWS(session::ed25519::sign(ed_invalid, to_span("hello"))); auto expected_sig_hex = "e03b6e87a53d83f202f2501e9b52193dbe4a64c6503f88244948dee53271" "85011574589aa7b59bc9757f9b9c31b7be9c9212b92ac7c81e029ee21c338ee12405"; - CHECK(oxenc::to_hex(sig1.begin(), sig1.end()) == expected_sig_hex); + CHECK(oxenc::to_hex(sig1) == expected_sig_hex); CHECK(session::ed25519::verify(sig1, ed_pk, to_span("hello"))); CHECK_THROWS(session::ed25519::verify(ed_invalid, ed_pk, to_span("hello"))); From d9b3b095ffe706a9d974a4ae73e3a71d452b0f3b Mon Sep 17 00:00:00 2001 From: doylet Date: Fri, 1 Aug 2025 11:38:15 +1000 Subject: [PATCH 04/59] Use cleared_u32 and 64 from sodium_array header --- src/ed25519.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/ed25519.cpp b/src/ed25519.cpp index d537e39a..2ba8cff2 100644 --- a/src/ed25519.cpp +++ b/src/ed25519.cpp @@ -11,12 +11,8 @@ #include "session/sodium_array.hpp" template -using cleared_array = session::sodium_cleared>; - using uc32 = std::array; using uc64 = std::array; -using cleared_uc32 = cleared_array<32>; -using cleared_uc64 = cleared_array<64>; namespace { uc64 derived_ed25519_keypair( @@ -28,7 +24,7 @@ uc64 derived_ed25519_keypair( // Construct seed for derived key // new_seed = Blake2b32(ed25519_seed, key=) // b/B = Ed25519FromSeed(new_seed) - cleared_uc32 s2 = {}; + session::cleared_uc32 s2 = {}; int hash_result = crypto_generichash_blake2b( s2.data(), s2.size(), From d7ba32e3c1e236a64f32c19f0a51f810a2d3449f Mon Sep 17 00:00:00 2001 From: doylet Date: Fri, 1 Aug 2025 13:28:27 +1000 Subject: [PATCH 05/59] Linting fix --- src/ed25519.cpp | 8 +++----- tests/test_ed25519.cpp | 6 ++++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ed25519.cpp b/src/ed25519.cpp index 2ba8cff2..3cc5dc17 100644 --- a/src/ed25519.cpp +++ b/src/ed25519.cpp @@ -7,7 +7,6 @@ #include #include "session/export.h" - #include "session/sodium_array.hpp" template @@ -15,8 +14,7 @@ using uc32 = std::array; using uc64 = std::array; namespace { -uc64 derived_ed25519_keypair( - std::span ed25519_seed, std::string_view key) { +uc64 derived_ed25519_keypair(std::span ed25519_seed, std::string_view key) { if (ed25519_seed.size() != 32 && ed25519_seed.size() != 64) throw std::invalid_argument{ "Invalid ed25519_seed: expected 32 bytes or libsodium style 64 bytes seed"}; @@ -30,14 +28,14 @@ uc64 derived_ed25519_keypair( s2.size(), ed25519_seed.data(), ed25519_seed.size(), - reinterpret_cast(key.data()), + reinterpret_cast(key.data()), key.size()); assert(hash_result == 0); // This function can't return 0 unless misused auto [pubkey, privkey] = session::ed25519::ed25519_key_pair(s2); return privkey; } -} +} // namespace namespace session::ed25519 { diff --git a/tests/test_ed25519.cpp b/tests/test_ed25519.cpp index eb5f4ec1..c04bf2cb 100644 --- a/tests/test_ed25519.cpp +++ b/tests/test_ed25519.cpp @@ -19,8 +19,10 @@ TEST_CASE("Ed25519 key pair generation", "[ed25519][keypair]") { TEST_CASE("Ed25519 key pair generation seed", "[ed25519][keypair]") { using namespace session; - constexpr auto ed_seed1 = "4cb76fdc6d32278e3f83dbf608360ecc6b65727934b85d2fb86862ff98c46ab7"_hex_u; - constexpr auto ed_seed2 = "5ea34e72bb044654a6a23675690ef5ffaaf1656b02f93fb76655f9cbdbe89876"_hex_u; + constexpr auto ed_seed1 = + "4cb76fdc6d32278e3f83dbf608360ecc6b65727934b85d2fb86862ff98c46ab7"_hex_u; + constexpr auto ed_seed2 = + "5ea34e72bb044654a6a23675690ef5ffaaf1656b02f93fb76655f9cbdbe89876"_hex_u; constexpr auto ed_seed_invalid = "010203040506070809"_hex_u; auto [pk1, sk1] = session::ed25519::ed25519_key_pair(ed_seed1); From dd59713b69e6afe1f0c66d410f7232788d609d12 Mon Sep 17 00:00:00 2001 From: doylet Date: Thu, 31 Jul 2025 17:11:49 +1000 Subject: [PATCH 06/59] Add basic pro proof verification functions --- src/CMakeLists.txt | 1 + src/pro.cpp | 179 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 180 insertions(+) create mode 100644 src/pro.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1e4ad566..c22af04a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -52,6 +52,7 @@ add_libsession_util_library(crypto session_encrypt.cpp sodium_array.cpp xed25519.cpp + pro.cpp ) add_libsession_util_library(config diff --git a/src/pro.cpp b/src/pro.cpp new file mode 100644 index 00000000..4d078810 --- /dev/null +++ b/src/pro.cpp @@ -0,0 +1,179 @@ +#include +#include +#include +#include +#include + +#include + +namespace session::pro { + +constexpr std::array BACKEND_PUBKEY = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; +static_assert(BACKEND_PUBKEY.size() == crypto_sign_ed25519_PUBLICKEYBYTES); + +struct proof { + uint8_t version; + std::array gen_index_hash; + std::array rotating_pubkey; + std::chrono::seconds expiry_unix_ts; + std::array sig; +}; +static_assert(sizeof(((proof *)0)->rotating_pubkey) == crypto_sign_ed25519_PUBLICKEYBYTES); +static_assert(sizeof(((proof *)0)->sig) == crypto_sign_ed25519_BYTES); + +struct add_payment_request { + uint8_t version; + std::array master_pkey; + std::array rotating_pkey; + std::array payment_token; + std::array master_sig; + std::array rotating_sig; + std::string to_json() const; +}; + +struct get_proof_request { + uint8_t version; + std::array master_pkey; + std::array rotating_pkey; + std::chrono::seconds unix_ts_s; + std::array master_sig; + std::array rotating_sig; + std::string to_json() const; +}; + +struct master_rotating_sigs { + std::array master_sig; + std::array rotating_sig; +}; + +struct revocation_item { + std::array gen_index_hash; + std::chrono::seconds expiry_unix_ts; +}; + +bool verify_proof(const proof& item); +master_rotating_sigs build_get_proof_sigs(std::array master_privkey, std::array rotating_privkey, std::chrono::seconds unix_ts); +master_rotating_sigs build_add_payment_sigs(std::array master_privkey, std::array rotating_privkey, std::array payment_token_hash, std::chrono::seconds unix_ts); + + +bool verify_proof(const proof& item) { + uint64_t expiry_unix_ts_u64 = item.expiry_unix_ts.count(); + std::array hash = {}; + crypto_generichash_blake2b_state state; + crypto_generichash_blake2b_init(&state, /*key*/ nullptr, 0, hash.max_size()); + crypto_generichash_blake2b_update(&state, &item.version, sizeof(item.version)); + crypto_generichash_blake2b_update( + &state, item.gen_index_hash.data(), item.gen_index_hash.size()); + crypto_generichash_blake2b_update( + &state, item.rotating_pubkey.data(), item.rotating_pubkey.size()); + crypto_generichash_blake2b_update( + &state, reinterpret_cast(&expiry_unix_ts_u64), sizeof(expiry_unix_ts_u64)); + crypto_generichash_blake2b_final(&state, hash.data(), hash.size()); + + int verify_result = crypto_sign_ed25519_verify_detached( + item.sig.data(), hash.data(), hash.size(), BACKEND_PUBKEY.data()); + bool result = verify_result == 0; + return result; +} + +master_rotating_sigs build_get_proof_sigs( + std::array master_privkey, + std::array rotating_privkey, + std::chrono::seconds unix_ts) { + // Derive the public keys + std::array master_pubkey; + std::array rotating_pubkey; + crypto_sign_ed25519_sk_to_pk(master_pubkey.data(), master_privkey.data()); + crypto_sign_ed25519_sk_to_pk(rotating_pubkey.data(), rotating_privkey.data()); + + // Hash components to 32 bytes + uint8_t version = 0; + uint64_t unix_ts_s = unix_ts.count(); + std::array hash_to_sign = {}; + crypto_generichash_blake2b_state state; + crypto_generichash_blake2b_init(&state, /*key*/ nullptr, 0, hash_to_sign.max_size()); + crypto_generichash_blake2b_update(&state, &version, sizeof(version)); + crypto_generichash_blake2b_update(&state, master_pubkey.data(), master_pubkey.size()); + crypto_generichash_blake2b_update(&state, rotating_pubkey.data(), rotating_pubkey.size()); + crypto_generichash_blake2b_update(&state, reinterpret_cast(&unix_ts_s), sizeof(unix_ts_s)); + crypto_generichash_blake2b_final(&state, hash_to_sign.data(), hash_to_sign.size()); + + // Sign the hash with both keys + master_rotating_sigs result = {}; + crypto_sign_ed25519_detached(result.master_sig.data(), nullptr, hash_to_sign.data(), hash_to_sign.size(), master_privkey.data()); + crypto_sign_ed25519_detached(result.rotating_sig.data(), nullptr, hash_to_sign.data(), hash_to_sign.size(), rotating_privkey.data()); + return result; +} + +master_rotating_sigs build_add_payment_sigs( + std::array master_privkey, + std::array rotating_privkey, + std::array payment_token_hash, + std::chrono::seconds unix_ts) { + // Derive the public keys + std::array master_pubkey; + std::array rotating_pubkey; + crypto_sign_ed25519_sk_to_pk(master_pubkey.data(), master_privkey.data()); + crypto_sign_ed25519_sk_to_pk(rotating_pubkey.data(), rotating_privkey.data()); + + // Hash components to 32 bytes + uint8_t version = 0; + std::array hash_to_sign = {}; + crypto_generichash_blake2b_state state; + crypto_generichash_blake2b_init(&state, /*key*/ nullptr, 0, hash_to_sign.max_size()); + crypto_generichash_blake2b_update(&state, &version, sizeof(version)); + crypto_generichash_blake2b_update(&state, master_pubkey.data(), master_pubkey.size()); + crypto_generichash_blake2b_update(&state, rotating_pubkey.data(), rotating_pubkey.size()); + crypto_generichash_blake2b_update(&state, payment_token_hash.data(), payment_token_hash.size()); + crypto_generichash_blake2b_final(&state, hash_to_sign.data(), hash_to_sign.size()); + + // Sign the hash with both keys + master_rotating_sigs result = {}; + crypto_sign_ed25519_detached(result.master_sig.data(), nullptr, hash_to_sign.data(), hash_to_sign.size(), master_privkey.data()); + crypto_sign_ed25519_detached(result.rotating_sig.data(), nullptr, hash_to_sign.data(), hash_to_sign.size(), rotating_privkey.data()); + return result; +} + +std::string get_proof_request::to_json() const { + // TODO: Cleanup + std::string result = fmt::format( + R"({{ + "version": {}, + "master_pkey": "{}", + "rotating_pkey": "{}", + "unix_ts_s": {}, + "master_sig": "{}", + "rotating_sig": "{}", +}})", + 0, + oxenc::to_hex(master_pkey), + oxenc::to_hex(rotating_pkey), + unix_ts_s.count(), + oxenc::to_hex(master_sig), + oxenc::to_hex(rotating_sig)); + return result; +} + +std::string add_payment_request::to_json() const { + // TODO: Cleanup + std::string result = fmt::format( + R"({{ + "version": {}, + "master_pkey": "{}", + "rotating_pkey": "{}", + "payment_token": "{}", + "master_sig": "{}", + "rotating_sig": "{}", +}})", + 0, + oxenc::to_hex(master_pkey), + oxenc::to_hex(rotating_pkey), + oxenc::to_hex(payment_token), + oxenc::to_hex(master_sig), + oxenc::to_hex(rotating_sig)); + return result; +} +} // namespace session::pro From d4d6176631f01342eaea9c6836e2406c7ebb8e0d Mon Sep 17 00:00:00 2001 From: doylet Date: Mon, 4 Aug 2025 16:39:59 +1000 Subject: [PATCH 07/59] Reformat the string split in test_config_userprofile --- tests/test_config_userprofile.cpp | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/tests/test_config_userprofile.cpp b/tests/test_config_userprofile.cpp index 66a169b5..76235849 100644 --- a/tests/test_config_userprofile.cpp +++ b/tests/test_config_userprofile.cpp @@ -63,28 +63,24 @@ TEST_CASE("UserProfile", "[config][user_profile]") { session::config::UserProfile profile{std::span{seed}, std::nullopt}; - CHECK_THROWS( - profile.set_name("123456789012345678901234567890123456789012345678901234567890123456789" - "01" - "23456789012345678901234567890A")); - CHECK_NOTHROW( - profile.set_name_truncated("12345678901234567890123456789012345678901234567890123456789" - "01" - "234567890123456789012345678901234567890A")); + CHECK_THROWS(profile.set_name( + "123456789012345678901234567890123456789012345678901234567890123456789" + "0123456789012345678901234567890A")); + CHECK_NOTHROW(profile.set_name_truncated( + "12345678901234567890123456789012345678901234567890123456789" + "01234567890123456789012345678901234567890A")); CHECK(profile.get_name() == "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" "901234567890"); - CHECK_NOTHROW( - profile.set_name_truncated("12345678901234567890123456789012345678901234567890123456789" - "01" - "234567890123456789012345678901234567🎂")); + CHECK_NOTHROW(profile.set_name_truncated( + "12345678901234567890123456789012345678901234567890123456789" + "01234567890123456789012345678901234567🎂")); CHECK(profile.get_name() == "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" "901234567"); - CHECK_NOTHROW( - profile.set_name_truncated("12345678901234567890123456789012345678901234567890123456789" - "01" - "2345678901234567890123456789012345🎂🎂")); + CHECK_NOTHROW(profile.set_name_truncated( + "12345678901234567890123456789012345678901234567890123456789" + "012345678901234567890123456789012345🎂🎂")); CHECK(profile.get_name() == "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" "9012345🎂"); From af301dbb7e5d622228de7f23e518c69727c499ab Mon Sep 17 00:00:00 2001 From: doylet Date: Mon, 4 Aug 2025 16:43:08 +1000 Subject: [PATCH 08/59] Add pro proof and rotating key pair to user profile --- include/session/config/pro.hpp | 93 +++++++++++++++++++++ include/session/config/user_profile.hpp | 26 +++++- proto/SessionProtos.proto | 10 +++ src/CMakeLists.txt | 1 + src/config/pro.cpp | 103 ++++++++++++++++++++++++ src/config/user_profile.cpp | 23 ++++++ src/pro.cpp | 37 +-------- tests/CMakeLists.txt | 1 + tests/test_config_pro.cpp | 103 ++++++++++++++++++++++++ 9 files changed, 360 insertions(+), 37 deletions(-) create mode 100644 include/session/config/pro.hpp create mode 100644 src/config/pro.cpp create mode 100644 tests/test_config_pro.cpp diff --git a/include/session/config/pro.hpp b/include/session/config/pro.hpp new file mode 100644 index 00000000..13f5bef5 --- /dev/null +++ b/include/session/config/pro.hpp @@ -0,0 +1,93 @@ +#include +#include +#include + +#include +#include + +namespace session::config { + +/// keys used currently or in the past (so that we don't reuse): +/// +/// v - version +/// g - gen_index_hash +/// r - rotating ed25519 pubkey +/// e - expiry unix timestamp (in seconds) +/// s - proof signature, signed by the Session Pro Backend's ed25519 key +class Proof { + public: + /// Version of the proof set by the Session Pro Backend + uint8_t version; + + /// Hash of the generation index set by the Session Pro Backend + std::array gen_index_hash; + + /// The public key that the Session client registers their Session Pro entitlement under. + /// Session clients must sign messages with this key along side the sending of this proof for + /// the network to authenticate their usage of the proof + std::array rotating_pubkey; + + /// Unix epoch timestamp to which this proof's entitlement to Session Pro features is valid to + std::chrono::sys_seconds expiry_unix_ts; + + /// Signature over the contents of the proof. It is signed by the Session Pro Backend key which + /// is the entity responsible for issueing tamper-proof Sesison Pro certificates for Session + /// clients. + std::array sig; + + /// API: pro/Proof::verify + /// + /// Verify that the proof's contents was not tampered with by hashing the proof and checking + /// that the hash was signed by the secret key of the given Ed25519 public key. + /// + /// For Session Pro intents and purposes, we expect proofs to be signed by the Session Pro + /// Backend public key. + /// + /// Inputs: + /// - `verify_pubkey` -- Ed25519 public key of the corresponding secret key to check if they are + /// the original signatory of the proof. + /// + /// Outputs: + /// - `bool` - True if the given key was the signatory of the proof, false otherwise + bool verify(const std::array& verify_pubkey) const; + + /// API: pro/Proof::hash + /// + /// Create a 32-byte hash from the proof. This hash is the payload that is signed in the proof. + std::array hash() const; + + bool load(const dict& root); +}; + +/// keys used currently or in the past (so that we don't reuse): +/// +/// r - rotating ed25519 privkey +/// p - proof +class Pro { + public: + /// Private key for the public key key specified in the proof. This is synced between clients + /// to allow multiple clients to synchronise the Session Pro Proof and also the keys necessary + /// to use the proof. + std::array rotating_privkey; + + /// A cryptographic proof for entitling an Ed25519 key to Session Pro + Proof proof; + + /// API: pro/Pro::verify + /// + /// Verify the proof and that the proof's rotating public key matches the public key of the + /// `rotating_privkey` + /// + /// Inputs: + /// - `verify_pubkey` -- Ed25519 public key of the corresponding secret key to check if they are + /// the original signatory of the proof. + /// + /// Outputs: + /// - `bool` - True if the proof was verified and the proof's rotating public key corresponds to + /// the public component of the `rotating_privkey`. + bool verify(const std::array& verify_pubkey) const; + + bool load(const dict& root); +}; + +}; // namespace session::config diff --git a/include/session/config/user_profile.hpp b/include/session/config/user_profile.hpp index c9601086..c3b775a6 100644 --- a/include/session/config/user_profile.hpp +++ b/include/session/config/user_profile.hpp @@ -8,6 +8,7 @@ #include "base.hpp" #include "namespaces.hpp" #include "profile_pic.hpp" +#include "pro.hpp" namespace session::config { @@ -24,6 +25,7 @@ using namespace std::literals; /// M - set to 1 if blinded message request retrieval is enabled, 0 if retrieval is *disabled*, and /// omitted if the setting has not been explicitly set (or has been explicitly cleared for some /// reason). +/// s - session pro data /// t - The unix timestamp (seconds) that the user last explicitly updated their profile information /// (automatically updates when changing `name`, `profile_pic` or `set_blinded_msgreqs`). /// P - user profile url after re-uploading (should take precedence over `p` when `T > t`). @@ -31,7 +33,6 @@ using namespace std::literals; /// when `T > t`). /// T - The unix timestamp (seconds) that the user last re-uploaded their profile information /// (automatically updates when calling `set_reupload_profile_pic`). - class UserProfile : public ConfigBase { public: @@ -166,7 +167,7 @@ class UserProfile : public ConfigBase { /// Inputs: None /// /// Outputs: - /// - `int` - Returns a numeric representing prioritity + /// - `int` -- Returns a numeric representing prioritity int get_nts_priority() const; /// API: user_profile/UserProfile::set_nts_priority @@ -186,7 +187,7 @@ class UserProfile : public ConfigBase { /// Inputs: None /// /// Outputs: - /// - `std::optional` - Returns the timestamp representing the message + /// - `std::optional` -- Returns the timestamp representing the message /// expiry timer if the timer is set std::optional get_nts_expiry() const; @@ -242,6 +243,25 @@ class UserProfile : public ConfigBase { std::chrono::sys_seconds get_profile_updated() const; bool accepts_protobuf() const override { return true; } + + /// API: user_profile/UserProfile::get_pro_data + /// + /// Get the Session Pro data if any, for the current user profile. This may be missing if the + /// user does not have any entitlement to Session Pro data. + /// + /// Inputs: None + std::optional get_pro_data() const; + + /// API: user_profile/UserProfile::set_pro_data + /// + /// Attach the Session Pro components to the user profile including the proof entitling the user + /// to use Session Pro features as well as the Ed25519 key pair known as the Rotating Session + /// Pro key authorised to use the proof. + /// + /// Inputs: + /// - `pro` -- The Session Pro components to assign to the current user profile. This will + /// overwrite any existing Session Pro data if it exists. No verification of `pro` is done. + void set_pro_data(const Pro& pro); }; } // namespace session::config diff --git a/proto/SessionProtos.proto b/proto/SessionProtos.proto index d112322b..a9d434b0 100644 --- a/proto/SessionProtos.proto +++ b/proto/SessionProtos.proto @@ -234,12 +234,22 @@ message ConfigurationMessage { optional bool didApproveMe = 7; // added for msg requests } + message ProProof { + required uint32 version = 1; + required bytes genIndexHash = 2; + required bytes rotatingPublicKey = 3; + required uint64 expiryUnixTs = 4; + required bytes sig = 5; + } + repeated ClosedGroup closedGroups = 1; repeated string openGroups = 2; optional string displayName = 3; optional string profilePicture = 4; optional bytes profileKey = 5; repeated Contact contacts = 6; + optional bytes proRotatingKey = 7; + optional ProProof proProof = 8; } message ReceiptMessage { diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c22af04a..c0f411c0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -70,6 +70,7 @@ add_libsession_util_library(config config/internal.cpp config/local.cpp config/protos.cpp + config/pro.cpp config/user_groups.cpp config/user_profile.cpp fields.cpp diff --git a/src/config/pro.cpp b/src/config/pro.cpp new file mode 100644 index 00000000..72ac707d --- /dev/null +++ b/src/config/pro.cpp @@ -0,0 +1,103 @@ +#include +#include + +#include +#include + +#include "internal.hpp" + +namespace session::config { + +static_assert(sizeof(((Proof *)0)->rotating_pubkey) == crypto_sign_ed25519_PUBLICKEYBYTES); +static_assert(sizeof(((Proof *)0)->sig) == crypto_sign_ed25519_BYTES); + +bool Proof::verify(const std::array& verify_pubkey) const +{ + std::array hash_to_sign = hash(); + int verify_result = crypto_sign_ed25519_verify_detached( + sig.data(), hash_to_sign.data(), hash_to_sign.size(), verify_pubkey.data()); + bool result = verify_result == 0; + return result; +} + +std::array Proof::hash() const +{ + // TODO: Check why does sys_time have a time since epoch? Is it counting some other duration? + uint64_t expiry_unix_ts_u64 = expiry_unix_ts.time_since_epoch().count(); + std::array result = {}; + crypto_generichash_blake2b_state state; + crypto_generichash_blake2b_init(&state, /*key*/ nullptr, 0, result.max_size()); + crypto_generichash_blake2b_update(&state, &version, sizeof(version)); + crypto_generichash_blake2b_update( + &state, gen_index_hash.data(), gen_index_hash.size()); + crypto_generichash_blake2b_update( + &state, rotating_pubkey.data(), rotating_pubkey.size()); + crypto_generichash_blake2b_update( + &state, reinterpret_cast(&expiry_unix_ts_u64), sizeof(expiry_unix_ts_u64)); + crypto_generichash_blake2b_final(&state, result.data(), result.size()); + return result; +} + +bool Proof::load(const dict& root) +{ + std::optional version = maybe_int(root, "v"); + std::optional> maybe_gen_index_hash = maybe_vector(root, "g"); + std::optional> maybe_rotating_pubkey = maybe_vector(root, "r"); + std::optional maybe_expiry_unix_ts = maybe_ts(root, "e"); + std::optional> maybe_sig = maybe_vector(root, "s"); + + if (!version) + return false; + if (!maybe_gen_index_hash || maybe_gen_index_hash->size() != gen_index_hash.size()) + return false; + if (!maybe_rotating_pubkey || maybe_rotating_pubkey->size() != rotating_pubkey.max_size()) + return false; + if (!maybe_sig || maybe_sig->size() != sig.max_size()) + return false; + + version = *version; + std::memcpy(gen_index_hash.data(), maybe_gen_index_hash->data(), gen_index_hash.size()); + std::memcpy(rotating_pubkey.data(), maybe_rotating_pubkey->data(), rotating_pubkey.size()); + expiry_unix_ts = *maybe_expiry_unix_ts; + std::memcpy(sig.data(), maybe_sig->data(), sig.size()); + + return true; +} + +bool Pro::verify(const std::array& verify_pubkey) const +{ + if (!proof.verify(verify_pubkey)) + return false; + + std::array rederived_pk; + [[maybe_unused]] session::cleared_uc32 rederived_sk; + crypto_sign_ed25519_seed_keypair( + rederived_pk.data(), rederived_sk.data(), rotating_privkey.data()); + bool result = rederived_pk == proof.rotating_pubkey; + return result; +} + +bool Pro::load(const dict& root) +{ + // Get proof fields sitting in 'p' dictionary + auto p_it = root.find("p"); + if (p_it == root.end()) + return false; + + // Lookup and get 'p' + const config::dict* p = std::get_if(&p_it->second); + if (!p) + return false; + + std::optional> maybe_rotating_privkey = maybe_vector(root, "r"); + if (!maybe_rotating_privkey || maybe_rotating_privkey->size() != rotating_privkey.max_size()) + return false; + + if (!proof.load(*p)) + return false; + + std::memcpy(rotating_privkey.data(), maybe_rotating_privkey->data(), rotating_privkey.size()); + return true; +} + +}; // namespace session::config diff --git a/src/config/user_profile.cpp b/src/config/user_profile.cpp index 5adaf110..c3f652d6 100644 --- a/src/config/user_profile.cpp +++ b/src/config/user_profile.cpp @@ -119,6 +119,29 @@ std::chrono::sys_seconds UserProfile::get_profile_updated() const { return std::chrono::sys_seconds{}; } +std::optional UserProfile::get_pro_data() const { + std::optional result = {}; + if (const config::dict* s = data["s"].dict(); s) { + Pro pro = {}; + if (pro.load(*s)) + result = std::move(pro); + } + return result; +} + +void UserProfile::set_pro_data(Pro const &pro) { + auto root = data["s"]; + root["r"] = pro.rotating_privkey; + + const Proof& pro_proof = pro.proof; + auto proof_dict = root["p"]; + proof_dict["v"] = pro_proof.version; + proof_dict["g"] = pro_proof.gen_index_hash; + proof_dict["r"] = pro_proof.rotating_pubkey; + proof_dict["e"] = pro_proof.expiry_unix_ts.time_since_epoch().count(); + proof_dict["s"] = pro_proof.sig; +} + extern "C" { using namespace session; diff --git a/src/pro.cpp b/src/pro.cpp index 4d078810..d07d4eb9 100644 --- a/src/pro.cpp +++ b/src/pro.cpp @@ -1,10 +1,11 @@ +#include +#include #include #include #include -#include -#include #include +#include namespace session::pro { @@ -14,16 +15,6 @@ constexpr std::array BACKEND_PUBKEY = {0x00, 0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; static_assert(BACKEND_PUBKEY.size() == crypto_sign_ed25519_PUBLICKEYBYTES); -struct proof { - uint8_t version; - std::array gen_index_hash; - std::array rotating_pubkey; - std::chrono::seconds expiry_unix_ts; - std::array sig; -}; -static_assert(sizeof(((proof *)0)->rotating_pubkey) == crypto_sign_ed25519_PUBLICKEYBYTES); -static_assert(sizeof(((proof *)0)->sig) == crypto_sign_ed25519_BYTES); - struct add_payment_request { uint8_t version; std::array master_pkey; @@ -54,31 +45,9 @@ struct revocation_item { std::chrono::seconds expiry_unix_ts; }; -bool verify_proof(const proof& item); master_rotating_sigs build_get_proof_sigs(std::array master_privkey, std::array rotating_privkey, std::chrono::seconds unix_ts); master_rotating_sigs build_add_payment_sigs(std::array master_privkey, std::array rotating_privkey, std::array payment_token_hash, std::chrono::seconds unix_ts); - -bool verify_proof(const proof& item) { - uint64_t expiry_unix_ts_u64 = item.expiry_unix_ts.count(); - std::array hash = {}; - crypto_generichash_blake2b_state state; - crypto_generichash_blake2b_init(&state, /*key*/ nullptr, 0, hash.max_size()); - crypto_generichash_blake2b_update(&state, &item.version, sizeof(item.version)); - crypto_generichash_blake2b_update( - &state, item.gen_index_hash.data(), item.gen_index_hash.size()); - crypto_generichash_blake2b_update( - &state, item.rotating_pubkey.data(), item.rotating_pubkey.size()); - crypto_generichash_blake2b_update( - &state, reinterpret_cast(&expiry_unix_ts_u64), sizeof(expiry_unix_ts_u64)); - crypto_generichash_blake2b_final(&state, hash.data(), hash.size()); - - int verify_result = crypto_sign_ed25519_verify_detached( - item.sig.data(), hash.data(), hash.size(), BACKEND_PUBKEY.data()); - bool result = verify_result == 0; - return result; -} - master_rotating_sigs build_get_proof_sigs( std::array master_privkey, std::array rotating_privkey, diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b436795f..bbd36af3 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -15,6 +15,7 @@ set(LIB_SESSION_UTESTS_SOURCES test_config_contacts.cpp test_config_convo_info_volatile.cpp test_config_local.cpp + test_config_pro.cpp test_curve25519.cpp test_ed25519.cpp test_encrypt.cpp diff --git a/tests/test_config_pro.cpp b/tests/test_config_pro.cpp new file mode 100644 index 00000000..da46fcc9 --- /dev/null +++ b/tests/test_config_pro.cpp @@ -0,0 +1,103 @@ +#include +#include + +#include +#include + +using namespace oxenc::literals; + +TEST_CASE("Pro", "[config][pro]") { + // Setup keys + std::array rotating_pk, signing_pk; + std::array rotating_sk, signing_sk; + { + crypto_sign_ed25519_keypair(rotating_pk.data(), rotating_sk.data()); + crypto_sign_ed25519_keypair(signing_pk.data(), signing_sk.data()); + } + + // Setup the Pro data structure + session::config::Pro pro = {}; + { + pro.rotating_privkey = rotating_sk; + pro.proof.version = 0; + pro.proof.rotating_pubkey = rotating_pk; + pro.proof.expiry_unix_ts = std::chrono::sys_seconds(1s); + + constexpr auto gen_index_hash = + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"_hex_u; + static_assert(pro.proof.gen_index_hash.max_size() == gen_index_hash.size()); + std::memcpy(pro.proof.gen_index_hash.data(), gen_index_hash.data(), gen_index_hash.size()); + } + + // Do the signing + { + static_assert(crypto_sign_ed25519_BYTES == pro.proof.sig.max_size()); + std::array hash_to_sign = pro.proof.hash(); + int sig_result = crypto_sign_ed25519_detached( + pro.proof.sig.data(), + nullptr, + hash_to_sign.data(), + hash_to_sign.size(), + signing_sk.data()); + CHECK(sig_result == 0); + } + + // Verify the proof + { + CHECK_FALSE(pro.verify(rotating_pk)); + CHECK(pro.verify(signing_pk)); + } + + // Try loading the proof from dict + session::config::dict good_dict; + { + // clang-format off + const session::config::Proof& proof = pro.proof; + good_dict = { + {"r", std::string(reinterpret_cast(rotating_sk.data()), rotating_sk.size())}, + {"p", session::config::dict{ + /*version*/ {"v", 0}, + /*gen_index_hash*/ {"g", std::string(reinterpret_cast(proof.gen_index_hash.data()), proof.gen_index_hash.size())}, + /*rotating pubkey*/ {"r", std::string(reinterpret_cast(proof.rotating_pubkey.data()), proof.rotating_pubkey.size())}, + /*expiry unix ts*/ {"e", proof.expiry_unix_ts.time_since_epoch().count()}, + /*signature*/ {"s", std::string{reinterpret_cast(proof.sig.data()), proof.sig.size()}}, + }} + }; + // clang-format on + + session::config::Pro loaded_pro = {}; + CHECK(loaded_pro.load(good_dict)); + CHECK(loaded_pro.rotating_privkey == pro.rotating_privkey); + CHECK(loaded_pro.proof.version == pro.proof.version); + CHECK(loaded_pro.proof.gen_index_hash == pro.proof.gen_index_hash); + CHECK(loaded_pro.proof.rotating_pubkey == pro.proof.rotating_pubkey); + CHECK(loaded_pro.proof.expiry_unix_ts == pro.proof.expiry_unix_ts); + CHECK(loaded_pro.proof.sig == pro.proof.sig); + CHECK(loaded_pro.verify(signing_pk)); + } + + // Try loading a proof with a bad signature in it from dict + { + session::config::dict bad_dict = good_dict; + std::array broken_sig = pro.proof.sig; + broken_sig[0] = ~broken_sig[0]; // Break the sig + + // clang-format off + const session::config::Proof& proof = pro.proof; + bad_dict = { + {"r", std::string(reinterpret_cast(rotating_sk.data()), rotating_sk.size())}, + {"p", session::config::dict{ + /*version*/ {"v", 0}, + /*gen_index_hash*/ {"g", std::string(reinterpret_cast(proof.gen_index_hash.data()), proof.gen_index_hash.size())}, + /*rotating pubkey*/ {"r", std::string(reinterpret_cast(proof.rotating_pubkey.data()), proof.rotating_pubkey.size())}, + /*expiry unix ts*/ {"e", proof.expiry_unix_ts.time_since_epoch().count()}, + /*signature*/ {"s", std::string{reinterpret_cast(broken_sig.data()), broken_sig.size()}}, + }} + }; + // clang-format on + + session::config::Pro loaded_pro = {}; + CHECK(loaded_pro.load(bad_dict)); + CHECK_FALSE(loaded_pro.verify(signing_pk)); + } +} From 176d72a45f0ddf876502b2c52c38bc27dfe5d060 Mon Sep 17 00:00:00 2001 From: doylet Date: Tue, 5 Aug 2025 11:37:20 +1000 Subject: [PATCH 09/59] Add c wrappers for Session Pro and proofs --- include/session/config/pro.h | 31 +++++++ src/config/pro.cpp | 162 +++++++++++++++++++++++++++-------- 2 files changed, 157 insertions(+), 36 deletions(-) create mode 100644 include/session/config/pro.h diff --git a/include/session/config/pro.h b/include/session/config/pro.h new file mode 100644 index 00000000..06d2f3c7 --- /dev/null +++ b/include/session/config/pro.h @@ -0,0 +1,31 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +#include "../export.h" + +struct pro_proof { + uint8_t version; + uint8_t gen_index_hash[32]; + uint8_t rotating_pubkey[32]; + uint64_t expiry_unix_ts; + uint8_t sig[64]; +}; + +struct pro_pro { + uint8_t rotating_privkey[64]; + pro_proof proof; +}; + +LIBSESSION_EXPORT bool proof_verify(pro_proof const *proof, uint8_t const *verify_pubkey); + +LIBSESSION_EXPORT bool pro_verify(pro_pro const *pro, uint8_t const *verify_pubkey); + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/src/config/pro.cpp b/src/config/pro.cpp index 72ac707d..a2e3d937 100644 --- a/src/config/pro.cpp +++ b/src/config/pro.cpp @@ -1,3 +1,4 @@ +#include #include #include @@ -6,40 +7,87 @@ #include "internal.hpp" +namespace { +std::array proof_hash_internal( + uint8_t version, + std::span gen_index_hash, + std::span rotating_pubkey, + uint64_t expiry_unix_ts) { + std::array result = {}; + crypto_generichash_blake2b_state state; + crypto_generichash_blake2b_init(&state, /*key*/ nullptr, 0, result.max_size()); + crypto_generichash_blake2b_update(&state, &version, sizeof(version)); + crypto_generichash_blake2b_update(&state, gen_index_hash.data(), gen_index_hash.size()); + crypto_generichash_blake2b_update(&state, rotating_pubkey.data(), rotating_pubkey.size()); + crypto_generichash_blake2b_update( + &state, reinterpret_cast(&expiry_unix_ts), sizeof(expiry_unix_ts)); + crypto_generichash_blake2b_final(&state, result.data(), result.size()); + return result; +} + +bool proof_verify_internal( + std::span hash, + std::span sig, + std::span verify_pubkey) { + // The C/C++ interface verifies that the payloads are the correct size using the type system so + // only need asserts here. + assert(hash.size() == 32); + assert(sig.size() == crypto_sign_ed25519_BYTES); + assert(verify_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); + int verify_result = crypto_sign_ed25519_verify_detached( + sig.data(), hash.data(), hash.size(), verify_pubkey.data()); + bool result = verify_result == 0; + return result; +} + +bool pro_verify_internal( + std::span rotating_privkey, + std::span verify_pubkey, + uint8_t version, + std::span gen_index_hash, + std::span rotating_pubkey, + uint64_t expiry_unix_ts, + std::span sig) { + + std::array hash = + proof_hash_internal(version, gen_index_hash, rotating_pubkey, expiry_unix_ts); + if (!proof_verify_internal(hash, sig, verify_pubkey)) + return false; + + std::array rederived_pk; + [[maybe_unused]] session::cleared_uc32 rederived_sk; + crypto_sign_ed25519_seed_keypair( + rederived_pk.data(), rederived_sk.data(), rotating_privkey.data()); + + bool result = false; + if (rederived_pk.size() == rotating_pubkey.size()) + result = std::memcmp(rederived_pk.data(), rotating_pubkey.data(), rederived_pk.size()) == 0; + + return result; +} + +} // namespace + namespace session::config { -static_assert(sizeof(((Proof *)0)->rotating_pubkey) == crypto_sign_ed25519_PUBLICKEYBYTES); -static_assert(sizeof(((Proof *)0)->sig) == crypto_sign_ed25519_BYTES); +static_assert(sizeof(((Pro*)0)->rotating_privkey) == crypto_sign_ed25519_SECRETKEYBYTES); +static_assert(sizeof(((Proof*)0)->gen_index_hash) == 32); +static_assert(sizeof(((Proof*)0)->rotating_pubkey) == crypto_sign_ed25519_PUBLICKEYBYTES); +static_assert(sizeof(((Proof*)0)->sig) == crypto_sign_ed25519_BYTES); -bool Proof::verify(const std::array& verify_pubkey) const -{ +bool Proof::verify(const std::array& verify_pubkey) const { std::array hash_to_sign = hash(); - int verify_result = crypto_sign_ed25519_verify_detached( - sig.data(), hash_to_sign.data(), hash_to_sign.size(), verify_pubkey.data()); - bool result = verify_result == 0; + bool result = proof_verify_internal(hash_to_sign, sig, verify_pubkey); return result; } -std::array Proof::hash() const -{ - // TODO: Check why does sys_time have a time since epoch? Is it counting some other duration? - uint64_t expiry_unix_ts_u64 = expiry_unix_ts.time_since_epoch().count(); - std::array result = {}; - crypto_generichash_blake2b_state state; - crypto_generichash_blake2b_init(&state, /*key*/ nullptr, 0, result.max_size()); - crypto_generichash_blake2b_update(&state, &version, sizeof(version)); - crypto_generichash_blake2b_update( - &state, gen_index_hash.data(), gen_index_hash.size()); - crypto_generichash_blake2b_update( - &state, rotating_pubkey.data(), rotating_pubkey.size()); - crypto_generichash_blake2b_update( - &state, reinterpret_cast(&expiry_unix_ts_u64), sizeof(expiry_unix_ts_u64)); - crypto_generichash_blake2b_final(&state, result.data(), result.size()); +std::array Proof::hash() const { + std::array result = proof_hash_internal( + version, gen_index_hash, rotating_pubkey, expiry_unix_ts.time_since_epoch().count()); return result; } -bool Proof::load(const dict& root) -{ +bool Proof::load(const dict& root) { std::optional version = maybe_int(root, "v"); std::optional> maybe_gen_index_hash = maybe_vector(root, "g"); std::optional> maybe_rotating_pubkey = maybe_vector(root, "r"); @@ -64,21 +112,20 @@ bool Proof::load(const dict& root) return true; } -bool Pro::verify(const std::array& verify_pubkey) const -{ - if (!proof.verify(verify_pubkey)) - return false; - - std::array rederived_pk; - [[maybe_unused]] session::cleared_uc32 rederived_sk; - crypto_sign_ed25519_seed_keypair( - rederived_pk.data(), rederived_sk.data(), rotating_privkey.data()); - bool result = rederived_pk == proof.rotating_pubkey; +bool Pro::verify(const std::array& verify_pubkey) const { + uint64_t expiry_unix_ts = proof.expiry_unix_ts.time_since_epoch().count(); + bool result = pro_verify_internal( + rotating_privkey, + verify_pubkey, + proof.version, + proof.gen_index_hash, + proof.rotating_pubkey, + expiry_unix_ts, + proof.sig); return result; } -bool Pro::load(const dict& root) -{ +bool Pro::load(const dict& root) { // Get proof fields sitting in 'p' dictionary auto p_it = root.find("p"); if (p_it == root.end()) @@ -101,3 +148,46 @@ bool Pro::load(const dict& root) } }; // namespace session::config + +// Ensure these are byte buffers and we can just use sizeof to build std::spans to interop with C++ +static_assert((sizeof((pro_pro*)0)->rotating_privkey) == crypto_sign_ed25519_SECRETKEYBYTES); +static_assert((sizeof((pro_proof*)0)->gen_index_hash) == 32); +static_assert((sizeof((pro_proof*)0)->rotating_pubkey) == crypto_sign_ed25519_PUBLICKEYBYTES); +static_assert((sizeof((pro_proof*)0)->sig) == crypto_sign_ed25519_BYTES); + +LIBSESSION_C_API bool proof_verify(pro_proof const* proof, uint8_t const* verify_pubkey) { + auto verify_pubkey_span = + std::span(verify_pubkey, crypto_sign_ed25519_PUBLICKEYBYTES); + auto gen_index_hash = + std::span(proof->gen_index_hash, sizeof proof->gen_index_hash); + auto rotating_pubkey = + std::span(proof->rotating_pubkey, sizeof proof->rotating_pubkey); + auto sig = std::span(proof->sig, sizeof proof->sig); + + std::array hash = proof_hash_internal( + proof->version, gen_index_hash, rotating_pubkey, proof->expiry_unix_ts); + bool result = proof_verify_internal(hash, sig, verify_pubkey_span); + return result; +} + +LIBSESSION_C_API bool pro_verify(pro_pro const* pro, uint8_t const* verify_pubkey) { + auto verify_pubkey_span = + std::span(verify_pubkey, crypto_sign_ed25519_PUBLICKEYBYTES); + auto rotating_privkey = + std::span(pro->rotating_privkey, sizeof pro->rotating_privkey); + auto gen_index_hash = + std::span(pro->proof.gen_index_hash, sizeof pro->proof.gen_index_hash); + auto rotating_pubkey = + std::span(pro->proof.rotating_pubkey, sizeof pro->proof.rotating_pubkey); + auto sig = std::span(pro->proof.sig, sizeof pro->proof.sig); + + bool result = pro_verify_internal( + rotating_privkey, + verify_pubkey_span, + pro->proof.version, + gen_index_hash, + rotating_pubkey, + pro->proof.expiry_unix_ts, + sig); + return result; +} From 69f38a777a8c59223d09e9b966e31c6cbb2f5acc Mon Sep 17 00:00:00 2001 From: doylet Date: Tue, 5 Aug 2025 11:48:20 +1000 Subject: [PATCH 10/59] Update protobufs for Pro and pro proofs --- proto/SessionProtos.pb.cc | 1184 +++++++++++++++++++++++++++++++------ proto/SessionProtos.pb.h | 926 ++++++++++++++++++++++++++++- proto/SessionProtos.proto | 8 +- 3 files changed, 1924 insertions(+), 194 deletions(-) diff --git a/proto/SessionProtos.pb.cc b/proto/SessionProtos.pb.cc index cd353a0f..f58247a3 100644 --- a/proto/SessionProtos.pb.cc +++ b/proto/SessionProtos.pb.cc @@ -352,6 +352,39 @@ struct ConfigurationMessage_ContactDefaultTypeInternal { }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ConfigurationMessage_ContactDefaultTypeInternal _ConfigurationMessage_Contact_default_instance_; +PROTOBUF_CONSTEXPR ConfigurationMessage_ProProof::ConfigurationMessage_ProProof( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.genindexhash_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.rotatingpublickey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.sig_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.expiryunixts_)*/uint64_t{0u} + , /*decltype(_impl_.version_)*/0u} {} +struct ConfigurationMessage_ProProofDefaultTypeInternal { + PROTOBUF_CONSTEXPR ConfigurationMessage_ProProofDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ConfigurationMessage_ProProofDefaultTypeInternal() {} + union { + ConfigurationMessage_ProProof _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ConfigurationMessage_ProProofDefaultTypeInternal _ConfigurationMessage_ProProof_default_instance_; +PROTOBUF_CONSTEXPR ConfigurationMessage_Pro::ConfigurationMessage_Pro( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.rotatingprivkey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.proof_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {} +struct ConfigurationMessage_ProDefaultTypeInternal { + PROTOBUF_CONSTEXPR ConfigurationMessage_ProDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ConfigurationMessage_ProDefaultTypeInternal() {} + union { + ConfigurationMessage_Pro _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ConfigurationMessage_ProDefaultTypeInternal _ConfigurationMessage_Pro_default_instance_; PROTOBUF_CONSTEXPR ConfigurationMessage::ConfigurationMessage( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_._has_bits_)*/{} @@ -361,7 +394,8 @@ PROTOBUF_CONSTEXPR ConfigurationMessage::ConfigurationMessage( , /*decltype(_impl_.contacts_)*/{} , /*decltype(_impl_.displayname_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} , /*decltype(_impl_.profilepicture_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.profilekey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {} + , /*decltype(_impl_.profilekey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.pro_)*/nullptr} {} struct ConfigurationMessageDefaultTypeInternal { PROTOBUF_CONSTEXPR ConfigurationMessageDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -8345,97 +8379,107 @@ std::string ConfigurationMessage_Contact::GetTypeName() const { // =================================================================== -class ConfigurationMessage::_Internal { +class ConfigurationMessage_ProProof::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_displayname(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_version(HasBits* has_bits) { + (*has_bits)[0] |= 16u; + } + static void set_has_genindexhash(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_profilepicture(HasBits* has_bits) { + static void set_has_rotatingpublickey(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static void set_has_profilekey(HasBits* has_bits) { + static void set_has_expiryunixts(HasBits* has_bits) { + (*has_bits)[0] |= 8u; + } + static void set_has_sig(HasBits* has_bits) { (*has_bits)[0] |= 4u; } + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x0000001f) ^ 0x0000001f) != 0; + } }; -ConfigurationMessage::ConfigurationMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, +ConfigurationMessage_ProProof::ConfigurationMessage_ProProof(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.ConfigurationMessage) + // @@protoc_insertion_point(arena_constructor:SessionProtos.ConfigurationMessage.ProProof) } -ConfigurationMessage::ConfigurationMessage(const ConfigurationMessage& from) +ConfigurationMessage_ProProof::ConfigurationMessage_ProProof(const ConfigurationMessage_ProProof& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - ConfigurationMessage* const _this = this; (void)_this; + ConfigurationMessage_ProProof* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.closedgroups_){from._impl_.closedgroups_} - , decltype(_impl_.opengroups_){from._impl_.opengroups_} - , decltype(_impl_.contacts_){from._impl_.contacts_} - , decltype(_impl_.displayname_){} - , decltype(_impl_.profilepicture_){} - , decltype(_impl_.profilekey_){}}; + , decltype(_impl_.genindexhash_){} + , decltype(_impl_.rotatingpublickey_){} + , decltype(_impl_.sig_){} + , decltype(_impl_.expiryunixts_){} + , decltype(_impl_.version_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.displayname_.InitDefault(); + _impl_.genindexhash_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.displayname_.Set("", GetArenaForAllocation()); + _impl_.genindexhash_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_displayname()) { - _this->_impl_.displayname_.Set(from._internal_displayname(), + if (from._internal_has_genindexhash()) { + _this->_impl_.genindexhash_.Set(from._internal_genindexhash(), _this->GetArenaForAllocation()); } - _impl_.profilepicture_.InitDefault(); + _impl_.rotatingpublickey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilepicture_.Set("", GetArenaForAllocation()); + _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_profilepicture()) { - _this->_impl_.profilepicture_.Set(from._internal_profilepicture(), + if (from._internal_has_rotatingpublickey()) { + _this->_impl_.rotatingpublickey_.Set(from._internal_rotatingpublickey(), _this->GetArenaForAllocation()); } - _impl_.profilekey_.InitDefault(); + _impl_.sig_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilekey_.Set("", GetArenaForAllocation()); + _impl_.sig_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_profilekey()) { - _this->_impl_.profilekey_.Set(from._internal_profilekey(), + if (from._internal_has_sig()) { + _this->_impl_.sig_.Set(from._internal_sig(), _this->GetArenaForAllocation()); } - // @@protoc_insertion_point(copy_constructor:SessionProtos.ConfigurationMessage) + ::memcpy(&_impl_.expiryunixts_, &from._impl_.expiryunixts_, + static_cast(reinterpret_cast(&_impl_.version_) - + reinterpret_cast(&_impl_.expiryunixts_)) + sizeof(_impl_.version_)); + // @@protoc_insertion_point(copy_constructor:SessionProtos.ConfigurationMessage.ProProof) } -inline void ConfigurationMessage::SharedCtor( +inline void ConfigurationMessage_ProProof::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.closedgroups_){arena} - , decltype(_impl_.opengroups_){arena} - , decltype(_impl_.contacts_){arena} - , decltype(_impl_.displayname_){} - , decltype(_impl_.profilepicture_){} - , decltype(_impl_.profilekey_){} + , decltype(_impl_.genindexhash_){} + , decltype(_impl_.rotatingpublickey_){} + , decltype(_impl_.sig_){} + , decltype(_impl_.expiryunixts_){uint64_t{0u}} + , decltype(_impl_.version_){0u} }; - _impl_.displayname_.InitDefault(); + _impl_.genindexhash_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.displayname_.Set("", GetArenaForAllocation()); + _impl_.genindexhash_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilepicture_.InitDefault(); + _impl_.rotatingpublickey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilepicture_.Set("", GetArenaForAllocation()); + _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilekey_.InitDefault(); + _impl_.sig_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilekey_.Set("", GetArenaForAllocation()); + _impl_.sig_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -ConfigurationMessage::~ConfigurationMessage() { - // @@protoc_insertion_point(destructor:SessionProtos.ConfigurationMessage) +ConfigurationMessage_ProProof::~ConfigurationMessage_ProProof() { + // @@protoc_insertion_point(destructor:SessionProtos.ConfigurationMessage.ProProof) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -8443,119 +8487,96 @@ ConfigurationMessage::~ConfigurationMessage() { SharedDtor(); } -inline void ConfigurationMessage::SharedDtor() { +inline void ConfigurationMessage_ProProof::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.closedgroups_.~RepeatedPtrField(); - _impl_.opengroups_.~RepeatedPtrField(); - _impl_.contacts_.~RepeatedPtrField(); - _impl_.displayname_.Destroy(); - _impl_.profilepicture_.Destroy(); - _impl_.profilekey_.Destroy(); + _impl_.genindexhash_.Destroy(); + _impl_.rotatingpublickey_.Destroy(); + _impl_.sig_.Destroy(); } -void ConfigurationMessage::SetCachedSize(int size) const { +void ConfigurationMessage_ProProof::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void ConfigurationMessage::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.ConfigurationMessage) +void ConfigurationMessage_ProProof::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.ConfigurationMessage.ProProof) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.closedgroups_.Clear(); - _impl_.opengroups_.Clear(); - _impl_.contacts_.Clear(); cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x00000001u) { - _impl_.displayname_.ClearNonDefaultToEmpty(); + _impl_.genindexhash_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.profilepicture_.ClearNonDefaultToEmpty(); + _impl_.rotatingpublickey_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000004u) { - _impl_.profilekey_.ClearNonDefaultToEmpty(); + _impl_.sig_.ClearNonDefaultToEmpty(); } } + if (cached_has_bits & 0x00000018u) { + ::memset(&_impl_.expiryunixts_, 0, static_cast( + reinterpret_cast(&_impl_.version_) - + reinterpret_cast(&_impl_.expiryunixts_)) + sizeof(_impl_.version_)); + } _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* ConfigurationMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* ConfigurationMessage_ProProof::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // repeated .SessionProtos.ConfigurationMessage.ClosedGroup closedGroups = 1; + // required uint32 version = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_closedgroups(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _Internal::set_has_version(&has_bits); + _impl_.version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); } else goto handle_unusual; continue; - // repeated string openGroups = 2; + // required bytes genIndexHash = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - ptr -= 1; - do { - ptr += 1; - auto str = _internal_add_opengroups(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); + auto str = _internal_mutable_genindexhash(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); } else goto handle_unusual; continue; - // optional string displayName = 3; + // required bytes rotatingPublicKey = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_displayname(); + auto str = _internal_mutable_rotatingpublickey(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional string profilePicture = 4; + // required uint64 expiryUnixTs = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { - auto str = _internal_mutable_profilepicture(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + _Internal::set_has_expiryunixts(&has_bits); + _impl_.expiryunixts_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else goto handle_unusual; continue; - // optional bytes profileKey = 5; + // required bytes sig = 5; case 5: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { - auto str = _internal_mutable_profilekey(); + auto str = _internal_mutable_sig(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // repeated .SessionProtos.ConfigurationMessage.Contact contacts = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_contacts(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr)); - } else - goto handle_unusual; - continue; default: goto handle_unusual; } // switch @@ -8580,115 +8601,121 @@ const char* ConfigurationMessage::_InternalParse(const char* ptr, ::_pbi::ParseC #undef CHK_ } -uint8_t* ConfigurationMessage::_InternalSerialize( +uint8_t* ConfigurationMessage_ProProof::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ConfigurationMessage) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ConfigurationMessage.ProProof) uint32_t cached_has_bits = 0; (void) cached_has_bits; - // repeated .SessionProtos.ConfigurationMessage.ClosedGroup closedGroups = 1; - for (unsigned i = 0, - n = static_cast(this->_internal_closedgroups_size()); i < n; i++) { - const auto& repfield = this->_internal_closedgroups(i); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream); - } - - // repeated string openGroups = 2; - for (int i = 0, n = this->_internal_opengroups_size(); i < n; i++) { - const auto& s = this->_internal_opengroups(i); - target = stream->WriteString(2, s, target); + cached_has_bits = _impl_._has_bits_[0]; + // required uint32 version = 1; + if (cached_has_bits & 0x00000010u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_version(), target); } - cached_has_bits = _impl_._has_bits_[0]; - // optional string displayName = 3; + // required bytes genIndexHash = 2; if (cached_has_bits & 0x00000001u) { - target = stream->WriteStringMaybeAliased( - 3, this->_internal_displayname(), target); + target = stream->WriteBytesMaybeAliased( + 2, this->_internal_genindexhash(), target); } - // optional string profilePicture = 4; + // required bytes rotatingPublicKey = 3; if (cached_has_bits & 0x00000002u) { - target = stream->WriteStringMaybeAliased( - 4, this->_internal_profilepicture(), target); + target = stream->WriteBytesMaybeAliased( + 3, this->_internal_rotatingpublickey(), target); } - // optional bytes profileKey = 5; - if (cached_has_bits & 0x00000004u) { - target = stream->WriteBytesMaybeAliased( - 5, this->_internal_profilekey(), target); + // required uint64 expiryUnixTs = 4; + if (cached_has_bits & 0x00000008u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_expiryunixts(), target); } - // repeated .SessionProtos.ConfigurationMessage.Contact contacts = 6; - for (unsigned i = 0, - n = static_cast(this->_internal_contacts_size()); i < n; i++) { - const auto& repfield = this->_internal_contacts(i); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(6, repfield, repfield.GetCachedSize(), target, stream); + // required bytes sig = 5; + if (cached_has_bits & 0x00000004u) { + target = stream->WriteBytesMaybeAliased( + 5, this->_internal_sig(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ConfigurationMessage) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ConfigurationMessage.ProProof) return target; } -size_t ConfigurationMessage::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ConfigurationMessage) +size_t ConfigurationMessage_ProProof::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.ConfigurationMessage.ProProof) size_t total_size = 0; - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; + if (_internal_has_genindexhash()) { + // required bytes genIndexHash = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_genindexhash()); + } - // repeated .SessionProtos.ConfigurationMessage.ClosedGroup closedGroups = 1; - total_size += 1UL * this->_internal_closedgroups_size(); - for (const auto& msg : this->_impl_.closedgroups_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + if (_internal_has_rotatingpublickey()) { + // required bytes rotatingPublicKey = 3; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_rotatingpublickey()); } - // repeated string openGroups = 2; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.opengroups_.size()); - for (int i = 0, n = _impl_.opengroups_.size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - _impl_.opengroups_.Get(i)); + if (_internal_has_sig()) { + // required bytes sig = 5; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_sig()); } - // repeated .SessionProtos.ConfigurationMessage.Contact contacts = 6; - total_size += 1UL * this->_internal_contacts_size(); - for (const auto& msg : this->_impl_.contacts_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + if (_internal_has_expiryunixts()) { + // required uint64 expiryUnixTs = 4; + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_expiryunixts()); } - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - // optional string displayName = 3; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_displayname()); - } + if (_internal_has_version()) { + // required uint32 version = 1; + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_version()); + } - // optional string profilePicture = 4; - if (cached_has_bits & 0x00000002u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_profilepicture()); - } + return total_size; +} +size_t ConfigurationMessage_ProProof::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ConfigurationMessage.ProProof) + size_t total_size = 0; - // optional bytes profileKey = 5; - if (cached_has_bits & 0x00000004u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_profilekey()); - } + if (((_impl_._has_bits_[0] & 0x0000001f) ^ 0x0000001f) == 0) { // All required fields are present. + // required bytes genIndexHash = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_genindexhash()); + + // required bytes rotatingPublicKey = 3; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_rotatingpublickey()); + // required bytes sig = 5; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_sig()); + + // required uint64 expiryUnixTs = 4; + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_expiryunixts()); + + // required uint32 version = 1; + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_version()); + + } else { + total_size += RequiredFieldsByteSizeFallback(); } + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } @@ -8697,49 +8724,821 @@ size_t ConfigurationMessage::ByteSizeLong() const { return total_size; } -void ConfigurationMessage::CheckTypeAndMergeFrom( +void ConfigurationMessage_ProProof::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void ConfigurationMessage::MergeFrom(const ConfigurationMessage& from) { - ConfigurationMessage* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ConfigurationMessage) +void ConfigurationMessage_ProProof::MergeFrom(const ConfigurationMessage_ProProof& from) { + ConfigurationMessage_ProProof* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ConfigurationMessage.ProProof) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.closedgroups_.MergeFrom(from._impl_.closedgroups_); - _this->_impl_.opengroups_.MergeFrom(from._impl_.opengroups_); - _this->_impl_.contacts_.MergeFrom(from._impl_.contacts_); cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x0000001fu) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_displayname(from._internal_displayname()); + _this->_internal_set_genindexhash(from._internal_genindexhash()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_profilepicture(from._internal_profilepicture()); + _this->_internal_set_rotatingpublickey(from._internal_rotatingpublickey()); } if (cached_has_bits & 0x00000004u) { - _this->_internal_set_profilekey(from._internal_profilekey()); + _this->_internal_set_sig(from._internal_sig()); } + if (cached_has_bits & 0x00000008u) { + _this->_impl_.expiryunixts_ = from._impl_.expiryunixts_; + } + if (cached_has_bits & 0x00000010u) { + _this->_impl_.version_ = from._impl_.version_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void ConfigurationMessage::CopyFrom(const ConfigurationMessage& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ConfigurationMessage) +void ConfigurationMessage_ProProof::CopyFrom(const ConfigurationMessage_ProProof& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ConfigurationMessage.ProProof) if (&from == this) return; Clear(); MergeFrom(from); } -bool ConfigurationMessage::IsInitialized() const { +bool ConfigurationMessage_ProProof::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; + return true; +} + +void ConfigurationMessage_ProProof::InternalSwap(ConfigurationMessage_ProProof* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.genindexhash_, lhs_arena, + &other->_impl_.genindexhash_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.rotatingpublickey_, lhs_arena, + &other->_impl_.rotatingpublickey_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.sig_, lhs_arena, + &other->_impl_.sig_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(ConfigurationMessage_ProProof, _impl_.version_) + + sizeof(ConfigurationMessage_ProProof::_impl_.version_) + - PROTOBUF_FIELD_OFFSET(ConfigurationMessage_ProProof, _impl_.expiryunixts_)>( + reinterpret_cast(&_impl_.expiryunixts_), + reinterpret_cast(&other->_impl_.expiryunixts_)); +} + +std::string ConfigurationMessage_ProProof::GetTypeName() const { + return "SessionProtos.ConfigurationMessage.ProProof"; +} + + +// =================================================================== + +class ConfigurationMessage_Pro::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_rotatingprivkey(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_proof(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; + } +}; + +ConfigurationMessage_Pro::ConfigurationMessage_Pro(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:SessionProtos.ConfigurationMessage.Pro) +} +ConfigurationMessage_Pro::ConfigurationMessage_Pro(const ConfigurationMessage_Pro& from) + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { + ConfigurationMessage_Pro* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.rotatingprivkey_){} + , decltype(_impl_.proof_){}}; + + _internal_metadata_.MergeFrom(from._internal_metadata_); + _impl_.rotatingprivkey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_rotatingprivkey()) { + _this->_impl_.rotatingprivkey_.Set(from._internal_rotatingprivkey(), + _this->GetArenaForAllocation()); + } + _impl_.proof_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.proof_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_proof()) { + _this->_impl_.proof_.Set(from._internal_proof(), + _this->GetArenaForAllocation()); + } + // @@protoc_insertion_point(copy_constructor:SessionProtos.ConfigurationMessage.Pro) +} + +inline void ConfigurationMessage_Pro::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.rotatingprivkey_){} + , decltype(_impl_.proof_){} + }; + _impl_.rotatingprivkey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.proof_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.proof_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +ConfigurationMessage_Pro::~ConfigurationMessage_Pro() { + // @@protoc_insertion_point(destructor:SessionProtos.ConfigurationMessage.Pro) + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void ConfigurationMessage_Pro::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.rotatingprivkey_.Destroy(); + _impl_.proof_.Destroy(); +} + +void ConfigurationMessage_Pro::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void ConfigurationMessage_Pro::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.ConfigurationMessage.Pro) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _impl_.rotatingprivkey_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000002u) { + _impl_.proof_.ClearNonDefaultToEmpty(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +const char* ConfigurationMessage_Pro::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // required bytes rotatingPrivKey = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_rotatingprivkey(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // required bytes proof = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_proof(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* ConfigurationMessage_Pro::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ConfigurationMessage.Pro) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + // required bytes rotatingPrivKey = 1; + if (cached_has_bits & 0x00000001u) { + target = stream->WriteBytesMaybeAliased( + 1, this->_internal_rotatingprivkey(), target); + } + + // required bytes proof = 2; + if (cached_has_bits & 0x00000002u) { + target = stream->WriteBytesMaybeAliased( + 2, this->_internal_proof(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ConfigurationMessage.Pro) + return target; +} + +size_t ConfigurationMessage_Pro::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.ConfigurationMessage.Pro) + size_t total_size = 0; + + if (_internal_has_rotatingprivkey()) { + // required bytes rotatingPrivKey = 1; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_rotatingprivkey()); + } + + if (_internal_has_proof()) { + // required bytes proof = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_proof()); + } + + return total_size; +} +size_t ConfigurationMessage_Pro::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ConfigurationMessage.Pro) + size_t total_size = 0; + + if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. + // required bytes rotatingPrivKey = 1; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_rotatingprivkey()); + + // required bytes proof = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_proof()); + + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ConfigurationMessage_Pro::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} + +void ConfigurationMessage_Pro::MergeFrom(const ConfigurationMessage_Pro& from) { + ConfigurationMessage_Pro* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ConfigurationMessage.Pro) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_rotatingprivkey(from._internal_rotatingprivkey()); + } + if (cached_has_bits & 0x00000002u) { + _this->_internal_set_proof(from._internal_proof()); + } + } + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); +} + +void ConfigurationMessage_Pro::CopyFrom(const ConfigurationMessage_Pro& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ConfigurationMessage.Pro) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ConfigurationMessage_Pro::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; + return true; +} + +void ConfigurationMessage_Pro::InternalSwap(ConfigurationMessage_Pro* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.rotatingprivkey_, lhs_arena, + &other->_impl_.rotatingprivkey_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.proof_, lhs_arena, + &other->_impl_.proof_, rhs_arena + ); +} + +std::string ConfigurationMessage_Pro::GetTypeName() const { + return "SessionProtos.ConfigurationMessage.Pro"; +} + + +// =================================================================== + +class ConfigurationMessage::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_displayname(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_profilepicture(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_profilekey(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static const ::SessionProtos::ConfigurationMessage_Pro& pro(const ConfigurationMessage* msg); + static void set_has_pro(HasBits* has_bits) { + (*has_bits)[0] |= 8u; + } +}; + +const ::SessionProtos::ConfigurationMessage_Pro& +ConfigurationMessage::_Internal::pro(const ConfigurationMessage* msg) { + return *msg->_impl_.pro_; +} +ConfigurationMessage::ConfigurationMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:SessionProtos.ConfigurationMessage) +} +ConfigurationMessage::ConfigurationMessage(const ConfigurationMessage& from) + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { + ConfigurationMessage* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.closedgroups_){from._impl_.closedgroups_} + , decltype(_impl_.opengroups_){from._impl_.opengroups_} + , decltype(_impl_.contacts_){from._impl_.contacts_} + , decltype(_impl_.displayname_){} + , decltype(_impl_.profilepicture_){} + , decltype(_impl_.profilekey_){} + , decltype(_impl_.pro_){nullptr}}; + + _internal_metadata_.MergeFrom(from._internal_metadata_); + _impl_.displayname_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.displayname_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_displayname()) { + _this->_impl_.displayname_.Set(from._internal_displayname(), + _this->GetArenaForAllocation()); + } + _impl_.profilepicture_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.profilepicture_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_profilepicture()) { + _this->_impl_.profilepicture_.Set(from._internal_profilepicture(), + _this->GetArenaForAllocation()); + } + _impl_.profilekey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.profilekey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_profilekey()) { + _this->_impl_.profilekey_.Set(from._internal_profilekey(), + _this->GetArenaForAllocation()); + } + if (from._internal_has_pro()) { + _this->_impl_.pro_ = new ::SessionProtos::ConfigurationMessage_Pro(*from._impl_.pro_); + } + // @@protoc_insertion_point(copy_constructor:SessionProtos.ConfigurationMessage) +} + +inline void ConfigurationMessage::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.closedgroups_){arena} + , decltype(_impl_.opengroups_){arena} + , decltype(_impl_.contacts_){arena} + , decltype(_impl_.displayname_){} + , decltype(_impl_.profilepicture_){} + , decltype(_impl_.profilekey_){} + , decltype(_impl_.pro_){nullptr} + }; + _impl_.displayname_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.displayname_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.profilepicture_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.profilepicture_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.profilekey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.profilekey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +ConfigurationMessage::~ConfigurationMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.ConfigurationMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void ConfigurationMessage::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.closedgroups_.~RepeatedPtrField(); + _impl_.opengroups_.~RepeatedPtrField(); + _impl_.contacts_.~RepeatedPtrField(); + _impl_.displayname_.Destroy(); + _impl_.profilepicture_.Destroy(); + _impl_.profilekey_.Destroy(); + if (this != internal_default_instance()) delete _impl_.pro_; +} + +void ConfigurationMessage::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void ConfigurationMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.ConfigurationMessage) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.closedgroups_.Clear(); + _impl_.opengroups_.Clear(); + _impl_.contacts_.Clear(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x0000000fu) { + if (cached_has_bits & 0x00000001u) { + _impl_.displayname_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000002u) { + _impl_.profilepicture_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000004u) { + _impl_.profilekey_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000008u) { + GOOGLE_DCHECK(_impl_.pro_ != nullptr); + _impl_.pro_->Clear(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +const char* ConfigurationMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // repeated .SessionProtos.ConfigurationMessage.ClosedGroup closedGroups = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_closedgroups(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); + } else + goto handle_unusual; + continue; + // repeated string openGroups = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr -= 1; + do { + ptr += 1; + auto str = _internal_add_opengroups(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); + } else + goto handle_unusual; + continue; + // optional string displayName = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + auto str = _internal_mutable_displayname(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional string profilePicture = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + auto str = _internal_mutable_profilepicture(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional bytes profileKey = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + auto str = _internal_mutable_profilekey(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // repeated .SessionProtos.ConfigurationMessage.Contact contacts = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_contacts(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr)); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.ConfigurationMessage.Pro pro = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { + ptr = ctx->ParseMessage(_internal_mutable_pro(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* ConfigurationMessage::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ConfigurationMessage) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .SessionProtos.ConfigurationMessage.ClosedGroup closedGroups = 1; + for (unsigned i = 0, + n = static_cast(this->_internal_closedgroups_size()); i < n; i++) { + const auto& repfield = this->_internal_closedgroups(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream); + } + + // repeated string openGroups = 2; + for (int i = 0, n = this->_internal_opengroups_size(); i < n; i++) { + const auto& s = this->_internal_opengroups(i); + target = stream->WriteString(2, s, target); + } + + cached_has_bits = _impl_._has_bits_[0]; + // optional string displayName = 3; + if (cached_has_bits & 0x00000001u) { + target = stream->WriteStringMaybeAliased( + 3, this->_internal_displayname(), target); + } + + // optional string profilePicture = 4; + if (cached_has_bits & 0x00000002u) { + target = stream->WriteStringMaybeAliased( + 4, this->_internal_profilepicture(), target); + } + + // optional bytes profileKey = 5; + if (cached_has_bits & 0x00000004u) { + target = stream->WriteBytesMaybeAliased( + 5, this->_internal_profilekey(), target); + } + + // repeated .SessionProtos.ConfigurationMessage.Contact contacts = 6; + for (unsigned i = 0, + n = static_cast(this->_internal_contacts_size()); i < n; i++) { + const auto& repfield = this->_internal_contacts(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(6, repfield, repfield.GetCachedSize(), target, stream); + } + + // optional .SessionProtos.ConfigurationMessage.Pro pro = 7; + if (cached_has_bits & 0x00000008u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(7, _Internal::pro(this), + _Internal::pro(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ConfigurationMessage) + return target; +} + +size_t ConfigurationMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ConfigurationMessage) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .SessionProtos.ConfigurationMessage.ClosedGroup closedGroups = 1; + total_size += 1UL * this->_internal_closedgroups_size(); + for (const auto& msg : this->_impl_.closedgroups_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // repeated string openGroups = 2; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.opengroups_.size()); + for (int i = 0, n = _impl_.opengroups_.size(); i < n; i++) { + total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + _impl_.opengroups_.Get(i)); + } + + // repeated .SessionProtos.ConfigurationMessage.Contact contacts = 6; + total_size += 1UL * this->_internal_contacts_size(); + for (const auto& msg : this->_impl_.contacts_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x0000000fu) { + // optional string displayName = 3; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_displayname()); + } + + // optional string profilePicture = 4; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_profilepicture()); + } + + // optional bytes profileKey = 5; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_profilekey()); + } + + // optional .SessionProtos.ConfigurationMessage.Pro pro = 7; + if (cached_has_bits & 0x00000008u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.pro_); + } + + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ConfigurationMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} + +void ConfigurationMessage::MergeFrom(const ConfigurationMessage& from) { + ConfigurationMessage* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ConfigurationMessage) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.closedgroups_.MergeFrom(from._impl_.closedgroups_); + _this->_impl_.opengroups_.MergeFrom(from._impl_.opengroups_); + _this->_impl_.contacts_.MergeFrom(from._impl_.contacts_); + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x0000000fu) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_displayname(from._internal_displayname()); + } + if (cached_has_bits & 0x00000002u) { + _this->_internal_set_profilepicture(from._internal_profilepicture()); + } + if (cached_has_bits & 0x00000004u) { + _this->_internal_set_profilekey(from._internal_profilekey()); + } + if (cached_has_bits & 0x00000008u) { + _this->_internal_mutable_pro()->::SessionProtos::ConfigurationMessage_Pro::MergeFrom( + from._internal_pro()); + } + } + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); +} + +void ConfigurationMessage::CopyFrom(const ConfigurationMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ConfigurationMessage) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ConfigurationMessage::IsInitialized() const { if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.closedgroups_)) return false; if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.contacts_)) return false; + if (_internal_has_pro()) { + if (!_impl_.pro_->IsInitialized()) return false; + } return true; } @@ -8764,6 +9563,7 @@ void ConfigurationMessage::InternalSwap(ConfigurationMessage* other) { &_impl_.profilekey_, lhs_arena, &other->_impl_.profilekey_, rhs_arena ); + swap(_impl_.pro_, other->_impl_.pro_); } std::string ConfigurationMessage::GetTypeName() const { @@ -10089,6 +10889,14 @@ template<> PROTOBUF_NOINLINE ::SessionProtos::ConfigurationMessage_Contact* Arena::CreateMaybeMessage< ::SessionProtos::ConfigurationMessage_Contact >(Arena* arena) { return Arena::CreateMessageInternal< ::SessionProtos::ConfigurationMessage_Contact >(arena); } +template<> PROTOBUF_NOINLINE ::SessionProtos::ConfigurationMessage_ProProof* +Arena::CreateMaybeMessage< ::SessionProtos::ConfigurationMessage_ProProof >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::ConfigurationMessage_ProProof >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::ConfigurationMessage_Pro* +Arena::CreateMaybeMessage< ::SessionProtos::ConfigurationMessage_Pro >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::ConfigurationMessage_Pro >(arena); +} template<> PROTOBUF_NOINLINE ::SessionProtos::ConfigurationMessage* Arena::CreateMaybeMessage< ::SessionProtos::ConfigurationMessage >(Arena* arena) { return Arena::CreateMessageInternal< ::SessionProtos::ConfigurationMessage >(arena); diff --git a/proto/SessionProtos.pb.h b/proto/SessionProtos.pb.h index e75a5652..e05be469 100644 --- a/proto/SessionProtos.pb.h +++ b/proto/SessionProtos.pb.h @@ -58,6 +58,12 @@ extern ConfigurationMessage_ClosedGroupDefaultTypeInternal _ConfigurationMessage class ConfigurationMessage_Contact; struct ConfigurationMessage_ContactDefaultTypeInternal; extern ConfigurationMessage_ContactDefaultTypeInternal _ConfigurationMessage_Contact_default_instance_; +class ConfigurationMessage_Pro; +struct ConfigurationMessage_ProDefaultTypeInternal; +extern ConfigurationMessage_ProDefaultTypeInternal _ConfigurationMessage_Pro_default_instance_; +class ConfigurationMessage_ProProof; +struct ConfigurationMessage_ProProofDefaultTypeInternal; +extern ConfigurationMessage_ProProofDefaultTypeInternal _ConfigurationMessage_ProProof_default_instance_; class Content; struct ContentDefaultTypeInternal; extern ContentDefaultTypeInternal _Content_default_instance_; @@ -119,6 +125,8 @@ template<> ::SessionProtos::CallMessage* Arena::CreateMaybeMessage<::SessionProt template<> ::SessionProtos::ConfigurationMessage* Arena::CreateMaybeMessage<::SessionProtos::ConfigurationMessage>(Arena*); template<> ::SessionProtos::ConfigurationMessage_ClosedGroup* Arena::CreateMaybeMessage<::SessionProtos::ConfigurationMessage_ClosedGroup>(Arena*); template<> ::SessionProtos::ConfigurationMessage_Contact* Arena::CreateMaybeMessage<::SessionProtos::ConfigurationMessage_Contact>(Arena*); +template<> ::SessionProtos::ConfigurationMessage_Pro* Arena::CreateMaybeMessage<::SessionProtos::ConfigurationMessage_Pro>(Arena*); +template<> ::SessionProtos::ConfigurationMessage_ProProof* Arena::CreateMaybeMessage<::SessionProtos::ConfigurationMessage_ProProof>(Arena*); template<> ::SessionProtos::Content* Arena::CreateMaybeMessage<::SessionProtos::Content>(Arena*); template<> ::SessionProtos::DataExtractionNotification* Arena::CreateMaybeMessage<::SessionProtos::DataExtractionNotification>(Arena*); template<> ::SessionProtos::DataMessage* Arena::CreateMaybeMessage<::SessionProtos::DataMessage>(Arena*); @@ -4689,6 +4697,396 @@ class ConfigurationMessage_Contact final : }; // ------------------------------------------------------------------- +class ConfigurationMessage_ProProof final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ConfigurationMessage.ProProof) */ { + public: + inline ConfigurationMessage_ProProof() : ConfigurationMessage_ProProof(nullptr) {} + ~ConfigurationMessage_ProProof() override; + explicit PROTOBUF_CONSTEXPR ConfigurationMessage_ProProof(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + ConfigurationMessage_ProProof(const ConfigurationMessage_ProProof& from); + ConfigurationMessage_ProProof(ConfigurationMessage_ProProof&& from) noexcept + : ConfigurationMessage_ProProof() { + *this = ::std::move(from); + } + + inline ConfigurationMessage_ProProof& operator=(const ConfigurationMessage_ProProof& from) { + CopyFrom(from); + return *this; + } + inline ConfigurationMessage_ProProof& operator=(ConfigurationMessage_ProProof&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + } + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ConfigurationMessage_ProProof& default_instance() { + return *internal_default_instance(); + } + static inline const ConfigurationMessage_ProProof* internal_default_instance() { + return reinterpret_cast( + &_ConfigurationMessage_ProProof_default_instance_); + } + static constexpr int kIndexInFileMessages = + 19; + + friend void swap(ConfigurationMessage_ProProof& a, ConfigurationMessage_ProProof& b) { + a.Swap(&b); + } + inline void Swap(ConfigurationMessage_ProProof* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConfigurationMessage_ProProof* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + ConfigurationMessage_ProProof* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; + void CopyFrom(const ConfigurationMessage_ProProof& from); + void MergeFrom(const ConfigurationMessage_ProProof& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ConfigurationMessage_ProProof* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "SessionProtos.ConfigurationMessage.ProProof"; + } + protected: + explicit ConfigurationMessage_ProProof(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + std::string GetTypeName() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kGenIndexHashFieldNumber = 2, + kRotatingPublicKeyFieldNumber = 3, + kSigFieldNumber = 5, + kExpiryUnixTsFieldNumber = 4, + kVersionFieldNumber = 1, + }; + // required bytes genIndexHash = 2; + bool has_genindexhash() const; + private: + bool _internal_has_genindexhash() const; + public: + void clear_genindexhash(); + const std::string& genindexhash() const; + template + void set_genindexhash(ArgT0&& arg0, ArgT... args); + std::string* mutable_genindexhash(); + PROTOBUF_NODISCARD std::string* release_genindexhash(); + void set_allocated_genindexhash(std::string* genindexhash); + private: + const std::string& _internal_genindexhash() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_genindexhash(const std::string& value); + std::string* _internal_mutable_genindexhash(); + public: + + // required bytes rotatingPublicKey = 3; + bool has_rotatingpublickey() const; + private: + bool _internal_has_rotatingpublickey() const; + public: + void clear_rotatingpublickey(); + const std::string& rotatingpublickey() const; + template + void set_rotatingpublickey(ArgT0&& arg0, ArgT... args); + std::string* mutable_rotatingpublickey(); + PROTOBUF_NODISCARD std::string* release_rotatingpublickey(); + void set_allocated_rotatingpublickey(std::string* rotatingpublickey); + private: + const std::string& _internal_rotatingpublickey() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_rotatingpublickey(const std::string& value); + std::string* _internal_mutable_rotatingpublickey(); + public: + + // required bytes sig = 5; + bool has_sig() const; + private: + bool _internal_has_sig() const; + public: + void clear_sig(); + const std::string& sig() const; + template + void set_sig(ArgT0&& arg0, ArgT... args); + std::string* mutable_sig(); + PROTOBUF_NODISCARD std::string* release_sig(); + void set_allocated_sig(std::string* sig); + private: + const std::string& _internal_sig() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_sig(const std::string& value); + std::string* _internal_mutable_sig(); + public: + + // required uint64 expiryUnixTs = 4; + bool has_expiryunixts() const; + private: + bool _internal_has_expiryunixts() const; + public: + void clear_expiryunixts(); + uint64_t expiryunixts() const; + void set_expiryunixts(uint64_t value); + private: + uint64_t _internal_expiryunixts() const; + void _internal_set_expiryunixts(uint64_t value); + public: + + // required uint32 version = 1; + bool has_version() const; + private: + bool _internal_has_version() const; + public: + void clear_version(); + uint32_t version() const; + void set_version(uint32_t value); + private: + uint32_t _internal_version() const; + void _internal_set_version(uint32_t value); + public: + + // @@protoc_insertion_point(class_scope:SessionProtos.ConfigurationMessage.ProProof) + private: + class _Internal; + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr genindexhash_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr rotatingpublickey_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr sig_; + uint64_t expiryunixts_; + uint32_t version_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_SessionProtos_2eproto; +}; +// ------------------------------------------------------------------- + +class ConfigurationMessage_Pro final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ConfigurationMessage.Pro) */ { + public: + inline ConfigurationMessage_Pro() : ConfigurationMessage_Pro(nullptr) {} + ~ConfigurationMessage_Pro() override; + explicit PROTOBUF_CONSTEXPR ConfigurationMessage_Pro(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + ConfigurationMessage_Pro(const ConfigurationMessage_Pro& from); + ConfigurationMessage_Pro(ConfigurationMessage_Pro&& from) noexcept + : ConfigurationMessage_Pro() { + *this = ::std::move(from); + } + + inline ConfigurationMessage_Pro& operator=(const ConfigurationMessage_Pro& from) { + CopyFrom(from); + return *this; + } + inline ConfigurationMessage_Pro& operator=(ConfigurationMessage_Pro&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + } + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ConfigurationMessage_Pro& default_instance() { + return *internal_default_instance(); + } + static inline const ConfigurationMessage_Pro* internal_default_instance() { + return reinterpret_cast( + &_ConfigurationMessage_Pro_default_instance_); + } + static constexpr int kIndexInFileMessages = + 20; + + friend void swap(ConfigurationMessage_Pro& a, ConfigurationMessage_Pro& b) { + a.Swap(&b); + } + inline void Swap(ConfigurationMessage_Pro* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ConfigurationMessage_Pro* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + ConfigurationMessage_Pro* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; + void CopyFrom(const ConfigurationMessage_Pro& from); + void MergeFrom(const ConfigurationMessage_Pro& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ConfigurationMessage_Pro* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "SessionProtos.ConfigurationMessage.Pro"; + } + protected: + explicit ConfigurationMessage_Pro(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + std::string GetTypeName() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kRotatingPrivKeyFieldNumber = 1, + kProofFieldNumber = 2, + }; + // required bytes rotatingPrivKey = 1; + bool has_rotatingprivkey() const; + private: + bool _internal_has_rotatingprivkey() const; + public: + void clear_rotatingprivkey(); + const std::string& rotatingprivkey() const; + template + void set_rotatingprivkey(ArgT0&& arg0, ArgT... args); + std::string* mutable_rotatingprivkey(); + PROTOBUF_NODISCARD std::string* release_rotatingprivkey(); + void set_allocated_rotatingprivkey(std::string* rotatingprivkey); + private: + const std::string& _internal_rotatingprivkey() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_rotatingprivkey(const std::string& value); + std::string* _internal_mutable_rotatingprivkey(); + public: + + // required bytes proof = 2; + bool has_proof() const; + private: + bool _internal_has_proof() const; + public: + void clear_proof(); + const std::string& proof() const; + template + void set_proof(ArgT0&& arg0, ArgT... args); + std::string* mutable_proof(); + PROTOBUF_NODISCARD std::string* release_proof(); + void set_allocated_proof(std::string* proof); + private: + const std::string& _internal_proof() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_proof(const std::string& value); + std::string* _internal_mutable_proof(); + public: + + // @@protoc_insertion_point(class_scope:SessionProtos.ConfigurationMessage.Pro) + private: + class _Internal; + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr rotatingprivkey_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr proof_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_SessionProtos_2eproto; +}; +// ------------------------------------------------------------------- + class ConfigurationMessage final : public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ConfigurationMessage) */ { public: @@ -4735,7 +5133,7 @@ class ConfigurationMessage final : &_ConfigurationMessage_default_instance_); } static constexpr int kIndexInFileMessages = - 19; + 21; friend void swap(ConfigurationMessage& a, ConfigurationMessage& b) { a.Swap(&b); @@ -4798,6 +5196,8 @@ class ConfigurationMessage final : typedef ConfigurationMessage_ClosedGroup ClosedGroup; typedef ConfigurationMessage_Contact Contact; + typedef ConfigurationMessage_ProProof ProProof; + typedef ConfigurationMessage_Pro Pro; // accessors ------------------------------------------------------- @@ -4808,6 +5208,7 @@ class ConfigurationMessage final : kDisplayNameFieldNumber = 3, kProfilePictureFieldNumber = 4, kProfileKeyFieldNumber = 5, + kProFieldNumber = 7, }; // repeated .SessionProtos.ConfigurationMessage.ClosedGroup closedGroups = 1; int closedgroups_size() const; @@ -4923,6 +5324,24 @@ class ConfigurationMessage final : std::string* _internal_mutable_profilekey(); public: + // optional .SessionProtos.ConfigurationMessage.Pro pro = 7; + bool has_pro() const; + private: + bool _internal_has_pro() const; + public: + void clear_pro(); + const ::SessionProtos::ConfigurationMessage_Pro& pro() const; + PROTOBUF_NODISCARD ::SessionProtos::ConfigurationMessage_Pro* release_pro(); + ::SessionProtos::ConfigurationMessage_Pro* mutable_pro(); + void set_allocated_pro(::SessionProtos::ConfigurationMessage_Pro* pro); + private: + const ::SessionProtos::ConfigurationMessage_Pro& _internal_pro() const; + ::SessionProtos::ConfigurationMessage_Pro* _internal_mutable_pro(); + public: + void unsafe_arena_set_allocated_pro( + ::SessionProtos::ConfigurationMessage_Pro* pro); + ::SessionProtos::ConfigurationMessage_Pro* unsafe_arena_release_pro(); + // @@protoc_insertion_point(class_scope:SessionProtos.ConfigurationMessage) private: class _Internal; @@ -4939,6 +5358,7 @@ class ConfigurationMessage final : ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr displayname_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilepicture_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilekey_; + ::SessionProtos::ConfigurationMessage_Pro* pro_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; @@ -4991,7 +5411,7 @@ class ReceiptMessage final : &_ReceiptMessage_default_instance_); } static constexpr int kIndexInFileMessages = - 20; + 22; friend void swap(ReceiptMessage& a, ReceiptMessage& b) { a.Swap(&b); @@ -5183,7 +5603,7 @@ class AttachmentPointer final : &_AttachmentPointer_default_instance_); } static constexpr int kIndexInFileMessages = - 21; + 23; friend void swap(AttachmentPointer& a, AttachmentPointer& b) { a.Swap(&b); @@ -5549,7 +5969,7 @@ class SharedConfigMessage final : &_SharedConfigMessage_default_instance_); } static constexpr int kIndexInFileMessages = - 22; + 24; friend void swap(SharedConfigMessage& a, SharedConfigMessage& b) { a.Swap(&b); @@ -11045,6 +11465,410 @@ inline void ConfigurationMessage_Contact::set_didapproveme(bool value) { // ------------------------------------------------------------------- +// ConfigurationMessage_ProProof + +// required uint32 version = 1; +inline bool ConfigurationMessage_ProProof::_internal_has_version() const { + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; + return value; +} +inline bool ConfigurationMessage_ProProof::has_version() const { + return _internal_has_version(); +} +inline void ConfigurationMessage_ProProof::clear_version() { + _impl_.version_ = 0u; + _impl_._has_bits_[0] &= ~0x00000010u; +} +inline uint32_t ConfigurationMessage_ProProof::_internal_version() const { + return _impl_.version_; +} +inline uint32_t ConfigurationMessage_ProProof::version() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ProProof.version) + return _internal_version(); +} +inline void ConfigurationMessage_ProProof::_internal_set_version(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.version_ = value; +} +inline void ConfigurationMessage_ProProof::set_version(uint32_t value) { + _internal_set_version(value); + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ProProof.version) +} + +// required bytes genIndexHash = 2; +inline bool ConfigurationMessage_ProProof::_internal_has_genindexhash() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool ConfigurationMessage_ProProof::has_genindexhash() const { + return _internal_has_genindexhash(); +} +inline void ConfigurationMessage_ProProof::clear_genindexhash() { + _impl_.genindexhash_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& ConfigurationMessage_ProProof::genindexhash() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ProProof.genIndexHash) + return _internal_genindexhash(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void ConfigurationMessage_ProProof::set_genindexhash(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.genindexhash_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ProProof.genIndexHash) +} +inline std::string* ConfigurationMessage_ProProof::mutable_genindexhash() { + std::string* _s = _internal_mutable_genindexhash(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ProProof.genIndexHash) + return _s; +} +inline const std::string& ConfigurationMessage_ProProof::_internal_genindexhash() const { + return _impl_.genindexhash_.Get(); +} +inline void ConfigurationMessage_ProProof::_internal_set_genindexhash(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.genindexhash_.Set(value, GetArenaForAllocation()); +} +inline std::string* ConfigurationMessage_ProProof::_internal_mutable_genindexhash() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.genindexhash_.Mutable(GetArenaForAllocation()); +} +inline std::string* ConfigurationMessage_ProProof::release_genindexhash() { + // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.ProProof.genIndexHash) + if (!_internal_has_genindexhash()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.genindexhash_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.genindexhash_.IsDefault()) { + _impl_.genindexhash_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void ConfigurationMessage_ProProof::set_allocated_genindexhash(std::string* genindexhash) { + if (genindexhash != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.genindexhash_.SetAllocated(genindexhash, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.genindexhash_.IsDefault()) { + _impl_.genindexhash_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.ProProof.genIndexHash) +} + +// required bytes rotatingPublicKey = 3; +inline bool ConfigurationMessage_ProProof::_internal_has_rotatingpublickey() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool ConfigurationMessage_ProProof::has_rotatingpublickey() const { + return _internal_has_rotatingpublickey(); +} +inline void ConfigurationMessage_ProProof::clear_rotatingpublickey() { + _impl_.rotatingpublickey_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline const std::string& ConfigurationMessage_ProProof::rotatingpublickey() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ProProof.rotatingPublicKey) + return _internal_rotatingpublickey(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void ConfigurationMessage_ProProof::set_rotatingpublickey(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.rotatingpublickey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ProProof.rotatingPublicKey) +} +inline std::string* ConfigurationMessage_ProProof::mutable_rotatingpublickey() { + std::string* _s = _internal_mutable_rotatingpublickey(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ProProof.rotatingPublicKey) + return _s; +} +inline const std::string& ConfigurationMessage_ProProof::_internal_rotatingpublickey() const { + return _impl_.rotatingpublickey_.Get(); +} +inline void ConfigurationMessage_ProProof::_internal_set_rotatingpublickey(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.rotatingpublickey_.Set(value, GetArenaForAllocation()); +} +inline std::string* ConfigurationMessage_ProProof::_internal_mutable_rotatingpublickey() { + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.rotatingpublickey_.Mutable(GetArenaForAllocation()); +} +inline std::string* ConfigurationMessage_ProProof::release_rotatingpublickey() { + // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.ProProof.rotatingPublicKey) + if (!_internal_has_rotatingpublickey()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.rotatingpublickey_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.rotatingpublickey_.IsDefault()) { + _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void ConfigurationMessage_ProProof::set_allocated_rotatingpublickey(std::string* rotatingpublickey) { + if (rotatingpublickey != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + _impl_.rotatingpublickey_.SetAllocated(rotatingpublickey, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.rotatingpublickey_.IsDefault()) { + _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.ProProof.rotatingPublicKey) +} + +// required uint64 expiryUnixTs = 4; +inline bool ConfigurationMessage_ProProof::_internal_has_expiryunixts() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + return value; +} +inline bool ConfigurationMessage_ProProof::has_expiryunixts() const { + return _internal_has_expiryunixts(); +} +inline void ConfigurationMessage_ProProof::clear_expiryunixts() { + _impl_.expiryunixts_ = uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000008u; +} +inline uint64_t ConfigurationMessage_ProProof::_internal_expiryunixts() const { + return _impl_.expiryunixts_; +} +inline uint64_t ConfigurationMessage_ProProof::expiryunixts() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ProProof.expiryUnixTs) + return _internal_expiryunixts(); +} +inline void ConfigurationMessage_ProProof::_internal_set_expiryunixts(uint64_t value) { + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.expiryunixts_ = value; +} +inline void ConfigurationMessage_ProProof::set_expiryunixts(uint64_t value) { + _internal_set_expiryunixts(value); + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ProProof.expiryUnixTs) +} + +// required bytes sig = 5; +inline bool ConfigurationMessage_ProProof::_internal_has_sig() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; +} +inline bool ConfigurationMessage_ProProof::has_sig() const { + return _internal_has_sig(); +} +inline void ConfigurationMessage_ProProof::clear_sig() { + _impl_.sig_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000004u; +} +inline const std::string& ConfigurationMessage_ProProof::sig() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ProProof.sig) + return _internal_sig(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void ConfigurationMessage_ProProof::set_sig(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.sig_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ProProof.sig) +} +inline std::string* ConfigurationMessage_ProProof::mutable_sig() { + std::string* _s = _internal_mutable_sig(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ProProof.sig) + return _s; +} +inline const std::string& ConfigurationMessage_ProProof::_internal_sig() const { + return _impl_.sig_.Get(); +} +inline void ConfigurationMessage_ProProof::_internal_set_sig(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.sig_.Set(value, GetArenaForAllocation()); +} +inline std::string* ConfigurationMessage_ProProof::_internal_mutable_sig() { + _impl_._has_bits_[0] |= 0x00000004u; + return _impl_.sig_.Mutable(GetArenaForAllocation()); +} +inline std::string* ConfigurationMessage_ProProof::release_sig() { + // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.ProProof.sig) + if (!_internal_has_sig()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000004u; + auto* p = _impl_.sig_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.sig_.IsDefault()) { + _impl_.sig_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void ConfigurationMessage_ProProof::set_allocated_sig(std::string* sig) { + if (sig != nullptr) { + _impl_._has_bits_[0] |= 0x00000004u; + } else { + _impl_._has_bits_[0] &= ~0x00000004u; + } + _impl_.sig_.SetAllocated(sig, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.sig_.IsDefault()) { + _impl_.sig_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.ProProof.sig) +} + +// ------------------------------------------------------------------- + +// ConfigurationMessage_Pro + +// required bytes rotatingPrivKey = 1; +inline bool ConfigurationMessage_Pro::_internal_has_rotatingprivkey() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool ConfigurationMessage_Pro::has_rotatingprivkey() const { + return _internal_has_rotatingprivkey(); +} +inline void ConfigurationMessage_Pro::clear_rotatingprivkey() { + _impl_.rotatingprivkey_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& ConfigurationMessage_Pro::rotatingprivkey() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Pro.rotatingPrivKey) + return _internal_rotatingprivkey(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void ConfigurationMessage_Pro::set_rotatingprivkey(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.rotatingprivkey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Pro.rotatingPrivKey) +} +inline std::string* ConfigurationMessage_Pro::mutable_rotatingprivkey() { + std::string* _s = _internal_mutable_rotatingprivkey(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.Pro.rotatingPrivKey) + return _s; +} +inline const std::string& ConfigurationMessage_Pro::_internal_rotatingprivkey() const { + return _impl_.rotatingprivkey_.Get(); +} +inline void ConfigurationMessage_Pro::_internal_set_rotatingprivkey(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.rotatingprivkey_.Set(value, GetArenaForAllocation()); +} +inline std::string* ConfigurationMessage_Pro::_internal_mutable_rotatingprivkey() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.rotatingprivkey_.Mutable(GetArenaForAllocation()); +} +inline std::string* ConfigurationMessage_Pro::release_rotatingprivkey() { + // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.Pro.rotatingPrivKey) + if (!_internal_has_rotatingprivkey()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.rotatingprivkey_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.rotatingprivkey_.IsDefault()) { + _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void ConfigurationMessage_Pro::set_allocated_rotatingprivkey(std::string* rotatingprivkey) { + if (rotatingprivkey != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.rotatingprivkey_.SetAllocated(rotatingprivkey, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.rotatingprivkey_.IsDefault()) { + _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.Pro.rotatingPrivKey) +} + +// required bytes proof = 2; +inline bool ConfigurationMessage_Pro::_internal_has_proof() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool ConfigurationMessage_Pro::has_proof() const { + return _internal_has_proof(); +} +inline void ConfigurationMessage_Pro::clear_proof() { + _impl_.proof_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline const std::string& ConfigurationMessage_Pro::proof() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Pro.proof) + return _internal_proof(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void ConfigurationMessage_Pro::set_proof(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.proof_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Pro.proof) +} +inline std::string* ConfigurationMessage_Pro::mutable_proof() { + std::string* _s = _internal_mutable_proof(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.Pro.proof) + return _s; +} +inline const std::string& ConfigurationMessage_Pro::_internal_proof() const { + return _impl_.proof_.Get(); +} +inline void ConfigurationMessage_Pro::_internal_set_proof(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.proof_.Set(value, GetArenaForAllocation()); +} +inline std::string* ConfigurationMessage_Pro::_internal_mutable_proof() { + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.proof_.Mutable(GetArenaForAllocation()); +} +inline std::string* ConfigurationMessage_Pro::release_proof() { + // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.Pro.proof) + if (!_internal_has_proof()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.proof_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.proof_.IsDefault()) { + _impl_.proof_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void ConfigurationMessage_Pro::set_allocated_proof(std::string* proof) { + if (proof != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + _impl_.proof_.SetAllocated(proof, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.proof_.IsDefault()) { + _impl_.proof_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.Pro.proof) +} + +// ------------------------------------------------------------------- + // ConfigurationMessage // repeated .SessionProtos.ConfigurationMessage.ClosedGroup closedGroups = 1; @@ -11406,6 +12230,96 @@ ConfigurationMessage::contacts() const { return _impl_.contacts_; } +// optional .SessionProtos.ConfigurationMessage.Pro pro = 7; +inline bool ConfigurationMessage::_internal_has_pro() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + PROTOBUF_ASSUME(!value || _impl_.pro_ != nullptr); + return value; +} +inline bool ConfigurationMessage::has_pro() const { + return _internal_has_pro(); +} +inline void ConfigurationMessage::clear_pro() { + if (_impl_.pro_ != nullptr) _impl_.pro_->Clear(); + _impl_._has_bits_[0] &= ~0x00000008u; +} +inline const ::SessionProtos::ConfigurationMessage_Pro& ConfigurationMessage::_internal_pro() const { + const ::SessionProtos::ConfigurationMessage_Pro* p = _impl_.pro_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_ConfigurationMessage_Pro_default_instance_); +} +inline const ::SessionProtos::ConfigurationMessage_Pro& ConfigurationMessage::pro() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.pro) + return _internal_pro(); +} +inline void ConfigurationMessage::unsafe_arena_set_allocated_pro( + ::SessionProtos::ConfigurationMessage_Pro* pro) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.pro_); + } + _impl_.pro_ = pro; + if (pro) { + _impl_._has_bits_[0] |= 0x00000008u; + } else { + _impl_._has_bits_[0] &= ~0x00000008u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.ConfigurationMessage.pro) +} +inline ::SessionProtos::ConfigurationMessage_Pro* ConfigurationMessage::release_pro() { + _impl_._has_bits_[0] &= ~0x00000008u; + ::SessionProtos::ConfigurationMessage_Pro* temp = _impl_.pro_; + _impl_.pro_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::SessionProtos::ConfigurationMessage_Pro* ConfigurationMessage::unsafe_arena_release_pro() { + // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.pro) + _impl_._has_bits_[0] &= ~0x00000008u; + ::SessionProtos::ConfigurationMessage_Pro* temp = _impl_.pro_; + _impl_.pro_ = nullptr; + return temp; +} +inline ::SessionProtos::ConfigurationMessage_Pro* ConfigurationMessage::_internal_mutable_pro() { + _impl_._has_bits_[0] |= 0x00000008u; + if (_impl_.pro_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::ConfigurationMessage_Pro>(GetArenaForAllocation()); + _impl_.pro_ = p; + } + return _impl_.pro_; +} +inline ::SessionProtos::ConfigurationMessage_Pro* ConfigurationMessage::mutable_pro() { + ::SessionProtos::ConfigurationMessage_Pro* _msg = _internal_mutable_pro(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.pro) + return _msg; +} +inline void ConfigurationMessage::set_allocated_pro(::SessionProtos::ConfigurationMessage_Pro* pro) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.pro_; + } + if (pro) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(pro); + if (message_arena != submessage_arena) { + pro = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, pro, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000008u; + } else { + _impl_._has_bits_[0] &= ~0x00000008u; + } + _impl_.pro_ = pro; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.pro) +} + // ------------------------------------------------------------------- // ReceiptMessage @@ -12282,6 +13196,10 @@ inline void SharedConfigMessage::set_allocated_data(std::string* data) { // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) diff --git a/proto/SessionProtos.proto b/proto/SessionProtos.proto index a9d434b0..cdac33c4 100644 --- a/proto/SessionProtos.proto +++ b/proto/SessionProtos.proto @@ -242,14 +242,18 @@ message ConfigurationMessage { required bytes sig = 5; } + message Pro { + required bytes rotatingPrivKey = 1; + required bytes proof = 2; + } + repeated ClosedGroup closedGroups = 1; repeated string openGroups = 2; optional string displayName = 3; optional string profilePicture = 4; optional bytes profileKey = 5; repeated Contact contacts = 6; - optional bytes proRotatingKey = 7; - optional ProProof proProof = 8; + optional Pro pro = 7; } message ReceiptMessage { From c397b1503bcbd1faf4168508138fb56af81ad21f Mon Sep 17 00:00:00 2001 From: doylet Date: Tue, 5 Aug 2025 12:12:54 +1000 Subject: [PATCH 11/59] Typedef array u8x32, add it to types.hpp anad use it in new code --- include/session/config/pro.hpp | 25 +++++----- include/session/session_encrypt.hpp | 3 +- include/session/types.hpp | 14 +++--- src/config/pro.cpp | 73 ++++++++++++++--------------- src/pro.cpp | 65 +++++++++++++------------ tests/test_config_pro.cpp | 2 +- 6 files changed, 89 insertions(+), 93 deletions(-) diff --git a/include/session/config/pro.hpp b/include/session/config/pro.hpp index 13f5bef5..25d4a98b 100644 --- a/include/session/config/pro.hpp +++ b/include/session/config/pro.hpp @@ -1,9 +1,9 @@ +#include +#include #include #include -#include - -#include -#include +#include +#include namespace session::config { @@ -17,15 +17,15 @@ namespace session::config { class Proof { public: /// Version of the proof set by the Session Pro Backend - uint8_t version; + std::uint8_t version; /// Hash of the generation index set by the Session Pro Backend - std::array gen_index_hash; + array_uc32 gen_index_hash; /// The public key that the Session client registers their Session Pro entitlement under. /// Session clients must sign messages with this key along side the sending of this proof for /// the network to authenticate their usage of the proof - std::array rotating_pubkey; + array_uc32 rotating_pubkey; /// Unix epoch timestamp to which this proof's entitlement to Session Pro features is valid to std::chrono::sys_seconds expiry_unix_ts; @@ -33,7 +33,7 @@ class Proof { /// Signature over the contents of the proof. It is signed by the Session Pro Backend key which /// is the entity responsible for issueing tamper-proof Sesison Pro certificates for Session /// clients. - std::array sig; + array_uc64 sig; /// API: pro/Proof::verify /// @@ -49,12 +49,12 @@ class Proof { /// /// Outputs: /// - `bool` - True if the given key was the signatory of the proof, false otherwise - bool verify(const std::array& verify_pubkey) const; + bool verify(const array_uc32& verify_pubkey) const; /// API: pro/Proof::hash /// /// Create a 32-byte hash from the proof. This hash is the payload that is signed in the proof. - std::array hash() const; + array_uc32 hash() const; bool load(const dict& root); }; @@ -68,7 +68,7 @@ class Pro { /// Private key for the public key key specified in the proof. This is synced between clients /// to allow multiple clients to synchronise the Session Pro Proof and also the keys necessary /// to use the proof. - std::array rotating_privkey; + cleared_uc64 rotating_privkey; /// A cryptographic proof for entitling an Ed25519 key to Session Pro Proof proof; @@ -85,9 +85,8 @@ class Pro { /// Outputs: /// - `bool` - True if the proof was verified and the proof's rotating public key corresponds to /// the public component of the `rotating_privkey`. - bool verify(const std::array& verify_pubkey) const; + bool verify(const array_uc32& verify_pubkey) const; bool load(const dict& root); }; - }; // namespace session::config diff --git a/include/session/session_encrypt.hpp b/include/session/session_encrypt.hpp index c357a2f0..b4b6f5ed 100644 --- a/include/session/session_encrypt.hpp +++ b/include/session/session_encrypt.hpp @@ -2,10 +2,9 @@ #include #include +#include #include -#include "types.hpp" - // Helper functions for the "Session Protocol" encryption mechanism. This is the encryption used // for DMs sent from one Session user to another. // diff --git a/include/session/types.hpp b/include/session/types.hpp index 2f361c49..a33aaaf8 100644 --- a/include/session/types.hpp +++ b/include/session/types.hpp @@ -1,13 +1,13 @@ #pragma once #include -#include -#include -#include -#include +#include -namespace session { namespace config { +namespace session { +using array_uc32 = std::array; +using array_uc64 = std::array; +namespace config { using seqno_t = std::int64_t; - -}} // namespace session::config +} +} // namespace session diff --git a/src/config/pro.cpp b/src/config/pro.cpp index a2e3d937..d090f217 100644 --- a/src/config/pro.cpp +++ b/src/config/pro.cpp @@ -3,17 +3,16 @@ #include #include -#include #include "internal.hpp" namespace { -std::array proof_hash_internal( - uint8_t version, - std::span gen_index_hash, - std::span rotating_pubkey, - uint64_t expiry_unix_ts) { - std::array result = {}; +session::array_uc32 proof_hash_internal( + std::uint8_t version, + std::span gen_index_hash, + std::span rotating_pubkey, + std::uint64_t expiry_unix_ts) { + session::array_uc32 result = {}; crypto_generichash_blake2b_state state; crypto_generichash_blake2b_init(&state, /*key*/ nullptr, 0, result.max_size()); crypto_generichash_blake2b_update(&state, &version, sizeof(version)); @@ -26,9 +25,9 @@ std::array proof_hash_internal( } bool proof_verify_internal( - std::span hash, - std::span sig, - std::span verify_pubkey) { + std::span hash, + std::span sig, + std::span verify_pubkey) { // The C/C++ interface verifies that the payloads are the correct size using the type system so // only need asserts here. assert(hash.size() == 32); @@ -41,20 +40,20 @@ bool proof_verify_internal( } bool pro_verify_internal( - std::span rotating_privkey, - std::span verify_pubkey, - uint8_t version, - std::span gen_index_hash, - std::span rotating_pubkey, - uint64_t expiry_unix_ts, - std::span sig) { - - std::array hash = + std::span rotating_privkey, + std::span verify_pubkey, + std::uint8_t version, + std::span gen_index_hash, + std::span rotating_pubkey, + std::uint64_t expiry_unix_ts, + std::span sig) { + + session::array_uc32 hash = proof_hash_internal(version, gen_index_hash, rotating_pubkey, expiry_unix_ts); if (!proof_verify_internal(hash, sig, verify_pubkey)) return false; - std::array rederived_pk; + session::array_uc32 rederived_pk; [[maybe_unused]] session::cleared_uc32 rederived_sk; crypto_sign_ed25519_seed_keypair( rederived_pk.data(), rederived_sk.data(), rotating_privkey.data()); @@ -75,14 +74,14 @@ static_assert(sizeof(((Proof*)0)->gen_index_hash) == 32); static_assert(sizeof(((Proof*)0)->rotating_pubkey) == crypto_sign_ed25519_PUBLICKEYBYTES); static_assert(sizeof(((Proof*)0)->sig) == crypto_sign_ed25519_BYTES); -bool Proof::verify(const std::array& verify_pubkey) const { - std::array hash_to_sign = hash(); +bool Proof::verify(const array_uc32& verify_pubkey) const { + array_uc32 hash_to_sign = hash(); bool result = proof_verify_internal(hash_to_sign, sig, verify_pubkey); return result; } -std::array Proof::hash() const { - std::array result = proof_hash_internal( +array_uc32 Proof::hash() const { + array_uc32 result = proof_hash_internal( version, gen_index_hash, rotating_pubkey, expiry_unix_ts.time_since_epoch().count()); return result; } @@ -112,7 +111,7 @@ bool Proof::load(const dict& root) { return true; } -bool Pro::verify(const std::array& verify_pubkey) const { +bool Pro::verify(const array_uc32& verify_pubkey) const { uint64_t expiry_unix_ts = proof.expiry_unix_ts.time_since_epoch().count(); bool result = pro_verify_internal( rotating_privkey, @@ -157,14 +156,14 @@ static_assert((sizeof((pro_proof*)0)->sig) == crypto_sign_ed25519_BYTES); LIBSESSION_C_API bool proof_verify(pro_proof const* proof, uint8_t const* verify_pubkey) { auto verify_pubkey_span = - std::span(verify_pubkey, crypto_sign_ed25519_PUBLICKEYBYTES); + std::span(verify_pubkey, crypto_sign_ed25519_PUBLICKEYBYTES); auto gen_index_hash = - std::span(proof->gen_index_hash, sizeof proof->gen_index_hash); + std::span(proof->gen_index_hash, sizeof proof->gen_index_hash); auto rotating_pubkey = - std::span(proof->rotating_pubkey, sizeof proof->rotating_pubkey); - auto sig = std::span(proof->sig, sizeof proof->sig); + std::span(proof->rotating_pubkey, sizeof proof->rotating_pubkey); + auto sig = std::span(proof->sig, sizeof proof->sig); - std::array hash = proof_hash_internal( + session::array_uc32 hash = proof_hash_internal( proof->version, gen_index_hash, rotating_pubkey, proof->expiry_unix_ts); bool result = proof_verify_internal(hash, sig, verify_pubkey_span); return result; @@ -172,14 +171,14 @@ LIBSESSION_C_API bool proof_verify(pro_proof const* proof, uint8_t const* verify LIBSESSION_C_API bool pro_verify(pro_pro const* pro, uint8_t const* verify_pubkey) { auto verify_pubkey_span = - std::span(verify_pubkey, crypto_sign_ed25519_PUBLICKEYBYTES); + std::span(verify_pubkey, crypto_sign_ed25519_PUBLICKEYBYTES); auto rotating_privkey = - std::span(pro->rotating_privkey, sizeof pro->rotating_privkey); - auto gen_index_hash = - std::span(pro->proof.gen_index_hash, sizeof pro->proof.gen_index_hash); - auto rotating_pubkey = - std::span(pro->proof.rotating_pubkey, sizeof pro->proof.rotating_pubkey); - auto sig = std::span(pro->proof.sig, sizeof pro->proof.sig); + std::span(pro->rotating_privkey, sizeof pro->rotating_privkey); + auto gen_index_hash = std::span( + pro->proof.gen_index_hash, sizeof pro->proof.gen_index_hash); + auto rotating_pubkey = std::span( + pro->proof.rotating_pubkey, sizeof pro->proof.rotating_pubkey); + auto sig = std::span(pro->proof.sig, sizeof pro->proof.sig); bool result = pro_verify_internal( rotating_privkey, diff --git a/src/pro.cpp b/src/pro.cpp index d07d4eb9..37ae59b5 100644 --- a/src/pro.cpp +++ b/src/pro.cpp @@ -2,66 +2,65 @@ #include #include #include -#include #include #include +#include namespace session::pro { -constexpr std::array BACKEND_PUBKEY = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; +constexpr array_uc32 BACKEND_PUBKEY = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + static_assert(BACKEND_PUBKEY.size() == crypto_sign_ed25519_PUBLICKEYBYTES); struct add_payment_request { - uint8_t version; - std::array master_pkey; - std::array rotating_pkey; - std::array payment_token; - std::array master_sig; - std::array rotating_sig; + std::uint8_t version; + array_uc32 master_pkey; + array_uc32 rotating_pkey; + array_uc32 payment_token; + array_uc32 master_sig; + array_uc32 rotating_sig; std::string to_json() const; }; struct get_proof_request { - uint8_t version; - std::array master_pkey; - std::array rotating_pkey; + std::uint8_t version; + array_uc32 master_pkey; + array_uc32 rotating_pkey; std::chrono::seconds unix_ts_s; - std::array master_sig; - std::array rotating_sig; + array_uc32 master_sig; + array_uc32 rotating_sig; std::string to_json() const; }; struct master_rotating_sigs { - std::array master_sig; - std::array rotating_sig; + array_uc64 master_sig; + array_uc64 rotating_sig; }; struct revocation_item { - std::array gen_index_hash; + array_uc32 gen_index_hash; std::chrono::seconds expiry_unix_ts; }; -master_rotating_sigs build_get_proof_sigs(std::array master_privkey, std::array rotating_privkey, std::chrono::seconds unix_ts); -master_rotating_sigs build_add_payment_sigs(std::array master_privkey, std::array rotating_privkey, std::array payment_token_hash, std::chrono::seconds unix_ts); +master_rotating_sigs build_get_proof_sigs(const array_uc64& master_privkey, const array_uc64& rotating_privkey, std::chrono::seconds unix_ts); +master_rotating_sigs build_add_payment_sigs(const array_uc64& master_privkey, const array_uc64& rotating_privkey, const array_uc32& payment_token_hash, std::chrono::seconds unix_ts); master_rotating_sigs build_get_proof_sigs( - std::array master_privkey, - std::array rotating_privkey, - std::chrono::seconds unix_ts) { + const array_uc64& master_privkey, const array_uc64& rotating_privkey, std::chrono::seconds unix_ts) { // Derive the public keys - std::array master_pubkey; - std::array rotating_pubkey; + array_uc32 master_pubkey; + array_uc32 rotating_pubkey; crypto_sign_ed25519_sk_to_pk(master_pubkey.data(), master_privkey.data()); crypto_sign_ed25519_sk_to_pk(rotating_pubkey.data(), rotating_privkey.data()); // Hash components to 32 bytes uint8_t version = 0; uint64_t unix_ts_s = unix_ts.count(); - std::array hash_to_sign = {}; + array_uc32 hash_to_sign = {}; crypto_generichash_blake2b_state state; crypto_generichash_blake2b_init(&state, /*key*/ nullptr, 0, hash_to_sign.max_size()); crypto_generichash_blake2b_update(&state, &version, sizeof(version)); @@ -78,19 +77,19 @@ master_rotating_sigs build_get_proof_sigs( } master_rotating_sigs build_add_payment_sigs( - std::array master_privkey, - std::array rotating_privkey, - std::array payment_token_hash, + const array_uc64& master_privkey, + const array_uc64& rotating_privkey, + const array_uc32& payment_token_hash, std::chrono::seconds unix_ts) { // Derive the public keys - std::array master_pubkey; - std::array rotating_pubkey; + array_uc32 master_pubkey; + array_uc32 rotating_pubkey; crypto_sign_ed25519_sk_to_pk(master_pubkey.data(), master_privkey.data()); crypto_sign_ed25519_sk_to_pk(rotating_pubkey.data(), rotating_privkey.data()); // Hash components to 32 bytes uint8_t version = 0; - std::array hash_to_sign = {}; + array_uc32 hash_to_sign = {}; crypto_generichash_blake2b_state state; crypto_generichash_blake2b_init(&state, /*key*/ nullptr, 0, hash_to_sign.max_size()); crypto_generichash_blake2b_update(&state, &version, sizeof(version)); diff --git a/tests/test_config_pro.cpp b/tests/test_config_pro.cpp index da46fcc9..bc803974 100644 --- a/tests/test_config_pro.cpp +++ b/tests/test_config_pro.cpp @@ -9,7 +9,7 @@ using namespace oxenc::literals; TEST_CASE("Pro", "[config][pro]") { // Setup keys std::array rotating_pk, signing_pk; - std::array rotating_sk, signing_sk; + session::cleared_uc64 rotating_sk, signing_sk; { crypto_sign_ed25519_keypair(rotating_pk.data(), rotating_sk.data()); crypto_sign_ed25519_keypair(signing_pk.data(), signing_sk.data()); From f7047b29b377453620ed0231c7f525c2a517397d Mon Sep 17 00:00:00 2001 From: doylet Date: Wed, 6 Aug 2025 16:06:44 +1000 Subject: [PATCH 12/59] Add Pro message to Content and decrypt it --- include/session/config/pro.hpp | 10 +- include/session/config/user_profile.hpp | 4 +- include/session/pro.hpp | 72 + proto/SessionProtos.pb.cc | 6816 ++++++++-------- proto/SessionProtos.pb.h | 9407 ++++++++++++----------- proto/SessionProtos.proto | 33 +- src/CMakeLists.txt | 1 + src/config/pro.cpp | 18 +- src/config/user_profile.cpp | 10 +- src/pro.cpp | 108 +- tests/test_config_pro.cpp | 10 +- 11 files changed, 8682 insertions(+), 7807 deletions(-) create mode 100644 include/session/pro.hpp diff --git a/include/session/config/pro.hpp b/include/session/config/pro.hpp index 25d4a98b..678b1e09 100644 --- a/include/session/config/pro.hpp +++ b/include/session/config/pro.hpp @@ -1,3 +1,5 @@ +#pragma once + #include #include #include @@ -7,6 +9,8 @@ namespace session::config { +enum ProProofVersion { ProProofVersion_v0 }; + /// keys used currently or in the past (so that we don't reuse): /// /// v - version @@ -14,7 +18,7 @@ namespace session::config { /// r - rotating ed25519 pubkey /// e - expiry unix timestamp (in seconds) /// s - proof signature, signed by the Session Pro Backend's ed25519 key -class Proof { +class ProProof { public: /// Version of the proof set by the Session Pro Backend std::uint8_t version; @@ -63,7 +67,7 @@ class Proof { /// /// r - rotating ed25519 privkey /// p - proof -class Pro { +class ProConfig { public: /// Private key for the public key key specified in the proof. This is synced between clients /// to allow multiple clients to synchronise the Session Pro Proof and also the keys necessary @@ -71,7 +75,7 @@ class Pro { cleared_uc64 rotating_privkey; /// A cryptographic proof for entitling an Ed25519 key to Session Pro - Proof proof; + ProProof proof; /// API: pro/Pro::verify /// diff --git a/include/session/config/user_profile.hpp b/include/session/config/user_profile.hpp index c3b775a6..d7c9cb71 100644 --- a/include/session/config/user_profile.hpp +++ b/include/session/config/user_profile.hpp @@ -250,7 +250,7 @@ class UserProfile : public ConfigBase { /// user does not have any entitlement to Session Pro data. /// /// Inputs: None - std::optional get_pro_data() const; + std::optional get_pro_data() const; /// API: user_profile/UserProfile::set_pro_data /// @@ -261,7 +261,7 @@ class UserProfile : public ConfigBase { /// Inputs: /// - `pro` -- The Session Pro components to assign to the current user profile. This will /// overwrite any existing Session Pro data if it exists. No verification of `pro` is done. - void set_pro_data(const Pro& pro); + void set_pro_data(const ProConfig& pro); }; } // namespace session::config diff --git a/include/session/pro.hpp b/include/session/pro.hpp new file mode 100644 index 00000000..92d1b2e1 --- /dev/null +++ b/include/session/pro.hpp @@ -0,0 +1,72 @@ +#pragma once + +#include +#include + +namespace session::pro { + +struct add_payment_request { + std::uint8_t version; + array_uc32 master_pkey; + array_uc32 rotating_pkey; + array_uc32 payment_token; + array_uc32 master_sig; + array_uc32 rotating_sig; + std::string to_json() const; +}; + +struct get_proof_request { + std::uint8_t version; + array_uc32 master_pkey; + array_uc32 rotating_pkey; + std::chrono::seconds unix_ts_s; + array_uc32 master_sig; + array_uc32 rotating_sig; + std::string to_json() const; +}; + +struct master_rotating_sigs { + array_uc64 master_sig; + array_uc64 rotating_sig; +}; + +struct revocation_item { + array_uc32 gen_index_hash; + std::chrono::seconds expiry_unix_ts; +}; + +enum class Status { + Nil, // Pro proof was not set + Invalid, // Pro proof was set; signature validation failed + Valid, // Pro proof was set, is verified; has not expired + Expired, // Pro proof was set, is verified; has expired +}; + +typedef std::uint32_t FeatureFlag; +enum FeatureFlag_ { + FeatureFlag_HigherCharacterLimit = 0 << 1, + FeatureFlag_ProBadge = 1 << 1, + FeatureFlag_AnimatedAvatar = 2 << 1, + FeatureFlag_All = + FeatureFlag_HigherCharacterLimit | FeatureFlag_ProBadge | FeatureFlag_AnimatedAvatar, +}; + +struct DecryptIncomingWithPro +{ + std::vector plaintext; + std::vector ed25519_pubkey; + config::ProProof pro_proof; + Status pro_status; + FeatureFlag pro_flags; +}; + +master_rotating_sigs build_get_proof_sigs(const array_uc64& master_privkey, const array_uc64& rotating_privkey, std::chrono::seconds unix_ts); +master_rotating_sigs build_add_payment_sigs(const array_uc64& master_privkey, const array_uc64& rotating_privkey, const array_uc32& payment_token_hash, std::chrono::seconds unix_ts); + +constexpr array_uc32 BACKEND_PUBKEY = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + + +} // namespace session::pro diff --git a/proto/SessionProtos.pb.cc b/proto/SessionProtos.pb.cc index f58247a3..c65c09b5 100644 --- a/proto/SessionProtos.pb.cc +++ b/proto/SessionProtos.pb.cc @@ -83,6 +83,54 @@ struct MessageRequestResponseDefaultTypeInternal { }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageRequestResponseDefaultTypeInternal _MessageRequestResponse_default_instance_; +PROTOBUF_CONSTEXPR ProProof::ProProof( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.genindexhash_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.rotatingpublickey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.sig_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.expiryunixts_)*/uint64_t{0u} + , /*decltype(_impl_.version_)*/0u} {} +struct ProProofDefaultTypeInternal { + PROTOBUF_CONSTEXPR ProProofDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ProProofDefaultTypeInternal() {} + union { + ProProof _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProProofDefaultTypeInternal _ProProof_default_instance_; +PROTOBUF_CONSTEXPR ProConfig::ProConfig( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.rotatingprivkey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.proof_)*/nullptr} {} +struct ProConfigDefaultTypeInternal { + PROTOBUF_CONSTEXPR ProConfigDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ProConfigDefaultTypeInternal() {} + union { + ProConfig _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProConfigDefaultTypeInternal _ProConfig_default_instance_; +PROTOBUF_CONSTEXPR ProMessageConfig::ProMessageConfig( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.proof_)*/nullptr + , /*decltype(_impl_.flags_)*/0u} {} +struct ProMessageConfigDefaultTypeInternal { + PROTOBUF_CONSTEXPR ProMessageConfigDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ProMessageConfigDefaultTypeInternal() {} + union { + ProMessageConfig _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProMessageConfigDefaultTypeInternal _ProMessageConfig_default_instance_; PROTOBUF_CONSTEXPR Content::Content( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_._has_bits_)*/{} @@ -95,7 +143,8 @@ PROTOBUF_CONSTEXPR Content::Content( , /*decltype(_impl_.dataextractionnotification_)*/nullptr , /*decltype(_impl_.unsendrequest_)*/nullptr , /*decltype(_impl_.messagerequestresponse_)*/nullptr - , /*decltype(_impl_.sharedconfigmessage_)*/nullptr} {} + , /*decltype(_impl_.sharedconfigmessage_)*/nullptr + , /*decltype(_impl_.promessageconfig_)*/nullptr} {} struct ContentDefaultTypeInternal { PROTOBUF_CONSTEXPR ContentDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -352,39 +401,6 @@ struct ConfigurationMessage_ContactDefaultTypeInternal { }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ConfigurationMessage_ContactDefaultTypeInternal _ConfigurationMessage_Contact_default_instance_; -PROTOBUF_CONSTEXPR ConfigurationMessage_ProProof::ConfigurationMessage_ProProof( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_._has_bits_)*/{} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_.genindexhash_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.rotatingpublickey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.sig_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.expiryunixts_)*/uint64_t{0u} - , /*decltype(_impl_.version_)*/0u} {} -struct ConfigurationMessage_ProProofDefaultTypeInternal { - PROTOBUF_CONSTEXPR ConfigurationMessage_ProProofDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~ConfigurationMessage_ProProofDefaultTypeInternal() {} - union { - ConfigurationMessage_ProProof _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ConfigurationMessage_ProProofDefaultTypeInternal _ConfigurationMessage_ProProof_default_instance_; -PROTOBUF_CONSTEXPR ConfigurationMessage_Pro::ConfigurationMessage_Pro( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_._has_bits_)*/{} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_.rotatingprivkey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.proof_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {} -struct ConfigurationMessage_ProDefaultTypeInternal { - PROTOBUF_CONSTEXPR ConfigurationMessage_ProDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~ConfigurationMessage_ProDefaultTypeInternal() {} - union { - ConfigurationMessage_Pro _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ConfigurationMessage_ProDefaultTypeInternal _ConfigurationMessage_Pro_default_instance_; PROTOBUF_CONSTEXPR ConfigurationMessage::ConfigurationMessage( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_._has_bits_)*/{} @@ -395,7 +411,7 @@ PROTOBUF_CONSTEXPR ConfigurationMessage::ConfigurationMessage( , /*decltype(_impl_.displayname_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} , /*decltype(_impl_.profilepicture_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} , /*decltype(_impl_.profilekey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.pro_)*/nullptr} {} + , /*decltype(_impl_.proconfig_)*/nullptr} {} struct ConfigurationMessageDefaultTypeInternal { PROTOBUF_CONSTEXPR ConfigurationMessageDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -2414,157 +2430,107 @@ std::string MessageRequestResponse::GetTypeName() const { // =================================================================== -class Content::_Internal { +class ProProof::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static const ::SessionProtos::DataMessage& datamessage(const Content* msg); - static void set_has_datamessage(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_version(HasBits* has_bits) { + (*has_bits)[0] |= 16u; + } + static void set_has_genindexhash(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static const ::SessionProtos::CallMessage& callmessage(const Content* msg); - static void set_has_callmessage(HasBits* has_bits) { + static void set_has_rotatingpublickey(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static const ::SessionProtos::ReceiptMessage& receiptmessage(const Content* msg); - static void set_has_receiptmessage(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } - static const ::SessionProtos::TypingMessage& typingmessage(const Content* msg); - static void set_has_typingmessage(HasBits* has_bits) { + static void set_has_expiryunixts(HasBits* has_bits) { (*has_bits)[0] |= 8u; } - static const ::SessionProtos::ConfigurationMessage& configurationmessage(const Content* msg); - static void set_has_configurationmessage(HasBits* has_bits) { - (*has_bits)[0] |= 16u; - } - static const ::SessionProtos::DataExtractionNotification& dataextractionnotification(const Content* msg); - static void set_has_dataextractionnotification(HasBits* has_bits) { - (*has_bits)[0] |= 32u; - } - static const ::SessionProtos::UnsendRequest& unsendrequest(const Content* msg); - static void set_has_unsendrequest(HasBits* has_bits) { - (*has_bits)[0] |= 64u; - } - static const ::SessionProtos::MessageRequestResponse& messagerequestresponse(const Content* msg); - static void set_has_messagerequestresponse(HasBits* has_bits) { - (*has_bits)[0] |= 128u; + static void set_has_sig(HasBits* has_bits) { + (*has_bits)[0] |= 4u; } - static const ::SessionProtos::SharedConfigMessage& sharedconfigmessage(const Content* msg); - static void set_has_sharedconfigmessage(HasBits* has_bits) { - (*has_bits)[0] |= 256u; + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x0000001f) ^ 0x0000001f) != 0; } }; -const ::SessionProtos::DataMessage& -Content::_Internal::datamessage(const Content* msg) { - return *msg->_impl_.datamessage_; -} -const ::SessionProtos::CallMessage& -Content::_Internal::callmessage(const Content* msg) { - return *msg->_impl_.callmessage_; -} -const ::SessionProtos::ReceiptMessage& -Content::_Internal::receiptmessage(const Content* msg) { - return *msg->_impl_.receiptmessage_; -} -const ::SessionProtos::TypingMessage& -Content::_Internal::typingmessage(const Content* msg) { - return *msg->_impl_.typingmessage_; -} -const ::SessionProtos::ConfigurationMessage& -Content::_Internal::configurationmessage(const Content* msg) { - return *msg->_impl_.configurationmessage_; -} -const ::SessionProtos::DataExtractionNotification& -Content::_Internal::dataextractionnotification(const Content* msg) { - return *msg->_impl_.dataextractionnotification_; -} -const ::SessionProtos::UnsendRequest& -Content::_Internal::unsendrequest(const Content* msg) { - return *msg->_impl_.unsendrequest_; -} -const ::SessionProtos::MessageRequestResponse& -Content::_Internal::messagerequestresponse(const Content* msg) { - return *msg->_impl_.messagerequestresponse_; -} -const ::SessionProtos::SharedConfigMessage& -Content::_Internal::sharedconfigmessage(const Content* msg) { - return *msg->_impl_.sharedconfigmessage_; -} -Content::Content(::PROTOBUF_NAMESPACE_ID::Arena* arena, +ProProof::ProProof(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.Content) + // @@protoc_insertion_point(arena_constructor:SessionProtos.ProProof) } -Content::Content(const Content& from) +ProProof::ProProof(const ProProof& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - Content* const _this = this; (void)_this; + ProProof* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.datamessage_){nullptr} - , decltype(_impl_.callmessage_){nullptr} - , decltype(_impl_.receiptmessage_){nullptr} - , decltype(_impl_.typingmessage_){nullptr} - , decltype(_impl_.configurationmessage_){nullptr} - , decltype(_impl_.dataextractionnotification_){nullptr} - , decltype(_impl_.unsendrequest_){nullptr} - , decltype(_impl_.messagerequestresponse_){nullptr} - , decltype(_impl_.sharedconfigmessage_){nullptr}}; + , decltype(_impl_.genindexhash_){} + , decltype(_impl_.rotatingpublickey_){} + , decltype(_impl_.sig_){} + , decltype(_impl_.expiryunixts_){} + , decltype(_impl_.version_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from._internal_has_datamessage()) { - _this->_impl_.datamessage_ = new ::SessionProtos::DataMessage(*from._impl_.datamessage_); - } - if (from._internal_has_callmessage()) { - _this->_impl_.callmessage_ = new ::SessionProtos::CallMessage(*from._impl_.callmessage_); - } - if (from._internal_has_receiptmessage()) { - _this->_impl_.receiptmessage_ = new ::SessionProtos::ReceiptMessage(*from._impl_.receiptmessage_); - } - if (from._internal_has_typingmessage()) { - _this->_impl_.typingmessage_ = new ::SessionProtos::TypingMessage(*from._impl_.typingmessage_); - } - if (from._internal_has_configurationmessage()) { - _this->_impl_.configurationmessage_ = new ::SessionProtos::ConfigurationMessage(*from._impl_.configurationmessage_); - } - if (from._internal_has_dataextractionnotification()) { - _this->_impl_.dataextractionnotification_ = new ::SessionProtos::DataExtractionNotification(*from._impl_.dataextractionnotification_); - } - if (from._internal_has_unsendrequest()) { - _this->_impl_.unsendrequest_ = new ::SessionProtos::UnsendRequest(*from._impl_.unsendrequest_); + _impl_.genindexhash_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.genindexhash_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_genindexhash()) { + _this->_impl_.genindexhash_.Set(from._internal_genindexhash(), + _this->GetArenaForAllocation()); } - if (from._internal_has_messagerequestresponse()) { - _this->_impl_.messagerequestresponse_ = new ::SessionProtos::MessageRequestResponse(*from._impl_.messagerequestresponse_); + _impl_.rotatingpublickey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_rotatingpublickey()) { + _this->_impl_.rotatingpublickey_.Set(from._internal_rotatingpublickey(), + _this->GetArenaForAllocation()); } - if (from._internal_has_sharedconfigmessage()) { - _this->_impl_.sharedconfigmessage_ = new ::SessionProtos::SharedConfigMessage(*from._impl_.sharedconfigmessage_); + _impl_.sig_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.sig_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_sig()) { + _this->_impl_.sig_.Set(from._internal_sig(), + _this->GetArenaForAllocation()); } - // @@protoc_insertion_point(copy_constructor:SessionProtos.Content) + ::memcpy(&_impl_.expiryunixts_, &from._impl_.expiryunixts_, + static_cast(reinterpret_cast(&_impl_.version_) - + reinterpret_cast(&_impl_.expiryunixts_)) + sizeof(_impl_.version_)); + // @@protoc_insertion_point(copy_constructor:SessionProtos.ProProof) } -inline void Content::SharedCtor( +inline void ProProof::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.datamessage_){nullptr} - , decltype(_impl_.callmessage_){nullptr} - , decltype(_impl_.receiptmessage_){nullptr} - , decltype(_impl_.typingmessage_){nullptr} - , decltype(_impl_.configurationmessage_){nullptr} - , decltype(_impl_.dataextractionnotification_){nullptr} - , decltype(_impl_.unsendrequest_){nullptr} - , decltype(_impl_.messagerequestresponse_){nullptr} - , decltype(_impl_.sharedconfigmessage_){nullptr} + , decltype(_impl_.genindexhash_){} + , decltype(_impl_.rotatingpublickey_){} + , decltype(_impl_.sig_){} + , decltype(_impl_.expiryunixts_){uint64_t{0u}} + , decltype(_impl_.version_){0u} }; + _impl_.genindexhash_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.genindexhash_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.rotatingpublickey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.sig_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.sig_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -Content::~Content() { - // @@protoc_insertion_point(destructor:SessionProtos.Content) +ProProof::~ProProof() { + // @@protoc_insertion_point(destructor:SessionProtos.ProProof) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -2572,147 +2538,92 @@ Content::~Content() { SharedDtor(); } -inline void Content::SharedDtor() { +inline void ProProof::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - if (this != internal_default_instance()) delete _impl_.datamessage_; - if (this != internal_default_instance()) delete _impl_.callmessage_; - if (this != internal_default_instance()) delete _impl_.receiptmessage_; - if (this != internal_default_instance()) delete _impl_.typingmessage_; - if (this != internal_default_instance()) delete _impl_.configurationmessage_; - if (this != internal_default_instance()) delete _impl_.dataextractionnotification_; - if (this != internal_default_instance()) delete _impl_.unsendrequest_; - if (this != internal_default_instance()) delete _impl_.messagerequestresponse_; - if (this != internal_default_instance()) delete _impl_.sharedconfigmessage_; + _impl_.genindexhash_.Destroy(); + _impl_.rotatingpublickey_.Destroy(); + _impl_.sig_.Destroy(); } -void Content::SetCachedSize(int size) const { +void ProProof::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void Content::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.Content) +void ProProof::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.ProProof) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x000000ffu) { + if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x00000001u) { - GOOGLE_DCHECK(_impl_.datamessage_ != nullptr); - _impl_.datamessage_->Clear(); + _impl_.genindexhash_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(_impl_.callmessage_ != nullptr); - _impl_.callmessage_->Clear(); + _impl_.rotatingpublickey_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000004u) { - GOOGLE_DCHECK(_impl_.receiptmessage_ != nullptr); - _impl_.receiptmessage_->Clear(); - } - if (cached_has_bits & 0x00000008u) { - GOOGLE_DCHECK(_impl_.typingmessage_ != nullptr); - _impl_.typingmessage_->Clear(); - } - if (cached_has_bits & 0x00000010u) { - GOOGLE_DCHECK(_impl_.configurationmessage_ != nullptr); - _impl_.configurationmessage_->Clear(); - } - if (cached_has_bits & 0x00000020u) { - GOOGLE_DCHECK(_impl_.dataextractionnotification_ != nullptr); - _impl_.dataextractionnotification_->Clear(); - } - if (cached_has_bits & 0x00000040u) { - GOOGLE_DCHECK(_impl_.unsendrequest_ != nullptr); - _impl_.unsendrequest_->Clear(); - } - if (cached_has_bits & 0x00000080u) { - GOOGLE_DCHECK(_impl_.messagerequestresponse_ != nullptr); - _impl_.messagerequestresponse_->Clear(); + _impl_.sig_.ClearNonDefaultToEmpty(); } } - if (cached_has_bits & 0x00000100u) { - GOOGLE_DCHECK(_impl_.sharedconfigmessage_ != nullptr); - _impl_.sharedconfigmessage_->Clear(); + if (cached_has_bits & 0x00000018u) { + ::memset(&_impl_.expiryunixts_, 0, static_cast( + reinterpret_cast(&_impl_.version_) - + reinterpret_cast(&_impl_.expiryunixts_)) + sizeof(_impl_.version_)); } _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* Content::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* ProProof::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // optional .SessionProtos.DataMessage dataMessage = 1; + // required uint32 version = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - ptr = ctx->ParseMessage(_internal_mutable_datamessage(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.CallMessage callMessage = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - ptr = ctx->ParseMessage(_internal_mutable_callmessage(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.ReceiptMessage receiptMessage = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { - ptr = ctx->ParseMessage(_internal_mutable_receiptmessage(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.TypingMessage typingMessage = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { - ptr = ctx->ParseMessage(_internal_mutable_typingmessage(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.ConfigurationMessage configurationMessage = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { - ptr = ctx->ParseMessage(_internal_mutable_configurationmessage(), ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _Internal::set_has_version(&has_bits); + _impl_.version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; - // optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { - ptr = ctx->ParseMessage(_internal_mutable_dataextractionnotification(), ptr); + // required bytes genIndexHash = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_genindexhash(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional .SessionProtos.UnsendRequest unsendRequest = 9; - case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { - ptr = ctx->ParseMessage(_internal_mutable_unsendrequest(), ptr); + // required bytes rotatingPublicKey = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + auto str = _internal_mutable_rotatingpublickey(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; - case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 82)) { - ptr = ctx->ParseMessage(_internal_mutable_messagerequestresponse(), ptr); + // required uint64 expiryUnixTs = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + _Internal::set_has_expiryunixts(&has_bits); + _impl_.expiryunixts_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else goto handle_unusual; continue; - // optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; - case 11: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 90)) { - ptr = ctx->ParseMessage(_internal_mutable_sharedconfigmessage(), ptr); + // required bytes sig = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + auto str = _internal_mutable_sig(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; @@ -2741,344 +2652,276 @@ const char* Content::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) #undef CHK_ } -uint8_t* Content::_InternalSerialize( +uint8_t* ProProof::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.Content) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ProProof) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // optional .SessionProtos.DataMessage dataMessage = 1; + // required uint32 version = 1; + if (cached_has_bits & 0x00000010u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_version(), target); + } + + // required bytes genIndexHash = 2; if (cached_has_bits & 0x00000001u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, _Internal::datamessage(this), - _Internal::datamessage(this).GetCachedSize(), target, stream); + target = stream->WriteBytesMaybeAliased( + 2, this->_internal_genindexhash(), target); } - // optional .SessionProtos.CallMessage callMessage = 3; + // required bytes rotatingPublicKey = 3; if (cached_has_bits & 0x00000002u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::callmessage(this), - _Internal::callmessage(this).GetCachedSize(), target, stream); + target = stream->WriteBytesMaybeAliased( + 3, this->_internal_rotatingpublickey(), target); } - // optional .SessionProtos.ReceiptMessage receiptMessage = 5; + // required uint64 expiryUnixTs = 4; + if (cached_has_bits & 0x00000008u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_expiryunixts(), target); + } + + // required bytes sig = 5; if (cached_has_bits & 0x00000004u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(5, _Internal::receiptmessage(this), - _Internal::receiptmessage(this).GetCachedSize(), target, stream); + target = stream->WriteBytesMaybeAliased( + 5, this->_internal_sig(), target); } - // optional .SessionProtos.TypingMessage typingMessage = 6; - if (cached_has_bits & 0x00000008u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(6, _Internal::typingmessage(this), - _Internal::typingmessage(this).GetCachedSize(), target, stream); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ProProof) + return target; +} - // optional .SessionProtos.ConfigurationMessage configurationMessage = 7; - if (cached_has_bits & 0x00000010u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(7, _Internal::configurationmessage(this), - _Internal::configurationmessage(this).GetCachedSize(), target, stream); +size_t ProProof::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.ProProof) + size_t total_size = 0; + + if (_internal_has_genindexhash()) { + // required bytes genIndexHash = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_genindexhash()); } - // optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; - if (cached_has_bits & 0x00000020u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(8, _Internal::dataextractionnotification(this), - _Internal::dataextractionnotification(this).GetCachedSize(), target, stream); + if (_internal_has_rotatingpublickey()) { + // required bytes rotatingPublicKey = 3; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_rotatingpublickey()); } - // optional .SessionProtos.UnsendRequest unsendRequest = 9; - if (cached_has_bits & 0x00000040u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(9, _Internal::unsendrequest(this), - _Internal::unsendrequest(this).GetCachedSize(), target, stream); + if (_internal_has_sig()) { + // required bytes sig = 5; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_sig()); } - // optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; - if (cached_has_bits & 0x00000080u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(10, _Internal::messagerequestresponse(this), - _Internal::messagerequestresponse(this).GetCachedSize(), target, stream); + if (_internal_has_expiryunixts()) { + // required uint64 expiryUnixTs = 4; + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_expiryunixts()); } - // optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; - if (cached_has_bits & 0x00000100u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(11, _Internal::sharedconfigmessage(this), - _Internal::sharedconfigmessage(this).GetCachedSize(), target, stream); + if (_internal_has_version()) { + // required uint32 version = 1; + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_version()); + } + + return total_size; +} +size_t ProProof::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ProProof) + size_t total_size = 0; + + if (((_impl_._has_bits_[0] & 0x0000001f) ^ 0x0000001f) == 0) { // All required fields are present. + // required bytes genIndexHash = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_genindexhash()); + + // required bytes rotatingPublicKey = 3; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_rotatingpublickey()); + + // required bytes sig = 5; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_sig()); + + // required uint64 expiryUnixTs = 4; + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_expiryunixts()); + + // required uint32 version = 1; + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_version()); + + } else { + total_size += RequiredFieldsByteSizeFallback(); } + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.Content) - return target; + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -size_t Content::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.Content) - size_t total_size = 0; +void ProProof::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} +void ProProof::MergeFrom(const ProProof& from) { + ProProof* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ProProof) + GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x000000ffu) { - // optional .SessionProtos.DataMessage dataMessage = 1; + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x0000001fu) { if (cached_has_bits & 0x00000001u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.datamessage_); + _this->_internal_set_genindexhash(from._internal_genindexhash()); } - - // optional .SessionProtos.CallMessage callMessage = 3; if (cached_has_bits & 0x00000002u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.callmessage_); + _this->_internal_set_rotatingpublickey(from._internal_rotatingpublickey()); } - - // optional .SessionProtos.ReceiptMessage receiptMessage = 5; if (cached_has_bits & 0x00000004u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.receiptmessage_); + _this->_internal_set_sig(from._internal_sig()); } - - // optional .SessionProtos.TypingMessage typingMessage = 6; if (cached_has_bits & 0x00000008u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.typingmessage_); - } - - // optional .SessionProtos.ConfigurationMessage configurationMessage = 7; - if (cached_has_bits & 0x00000010u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.configurationmessage_); - } - - // optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; - if (cached_has_bits & 0x00000020u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.dataextractionnotification_); - } - - // optional .SessionProtos.UnsendRequest unsendRequest = 9; - if (cached_has_bits & 0x00000040u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.unsendrequest_); - } - - // optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; - if (cached_has_bits & 0x00000080u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.messagerequestresponse_); - } - - } - // optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; - if (cached_has_bits & 0x00000100u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.sharedconfigmessage_); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); - } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void Content::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} - -void Content::MergeFrom(const Content& from) { - Content* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.Content) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x000000ffu) { - if (cached_has_bits & 0x00000001u) { - _this->_internal_mutable_datamessage()->::SessionProtos::DataMessage::MergeFrom( - from._internal_datamessage()); - } - if (cached_has_bits & 0x00000002u) { - _this->_internal_mutable_callmessage()->::SessionProtos::CallMessage::MergeFrom( - from._internal_callmessage()); - } - if (cached_has_bits & 0x00000004u) { - _this->_internal_mutable_receiptmessage()->::SessionProtos::ReceiptMessage::MergeFrom( - from._internal_receiptmessage()); - } - if (cached_has_bits & 0x00000008u) { - _this->_internal_mutable_typingmessage()->::SessionProtos::TypingMessage::MergeFrom( - from._internal_typingmessage()); + _this->_impl_.expiryunixts_ = from._impl_.expiryunixts_; } if (cached_has_bits & 0x00000010u) { - _this->_internal_mutable_configurationmessage()->::SessionProtos::ConfigurationMessage::MergeFrom( - from._internal_configurationmessage()); - } - if (cached_has_bits & 0x00000020u) { - _this->_internal_mutable_dataextractionnotification()->::SessionProtos::DataExtractionNotification::MergeFrom( - from._internal_dataextractionnotification()); - } - if (cached_has_bits & 0x00000040u) { - _this->_internal_mutable_unsendrequest()->::SessionProtos::UnsendRequest::MergeFrom( - from._internal_unsendrequest()); - } - if (cached_has_bits & 0x00000080u) { - _this->_internal_mutable_messagerequestresponse()->::SessionProtos::MessageRequestResponse::MergeFrom( - from._internal_messagerequestresponse()); + _this->_impl_.version_ = from._impl_.version_; } - } - if (cached_has_bits & 0x00000100u) { - _this->_internal_mutable_sharedconfigmessage()->::SessionProtos::SharedConfigMessage::MergeFrom( - from._internal_sharedconfigmessage()); + _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void Content::CopyFrom(const Content& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.Content) +void ProProof::CopyFrom(const ProProof& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ProProof) if (&from == this) return; Clear(); MergeFrom(from); } -bool Content::IsInitialized() const { - if (_internal_has_datamessage()) { - if (!_impl_.datamessage_->IsInitialized()) return false; - } - if (_internal_has_callmessage()) { - if (!_impl_.callmessage_->IsInitialized()) return false; - } - if (_internal_has_receiptmessage()) { - if (!_impl_.receiptmessage_->IsInitialized()) return false; - } - if (_internal_has_typingmessage()) { - if (!_impl_.typingmessage_->IsInitialized()) return false; - } - if (_internal_has_configurationmessage()) { - if (!_impl_.configurationmessage_->IsInitialized()) return false; - } - if (_internal_has_dataextractionnotification()) { - if (!_impl_.dataextractionnotification_->IsInitialized()) return false; - } - if (_internal_has_unsendrequest()) { - if (!_impl_.unsendrequest_->IsInitialized()) return false; - } - if (_internal_has_messagerequestresponse()) { - if (!_impl_.messagerequestresponse_->IsInitialized()) return false; - } - if (_internal_has_sharedconfigmessage()) { - if (!_impl_.sharedconfigmessage_->IsInitialized()) return false; - } +bool ProProof::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; return true; } -void Content::InternalSwap(Content* other) { +void ProProof::InternalSwap(ProProof* other) { using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.genindexhash_, lhs_arena, + &other->_impl_.genindexhash_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.rotatingpublickey_, lhs_arena, + &other->_impl_.rotatingpublickey_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.sig_, lhs_arena, + &other->_impl_.sig_, rhs_arena + ); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(Content, _impl_.sharedconfigmessage_) - + sizeof(Content::_impl_.sharedconfigmessage_) - - PROTOBUF_FIELD_OFFSET(Content, _impl_.datamessage_)>( - reinterpret_cast(&_impl_.datamessage_), - reinterpret_cast(&other->_impl_.datamessage_)); + PROTOBUF_FIELD_OFFSET(ProProof, _impl_.version_) + + sizeof(ProProof::_impl_.version_) + - PROTOBUF_FIELD_OFFSET(ProProof, _impl_.expiryunixts_)>( + reinterpret_cast(&_impl_.expiryunixts_), + reinterpret_cast(&other->_impl_.expiryunixts_)); } -std::string Content::GetTypeName() const { - return "SessionProtos.Content"; +std::string ProProof::GetTypeName() const { + return "SessionProtos.ProProof"; } // =================================================================== -class CallMessage::_Internal { +class ProConfig::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_type(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } - static void set_has_uuid(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_rotatingprivkey(HasBits* has_bits) { (*has_bits)[0] |= 1u; } + static const ::SessionProtos::ProProof& proof(const ProConfig* msg); + static void set_has_proof(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } static bool MissingRequiredFields(const HasBits& has_bits) { return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; } }; -CallMessage::CallMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, +const ::SessionProtos::ProProof& +ProConfig::_Internal::proof(const ProConfig* msg) { + return *msg->_impl_.proof_; +} +ProConfig::ProConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.CallMessage) + // @@protoc_insertion_point(arena_constructor:SessionProtos.ProConfig) } -CallMessage::CallMessage(const CallMessage& from) +ProConfig::ProConfig(const ProConfig& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - CallMessage* const _this = this; (void)_this; + ProConfig* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.sdps_){from._impl_.sdps_} - , decltype(_impl_.sdpmlineindexes_){from._impl_.sdpmlineindexes_} - , decltype(_impl_.sdpmids_){from._impl_.sdpmids_} - , decltype(_impl_.uuid_){} - , decltype(_impl_.type_){}}; + , decltype(_impl_.rotatingprivkey_){} + , decltype(_impl_.proof_){nullptr}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.uuid_.InitDefault(); + _impl_.rotatingprivkey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.uuid_.Set("", GetArenaForAllocation()); + _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_uuid()) { - _this->_impl_.uuid_.Set(from._internal_uuid(), + if (from._internal_has_rotatingprivkey()) { + _this->_impl_.rotatingprivkey_.Set(from._internal_rotatingprivkey(), _this->GetArenaForAllocation()); } - _this->_impl_.type_ = from._impl_.type_; - // @@protoc_insertion_point(copy_constructor:SessionProtos.CallMessage) + if (from._internal_has_proof()) { + _this->_impl_.proof_ = new ::SessionProtos::ProProof(*from._impl_.proof_); + } + // @@protoc_insertion_point(copy_constructor:SessionProtos.ProConfig) } -inline void CallMessage::SharedCtor( +inline void ProConfig::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.sdps_){arena} - , decltype(_impl_.sdpmlineindexes_){arena} - , decltype(_impl_.sdpmids_){arena} - , decltype(_impl_.uuid_){} - , decltype(_impl_.type_){6} + , decltype(_impl_.rotatingprivkey_){} + , decltype(_impl_.proof_){nullptr} }; - _impl_.uuid_.InitDefault(); + _impl_.rotatingprivkey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.uuid_.Set("", GetArenaForAllocation()); + _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -CallMessage::~CallMessage() { - // @@protoc_insertion_point(destructor:SessionProtos.CallMessage) +ProConfig::~ProConfig() { + // @@protoc_insertion_point(destructor:SessionProtos.ProConfig) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -3086,107 +2929,56 @@ CallMessage::~CallMessage() { SharedDtor(); } -inline void CallMessage::SharedDtor() { +inline void ProConfig::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.sdps_.~RepeatedPtrField(); - _impl_.sdpmlineindexes_.~RepeatedField(); - _impl_.sdpmids_.~RepeatedPtrField(); - _impl_.uuid_.Destroy(); + _impl_.rotatingprivkey_.Destroy(); + if (this != internal_default_instance()) delete _impl_.proof_; } -void CallMessage::SetCachedSize(int size) const { +void ProConfig::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void CallMessage::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.CallMessage) +void ProConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.ProConfig) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.sdps_.Clear(); - _impl_.sdpmlineindexes_.Clear(); - _impl_.sdpmids_.Clear(); cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _impl_.uuid_.ClearNonDefaultToEmpty(); + _impl_.rotatingprivkey_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(_impl_.proof_ != nullptr); + _impl_.proof_->Clear(); } - _impl_.type_ = 6; } _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* CallMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* ProConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required .SessionProtos.CallMessage.Type type = 1; + // required bytes rotatingPrivKey = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_rotatingprivkey(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - if (PROTOBUF_PREDICT_TRUE(::SessionProtos::CallMessage_Type_IsValid(val))) { - _internal_set_type(static_cast<::SessionProtos::CallMessage_Type>(val)); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields()); - } } else goto handle_unusual; continue; - // repeated string sdps = 2; + // required .SessionProtos.ProProof proof = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - ptr -= 1; - do { - ptr += 1; - auto str = _internal_add_sdps(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); - } else - goto handle_unusual; - continue; - // repeated uint32 sdpMLineIndexes = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { - ptr -= 1; - do { - ptr += 1; - _internal_add_sdpmlineindexes(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr)); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<24>(ptr)); - } else if (static_cast(tag) == 26) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_sdpmlineindexes(), ptr, ctx); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // repeated string sdpMids = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { - ptr -= 1; - do { - ptr += 1; - auto str = _internal_add_sdpmids(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); - } else - goto handle_unusual; - continue; - // required string uuid = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { - auto str = _internal_mutable_uuid(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + ptr = ctx->ParseMessage(_internal_mutable_proof(), ptr); CHK_(ptr); } else goto handle_unusual; @@ -3215,84 +3007,68 @@ const char* CallMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* c #undef CHK_ } -uint8_t* CallMessage::_InternalSerialize( +uint8_t* ProConfig::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.CallMessage) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ProConfig) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required .SessionProtos.CallMessage.Type type = 1; - if (cached_has_bits & 0x00000002u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 1, this->_internal_type(), target); - } - - // repeated string sdps = 2; - for (int i = 0, n = this->_internal_sdps_size(); i < n; i++) { - const auto& s = this->_internal_sdps(i); - target = stream->WriteString(2, s, target); - } - - // repeated uint32 sdpMLineIndexes = 3; - for (int i = 0, n = this->_internal_sdpmlineindexes_size(); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_sdpmlineindexes(i), target); - } - - // repeated string sdpMids = 4; - for (int i = 0, n = this->_internal_sdpmids_size(); i < n; i++) { - const auto& s = this->_internal_sdpmids(i); - target = stream->WriteString(4, s, target); + // required bytes rotatingPrivKey = 1; + if (cached_has_bits & 0x00000001u) { + target = stream->WriteBytesMaybeAliased( + 1, this->_internal_rotatingprivkey(), target); } - // required string uuid = 5; - if (cached_has_bits & 0x00000001u) { - target = stream->WriteStringMaybeAliased( - 5, this->_internal_uuid(), target); + // required .SessionProtos.ProProof proof = 2; + if (cached_has_bits & 0x00000002u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::proof(this), + _Internal::proof(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.CallMessage) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ProConfig) return target; } -size_t CallMessage::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.CallMessage) +size_t ProConfig::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.ProConfig) size_t total_size = 0; - if (_internal_has_uuid()) { - // required string uuid = 5; + if (_internal_has_rotatingprivkey()) { + // required bytes rotatingPrivKey = 1; total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_uuid()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_rotatingprivkey()); } - if (_internal_has_type()) { - // required .SessionProtos.CallMessage.Type type = 1; + if (_internal_has_proof()) { + // required .SessionProtos.ProProof proof = 2; total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.proof_); } return total_size; } -size_t CallMessage::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.CallMessage) +size_t ProConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ProConfig) size_t total_size = 0; if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. - // required string uuid = 5; + // required bytes rotatingPrivKey = 1; total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_uuid()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_rotatingprivkey()); - // required .SessionProtos.CallMessage.Type type = 1; + // required .SessionProtos.ProProof proof = 2; total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.proof_); } else { total_size += RequiredFieldsByteSizeFallback(); @@ -3301,31 +3077,6 @@ size_t CallMessage::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // repeated string sdps = 2; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.sdps_.size()); - for (int i = 0, n = _impl_.sdps_.size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - _impl_.sdps_.Get(i)); - } - - // repeated uint32 sdpMLineIndexes = 3; - { - size_t data_size = ::_pbi::WireFormatLite:: - UInt32Size(this->_impl_.sdpmlineindexes_); - total_size += 1 * - ::_pbi::FromIntSize(this->_internal_sdpmlineindexes_size()); - total_size += data_size; - } - - // repeated string sdpMids = 4; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.sdpmids_.size()); - for (int i = 0, n = _impl_.sdpmids_.size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - _impl_.sdpmids_.Get(i)); - } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } @@ -3334,77 +3085,75 @@ size_t CallMessage::ByteSizeLong() const { return total_size; } -void CallMessage::CheckTypeAndMergeFrom( +void ProConfig::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void CallMessage::MergeFrom(const CallMessage& from) { - CallMessage* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.CallMessage) +void ProConfig::MergeFrom(const ProConfig& from) { + ProConfig* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ProConfig) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.sdps_.MergeFrom(from._impl_.sdps_); - _this->_impl_.sdpmlineindexes_.MergeFrom(from._impl_.sdpmlineindexes_); - _this->_impl_.sdpmids_.MergeFrom(from._impl_.sdpmids_); cached_has_bits = from._impl_._has_bits_[0]; if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_uuid(from._internal_uuid()); + _this->_internal_set_rotatingprivkey(from._internal_rotatingprivkey()); } if (cached_has_bits & 0x00000002u) { - _this->_impl_.type_ = from._impl_.type_; + _this->_internal_mutable_proof()->::SessionProtos::ProProof::MergeFrom( + from._internal_proof()); } - _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void CallMessage::CopyFrom(const CallMessage& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.CallMessage) +void ProConfig::CopyFrom(const ProConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ProConfig) if (&from == this) return; Clear(); MergeFrom(from); } -bool CallMessage::IsInitialized() const { +bool ProConfig::IsInitialized() const { if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; + if (_internal_has_proof()) { + if (!_impl_.proof_->IsInitialized()) return false; + } return true; } -void CallMessage::InternalSwap(CallMessage* other) { +void ProConfig::InternalSwap(ProConfig* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.sdps_.InternalSwap(&other->_impl_.sdps_); - _impl_.sdpmlineindexes_.InternalSwap(&other->_impl_.sdpmlineindexes_); - _impl_.sdpmids_.InternalSwap(&other->_impl_.sdpmids_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.uuid_, lhs_arena, - &other->_impl_.uuid_, rhs_arena + &_impl_.rotatingprivkey_, lhs_arena, + &other->_impl_.rotatingprivkey_, rhs_arena ); - swap(_impl_.type_, other->_impl_.type_); + swap(_impl_.proof_, other->_impl_.proof_); } -std::string CallMessage::GetTypeName() const { - return "SessionProtos.CallMessage"; +std::string ProConfig::GetTypeName() const { + return "SessionProtos.ProConfig"; } // =================================================================== -class KeyPair::_Internal { +class ProMessageConfig::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_publickey(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static const ::SessionProtos::ProProof& proof(const ProMessageConfig* msg); + static void set_has_proof(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_privatekey(HasBits* has_bits) { + static void set_has_flags(HasBits* has_bits) { (*has_bits)[0] |= 2u; } static bool MissingRequiredFields(const HasBits& has_bits) { @@ -3412,63 +3161,47 @@ class KeyPair::_Internal { } }; -KeyPair::KeyPair(::PROTOBUF_NAMESPACE_ID::Arena* arena, +const ::SessionProtos::ProProof& +ProMessageConfig::_Internal::proof(const ProMessageConfig* msg) { + return *msg->_impl_.proof_; +} +ProMessageConfig::ProMessageConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.KeyPair) + // @@protoc_insertion_point(arena_constructor:SessionProtos.ProMessageConfig) } -KeyPair::KeyPair(const KeyPair& from) +ProMessageConfig::ProMessageConfig(const ProMessageConfig& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - KeyPair* const _this = this; (void)_this; + ProMessageConfig* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.publickey_){} - , decltype(_impl_.privatekey_){}}; + , decltype(_impl_.proof_){nullptr} + , decltype(_impl_.flags_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.publickey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_publickey()) { - _this->_impl_.publickey_.Set(from._internal_publickey(), - _this->GetArenaForAllocation()); - } - _impl_.privatekey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.privatekey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_privatekey()) { - _this->_impl_.privatekey_.Set(from._internal_privatekey(), - _this->GetArenaForAllocation()); + if (from._internal_has_proof()) { + _this->_impl_.proof_ = new ::SessionProtos::ProProof(*from._impl_.proof_); } - // @@protoc_insertion_point(copy_constructor:SessionProtos.KeyPair) + _this->_impl_.flags_ = from._impl_.flags_; + // @@protoc_insertion_point(copy_constructor:SessionProtos.ProMessageConfig) } -inline void KeyPair::SharedCtor( +inline void ProMessageConfig::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.publickey_){} - , decltype(_impl_.privatekey_){} + , decltype(_impl_.proof_){nullptr} + , decltype(_impl_.flags_){0u} }; - _impl_.publickey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.privatekey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.privatekey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -KeyPair::~KeyPair() { - // @@protoc_insertion_point(destructor:SessionProtos.KeyPair) +ProMessageConfig::~ProMessageConfig() { + // @@protoc_insertion_point(destructor:SessionProtos.ProMessageConfig) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -3476,56 +3209,51 @@ KeyPair::~KeyPair() { SharedDtor(); } -inline void KeyPair::SharedDtor() { +inline void ProMessageConfig::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.publickey_.Destroy(); - _impl_.privatekey_.Destroy(); + if (this != internal_default_instance()) delete _impl_.proof_; } -void KeyPair::SetCachedSize(int size) const { +void ProMessageConfig::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void KeyPair::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.KeyPair) +void ProMessageConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.ProMessageConfig) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - if (cached_has_bits & 0x00000001u) { - _impl_.publickey_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000002u) { - _impl_.privatekey_.ClearNonDefaultToEmpty(); - } + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(_impl_.proof_ != nullptr); + _impl_.proof_->Clear(); } + _impl_.flags_ = 0u; _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* KeyPair::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* ProMessageConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required bytes publicKey = 1; + // required .SessionProtos.ProProof proof = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_publickey(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + ptr = ctx->ParseMessage(_internal_mutable_proof(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // required bytes privateKey = 2; + // required uint32 flags = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_privatekey(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _Internal::set_has_flags(&has_bits); + _impl_.flags_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; @@ -3554,67 +3282,64 @@ const char* KeyPair::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) #undef CHK_ } -uint8_t* KeyPair::_InternalSerialize( +uint8_t* ProMessageConfig::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.KeyPair) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ProMessageConfig) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required bytes publicKey = 1; + // required .SessionProtos.ProProof proof = 1; if (cached_has_bits & 0x00000001u) { - target = stream->WriteBytesMaybeAliased( - 1, this->_internal_publickey(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::proof(this), + _Internal::proof(this).GetCachedSize(), target, stream); } - // required bytes privateKey = 2; + // required uint32 flags = 2; if (cached_has_bits & 0x00000002u) { - target = stream->WriteBytesMaybeAliased( - 2, this->_internal_privatekey(), target); + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_flags(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.KeyPair) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ProMessageConfig) return target; } -size_t KeyPair::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.KeyPair) +size_t ProMessageConfig::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.ProMessageConfig) size_t total_size = 0; - if (_internal_has_publickey()) { - // required bytes publicKey = 1; + if (_internal_has_proof()) { + // required .SessionProtos.ProProof proof = 1; total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_publickey()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.proof_); } - if (_internal_has_privatekey()) { - // required bytes privateKey = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_privatekey()); + if (_internal_has_flags()) { + // required uint32 flags = 2; + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); } return total_size; } -size_t KeyPair::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.KeyPair) +size_t ProMessageConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ProMessageConfig) size_t total_size = 0; if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. - // required bytes publicKey = 1; + // required .SessionProtos.ProProof proof = 1; total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_publickey()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.proof_); - // required bytes privateKey = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_privatekey()); + // required uint32 flags = 2; + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); } else { total_size += RequiredFieldsByteSizeFallback(); @@ -3631,15 +3356,15 @@ size_t KeyPair::ByteSizeLong() const { return total_size; } -void KeyPair::CheckTypeAndMergeFrom( +void ProMessageConfig::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void KeyPair::MergeFrom(const KeyPair& from) { - KeyPair* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.KeyPair) +void ProMessageConfig::MergeFrom(const ProMessageConfig& from) { + ProMessageConfig* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ProMessageConfig) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -3647,100 +3372,215 @@ void KeyPair::MergeFrom(const KeyPair& from) { cached_has_bits = from._impl_._has_bits_[0]; if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_publickey(from._internal_publickey()); + _this->_internal_mutable_proof()->::SessionProtos::ProProof::MergeFrom( + from._internal_proof()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_privatekey(from._internal_privatekey()); + _this->_impl_.flags_ = from._impl_.flags_; } + _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void KeyPair::CopyFrom(const KeyPair& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.KeyPair) +void ProMessageConfig::CopyFrom(const ProMessageConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ProMessageConfig) if (&from == this) return; Clear(); MergeFrom(from); } -bool KeyPair::IsInitialized() const { +bool ProMessageConfig::IsInitialized() const { if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; + if (_internal_has_proof()) { + if (!_impl_.proof_->IsInitialized()) return false; + } return true; } -void KeyPair::InternalSwap(KeyPair* other) { +void ProMessageConfig::InternalSwap(ProMessageConfig* other) { using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.publickey_, lhs_arena, - &other->_impl_.publickey_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.privatekey_, lhs_arena, - &other->_impl_.privatekey_, rhs_arena - ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(ProMessageConfig, _impl_.flags_) + + sizeof(ProMessageConfig::_impl_.flags_) + - PROTOBUF_FIELD_OFFSET(ProMessageConfig, _impl_.proof_)>( + reinterpret_cast(&_impl_.proof_), + reinterpret_cast(&other->_impl_.proof_)); } -std::string KeyPair::GetTypeName() const { - return "SessionProtos.KeyPair"; +std::string ProMessageConfig::GetTypeName() const { + return "SessionProtos.ProMessageConfig"; } // =================================================================== -class DataExtractionNotification::_Internal { +class Content::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_type(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static const ::SessionProtos::DataMessage& datamessage(const Content* msg); + static void set_has_datamessage(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static const ::SessionProtos::CallMessage& callmessage(const Content* msg); + static void set_has_callmessage(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static void set_has_timestamp(HasBits* has_bits) { - (*has_bits)[0] |= 1u; + static const ::SessionProtos::ReceiptMessage& receiptmessage(const Content* msg); + static void set_has_receiptmessage(HasBits* has_bits) { + (*has_bits)[0] |= 4u; } - static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000002) ^ 0x00000002) != 0; + static const ::SessionProtos::TypingMessage& typingmessage(const Content* msg); + static void set_has_typingmessage(HasBits* has_bits) { + (*has_bits)[0] |= 8u; + } + static const ::SessionProtos::ConfigurationMessage& configurationmessage(const Content* msg); + static void set_has_configurationmessage(HasBits* has_bits) { + (*has_bits)[0] |= 16u; + } + static const ::SessionProtos::DataExtractionNotification& dataextractionnotification(const Content* msg); + static void set_has_dataextractionnotification(HasBits* has_bits) { + (*has_bits)[0] |= 32u; + } + static const ::SessionProtos::UnsendRequest& unsendrequest(const Content* msg); + static void set_has_unsendrequest(HasBits* has_bits) { + (*has_bits)[0] |= 64u; + } + static const ::SessionProtos::MessageRequestResponse& messagerequestresponse(const Content* msg); + static void set_has_messagerequestresponse(HasBits* has_bits) { + (*has_bits)[0] |= 128u; + } + static const ::SessionProtos::SharedConfigMessage& sharedconfigmessage(const Content* msg); + static void set_has_sharedconfigmessage(HasBits* has_bits) { + (*has_bits)[0] |= 256u; + } + static const ::SessionProtos::ProMessageConfig& promessageconfig(const Content* msg); + static void set_has_promessageconfig(HasBits* has_bits) { + (*has_bits)[0] |= 512u; } }; -DataExtractionNotification::DataExtractionNotification(::PROTOBUF_NAMESPACE_ID::Arena* arena, +const ::SessionProtos::DataMessage& +Content::_Internal::datamessage(const Content* msg) { + return *msg->_impl_.datamessage_; +} +const ::SessionProtos::CallMessage& +Content::_Internal::callmessage(const Content* msg) { + return *msg->_impl_.callmessage_; +} +const ::SessionProtos::ReceiptMessage& +Content::_Internal::receiptmessage(const Content* msg) { + return *msg->_impl_.receiptmessage_; +} +const ::SessionProtos::TypingMessage& +Content::_Internal::typingmessage(const Content* msg) { + return *msg->_impl_.typingmessage_; +} +const ::SessionProtos::ConfigurationMessage& +Content::_Internal::configurationmessage(const Content* msg) { + return *msg->_impl_.configurationmessage_; +} +const ::SessionProtos::DataExtractionNotification& +Content::_Internal::dataextractionnotification(const Content* msg) { + return *msg->_impl_.dataextractionnotification_; +} +const ::SessionProtos::UnsendRequest& +Content::_Internal::unsendrequest(const Content* msg) { + return *msg->_impl_.unsendrequest_; +} +const ::SessionProtos::MessageRequestResponse& +Content::_Internal::messagerequestresponse(const Content* msg) { + return *msg->_impl_.messagerequestresponse_; +} +const ::SessionProtos::SharedConfigMessage& +Content::_Internal::sharedconfigmessage(const Content* msg) { + return *msg->_impl_.sharedconfigmessage_; +} +const ::SessionProtos::ProMessageConfig& +Content::_Internal::promessageconfig(const Content* msg) { + return *msg->_impl_.promessageconfig_; +} +Content::Content(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.DataExtractionNotification) + // @@protoc_insertion_point(arena_constructor:SessionProtos.Content) } -DataExtractionNotification::DataExtractionNotification(const DataExtractionNotification& from) +Content::Content(const Content& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataExtractionNotification* const _this = this; (void)_this; + Content* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.timestamp_){} - , decltype(_impl_.type_){}}; + , decltype(_impl_.datamessage_){nullptr} + , decltype(_impl_.callmessage_){nullptr} + , decltype(_impl_.receiptmessage_){nullptr} + , decltype(_impl_.typingmessage_){nullptr} + , decltype(_impl_.configurationmessage_){nullptr} + , decltype(_impl_.dataextractionnotification_){nullptr} + , decltype(_impl_.unsendrequest_){nullptr} + , decltype(_impl_.messagerequestresponse_){nullptr} + , decltype(_impl_.sharedconfigmessage_){nullptr} + , decltype(_impl_.promessageconfig_){nullptr}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - ::memcpy(&_impl_.timestamp_, &from._impl_.timestamp_, - static_cast(reinterpret_cast(&_impl_.type_) - - reinterpret_cast(&_impl_.timestamp_)) + sizeof(_impl_.type_)); - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataExtractionNotification) + if (from._internal_has_datamessage()) { + _this->_impl_.datamessage_ = new ::SessionProtos::DataMessage(*from._impl_.datamessage_); + } + if (from._internal_has_callmessage()) { + _this->_impl_.callmessage_ = new ::SessionProtos::CallMessage(*from._impl_.callmessage_); + } + if (from._internal_has_receiptmessage()) { + _this->_impl_.receiptmessage_ = new ::SessionProtos::ReceiptMessage(*from._impl_.receiptmessage_); + } + if (from._internal_has_typingmessage()) { + _this->_impl_.typingmessage_ = new ::SessionProtos::TypingMessage(*from._impl_.typingmessage_); + } + if (from._internal_has_configurationmessage()) { + _this->_impl_.configurationmessage_ = new ::SessionProtos::ConfigurationMessage(*from._impl_.configurationmessage_); + } + if (from._internal_has_dataextractionnotification()) { + _this->_impl_.dataextractionnotification_ = new ::SessionProtos::DataExtractionNotification(*from._impl_.dataextractionnotification_); + } + if (from._internal_has_unsendrequest()) { + _this->_impl_.unsendrequest_ = new ::SessionProtos::UnsendRequest(*from._impl_.unsendrequest_); + } + if (from._internal_has_messagerequestresponse()) { + _this->_impl_.messagerequestresponse_ = new ::SessionProtos::MessageRequestResponse(*from._impl_.messagerequestresponse_); + } + if (from._internal_has_sharedconfigmessage()) { + _this->_impl_.sharedconfigmessage_ = new ::SessionProtos::SharedConfigMessage(*from._impl_.sharedconfigmessage_); + } + if (from._internal_has_promessageconfig()) { + _this->_impl_.promessageconfig_ = new ::SessionProtos::ProMessageConfig(*from._impl_.promessageconfig_); + } + // @@protoc_insertion_point(copy_constructor:SessionProtos.Content) } -inline void DataExtractionNotification::SharedCtor( +inline void Content::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.timestamp_){uint64_t{0u}} - , decltype(_impl_.type_){1} + , decltype(_impl_.datamessage_){nullptr} + , decltype(_impl_.callmessage_){nullptr} + , decltype(_impl_.receiptmessage_){nullptr} + , decltype(_impl_.typingmessage_){nullptr} + , decltype(_impl_.configurationmessage_){nullptr} + , decltype(_impl_.dataextractionnotification_){nullptr} + , decltype(_impl_.unsendrequest_){nullptr} + , decltype(_impl_.messagerequestresponse_){nullptr} + , decltype(_impl_.sharedconfigmessage_){nullptr} + , decltype(_impl_.promessageconfig_){nullptr} }; } -DataExtractionNotification::~DataExtractionNotification() { - // @@protoc_insertion_point(destructor:SessionProtos.DataExtractionNotification) +Content::~Content() { + // @@protoc_insertion_point(destructor:SessionProtos.Content) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -3748,75 +3588,183 @@ DataExtractionNotification::~DataExtractionNotification() { SharedDtor(); } -inline void DataExtractionNotification::SharedDtor() { +inline void Content::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + if (this != internal_default_instance()) delete _impl_.datamessage_; + if (this != internal_default_instance()) delete _impl_.callmessage_; + if (this != internal_default_instance()) delete _impl_.receiptmessage_; + if (this != internal_default_instance()) delete _impl_.typingmessage_; + if (this != internal_default_instance()) delete _impl_.configurationmessage_; + if (this != internal_default_instance()) delete _impl_.dataextractionnotification_; + if (this != internal_default_instance()) delete _impl_.unsendrequest_; + if (this != internal_default_instance()) delete _impl_.messagerequestresponse_; + if (this != internal_default_instance()) delete _impl_.sharedconfigmessage_; + if (this != internal_default_instance()) delete _impl_.promessageconfig_; } -void DataExtractionNotification::SetCachedSize(int size) const { +void Content::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataExtractionNotification::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataExtractionNotification) +void Content::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.Content) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - _impl_.timestamp_ = uint64_t{0u}; - _impl_.type_ = 1; + if (cached_has_bits & 0x000000ffu) { + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(_impl_.datamessage_ != nullptr); + _impl_.datamessage_->Clear(); + } + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(_impl_.callmessage_ != nullptr); + _impl_.callmessage_->Clear(); + } + if (cached_has_bits & 0x00000004u) { + GOOGLE_DCHECK(_impl_.receiptmessage_ != nullptr); + _impl_.receiptmessage_->Clear(); + } + if (cached_has_bits & 0x00000008u) { + GOOGLE_DCHECK(_impl_.typingmessage_ != nullptr); + _impl_.typingmessage_->Clear(); + } + if (cached_has_bits & 0x00000010u) { + GOOGLE_DCHECK(_impl_.configurationmessage_ != nullptr); + _impl_.configurationmessage_->Clear(); + } + if (cached_has_bits & 0x00000020u) { + GOOGLE_DCHECK(_impl_.dataextractionnotification_ != nullptr); + _impl_.dataextractionnotification_->Clear(); + } + if (cached_has_bits & 0x00000040u) { + GOOGLE_DCHECK(_impl_.unsendrequest_ != nullptr); + _impl_.unsendrequest_->Clear(); + } + if (cached_has_bits & 0x00000080u) { + GOOGLE_DCHECK(_impl_.messagerequestresponse_ != nullptr); + _impl_.messagerequestresponse_->Clear(); + } + } + if (cached_has_bits & 0x00000300u) { + if (cached_has_bits & 0x00000100u) { + GOOGLE_DCHECK(_impl_.sharedconfigmessage_ != nullptr); + _impl_.sharedconfigmessage_->Clear(); + } + if (cached_has_bits & 0x00000200u) { + GOOGLE_DCHECK(_impl_.promessageconfig_ != nullptr); + _impl_.promessageconfig_->Clear(); + } } _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* DataExtractionNotification::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* Content::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required .SessionProtos.DataExtractionNotification.Type type = 1; + // optional .SessionProtos.DataMessage dataMessage = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_datamessage(), ptr); CHK_(ptr); - if (PROTOBUF_PREDICT_TRUE(::SessionProtos::DataExtractionNotification_Type_IsValid(val))) { - _internal_set_type(static_cast<::SessionProtos::DataExtractionNotification_Type>(val)); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields()); - } } else goto handle_unusual; continue; - // optional uint64 timestamp = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { - _Internal::set_has_timestamp(&has_bits); - _impl_.timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + // optional .SessionProtos.CallMessage callMessage = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr = ctx->ParseMessage(_internal_mutable_callmessage(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - default: - goto handle_unusual; - } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields(), - ptr, ctx); - CHK_(ptr != nullptr); - } // while -message_done: - _impl_._has_bits_.Or(has_bits); + // optional .SessionProtos.ReceiptMessage receiptMessage = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + ptr = ctx->ParseMessage(_internal_mutable_receiptmessage(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.TypingMessage typingMessage = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { + ptr = ctx->ParseMessage(_internal_mutable_typingmessage(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.ConfigurationMessage configurationMessage = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { + ptr = ctx->ParseMessage(_internal_mutable_configurationmessage(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { + ptr = ctx->ParseMessage(_internal_mutable_dataextractionnotification(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.UnsendRequest unsendRequest = 9; + case 9: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { + ptr = ctx->ParseMessage(_internal_mutable_unsendrequest(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; + case 10: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 82)) { + ptr = ctx->ParseMessage(_internal_mutable_messagerequestresponse(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; + case 11: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 90)) { + ptr = ctx->ParseMessage(_internal_mutable_sharedconfigmessage(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.ProMessageConfig proMessageConfig = 12; + case 12: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 98)) { + ptr = ctx->ParseMessage(_internal_mutable_promessageconfig(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); return ptr; failure: ptr = nullptr; @@ -3824,53 +3772,174 @@ const char* DataExtractionNotification::_InternalParse(const char* ptr, ::_pbi:: #undef CHK_ } -uint8_t* DataExtractionNotification::_InternalSerialize( +uint8_t* Content::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataExtractionNotification) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.Content) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required .SessionProtos.DataExtractionNotification.Type type = 1; + // optional .SessionProtos.DataMessage dataMessage = 1; + if (cached_has_bits & 0x00000001u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::datamessage(this), + _Internal::datamessage(this).GetCachedSize(), target, stream); + } + + // optional .SessionProtos.CallMessage callMessage = 3; if (cached_has_bits & 0x00000002u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 1, this->_internal_type(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::callmessage(this), + _Internal::callmessage(this).GetCachedSize(), target, stream); } - // optional uint64 timestamp = 2; - if (cached_has_bits & 0x00000001u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_timestamp(), target); + // optional .SessionProtos.ReceiptMessage receiptMessage = 5; + if (cached_has_bits & 0x00000004u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(5, _Internal::receiptmessage(this), + _Internal::receiptmessage(this).GetCachedSize(), target, stream); + } + + // optional .SessionProtos.TypingMessage typingMessage = 6; + if (cached_has_bits & 0x00000008u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(6, _Internal::typingmessage(this), + _Internal::typingmessage(this).GetCachedSize(), target, stream); + } + + // optional .SessionProtos.ConfigurationMessage configurationMessage = 7; + if (cached_has_bits & 0x00000010u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(7, _Internal::configurationmessage(this), + _Internal::configurationmessage(this).GetCachedSize(), target, stream); + } + + // optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; + if (cached_has_bits & 0x00000020u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(8, _Internal::dataextractionnotification(this), + _Internal::dataextractionnotification(this).GetCachedSize(), target, stream); + } + + // optional .SessionProtos.UnsendRequest unsendRequest = 9; + if (cached_has_bits & 0x00000040u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(9, _Internal::unsendrequest(this), + _Internal::unsendrequest(this).GetCachedSize(), target, stream); + } + + // optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; + if (cached_has_bits & 0x00000080u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(10, _Internal::messagerequestresponse(this), + _Internal::messagerequestresponse(this).GetCachedSize(), target, stream); + } + + // optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; + if (cached_has_bits & 0x00000100u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(11, _Internal::sharedconfigmessage(this), + _Internal::sharedconfigmessage(this).GetCachedSize(), target, stream); + } + + // optional .SessionProtos.ProMessageConfig proMessageConfig = 12; + if (cached_has_bits & 0x00000200u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(12, _Internal::promessageconfig(this), + _Internal::promessageconfig(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataExtractionNotification) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.Content) return target; } -size_t DataExtractionNotification::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataExtractionNotification) +size_t Content::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.Content) size_t total_size = 0; - // required .SessionProtos.DataExtractionNotification.Type type = 1; - if (_internal_has_type()) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); - } uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // optional uint64 timestamp = 2; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_timestamp()); + if (cached_has_bits & 0x000000ffu) { + // optional .SessionProtos.DataMessage dataMessage = 1; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.datamessage_); + } + + // optional .SessionProtos.CallMessage callMessage = 3; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.callmessage_); + } + + // optional .SessionProtos.ReceiptMessage receiptMessage = 5; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.receiptmessage_); + } + + // optional .SessionProtos.TypingMessage typingMessage = 6; + if (cached_has_bits & 0x00000008u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.typingmessage_); + } + + // optional .SessionProtos.ConfigurationMessage configurationMessage = 7; + if (cached_has_bits & 0x00000010u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.configurationmessage_); + } + + // optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; + if (cached_has_bits & 0x00000020u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.dataextractionnotification_); + } + + // optional .SessionProtos.UnsendRequest unsendRequest = 9; + if (cached_has_bits & 0x00000040u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.unsendrequest_); + } + + // optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; + if (cached_has_bits & 0x00000080u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.messagerequestresponse_); + } + } + if (cached_has_bits & 0x00000300u) { + // optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; + if (cached_has_bits & 0x00000100u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.sharedconfigmessage_); + } + + // optional .SessionProtos.ProMessageConfig proMessageConfig = 12; + if (cached_has_bits & 0x00000200u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.promessageconfig_); + } + } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } @@ -3879,127 +3948,193 @@ size_t DataExtractionNotification::ByteSizeLong() const { return total_size; } -void DataExtractionNotification::CheckTypeAndMergeFrom( +void Content::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void DataExtractionNotification::MergeFrom(const DataExtractionNotification& from) { - DataExtractionNotification* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataExtractionNotification) +void Content::MergeFrom(const Content& from) { + Content* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.Content) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x000000ffu) { if (cached_has_bits & 0x00000001u) { - _this->_impl_.timestamp_ = from._impl_.timestamp_; + _this->_internal_mutable_datamessage()->::SessionProtos::DataMessage::MergeFrom( + from._internal_datamessage()); } if (cached_has_bits & 0x00000002u) { - _this->_impl_.type_ = from._impl_.type_; + _this->_internal_mutable_callmessage()->::SessionProtos::CallMessage::MergeFrom( + from._internal_callmessage()); } - _this->_impl_._has_bits_[0] |= cached_has_bits; - } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); -} - -void DataExtractionNotification::CopyFrom(const DataExtractionNotification& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataExtractionNotification) + if (cached_has_bits & 0x00000004u) { + _this->_internal_mutable_receiptmessage()->::SessionProtos::ReceiptMessage::MergeFrom( + from._internal_receiptmessage()); + } + if (cached_has_bits & 0x00000008u) { + _this->_internal_mutable_typingmessage()->::SessionProtos::TypingMessage::MergeFrom( + from._internal_typingmessage()); + } + if (cached_has_bits & 0x00000010u) { + _this->_internal_mutable_configurationmessage()->::SessionProtos::ConfigurationMessage::MergeFrom( + from._internal_configurationmessage()); + } + if (cached_has_bits & 0x00000020u) { + _this->_internal_mutable_dataextractionnotification()->::SessionProtos::DataExtractionNotification::MergeFrom( + from._internal_dataextractionnotification()); + } + if (cached_has_bits & 0x00000040u) { + _this->_internal_mutable_unsendrequest()->::SessionProtos::UnsendRequest::MergeFrom( + from._internal_unsendrequest()); + } + if (cached_has_bits & 0x00000080u) { + _this->_internal_mutable_messagerequestresponse()->::SessionProtos::MessageRequestResponse::MergeFrom( + from._internal_messagerequestresponse()); + } + } + if (cached_has_bits & 0x00000300u) { + if (cached_has_bits & 0x00000100u) { + _this->_internal_mutable_sharedconfigmessage()->::SessionProtos::SharedConfigMessage::MergeFrom( + from._internal_sharedconfigmessage()); + } + if (cached_has_bits & 0x00000200u) { + _this->_internal_mutable_promessageconfig()->::SessionProtos::ProMessageConfig::MergeFrom( + from._internal_promessageconfig()); + } + } + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); +} + +void Content::CopyFrom(const Content& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.Content) if (&from == this) return; Clear(); MergeFrom(from); } -bool DataExtractionNotification::IsInitialized() const { - if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; +bool Content::IsInitialized() const { + if (_internal_has_datamessage()) { + if (!_impl_.datamessage_->IsInitialized()) return false; + } + if (_internal_has_callmessage()) { + if (!_impl_.callmessage_->IsInitialized()) return false; + } + if (_internal_has_receiptmessage()) { + if (!_impl_.receiptmessage_->IsInitialized()) return false; + } + if (_internal_has_typingmessage()) { + if (!_impl_.typingmessage_->IsInitialized()) return false; + } + if (_internal_has_configurationmessage()) { + if (!_impl_.configurationmessage_->IsInitialized()) return false; + } + if (_internal_has_dataextractionnotification()) { + if (!_impl_.dataextractionnotification_->IsInitialized()) return false; + } + if (_internal_has_unsendrequest()) { + if (!_impl_.unsendrequest_->IsInitialized()) return false; + } + if (_internal_has_messagerequestresponse()) { + if (!_impl_.messagerequestresponse_->IsInitialized()) return false; + } + if (_internal_has_sharedconfigmessage()) { + if (!_impl_.sharedconfigmessage_->IsInitialized()) return false; + } + if (_internal_has_promessageconfig()) { + if (!_impl_.promessageconfig_->IsInitialized()) return false; + } return true; } -void DataExtractionNotification::InternalSwap(DataExtractionNotification* other) { +void Content::InternalSwap(Content* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - swap(_impl_.timestamp_, other->_impl_.timestamp_); - swap(_impl_.type_, other->_impl_.type_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(Content, _impl_.promessageconfig_) + + sizeof(Content::_impl_.promessageconfig_) + - PROTOBUF_FIELD_OFFSET(Content, _impl_.datamessage_)>( + reinterpret_cast(&_impl_.datamessage_), + reinterpret_cast(&other->_impl_.datamessage_)); } -std::string DataExtractionNotification::GetTypeName() const { - return "SessionProtos.DataExtractionNotification"; +std::string Content::GetTypeName() const { + return "SessionProtos.Content"; } // =================================================================== -class LokiProfile::_Internal { +class CallMessage::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_displayname(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_type(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_uuid(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_profilepicture(HasBits* has_bits) { - (*has_bits)[0] |= 2u; + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; } }; -LokiProfile::LokiProfile(::PROTOBUF_NAMESPACE_ID::Arena* arena, +CallMessage::CallMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.LokiProfile) + // @@protoc_insertion_point(arena_constructor:SessionProtos.CallMessage) } -LokiProfile::LokiProfile(const LokiProfile& from) +CallMessage::CallMessage(const CallMessage& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - LokiProfile* const _this = this; (void)_this; + CallMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.displayname_){} - , decltype(_impl_.profilepicture_){}}; + , decltype(_impl_.sdps_){from._impl_.sdps_} + , decltype(_impl_.sdpmlineindexes_){from._impl_.sdpmlineindexes_} + , decltype(_impl_.sdpmids_){from._impl_.sdpmids_} + , decltype(_impl_.uuid_){} + , decltype(_impl_.type_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.displayname_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.displayname_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_displayname()) { - _this->_impl_.displayname_.Set(from._internal_displayname(), - _this->GetArenaForAllocation()); - } - _impl_.profilepicture_.InitDefault(); + _impl_.uuid_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilepicture_.Set("", GetArenaForAllocation()); + _impl_.uuid_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_profilepicture()) { - _this->_impl_.profilepicture_.Set(from._internal_profilepicture(), + if (from._internal_has_uuid()) { + _this->_impl_.uuid_.Set(from._internal_uuid(), _this->GetArenaForAllocation()); } - // @@protoc_insertion_point(copy_constructor:SessionProtos.LokiProfile) + _this->_impl_.type_ = from._impl_.type_; + // @@protoc_insertion_point(copy_constructor:SessionProtos.CallMessage) } -inline void LokiProfile::SharedCtor( +inline void CallMessage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.displayname_){} - , decltype(_impl_.profilepicture_){} + , decltype(_impl_.sdps_){arena} + , decltype(_impl_.sdpmlineindexes_){arena} + , decltype(_impl_.sdpmids_){arena} + , decltype(_impl_.uuid_){} + , decltype(_impl_.type_){6} }; - _impl_.displayname_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.displayname_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilepicture_.InitDefault(); + _impl_.uuid_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilepicture_.Set("", GetArenaForAllocation()); + _impl_.uuid_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -LokiProfile::~LokiProfile() { - // @@protoc_insertion_point(destructor:SessionProtos.LokiProfile) +CallMessage::~CallMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.CallMessage) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -4007,55 +4142,106 @@ LokiProfile::~LokiProfile() { SharedDtor(); } -inline void LokiProfile::SharedDtor() { +inline void CallMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.displayname_.Destroy(); - _impl_.profilepicture_.Destroy(); + _impl_.sdps_.~RepeatedPtrField(); + _impl_.sdpmlineindexes_.~RepeatedField(); + _impl_.sdpmids_.~RepeatedPtrField(); + _impl_.uuid_.Destroy(); } -void LokiProfile::SetCachedSize(int size) const { +void CallMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void LokiProfile::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.LokiProfile) +void CallMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.CallMessage) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + _impl_.sdps_.Clear(); + _impl_.sdpmlineindexes_.Clear(); + _impl_.sdpmids_.Clear(); cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _impl_.displayname_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000002u) { - _impl_.profilepicture_.ClearNonDefaultToEmpty(); + _impl_.uuid_.ClearNonDefaultToEmpty(); } + _impl_.type_ = 6; } _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* LokiProfile::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* CallMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // optional string displayName = 1; + // required .SessionProtos.CallMessage.Type type = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_displayname(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); + if (PROTOBUF_PREDICT_TRUE(::SessionProtos::CallMessage_Type_IsValid(val))) { + _internal_set_type(static_cast<::SessionProtos::CallMessage_Type>(val)); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields()); + } } else goto handle_unusual; continue; - // optional string profilePicture = 2; + // repeated string sdps = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_profilepicture(); + ptr -= 1; + do { + ptr += 1; + auto str = _internal_add_sdps(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); + } else + goto handle_unusual; + continue; + // repeated uint32 sdpMLineIndexes = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + ptr -= 1; + do { + ptr += 1; + _internal_add_sdpmlineindexes(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr)); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<24>(ptr)); + } else if (static_cast(tag) == 26) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_sdpmlineindexes(), ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // repeated string sdpMids = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr -= 1; + do { + ptr += 1; + auto str = _internal_add_sdpmids(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); + } else + goto handle_unusual; + continue; + // required string uuid = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + auto str = _internal_mutable_uuid(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else @@ -4085,58 +4271,117 @@ const char* LokiProfile::_InternalParse(const char* ptr, ::_pbi::ParseContext* c #undef CHK_ } -uint8_t* LokiProfile::_InternalSerialize( +uint8_t* CallMessage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.LokiProfile) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.CallMessage) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // optional string displayName = 1; - if (cached_has_bits & 0x00000001u) { - target = stream->WriteStringMaybeAliased( - 1, this->_internal_displayname(), target); - } - - // optional string profilePicture = 2; + // required .SessionProtos.CallMessage.Type type = 1; if (cached_has_bits & 0x00000002u) { - target = stream->WriteStringMaybeAliased( - 2, this->_internal_profilepicture(), target); + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this->_internal_type(), target); } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + // repeated string sdps = 2; + for (int i = 0, n = this->_internal_sdps_size(); i < n; i++) { + const auto& s = this->_internal_sdps(i); + target = stream->WriteString(2, s, target); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.LokiProfile) + + // repeated uint32 sdpMLineIndexes = 3; + for (int i = 0, n = this->_internal_sdpmlineindexes_size(); i < n; i++) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_sdpmlineindexes(i), target); + } + + // repeated string sdpMids = 4; + for (int i = 0, n = this->_internal_sdpmids_size(); i < n; i++) { + const auto& s = this->_internal_sdpmids(i); + target = stream->WriteString(4, s, target); + } + + // required string uuid = 5; + if (cached_has_bits & 0x00000001u) { + target = stream->WriteStringMaybeAliased( + 5, this->_internal_uuid(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.CallMessage) return target; } -size_t LokiProfile::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.LokiProfile) +size_t CallMessage::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.CallMessage) + size_t total_size = 0; + + if (_internal_has_uuid()) { + // required string uuid = 5; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_uuid()); + } + + if (_internal_has_type()) { + // required .SessionProtos.CallMessage.Type type = 1; + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); + } + + return total_size; +} +size_t CallMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.CallMessage) size_t total_size = 0; + if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. + // required string uuid = 5; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_uuid()); + + // required .SessionProtos.CallMessage.Type type = 1; + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); + + } else { + total_size += RequiredFieldsByteSizeFallback(); + } uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - // optional string displayName = 1; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_displayname()); - } + // repeated string sdps = 2; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.sdps_.size()); + for (int i = 0, n = _impl_.sdps_.size(); i < n; i++) { + total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + _impl_.sdps_.Get(i)); + } - // optional string profilePicture = 2; - if (cached_has_bits & 0x00000002u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_profilepicture()); - } + // repeated uint32 sdpMLineIndexes = 3; + { + size_t data_size = ::_pbi::WireFormatLite:: + UInt32Size(this->_impl_.sdpmlineindexes_); + total_size += 1 * + ::_pbi::FromIntSize(this->_internal_sdpmlineindexes_size()); + total_size += data_size; + } + // repeated string sdpMids = 4; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.sdpmids_.size()); + for (int i = 0, n = _impl_.sdpmids_.size(); i < n; i++) { + total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + _impl_.sdpmids_.Get(i)); } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } @@ -4145,152 +4390,141 @@ size_t LokiProfile::ByteSizeLong() const { return total_size; } -void LokiProfile::CheckTypeAndMergeFrom( +void CallMessage::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void LokiProfile::MergeFrom(const LokiProfile& from) { - LokiProfile* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.LokiProfile) +void CallMessage::MergeFrom(const CallMessage& from) { + CallMessage* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.CallMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; + _this->_impl_.sdps_.MergeFrom(from._impl_.sdps_); + _this->_impl_.sdpmlineindexes_.MergeFrom(from._impl_.sdpmlineindexes_); + _this->_impl_.sdpmids_.MergeFrom(from._impl_.sdpmids_); cached_has_bits = from._impl_._has_bits_[0]; if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_displayname(from._internal_displayname()); + _this->_internal_set_uuid(from._internal_uuid()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_profilepicture(from._internal_profilepicture()); + _this->_impl_.type_ = from._impl_.type_; } + _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void LokiProfile::CopyFrom(const LokiProfile& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.LokiProfile) +void CallMessage::CopyFrom(const CallMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.CallMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool LokiProfile::IsInitialized() const { +bool CallMessage::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; return true; } -void LokiProfile::InternalSwap(LokiProfile* other) { +void CallMessage::InternalSwap(CallMessage* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.sdps_.InternalSwap(&other->_impl_.sdps_); + _impl_.sdpmlineindexes_.InternalSwap(&other->_impl_.sdpmlineindexes_); + _impl_.sdpmids_.InternalSwap(&other->_impl_.sdpmids_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.displayname_, lhs_arena, - &other->_impl_.displayname_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.profilepicture_, lhs_arena, - &other->_impl_.profilepicture_, rhs_arena + &_impl_.uuid_, lhs_arena, + &other->_impl_.uuid_, rhs_arena ); + swap(_impl_.type_, other->_impl_.type_); } -std::string LokiProfile::GetTypeName() const { - return "SessionProtos.LokiProfile"; +std::string CallMessage::GetTypeName() const { + return "SessionProtos.CallMessage"; } // =================================================================== -class DataMessage_Quote_QuotedAttachment::_Internal { +class KeyPair::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_contenttype(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_publickey(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_filename(HasBits* has_bits) { + static void set_has_privatekey(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static const ::SessionProtos::AttachmentPointer& thumbnail(const DataMessage_Quote_QuotedAttachment* msg); - static void set_has_thumbnail(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } - static void set_has_flags(HasBits* has_bits) { - (*has_bits)[0] |= 8u; + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; } }; -const ::SessionProtos::AttachmentPointer& -DataMessage_Quote_QuotedAttachment::_Internal::thumbnail(const DataMessage_Quote_QuotedAttachment* msg) { - return *msg->_impl_.thumbnail_; -} -DataMessage_Quote_QuotedAttachment::DataMessage_Quote_QuotedAttachment(::PROTOBUF_NAMESPACE_ID::Arena* arena, +KeyPair::KeyPair(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Quote.QuotedAttachment) + // @@protoc_insertion_point(arena_constructor:SessionProtos.KeyPair) } -DataMessage_Quote_QuotedAttachment::DataMessage_Quote_QuotedAttachment(const DataMessage_Quote_QuotedAttachment& from) +KeyPair::KeyPair(const KeyPair& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataMessage_Quote_QuotedAttachment* const _this = this; (void)_this; + KeyPair* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.contenttype_){} - , decltype(_impl_.filename_){} - , decltype(_impl_.thumbnail_){nullptr} - , decltype(_impl_.flags_){}}; + , decltype(_impl_.publickey_){} + , decltype(_impl_.privatekey_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.contenttype_.InitDefault(); + _impl_.publickey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.contenttype_.Set("", GetArenaForAllocation()); + _impl_.publickey_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_contenttype()) { - _this->_impl_.contenttype_.Set(from._internal_contenttype(), + if (from._internal_has_publickey()) { + _this->_impl_.publickey_.Set(from._internal_publickey(), _this->GetArenaForAllocation()); } - _impl_.filename_.InitDefault(); + _impl_.privatekey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.filename_.Set("", GetArenaForAllocation()); + _impl_.privatekey_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_filename()) { - _this->_impl_.filename_.Set(from._internal_filename(), + if (from._internal_has_privatekey()) { + _this->_impl_.privatekey_.Set(from._internal_privatekey(), _this->GetArenaForAllocation()); } - if (from._internal_has_thumbnail()) { - _this->_impl_.thumbnail_ = new ::SessionProtos::AttachmentPointer(*from._impl_.thumbnail_); - } - _this->_impl_.flags_ = from._impl_.flags_; - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.Quote.QuotedAttachment) + // @@protoc_insertion_point(copy_constructor:SessionProtos.KeyPair) } -inline void DataMessage_Quote_QuotedAttachment::SharedCtor( +inline void KeyPair::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.contenttype_){} - , decltype(_impl_.filename_){} - , decltype(_impl_.thumbnail_){nullptr} - , decltype(_impl_.flags_){0u} + , decltype(_impl_.publickey_){} + , decltype(_impl_.privatekey_){} }; - _impl_.contenttype_.InitDefault(); + _impl_.publickey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.contenttype_.Set("", GetArenaForAllocation()); + _impl_.publickey_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.filename_.InitDefault(); + _impl_.privatekey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.filename_.Set("", GetArenaForAllocation()); + _impl_.privatekey_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -DataMessage_Quote_QuotedAttachment::~DataMessage_Quote_QuotedAttachment() { - // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Quote.QuotedAttachment) +KeyPair::~KeyPair() { + // @@protoc_insertion_point(destructor:SessionProtos.KeyPair) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -4298,83 +4532,60 @@ DataMessage_Quote_QuotedAttachment::~DataMessage_Quote_QuotedAttachment() { SharedDtor(); } -inline void DataMessage_Quote_QuotedAttachment::SharedDtor() { +inline void KeyPair::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.contenttype_.Destroy(); - _impl_.filename_.Destroy(); - if (this != internal_default_instance()) delete _impl_.thumbnail_; + _impl_.publickey_.Destroy(); + _impl_.privatekey_.Destroy(); } -void DataMessage_Quote_QuotedAttachment::SetCachedSize(int size) const { +void KeyPair::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataMessage_Quote_QuotedAttachment::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.Quote.QuotedAttachment) +void KeyPair::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.KeyPair) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _impl_.contenttype_.ClearNonDefaultToEmpty(); + _impl_.publickey_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.filename_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000004u) { - GOOGLE_DCHECK(_impl_.thumbnail_ != nullptr); - _impl_.thumbnail_->Clear(); + _impl_.privatekey_.ClearNonDefaultToEmpty(); } } - _impl_.flags_ = 0u; _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* DataMessage_Quote_QuotedAttachment::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* KeyPair::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // optional string contentType = 1; + // required bytes publicKey = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_contenttype(); + auto str = _internal_mutable_publickey(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional string fileName = 2; + // required bytes privateKey = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_filename(); + auto str = _internal_mutable_privatekey(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional .SessionProtos.AttachmentPointer thumbnail = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - ptr = ctx->ParseMessage(_internal_mutable_thumbnail(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional uint32 flags = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - _Internal::set_has_flags(&has_bits); - _impl_.flags_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; default: goto handle_unusual; } // switch @@ -4399,83 +4610,75 @@ const char* DataMessage_Quote_QuotedAttachment::_InternalParse(const char* ptr, #undef CHK_ } -uint8_t* DataMessage_Quote_QuotedAttachment::_InternalSerialize( +uint8_t* KeyPair::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.Quote.QuotedAttachment) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.KeyPair) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // optional string contentType = 1; + // required bytes publicKey = 1; if (cached_has_bits & 0x00000001u) { - target = stream->WriteStringMaybeAliased( - 1, this->_internal_contenttype(), target); + target = stream->WriteBytesMaybeAliased( + 1, this->_internal_publickey(), target); } - // optional string fileName = 2; + // required bytes privateKey = 2; if (cached_has_bits & 0x00000002u) { - target = stream->WriteStringMaybeAliased( - 2, this->_internal_filename(), target); - } - - // optional .SessionProtos.AttachmentPointer thumbnail = 3; - if (cached_has_bits & 0x00000004u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::thumbnail(this), - _Internal::thumbnail(this).GetCachedSize(), target, stream); - } - - // optional uint32 flags = 4; - if (cached_has_bits & 0x00000008u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_flags(), target); + target = stream->WriteBytesMaybeAliased( + 2, this->_internal_privatekey(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Quote.QuotedAttachment) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.KeyPair) return target; } -size_t DataMessage_Quote_QuotedAttachment::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.Quote.QuotedAttachment) +size_t KeyPair::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.KeyPair) size_t total_size = 0; - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; + if (_internal_has_publickey()) { + // required bytes publicKey = 1; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_publickey()); + } - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { - // optional string contentType = 1; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_contenttype()); - } + if (_internal_has_privatekey()) { + // required bytes privateKey = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_privatekey()); + } - // optional string fileName = 2; - if (cached_has_bits & 0x00000002u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_filename()); - } + return total_size; +} +size_t KeyPair::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.KeyPair) + size_t total_size = 0; - // optional .SessionProtos.AttachmentPointer thumbnail = 3; - if (cached_has_bits & 0x00000004u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.thumbnail_); - } + if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. + // required bytes publicKey = 1; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_publickey()); - // optional uint32 flags = 4; - if (cached_has_bits & 0x00000008u) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); - } + // required bytes privateKey = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_privatekey()); + } else { + total_size += RequiredFieldsByteSizeFallback(); } + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } @@ -4484,161 +4687,116 @@ size_t DataMessage_Quote_QuotedAttachment::ByteSizeLong() const { return total_size; } -void DataMessage_Quote_QuotedAttachment::CheckTypeAndMergeFrom( +void KeyPair::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void DataMessage_Quote_QuotedAttachment::MergeFrom(const DataMessage_Quote_QuotedAttachment& from) { - DataMessage_Quote_QuotedAttachment* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Quote.QuotedAttachment) +void KeyPair::MergeFrom(const KeyPair& from) { + KeyPair* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.KeyPair) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { + if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_contenttype(from._internal_contenttype()); + _this->_internal_set_publickey(from._internal_publickey()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_filename(from._internal_filename()); - } - if (cached_has_bits & 0x00000004u) { - _this->_internal_mutable_thumbnail()->::SessionProtos::AttachmentPointer::MergeFrom( - from._internal_thumbnail()); - } - if (cached_has_bits & 0x00000008u) { - _this->_impl_.flags_ = from._impl_.flags_; + _this->_internal_set_privatekey(from._internal_privatekey()); } - _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void DataMessage_Quote_QuotedAttachment::CopyFrom(const DataMessage_Quote_QuotedAttachment& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.Quote.QuotedAttachment) +void KeyPair::CopyFrom(const KeyPair& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.KeyPair) if (&from == this) return; Clear(); MergeFrom(from); } -bool DataMessage_Quote_QuotedAttachment::IsInitialized() const { - if (_internal_has_thumbnail()) { - if (!_impl_.thumbnail_->IsInitialized()) return false; - } +bool KeyPair::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; return true; } -void DataMessage_Quote_QuotedAttachment::InternalSwap(DataMessage_Quote_QuotedAttachment* other) { +void KeyPair::InternalSwap(KeyPair* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.contenttype_, lhs_arena, - &other->_impl_.contenttype_, rhs_arena + &_impl_.publickey_, lhs_arena, + &other->_impl_.publickey_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.filename_, lhs_arena, - &other->_impl_.filename_, rhs_arena + &_impl_.privatekey_, lhs_arena, + &other->_impl_.privatekey_, rhs_arena ); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(DataMessage_Quote_QuotedAttachment, _impl_.flags_) - + sizeof(DataMessage_Quote_QuotedAttachment::_impl_.flags_) - - PROTOBUF_FIELD_OFFSET(DataMessage_Quote_QuotedAttachment, _impl_.thumbnail_)>( - reinterpret_cast(&_impl_.thumbnail_), - reinterpret_cast(&other->_impl_.thumbnail_)); } -std::string DataMessage_Quote_QuotedAttachment::GetTypeName() const { - return "SessionProtos.DataMessage.Quote.QuotedAttachment"; +std::string KeyPair::GetTypeName() const { + return "SessionProtos.KeyPair"; } // =================================================================== -class DataMessage_Quote::_Internal { +class DataExtractionNotification::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_id(HasBits* has_bits) { - (*has_bits)[0] |= 4u; + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_type(HasBits* has_bits) { + (*has_bits)[0] |= 2u; } - static void set_has_author(HasBits* has_bits) { + static void set_has_timestamp(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_text(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000005) ^ 0x00000005) != 0; + return ((has_bits[0] & 0x00000002) ^ 0x00000002) != 0; } }; -DataMessage_Quote::DataMessage_Quote(::PROTOBUF_NAMESPACE_ID::Arena* arena, +DataExtractionNotification::DataExtractionNotification(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Quote) + // @@protoc_insertion_point(arena_constructor:SessionProtos.DataExtractionNotification) } -DataMessage_Quote::DataMessage_Quote(const DataMessage_Quote& from) +DataExtractionNotification::DataExtractionNotification(const DataExtractionNotification& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataMessage_Quote* const _this = this; (void)_this; + DataExtractionNotification* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.attachments_){from._impl_.attachments_} - , decltype(_impl_.author_){} - , decltype(_impl_.text_){} - , decltype(_impl_.id_){}}; + , decltype(_impl_.timestamp_){} + , decltype(_impl_.type_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.author_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.author_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_author()) { - _this->_impl_.author_.Set(from._internal_author(), - _this->GetArenaForAllocation()); - } - _impl_.text_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.text_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_text()) { - _this->_impl_.text_.Set(from._internal_text(), - _this->GetArenaForAllocation()); - } - _this->_impl_.id_ = from._impl_.id_; - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.Quote) + ::memcpy(&_impl_.timestamp_, &from._impl_.timestamp_, + static_cast(reinterpret_cast(&_impl_.type_) - + reinterpret_cast(&_impl_.timestamp_)) + sizeof(_impl_.type_)); + // @@protoc_insertion_point(copy_constructor:SessionProtos.DataExtractionNotification) } -inline void DataMessage_Quote::SharedCtor( +inline void DataExtractionNotification::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.attachments_){arena} - , decltype(_impl_.author_){} - , decltype(_impl_.text_){} - , decltype(_impl_.id_){uint64_t{0u}} + , decltype(_impl_.timestamp_){uint64_t{0u}} + , decltype(_impl_.type_){1} }; - _impl_.author_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.author_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.text_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.text_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -DataMessage_Quote::~DataMessage_Quote() { - // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Quote) +DataExtractionNotification::~DataExtractionNotification() { + // @@protoc_insertion_point(destructor:SessionProtos.DataExtractionNotification) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -4646,85 +4804,58 @@ DataMessage_Quote::~DataMessage_Quote() { SharedDtor(); } -inline void DataMessage_Quote::SharedDtor() { +inline void DataExtractionNotification::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.attachments_.~RepeatedPtrField(); - _impl_.author_.Destroy(); - _impl_.text_.Destroy(); } -void DataMessage_Quote::SetCachedSize(int size) const { +void DataExtractionNotification::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataMessage_Quote::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.Quote) +void DataExtractionNotification::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.DataExtractionNotification) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.attachments_.Clear(); cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000003u) { - if (cached_has_bits & 0x00000001u) { - _impl_.author_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000002u) { - _impl_.text_.ClearNonDefaultToEmpty(); - } + _impl_.timestamp_ = uint64_t{0u}; + _impl_.type_ = 1; } - _impl_.id_ = uint64_t{0u}; _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* DataMessage_Quote::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* DataExtractionNotification::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required uint64 id = 1; + // required .SessionProtos.DataExtractionNotification.Type type = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _Internal::set_has_id(&has_bits); - _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); + if (PROTOBUF_PREDICT_TRUE(::SessionProtos::DataExtractionNotification_Type_IsValid(val))) { + _internal_set_type(static_cast<::SessionProtos::DataExtractionNotification_Type>(val)); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields()); + } } else goto handle_unusual; continue; - // required string author = 2; + // optional uint64 timestamp = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_author(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional string text = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_text(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _Internal::set_has_timestamp(&has_bits); + _impl_.timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else goto handle_unusual; continue; - // repeated .SessionProtos.DataMessage.Quote.QuotedAttachment attachments = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_attachments(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); - } else - goto handle_unusual; - continue; default: goto handle_unusual; } // switch @@ -4749,98 +4880,51 @@ const char* DataMessage_Quote::_InternalParse(const char* ptr, ::_pbi::ParseCont #undef CHK_ } -uint8_t* DataMessage_Quote::_InternalSerialize( +uint8_t* DataExtractionNotification::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.Quote) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataExtractionNotification) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required uint64 id = 1; - if (cached_has_bits & 0x00000004u) { + // required .SessionProtos.DataExtractionNotification.Type type = 1; + if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_id(), target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this->_internal_type(), target); } - // required string author = 2; + // optional uint64 timestamp = 2; if (cached_has_bits & 0x00000001u) { - target = stream->WriteStringMaybeAliased( - 2, this->_internal_author(), target); - } - - // optional string text = 3; - if (cached_has_bits & 0x00000002u) { - target = stream->WriteStringMaybeAliased( - 3, this->_internal_text(), target); - } - - // repeated .SessionProtos.DataMessage.Quote.QuotedAttachment attachments = 4; - for (unsigned i = 0, - n = static_cast(this->_internal_attachments_size()); i < n; i++) { - const auto& repfield = this->_internal_attachments(i); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(4, repfield, repfield.GetCachedSize(), target, stream); + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_timestamp(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Quote) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataExtractionNotification) return target; } -size_t DataMessage_Quote::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.DataMessage.Quote) - size_t total_size = 0; - - if (_internal_has_author()) { - // required string author = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_author()); - } - - if (_internal_has_id()) { - // required uint64 id = 1; - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id()); - } - - return total_size; -} -size_t DataMessage_Quote::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.Quote) +size_t DataExtractionNotification::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataExtractionNotification) size_t total_size = 0; - if (((_impl_._has_bits_[0] & 0x00000005) ^ 0x00000005) == 0) { // All required fields are present. - // required string author = 2; + // required .SessionProtos.DataExtractionNotification.Type type = 1; + if (_internal_has_type()) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_author()); - - // required uint64 id = 1; - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id()); - - } else { - total_size += RequiredFieldsByteSizeFallback(); + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); } uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // repeated .SessionProtos.DataMessage.Quote.QuotedAttachment attachments = 4; - total_size += 1UL * this->_internal_attachments_size(); - for (const auto& msg : this->_impl_.attachments_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // optional string text = 3; + // optional uint64 timestamp = 2; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000002u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_text()); + if (cached_has_bits & 0x00000001u) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_timestamp()); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -4851,159 +4935,127 @@ size_t DataMessage_Quote::ByteSizeLong() const { return total_size; } -void DataMessage_Quote::CheckTypeAndMergeFrom( +void DataExtractionNotification::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void DataMessage_Quote::MergeFrom(const DataMessage_Quote& from) { - DataMessage_Quote* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Quote) +void DataExtractionNotification::MergeFrom(const DataExtractionNotification& from) { + DataExtractionNotification* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataExtractionNotification) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.attachments_.MergeFrom(from._impl_.attachments_); cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_author(from._internal_author()); + _this->_impl_.timestamp_ = from._impl_.timestamp_; } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_text(from._internal_text()); - } - if (cached_has_bits & 0x00000004u) { - _this->_impl_.id_ = from._impl_.id_; + _this->_impl_.type_ = from._impl_.type_; } _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void DataMessage_Quote::CopyFrom(const DataMessage_Quote& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.Quote) +void DataExtractionNotification::CopyFrom(const DataExtractionNotification& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataExtractionNotification) if (&from == this) return; Clear(); MergeFrom(from); } -bool DataMessage_Quote::IsInitialized() const { +bool DataExtractionNotification::IsInitialized() const { if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; - if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.attachments_)) - return false; return true; } -void DataMessage_Quote::InternalSwap(DataMessage_Quote* other) { +void DataExtractionNotification::InternalSwap(DataExtractionNotification* other) { using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.attachments_.InternalSwap(&other->_impl_.attachments_); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.author_, lhs_arena, - &other->_impl_.author_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.text_, lhs_arena, - &other->_impl_.text_, rhs_arena - ); - swap(_impl_.id_, other->_impl_.id_); + swap(_impl_.timestamp_, other->_impl_.timestamp_); + swap(_impl_.type_, other->_impl_.type_); } -std::string DataMessage_Quote::GetTypeName() const { - return "SessionProtos.DataMessage.Quote"; +std::string DataExtractionNotification::GetTypeName() const { + return "SessionProtos.DataExtractionNotification"; } // =================================================================== -class DataMessage_Preview::_Internal { +class LokiProfile::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_url(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_displayname(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_title(HasBits* has_bits) { + static void set_has_profilepicture(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static const ::SessionProtos::AttachmentPointer& image(const DataMessage_Preview* msg); - static void set_has_image(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } - static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0; - } }; -const ::SessionProtos::AttachmentPointer& -DataMessage_Preview::_Internal::image(const DataMessage_Preview* msg) { - return *msg->_impl_.image_; -} -DataMessage_Preview::DataMessage_Preview(::PROTOBUF_NAMESPACE_ID::Arena* arena, +LokiProfile::LokiProfile(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Preview) + // @@protoc_insertion_point(arena_constructor:SessionProtos.LokiProfile) } -DataMessage_Preview::DataMessage_Preview(const DataMessage_Preview& from) +LokiProfile::LokiProfile(const LokiProfile& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataMessage_Preview* const _this = this; (void)_this; + LokiProfile* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.url_){} - , decltype(_impl_.title_){} - , decltype(_impl_.image_){nullptr}}; + , decltype(_impl_.displayname_){} + , decltype(_impl_.profilepicture_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.url_.InitDefault(); + _impl_.displayname_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.url_.Set("", GetArenaForAllocation()); + _impl_.displayname_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_url()) { - _this->_impl_.url_.Set(from._internal_url(), + if (from._internal_has_displayname()) { + _this->_impl_.displayname_.Set(from._internal_displayname(), _this->GetArenaForAllocation()); } - _impl_.title_.InitDefault(); + _impl_.profilepicture_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.title_.Set("", GetArenaForAllocation()); + _impl_.profilepicture_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_title()) { - _this->_impl_.title_.Set(from._internal_title(), + if (from._internal_has_profilepicture()) { + _this->_impl_.profilepicture_.Set(from._internal_profilepicture(), _this->GetArenaForAllocation()); } - if (from._internal_has_image()) { - _this->_impl_.image_ = new ::SessionProtos::AttachmentPointer(*from._impl_.image_); - } - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.Preview) + // @@protoc_insertion_point(copy_constructor:SessionProtos.LokiProfile) } -inline void DataMessage_Preview::SharedCtor( +inline void LokiProfile::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.url_){} - , decltype(_impl_.title_){} - , decltype(_impl_.image_){nullptr} + , decltype(_impl_.displayname_){} + , decltype(_impl_.profilepicture_){} }; - _impl_.url_.InitDefault(); + _impl_.displayname_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.url_.Set("", GetArenaForAllocation()); + _impl_.displayname_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.title_.InitDefault(); + _impl_.profilepicture_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.title_.Set("", GetArenaForAllocation()); + _impl_.profilepicture_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -DataMessage_Preview::~DataMessage_Preview() { - // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Preview) +LokiProfile::~LokiProfile() { + // @@protoc_insertion_point(destructor:SessionProtos.LokiProfile) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -5011,73 +5063,60 @@ DataMessage_Preview::~DataMessage_Preview() { SharedDtor(); } -inline void DataMessage_Preview::SharedDtor() { +inline void LokiProfile::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.url_.Destroy(); - _impl_.title_.Destroy(); - if (this != internal_default_instance()) delete _impl_.image_; + _impl_.displayname_.Destroy(); + _impl_.profilepicture_.Destroy(); } -void DataMessage_Preview::SetCachedSize(int size) const { +void LokiProfile::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataMessage_Preview::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.Preview) +void LokiProfile::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.LokiProfile) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _impl_.url_.ClearNonDefaultToEmpty(); + _impl_.displayname_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.title_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000004u) { - GOOGLE_DCHECK(_impl_.image_ != nullptr); - _impl_.image_->Clear(); + _impl_.profilepicture_.ClearNonDefaultToEmpty(); } } _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* DataMessage_Preview::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* LokiProfile::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required string url = 1; + // optional string displayName = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_url(); + auto str = _internal_mutable_displayname(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional string title = 2; + // optional string profilePicture = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_title(); + auto str = _internal_mutable_profilepicture(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional .SessionProtos.AttachmentPointer image = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - ptr = ctx->ParseMessage(_internal_mutable_image(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; default: goto handle_unusual; } // switch @@ -5102,68 +5141,55 @@ const char* DataMessage_Preview::_InternalParse(const char* ptr, ::_pbi::ParseCo #undef CHK_ } -uint8_t* DataMessage_Preview::_InternalSerialize( +uint8_t* LokiProfile::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.Preview) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.LokiProfile) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required string url = 1; + // optional string displayName = 1; if (cached_has_bits & 0x00000001u) { target = stream->WriteStringMaybeAliased( - 1, this->_internal_url(), target); + 1, this->_internal_displayname(), target); } - // optional string title = 2; + // optional string profilePicture = 2; if (cached_has_bits & 0x00000002u) { target = stream->WriteStringMaybeAliased( - 2, this->_internal_title(), target); - } - - // optional .SessionProtos.AttachmentPointer image = 3; - if (cached_has_bits & 0x00000004u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::image(this), - _Internal::image(this).GetCachedSize(), target, stream); + 2, this->_internal_profilepicture(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Preview) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.LokiProfile) return target; } -size_t DataMessage_Preview::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.Preview) +size_t LokiProfile::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.LokiProfile) size_t total_size = 0; - // required string url = 1; - if (_internal_has_url()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_url()); - } uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000006u) { - // optional string title = 2; - if (cached_has_bits & 0x00000002u) { + if (cached_has_bits & 0x00000003u) { + // optional string displayName = 1; + if (cached_has_bits & 0x00000001u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_title()); + this->_internal_displayname()); } - // optional .SessionProtos.AttachmentPointer image = 3; - if (cached_has_bits & 0x00000004u) { + // optional string profilePicture = 2; + if (cached_has_bits & 0x00000002u) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.image_); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_profilepicture()); } } @@ -5175,158 +5201,152 @@ size_t DataMessage_Preview::ByteSizeLong() const { return total_size; } -void DataMessage_Preview::CheckTypeAndMergeFrom( +void LokiProfile::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void DataMessage_Preview::MergeFrom(const DataMessage_Preview& from) { - DataMessage_Preview* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Preview) +void LokiProfile::MergeFrom(const LokiProfile& from) { + LokiProfile* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.LokiProfile) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_url(from._internal_url()); + _this->_internal_set_displayname(from._internal_displayname()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_title(from._internal_title()); - } - if (cached_has_bits & 0x00000004u) { - _this->_internal_mutable_image()->::SessionProtos::AttachmentPointer::MergeFrom( - from._internal_image()); + _this->_internal_set_profilepicture(from._internal_profilepicture()); } } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void DataMessage_Preview::CopyFrom(const DataMessage_Preview& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.Preview) +void LokiProfile::CopyFrom(const LokiProfile& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.LokiProfile) if (&from == this) return; Clear(); MergeFrom(from); } -bool DataMessage_Preview::IsInitialized() const { - if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; - if (_internal_has_image()) { - if (!_impl_.image_->IsInitialized()) return false; - } +bool LokiProfile::IsInitialized() const { return true; } -void DataMessage_Preview::InternalSwap(DataMessage_Preview* other) { +void LokiProfile::InternalSwap(LokiProfile* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.url_, lhs_arena, - &other->_impl_.url_, rhs_arena + &_impl_.displayname_, lhs_arena, + &other->_impl_.displayname_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.title_, lhs_arena, - &other->_impl_.title_, rhs_arena + &_impl_.profilepicture_, lhs_arena, + &other->_impl_.profilepicture_, rhs_arena ); - swap(_impl_.image_, other->_impl_.image_); } -std::string DataMessage_Preview::GetTypeName() const { - return "SessionProtos.DataMessage.Preview"; +std::string LokiProfile::GetTypeName() const { + return "SessionProtos.LokiProfile"; } // =================================================================== -class DataMessage_Reaction::_Internal { +class DataMessage_Quote_QuotedAttachment::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_id(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } - static void set_has_author(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_contenttype(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_emoji(HasBits* has_bits) { + static void set_has_filename(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static void set_has_action(HasBits* has_bits) { - (*has_bits)[0] |= 8u; + static const ::SessionProtos::AttachmentPointer& thumbnail(const DataMessage_Quote_QuotedAttachment* msg); + static void set_has_thumbnail(HasBits* has_bits) { + (*has_bits)[0] |= 4u; } - static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x0000000d) ^ 0x0000000d) != 0; + static void set_has_flags(HasBits* has_bits) { + (*has_bits)[0] |= 8u; } }; -DataMessage_Reaction::DataMessage_Reaction(::PROTOBUF_NAMESPACE_ID::Arena* arena, +const ::SessionProtos::AttachmentPointer& +DataMessage_Quote_QuotedAttachment::_Internal::thumbnail(const DataMessage_Quote_QuotedAttachment* msg) { + return *msg->_impl_.thumbnail_; +} +DataMessage_Quote_QuotedAttachment::DataMessage_Quote_QuotedAttachment(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Reaction) + // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Quote.QuotedAttachment) } -DataMessage_Reaction::DataMessage_Reaction(const DataMessage_Reaction& from) +DataMessage_Quote_QuotedAttachment::DataMessage_Quote_QuotedAttachment(const DataMessage_Quote_QuotedAttachment& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataMessage_Reaction* const _this = this; (void)_this; + DataMessage_Quote_QuotedAttachment* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.author_){} - , decltype(_impl_.emoji_){} - , decltype(_impl_.id_){} - , decltype(_impl_.action_){}}; + , decltype(_impl_.contenttype_){} + , decltype(_impl_.filename_){} + , decltype(_impl_.thumbnail_){nullptr} + , decltype(_impl_.flags_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.author_.InitDefault(); + _impl_.contenttype_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.author_.Set("", GetArenaForAllocation()); + _impl_.contenttype_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_author()) { - _this->_impl_.author_.Set(from._internal_author(), + if (from._internal_has_contenttype()) { + _this->_impl_.contenttype_.Set(from._internal_contenttype(), _this->GetArenaForAllocation()); } - _impl_.emoji_.InitDefault(); + _impl_.filename_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.emoji_.Set("", GetArenaForAllocation()); + _impl_.filename_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_emoji()) { - _this->_impl_.emoji_.Set(from._internal_emoji(), + if (from._internal_has_filename()) { + _this->_impl_.filename_.Set(from._internal_filename(), _this->GetArenaForAllocation()); } - ::memcpy(&_impl_.id_, &from._impl_.id_, - static_cast(reinterpret_cast(&_impl_.action_) - - reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.action_)); - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.Reaction) + if (from._internal_has_thumbnail()) { + _this->_impl_.thumbnail_ = new ::SessionProtos::AttachmentPointer(*from._impl_.thumbnail_); + } + _this->_impl_.flags_ = from._impl_.flags_; + // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.Quote.QuotedAttachment) } -inline void DataMessage_Reaction::SharedCtor( +inline void DataMessage_Quote_QuotedAttachment::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.author_){} - , decltype(_impl_.emoji_){} - , decltype(_impl_.id_){uint64_t{0u}} - , decltype(_impl_.action_){0} + , decltype(_impl_.contenttype_){} + , decltype(_impl_.filename_){} + , decltype(_impl_.thumbnail_){nullptr} + , decltype(_impl_.flags_){0u} }; - _impl_.author_.InitDefault(); + _impl_.contenttype_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.author_.Set("", GetArenaForAllocation()); + _impl_.contenttype_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.emoji_.InitDefault(); + _impl_.filename_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.emoji_.Set("", GetArenaForAllocation()); + _impl_.filename_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -DataMessage_Reaction::~DataMessage_Reaction() { - // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Reaction) +DataMessage_Quote_QuotedAttachment::~DataMessage_Quote_QuotedAttachment() { + // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Quote.QuotedAttachment) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -5334,84 +5354,80 @@ DataMessage_Reaction::~DataMessage_Reaction() { SharedDtor(); } -inline void DataMessage_Reaction::SharedDtor() { +inline void DataMessage_Quote_QuotedAttachment::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.author_.Destroy(); - _impl_.emoji_.Destroy(); + _impl_.contenttype_.Destroy(); + _impl_.filename_.Destroy(); + if (this != internal_default_instance()) delete _impl_.thumbnail_; } -void DataMessage_Reaction::SetCachedSize(int size) const { +void DataMessage_Quote_QuotedAttachment::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataMessage_Reaction::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.Reaction) +void DataMessage_Quote_QuotedAttachment::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.Quote.QuotedAttachment) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x00000001u) { - _impl_.author_.ClearNonDefaultToEmpty(); + _impl_.contenttype_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.emoji_.ClearNonDefaultToEmpty(); + _impl_.filename_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000004u) { + GOOGLE_DCHECK(_impl_.thumbnail_ != nullptr); + _impl_.thumbnail_->Clear(); } } - if (cached_has_bits & 0x0000000cu) { - ::memset(&_impl_.id_, 0, static_cast( - reinterpret_cast(&_impl_.action_) - - reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.action_)); - } + _impl_.flags_ = 0u; _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* DataMessage_Reaction::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* DataMessage_Quote_QuotedAttachment::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required uint64 id = 1; + // optional string contentType = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _Internal::set_has_id(&has_bits); - _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_contenttype(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // required string author = 2; + // optional string fileName = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_author(); + auto str = _internal_mutable_filename(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional string emoji = 3; + // optional .SessionProtos.AttachmentPointer thumbnail = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_emoji(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + ptr = ctx->ParseMessage(_internal_mutable_thumbnail(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // required .SessionProtos.DataMessage.Reaction.Action action = 4; + // optional uint32 flags = 4; case 4: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - if (PROTOBUF_PREDICT_TRUE(::SessionProtos::DataMessage_Reaction_Action_IsValid(val))) { - _internal_set_action(static_cast<::SessionProtos::DataMessage_Reaction_Action>(val)); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields()); - } + _Internal::set_has_flags(&has_bits); + _impl_.flags_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); } else goto handle_unusual; continue; @@ -5439,102 +5455,83 @@ const char* DataMessage_Reaction::_InternalParse(const char* ptr, ::_pbi::ParseC #undef CHK_ } -uint8_t* DataMessage_Reaction::_InternalSerialize( +uint8_t* DataMessage_Quote_QuotedAttachment::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.Reaction) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.Quote.QuotedAttachment) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required uint64 id = 1; - if (cached_has_bits & 0x00000004u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_id(), target); - } - - // required string author = 2; + // optional string contentType = 1; if (cached_has_bits & 0x00000001u) { target = stream->WriteStringMaybeAliased( - 2, this->_internal_author(), target); + 1, this->_internal_contenttype(), target); } - // optional string emoji = 3; + // optional string fileName = 2; if (cached_has_bits & 0x00000002u) { target = stream->WriteStringMaybeAliased( - 3, this->_internal_emoji(), target); + 2, this->_internal_filename(), target); } - // required .SessionProtos.DataMessage.Reaction.Action action = 4; + // optional .SessionProtos.AttachmentPointer thumbnail = 3; + if (cached_has_bits & 0x00000004u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::thumbnail(this), + _Internal::thumbnail(this).GetCachedSize(), target, stream); + } + + // optional uint32 flags = 4; if (cached_has_bits & 0x00000008u) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 4, this->_internal_action(), target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_flags(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Reaction) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Quote.QuotedAttachment) return target; } -size_t DataMessage_Reaction::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.DataMessage.Reaction) - size_t total_size = 0; - - if (_internal_has_author()) { - // required string author = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_author()); - } - - if (_internal_has_id()) { - // required uint64 id = 1; - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id()); - } - - if (_internal_has_action()) { - // required .SessionProtos.DataMessage.Reaction.Action action = 4; - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_action()); - } - - return total_size; -} -size_t DataMessage_Reaction::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.Reaction) +size_t DataMessage_Quote_QuotedAttachment::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.Quote.QuotedAttachment) size_t total_size = 0; - if (((_impl_._has_bits_[0] & 0x0000000d) ^ 0x0000000d) == 0) { // All required fields are present. - // required string author = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_author()); - - // required uint64 id = 1; - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id()); - - // required .SessionProtos.DataMessage.Reaction.Action action = 4; - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_action()); - - } else { - total_size += RequiredFieldsByteSizeFallback(); - } uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // optional string emoji = 3; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000002u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_emoji()); - } + if (cached_has_bits & 0x0000000fu) { + // optional string contentType = 1; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_contenttype()); + } + + // optional string fileName = 2; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_filename()); + } + + // optional .SessionProtos.AttachmentPointer thumbnail = 3; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.thumbnail_); + } + + // optional uint32 flags = 4; + if (cached_has_bits & 0x00000008u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); + } + } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } @@ -5543,15 +5540,15 @@ size_t DataMessage_Reaction::ByteSizeLong() const { return total_size; } -void DataMessage_Reaction::CheckTypeAndMergeFrom( +void DataMessage_Quote_QuotedAttachment::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void DataMessage_Reaction::MergeFrom(const DataMessage_Reaction& from) { - DataMessage_Reaction* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Reaction) +void DataMessage_Quote_QuotedAttachment::MergeFrom(const DataMessage_Quote_QuotedAttachment& from) { + DataMessage_Quote_QuotedAttachment* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Quote.QuotedAttachment) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -5559,134 +5556,145 @@ void DataMessage_Reaction::MergeFrom(const DataMessage_Reaction& from) { cached_has_bits = from._impl_._has_bits_[0]; if (cached_has_bits & 0x0000000fu) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_author(from._internal_author()); + _this->_internal_set_contenttype(from._internal_contenttype()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_emoji(from._internal_emoji()); + _this->_internal_set_filename(from._internal_filename()); } if (cached_has_bits & 0x00000004u) { - _this->_impl_.id_ = from._impl_.id_; + _this->_internal_mutable_thumbnail()->::SessionProtos::AttachmentPointer::MergeFrom( + from._internal_thumbnail()); } if (cached_has_bits & 0x00000008u) { - _this->_impl_.action_ = from._impl_.action_; + _this->_impl_.flags_ = from._impl_.flags_; } _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void DataMessage_Reaction::CopyFrom(const DataMessage_Reaction& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.Reaction) +void DataMessage_Quote_QuotedAttachment::CopyFrom(const DataMessage_Quote_QuotedAttachment& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.Quote.QuotedAttachment) if (&from == this) return; Clear(); MergeFrom(from); } -bool DataMessage_Reaction::IsInitialized() const { - if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; +bool DataMessage_Quote_QuotedAttachment::IsInitialized() const { + if (_internal_has_thumbnail()) { + if (!_impl_.thumbnail_->IsInitialized()) return false; + } return true; } -void DataMessage_Reaction::InternalSwap(DataMessage_Reaction* other) { +void DataMessage_Quote_QuotedAttachment::InternalSwap(DataMessage_Quote_QuotedAttachment* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.author_, lhs_arena, - &other->_impl_.author_, rhs_arena + &_impl_.contenttype_, lhs_arena, + &other->_impl_.contenttype_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.emoji_, lhs_arena, - &other->_impl_.emoji_, rhs_arena + &_impl_.filename_, lhs_arena, + &other->_impl_.filename_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(DataMessage_Reaction, _impl_.action_) - + sizeof(DataMessage_Reaction::_impl_.action_) - - PROTOBUF_FIELD_OFFSET(DataMessage_Reaction, _impl_.id_)>( - reinterpret_cast(&_impl_.id_), - reinterpret_cast(&other->_impl_.id_)); + PROTOBUF_FIELD_OFFSET(DataMessage_Quote_QuotedAttachment, _impl_.flags_) + + sizeof(DataMessage_Quote_QuotedAttachment::_impl_.flags_) + - PROTOBUF_FIELD_OFFSET(DataMessage_Quote_QuotedAttachment, _impl_.thumbnail_)>( + reinterpret_cast(&_impl_.thumbnail_), + reinterpret_cast(&other->_impl_.thumbnail_)); } -std::string DataMessage_Reaction::GetTypeName() const { - return "SessionProtos.DataMessage.Reaction"; +std::string DataMessage_Quote_QuotedAttachment::GetTypeName() const { + return "SessionProtos.DataMessage.Quote.QuotedAttachment"; } // =================================================================== -class DataMessage_OpenGroupInvitation::_Internal { +class DataMessage_Quote::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_url(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_id(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static void set_has_author(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_name(HasBits* has_bits) { + static void set_has_text(HasBits* has_bits) { (*has_bits)[0] |= 2u; } static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; + return ((has_bits[0] & 0x00000005) ^ 0x00000005) != 0; } }; -DataMessage_OpenGroupInvitation::DataMessage_OpenGroupInvitation(::PROTOBUF_NAMESPACE_ID::Arena* arena, +DataMessage_Quote::DataMessage_Quote(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.OpenGroupInvitation) + // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Quote) } -DataMessage_OpenGroupInvitation::DataMessage_OpenGroupInvitation(const DataMessage_OpenGroupInvitation& from) +DataMessage_Quote::DataMessage_Quote(const DataMessage_Quote& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataMessage_OpenGroupInvitation* const _this = this; (void)_this; + DataMessage_Quote* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.url_){} - , decltype(_impl_.name_){}}; + , decltype(_impl_.attachments_){from._impl_.attachments_} + , decltype(_impl_.author_){} + , decltype(_impl_.text_){} + , decltype(_impl_.id_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.url_.InitDefault(); + _impl_.author_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.url_.Set("", GetArenaForAllocation()); + _impl_.author_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_url()) { - _this->_impl_.url_.Set(from._internal_url(), + if (from._internal_has_author()) { + _this->_impl_.author_.Set(from._internal_author(), _this->GetArenaForAllocation()); } - _impl_.name_.InitDefault(); + _impl_.text_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); + _impl_.text_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_name()) { - _this->_impl_.name_.Set(from._internal_name(), + if (from._internal_has_text()) { + _this->_impl_.text_.Set(from._internal_text(), _this->GetArenaForAllocation()); } - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.OpenGroupInvitation) + _this->_impl_.id_ = from._impl_.id_; + // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.Quote) } -inline void DataMessage_OpenGroupInvitation::SharedCtor( +inline void DataMessage_Quote::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.url_){} - , decltype(_impl_.name_){} + , decltype(_impl_.attachments_){arena} + , decltype(_impl_.author_){} + , decltype(_impl_.text_){} + , decltype(_impl_.id_){uint64_t{0u}} }; - _impl_.url_.InitDefault(); + _impl_.author_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.url_.Set("", GetArenaForAllocation()); + _impl_.author_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.InitDefault(); + _impl_.text_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); + _impl_.text_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -DataMessage_OpenGroupInvitation::~DataMessage_OpenGroupInvitation() { - // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.OpenGroupInvitation) +DataMessage_Quote::~DataMessage_Quote() { + // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Quote) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -5694,60 +5702,85 @@ DataMessage_OpenGroupInvitation::~DataMessage_OpenGroupInvitation() { SharedDtor(); } -inline void DataMessage_OpenGroupInvitation::SharedDtor() { +inline void DataMessage_Quote::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.url_.Destroy(); - _impl_.name_.Destroy(); + _impl_.attachments_.~RepeatedPtrField(); + _impl_.author_.Destroy(); + _impl_.text_.Destroy(); } -void DataMessage_OpenGroupInvitation::SetCachedSize(int size) const { +void DataMessage_Quote::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataMessage_OpenGroupInvitation::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.OpenGroupInvitation) +void DataMessage_Quote::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.Quote) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + _impl_.attachments_.Clear(); cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _impl_.url_.ClearNonDefaultToEmpty(); + _impl_.author_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.name_.ClearNonDefaultToEmpty(); + _impl_.text_.ClearNonDefaultToEmpty(); } } + _impl_.id_ = uint64_t{0u}; _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* DataMessage_OpenGroupInvitation::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* DataMessage_Quote::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required string url = 1; + // required uint64 id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_url(); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _Internal::set_has_id(&has_bits); + _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // required string author = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_author(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // required string name = 3; + // optional string text = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_name(); + auto str = _internal_mutable_text(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; + // repeated .SessionProtos.DataMessage.Quote.QuotedAttachment attachments = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_attachments(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); + } else + goto handle_unusual; + continue; default: goto handle_unusual; } // switch @@ -5772,67 +5805,77 @@ const char* DataMessage_OpenGroupInvitation::_InternalParse(const char* ptr, ::_ #undef CHK_ } -uint8_t* DataMessage_OpenGroupInvitation::_InternalSerialize( +uint8_t* DataMessage_Quote::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.OpenGroupInvitation) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.Quote) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required string url = 1; + // required uint64 id = 1; + if (cached_has_bits & 0x00000004u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_id(), target); + } + + // required string author = 2; if (cached_has_bits & 0x00000001u) { target = stream->WriteStringMaybeAliased( - 1, this->_internal_url(), target); + 2, this->_internal_author(), target); } - // required string name = 3; + // optional string text = 3; if (cached_has_bits & 0x00000002u) { target = stream->WriteStringMaybeAliased( - 3, this->_internal_name(), target); + 3, this->_internal_text(), target); + } + + // repeated .SessionProtos.DataMessage.Quote.QuotedAttachment attachments = 4; + for (unsigned i = 0, + n = static_cast(this->_internal_attachments_size()); i < n; i++) { + const auto& repfield = this->_internal_attachments(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(4, repfield, repfield.GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.OpenGroupInvitation) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Quote) return target; } -size_t DataMessage_OpenGroupInvitation::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.DataMessage.OpenGroupInvitation) +size_t DataMessage_Quote::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.DataMessage.Quote) size_t total_size = 0; - if (_internal_has_url()) { - // required string url = 1; + if (_internal_has_author()) { + // required string author = 2; total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_url()); + this->_internal_author()); } - if (_internal_has_name()) { - // required string name = 3; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); + if (_internal_has_id()) { + // required uint64 id = 1; + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id()); } return total_size; } -size_t DataMessage_OpenGroupInvitation::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.OpenGroupInvitation) +size_t DataMessage_Quote::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.Quote) size_t total_size = 0; - if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. - // required string url = 1; + if (((_impl_._has_bits_[0] & 0x00000005) ^ 0x00000005) == 0) { // All required fields are present. + // required string author = 2; total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_url()); + this->_internal_author()); - // required string name = 3; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); + // required uint64 id = 1; + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id()); } else { total_size += RequiredFieldsByteSizeFallback(); @@ -5841,6 +5884,21 @@ size_t DataMessage_OpenGroupInvitation::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + // repeated .SessionProtos.DataMessage.Quote.QuotedAttachment attachments = 4; + total_size += 1UL * this->_internal_attachments_size(); + for (const auto& msg : this->_impl_.attachments_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // optional string text = 3; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_text()); + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } @@ -5849,137 +5907,159 @@ size_t DataMessage_OpenGroupInvitation::ByteSizeLong() const { return total_size; } -void DataMessage_OpenGroupInvitation::CheckTypeAndMergeFrom( +void DataMessage_Quote::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void DataMessage_OpenGroupInvitation::MergeFrom(const DataMessage_OpenGroupInvitation& from) { - DataMessage_OpenGroupInvitation* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.OpenGroupInvitation) +void DataMessage_Quote::MergeFrom(const DataMessage_Quote& from) { + DataMessage_Quote* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Quote) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; + _this->_impl_.attachments_.MergeFrom(from._impl_.attachments_); cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_url(from._internal_url()); + _this->_internal_set_author(from._internal_author()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_name(from._internal_name()); + _this->_internal_set_text(from._internal_text()); + } + if (cached_has_bits & 0x00000004u) { + _this->_impl_.id_ = from._impl_.id_; } + _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void DataMessage_OpenGroupInvitation::CopyFrom(const DataMessage_OpenGroupInvitation& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.OpenGroupInvitation) +void DataMessage_Quote::CopyFrom(const DataMessage_Quote& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.Quote) if (&from == this) return; Clear(); MergeFrom(from); } -bool DataMessage_OpenGroupInvitation::IsInitialized() const { +bool DataMessage_Quote::IsInitialized() const { if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; + if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.attachments_)) + return false; return true; } -void DataMessage_OpenGroupInvitation::InternalSwap(DataMessage_OpenGroupInvitation* other) { +void DataMessage_Quote::InternalSwap(DataMessage_Quote* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.attachments_.InternalSwap(&other->_impl_.attachments_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.url_, lhs_arena, - &other->_impl_.url_, rhs_arena + &_impl_.author_, lhs_arena, + &other->_impl_.author_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.name_, lhs_arena, - &other->_impl_.name_, rhs_arena + &_impl_.text_, lhs_arena, + &other->_impl_.text_, rhs_arena ); + swap(_impl_.id_, other->_impl_.id_); } -std::string DataMessage_OpenGroupInvitation::GetTypeName() const { - return "SessionProtos.DataMessage.OpenGroupInvitation"; +std::string DataMessage_Quote::GetTypeName() const { + return "SessionProtos.DataMessage.Quote"; } // =================================================================== -class DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_Internal { +class DataMessage_Preview::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_publickey(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_url(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_encryptedkeypair(HasBits* has_bits) { + static void set_has_title(HasBits* has_bits) { (*has_bits)[0] |= 2u; } + static const ::SessionProtos::AttachmentPointer& image(const DataMessage_Preview* msg); + static void set_has_image(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; + return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0; } }; -DataMessage_ClosedGroupControlMessage_KeyPairWrapper::DataMessage_ClosedGroupControlMessage_KeyPairWrapper(::PROTOBUF_NAMESPACE_ID::Arena* arena, +const ::SessionProtos::AttachmentPointer& +DataMessage_Preview::_Internal::image(const DataMessage_Preview* msg) { + return *msg->_impl_.image_; +} +DataMessage_Preview::DataMessage_Preview(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) + // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Preview) } -DataMessage_ClosedGroupControlMessage_KeyPairWrapper::DataMessage_ClosedGroupControlMessage_KeyPairWrapper(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from) +DataMessage_Preview::DataMessage_Preview(const DataMessage_Preview& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataMessage_ClosedGroupControlMessage_KeyPairWrapper* const _this = this; (void)_this; + DataMessage_Preview* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.publickey_){} - , decltype(_impl_.encryptedkeypair_){}}; + , decltype(_impl_.url_){} + , decltype(_impl_.title_){} + , decltype(_impl_.image_){nullptr}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.publickey_.InitDefault(); + _impl_.url_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.Set("", GetArenaForAllocation()); + _impl_.url_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_publickey()) { - _this->_impl_.publickey_.Set(from._internal_publickey(), + if (from._internal_has_url()) { + _this->_impl_.url_.Set(from._internal_url(), _this->GetArenaForAllocation()); } - _impl_.encryptedkeypair_.InitDefault(); + _impl_.title_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.encryptedkeypair_.Set("", GetArenaForAllocation()); + _impl_.title_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_encryptedkeypair()) { - _this->_impl_.encryptedkeypair_.Set(from._internal_encryptedkeypair(), + if (from._internal_has_title()) { + _this->_impl_.title_.Set(from._internal_title(), _this->GetArenaForAllocation()); } - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) + if (from._internal_has_image()) { + _this->_impl_.image_ = new ::SessionProtos::AttachmentPointer(*from._impl_.image_); + } + // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.Preview) } -inline void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::SharedCtor( +inline void DataMessage_Preview::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.publickey_){} - , decltype(_impl_.encryptedkeypair_){} + , decltype(_impl_.url_){} + , decltype(_impl_.title_){} + , decltype(_impl_.image_){nullptr} }; - _impl_.publickey_.InitDefault(); + _impl_.url_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.Set("", GetArenaForAllocation()); + _impl_.url_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.encryptedkeypair_.InitDefault(); + _impl_.title_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.encryptedkeypair_.Set("", GetArenaForAllocation()); + _impl_.title_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -DataMessage_ClosedGroupControlMessage_KeyPairWrapper::~DataMessage_ClosedGroupControlMessage_KeyPairWrapper() { - // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) +DataMessage_Preview::~DataMessage_Preview() { + // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Preview) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -5987,60 +6067,73 @@ DataMessage_ClosedGroupControlMessage_KeyPairWrapper::~DataMessage_ClosedGroupCo SharedDtor(); } -inline void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::SharedDtor() { +inline void DataMessage_Preview::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.publickey_.Destroy(); - _impl_.encryptedkeypair_.Destroy(); + _impl_.url_.Destroy(); + _impl_.title_.Destroy(); + if (this != internal_default_instance()) delete _impl_.image_; } -void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::SetCachedSize(int size) const { +void DataMessage_Preview::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) +void DataMessage_Preview::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.Preview) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x00000001u) { - _impl_.publickey_.ClearNonDefaultToEmpty(); + _impl_.url_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.encryptedkeypair_.ClearNonDefaultToEmpty(); + _impl_.title_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000004u) { + GOOGLE_DCHECK(_impl_.image_ != nullptr); + _impl_.image_->Clear(); } } _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* DataMessage_Preview::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required bytes publicKey = 1; + // required string url = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_publickey(); + auto str = _internal_mutable_url(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // required bytes encryptedKeyPair = 2; + // optional string title = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_encryptedkeypair(); + auto str = _internal_mutable_title(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; + // optional .SessionProtos.AttachmentPointer image = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr = ctx->ParseMessage(_internal_mutable_image(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; default: goto handle_unusual; } // switch @@ -6065,75 +6158,71 @@ const char* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_InternalParse #undef CHK_ } -uint8_t* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_InternalSerialize( +uint8_t* DataMessage_Preview::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.Preview) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required bytes publicKey = 1; + // required string url = 1; if (cached_has_bits & 0x00000001u) { - target = stream->WriteBytesMaybeAliased( - 1, this->_internal_publickey(), target); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_url(), target); } - // required bytes encryptedKeyPair = 2; + // optional string title = 2; if (cached_has_bits & 0x00000002u) { - target = stream->WriteBytesMaybeAliased( - 2, this->_internal_encryptedkeypair(), target); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_title(), target); + } + + // optional .SessionProtos.AttachmentPointer image = 3; + if (cached_has_bits & 0x00000004u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::image(this), + _Internal::image(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Preview) return target; } -size_t DataMessage_ClosedGroupControlMessage_KeyPairWrapper::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) - size_t total_size = 0; - - if (_internal_has_publickey()) { - // required bytes publicKey = 1; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_publickey()); - } - - if (_internal_has_encryptedkeypair()) { - // required bytes encryptedKeyPair = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_encryptedkeypair()); - } - - return total_size; -} -size_t DataMessage_ClosedGroupControlMessage_KeyPairWrapper::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) +size_t DataMessage_Preview::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.Preview) size_t total_size = 0; - if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. - // required bytes publicKey = 1; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_publickey()); - - // required bytes encryptedKeyPair = 2; + // required string url = 1; + if (_internal_has_url()) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_encryptedkeypair()); - - } else { - total_size += RequiredFieldsByteSizeFallback(); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_url()); } uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000006u) { + // optional string title = 2; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_title()); + } + + // optional .SessionProtos.AttachmentPointer image = 3; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.image_); + } + + } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } @@ -6142,169 +6231,158 @@ size_t DataMessage_ClosedGroupControlMessage_KeyPairWrapper::ByteSizeLong() cons return total_size; } -void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::CheckTypeAndMergeFrom( +void DataMessage_Preview::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::MergeFrom(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from) { - DataMessage_ClosedGroupControlMessage_KeyPairWrapper* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) +void DataMessage_Preview::MergeFrom(const DataMessage_Preview& from) { + DataMessage_Preview* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Preview) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_publickey(from._internal_publickey()); + _this->_internal_set_url(from._internal_url()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_encryptedkeypair(from._internal_encryptedkeypair()); + _this->_internal_set_title(from._internal_title()); + } + if (cached_has_bits & 0x00000004u) { + _this->_internal_mutable_image()->::SessionProtos::AttachmentPointer::MergeFrom( + from._internal_image()); } } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::CopyFrom(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) +void DataMessage_Preview::CopyFrom(const DataMessage_Preview& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.Preview) if (&from == this) return; Clear(); MergeFrom(from); } -bool DataMessage_ClosedGroupControlMessage_KeyPairWrapper::IsInitialized() const { +bool DataMessage_Preview::IsInitialized() const { if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; + if (_internal_has_image()) { + if (!_impl_.image_->IsInitialized()) return false; + } return true; } -void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::InternalSwap(DataMessage_ClosedGroupControlMessage_KeyPairWrapper* other) { +void DataMessage_Preview::InternalSwap(DataMessage_Preview* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.publickey_, lhs_arena, - &other->_impl_.publickey_, rhs_arena + &_impl_.url_, lhs_arena, + &other->_impl_.url_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.encryptedkeypair_, lhs_arena, - &other->_impl_.encryptedkeypair_, rhs_arena + &_impl_.title_, lhs_arena, + &other->_impl_.title_, rhs_arena ); + swap(_impl_.image_, other->_impl_.image_); } -std::string DataMessage_ClosedGroupControlMessage_KeyPairWrapper::GetTypeName() const { - return "SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper"; +std::string DataMessage_Preview::GetTypeName() const { + return "SessionProtos.DataMessage.Preview"; } // =================================================================== -class DataMessage_ClosedGroupControlMessage::_Internal { +class DataMessage_Reaction::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_type(HasBits* has_bits) { - (*has_bits)[0] |= 16u; + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_id(HasBits* has_bits) { + (*has_bits)[0] |= 4u; } - static void set_has_publickey(HasBits* has_bits) { + static void set_has_author(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_name(HasBits* has_bits) { + static void set_has_emoji(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static const ::SessionProtos::KeyPair& encryptionkeypair(const DataMessage_ClosedGroupControlMessage* msg); - static void set_has_encryptionkeypair(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } - static void set_has_expirationtimer(HasBits* has_bits) { + static void set_has_action(HasBits* has_bits) { (*has_bits)[0] |= 8u; } static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000010) ^ 0x00000010) != 0; + return ((has_bits[0] & 0x0000000d) ^ 0x0000000d) != 0; } }; -const ::SessionProtos::KeyPair& -DataMessage_ClosedGroupControlMessage::_Internal::encryptionkeypair(const DataMessage_ClosedGroupControlMessage* msg) { - return *msg->_impl_.encryptionkeypair_; -} -DataMessage_ClosedGroupControlMessage::DataMessage_ClosedGroupControlMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, +DataMessage_Reaction::DataMessage_Reaction(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.ClosedGroupControlMessage) + // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Reaction) } -DataMessage_ClosedGroupControlMessage::DataMessage_ClosedGroupControlMessage(const DataMessage_ClosedGroupControlMessage& from) +DataMessage_Reaction::DataMessage_Reaction(const DataMessage_Reaction& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataMessage_ClosedGroupControlMessage* const _this = this; (void)_this; + DataMessage_Reaction* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.members_){from._impl_.members_} - , decltype(_impl_.admins_){from._impl_.admins_} - , decltype(_impl_.wrappers_){from._impl_.wrappers_} - , decltype(_impl_.publickey_){} - , decltype(_impl_.name_){} - , decltype(_impl_.encryptionkeypair_){nullptr} - , decltype(_impl_.expirationtimer_){} - , decltype(_impl_.type_){}}; + , decltype(_impl_.author_){} + , decltype(_impl_.emoji_){} + , decltype(_impl_.id_){} + , decltype(_impl_.action_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.publickey_.InitDefault(); + _impl_.author_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.Set("", GetArenaForAllocation()); + _impl_.author_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_publickey()) { - _this->_impl_.publickey_.Set(from._internal_publickey(), + if (from._internal_has_author()) { + _this->_impl_.author_.Set(from._internal_author(), _this->GetArenaForAllocation()); } - _impl_.name_.InitDefault(); + _impl_.emoji_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); + _impl_.emoji_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_name()) { - _this->_impl_.name_.Set(from._internal_name(), + if (from._internal_has_emoji()) { + _this->_impl_.emoji_.Set(from._internal_emoji(), _this->GetArenaForAllocation()); } - if (from._internal_has_encryptionkeypair()) { - _this->_impl_.encryptionkeypair_ = new ::SessionProtos::KeyPair(*from._impl_.encryptionkeypair_); - } - ::memcpy(&_impl_.expirationtimer_, &from._impl_.expirationtimer_, - static_cast(reinterpret_cast(&_impl_.type_) - - reinterpret_cast(&_impl_.expirationtimer_)) + sizeof(_impl_.type_)); - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.ClosedGroupControlMessage) + ::memcpy(&_impl_.id_, &from._impl_.id_, + static_cast(reinterpret_cast(&_impl_.action_) - + reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.action_)); + // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.Reaction) } -inline void DataMessage_ClosedGroupControlMessage::SharedCtor( +inline void DataMessage_Reaction::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.members_){arena} - , decltype(_impl_.admins_){arena} - , decltype(_impl_.wrappers_){arena} - , decltype(_impl_.publickey_){} - , decltype(_impl_.name_){} - , decltype(_impl_.encryptionkeypair_){nullptr} - , decltype(_impl_.expirationtimer_){0u} - , decltype(_impl_.type_){1} + , decltype(_impl_.author_){} + , decltype(_impl_.emoji_){} + , decltype(_impl_.id_){uint64_t{0u}} + , decltype(_impl_.action_){0} }; - _impl_.publickey_.InitDefault(); + _impl_.author_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.Set("", GetArenaForAllocation()); + _impl_.author_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.InitDefault(); + _impl_.emoji_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); + _impl_.emoji_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -DataMessage_ClosedGroupControlMessage::~DataMessage_ClosedGroupControlMessage() { - // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.ClosedGroupControlMessage) +DataMessage_Reaction::~DataMessage_Reaction() { + // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Reaction) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -6312,143 +6390,84 @@ DataMessage_ClosedGroupControlMessage::~DataMessage_ClosedGroupControlMessage() SharedDtor(); } -inline void DataMessage_ClosedGroupControlMessage::SharedDtor() { +inline void DataMessage_Reaction::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.members_.~RepeatedPtrField(); - _impl_.admins_.~RepeatedPtrField(); - _impl_.wrappers_.~RepeatedPtrField(); - _impl_.publickey_.Destroy(); - _impl_.name_.Destroy(); - if (this != internal_default_instance()) delete _impl_.encryptionkeypair_; + _impl_.author_.Destroy(); + _impl_.emoji_.Destroy(); } -void DataMessage_ClosedGroupControlMessage::SetCachedSize(int size) const { +void DataMessage_Reaction::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataMessage_ClosedGroupControlMessage::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.ClosedGroupControlMessage) +void DataMessage_Reaction::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.Reaction) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.members_.Clear(); - _impl_.admins_.Clear(); - _impl_.wrappers_.Clear(); cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _impl_.publickey_.ClearNonDefaultToEmpty(); + _impl_.author_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.name_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000004u) { - GOOGLE_DCHECK(_impl_.encryptionkeypair_ != nullptr); - _impl_.encryptionkeypair_->Clear(); + _impl_.emoji_.ClearNonDefaultToEmpty(); } } - if (cached_has_bits & 0x00000018u) { - _impl_.expirationtimer_ = 0u; - _impl_.type_ = 1; + if (cached_has_bits & 0x0000000cu) { + ::memset(&_impl_.id_, 0, static_cast( + reinterpret_cast(&_impl_.action_) - + reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.action_)); } _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* DataMessage_ClosedGroupControlMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* DataMessage_Reaction::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required .SessionProtos.DataMessage.ClosedGroupControlMessage.Type type = 1; + // required uint64 id = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + _Internal::set_has_id(&has_bits); + _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - if (PROTOBUF_PREDICT_TRUE(::SessionProtos::DataMessage_ClosedGroupControlMessage_Type_IsValid(val))) { - _internal_set_type(static_cast<::SessionProtos::DataMessage_ClosedGroupControlMessage_Type>(val)); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields()); - } } else goto handle_unusual; continue; - // optional bytes publicKey = 2; + // required string author = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_publickey(); + auto str = _internal_mutable_author(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional string name = 3; + // optional string emoji = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_name(); + auto str = _internal_mutable_emoji(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional .SessionProtos.KeyPair encryptionKeyPair = 4; + // required .SessionProtos.DataMessage.Reaction.Action action = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { - ptr = ctx->ParseMessage(_internal_mutable_encryptionkeypair(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // repeated bytes members = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { - ptr -= 1; - do { - ptr += 1; - auto str = _internal_add_members(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr)); - } else - goto handle_unusual; - continue; - // repeated bytes admins = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { - ptr -= 1; - do { - ptr += 1; - auto str = _internal_add_admins(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr)); - } else - goto handle_unusual; - continue; - // repeated .SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper wrappers = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_wrappers(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<58>(ptr)); - } else - goto handle_unusual; - continue; - // optional uint32 expirationTimer = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 64)) { - _Internal::set_has_expirationtimer(&has_bits); - _impl_.expirationtimer_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); + if (PROTOBUF_PREDICT_TRUE(::SessionProtos::DataMessage_Reaction_Action_IsValid(val))) { + _internal_set_action(static_cast<::SessionProtos::DataMessage_Reaction_Action>(val)); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields()); + } } else goto handle_unusual; continue; @@ -6476,138 +6495,102 @@ const char* DataMessage_ClosedGroupControlMessage::_InternalParse(const char* pt #undef CHK_ } -uint8_t* DataMessage_ClosedGroupControlMessage::_InternalSerialize( +uint8_t* DataMessage_Reaction::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.ClosedGroupControlMessage) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.Reaction) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required .SessionProtos.DataMessage.ClosedGroupControlMessage.Type type = 1; - if (cached_has_bits & 0x00000010u) { + // required uint64 id = 1; + if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 1, this->_internal_type(), target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_id(), target); } - // optional bytes publicKey = 2; + // required string author = 2; if (cached_has_bits & 0x00000001u) { - target = stream->WriteBytesMaybeAliased( - 2, this->_internal_publickey(), target); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_author(), target); } - // optional string name = 3; + // optional string emoji = 3; if (cached_has_bits & 0x00000002u) { target = stream->WriteStringMaybeAliased( - 3, this->_internal_name(), target); - } - - // optional .SessionProtos.KeyPair encryptionKeyPair = 4; - if (cached_has_bits & 0x00000004u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::encryptionkeypair(this), - _Internal::encryptionkeypair(this).GetCachedSize(), target, stream); - } - - // repeated bytes members = 5; - for (int i = 0, n = this->_internal_members_size(); i < n; i++) { - const auto& s = this->_internal_members(i); - target = stream->WriteBytes(5, s, target); - } - - // repeated bytes admins = 6; - for (int i = 0, n = this->_internal_admins_size(); i < n; i++) { - const auto& s = this->_internal_admins(i); - target = stream->WriteBytes(6, s, target); - } - - // repeated .SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper wrappers = 7; - for (unsigned i = 0, - n = static_cast(this->_internal_wrappers_size()); i < n; i++) { - const auto& repfield = this->_internal_wrappers(i); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(7, repfield, repfield.GetCachedSize(), target, stream); + 3, this->_internal_emoji(), target); } - // optional uint32 expirationTimer = 8; + // required .SessionProtos.DataMessage.Reaction.Action action = 4; if (cached_has_bits & 0x00000008u) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(8, this->_internal_expirationtimer(), target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 4, this->_internal_action(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.ClosedGroupControlMessage) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Reaction) return target; } -size_t DataMessage_ClosedGroupControlMessage::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.ClosedGroupControlMessage) +size_t DataMessage_Reaction::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.DataMessage.Reaction) size_t total_size = 0; - // required .SessionProtos.DataMessage.ClosedGroupControlMessage.Type type = 1; - if (_internal_has_type()) { + if (_internal_has_author()) { + // required string author = 2; total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_author()); } - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - // repeated bytes members = 5; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.members_.size()); - for (int i = 0, n = _impl_.members_.size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - _impl_.members_.Get(i)); + if (_internal_has_id()) { + // required uint64 id = 1; + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id()); } - // repeated bytes admins = 6; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.admins_.size()); - for (int i = 0, n = _impl_.admins_.size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - _impl_.admins_.Get(i)); + if (_internal_has_action()) { + // required .SessionProtos.DataMessage.Reaction.Action action = 4; + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_action()); } - // repeated .SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper wrappers = 7; - total_size += 1UL * this->_internal_wrappers_size(); - for (const auto& msg : this->_impl_.wrappers_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } + return total_size; +} +size_t DataMessage_Reaction::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.Reaction) + size_t total_size = 0; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { - // optional bytes publicKey = 2; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_publickey()); - } + if (((_impl_._has_bits_[0] & 0x0000000d) ^ 0x0000000d) == 0) { // All required fields are present. + // required string author = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_author()); - // optional string name = 3; - if (cached_has_bits & 0x00000002u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); - } + // required uint64 id = 1; + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id()); - // optional .SessionProtos.KeyPair encryptionKeyPair = 4; - if (cached_has_bits & 0x00000004u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.encryptionkeypair_); - } + // required .SessionProtos.DataMessage.Reaction.Action action = 4; + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_action()); - // optional uint32 expirationTimer = 8; - if (cached_has_bits & 0x00000008u) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_expirationtimer()); - } + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + // optional string emoji = 3; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_emoji()); } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } @@ -6616,272 +6599,150 @@ size_t DataMessage_ClosedGroupControlMessage::ByteSizeLong() const { return total_size; } -void DataMessage_ClosedGroupControlMessage::CheckTypeAndMergeFrom( +void DataMessage_Reaction::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void DataMessage_ClosedGroupControlMessage::MergeFrom(const DataMessage_ClosedGroupControlMessage& from) { - DataMessage_ClosedGroupControlMessage* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.ClosedGroupControlMessage) +void DataMessage_Reaction::MergeFrom(const DataMessage_Reaction& from) { + DataMessage_Reaction* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Reaction) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.members_.MergeFrom(from._impl_.members_); - _this->_impl_.admins_.MergeFrom(from._impl_.admins_); - _this->_impl_.wrappers_.MergeFrom(from._impl_.wrappers_); cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x0000001fu) { + if (cached_has_bits & 0x0000000fu) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_publickey(from._internal_publickey()); + _this->_internal_set_author(from._internal_author()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_name(from._internal_name()); + _this->_internal_set_emoji(from._internal_emoji()); } if (cached_has_bits & 0x00000004u) { - _this->_internal_mutable_encryptionkeypair()->::SessionProtos::KeyPair::MergeFrom( - from._internal_encryptionkeypair()); + _this->_impl_.id_ = from._impl_.id_; } if (cached_has_bits & 0x00000008u) { - _this->_impl_.expirationtimer_ = from._impl_.expirationtimer_; - } - if (cached_has_bits & 0x00000010u) { - _this->_impl_.type_ = from._impl_.type_; + _this->_impl_.action_ = from._impl_.action_; } _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void DataMessage_ClosedGroupControlMessage::CopyFrom(const DataMessage_ClosedGroupControlMessage& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.ClosedGroupControlMessage) +void DataMessage_Reaction::CopyFrom(const DataMessage_Reaction& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.Reaction) if (&from == this) return; Clear(); MergeFrom(from); } -bool DataMessage_ClosedGroupControlMessage::IsInitialized() const { +bool DataMessage_Reaction::IsInitialized() const { if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; - if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.wrappers_)) - return false; - if (_internal_has_encryptionkeypair()) { - if (!_impl_.encryptionkeypair_->IsInitialized()) return false; - } return true; } -void DataMessage_ClosedGroupControlMessage::InternalSwap(DataMessage_ClosedGroupControlMessage* other) { +void DataMessage_Reaction::InternalSwap(DataMessage_Reaction* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.members_.InternalSwap(&other->_impl_.members_); - _impl_.admins_.InternalSwap(&other->_impl_.admins_); - _impl_.wrappers_.InternalSwap(&other->_impl_.wrappers_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.publickey_, lhs_arena, - &other->_impl_.publickey_, rhs_arena + &_impl_.author_, lhs_arena, + &other->_impl_.author_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.name_, lhs_arena, - &other->_impl_.name_, rhs_arena + &_impl_.emoji_, lhs_arena, + &other->_impl_.emoji_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(DataMessage_ClosedGroupControlMessage, _impl_.expirationtimer_) - + sizeof(DataMessage_ClosedGroupControlMessage::_impl_.expirationtimer_) - - PROTOBUF_FIELD_OFFSET(DataMessage_ClosedGroupControlMessage, _impl_.encryptionkeypair_)>( - reinterpret_cast(&_impl_.encryptionkeypair_), - reinterpret_cast(&other->_impl_.encryptionkeypair_)); - swap(_impl_.type_, other->_impl_.type_); + PROTOBUF_FIELD_OFFSET(DataMessage_Reaction, _impl_.action_) + + sizeof(DataMessage_Reaction::_impl_.action_) + - PROTOBUF_FIELD_OFFSET(DataMessage_Reaction, _impl_.id_)>( + reinterpret_cast(&_impl_.id_), + reinterpret_cast(&other->_impl_.id_)); } -std::string DataMessage_ClosedGroupControlMessage::GetTypeName() const { - return "SessionProtos.DataMessage.ClosedGroupControlMessage"; +std::string DataMessage_Reaction::GetTypeName() const { + return "SessionProtos.DataMessage.Reaction"; } // =================================================================== -class DataMessage::_Internal { +class DataMessage_OpenGroupInvitation::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_body(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_url(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_flags(HasBits* has_bits) { - (*has_bits)[0] |= 256u; - } - static void set_has_expiretimer(HasBits* has_bits) { - (*has_bits)[0] |= 512u; - } - static void set_has_profilekey(HasBits* has_bits) { + static void set_has_name(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static void set_has_timestamp(HasBits* has_bits) { - (*has_bits)[0] |= 1024u; - } - static const ::SessionProtos::DataMessage_Quote& quote(const DataMessage* msg); - static void set_has_quote(HasBits* has_bits) { - (*has_bits)[0] |= 8u; - } - static const ::SessionProtos::DataMessage_Reaction& reaction(const DataMessage* msg); - static void set_has_reaction(HasBits* has_bits) { - (*has_bits)[0] |= 16u; - } - static const ::SessionProtos::LokiProfile& profile(const DataMessage* msg); - static void set_has_profile(HasBits* has_bits) { - (*has_bits)[0] |= 32u; - } - static const ::SessionProtos::DataMessage_OpenGroupInvitation& opengroupinvitation(const DataMessage* msg); - static void set_has_opengroupinvitation(HasBits* has_bits) { - (*has_bits)[0] |= 64u; - } - static const ::SessionProtos::DataMessage_ClosedGroupControlMessage& closedgroupcontrolmessage(const DataMessage* msg); - static void set_has_closedgroupcontrolmessage(HasBits* has_bits) { - (*has_bits)[0] |= 128u; - } - static void set_has_synctarget(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } - static void set_has_blockscommunitymessagerequests(HasBits* has_bits) { - (*has_bits)[0] |= 2048u; + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; } }; -const ::SessionProtos::DataMessage_Quote& -DataMessage::_Internal::quote(const DataMessage* msg) { - return *msg->_impl_.quote_; -} -const ::SessionProtos::DataMessage_Reaction& -DataMessage::_Internal::reaction(const DataMessage* msg) { - return *msg->_impl_.reaction_; -} -const ::SessionProtos::LokiProfile& -DataMessage::_Internal::profile(const DataMessage* msg) { - return *msg->_impl_.profile_; -} -const ::SessionProtos::DataMessage_OpenGroupInvitation& -DataMessage::_Internal::opengroupinvitation(const DataMessage* msg) { - return *msg->_impl_.opengroupinvitation_; -} -const ::SessionProtos::DataMessage_ClosedGroupControlMessage& -DataMessage::_Internal::closedgroupcontrolmessage(const DataMessage* msg) { - return *msg->_impl_.closedgroupcontrolmessage_; -} -DataMessage::DataMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, +DataMessage_OpenGroupInvitation::DataMessage_OpenGroupInvitation(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage) + // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.OpenGroupInvitation) } -DataMessage::DataMessage(const DataMessage& from) +DataMessage_OpenGroupInvitation::DataMessage_OpenGroupInvitation(const DataMessage_OpenGroupInvitation& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataMessage* const _this = this; (void)_this; + DataMessage_OpenGroupInvitation* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.attachments_){from._impl_.attachments_} - , decltype(_impl_.preview_){from._impl_.preview_} - , decltype(_impl_.body_){} - , decltype(_impl_.profilekey_){} - , decltype(_impl_.synctarget_){} - , decltype(_impl_.quote_){nullptr} - , decltype(_impl_.reaction_){nullptr} - , decltype(_impl_.profile_){nullptr} - , decltype(_impl_.opengroupinvitation_){nullptr} - , decltype(_impl_.closedgroupcontrolmessage_){nullptr} - , decltype(_impl_.flags_){} - , decltype(_impl_.expiretimer_){} - , decltype(_impl_.timestamp_){} - , decltype(_impl_.blockscommunitymessagerequests_){}}; + , decltype(_impl_.url_){} + , decltype(_impl_.name_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.body_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.body_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_body()) { - _this->_impl_.body_.Set(from._internal_body(), - _this->GetArenaForAllocation()); - } - _impl_.profilekey_.InitDefault(); + _impl_.url_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilekey_.Set("", GetArenaForAllocation()); + _impl_.url_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_profilekey()) { - _this->_impl_.profilekey_.Set(from._internal_profilekey(), + if (from._internal_has_url()) { + _this->_impl_.url_.Set(from._internal_url(), _this->GetArenaForAllocation()); } - _impl_.synctarget_.InitDefault(); + _impl_.name_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.synctarget_.Set("", GetArenaForAllocation()); + _impl_.name_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_synctarget()) { - _this->_impl_.synctarget_.Set(from._internal_synctarget(), + if (from._internal_has_name()) { + _this->_impl_.name_.Set(from._internal_name(), _this->GetArenaForAllocation()); } - if (from._internal_has_quote()) { - _this->_impl_.quote_ = new ::SessionProtos::DataMessage_Quote(*from._impl_.quote_); - } - if (from._internal_has_reaction()) { - _this->_impl_.reaction_ = new ::SessionProtos::DataMessage_Reaction(*from._impl_.reaction_); - } - if (from._internal_has_profile()) { - _this->_impl_.profile_ = new ::SessionProtos::LokiProfile(*from._impl_.profile_); - } - if (from._internal_has_opengroupinvitation()) { - _this->_impl_.opengroupinvitation_ = new ::SessionProtos::DataMessage_OpenGroupInvitation(*from._impl_.opengroupinvitation_); - } - if (from._internal_has_closedgroupcontrolmessage()) { - _this->_impl_.closedgroupcontrolmessage_ = new ::SessionProtos::DataMessage_ClosedGroupControlMessage(*from._impl_.closedgroupcontrolmessage_); - } - ::memcpy(&_impl_.flags_, &from._impl_.flags_, - static_cast(reinterpret_cast(&_impl_.blockscommunitymessagerequests_) - - reinterpret_cast(&_impl_.flags_)) + sizeof(_impl_.blockscommunitymessagerequests_)); - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage) + // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.OpenGroupInvitation) } -inline void DataMessage::SharedCtor( +inline void DataMessage_OpenGroupInvitation::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.attachments_){arena} - , decltype(_impl_.preview_){arena} - , decltype(_impl_.body_){} - , decltype(_impl_.profilekey_){} - , decltype(_impl_.synctarget_){} - , decltype(_impl_.quote_){nullptr} - , decltype(_impl_.reaction_){nullptr} - , decltype(_impl_.profile_){nullptr} - , decltype(_impl_.opengroupinvitation_){nullptr} - , decltype(_impl_.closedgroupcontrolmessage_){nullptr} - , decltype(_impl_.flags_){0u} - , decltype(_impl_.expiretimer_){0u} - , decltype(_impl_.timestamp_){uint64_t{0u}} - , decltype(_impl_.blockscommunitymessagerequests_){false} + , decltype(_impl_.url_){} + , decltype(_impl_.name_){} }; - _impl_.body_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.body_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilekey_.InitDefault(); + _impl_.url_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilekey_.Set("", GetArenaForAllocation()); + _impl_.url_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.synctarget_.InitDefault(); + _impl_.name_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.synctarget_.Set("", GetArenaForAllocation()); + _impl_.name_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -DataMessage::~DataMessage() { - // @@protoc_insertion_point(destructor:SessionProtos.DataMessage) +DataMessage_OpenGroupInvitation::~DataMessage_OpenGroupInvitation() { + // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.OpenGroupInvitation) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -6889,209 +6750,60 @@ DataMessage::~DataMessage() { SharedDtor(); } -inline void DataMessage::SharedDtor() { +inline void DataMessage_OpenGroupInvitation::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.attachments_.~RepeatedPtrField(); - _impl_.preview_.~RepeatedPtrField(); - _impl_.body_.Destroy(); - _impl_.profilekey_.Destroy(); - _impl_.synctarget_.Destroy(); - if (this != internal_default_instance()) delete _impl_.quote_; - if (this != internal_default_instance()) delete _impl_.reaction_; - if (this != internal_default_instance()) delete _impl_.profile_; - if (this != internal_default_instance()) delete _impl_.opengroupinvitation_; - if (this != internal_default_instance()) delete _impl_.closedgroupcontrolmessage_; + _impl_.url_.Destroy(); + _impl_.name_.Destroy(); } -void DataMessage::SetCachedSize(int size) const { +void DataMessage_OpenGroupInvitation::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataMessage::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage) +void DataMessage_OpenGroupInvitation::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.OpenGroupInvitation) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.attachments_.Clear(); - _impl_.preview_.Clear(); cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x000000ffu) { + if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _impl_.body_.ClearNonDefaultToEmpty(); + _impl_.url_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.profilekey_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000004u) { - _impl_.synctarget_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000008u) { - GOOGLE_DCHECK(_impl_.quote_ != nullptr); - _impl_.quote_->Clear(); - } - if (cached_has_bits & 0x00000010u) { - GOOGLE_DCHECK(_impl_.reaction_ != nullptr); - _impl_.reaction_->Clear(); + _impl_.name_.ClearNonDefaultToEmpty(); } - if (cached_has_bits & 0x00000020u) { - GOOGLE_DCHECK(_impl_.profile_ != nullptr); - _impl_.profile_->Clear(); - } - if (cached_has_bits & 0x00000040u) { - GOOGLE_DCHECK(_impl_.opengroupinvitation_ != nullptr); - _impl_.opengroupinvitation_->Clear(); - } - if (cached_has_bits & 0x00000080u) { - GOOGLE_DCHECK(_impl_.closedgroupcontrolmessage_ != nullptr); - _impl_.closedgroupcontrolmessage_->Clear(); - } - } - if (cached_has_bits & 0x00000f00u) { - ::memset(&_impl_.flags_, 0, static_cast( - reinterpret_cast(&_impl_.blockscommunitymessagerequests_) - - reinterpret_cast(&_impl_.flags_)) + sizeof(_impl_.blockscommunitymessagerequests_)); } _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* DataMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* DataMessage_OpenGroupInvitation::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // optional string body = 1; + // required string url = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_body(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // repeated .SessionProtos.AttachmentPointer attachments = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_attachments(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); - } else - goto handle_unusual; - continue; - // optional uint32 flags = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - _Internal::set_has_flags(&has_bits); - _impl_.flags_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional uint32 expireTimer = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { - _Internal::set_has_expiretimer(&has_bits); - _impl_.expiretimer_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional bytes profileKey = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { - auto str = _internal_mutable_profilekey(); + auto str = _internal_mutable_url(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional uint64 timestamp = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { - _Internal::set_has_timestamp(&has_bits); - _impl_.timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.DataMessage.Quote quote = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { - ptr = ctx->ParseMessage(_internal_mutable_quote(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // repeated .SessionProtos.DataMessage.Preview preview = 10; - case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 82)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_preview(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<82>(ptr)); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.DataMessage.Reaction reaction = 11; - case 11: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 90)) { - ptr = ctx->ParseMessage(_internal_mutable_reaction(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.LokiProfile profile = 101; - case 101: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { - ptr = ctx->ParseMessage(_internal_mutable_profile(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; - case 102: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { - ptr = ctx->ParseMessage(_internal_mutable_opengroupinvitation(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; - case 104: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { - ptr = ctx->ParseMessage(_internal_mutable_closedgroupcontrolmessage(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional string syncTarget = 105; - case 105: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { - auto str = _internal_mutable_synctarget(); + // required string name = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + auto str = _internal_mutable_name(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional bool blocksCommunityMessageRequests = 106; - case 106: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 80)) { - _Internal::set_has_blockscommunitymessagerequests(&has_bits); - _impl_.blockscommunitymessagerequests_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; default: goto handle_unusual; } // switch @@ -7116,217 +6828,368 @@ const char* DataMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* c #undef CHK_ } -uint8_t* DataMessage::_InternalSerialize( +uint8_t* DataMessage_OpenGroupInvitation::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.OpenGroupInvitation) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // optional string body = 1; + // required string url = 1; if (cached_has_bits & 0x00000001u) { target = stream->WriteStringMaybeAliased( - 1, this->_internal_body(), target); + 1, this->_internal_url(), target); } - // repeated .SessionProtos.AttachmentPointer attachments = 2; - for (unsigned i = 0, - n = static_cast(this->_internal_attachments_size()); i < n; i++) { - const auto& repfield = this->_internal_attachments(i); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); + // required string name = 3; + if (cached_has_bits & 0x00000002u) { + target = stream->WriteStringMaybeAliased( + 3, this->_internal_name(), target); } - // optional uint32 flags = 4; - if (cached_has_bits & 0x00000100u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_flags(), target); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.OpenGroupInvitation) + return target; +} - // optional uint32 expireTimer = 5; - if (cached_has_bits & 0x00000200u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_expiretimer(), target); - } +size_t DataMessage_OpenGroupInvitation::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.DataMessage.OpenGroupInvitation) + size_t total_size = 0; - // optional bytes profileKey = 6; - if (cached_has_bits & 0x00000002u) { - target = stream->WriteBytesMaybeAliased( - 6, this->_internal_profilekey(), target); + if (_internal_has_url()) { + // required string url = 1; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_url()); } - // optional uint64 timestamp = 7; - if (cached_has_bits & 0x00000400u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray(7, this->_internal_timestamp(), target); + if (_internal_has_name()) { + // required string name = 3; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); } - // optional .SessionProtos.DataMessage.Quote quote = 8; - if (cached_has_bits & 0x00000008u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(8, _Internal::quote(this), - _Internal::quote(this).GetCachedSize(), target, stream); - } + return total_size; +} +size_t DataMessage_OpenGroupInvitation::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.OpenGroupInvitation) + size_t total_size = 0; - // repeated .SessionProtos.DataMessage.Preview preview = 10; - for (unsigned i = 0, - n = static_cast(this->_internal_preview_size()); i < n; i++) { - const auto& repfield = this->_internal_preview(i); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(10, repfield, repfield.GetCachedSize(), target, stream); - } + if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. + // required string url = 1; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_url()); - // optional .SessionProtos.DataMessage.Reaction reaction = 11; - if (cached_has_bits & 0x00000010u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(11, _Internal::reaction(this), - _Internal::reaction(this).GetCachedSize(), target, stream); - } + // required string name = 3; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); - // optional .SessionProtos.LokiProfile profile = 101; - if (cached_has_bits & 0x00000020u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(101, _Internal::profile(this), - _Internal::profile(this).GetCachedSize(), target, stream); + } else { + total_size += RequiredFieldsByteSizeFallback(); } + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; - // optional .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; - if (cached_has_bits & 0x00000040u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(102, _Internal::opengroupinvitation(this), - _Internal::opengroupinvitation(this).GetCachedSize(), target, stream); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} - // optional .SessionProtos.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; - if (cached_has_bits & 0x00000080u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(104, _Internal::closedgroupcontrolmessage(this), - _Internal::closedgroupcontrolmessage(this).GetCachedSize(), target, stream); - } +void DataMessage_OpenGroupInvitation::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} - // optional string syncTarget = 105; - if (cached_has_bits & 0x00000004u) { - target = stream->WriteStringMaybeAliased( - 105, this->_internal_synctarget(), target); +void DataMessage_OpenGroupInvitation::MergeFrom(const DataMessage_OpenGroupInvitation& from) { + DataMessage_OpenGroupInvitation* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.OpenGroupInvitation) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_url(from._internal_url()); + } + if (cached_has_bits & 0x00000002u) { + _this->_internal_set_name(from._internal_name()); + } } + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); +} - // optional bool blocksCommunityMessageRequests = 106; - if (cached_has_bits & 0x00000800u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(106, this->_internal_blockscommunitymessagerequests(), target); +void DataMessage_OpenGroupInvitation::CopyFrom(const DataMessage_OpenGroupInvitation& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.OpenGroupInvitation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DataMessage_OpenGroupInvitation::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; + return true; +} + +void DataMessage_OpenGroupInvitation::InternalSwap(DataMessage_OpenGroupInvitation* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.url_, lhs_arena, + &other->_impl_.url_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena + ); +} + +std::string DataMessage_OpenGroupInvitation::GetTypeName() const { + return "SessionProtos.DataMessage.OpenGroupInvitation"; +} + + +// =================================================================== + +class DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_publickey(HasBits* has_bits) { + (*has_bits)[0] |= 1u; } + static void set_has_encryptedkeypair(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; + } +}; - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); +DataMessage_ClosedGroupControlMessage_KeyPairWrapper::DataMessage_ClosedGroupControlMessage_KeyPairWrapper(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) +} +DataMessage_ClosedGroupControlMessage_KeyPairWrapper::DataMessage_ClosedGroupControlMessage_KeyPairWrapper(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from) + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { + DataMessage_ClosedGroupControlMessage_KeyPairWrapper* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.publickey_){} + , decltype(_impl_.encryptedkeypair_){}}; + + _internal_metadata_.MergeFrom(from._internal_metadata_); + _impl_.publickey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.publickey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_publickey()) { + _this->_impl_.publickey_.Set(from._internal_publickey(), + _this->GetArenaForAllocation()); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage) - return target; + _impl_.encryptedkeypair_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.encryptedkeypair_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_encryptedkeypair()) { + _this->_impl_.encryptedkeypair_.Set(from._internal_encryptedkeypair(), + _this->GetArenaForAllocation()); + } + // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) } -size_t DataMessage::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage) - size_t total_size = 0; +inline void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.publickey_){} + , decltype(_impl_.encryptedkeypair_){} + }; + _impl_.publickey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.publickey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.encryptedkeypair_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.encryptedkeypair_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +DataMessage_ClosedGroupControlMessage_KeyPairWrapper::~DataMessage_ClosedGroupControlMessage_KeyPairWrapper() { + // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.publickey_.Destroy(); + _impl_.encryptedkeypair_.Destroy(); +} +void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // repeated .SessionProtos.AttachmentPointer attachments = 2; - total_size += 1UL * this->_internal_attachments_size(); - for (const auto& msg : this->_impl_.attachments_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // repeated .SessionProtos.DataMessage.Preview preview = 10; - total_size += 1UL * this->_internal_preview_size(); - for (const auto& msg : this->_impl_.preview_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x000000ffu) { - // optional string body = 1; + if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_body()); + _impl_.publickey_.ClearNonDefaultToEmpty(); } - - // optional bytes profileKey = 6; if (cached_has_bits & 0x00000002u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_profilekey()); + _impl_.encryptedkeypair_.ClearNonDefaultToEmpty(); } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear(); +} - // optional string syncTarget = 105; - if (cached_has_bits & 0x00000004u) { - total_size += 2 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_synctarget()); +const char* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // required bytes publicKey = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_publickey(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // required bytes encryptedKeyPair = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_encryptedkeypair(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} - // optional .SessionProtos.DataMessage.Quote quote = 8; - if (cached_has_bits & 0x00000008u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.quote_); - } +uint8_t* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; - // optional .SessionProtos.DataMessage.Reaction reaction = 11; - if (cached_has_bits & 0x00000010u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.reaction_); - } + cached_has_bits = _impl_._has_bits_[0]; + // required bytes publicKey = 1; + if (cached_has_bits & 0x00000001u) { + target = stream->WriteBytesMaybeAliased( + 1, this->_internal_publickey(), target); + } - // optional .SessionProtos.LokiProfile profile = 101; - if (cached_has_bits & 0x00000020u) { - total_size += 2 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.profile_); - } + // required bytes encryptedKeyPair = 2; + if (cached_has_bits & 0x00000002u) { + target = stream->WriteBytesMaybeAliased( + 2, this->_internal_encryptedkeypair(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) + return target; +} - // optional .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; - if (cached_has_bits & 0x00000040u) { - total_size += 2 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.opengroupinvitation_); - } +size_t DataMessage_ClosedGroupControlMessage_KeyPairWrapper::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) + size_t total_size = 0; - // optional .SessionProtos.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; - if (cached_has_bits & 0x00000080u) { - total_size += 2 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.closedgroupcontrolmessage_); - } + if (_internal_has_publickey()) { + // required bytes publicKey = 1; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_publickey()); + } + if (_internal_has_encryptedkeypair()) { + // required bytes encryptedKeyPair = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_encryptedkeypair()); } - if (cached_has_bits & 0x00000f00u) { - // optional uint32 flags = 4; - if (cached_has_bits & 0x00000100u) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); - } - // optional uint32 expireTimer = 5; - if (cached_has_bits & 0x00000200u) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_expiretimer()); - } + return total_size; +} +size_t DataMessage_ClosedGroupControlMessage_KeyPairWrapper::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) + size_t total_size = 0; - // optional uint64 timestamp = 7; - if (cached_has_bits & 0x00000400u) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_timestamp()); - } + if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. + // required bytes publicKey = 1; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_publickey()); - // optional bool blocksCommunityMessageRequests = 106; - if (cached_has_bits & 0x00000800u) { - total_size += 2 + 1; - } + // required bytes encryptedKeyPair = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_encryptedkeypair()); + } else { + total_size += RequiredFieldsByteSizeFallback(); } + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } @@ -7335,173 +7198,114 @@ size_t DataMessage::ByteSizeLong() const { return total_size; } -void DataMessage::CheckTypeAndMergeFrom( +void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void DataMessage::MergeFrom(const DataMessage& from) { - DataMessage* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage) +void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::MergeFrom(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from) { + DataMessage_ClosedGroupControlMessage_KeyPairWrapper* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.attachments_.MergeFrom(from._impl_.attachments_); - _this->_impl_.preview_.MergeFrom(from._impl_.preview_); cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x000000ffu) { + if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_body(from._internal_body()); + _this->_internal_set_publickey(from._internal_publickey()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_profilekey(from._internal_profilekey()); - } - if (cached_has_bits & 0x00000004u) { - _this->_internal_set_synctarget(from._internal_synctarget()); - } - if (cached_has_bits & 0x00000008u) { - _this->_internal_mutable_quote()->::SessionProtos::DataMessage_Quote::MergeFrom( - from._internal_quote()); - } - if (cached_has_bits & 0x00000010u) { - _this->_internal_mutable_reaction()->::SessionProtos::DataMessage_Reaction::MergeFrom( - from._internal_reaction()); - } - if (cached_has_bits & 0x00000020u) { - _this->_internal_mutable_profile()->::SessionProtos::LokiProfile::MergeFrom( - from._internal_profile()); - } - if (cached_has_bits & 0x00000040u) { - _this->_internal_mutable_opengroupinvitation()->::SessionProtos::DataMessage_OpenGroupInvitation::MergeFrom( - from._internal_opengroupinvitation()); - } - if (cached_has_bits & 0x00000080u) { - _this->_internal_mutable_closedgroupcontrolmessage()->::SessionProtos::DataMessage_ClosedGroupControlMessage::MergeFrom( - from._internal_closedgroupcontrolmessage()); - } - } - if (cached_has_bits & 0x00000f00u) { - if (cached_has_bits & 0x00000100u) { - _this->_impl_.flags_ = from._impl_.flags_; - } - if (cached_has_bits & 0x00000200u) { - _this->_impl_.expiretimer_ = from._impl_.expiretimer_; - } - if (cached_has_bits & 0x00000400u) { - _this->_impl_.timestamp_ = from._impl_.timestamp_; - } - if (cached_has_bits & 0x00000800u) { - _this->_impl_.blockscommunitymessagerequests_ = from._impl_.blockscommunitymessagerequests_; + _this->_internal_set_encryptedkeypair(from._internal_encryptedkeypair()); } - _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void DataMessage::CopyFrom(const DataMessage& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage) +void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::CopyFrom(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) if (&from == this) return; Clear(); MergeFrom(from); } -bool DataMessage::IsInitialized() const { - if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.attachments_)) - return false; - if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.preview_)) - return false; - if (_internal_has_quote()) { - if (!_impl_.quote_->IsInitialized()) return false; - } - if (_internal_has_reaction()) { - if (!_impl_.reaction_->IsInitialized()) return false; - } - if (_internal_has_opengroupinvitation()) { - if (!_impl_.opengroupinvitation_->IsInitialized()) return false; - } - if (_internal_has_closedgroupcontrolmessage()) { - if (!_impl_.closedgroupcontrolmessage_->IsInitialized()) return false; - } +bool DataMessage_ClosedGroupControlMessage_KeyPairWrapper::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; return true; } -void DataMessage::InternalSwap(DataMessage* other) { +void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::InternalSwap(DataMessage_ClosedGroupControlMessage_KeyPairWrapper* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.attachments_.InternalSwap(&other->_impl_.attachments_); - _impl_.preview_.InternalSwap(&other->_impl_.preview_); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.body_, lhs_arena, - &other->_impl_.body_, rhs_arena - ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.profilekey_, lhs_arena, - &other->_impl_.profilekey_, rhs_arena + &_impl_.publickey_, lhs_arena, + &other->_impl_.publickey_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.synctarget_, lhs_arena, - &other->_impl_.synctarget_, rhs_arena + &_impl_.encryptedkeypair_, lhs_arena, + &other->_impl_.encryptedkeypair_, rhs_arena ); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(DataMessage, _impl_.blockscommunitymessagerequests_) - + sizeof(DataMessage::_impl_.blockscommunitymessagerequests_) - - PROTOBUF_FIELD_OFFSET(DataMessage, _impl_.quote_)>( - reinterpret_cast(&_impl_.quote_), - reinterpret_cast(&other->_impl_.quote_)); } -std::string DataMessage::GetTypeName() const { - return "SessionProtos.DataMessage"; +std::string DataMessage_ClosedGroupControlMessage_KeyPairWrapper::GetTypeName() const { + return "SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper"; } // =================================================================== -class ConfigurationMessage_ClosedGroup::_Internal { +class DataMessage_ClosedGroupControlMessage::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_type(HasBits* has_bits) { + (*has_bits)[0] |= 16u; + } static void set_has_publickey(HasBits* has_bits) { (*has_bits)[0] |= 1u; } static void set_has_name(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static const ::SessionProtos::KeyPair& encryptionkeypair(const ConfigurationMessage_ClosedGroup* msg); + static const ::SessionProtos::KeyPair& encryptionkeypair(const DataMessage_ClosedGroupControlMessage* msg); static void set_has_encryptionkeypair(HasBits* has_bits) { (*has_bits)[0] |= 4u; } static void set_has_expirationtimer(HasBits* has_bits) { (*has_bits)[0] |= 8u; } + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x00000010) ^ 0x00000010) != 0; + } }; const ::SessionProtos::KeyPair& -ConfigurationMessage_ClosedGroup::_Internal::encryptionkeypair(const ConfigurationMessage_ClosedGroup* msg) { +DataMessage_ClosedGroupControlMessage::_Internal::encryptionkeypair(const DataMessage_ClosedGroupControlMessage* msg) { return *msg->_impl_.encryptionkeypair_; } -ConfigurationMessage_ClosedGroup::ConfigurationMessage_ClosedGroup(::PROTOBUF_NAMESPACE_ID::Arena* arena, +DataMessage_ClosedGroupControlMessage::DataMessage_ClosedGroupControlMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.ConfigurationMessage.ClosedGroup) + // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.ClosedGroupControlMessage) } -ConfigurationMessage_ClosedGroup::ConfigurationMessage_ClosedGroup(const ConfigurationMessage_ClosedGroup& from) +DataMessage_ClosedGroupControlMessage::DataMessage_ClosedGroupControlMessage(const DataMessage_ClosedGroupControlMessage& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - ConfigurationMessage_ClosedGroup* const _this = this; (void)_this; + DataMessage_ClosedGroupControlMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} , decltype(_impl_.members_){from._impl_.members_} , decltype(_impl_.admins_){from._impl_.admins_} + , decltype(_impl_.wrappers_){from._impl_.wrappers_} , decltype(_impl_.publickey_){} , decltype(_impl_.name_){} , decltype(_impl_.encryptionkeypair_){nullptr} - , decltype(_impl_.expirationtimer_){}}; + , decltype(_impl_.expirationtimer_){} + , decltype(_impl_.type_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.publickey_.InitDefault(); @@ -7523,11 +7327,13 @@ ConfigurationMessage_ClosedGroup::ConfigurationMessage_ClosedGroup(const Configu if (from._internal_has_encryptionkeypair()) { _this->_impl_.encryptionkeypair_ = new ::SessionProtos::KeyPair(*from._impl_.encryptionkeypair_); } - _this->_impl_.expirationtimer_ = from._impl_.expirationtimer_; - // @@protoc_insertion_point(copy_constructor:SessionProtos.ConfigurationMessage.ClosedGroup) + ::memcpy(&_impl_.expirationtimer_, &from._impl_.expirationtimer_, + static_cast(reinterpret_cast(&_impl_.type_) - + reinterpret_cast(&_impl_.expirationtimer_)) + sizeof(_impl_.type_)); + // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.ClosedGroupControlMessage) } -inline void ConfigurationMessage_ClosedGroup::SharedCtor( +inline void DataMessage_ClosedGroupControlMessage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; @@ -7536,10 +7342,12 @@ inline void ConfigurationMessage_ClosedGroup::SharedCtor( , /*decltype(_impl_._cached_size_)*/{} , decltype(_impl_.members_){arena} , decltype(_impl_.admins_){arena} + , decltype(_impl_.wrappers_){arena} , decltype(_impl_.publickey_){} , decltype(_impl_.name_){} , decltype(_impl_.encryptionkeypair_){nullptr} , decltype(_impl_.expirationtimer_){0u} + , decltype(_impl_.type_){1} }; _impl_.publickey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -7551,8 +7359,8 @@ inline void ConfigurationMessage_ClosedGroup::SharedCtor( #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -ConfigurationMessage_ClosedGroup::~ConfigurationMessage_ClosedGroup() { - // @@protoc_insertion_point(destructor:SessionProtos.ConfigurationMessage.ClosedGroup) +DataMessage_ClosedGroupControlMessage::~DataMessage_ClosedGroupControlMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.ClosedGroupControlMessage) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -7560,27 +7368,29 @@ ConfigurationMessage_ClosedGroup::~ConfigurationMessage_ClosedGroup() { SharedDtor(); } -inline void ConfigurationMessage_ClosedGroup::SharedDtor() { +inline void DataMessage_ClosedGroupControlMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); _impl_.members_.~RepeatedPtrField(); _impl_.admins_.~RepeatedPtrField(); + _impl_.wrappers_.~RepeatedPtrField(); _impl_.publickey_.Destroy(); _impl_.name_.Destroy(); if (this != internal_default_instance()) delete _impl_.encryptionkeypair_; } -void ConfigurationMessage_ClosedGroup::SetCachedSize(int size) const { +void DataMessage_ClosedGroupControlMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void ConfigurationMessage_ClosedGroup::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.ConfigurationMessage.ClosedGroup) +void DataMessage_ClosedGroupControlMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.ClosedGroupControlMessage) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; _impl_.members_.Clear(); _impl_.admins_.Clear(); + _impl_.wrappers_.Clear(); cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x00000001u) { @@ -7594,47 +7404,63 @@ void ConfigurationMessage_ClosedGroup::Clear() { _impl_.encryptionkeypair_->Clear(); } } - _impl_.expirationtimer_ = 0u; + if (cached_has_bits & 0x00000018u) { + _impl_.expirationtimer_ = 0u; + _impl_.type_ = 1; + } _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* ConfigurationMessage_ClosedGroup::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* DataMessage_ClosedGroupControlMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // optional bytes publicKey = 1; + // required .SessionProtos.DataMessage.ClosedGroupControlMessage.Type type = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_publickey(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); + if (PROTOBUF_PREDICT_TRUE(::SessionProtos::DataMessage_ClosedGroupControlMessage_Type_IsValid(val))) { + _internal_set_type(static_cast<::SessionProtos::DataMessage_ClosedGroupControlMessage_Type>(val)); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields()); + } } else goto handle_unusual; continue; - // optional string name = 2; + // optional bytes publicKey = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_name(); + auto str = _internal_mutable_publickey(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional .SessionProtos.KeyPair encryptionKeyPair = 3; + // optional string name = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - ptr = ctx->ParseMessage(_internal_mutable_encryptionkeypair(), ptr); + auto str = _internal_mutable_name(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // repeated bytes members = 4; + // optional .SessionProtos.KeyPair encryptionKeyPair = 4; case 4: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr = ctx->ParseMessage(_internal_mutable_encryptionkeypair(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // repeated bytes members = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { ptr -= 1; do { ptr += 1; @@ -7642,13 +7468,13 @@ const char* ConfigurationMessage_ClosedGroup::_InternalParse(const char* ptr, :: ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr)); } else goto handle_unusual; continue; - // repeated bytes admins = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + // repeated bytes admins = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { ptr -= 1; do { ptr += 1; @@ -7656,13 +7482,26 @@ const char* ConfigurationMessage_ClosedGroup::_InternalParse(const char* ptr, :: ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr)); + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr)); } else goto handle_unusual; continue; - // optional uint32 expirationTimer = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { + // repeated .SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper wrappers = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_wrappers(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<58>(ptr)); + } else + goto handle_unusual; + continue; + // optional uint32 expirationTimer = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 64)) { _Internal::set_has_expirationtimer(&has_bits); _impl_.expirationtimer_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); @@ -7693,67 +7532,87 @@ const char* ConfigurationMessage_ClosedGroup::_InternalParse(const char* ptr, :: #undef CHK_ } -uint8_t* ConfigurationMessage_ClosedGroup::_InternalSerialize( +uint8_t* DataMessage_ClosedGroupControlMessage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ConfigurationMessage.ClosedGroup) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.ClosedGroupControlMessage) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // optional bytes publicKey = 1; + // required .SessionProtos.DataMessage.ClosedGroupControlMessage.Type type = 1; + if (cached_has_bits & 0x00000010u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this->_internal_type(), target); + } + + // optional bytes publicKey = 2; if (cached_has_bits & 0x00000001u) { target = stream->WriteBytesMaybeAliased( - 1, this->_internal_publickey(), target); + 2, this->_internal_publickey(), target); } - // optional string name = 2; + // optional string name = 3; if (cached_has_bits & 0x00000002u) { target = stream->WriteStringMaybeAliased( - 2, this->_internal_name(), target); + 3, this->_internal_name(), target); } - // optional .SessionProtos.KeyPair encryptionKeyPair = 3; + // optional .SessionProtos.KeyPair encryptionKeyPair = 4; if (cached_has_bits & 0x00000004u) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::encryptionkeypair(this), + InternalWriteMessage(4, _Internal::encryptionkeypair(this), _Internal::encryptionkeypair(this).GetCachedSize(), target, stream); } - // repeated bytes members = 4; + // repeated bytes members = 5; for (int i = 0, n = this->_internal_members_size(); i < n; i++) { const auto& s = this->_internal_members(i); - target = stream->WriteBytes(4, s, target); + target = stream->WriteBytes(5, s, target); } - // repeated bytes admins = 5; + // repeated bytes admins = 6; for (int i = 0, n = this->_internal_admins_size(); i < n; i++) { const auto& s = this->_internal_admins(i); - target = stream->WriteBytes(5, s, target); + target = stream->WriteBytes(6, s, target); } - // optional uint32 expirationTimer = 6; + // repeated .SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper wrappers = 7; + for (unsigned i = 0, + n = static_cast(this->_internal_wrappers_size()); i < n; i++) { + const auto& repfield = this->_internal_wrappers(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(7, repfield, repfield.GetCachedSize(), target, stream); + } + + // optional uint32 expirationTimer = 8; if (cached_has_bits & 0x00000008u) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(6, this->_internal_expirationtimer(), target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(8, this->_internal_expirationtimer(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ConfigurationMessage.ClosedGroup) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.ClosedGroupControlMessage) return target; } -size_t ConfigurationMessage_ClosedGroup::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ConfigurationMessage.ClosedGroup) +size_t DataMessage_ClosedGroupControlMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.ClosedGroupControlMessage) size_t total_size = 0; + // required .SessionProtos.DataMessage.ClosedGroupControlMessage.Type type = 1; + if (_internal_has_type()) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); + } uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // repeated bytes members = 4; + // repeated bytes members = 5; total_size += 1 * ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.members_.size()); for (int i = 0, n = _impl_.members_.size(); i < n; i++) { @@ -7761,7 +7620,7 @@ size_t ConfigurationMessage_ClosedGroup::ByteSizeLong() const { _impl_.members_.Get(i)); } - // repeated bytes admins = 5; + // repeated bytes admins = 6; total_size += 1 * ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.admins_.size()); for (int i = 0, n = _impl_.admins_.size(); i < n; i++) { @@ -7769,30 +7628,37 @@ size_t ConfigurationMessage_ClosedGroup::ByteSizeLong() const { _impl_.admins_.Get(i)); } + // repeated .SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper wrappers = 7; + total_size += 1UL * this->_internal_wrappers_size(); + for (const auto& msg : this->_impl_.wrappers_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x0000000fu) { - // optional bytes publicKey = 1; + // optional bytes publicKey = 2; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( this->_internal_publickey()); } - // optional string name = 2; + // optional string name = 3; if (cached_has_bits & 0x00000002u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( this->_internal_name()); } - // optional .SessionProtos.KeyPair encryptionKeyPair = 3; + // optional .SessionProtos.KeyPair encryptionKeyPair = 4; if (cached_has_bits & 0x00000004u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( *_impl_.encryptionkeypair_); } - // optional uint32 expirationTimer = 6; + // optional uint32 expirationTimer = 8; if (cached_has_bits & 0x00000008u) { total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_expirationtimer()); } @@ -7806,23 +7672,24 @@ size_t ConfigurationMessage_ClosedGroup::ByteSizeLong() const { return total_size; } -void ConfigurationMessage_ClosedGroup::CheckTypeAndMergeFrom( +void DataMessage_ClosedGroupControlMessage::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void ConfigurationMessage_ClosedGroup::MergeFrom(const ConfigurationMessage_ClosedGroup& from) { - ConfigurationMessage_ClosedGroup* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ConfigurationMessage.ClosedGroup) +void DataMessage_ClosedGroupControlMessage::MergeFrom(const DataMessage_ClosedGroupControlMessage& from) { + DataMessage_ClosedGroupControlMessage* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.ClosedGroupControlMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; _this->_impl_.members_.MergeFrom(from._impl_.members_); _this->_impl_.admins_.MergeFrom(from._impl_.admins_); + _this->_impl_.wrappers_.MergeFrom(from._impl_.wrappers_); cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { + if (cached_has_bits & 0x0000001fu) { if (cached_has_bits & 0x00000001u) { _this->_internal_set_publickey(from._internal_publickey()); } @@ -7836,26 +7703,32 @@ void ConfigurationMessage_ClosedGroup::MergeFrom(const ConfigurationMessage_Clos if (cached_has_bits & 0x00000008u) { _this->_impl_.expirationtimer_ = from._impl_.expirationtimer_; } + if (cached_has_bits & 0x00000010u) { + _this->_impl_.type_ = from._impl_.type_; + } _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void ConfigurationMessage_ClosedGroup::CopyFrom(const ConfigurationMessage_ClosedGroup& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ConfigurationMessage.ClosedGroup) +void DataMessage_ClosedGroupControlMessage::CopyFrom(const DataMessage_ClosedGroupControlMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.ClosedGroupControlMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool ConfigurationMessage_ClosedGroup::IsInitialized() const { +bool DataMessage_ClosedGroupControlMessage::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; + if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.wrappers_)) + return false; if (_internal_has_encryptionkeypair()) { if (!_impl_.encryptionkeypair_->IsInitialized()) return false; } return true; } -void ConfigurationMessage_ClosedGroup::InternalSwap(ConfigurationMessage_ClosedGroup* other) { +void DataMessage_ClosedGroupControlMessage::InternalSwap(DataMessage_ClosedGroupControlMessage* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); @@ -7863,6 +7736,7 @@ void ConfigurationMessage_ClosedGroup::InternalSwap(ConfigurationMessage_ClosedG swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); _impl_.members_.InternalSwap(&other->_impl_.members_); _impl_.admins_.InternalSwap(&other->_impl_.admins_); + _impl_.wrappers_.InternalSwap(&other->_impl_.wrappers_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( &_impl_.publickey_, lhs_arena, &other->_impl_.publickey_, rhs_arena @@ -7872,92 +7746,121 @@ void ConfigurationMessage_ClosedGroup::InternalSwap(ConfigurationMessage_ClosedG &other->_impl_.name_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(ConfigurationMessage_ClosedGroup, _impl_.expirationtimer_) - + sizeof(ConfigurationMessage_ClosedGroup::_impl_.expirationtimer_) - - PROTOBUF_FIELD_OFFSET(ConfigurationMessage_ClosedGroup, _impl_.encryptionkeypair_)>( + PROTOBUF_FIELD_OFFSET(DataMessage_ClosedGroupControlMessage, _impl_.expirationtimer_) + + sizeof(DataMessage_ClosedGroupControlMessage::_impl_.expirationtimer_) + - PROTOBUF_FIELD_OFFSET(DataMessage_ClosedGroupControlMessage, _impl_.encryptionkeypair_)>( reinterpret_cast(&_impl_.encryptionkeypair_), reinterpret_cast(&other->_impl_.encryptionkeypair_)); + swap(_impl_.type_, other->_impl_.type_); } -std::string ConfigurationMessage_ClosedGroup::GetTypeName() const { - return "SessionProtos.ConfigurationMessage.ClosedGroup"; +std::string DataMessage_ClosedGroupControlMessage::GetTypeName() const { + return "SessionProtos.DataMessage.ClosedGroupControlMessage"; } // =================================================================== -class ConfigurationMessage_Contact::_Internal { +class DataMessage::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_publickey(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_body(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_name(HasBits* has_bits) { - (*has_bits)[0] |= 2u; + static void set_has_flags(HasBits* has_bits) { + (*has_bits)[0] |= 256u; } - static void set_has_profilepicture(HasBits* has_bits) { - (*has_bits)[0] |= 4u; + static void set_has_expiretimer(HasBits* has_bits) { + (*has_bits)[0] |= 512u; } static void set_has_profilekey(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_timestamp(HasBits* has_bits) { + (*has_bits)[0] |= 1024u; + } + static const ::SessionProtos::DataMessage_Quote& quote(const DataMessage* msg); + static void set_has_quote(HasBits* has_bits) { (*has_bits)[0] |= 8u; } - static void set_has_isapproved(HasBits* has_bits) { + static const ::SessionProtos::DataMessage_Reaction& reaction(const DataMessage* msg); + static void set_has_reaction(HasBits* has_bits) { (*has_bits)[0] |= 16u; } - static void set_has_isblocked(HasBits* has_bits) { + static const ::SessionProtos::LokiProfile& profile(const DataMessage* msg); + static void set_has_profile(HasBits* has_bits) { (*has_bits)[0] |= 32u; } - static void set_has_didapproveme(HasBits* has_bits) { + static const ::SessionProtos::DataMessage_OpenGroupInvitation& opengroupinvitation(const DataMessage* msg); + static void set_has_opengroupinvitation(HasBits* has_bits) { (*has_bits)[0] |= 64u; } - static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; + static const ::SessionProtos::DataMessage_ClosedGroupControlMessage& closedgroupcontrolmessage(const DataMessage* msg); + static void set_has_closedgroupcontrolmessage(HasBits* has_bits) { + (*has_bits)[0] |= 128u; + } + static void set_has_synctarget(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static void set_has_blockscommunitymessagerequests(HasBits* has_bits) { + (*has_bits)[0] |= 2048u; } }; -ConfigurationMessage_Contact::ConfigurationMessage_Contact(::PROTOBUF_NAMESPACE_ID::Arena* arena, +const ::SessionProtos::DataMessage_Quote& +DataMessage::_Internal::quote(const DataMessage* msg) { + return *msg->_impl_.quote_; +} +const ::SessionProtos::DataMessage_Reaction& +DataMessage::_Internal::reaction(const DataMessage* msg) { + return *msg->_impl_.reaction_; +} +const ::SessionProtos::LokiProfile& +DataMessage::_Internal::profile(const DataMessage* msg) { + return *msg->_impl_.profile_; +} +const ::SessionProtos::DataMessage_OpenGroupInvitation& +DataMessage::_Internal::opengroupinvitation(const DataMessage* msg) { + return *msg->_impl_.opengroupinvitation_; +} +const ::SessionProtos::DataMessage_ClosedGroupControlMessage& +DataMessage::_Internal::closedgroupcontrolmessage(const DataMessage* msg) { + return *msg->_impl_.closedgroupcontrolmessage_; +} +DataMessage::DataMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.ConfigurationMessage.Contact) + // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage) } -ConfigurationMessage_Contact::ConfigurationMessage_Contact(const ConfigurationMessage_Contact& from) +DataMessage::DataMessage(const DataMessage& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - ConfigurationMessage_Contact* const _this = this; (void)_this; + DataMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.publickey_){} - , decltype(_impl_.name_){} - , decltype(_impl_.profilepicture_){} + , decltype(_impl_.attachments_){from._impl_.attachments_} + , decltype(_impl_.preview_){from._impl_.preview_} + , decltype(_impl_.body_){} , decltype(_impl_.profilekey_){} - , decltype(_impl_.isapproved_){} - , decltype(_impl_.isblocked_){} - , decltype(_impl_.didapproveme_){}}; + , decltype(_impl_.synctarget_){} + , decltype(_impl_.quote_){nullptr} + , decltype(_impl_.reaction_){nullptr} + , decltype(_impl_.profile_){nullptr} + , decltype(_impl_.opengroupinvitation_){nullptr} + , decltype(_impl_.closedgroupcontrolmessage_){nullptr} + , decltype(_impl_.flags_){} + , decltype(_impl_.expiretimer_){} + , decltype(_impl_.timestamp_){} + , decltype(_impl_.blockscommunitymessagerequests_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.publickey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_publickey()) { - _this->_impl_.publickey_.Set(from._internal_publickey(), - _this->GetArenaForAllocation()); - } - _impl_.name_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_name()) { - _this->_impl_.name_.Set(from._internal_name(), - _this->GetArenaForAllocation()); - } - _impl_.profilepicture_.InitDefault(); + _impl_.body_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilepicture_.Set("", GetArenaForAllocation()); + _impl_.body_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_profilepicture()) { - _this->_impl_.profilepicture_.Set(from._internal_profilepicture(), + if (from._internal_has_body()) { + _this->_impl_.body_.Set(from._internal_body(), _this->GetArenaForAllocation()); } _impl_.profilekey_.InitDefault(); @@ -7968,47 +7871,73 @@ ConfigurationMessage_Contact::ConfigurationMessage_Contact(const ConfigurationMe _this->_impl_.profilekey_.Set(from._internal_profilekey(), _this->GetArenaForAllocation()); } - ::memcpy(&_impl_.isapproved_, &from._impl_.isapproved_, - static_cast(reinterpret_cast(&_impl_.didapproveme_) - - reinterpret_cast(&_impl_.isapproved_)) + sizeof(_impl_.didapproveme_)); - // @@protoc_insertion_point(copy_constructor:SessionProtos.ConfigurationMessage.Contact) + _impl_.synctarget_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.synctarget_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_synctarget()) { + _this->_impl_.synctarget_.Set(from._internal_synctarget(), + _this->GetArenaForAllocation()); + } + if (from._internal_has_quote()) { + _this->_impl_.quote_ = new ::SessionProtos::DataMessage_Quote(*from._impl_.quote_); + } + if (from._internal_has_reaction()) { + _this->_impl_.reaction_ = new ::SessionProtos::DataMessage_Reaction(*from._impl_.reaction_); + } + if (from._internal_has_profile()) { + _this->_impl_.profile_ = new ::SessionProtos::LokiProfile(*from._impl_.profile_); + } + if (from._internal_has_opengroupinvitation()) { + _this->_impl_.opengroupinvitation_ = new ::SessionProtos::DataMessage_OpenGroupInvitation(*from._impl_.opengroupinvitation_); + } + if (from._internal_has_closedgroupcontrolmessage()) { + _this->_impl_.closedgroupcontrolmessage_ = new ::SessionProtos::DataMessage_ClosedGroupControlMessage(*from._impl_.closedgroupcontrolmessage_); + } + ::memcpy(&_impl_.flags_, &from._impl_.flags_, + static_cast(reinterpret_cast(&_impl_.blockscommunitymessagerequests_) - + reinterpret_cast(&_impl_.flags_)) + sizeof(_impl_.blockscommunitymessagerequests_)); + // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage) } -inline void ConfigurationMessage_Contact::SharedCtor( +inline void DataMessage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.publickey_){} - , decltype(_impl_.name_){} - , decltype(_impl_.profilepicture_){} + , decltype(_impl_.attachments_){arena} + , decltype(_impl_.preview_){arena} + , decltype(_impl_.body_){} , decltype(_impl_.profilekey_){} - , decltype(_impl_.isapproved_){false} - , decltype(_impl_.isblocked_){false} - , decltype(_impl_.didapproveme_){false} + , decltype(_impl_.synctarget_){} + , decltype(_impl_.quote_){nullptr} + , decltype(_impl_.reaction_){nullptr} + , decltype(_impl_.profile_){nullptr} + , decltype(_impl_.opengroupinvitation_){nullptr} + , decltype(_impl_.closedgroupcontrolmessage_){nullptr} + , decltype(_impl_.flags_){0u} + , decltype(_impl_.expiretimer_){0u} + , decltype(_impl_.timestamp_){uint64_t{0u}} + , decltype(_impl_.blockscommunitymessagerequests_){false} }; - _impl_.publickey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilepicture_.InitDefault(); + _impl_.body_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilepicture_.Set("", GetArenaForAllocation()); + _impl_.body_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.profilekey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.profilekey_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.synctarget_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.synctarget_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -ConfigurationMessage_Contact::~ConfigurationMessage_Contact() { - // @@protoc_insertion_point(destructor:SessionProtos.ConfigurationMessage.Contact) +DataMessage::~DataMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.DataMessage) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -8016,112 +7945,205 @@ ConfigurationMessage_Contact::~ConfigurationMessage_Contact() { SharedDtor(); } -inline void ConfigurationMessage_Contact::SharedDtor() { +inline void DataMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.publickey_.Destroy(); - _impl_.name_.Destroy(); - _impl_.profilepicture_.Destroy(); + _impl_.attachments_.~RepeatedPtrField(); + _impl_.preview_.~RepeatedPtrField(); + _impl_.body_.Destroy(); _impl_.profilekey_.Destroy(); + _impl_.synctarget_.Destroy(); + if (this != internal_default_instance()) delete _impl_.quote_; + if (this != internal_default_instance()) delete _impl_.reaction_; + if (this != internal_default_instance()) delete _impl_.profile_; + if (this != internal_default_instance()) delete _impl_.opengroupinvitation_; + if (this != internal_default_instance()) delete _impl_.closedgroupcontrolmessage_; } -void ConfigurationMessage_Contact::SetCachedSize(int size) const { +void DataMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void ConfigurationMessage_Contact::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.ConfigurationMessage.Contact) +void DataMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + _impl_.attachments_.Clear(); + _impl_.preview_.Clear(); cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { + if (cached_has_bits & 0x000000ffu) { if (cached_has_bits & 0x00000001u) { - _impl_.publickey_.ClearNonDefaultToEmpty(); + _impl_.body_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.name_.ClearNonDefaultToEmpty(); + _impl_.profilekey_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000004u) { - _impl_.profilepicture_.ClearNonDefaultToEmpty(); + _impl_.synctarget_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000008u) { - _impl_.profilekey_.ClearNonDefaultToEmpty(); + GOOGLE_DCHECK(_impl_.quote_ != nullptr); + _impl_.quote_->Clear(); + } + if (cached_has_bits & 0x00000010u) { + GOOGLE_DCHECK(_impl_.reaction_ != nullptr); + _impl_.reaction_->Clear(); + } + if (cached_has_bits & 0x00000020u) { + GOOGLE_DCHECK(_impl_.profile_ != nullptr); + _impl_.profile_->Clear(); + } + if (cached_has_bits & 0x00000040u) { + GOOGLE_DCHECK(_impl_.opengroupinvitation_ != nullptr); + _impl_.opengroupinvitation_->Clear(); + } + if (cached_has_bits & 0x00000080u) { + GOOGLE_DCHECK(_impl_.closedgroupcontrolmessage_ != nullptr); + _impl_.closedgroupcontrolmessage_->Clear(); } } - ::memset(&_impl_.isapproved_, 0, static_cast( - reinterpret_cast(&_impl_.didapproveme_) - - reinterpret_cast(&_impl_.isapproved_)) + sizeof(_impl_.didapproveme_)); + if (cached_has_bits & 0x00000f00u) { + ::memset(&_impl_.flags_, 0, static_cast( + reinterpret_cast(&_impl_.blockscommunitymessagerequests_) - + reinterpret_cast(&_impl_.flags_)) + sizeof(_impl_.blockscommunitymessagerequests_)); + } _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* ConfigurationMessage_Contact::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* DataMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required bytes publicKey = 1; + // optional string body = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_publickey(); + auto str = _internal_mutable_body(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // required string name = 2; + // repeated .SessionProtos.AttachmentPointer attachments = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_name(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_attachments(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); + } else + goto handle_unusual; + continue; + // optional uint32 flags = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + _Internal::set_has_flags(&has_bits); + _impl_.flags_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; - // optional string profilePicture = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_profilepicture(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + // optional uint32 expireTimer = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { + _Internal::set_has_expiretimer(&has_bits); + _impl_.expiretimer_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; - // optional bytes profileKey = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + // optional bytes profileKey = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { auto str = _internal_mutable_profilekey(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional bool isApproved = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { - _Internal::set_has_isapproved(&has_bits); - _impl_.isapproved_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + // optional uint64 timestamp = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { + _Internal::set_has_timestamp(&has_bits); + _impl_.timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else goto handle_unusual; continue; - // optional bool isBlocked = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { - _Internal::set_has_isblocked(&has_bits); - _impl_.isblocked_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + // optional .SessionProtos.DataMessage.Quote quote = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { + ptr = ctx->ParseMessage(_internal_mutable_quote(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // optional bool didApproveMe = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { - _Internal::set_has_didapproveme(&has_bits); - _impl_.didapproveme_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + // repeated .SessionProtos.DataMessage.Preview preview = 10; + case 10: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 82)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_preview(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<82>(ptr)); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.DataMessage.Reaction reaction = 11; + case 11: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 90)) { + ptr = ctx->ParseMessage(_internal_mutable_reaction(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.LokiProfile profile = 101; + case 101: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + ptr = ctx->ParseMessage(_internal_mutable_profile(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + case 102: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { + ptr = ctx->ParseMessage(_internal_mutable_opengroupinvitation(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; + case 104: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { + ptr = ctx->ParseMessage(_internal_mutable_closedgroupcontrolmessage(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional string syncTarget = 105; + case 105: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { + auto str = _internal_mutable_synctarget(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional bool blocksCommunityMessageRequests = 106; + case 106: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 80)) { + _Internal::set_has_blockscommunitymessagerequests(&has_bits); + _impl_.blockscommunitymessagerequests_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else goto handle_unusual; @@ -8150,134 +8172,214 @@ const char* ConfigurationMessage_Contact::_InternalParse(const char* ptr, ::_pbi #undef CHK_ } -uint8_t* ConfigurationMessage_Contact::_InternalSerialize( +uint8_t* DataMessage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ConfigurationMessage.Contact) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required bytes publicKey = 1; + // optional string body = 1; if (cached_has_bits & 0x00000001u) { - target = stream->WriteBytesMaybeAliased( - 1, this->_internal_publickey(), target); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_body(), target); } - // required string name = 2; + // repeated .SessionProtos.AttachmentPointer attachments = 2; + for (unsigned i = 0, + n = static_cast(this->_internal_attachments_size()); i < n; i++) { + const auto& repfield = this->_internal_attachments(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); + } + + // optional uint32 flags = 4; + if (cached_has_bits & 0x00000100u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_flags(), target); + } + + // optional uint32 expireTimer = 5; + if (cached_has_bits & 0x00000200u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_expiretimer(), target); + } + + // optional bytes profileKey = 6; if (cached_has_bits & 0x00000002u) { - target = stream->WriteStringMaybeAliased( - 2, this->_internal_name(), target); + target = stream->WriteBytesMaybeAliased( + 6, this->_internal_profilekey(), target); } - // optional string profilePicture = 3; - if (cached_has_bits & 0x00000004u) { - target = stream->WriteStringMaybeAliased( - 3, this->_internal_profilepicture(), target); + // optional uint64 timestamp = 7; + if (cached_has_bits & 0x00000400u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(7, this->_internal_timestamp(), target); } - // optional bytes profileKey = 4; + // optional .SessionProtos.DataMessage.Quote quote = 8; if (cached_has_bits & 0x00000008u) { - target = stream->WriteBytesMaybeAliased( - 4, this->_internal_profilekey(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(8, _Internal::quote(this), + _Internal::quote(this).GetCachedSize(), target, stream); } - // optional bool isApproved = 5; + // repeated .SessionProtos.DataMessage.Preview preview = 10; + for (unsigned i = 0, + n = static_cast(this->_internal_preview_size()); i < n; i++) { + const auto& repfield = this->_internal_preview(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(10, repfield, repfield.GetCachedSize(), target, stream); + } + + // optional .SessionProtos.DataMessage.Reaction reaction = 11; if (cached_has_bits & 0x00000010u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_isapproved(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(11, _Internal::reaction(this), + _Internal::reaction(this).GetCachedSize(), target, stream); } - // optional bool isBlocked = 6; + // optional .SessionProtos.LokiProfile profile = 101; if (cached_has_bits & 0x00000020u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(6, this->_internal_isblocked(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(101, _Internal::profile(this), + _Internal::profile(this).GetCachedSize(), target, stream); } - // optional bool didApproveMe = 7; + // optional .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; if (cached_has_bits & 0x00000040u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(102, _Internal::opengroupinvitation(this), + _Internal::opengroupinvitation(this).GetCachedSize(), target, stream); + } + + // optional .SessionProtos.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; + if (cached_has_bits & 0x00000080u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(104, _Internal::closedgroupcontrolmessage(this), + _Internal::closedgroupcontrolmessage(this).GetCachedSize(), target, stream); + } + + // optional string syncTarget = 105; + if (cached_has_bits & 0x00000004u) { + target = stream->WriteStringMaybeAliased( + 105, this->_internal_synctarget(), target); + } + + // optional bool blocksCommunityMessageRequests = 106; + if (cached_has_bits & 0x00000800u) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(7, this->_internal_didapproveme(), target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(106, this->_internal_blockscommunitymessagerequests(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ConfigurationMessage.Contact) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage) return target; } -size_t ConfigurationMessage_Contact::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.ConfigurationMessage.Contact) +size_t DataMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage) size_t total_size = 0; - if (_internal_has_publickey()) { - // required bytes publicKey = 1; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_publickey()); - } + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; - if (_internal_has_name()) { - // required string name = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); + // repeated .SessionProtos.AttachmentPointer attachments = 2; + total_size += 1UL * this->_internal_attachments_size(); + for (const auto& msg : this->_impl_.attachments_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); } - return total_size; -} -size_t ConfigurationMessage_Contact::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ConfigurationMessage.Contact) - size_t total_size = 0; - - if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. - // required bytes publicKey = 1; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_publickey()); - - // required string name = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); - - } else { - total_size += RequiredFieldsByteSizeFallback(); + // repeated .SessionProtos.DataMessage.Preview preview = 10; + total_size += 1UL * this->_internal_preview_size(); + for (const auto& msg : this->_impl_.preview_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); } - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000007cu) { - // optional string profilePicture = 3; - if (cached_has_bits & 0x00000004u) { + if (cached_has_bits & 0x000000ffu) { + // optional string body = 1; + if (cached_has_bits & 0x00000001u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_profilepicture()); + this->_internal_body()); } - // optional bytes profileKey = 4; - if (cached_has_bits & 0x00000008u) { + // optional bytes profileKey = 6; + if (cached_has_bits & 0x00000002u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( this->_internal_profilekey()); } - // optional bool isApproved = 5; + // optional string syncTarget = 105; + if (cached_has_bits & 0x00000004u) { + total_size += 2 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_synctarget()); + } + + // optional .SessionProtos.DataMessage.Quote quote = 8; + if (cached_has_bits & 0x00000008u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.quote_); + } + + // optional .SessionProtos.DataMessage.Reaction reaction = 11; if (cached_has_bits & 0x00000010u) { - total_size += 1 + 1; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.reaction_); } - // optional bool isBlocked = 6; + // optional .SessionProtos.LokiProfile profile = 101; if (cached_has_bits & 0x00000020u) { - total_size += 1 + 1; + total_size += 2 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.profile_); } - // optional bool didApproveMe = 7; + // optional .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; if (cached_has_bits & 0x00000040u) { - total_size += 1 + 1; + total_size += 2 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.opengroupinvitation_); + } + + // optional .SessionProtos.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; + if (cached_has_bits & 0x00000080u) { + total_size += 2 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.closedgroupcontrolmessage_); + } + + } + if (cached_has_bits & 0x00000f00u) { + // optional uint32 flags = 4; + if (cached_has_bits & 0x00000100u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); + } + + // optional uint32 expireTimer = 5; + if (cached_has_bits & 0x00000200u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_expiretimer()); + } + + // optional uint64 timestamp = 7; + if (cached_has_bits & 0x00000400u) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_timestamp()); + } + + // optional bool blocksCommunityMessageRequests = 106; + if (cached_has_bits & 0x00000800u) { + total_size += 2 + 1; } } @@ -8289,197 +8391,224 @@ size_t ConfigurationMessage_Contact::ByteSizeLong() const { return total_size; } -void ConfigurationMessage_Contact::CheckTypeAndMergeFrom( +void DataMessage::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void ConfigurationMessage_Contact::MergeFrom(const ConfigurationMessage_Contact& from) { - ConfigurationMessage_Contact* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ConfigurationMessage.Contact) +void DataMessage::MergeFrom(const DataMessage& from) { + DataMessage* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; + _this->_impl_.attachments_.MergeFrom(from._impl_.attachments_); + _this->_impl_.preview_.MergeFrom(from._impl_.preview_); cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x0000007fu) { + if (cached_has_bits & 0x000000ffu) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_publickey(from._internal_publickey()); + _this->_internal_set_body(from._internal_body()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_name(from._internal_name()); + _this->_internal_set_profilekey(from._internal_profilekey()); + } + if (cached_has_bits & 0x00000004u) { + _this->_internal_set_synctarget(from._internal_synctarget()); + } + if (cached_has_bits & 0x00000008u) { + _this->_internal_mutable_quote()->::SessionProtos::DataMessage_Quote::MergeFrom( + from._internal_quote()); + } + if (cached_has_bits & 0x00000010u) { + _this->_internal_mutable_reaction()->::SessionProtos::DataMessage_Reaction::MergeFrom( + from._internal_reaction()); + } + if (cached_has_bits & 0x00000020u) { + _this->_internal_mutable_profile()->::SessionProtos::LokiProfile::MergeFrom( + from._internal_profile()); + } + if (cached_has_bits & 0x00000040u) { + _this->_internal_mutable_opengroupinvitation()->::SessionProtos::DataMessage_OpenGroupInvitation::MergeFrom( + from._internal_opengroupinvitation()); } - if (cached_has_bits & 0x00000004u) { - _this->_internal_set_profilepicture(from._internal_profilepicture()); + if (cached_has_bits & 0x00000080u) { + _this->_internal_mutable_closedgroupcontrolmessage()->::SessionProtos::DataMessage_ClosedGroupControlMessage::MergeFrom( + from._internal_closedgroupcontrolmessage()); } - if (cached_has_bits & 0x00000008u) { - _this->_internal_set_profilekey(from._internal_profilekey()); + } + if (cached_has_bits & 0x00000f00u) { + if (cached_has_bits & 0x00000100u) { + _this->_impl_.flags_ = from._impl_.flags_; } - if (cached_has_bits & 0x00000010u) { - _this->_impl_.isapproved_ = from._impl_.isapproved_; + if (cached_has_bits & 0x00000200u) { + _this->_impl_.expiretimer_ = from._impl_.expiretimer_; } - if (cached_has_bits & 0x00000020u) { - _this->_impl_.isblocked_ = from._impl_.isblocked_; + if (cached_has_bits & 0x00000400u) { + _this->_impl_.timestamp_ = from._impl_.timestamp_; } - if (cached_has_bits & 0x00000040u) { - _this->_impl_.didapproveme_ = from._impl_.didapproveme_; + if (cached_has_bits & 0x00000800u) { + _this->_impl_.blockscommunitymessagerequests_ = from._impl_.blockscommunitymessagerequests_; } _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void ConfigurationMessage_Contact::CopyFrom(const ConfigurationMessage_Contact& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ConfigurationMessage.Contact) +void DataMessage::CopyFrom(const DataMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool ConfigurationMessage_Contact::IsInitialized() const { - if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; +bool DataMessage::IsInitialized() const { + if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.attachments_)) + return false; + if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.preview_)) + return false; + if (_internal_has_quote()) { + if (!_impl_.quote_->IsInitialized()) return false; + } + if (_internal_has_reaction()) { + if (!_impl_.reaction_->IsInitialized()) return false; + } + if (_internal_has_opengroupinvitation()) { + if (!_impl_.opengroupinvitation_->IsInitialized()) return false; + } + if (_internal_has_closedgroupcontrolmessage()) { + if (!_impl_.closedgroupcontrolmessage_->IsInitialized()) return false; + } return true; } -void ConfigurationMessage_Contact::InternalSwap(ConfigurationMessage_Contact* other) { +void DataMessage::InternalSwap(DataMessage* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.attachments_.InternalSwap(&other->_impl_.attachments_); + _impl_.preview_.InternalSwap(&other->_impl_.preview_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.publickey_, lhs_arena, - &other->_impl_.publickey_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.name_, lhs_arena, - &other->_impl_.name_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.profilepicture_, lhs_arena, - &other->_impl_.profilepicture_, rhs_arena + &_impl_.body_, lhs_arena, + &other->_impl_.body_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( &_impl_.profilekey_, lhs_arena, &other->_impl_.profilekey_, rhs_arena ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.synctarget_, lhs_arena, + &other->_impl_.synctarget_, rhs_arena + ); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(ConfigurationMessage_Contact, _impl_.didapproveme_) - + sizeof(ConfigurationMessage_Contact::_impl_.didapproveme_) - - PROTOBUF_FIELD_OFFSET(ConfigurationMessage_Contact, _impl_.isapproved_)>( - reinterpret_cast(&_impl_.isapproved_), - reinterpret_cast(&other->_impl_.isapproved_)); + PROTOBUF_FIELD_OFFSET(DataMessage, _impl_.blockscommunitymessagerequests_) + + sizeof(DataMessage::_impl_.blockscommunitymessagerequests_) + - PROTOBUF_FIELD_OFFSET(DataMessage, _impl_.quote_)>( + reinterpret_cast(&_impl_.quote_), + reinterpret_cast(&other->_impl_.quote_)); } -std::string ConfigurationMessage_Contact::GetTypeName() const { - return "SessionProtos.ConfigurationMessage.Contact"; +std::string DataMessage::GetTypeName() const { + return "SessionProtos.DataMessage"; } // =================================================================== -class ConfigurationMessage_ProProof::_Internal { +class ConfigurationMessage_ClosedGroup::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_version(HasBits* has_bits) { - (*has_bits)[0] |= 16u; - } - static void set_has_genindexhash(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_publickey(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_rotatingpublickey(HasBits* has_bits) { + static void set_has_name(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static void set_has_expiryunixts(HasBits* has_bits) { - (*has_bits)[0] |= 8u; - } - static void set_has_sig(HasBits* has_bits) { + static const ::SessionProtos::KeyPair& encryptionkeypair(const ConfigurationMessage_ClosedGroup* msg); + static void set_has_encryptionkeypair(HasBits* has_bits) { (*has_bits)[0] |= 4u; } - static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x0000001f) ^ 0x0000001f) != 0; + static void set_has_expirationtimer(HasBits* has_bits) { + (*has_bits)[0] |= 8u; } }; -ConfigurationMessage_ProProof::ConfigurationMessage_ProProof(::PROTOBUF_NAMESPACE_ID::Arena* arena, +const ::SessionProtos::KeyPair& +ConfigurationMessage_ClosedGroup::_Internal::encryptionkeypair(const ConfigurationMessage_ClosedGroup* msg) { + return *msg->_impl_.encryptionkeypair_; +} +ConfigurationMessage_ClosedGroup::ConfigurationMessage_ClosedGroup(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.ConfigurationMessage.ProProof) + // @@protoc_insertion_point(arena_constructor:SessionProtos.ConfigurationMessage.ClosedGroup) } -ConfigurationMessage_ProProof::ConfigurationMessage_ProProof(const ConfigurationMessage_ProProof& from) +ConfigurationMessage_ClosedGroup::ConfigurationMessage_ClosedGroup(const ConfigurationMessage_ClosedGroup& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - ConfigurationMessage_ProProof* const _this = this; (void)_this; + ConfigurationMessage_ClosedGroup* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.genindexhash_){} - , decltype(_impl_.rotatingpublickey_){} - , decltype(_impl_.sig_){} - , decltype(_impl_.expiryunixts_){} - , decltype(_impl_.version_){}}; + , decltype(_impl_.members_){from._impl_.members_} + , decltype(_impl_.admins_){from._impl_.admins_} + , decltype(_impl_.publickey_){} + , decltype(_impl_.name_){} + , decltype(_impl_.encryptionkeypair_){nullptr} + , decltype(_impl_.expirationtimer_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.genindexhash_.InitDefault(); + _impl_.publickey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.genindexhash_.Set("", GetArenaForAllocation()); + _impl_.publickey_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_genindexhash()) { - _this->_impl_.genindexhash_.Set(from._internal_genindexhash(), + if (from._internal_has_publickey()) { + _this->_impl_.publickey_.Set(from._internal_publickey(), _this->GetArenaForAllocation()); } - _impl_.rotatingpublickey_.InitDefault(); + _impl_.name_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); + _impl_.name_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_rotatingpublickey()) { - _this->_impl_.rotatingpublickey_.Set(from._internal_rotatingpublickey(), + if (from._internal_has_name()) { + _this->_impl_.name_.Set(from._internal_name(), _this->GetArenaForAllocation()); } - _impl_.sig_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.sig_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_sig()) { - _this->_impl_.sig_.Set(from._internal_sig(), - _this->GetArenaForAllocation()); + if (from._internal_has_encryptionkeypair()) { + _this->_impl_.encryptionkeypair_ = new ::SessionProtos::KeyPair(*from._impl_.encryptionkeypair_); } - ::memcpy(&_impl_.expiryunixts_, &from._impl_.expiryunixts_, - static_cast(reinterpret_cast(&_impl_.version_) - - reinterpret_cast(&_impl_.expiryunixts_)) + sizeof(_impl_.version_)); - // @@protoc_insertion_point(copy_constructor:SessionProtos.ConfigurationMessage.ProProof) + _this->_impl_.expirationtimer_ = from._impl_.expirationtimer_; + // @@protoc_insertion_point(copy_constructor:SessionProtos.ConfigurationMessage.ClosedGroup) } -inline void ConfigurationMessage_ProProof::SharedCtor( +inline void ConfigurationMessage_ClosedGroup::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.genindexhash_){} - , decltype(_impl_.rotatingpublickey_){} - , decltype(_impl_.sig_){} - , decltype(_impl_.expiryunixts_){uint64_t{0u}} - , decltype(_impl_.version_){0u} + , decltype(_impl_.members_){arena} + , decltype(_impl_.admins_){arena} + , decltype(_impl_.publickey_){} + , decltype(_impl_.name_){} + , decltype(_impl_.encryptionkeypair_){nullptr} + , decltype(_impl_.expirationtimer_){0u} }; - _impl_.genindexhash_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.genindexhash_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.rotatingpublickey_.InitDefault(); + _impl_.publickey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); + _impl_.publickey_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.sig_.InitDefault(); + _impl_.name_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.sig_.Set("", GetArenaForAllocation()); + _impl_.name_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -ConfigurationMessage_ProProof::~ConfigurationMessage_ProProof() { - // @@protoc_insertion_point(destructor:SessionProtos.ConfigurationMessage.ProProof) +ConfigurationMessage_ClosedGroup::~ConfigurationMessage_ClosedGroup() { + // @@protoc_insertion_point(destructor:SessionProtos.ConfigurationMessage.ClosedGroup) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -8487,92 +8616,111 @@ ConfigurationMessage_ProProof::~ConfigurationMessage_ProProof() { SharedDtor(); } -inline void ConfigurationMessage_ProProof::SharedDtor() { +inline void ConfigurationMessage_ClosedGroup::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.genindexhash_.Destroy(); - _impl_.rotatingpublickey_.Destroy(); - _impl_.sig_.Destroy(); + _impl_.members_.~RepeatedPtrField(); + _impl_.admins_.~RepeatedPtrField(); + _impl_.publickey_.Destroy(); + _impl_.name_.Destroy(); + if (this != internal_default_instance()) delete _impl_.encryptionkeypair_; } -void ConfigurationMessage_ProProof::SetCachedSize(int size) const { +void ConfigurationMessage_ClosedGroup::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void ConfigurationMessage_ProProof::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.ConfigurationMessage.ProProof) +void ConfigurationMessage_ClosedGroup::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.ConfigurationMessage.ClosedGroup) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + _impl_.members_.Clear(); + _impl_.admins_.Clear(); cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x00000001u) { - _impl_.genindexhash_.ClearNonDefaultToEmpty(); + _impl_.publickey_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.rotatingpublickey_.ClearNonDefaultToEmpty(); + _impl_.name_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000004u) { - _impl_.sig_.ClearNonDefaultToEmpty(); + GOOGLE_DCHECK(_impl_.encryptionkeypair_ != nullptr); + _impl_.encryptionkeypair_->Clear(); } } - if (cached_has_bits & 0x00000018u) { - ::memset(&_impl_.expiryunixts_, 0, static_cast( - reinterpret_cast(&_impl_.version_) - - reinterpret_cast(&_impl_.expiryunixts_)) + sizeof(_impl_.version_)); - } + _impl_.expirationtimer_ = 0u; _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* ConfigurationMessage_ProProof::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* ConfigurationMessage_ClosedGroup::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required uint32 version = 1; + // optional bytes publicKey = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _Internal::set_has_version(&has_bits); - _impl_.version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_publickey(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // required bytes genIndexHash = 2; + // optional string name = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_genindexhash(); + auto str = _internal_mutable_name(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // required bytes rotatingPublicKey = 3; + // optional .SessionProtos.KeyPair encryptionKeyPair = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_rotatingpublickey(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + ptr = ctx->ParseMessage(_internal_mutable_encryptionkeypair(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // required uint64 expiryUnixTs = 4; + // repeated bytes members = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - _Internal::set_has_expiryunixts(&has_bits); - _impl_.expiryunixts_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr -= 1; + do { + ptr += 1; + auto str = _internal_add_members(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); } else goto handle_unusual; continue; - // required bytes sig = 5; + // repeated bytes admins = 5; case 5: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { - auto str = _internal_mutable_sig(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + ptr -= 1; + do { + ptr += 1; + auto str = _internal_add_admins(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr)); + } else + goto handle_unusual; + continue; + // optional uint32 expirationTimer = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { + _Internal::set_has_expirationtimer(&has_bits); + _impl_.expirationtimer_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; @@ -8601,121 +8749,111 @@ const char* ConfigurationMessage_ProProof::_InternalParse(const char* ptr, ::_pb #undef CHK_ } -uint8_t* ConfigurationMessage_ProProof::_InternalSerialize( +uint8_t* ConfigurationMessage_ClosedGroup::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ConfigurationMessage.ProProof) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ConfigurationMessage.ClosedGroup) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required uint32 version = 1; - if (cached_has_bits & 0x00000010u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_version(), target); - } - - // required bytes genIndexHash = 2; + // optional bytes publicKey = 1; if (cached_has_bits & 0x00000001u) { target = stream->WriteBytesMaybeAliased( - 2, this->_internal_genindexhash(), target); + 1, this->_internal_publickey(), target); } - // required bytes rotatingPublicKey = 3; + // optional string name = 2; if (cached_has_bits & 0x00000002u) { - target = stream->WriteBytesMaybeAliased( - 3, this->_internal_rotatingpublickey(), target); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_name(), target); } - // required uint64 expiryUnixTs = 4; - if (cached_has_bits & 0x00000008u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_expiryunixts(), target); + // optional .SessionProtos.KeyPair encryptionKeyPair = 3; + if (cached_has_bits & 0x00000004u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::encryptionkeypair(this), + _Internal::encryptionkeypair(this).GetCachedSize(), target, stream); } - // required bytes sig = 5; - if (cached_has_bits & 0x00000004u) { - target = stream->WriteBytesMaybeAliased( - 5, this->_internal_sig(), target); + // repeated bytes members = 4; + for (int i = 0, n = this->_internal_members_size(); i < n; i++) { + const auto& s = this->_internal_members(i); + target = stream->WriteBytes(4, s, target); + } + + // repeated bytes admins = 5; + for (int i = 0, n = this->_internal_admins_size(); i < n; i++) { + const auto& s = this->_internal_admins(i); + target = stream->WriteBytes(5, s, target); + } + + // optional uint32 expirationTimer = 6; + if (cached_has_bits & 0x00000008u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(6, this->_internal_expirationtimer(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ConfigurationMessage.ProProof) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ConfigurationMessage.ClosedGroup) return target; } -size_t ConfigurationMessage_ProProof::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.ConfigurationMessage.ProProof) +size_t ConfigurationMessage_ClosedGroup::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ConfigurationMessage.ClosedGroup) size_t total_size = 0; - if (_internal_has_genindexhash()) { - // required bytes genIndexHash = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_genindexhash()); - } - - if (_internal_has_rotatingpublickey()) { - // required bytes rotatingPublicKey = 3; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_rotatingpublickey()); - } - - if (_internal_has_sig()) { - // required bytes sig = 5; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_sig()); - } + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; - if (_internal_has_expiryunixts()) { - // required uint64 expiryUnixTs = 4; - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_expiryunixts()); + // repeated bytes members = 4; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.members_.size()); + for (int i = 0, n = _impl_.members_.size(); i < n; i++) { + total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + _impl_.members_.Get(i)); } - if (_internal_has_version()) { - // required uint32 version = 1; - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_version()); + // repeated bytes admins = 5; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.admins_.size()); + for (int i = 0, n = _impl_.admins_.size(); i < n; i++) { + total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + _impl_.admins_.Get(i)); } - return total_size; -} -size_t ConfigurationMessage_ProProof::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ConfigurationMessage.ProProof) - size_t total_size = 0; - - if (((_impl_._has_bits_[0] & 0x0000001f) ^ 0x0000001f) == 0) { // All required fields are present. - // required bytes genIndexHash = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_genindexhash()); - - // required bytes rotatingPublicKey = 3; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_rotatingpublickey()); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x0000000fu) { + // optional bytes publicKey = 1; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_publickey()); + } - // required bytes sig = 5; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_sig()); + // optional string name = 2; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); + } - // required uint64 expiryUnixTs = 4; - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_expiryunixts()); + // optional .SessionProtos.KeyPair encryptionKeyPair = 3; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.encryptionkeypair_); + } - // required uint32 version = 1; - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_version()); + // optional uint32 expirationTimer = 6; + if (cached_has_bits & 0x00000008u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_expirationtimer()); + } - } else { - total_size += RequiredFieldsByteSizeFallback(); } - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } @@ -8724,157 +8862,209 @@ size_t ConfigurationMessage_ProProof::ByteSizeLong() const { return total_size; } -void ConfigurationMessage_ProProof::CheckTypeAndMergeFrom( +void ConfigurationMessage_ClosedGroup::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void ConfigurationMessage_ProProof::MergeFrom(const ConfigurationMessage_ProProof& from) { - ConfigurationMessage_ProProof* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ConfigurationMessage.ProProof) +void ConfigurationMessage_ClosedGroup::MergeFrom(const ConfigurationMessage_ClosedGroup& from) { + ConfigurationMessage_ClosedGroup* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ConfigurationMessage.ClosedGroup) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; + _this->_impl_.members_.MergeFrom(from._impl_.members_); + _this->_impl_.admins_.MergeFrom(from._impl_.admins_); cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x0000001fu) { + if (cached_has_bits & 0x0000000fu) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_genindexhash(from._internal_genindexhash()); + _this->_internal_set_publickey(from._internal_publickey()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_rotatingpublickey(from._internal_rotatingpublickey()); + _this->_internal_set_name(from._internal_name()); } if (cached_has_bits & 0x00000004u) { - _this->_internal_set_sig(from._internal_sig()); + _this->_internal_mutable_encryptionkeypair()->::SessionProtos::KeyPair::MergeFrom( + from._internal_encryptionkeypair()); } if (cached_has_bits & 0x00000008u) { - _this->_impl_.expiryunixts_ = from._impl_.expiryunixts_; - } - if (cached_has_bits & 0x00000010u) { - _this->_impl_.version_ = from._impl_.version_; + _this->_impl_.expirationtimer_ = from._impl_.expirationtimer_; } _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void ConfigurationMessage_ProProof::CopyFrom(const ConfigurationMessage_ProProof& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ConfigurationMessage.ProProof) +void ConfigurationMessage_ClosedGroup::CopyFrom(const ConfigurationMessage_ClosedGroup& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ConfigurationMessage.ClosedGroup) if (&from == this) return; Clear(); MergeFrom(from); } -bool ConfigurationMessage_ProProof::IsInitialized() const { - if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; +bool ConfigurationMessage_ClosedGroup::IsInitialized() const { + if (_internal_has_encryptionkeypair()) { + if (!_impl_.encryptionkeypair_->IsInitialized()) return false; + } return true; } -void ConfigurationMessage_ProProof::InternalSwap(ConfigurationMessage_ProProof* other) { +void ConfigurationMessage_ClosedGroup::InternalSwap(ConfigurationMessage_ClosedGroup* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.members_.InternalSwap(&other->_impl_.members_); + _impl_.admins_.InternalSwap(&other->_impl_.admins_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.genindexhash_, lhs_arena, - &other->_impl_.genindexhash_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.rotatingpublickey_, lhs_arena, - &other->_impl_.rotatingpublickey_, rhs_arena + &_impl_.publickey_, lhs_arena, + &other->_impl_.publickey_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.sig_, lhs_arena, - &other->_impl_.sig_, rhs_arena + &_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(ConfigurationMessage_ProProof, _impl_.version_) - + sizeof(ConfigurationMessage_ProProof::_impl_.version_) - - PROTOBUF_FIELD_OFFSET(ConfigurationMessage_ProProof, _impl_.expiryunixts_)>( - reinterpret_cast(&_impl_.expiryunixts_), - reinterpret_cast(&other->_impl_.expiryunixts_)); + PROTOBUF_FIELD_OFFSET(ConfigurationMessage_ClosedGroup, _impl_.expirationtimer_) + + sizeof(ConfigurationMessage_ClosedGroup::_impl_.expirationtimer_) + - PROTOBUF_FIELD_OFFSET(ConfigurationMessage_ClosedGroup, _impl_.encryptionkeypair_)>( + reinterpret_cast(&_impl_.encryptionkeypair_), + reinterpret_cast(&other->_impl_.encryptionkeypair_)); } -std::string ConfigurationMessage_ProProof::GetTypeName() const { - return "SessionProtos.ConfigurationMessage.ProProof"; +std::string ConfigurationMessage_ClosedGroup::GetTypeName() const { + return "SessionProtos.ConfigurationMessage.ClosedGroup"; } // =================================================================== -class ConfigurationMessage_Pro::_Internal { +class ConfigurationMessage_Contact::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_rotatingprivkey(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_publickey(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_proof(HasBits* has_bits) { + static void set_has_name(HasBits* has_bits) { (*has_bits)[0] |= 2u; } + static void set_has_profilepicture(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static void set_has_profilekey(HasBits* has_bits) { + (*has_bits)[0] |= 8u; + } + static void set_has_isapproved(HasBits* has_bits) { + (*has_bits)[0] |= 16u; + } + static void set_has_isblocked(HasBits* has_bits) { + (*has_bits)[0] |= 32u; + } + static void set_has_didapproveme(HasBits* has_bits) { + (*has_bits)[0] |= 64u; + } static bool MissingRequiredFields(const HasBits& has_bits) { return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; } }; -ConfigurationMessage_Pro::ConfigurationMessage_Pro(::PROTOBUF_NAMESPACE_ID::Arena* arena, +ConfigurationMessage_Contact::ConfigurationMessage_Contact(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.ConfigurationMessage.Pro) + // @@protoc_insertion_point(arena_constructor:SessionProtos.ConfigurationMessage.Contact) } -ConfigurationMessage_Pro::ConfigurationMessage_Pro(const ConfigurationMessage_Pro& from) +ConfigurationMessage_Contact::ConfigurationMessage_Contact(const ConfigurationMessage_Contact& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - ConfigurationMessage_Pro* const _this = this; (void)_this; + ConfigurationMessage_Contact* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.rotatingprivkey_){} - , decltype(_impl_.proof_){}}; + , decltype(_impl_.publickey_){} + , decltype(_impl_.name_){} + , decltype(_impl_.profilepicture_){} + , decltype(_impl_.profilekey_){} + , decltype(_impl_.isapproved_){} + , decltype(_impl_.isblocked_){} + , decltype(_impl_.didapproveme_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.rotatingprivkey_.InitDefault(); + _impl_.publickey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); + _impl_.publickey_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_rotatingprivkey()) { - _this->_impl_.rotatingprivkey_.Set(from._internal_rotatingprivkey(), + if (from._internal_has_publickey()) { + _this->_impl_.publickey_.Set(from._internal_publickey(), _this->GetArenaForAllocation()); } - _impl_.proof_.InitDefault(); + _impl_.name_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.proof_.Set("", GetArenaForAllocation()); + _impl_.name_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_proof()) { - _this->_impl_.proof_.Set(from._internal_proof(), + if (from._internal_has_name()) { + _this->_impl_.name_.Set(from._internal_name(), + _this->GetArenaForAllocation()); + } + _impl_.profilepicture_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.profilepicture_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_profilepicture()) { + _this->_impl_.profilepicture_.Set(from._internal_profilepicture(), + _this->GetArenaForAllocation()); + } + _impl_.profilekey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.profilekey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_profilekey()) { + _this->_impl_.profilekey_.Set(from._internal_profilekey(), _this->GetArenaForAllocation()); } - // @@protoc_insertion_point(copy_constructor:SessionProtos.ConfigurationMessage.Pro) + ::memcpy(&_impl_.isapproved_, &from._impl_.isapproved_, + static_cast(reinterpret_cast(&_impl_.didapproveme_) - + reinterpret_cast(&_impl_.isapproved_)) + sizeof(_impl_.didapproveme_)); + // @@protoc_insertion_point(copy_constructor:SessionProtos.ConfigurationMessage.Contact) } -inline void ConfigurationMessage_Pro::SharedCtor( +inline void ConfigurationMessage_Contact::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.rotatingprivkey_){} - , decltype(_impl_.proof_){} + , decltype(_impl_.publickey_){} + , decltype(_impl_.name_){} + , decltype(_impl_.profilepicture_){} + , decltype(_impl_.profilekey_){} + , decltype(_impl_.isapproved_){false} + , decltype(_impl_.isblocked_){false} + , decltype(_impl_.didapproveme_){false} }; - _impl_.rotatingprivkey_.InitDefault(); + _impl_.publickey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); + _impl_.publickey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.profilepicture_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.profilepicture_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.proof_.InitDefault(); + _impl_.profilekey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.proof_.Set("", GetArenaForAllocation()); + _impl_.profilekey_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -ConfigurationMessage_Pro::~ConfigurationMessage_Pro() { - // @@protoc_insertion_point(destructor:SessionProtos.ConfigurationMessage.Pro) +ConfigurationMessage_Contact::~ConfigurationMessage_Contact() { + // @@protoc_insertion_point(destructor:SessionProtos.ConfigurationMessage.Contact) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -8882,60 +9072,116 @@ ConfigurationMessage_Pro::~ConfigurationMessage_Pro() { SharedDtor(); } -inline void ConfigurationMessage_Pro::SharedDtor() { +inline void ConfigurationMessage_Contact::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.rotatingprivkey_.Destroy(); - _impl_.proof_.Destroy(); + _impl_.publickey_.Destroy(); + _impl_.name_.Destroy(); + _impl_.profilepicture_.Destroy(); + _impl_.profilekey_.Destroy(); } -void ConfigurationMessage_Pro::SetCachedSize(int size) const { +void ConfigurationMessage_Contact::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void ConfigurationMessage_Pro::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.ConfigurationMessage.Pro) +void ConfigurationMessage_Contact::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.ConfigurationMessage.Contact) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x0000000fu) { if (cached_has_bits & 0x00000001u) { - _impl_.rotatingprivkey_.ClearNonDefaultToEmpty(); + _impl_.publickey_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.proof_.ClearNonDefaultToEmpty(); + _impl_.name_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000004u) { + _impl_.profilepicture_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000008u) { + _impl_.profilekey_.ClearNonDefaultToEmpty(); } } + ::memset(&_impl_.isapproved_, 0, static_cast( + reinterpret_cast(&_impl_.didapproveme_) - + reinterpret_cast(&_impl_.isapproved_)) + sizeof(_impl_.didapproveme_)); _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* ConfigurationMessage_Pro::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* ConfigurationMessage_Contact::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required bytes rotatingPrivKey = 1; + // required bytes publicKey = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_rotatingprivkey(); + auto str = _internal_mutable_publickey(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // required bytes proof = 2; + // required string name = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_proof(); + auto str = _internal_mutable_name(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional string profilePicture = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + auto str = _internal_mutable_profilepicture(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional bytes profileKey = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + auto str = _internal_mutable_profilekey(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; + // optional bool isApproved = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { + _Internal::set_has_isapproved(&has_bits); + _impl_.isapproved_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional bool isBlocked = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { + _Internal::set_has_isblocked(&has_bits); + _impl_.isblocked_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional bool didApproveMe = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { + _Internal::set_has_didapproveme(&has_bits); + _impl_.didapproveme_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; default: goto handle_unusual; } // switch @@ -8960,67 +9206,97 @@ const char* ConfigurationMessage_Pro::_InternalParse(const char* ptr, ::_pbi::Pa #undef CHK_ } -uint8_t* ConfigurationMessage_Pro::_InternalSerialize( +uint8_t* ConfigurationMessage_Contact::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ConfigurationMessage.Pro) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ConfigurationMessage.Contact) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required bytes rotatingPrivKey = 1; + // required bytes publicKey = 1; if (cached_has_bits & 0x00000001u) { target = stream->WriteBytesMaybeAliased( - 1, this->_internal_rotatingprivkey(), target); + 1, this->_internal_publickey(), target); } - // required bytes proof = 2; + // required string name = 2; if (cached_has_bits & 0x00000002u) { + target = stream->WriteStringMaybeAliased( + 2, this->_internal_name(), target); + } + + // optional string profilePicture = 3; + if (cached_has_bits & 0x00000004u) { + target = stream->WriteStringMaybeAliased( + 3, this->_internal_profilepicture(), target); + } + + // optional bytes profileKey = 4; + if (cached_has_bits & 0x00000008u) { target = stream->WriteBytesMaybeAliased( - 2, this->_internal_proof(), target); + 4, this->_internal_profilekey(), target); + } + + // optional bool isApproved = 5; + if (cached_has_bits & 0x00000010u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_isapproved(), target); + } + + // optional bool isBlocked = 6; + if (cached_has_bits & 0x00000020u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(6, this->_internal_isblocked(), target); + } + + // optional bool didApproveMe = 7; + if (cached_has_bits & 0x00000040u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(7, this->_internal_didapproveme(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ConfigurationMessage.Pro) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ConfigurationMessage.Contact) return target; } -size_t ConfigurationMessage_Pro::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.ConfigurationMessage.Pro) +size_t ConfigurationMessage_Contact::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.ConfigurationMessage.Contact) size_t total_size = 0; - if (_internal_has_rotatingprivkey()) { - // required bytes rotatingPrivKey = 1; + if (_internal_has_publickey()) { + // required bytes publicKey = 1; total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_rotatingprivkey()); + this->_internal_publickey()); } - if (_internal_has_proof()) { - // required bytes proof = 2; + if (_internal_has_name()) { + // required string name = 2; total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_proof()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); } return total_size; } -size_t ConfigurationMessage_Pro::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ConfigurationMessage.Pro) +size_t ConfigurationMessage_Contact::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ConfigurationMessage.Contact) size_t total_size = 0; if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. - // required bytes rotatingPrivKey = 1; + // required bytes publicKey = 1; total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_rotatingprivkey()); + this->_internal_publickey()); - // required bytes proof = 2; + // required string name = 2; total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_proof()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); } else { total_size += RequiredFieldsByteSizeFallback(); @@ -9029,6 +9305,38 @@ size_t ConfigurationMessage_Pro::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x0000007cu) { + // optional string profilePicture = 3; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_profilepicture()); + } + + // optional bytes profileKey = 4; + if (cached_has_bits & 0x00000008u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_profilekey()); + } + + // optional bool isApproved = 5; + if (cached_has_bits & 0x00000010u) { + total_size += 1 + 1; + } + + // optional bool isBlocked = 6; + if (cached_has_bits & 0x00000020u) { + total_size += 1 + 1; + } + + // optional bool didApproveMe = 7; + if (cached_has_bits & 0x00000040u) { + total_size += 1 + 1; + } + + } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } @@ -9037,61 +9345,91 @@ size_t ConfigurationMessage_Pro::ByteSizeLong() const { return total_size; } -void ConfigurationMessage_Pro::CheckTypeAndMergeFrom( +void ConfigurationMessage_Contact::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void ConfigurationMessage_Pro::MergeFrom(const ConfigurationMessage_Pro& from) { - ConfigurationMessage_Pro* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ConfigurationMessage.Pro) +void ConfigurationMessage_Contact::MergeFrom(const ConfigurationMessage_Contact& from) { + ConfigurationMessage_Contact* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ConfigurationMessage.Contact) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x0000007fu) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_rotatingprivkey(from._internal_rotatingprivkey()); + _this->_internal_set_publickey(from._internal_publickey()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_proof(from._internal_proof()); + _this->_internal_set_name(from._internal_name()); + } + if (cached_has_bits & 0x00000004u) { + _this->_internal_set_profilepicture(from._internal_profilepicture()); + } + if (cached_has_bits & 0x00000008u) { + _this->_internal_set_profilekey(from._internal_profilekey()); + } + if (cached_has_bits & 0x00000010u) { + _this->_impl_.isapproved_ = from._impl_.isapproved_; + } + if (cached_has_bits & 0x00000020u) { + _this->_impl_.isblocked_ = from._impl_.isblocked_; + } + if (cached_has_bits & 0x00000040u) { + _this->_impl_.didapproveme_ = from._impl_.didapproveme_; } + _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void ConfigurationMessage_Pro::CopyFrom(const ConfigurationMessage_Pro& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ConfigurationMessage.Pro) +void ConfigurationMessage_Contact::CopyFrom(const ConfigurationMessage_Contact& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ConfigurationMessage.Contact) if (&from == this) return; Clear(); MergeFrom(from); } -bool ConfigurationMessage_Pro::IsInitialized() const { +bool ConfigurationMessage_Contact::IsInitialized() const { if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; return true; } -void ConfigurationMessage_Pro::InternalSwap(ConfigurationMessage_Pro* other) { +void ConfigurationMessage_Contact::InternalSwap(ConfigurationMessage_Contact* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.rotatingprivkey_, lhs_arena, - &other->_impl_.rotatingprivkey_, rhs_arena + &_impl_.publickey_, lhs_arena, + &other->_impl_.publickey_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.profilepicture_, lhs_arena, + &other->_impl_.profilepicture_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.proof_, lhs_arena, - &other->_impl_.proof_, rhs_arena + &_impl_.profilekey_, lhs_arena, + &other->_impl_.profilekey_, rhs_arena ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(ConfigurationMessage_Contact, _impl_.didapproveme_) + + sizeof(ConfigurationMessage_Contact::_impl_.didapproveme_) + - PROTOBUF_FIELD_OFFSET(ConfigurationMessage_Contact, _impl_.isapproved_)>( + reinterpret_cast(&_impl_.isapproved_), + reinterpret_cast(&other->_impl_.isapproved_)); } -std::string ConfigurationMessage_Pro::GetTypeName() const { - return "SessionProtos.ConfigurationMessage.Pro"; +std::string ConfigurationMessage_Contact::GetTypeName() const { + return "SessionProtos.ConfigurationMessage.Contact"; } @@ -9109,15 +9447,15 @@ class ConfigurationMessage::_Internal { static void set_has_profilekey(HasBits* has_bits) { (*has_bits)[0] |= 4u; } - static const ::SessionProtos::ConfigurationMessage_Pro& pro(const ConfigurationMessage* msg); - static void set_has_pro(HasBits* has_bits) { + static const ::SessionProtos::ProConfig& proconfig(const ConfigurationMessage* msg); + static void set_has_proconfig(HasBits* has_bits) { (*has_bits)[0] |= 8u; } }; -const ::SessionProtos::ConfigurationMessage_Pro& -ConfigurationMessage::_Internal::pro(const ConfigurationMessage* msg) { - return *msg->_impl_.pro_; +const ::SessionProtos::ProConfig& +ConfigurationMessage::_Internal::proconfig(const ConfigurationMessage* msg) { + return *msg->_impl_.proconfig_; } ConfigurationMessage::ConfigurationMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) @@ -9137,7 +9475,7 @@ ConfigurationMessage::ConfigurationMessage(const ConfigurationMessage& from) , decltype(_impl_.displayname_){} , decltype(_impl_.profilepicture_){} , decltype(_impl_.profilekey_){} - , decltype(_impl_.pro_){nullptr}}; + , decltype(_impl_.proconfig_){nullptr}}; _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.displayname_.InitDefault(); @@ -9164,8 +9502,8 @@ ConfigurationMessage::ConfigurationMessage(const ConfigurationMessage& from) _this->_impl_.profilekey_.Set(from._internal_profilekey(), _this->GetArenaForAllocation()); } - if (from._internal_has_pro()) { - _this->_impl_.pro_ = new ::SessionProtos::ConfigurationMessage_Pro(*from._impl_.pro_); + if (from._internal_has_proconfig()) { + _this->_impl_.proconfig_ = new ::SessionProtos::ProConfig(*from._impl_.proconfig_); } // @@protoc_insertion_point(copy_constructor:SessionProtos.ConfigurationMessage) } @@ -9183,7 +9521,7 @@ inline void ConfigurationMessage::SharedCtor( , decltype(_impl_.displayname_){} , decltype(_impl_.profilepicture_){} , decltype(_impl_.profilekey_){} - , decltype(_impl_.pro_){nullptr} + , decltype(_impl_.proconfig_){nullptr} }; _impl_.displayname_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -9216,7 +9554,7 @@ inline void ConfigurationMessage::SharedDtor() { _impl_.displayname_.Destroy(); _impl_.profilepicture_.Destroy(); _impl_.profilekey_.Destroy(); - if (this != internal_default_instance()) delete _impl_.pro_; + if (this != internal_default_instance()) delete _impl_.proconfig_; } void ConfigurationMessage::SetCachedSize(int size) const { @@ -9244,8 +9582,8 @@ void ConfigurationMessage::Clear() { _impl_.profilekey_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000008u) { - GOOGLE_DCHECK(_impl_.pro_ != nullptr); - _impl_.pro_->Clear(); + GOOGLE_DCHECK(_impl_.proconfig_ != nullptr); + _impl_.proconfig_->Clear(); } } _impl_._has_bits_.Clear(); @@ -9326,10 +9664,10 @@ const char* ConfigurationMessage::_InternalParse(const char* ptr, ::_pbi::ParseC } else goto handle_unusual; continue; - // optional .SessionProtos.ConfigurationMessage.Pro pro = 7; + // optional .SessionProtos.ProConfig proConfig = 7; case 7: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { - ptr = ctx->ParseMessage(_internal_mutable_pro(), ptr); + ptr = ctx->ParseMessage(_internal_mutable_proconfig(), ptr); CHK_(ptr); } else goto handle_unusual; @@ -9405,11 +9743,11 @@ uint8_t* ConfigurationMessage::_InternalSerialize( InternalWriteMessage(6, repfield, repfield.GetCachedSize(), target, stream); } - // optional .SessionProtos.ConfigurationMessage.Pro pro = 7; + // optional .SessionProtos.ProConfig proConfig = 7; if (cached_has_bits & 0x00000008u) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(7, _Internal::pro(this), - _Internal::pro(this).GetCachedSize(), target, stream); + InternalWriteMessage(7, _Internal::proconfig(this), + _Internal::proconfig(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -9473,11 +9811,11 @@ size_t ConfigurationMessage::ByteSizeLong() const { this->_internal_profilekey()); } - // optional .SessionProtos.ConfigurationMessage.Pro pro = 7; + // optional .SessionProtos.ProConfig proConfig = 7; if (cached_has_bits & 0x00000008u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.pro_); + *_impl_.proconfig_); } } @@ -9517,8 +9855,8 @@ void ConfigurationMessage::MergeFrom(const ConfigurationMessage& from) { _this->_internal_set_profilekey(from._internal_profilekey()); } if (cached_has_bits & 0x00000008u) { - _this->_internal_mutable_pro()->::SessionProtos::ConfigurationMessage_Pro::MergeFrom( - from._internal_pro()); + _this->_internal_mutable_proconfig()->::SessionProtos::ProConfig::MergeFrom( + from._internal_proconfig()); } } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); @@ -9536,8 +9874,8 @@ bool ConfigurationMessage::IsInitialized() const { return false; if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.contacts_)) return false; - if (_internal_has_pro()) { - if (!_impl_.pro_->IsInitialized()) return false; + if (_internal_has_proconfig()) { + if (!_impl_.proconfig_->IsInitialized()) return false; } return true; } @@ -9563,7 +9901,7 @@ void ConfigurationMessage::InternalSwap(ConfigurationMessage* other) { &_impl_.profilekey_, lhs_arena, &other->_impl_.profilekey_, rhs_arena ); - swap(_impl_.pro_, other->_impl_.pro_); + swap(_impl_.proconfig_, other->_impl_.proconfig_); } std::string ConfigurationMessage::GetTypeName() const { @@ -10829,6 +11167,18 @@ template<> PROTOBUF_NOINLINE ::SessionProtos::MessageRequestResponse* Arena::CreateMaybeMessage< ::SessionProtos::MessageRequestResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::SessionProtos::MessageRequestResponse >(arena); } +template<> PROTOBUF_NOINLINE ::SessionProtos::ProProof* +Arena::CreateMaybeMessage< ::SessionProtos::ProProof >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::ProProof >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::ProConfig* +Arena::CreateMaybeMessage< ::SessionProtos::ProConfig >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::ProConfig >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::ProMessageConfig* +Arena::CreateMaybeMessage< ::SessionProtos::ProMessageConfig >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::ProMessageConfig >(arena); +} template<> PROTOBUF_NOINLINE ::SessionProtos::Content* Arena::CreateMaybeMessage< ::SessionProtos::Content >(Arena* arena) { return Arena::CreateMessageInternal< ::SessionProtos::Content >(arena); @@ -10889,14 +11239,6 @@ template<> PROTOBUF_NOINLINE ::SessionProtos::ConfigurationMessage_Contact* Arena::CreateMaybeMessage< ::SessionProtos::ConfigurationMessage_Contact >(Arena* arena) { return Arena::CreateMessageInternal< ::SessionProtos::ConfigurationMessage_Contact >(arena); } -template<> PROTOBUF_NOINLINE ::SessionProtos::ConfigurationMessage_ProProof* -Arena::CreateMaybeMessage< ::SessionProtos::ConfigurationMessage_ProProof >(Arena* arena) { - return Arena::CreateMessageInternal< ::SessionProtos::ConfigurationMessage_ProProof >(arena); -} -template<> PROTOBUF_NOINLINE ::SessionProtos::ConfigurationMessage_Pro* -Arena::CreateMaybeMessage< ::SessionProtos::ConfigurationMessage_Pro >(Arena* arena) { - return Arena::CreateMessageInternal< ::SessionProtos::ConfigurationMessage_Pro >(arena); -} template<> PROTOBUF_NOINLINE ::SessionProtos::ConfigurationMessage* Arena::CreateMaybeMessage< ::SessionProtos::ConfigurationMessage >(Arena* arena) { return Arena::CreateMessageInternal< ::SessionProtos::ConfigurationMessage >(arena); diff --git a/proto/SessionProtos.pb.h b/proto/SessionProtos.pb.h index e05be469..ee1c8b5e 100644 --- a/proto/SessionProtos.pb.h +++ b/proto/SessionProtos.pb.h @@ -58,12 +58,6 @@ extern ConfigurationMessage_ClosedGroupDefaultTypeInternal _ConfigurationMessage class ConfigurationMessage_Contact; struct ConfigurationMessage_ContactDefaultTypeInternal; extern ConfigurationMessage_ContactDefaultTypeInternal _ConfigurationMessage_Contact_default_instance_; -class ConfigurationMessage_Pro; -struct ConfigurationMessage_ProDefaultTypeInternal; -extern ConfigurationMessage_ProDefaultTypeInternal _ConfigurationMessage_Pro_default_instance_; -class ConfigurationMessage_ProProof; -struct ConfigurationMessage_ProProofDefaultTypeInternal; -extern ConfigurationMessage_ProProofDefaultTypeInternal _ConfigurationMessage_ProProof_default_instance_; class Content; struct ContentDefaultTypeInternal; extern ContentDefaultTypeInternal _Content_default_instance_; @@ -106,6 +100,15 @@ extern LokiProfileDefaultTypeInternal _LokiProfile_default_instance_; class MessageRequestResponse; struct MessageRequestResponseDefaultTypeInternal; extern MessageRequestResponseDefaultTypeInternal _MessageRequestResponse_default_instance_; +class ProConfig; +struct ProConfigDefaultTypeInternal; +extern ProConfigDefaultTypeInternal _ProConfig_default_instance_; +class ProMessageConfig; +struct ProMessageConfigDefaultTypeInternal; +extern ProMessageConfigDefaultTypeInternal _ProMessageConfig_default_instance_; +class ProProof; +struct ProProofDefaultTypeInternal; +extern ProProofDefaultTypeInternal _ProProof_default_instance_; class ReceiptMessage; struct ReceiptMessageDefaultTypeInternal; extern ReceiptMessageDefaultTypeInternal _ReceiptMessage_default_instance_; @@ -125,8 +128,6 @@ template<> ::SessionProtos::CallMessage* Arena::CreateMaybeMessage<::SessionProt template<> ::SessionProtos::ConfigurationMessage* Arena::CreateMaybeMessage<::SessionProtos::ConfigurationMessage>(Arena*); template<> ::SessionProtos::ConfigurationMessage_ClosedGroup* Arena::CreateMaybeMessage<::SessionProtos::ConfigurationMessage_ClosedGroup>(Arena*); template<> ::SessionProtos::ConfigurationMessage_Contact* Arena::CreateMaybeMessage<::SessionProtos::ConfigurationMessage_Contact>(Arena*); -template<> ::SessionProtos::ConfigurationMessage_Pro* Arena::CreateMaybeMessage<::SessionProtos::ConfigurationMessage_Pro>(Arena*); -template<> ::SessionProtos::ConfigurationMessage_ProProof* Arena::CreateMaybeMessage<::SessionProtos::ConfigurationMessage_ProProof>(Arena*); template<> ::SessionProtos::Content* Arena::CreateMaybeMessage<::SessionProtos::Content>(Arena*); template<> ::SessionProtos::DataExtractionNotification* Arena::CreateMaybeMessage<::SessionProtos::DataExtractionNotification>(Arena*); template<> ::SessionProtos::DataMessage* Arena::CreateMaybeMessage<::SessionProtos::DataMessage>(Arena*); @@ -141,6 +142,9 @@ template<> ::SessionProtos::Envelope* Arena::CreateMaybeMessage<::SessionProtos: template<> ::SessionProtos::KeyPair* Arena::CreateMaybeMessage<::SessionProtos::KeyPair>(Arena*); template<> ::SessionProtos::LokiProfile* Arena::CreateMaybeMessage<::SessionProtos::LokiProfile>(Arena*); template<> ::SessionProtos::MessageRequestResponse* Arena::CreateMaybeMessage<::SessionProtos::MessageRequestResponse>(Arena*); +template<> ::SessionProtos::ProConfig* Arena::CreateMaybeMessage<::SessionProtos::ProConfig>(Arena*); +template<> ::SessionProtos::ProMessageConfig* Arena::CreateMaybeMessage<::SessionProtos::ProMessageConfig>(Arena*); +template<> ::SessionProtos::ProProof* Arena::CreateMaybeMessage<::SessionProtos::ProProof>(Arena*); template<> ::SessionProtos::ReceiptMessage* Arena::CreateMaybeMessage<::SessionProtos::ReceiptMessage>(Arena*); template<> ::SessionProtos::SharedConfigMessage* Arena::CreateMaybeMessage<::SessionProtos::SharedConfigMessage>(Arena*); template<> ::SessionProtos::TypingMessage* Arena::CreateMaybeMessage<::SessionProtos::TypingMessage>(Arena*); @@ -1156,24 +1160,24 @@ class MessageRequestResponse final : }; // ------------------------------------------------------------------- -class Content final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.Content) */ { +class ProProof final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ProProof) */ { public: - inline Content() : Content(nullptr) {} - ~Content() override; - explicit PROTOBUF_CONSTEXPR Content(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline ProProof() : ProProof(nullptr) {} + ~ProProof() override; + explicit PROTOBUF_CONSTEXPR ProProof(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - Content(const Content& from); - Content(Content&& from) noexcept - : Content() { + ProProof(const ProProof& from); + ProProof(ProProof&& from) noexcept + : ProProof() { *this = ::std::move(from); } - inline Content& operator=(const Content& from) { + inline ProProof& operator=(const ProProof& from) { CopyFrom(from); return *this; } - inline Content& operator=(Content&& from) noexcept { + inline ProProof& operator=(ProProof&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1194,20 +1198,20 @@ class Content final : return _internal_metadata_.mutable_unknown_fields(); } - static const Content& default_instance() { + static const ProProof& default_instance() { return *internal_default_instance(); } - static inline const Content* internal_default_instance() { - return reinterpret_cast( - &_Content_default_instance_); + static inline const ProProof* internal_default_instance() { + return reinterpret_cast( + &_ProProof_default_instance_); } static constexpr int kIndexInFileMessages = 4; - friend void swap(Content& a, Content& b) { + friend void swap(ProProof& a, ProProof& b) { a.Swap(&b); } - inline void Swap(Content* other) { + inline void Swap(ProProof* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1220,7 +1224,7 @@ class Content final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(Content* other) { + void UnsafeArenaSwap(ProProof* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1228,12 +1232,12 @@ class Content final : // implements Message ---------------------------------------------- - Content* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + ProProof* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const Content& from); - void MergeFrom(const Content& from); + void CopyFrom(const ProProof& from); + void MergeFrom(const ProProof& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1247,15 +1251,15 @@ class Content final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(Content* other); + void InternalSwap(ProProof* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.Content"; + return "SessionProtos.ProProof"; } protected: - explicit Content(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit ProProof(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -1266,221 +1270,134 @@ class Content final : // accessors ------------------------------------------------------- enum : int { - kDataMessageFieldNumber = 1, - kCallMessageFieldNumber = 3, - kReceiptMessageFieldNumber = 5, - kTypingMessageFieldNumber = 6, - kConfigurationMessageFieldNumber = 7, - kDataExtractionNotificationFieldNumber = 8, - kUnsendRequestFieldNumber = 9, - kMessageRequestResponseFieldNumber = 10, - kSharedConfigMessageFieldNumber = 11, + kGenIndexHashFieldNumber = 2, + kRotatingPublicKeyFieldNumber = 3, + kSigFieldNumber = 5, + kExpiryUnixTsFieldNumber = 4, + kVersionFieldNumber = 1, }; - // optional .SessionProtos.DataMessage dataMessage = 1; - bool has_datamessage() const; - private: - bool _internal_has_datamessage() const; - public: - void clear_datamessage(); - const ::SessionProtos::DataMessage& datamessage() const; - PROTOBUF_NODISCARD ::SessionProtos::DataMessage* release_datamessage(); - ::SessionProtos::DataMessage* mutable_datamessage(); - void set_allocated_datamessage(::SessionProtos::DataMessage* datamessage); - private: - const ::SessionProtos::DataMessage& _internal_datamessage() const; - ::SessionProtos::DataMessage* _internal_mutable_datamessage(); - public: - void unsafe_arena_set_allocated_datamessage( - ::SessionProtos::DataMessage* datamessage); - ::SessionProtos::DataMessage* unsafe_arena_release_datamessage(); - - // optional .SessionProtos.CallMessage callMessage = 3; - bool has_callmessage() const; - private: - bool _internal_has_callmessage() const; - public: - void clear_callmessage(); - const ::SessionProtos::CallMessage& callmessage() const; - PROTOBUF_NODISCARD ::SessionProtos::CallMessage* release_callmessage(); - ::SessionProtos::CallMessage* mutable_callmessage(); - void set_allocated_callmessage(::SessionProtos::CallMessage* callmessage); - private: - const ::SessionProtos::CallMessage& _internal_callmessage() const; - ::SessionProtos::CallMessage* _internal_mutable_callmessage(); - public: - void unsafe_arena_set_allocated_callmessage( - ::SessionProtos::CallMessage* callmessage); - ::SessionProtos::CallMessage* unsafe_arena_release_callmessage(); - - // optional .SessionProtos.ReceiptMessage receiptMessage = 5; - bool has_receiptmessage() const; - private: - bool _internal_has_receiptmessage() const; - public: - void clear_receiptmessage(); - const ::SessionProtos::ReceiptMessage& receiptmessage() const; - PROTOBUF_NODISCARD ::SessionProtos::ReceiptMessage* release_receiptmessage(); - ::SessionProtos::ReceiptMessage* mutable_receiptmessage(); - void set_allocated_receiptmessage(::SessionProtos::ReceiptMessage* receiptmessage); - private: - const ::SessionProtos::ReceiptMessage& _internal_receiptmessage() const; - ::SessionProtos::ReceiptMessage* _internal_mutable_receiptmessage(); - public: - void unsafe_arena_set_allocated_receiptmessage( - ::SessionProtos::ReceiptMessage* receiptmessage); - ::SessionProtos::ReceiptMessage* unsafe_arena_release_receiptmessage(); - - // optional .SessionProtos.TypingMessage typingMessage = 6; - bool has_typingmessage() const; - private: - bool _internal_has_typingmessage() const; - public: - void clear_typingmessage(); - const ::SessionProtos::TypingMessage& typingmessage() const; - PROTOBUF_NODISCARD ::SessionProtos::TypingMessage* release_typingmessage(); - ::SessionProtos::TypingMessage* mutable_typingmessage(); - void set_allocated_typingmessage(::SessionProtos::TypingMessage* typingmessage); - private: - const ::SessionProtos::TypingMessage& _internal_typingmessage() const; - ::SessionProtos::TypingMessage* _internal_mutable_typingmessage(); - public: - void unsafe_arena_set_allocated_typingmessage( - ::SessionProtos::TypingMessage* typingmessage); - ::SessionProtos::TypingMessage* unsafe_arena_release_typingmessage(); - - // optional .SessionProtos.ConfigurationMessage configurationMessage = 7; - bool has_configurationmessage() const; + // required bytes genIndexHash = 2; + bool has_genindexhash() const; private: - bool _internal_has_configurationmessage() const; + bool _internal_has_genindexhash() const; public: - void clear_configurationmessage(); - const ::SessionProtos::ConfigurationMessage& configurationmessage() const; - PROTOBUF_NODISCARD ::SessionProtos::ConfigurationMessage* release_configurationmessage(); - ::SessionProtos::ConfigurationMessage* mutable_configurationmessage(); - void set_allocated_configurationmessage(::SessionProtos::ConfigurationMessage* configurationmessage); + void clear_genindexhash(); + const std::string& genindexhash() const; + template + void set_genindexhash(ArgT0&& arg0, ArgT... args); + std::string* mutable_genindexhash(); + PROTOBUF_NODISCARD std::string* release_genindexhash(); + void set_allocated_genindexhash(std::string* genindexhash); private: - const ::SessionProtos::ConfigurationMessage& _internal_configurationmessage() const; - ::SessionProtos::ConfigurationMessage* _internal_mutable_configurationmessage(); + const std::string& _internal_genindexhash() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_genindexhash(const std::string& value); + std::string* _internal_mutable_genindexhash(); public: - void unsafe_arena_set_allocated_configurationmessage( - ::SessionProtos::ConfigurationMessage* configurationmessage); - ::SessionProtos::ConfigurationMessage* unsafe_arena_release_configurationmessage(); - // optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; - bool has_dataextractionnotification() const; + // required bytes rotatingPublicKey = 3; + bool has_rotatingpublickey() const; private: - bool _internal_has_dataextractionnotification() const; + bool _internal_has_rotatingpublickey() const; public: - void clear_dataextractionnotification(); - const ::SessionProtos::DataExtractionNotification& dataextractionnotification() const; - PROTOBUF_NODISCARD ::SessionProtos::DataExtractionNotification* release_dataextractionnotification(); - ::SessionProtos::DataExtractionNotification* mutable_dataextractionnotification(); - void set_allocated_dataextractionnotification(::SessionProtos::DataExtractionNotification* dataextractionnotification); + void clear_rotatingpublickey(); + const std::string& rotatingpublickey() const; + template + void set_rotatingpublickey(ArgT0&& arg0, ArgT... args); + std::string* mutable_rotatingpublickey(); + PROTOBUF_NODISCARD std::string* release_rotatingpublickey(); + void set_allocated_rotatingpublickey(std::string* rotatingpublickey); private: - const ::SessionProtos::DataExtractionNotification& _internal_dataextractionnotification() const; - ::SessionProtos::DataExtractionNotification* _internal_mutable_dataextractionnotification(); + const std::string& _internal_rotatingpublickey() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_rotatingpublickey(const std::string& value); + std::string* _internal_mutable_rotatingpublickey(); public: - void unsafe_arena_set_allocated_dataextractionnotification( - ::SessionProtos::DataExtractionNotification* dataextractionnotification); - ::SessionProtos::DataExtractionNotification* unsafe_arena_release_dataextractionnotification(); - // optional .SessionProtos.UnsendRequest unsendRequest = 9; - bool has_unsendrequest() const; + // required bytes sig = 5; + bool has_sig() const; private: - bool _internal_has_unsendrequest() const; + bool _internal_has_sig() const; public: - void clear_unsendrequest(); - const ::SessionProtos::UnsendRequest& unsendrequest() const; - PROTOBUF_NODISCARD ::SessionProtos::UnsendRequest* release_unsendrequest(); - ::SessionProtos::UnsendRequest* mutable_unsendrequest(); - void set_allocated_unsendrequest(::SessionProtos::UnsendRequest* unsendrequest); + void clear_sig(); + const std::string& sig() const; + template + void set_sig(ArgT0&& arg0, ArgT... args); + std::string* mutable_sig(); + PROTOBUF_NODISCARD std::string* release_sig(); + void set_allocated_sig(std::string* sig); private: - const ::SessionProtos::UnsendRequest& _internal_unsendrequest() const; - ::SessionProtos::UnsendRequest* _internal_mutable_unsendrequest(); + const std::string& _internal_sig() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_sig(const std::string& value); + std::string* _internal_mutable_sig(); public: - void unsafe_arena_set_allocated_unsendrequest( - ::SessionProtos::UnsendRequest* unsendrequest); - ::SessionProtos::UnsendRequest* unsafe_arena_release_unsendrequest(); - // optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; - bool has_messagerequestresponse() const; + // required uint64 expiryUnixTs = 4; + bool has_expiryunixts() const; private: - bool _internal_has_messagerequestresponse() const; + bool _internal_has_expiryunixts() const; public: - void clear_messagerequestresponse(); - const ::SessionProtos::MessageRequestResponse& messagerequestresponse() const; - PROTOBUF_NODISCARD ::SessionProtos::MessageRequestResponse* release_messagerequestresponse(); - ::SessionProtos::MessageRequestResponse* mutable_messagerequestresponse(); - void set_allocated_messagerequestresponse(::SessionProtos::MessageRequestResponse* messagerequestresponse); + void clear_expiryunixts(); + uint64_t expiryunixts() const; + void set_expiryunixts(uint64_t value); private: - const ::SessionProtos::MessageRequestResponse& _internal_messagerequestresponse() const; - ::SessionProtos::MessageRequestResponse* _internal_mutable_messagerequestresponse(); + uint64_t _internal_expiryunixts() const; + void _internal_set_expiryunixts(uint64_t value); public: - void unsafe_arena_set_allocated_messagerequestresponse( - ::SessionProtos::MessageRequestResponse* messagerequestresponse); - ::SessionProtos::MessageRequestResponse* unsafe_arena_release_messagerequestresponse(); - // optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; - bool has_sharedconfigmessage() const; + // required uint32 version = 1; + bool has_version() const; private: - bool _internal_has_sharedconfigmessage() const; + bool _internal_has_version() const; public: - void clear_sharedconfigmessage(); - const ::SessionProtos::SharedConfigMessage& sharedconfigmessage() const; - PROTOBUF_NODISCARD ::SessionProtos::SharedConfigMessage* release_sharedconfigmessage(); - ::SessionProtos::SharedConfigMessage* mutable_sharedconfigmessage(); - void set_allocated_sharedconfigmessage(::SessionProtos::SharedConfigMessage* sharedconfigmessage); + void clear_version(); + uint32_t version() const; + void set_version(uint32_t value); private: - const ::SessionProtos::SharedConfigMessage& _internal_sharedconfigmessage() const; - ::SessionProtos::SharedConfigMessage* _internal_mutable_sharedconfigmessage(); + uint32_t _internal_version() const; + void _internal_set_version(uint32_t value); public: - void unsafe_arena_set_allocated_sharedconfigmessage( - ::SessionProtos::SharedConfigMessage* sharedconfigmessage); - ::SessionProtos::SharedConfigMessage* unsafe_arena_release_sharedconfigmessage(); - // @@protoc_insertion_point(class_scope:SessionProtos.Content) + // @@protoc_insertion_point(class_scope:SessionProtos.ProProof) private: class _Internal; + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::SessionProtos::DataMessage* datamessage_; - ::SessionProtos::CallMessage* callmessage_; - ::SessionProtos::ReceiptMessage* receiptmessage_; - ::SessionProtos::TypingMessage* typingmessage_; - ::SessionProtos::ConfigurationMessage* configurationmessage_; - ::SessionProtos::DataExtractionNotification* dataextractionnotification_; - ::SessionProtos::UnsendRequest* unsendrequest_; - ::SessionProtos::MessageRequestResponse* messagerequestresponse_; - ::SessionProtos::SharedConfigMessage* sharedconfigmessage_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr genindexhash_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr rotatingpublickey_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr sig_; + uint64_t expiryunixts_; + uint32_t version_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class CallMessage final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.CallMessage) */ { +class ProConfig final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ProConfig) */ { public: - inline CallMessage() : CallMessage(nullptr) {} - ~CallMessage() override; - explicit PROTOBUF_CONSTEXPR CallMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline ProConfig() : ProConfig(nullptr) {} + ~ProConfig() override; + explicit PROTOBUF_CONSTEXPR ProConfig(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - CallMessage(const CallMessage& from); - CallMessage(CallMessage&& from) noexcept - : CallMessage() { + ProConfig(const ProConfig& from); + ProConfig(ProConfig&& from) noexcept + : ProConfig() { *this = ::std::move(from); } - inline CallMessage& operator=(const CallMessage& from) { + inline ProConfig& operator=(const ProConfig& from) { CopyFrom(from); return *this; } - inline CallMessage& operator=(CallMessage&& from) noexcept { + inline ProConfig& operator=(ProConfig&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1501,20 +1418,20 @@ class CallMessage final : return _internal_metadata_.mutable_unknown_fields(); } - static const CallMessage& default_instance() { + static const ProConfig& default_instance() { return *internal_default_instance(); } - static inline const CallMessage* internal_default_instance() { - return reinterpret_cast( - &_CallMessage_default_instance_); + static inline const ProConfig* internal_default_instance() { + return reinterpret_cast( + &_ProConfig_default_instance_); } static constexpr int kIndexInFileMessages = 5; - friend void swap(CallMessage& a, CallMessage& b) { + friend void swap(ProConfig& a, ProConfig& b) { a.Swap(&b); } - inline void Swap(CallMessage* other) { + inline void Swap(ProConfig* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1527,7 +1444,7 @@ class CallMessage final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(CallMessage* other) { + void UnsafeArenaSwap(ProConfig* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1535,12 +1452,12 @@ class CallMessage final : // implements Message ---------------------------------------------- - CallMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + ProConfig* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const CallMessage& from); - void MergeFrom(const CallMessage& from); + void CopyFrom(const ProConfig& from); + void MergeFrom(const ProConfig& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1554,15 +1471,15 @@ class CallMessage final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(CallMessage* other); + void InternalSwap(ProConfig* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.CallMessage"; + return "SessionProtos.ProConfig"; } protected: - explicit CallMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit ProConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -1570,151 +1487,49 @@ class CallMessage final : // nested types ---------------------------------------------------- - typedef CallMessage_Type Type; - static constexpr Type PRE_OFFER = - CallMessage_Type_PRE_OFFER; - static constexpr Type OFFER = - CallMessage_Type_OFFER; - static constexpr Type ANSWER = - CallMessage_Type_ANSWER; - static constexpr Type PROVISIONAL_ANSWER = - CallMessage_Type_PROVISIONAL_ANSWER; - static constexpr Type ICE_CANDIDATES = - CallMessage_Type_ICE_CANDIDATES; - static constexpr Type END_CALL = - CallMessage_Type_END_CALL; - static inline bool Type_IsValid(int value) { - return CallMessage_Type_IsValid(value); - } - static constexpr Type Type_MIN = - CallMessage_Type_Type_MIN; - static constexpr Type Type_MAX = - CallMessage_Type_Type_MAX; - static constexpr int Type_ARRAYSIZE = - CallMessage_Type_Type_ARRAYSIZE; - template - static inline const std::string& Type_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function Type_Name."); - return CallMessage_Type_Name(enum_t_value); - } - static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Type* value) { - return CallMessage_Type_Parse(name, value); - } - // accessors ------------------------------------------------------- enum : int { - kSdpsFieldNumber = 2, - kSdpMLineIndexesFieldNumber = 3, - kSdpMidsFieldNumber = 4, - kUuidFieldNumber = 5, - kTypeFieldNumber = 1, + kRotatingPrivKeyFieldNumber = 1, + kProofFieldNumber = 2, }; - // repeated string sdps = 2; - int sdps_size() const; - private: - int _internal_sdps_size() const; - public: - void clear_sdps(); - const std::string& sdps(int index) const; - std::string* mutable_sdps(int index); - void set_sdps(int index, const std::string& value); - void set_sdps(int index, std::string&& value); - void set_sdps(int index, const char* value); - void set_sdps(int index, const char* value, size_t size); - std::string* add_sdps(); - void add_sdps(const std::string& value); - void add_sdps(std::string&& value); - void add_sdps(const char* value); - void add_sdps(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& sdps() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_sdps(); - private: - const std::string& _internal_sdps(int index) const; - std::string* _internal_add_sdps(); - public: - - // repeated uint32 sdpMLineIndexes = 3; - int sdpmlineindexes_size() const; - private: - int _internal_sdpmlineindexes_size() const; - public: - void clear_sdpmlineindexes(); - private: - uint32_t _internal_sdpmlineindexes(int index) const; - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >& - _internal_sdpmlineindexes() const; - void _internal_add_sdpmlineindexes(uint32_t value); - ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >* - _internal_mutable_sdpmlineindexes(); - public: - uint32_t sdpmlineindexes(int index) const; - void set_sdpmlineindexes(int index, uint32_t value); - void add_sdpmlineindexes(uint32_t value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >& - sdpmlineindexes() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >* - mutable_sdpmlineindexes(); - - // repeated string sdpMids = 4; - int sdpmids_size() const; - private: - int _internal_sdpmids_size() const; - public: - void clear_sdpmids(); - const std::string& sdpmids(int index) const; - std::string* mutable_sdpmids(int index); - void set_sdpmids(int index, const std::string& value); - void set_sdpmids(int index, std::string&& value); - void set_sdpmids(int index, const char* value); - void set_sdpmids(int index, const char* value, size_t size); - std::string* add_sdpmids(); - void add_sdpmids(const std::string& value); - void add_sdpmids(std::string&& value); - void add_sdpmids(const char* value); - void add_sdpmids(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& sdpmids() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_sdpmids(); - private: - const std::string& _internal_sdpmids(int index) const; - std::string* _internal_add_sdpmids(); - public: - - // required string uuid = 5; - bool has_uuid() const; + // required bytes rotatingPrivKey = 1; + bool has_rotatingprivkey() const; private: - bool _internal_has_uuid() const; + bool _internal_has_rotatingprivkey() const; public: - void clear_uuid(); - const std::string& uuid() const; + void clear_rotatingprivkey(); + const std::string& rotatingprivkey() const; template - void set_uuid(ArgT0&& arg0, ArgT... args); - std::string* mutable_uuid(); - PROTOBUF_NODISCARD std::string* release_uuid(); - void set_allocated_uuid(std::string* uuid); + void set_rotatingprivkey(ArgT0&& arg0, ArgT... args); + std::string* mutable_rotatingprivkey(); + PROTOBUF_NODISCARD std::string* release_rotatingprivkey(); + void set_allocated_rotatingprivkey(std::string* rotatingprivkey); private: - const std::string& _internal_uuid() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_uuid(const std::string& value); - std::string* _internal_mutable_uuid(); + const std::string& _internal_rotatingprivkey() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_rotatingprivkey(const std::string& value); + std::string* _internal_mutable_rotatingprivkey(); public: - // required .SessionProtos.CallMessage.Type type = 1; - bool has_type() const; + // required .SessionProtos.ProProof proof = 2; + bool has_proof() const; private: - bool _internal_has_type() const; + bool _internal_has_proof() const; public: - void clear_type(); - ::SessionProtos::CallMessage_Type type() const; - void set_type(::SessionProtos::CallMessage_Type value); + void clear_proof(); + const ::SessionProtos::ProProof& proof() const; + PROTOBUF_NODISCARD ::SessionProtos::ProProof* release_proof(); + ::SessionProtos::ProProof* mutable_proof(); + void set_allocated_proof(::SessionProtos::ProProof* proof); private: - ::SessionProtos::CallMessage_Type _internal_type() const; - void _internal_set_type(::SessionProtos::CallMessage_Type value); + const ::SessionProtos::ProProof& _internal_proof() const; + ::SessionProtos::ProProof* _internal_mutable_proof(); public: + void unsafe_arena_set_allocated_proof( + ::SessionProtos::ProProof* proof); + ::SessionProtos::ProProof* unsafe_arena_release_proof(); - // @@protoc_insertion_point(class_scope:SessionProtos.CallMessage) + // @@protoc_insertion_point(class_scope:SessionProtos.ProConfig) private: class _Internal; @@ -1727,35 +1542,32 @@ class CallMessage final : struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField sdps_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t > sdpmlineindexes_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField sdpmids_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr uuid_; - int type_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr rotatingprivkey_; + ::SessionProtos::ProProof* proof_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class KeyPair final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.KeyPair) */ { +class ProMessageConfig final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ProMessageConfig) */ { public: - inline KeyPair() : KeyPair(nullptr) {} - ~KeyPair() override; - explicit PROTOBUF_CONSTEXPR KeyPair(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline ProMessageConfig() : ProMessageConfig(nullptr) {} + ~ProMessageConfig() override; + explicit PROTOBUF_CONSTEXPR ProMessageConfig(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - KeyPair(const KeyPair& from); - KeyPair(KeyPair&& from) noexcept - : KeyPair() { + ProMessageConfig(const ProMessageConfig& from); + ProMessageConfig(ProMessageConfig&& from) noexcept + : ProMessageConfig() { *this = ::std::move(from); } - inline KeyPair& operator=(const KeyPair& from) { + inline ProMessageConfig& operator=(const ProMessageConfig& from) { CopyFrom(from); return *this; } - inline KeyPair& operator=(KeyPair&& from) noexcept { + inline ProMessageConfig& operator=(ProMessageConfig&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1776,20 +1588,20 @@ class KeyPair final : return _internal_metadata_.mutable_unknown_fields(); } - static const KeyPair& default_instance() { + static const ProMessageConfig& default_instance() { return *internal_default_instance(); } - static inline const KeyPair* internal_default_instance() { - return reinterpret_cast( - &_KeyPair_default_instance_); + static inline const ProMessageConfig* internal_default_instance() { + return reinterpret_cast( + &_ProMessageConfig_default_instance_); } static constexpr int kIndexInFileMessages = 6; - friend void swap(KeyPair& a, KeyPair& b) { + friend void swap(ProMessageConfig& a, ProMessageConfig& b) { a.Swap(&b); } - inline void Swap(KeyPair* other) { + inline void Swap(ProMessageConfig* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1802,7 +1614,7 @@ class KeyPair final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(KeyPair* other) { + void UnsafeArenaSwap(ProMessageConfig* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1810,12 +1622,12 @@ class KeyPair final : // implements Message ---------------------------------------------- - KeyPair* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + ProMessageConfig* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const KeyPair& from); - void MergeFrom(const KeyPair& from); + void CopyFrom(const ProMessageConfig& from); + void MergeFrom(const ProMessageConfig& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1829,15 +1641,15 @@ class KeyPair final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(KeyPair* other); + void InternalSwap(ProMessageConfig* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.KeyPair"; + return "SessionProtos.ProMessageConfig"; } protected: - explicit KeyPair(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit ProMessageConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -1848,46 +1660,41 @@ class KeyPair final : // accessors ------------------------------------------------------- enum : int { - kPublicKeyFieldNumber = 1, - kPrivateKeyFieldNumber = 2, + kProofFieldNumber = 1, + kFlagsFieldNumber = 2, }; - // required bytes publicKey = 1; - bool has_publickey() const; + // required .SessionProtos.ProProof proof = 1; + bool has_proof() const; private: - bool _internal_has_publickey() const; + bool _internal_has_proof() const; public: - void clear_publickey(); - const std::string& publickey() const; - template - void set_publickey(ArgT0&& arg0, ArgT... args); - std::string* mutable_publickey(); - PROTOBUF_NODISCARD std::string* release_publickey(); - void set_allocated_publickey(std::string* publickey); + void clear_proof(); + const ::SessionProtos::ProProof& proof() const; + PROTOBUF_NODISCARD ::SessionProtos::ProProof* release_proof(); + ::SessionProtos::ProProof* mutable_proof(); + void set_allocated_proof(::SessionProtos::ProProof* proof); private: - const std::string& _internal_publickey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_publickey(const std::string& value); - std::string* _internal_mutable_publickey(); + const ::SessionProtos::ProProof& _internal_proof() const; + ::SessionProtos::ProProof* _internal_mutable_proof(); public: + void unsafe_arena_set_allocated_proof( + ::SessionProtos::ProProof* proof); + ::SessionProtos::ProProof* unsafe_arena_release_proof(); - // required bytes privateKey = 2; - bool has_privatekey() const; + // required uint32 flags = 2; + bool has_flags() const; private: - bool _internal_has_privatekey() const; + bool _internal_has_flags() const; public: - void clear_privatekey(); - const std::string& privatekey() const; - template - void set_privatekey(ArgT0&& arg0, ArgT... args); - std::string* mutable_privatekey(); - PROTOBUF_NODISCARD std::string* release_privatekey(); - void set_allocated_privatekey(std::string* privatekey); + void clear_flags(); + uint32_t flags() const; + void set_flags(uint32_t value); private: - const std::string& _internal_privatekey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_privatekey(const std::string& value); - std::string* _internal_mutable_privatekey(); + uint32_t _internal_flags() const; + void _internal_set_flags(uint32_t value); public: - // @@protoc_insertion_point(class_scope:SessionProtos.KeyPair) + // @@protoc_insertion_point(class_scope:SessionProtos.ProMessageConfig) private: class _Internal; @@ -1900,32 +1707,32 @@ class KeyPair final : struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr publickey_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr privatekey_; + ::SessionProtos::ProProof* proof_; + uint32_t flags_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class DataExtractionNotification final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataExtractionNotification) */ { +class Content final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.Content) */ { public: - inline DataExtractionNotification() : DataExtractionNotification(nullptr) {} - ~DataExtractionNotification() override; - explicit PROTOBUF_CONSTEXPR DataExtractionNotification(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline Content() : Content(nullptr) {} + ~Content() override; + explicit PROTOBUF_CONSTEXPR Content(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - DataExtractionNotification(const DataExtractionNotification& from); - DataExtractionNotification(DataExtractionNotification&& from) noexcept - : DataExtractionNotification() { + Content(const Content& from); + Content(Content&& from) noexcept + : Content() { *this = ::std::move(from); } - inline DataExtractionNotification& operator=(const DataExtractionNotification& from) { + inline Content& operator=(const Content& from) { CopyFrom(from); return *this; } - inline DataExtractionNotification& operator=(DataExtractionNotification&& from) noexcept { + inline Content& operator=(Content&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1946,20 +1753,20 @@ class DataExtractionNotification final : return _internal_metadata_.mutable_unknown_fields(); } - static const DataExtractionNotification& default_instance() { + static const Content& default_instance() { return *internal_default_instance(); } - static inline const DataExtractionNotification* internal_default_instance() { - return reinterpret_cast( - &_DataExtractionNotification_default_instance_); + static inline const Content* internal_default_instance() { + return reinterpret_cast( + &_Content_default_instance_); } static constexpr int kIndexInFileMessages = 7; - friend void swap(DataExtractionNotification& a, DataExtractionNotification& b) { + friend void swap(Content& a, Content& b) { a.Swap(&b); } - inline void Swap(DataExtractionNotification* other) { + inline void Swap(Content* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1972,7 +1779,7 @@ class DataExtractionNotification final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataExtractionNotification* other) { + void UnsafeArenaSwap(Content* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1980,12 +1787,12 @@ class DataExtractionNotification final : // implements Message ---------------------------------------------- - DataExtractionNotification* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Content* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const DataExtractionNotification& from); - void MergeFrom(const DataExtractionNotification& from); + void CopyFrom(const Content& from); + void MergeFrom(const Content& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1999,15 +1806,15 @@ class DataExtractionNotification final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(DataExtractionNotification* other); + void InternalSwap(Content* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataExtractionNotification"; + return "SessionProtos.Content"; } protected: - explicit DataExtractionNotification(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit Content(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -2015,65 +1822,201 @@ class DataExtractionNotification final : // nested types ---------------------------------------------------- - typedef DataExtractionNotification_Type Type; - static constexpr Type SCREENSHOT = - DataExtractionNotification_Type_SCREENSHOT; - static constexpr Type MEDIA_SAVED = - DataExtractionNotification_Type_MEDIA_SAVED; - static inline bool Type_IsValid(int value) { - return DataExtractionNotification_Type_IsValid(value); - } - static constexpr Type Type_MIN = - DataExtractionNotification_Type_Type_MIN; - static constexpr Type Type_MAX = - DataExtractionNotification_Type_Type_MAX; - static constexpr int Type_ARRAYSIZE = - DataExtractionNotification_Type_Type_ARRAYSIZE; - template - static inline const std::string& Type_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function Type_Name."); - return DataExtractionNotification_Type_Name(enum_t_value); - } - static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Type* value) { - return DataExtractionNotification_Type_Parse(name, value); - } - // accessors ------------------------------------------------------- enum : int { - kTimestampFieldNumber = 2, - kTypeFieldNumber = 1, + kDataMessageFieldNumber = 1, + kCallMessageFieldNumber = 3, + kReceiptMessageFieldNumber = 5, + kTypingMessageFieldNumber = 6, + kConfigurationMessageFieldNumber = 7, + kDataExtractionNotificationFieldNumber = 8, + kUnsendRequestFieldNumber = 9, + kMessageRequestResponseFieldNumber = 10, + kSharedConfigMessageFieldNumber = 11, + kProMessageConfigFieldNumber = 12, }; - // optional uint64 timestamp = 2; - bool has_timestamp() const; + // optional .SessionProtos.DataMessage dataMessage = 1; + bool has_datamessage() const; private: - bool _internal_has_timestamp() const; + bool _internal_has_datamessage() const; public: - void clear_timestamp(); - uint64_t timestamp() const; - void set_timestamp(uint64_t value); + void clear_datamessage(); + const ::SessionProtos::DataMessage& datamessage() const; + PROTOBUF_NODISCARD ::SessionProtos::DataMessage* release_datamessage(); + ::SessionProtos::DataMessage* mutable_datamessage(); + void set_allocated_datamessage(::SessionProtos::DataMessage* datamessage); private: - uint64_t _internal_timestamp() const; - void _internal_set_timestamp(uint64_t value); + const ::SessionProtos::DataMessage& _internal_datamessage() const; + ::SessionProtos::DataMessage* _internal_mutable_datamessage(); public: + void unsafe_arena_set_allocated_datamessage( + ::SessionProtos::DataMessage* datamessage); + ::SessionProtos::DataMessage* unsafe_arena_release_datamessage(); - // required .SessionProtos.DataExtractionNotification.Type type = 1; - bool has_type() const; + // optional .SessionProtos.CallMessage callMessage = 3; + bool has_callmessage() const; private: - bool _internal_has_type() const; + bool _internal_has_callmessage() const; public: - void clear_type(); - ::SessionProtos::DataExtractionNotification_Type type() const; - void set_type(::SessionProtos::DataExtractionNotification_Type value); + void clear_callmessage(); + const ::SessionProtos::CallMessage& callmessage() const; + PROTOBUF_NODISCARD ::SessionProtos::CallMessage* release_callmessage(); + ::SessionProtos::CallMessage* mutable_callmessage(); + void set_allocated_callmessage(::SessionProtos::CallMessage* callmessage); private: - ::SessionProtos::DataExtractionNotification_Type _internal_type() const; - void _internal_set_type(::SessionProtos::DataExtractionNotification_Type value); + const ::SessionProtos::CallMessage& _internal_callmessage() const; + ::SessionProtos::CallMessage* _internal_mutable_callmessage(); public: + void unsafe_arena_set_allocated_callmessage( + ::SessionProtos::CallMessage* callmessage); + ::SessionProtos::CallMessage* unsafe_arena_release_callmessage(); - // @@protoc_insertion_point(class_scope:SessionProtos.DataExtractionNotification) + // optional .SessionProtos.ReceiptMessage receiptMessage = 5; + bool has_receiptmessage() const; + private: + bool _internal_has_receiptmessage() const; + public: + void clear_receiptmessage(); + const ::SessionProtos::ReceiptMessage& receiptmessage() const; + PROTOBUF_NODISCARD ::SessionProtos::ReceiptMessage* release_receiptmessage(); + ::SessionProtos::ReceiptMessage* mutable_receiptmessage(); + void set_allocated_receiptmessage(::SessionProtos::ReceiptMessage* receiptmessage); + private: + const ::SessionProtos::ReceiptMessage& _internal_receiptmessage() const; + ::SessionProtos::ReceiptMessage* _internal_mutable_receiptmessage(); + public: + void unsafe_arena_set_allocated_receiptmessage( + ::SessionProtos::ReceiptMessage* receiptmessage); + ::SessionProtos::ReceiptMessage* unsafe_arena_release_receiptmessage(); + + // optional .SessionProtos.TypingMessage typingMessage = 6; + bool has_typingmessage() const; + private: + bool _internal_has_typingmessage() const; + public: + void clear_typingmessage(); + const ::SessionProtos::TypingMessage& typingmessage() const; + PROTOBUF_NODISCARD ::SessionProtos::TypingMessage* release_typingmessage(); + ::SessionProtos::TypingMessage* mutable_typingmessage(); + void set_allocated_typingmessage(::SessionProtos::TypingMessage* typingmessage); + private: + const ::SessionProtos::TypingMessage& _internal_typingmessage() const; + ::SessionProtos::TypingMessage* _internal_mutable_typingmessage(); + public: + void unsafe_arena_set_allocated_typingmessage( + ::SessionProtos::TypingMessage* typingmessage); + ::SessionProtos::TypingMessage* unsafe_arena_release_typingmessage(); + + // optional .SessionProtos.ConfigurationMessage configurationMessage = 7; + bool has_configurationmessage() const; + private: + bool _internal_has_configurationmessage() const; + public: + void clear_configurationmessage(); + const ::SessionProtos::ConfigurationMessage& configurationmessage() const; + PROTOBUF_NODISCARD ::SessionProtos::ConfigurationMessage* release_configurationmessage(); + ::SessionProtos::ConfigurationMessage* mutable_configurationmessage(); + void set_allocated_configurationmessage(::SessionProtos::ConfigurationMessage* configurationmessage); + private: + const ::SessionProtos::ConfigurationMessage& _internal_configurationmessage() const; + ::SessionProtos::ConfigurationMessage* _internal_mutable_configurationmessage(); + public: + void unsafe_arena_set_allocated_configurationmessage( + ::SessionProtos::ConfigurationMessage* configurationmessage); + ::SessionProtos::ConfigurationMessage* unsafe_arena_release_configurationmessage(); + + // optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; + bool has_dataextractionnotification() const; + private: + bool _internal_has_dataextractionnotification() const; + public: + void clear_dataextractionnotification(); + const ::SessionProtos::DataExtractionNotification& dataextractionnotification() const; + PROTOBUF_NODISCARD ::SessionProtos::DataExtractionNotification* release_dataextractionnotification(); + ::SessionProtos::DataExtractionNotification* mutable_dataextractionnotification(); + void set_allocated_dataextractionnotification(::SessionProtos::DataExtractionNotification* dataextractionnotification); + private: + const ::SessionProtos::DataExtractionNotification& _internal_dataextractionnotification() const; + ::SessionProtos::DataExtractionNotification* _internal_mutable_dataextractionnotification(); + public: + void unsafe_arena_set_allocated_dataextractionnotification( + ::SessionProtos::DataExtractionNotification* dataextractionnotification); + ::SessionProtos::DataExtractionNotification* unsafe_arena_release_dataextractionnotification(); + + // optional .SessionProtos.UnsendRequest unsendRequest = 9; + bool has_unsendrequest() const; + private: + bool _internal_has_unsendrequest() const; + public: + void clear_unsendrequest(); + const ::SessionProtos::UnsendRequest& unsendrequest() const; + PROTOBUF_NODISCARD ::SessionProtos::UnsendRequest* release_unsendrequest(); + ::SessionProtos::UnsendRequest* mutable_unsendrequest(); + void set_allocated_unsendrequest(::SessionProtos::UnsendRequest* unsendrequest); + private: + const ::SessionProtos::UnsendRequest& _internal_unsendrequest() const; + ::SessionProtos::UnsendRequest* _internal_mutable_unsendrequest(); + public: + void unsafe_arena_set_allocated_unsendrequest( + ::SessionProtos::UnsendRequest* unsendrequest); + ::SessionProtos::UnsendRequest* unsafe_arena_release_unsendrequest(); + + // optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; + bool has_messagerequestresponse() const; + private: + bool _internal_has_messagerequestresponse() const; + public: + void clear_messagerequestresponse(); + const ::SessionProtos::MessageRequestResponse& messagerequestresponse() const; + PROTOBUF_NODISCARD ::SessionProtos::MessageRequestResponse* release_messagerequestresponse(); + ::SessionProtos::MessageRequestResponse* mutable_messagerequestresponse(); + void set_allocated_messagerequestresponse(::SessionProtos::MessageRequestResponse* messagerequestresponse); + private: + const ::SessionProtos::MessageRequestResponse& _internal_messagerequestresponse() const; + ::SessionProtos::MessageRequestResponse* _internal_mutable_messagerequestresponse(); + public: + void unsafe_arena_set_allocated_messagerequestresponse( + ::SessionProtos::MessageRequestResponse* messagerequestresponse); + ::SessionProtos::MessageRequestResponse* unsafe_arena_release_messagerequestresponse(); + + // optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; + bool has_sharedconfigmessage() const; + private: + bool _internal_has_sharedconfigmessage() const; + public: + void clear_sharedconfigmessage(); + const ::SessionProtos::SharedConfigMessage& sharedconfigmessage() const; + PROTOBUF_NODISCARD ::SessionProtos::SharedConfigMessage* release_sharedconfigmessage(); + ::SessionProtos::SharedConfigMessage* mutable_sharedconfigmessage(); + void set_allocated_sharedconfigmessage(::SessionProtos::SharedConfigMessage* sharedconfigmessage); + private: + const ::SessionProtos::SharedConfigMessage& _internal_sharedconfigmessage() const; + ::SessionProtos::SharedConfigMessage* _internal_mutable_sharedconfigmessage(); + public: + void unsafe_arena_set_allocated_sharedconfigmessage( + ::SessionProtos::SharedConfigMessage* sharedconfigmessage); + ::SessionProtos::SharedConfigMessage* unsafe_arena_release_sharedconfigmessage(); + + // optional .SessionProtos.ProMessageConfig proMessageConfig = 12; + bool has_promessageconfig() const; + private: + bool _internal_has_promessageconfig() const; + public: + void clear_promessageconfig(); + const ::SessionProtos::ProMessageConfig& promessageconfig() const; + PROTOBUF_NODISCARD ::SessionProtos::ProMessageConfig* release_promessageconfig(); + ::SessionProtos::ProMessageConfig* mutable_promessageconfig(); + void set_allocated_promessageconfig(::SessionProtos::ProMessageConfig* promessageconfig); + private: + const ::SessionProtos::ProMessageConfig& _internal_promessageconfig() const; + ::SessionProtos::ProMessageConfig* _internal_mutable_promessageconfig(); + public: + void unsafe_arena_set_allocated_promessageconfig( + ::SessionProtos::ProMessageConfig* promessageconfig); + ::SessionProtos::ProMessageConfig* unsafe_arena_release_promessageconfig(); + + // @@protoc_insertion_point(class_scope:SessionProtos.Content) private: class _Internal; @@ -2083,32 +2026,40 @@ class DataExtractionNotification final : struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - uint64_t timestamp_; - int type_; + ::SessionProtos::DataMessage* datamessage_; + ::SessionProtos::CallMessage* callmessage_; + ::SessionProtos::ReceiptMessage* receiptmessage_; + ::SessionProtos::TypingMessage* typingmessage_; + ::SessionProtos::ConfigurationMessage* configurationmessage_; + ::SessionProtos::DataExtractionNotification* dataextractionnotification_; + ::SessionProtos::UnsendRequest* unsendrequest_; + ::SessionProtos::MessageRequestResponse* messagerequestresponse_; + ::SessionProtos::SharedConfigMessage* sharedconfigmessage_; + ::SessionProtos::ProMessageConfig* promessageconfig_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class LokiProfile final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.LokiProfile) */ { +class CallMessage final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.CallMessage) */ { public: - inline LokiProfile() : LokiProfile(nullptr) {} - ~LokiProfile() override; - explicit PROTOBUF_CONSTEXPR LokiProfile(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline CallMessage() : CallMessage(nullptr) {} + ~CallMessage() override; + explicit PROTOBUF_CONSTEXPR CallMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - LokiProfile(const LokiProfile& from); - LokiProfile(LokiProfile&& from) noexcept - : LokiProfile() { + CallMessage(const CallMessage& from); + CallMessage(CallMessage&& from) noexcept + : CallMessage() { *this = ::std::move(from); } - inline LokiProfile& operator=(const LokiProfile& from) { + inline CallMessage& operator=(const CallMessage& from) { CopyFrom(from); return *this; } - inline LokiProfile& operator=(LokiProfile&& from) noexcept { + inline CallMessage& operator=(CallMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -2129,20 +2080,20 @@ class LokiProfile final : return _internal_metadata_.mutable_unknown_fields(); } - static const LokiProfile& default_instance() { + static const CallMessage& default_instance() { return *internal_default_instance(); } - static inline const LokiProfile* internal_default_instance() { - return reinterpret_cast( - &_LokiProfile_default_instance_); + static inline const CallMessage* internal_default_instance() { + return reinterpret_cast( + &_CallMessage_default_instance_); } static constexpr int kIndexInFileMessages = 8; - friend void swap(LokiProfile& a, LokiProfile& b) { + friend void swap(CallMessage& a, CallMessage& b) { a.Swap(&b); } - inline void Swap(LokiProfile* other) { + inline void Swap(CallMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -2155,7 +2106,7 @@ class LokiProfile final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(LokiProfile* other) { + void UnsafeArenaSwap(CallMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -2163,12 +2114,12 @@ class LokiProfile final : // implements Message ---------------------------------------------- - LokiProfile* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + CallMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const LokiProfile& from); - void MergeFrom(const LokiProfile& from); + void CopyFrom(const CallMessage& from); + void MergeFrom(const CallMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -2182,15 +2133,15 @@ class LokiProfile final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(LokiProfile* other); + void InternalSwap(CallMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.LokiProfile"; + return "SessionProtos.CallMessage"; } protected: - explicit LokiProfile(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit CallMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -2198,84 +2149,192 @@ class LokiProfile final : // nested types ---------------------------------------------------- + typedef CallMessage_Type Type; + static constexpr Type PRE_OFFER = + CallMessage_Type_PRE_OFFER; + static constexpr Type OFFER = + CallMessage_Type_OFFER; + static constexpr Type ANSWER = + CallMessage_Type_ANSWER; + static constexpr Type PROVISIONAL_ANSWER = + CallMessage_Type_PROVISIONAL_ANSWER; + static constexpr Type ICE_CANDIDATES = + CallMessage_Type_ICE_CANDIDATES; + static constexpr Type END_CALL = + CallMessage_Type_END_CALL; + static inline bool Type_IsValid(int value) { + return CallMessage_Type_IsValid(value); + } + static constexpr Type Type_MIN = + CallMessage_Type_Type_MIN; + static constexpr Type Type_MAX = + CallMessage_Type_Type_MAX; + static constexpr int Type_ARRAYSIZE = + CallMessage_Type_Type_ARRAYSIZE; + template + static inline const std::string& Type_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Type_Name."); + return CallMessage_Type_Name(enum_t_value); + } + static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Type* value) { + return CallMessage_Type_Parse(name, value); + } + // accessors ------------------------------------------------------- enum : int { - kDisplayNameFieldNumber = 1, - kProfilePictureFieldNumber = 2, + kSdpsFieldNumber = 2, + kSdpMLineIndexesFieldNumber = 3, + kSdpMidsFieldNumber = 4, + kUuidFieldNumber = 5, + kTypeFieldNumber = 1, }; - // optional string displayName = 1; - bool has_displayname() const; + // repeated string sdps = 2; + int sdps_size() const; private: - bool _internal_has_displayname() const; + int _internal_sdps_size() const; public: - void clear_displayname(); - const std::string& displayname() const; - template - void set_displayname(ArgT0&& arg0, ArgT... args); - std::string* mutable_displayname(); - PROTOBUF_NODISCARD std::string* release_displayname(); - void set_allocated_displayname(std::string* displayname); + void clear_sdps(); + const std::string& sdps(int index) const; + std::string* mutable_sdps(int index); + void set_sdps(int index, const std::string& value); + void set_sdps(int index, std::string&& value); + void set_sdps(int index, const char* value); + void set_sdps(int index, const char* value, size_t size); + std::string* add_sdps(); + void add_sdps(const std::string& value); + void add_sdps(std::string&& value); + void add_sdps(const char* value); + void add_sdps(const char* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& sdps() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_sdps(); private: - const std::string& _internal_displayname() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_displayname(const std::string& value); - std::string* _internal_mutable_displayname(); + const std::string& _internal_sdps(int index) const; + std::string* _internal_add_sdps(); public: - // optional string profilePicture = 2; - bool has_profilepicture() const; + // repeated uint32 sdpMLineIndexes = 3; + int sdpmlineindexes_size() const; private: - bool _internal_has_profilepicture() const; + int _internal_sdpmlineindexes_size() const; public: - void clear_profilepicture(); - const std::string& profilepicture() const; + void clear_sdpmlineindexes(); + private: + uint32_t _internal_sdpmlineindexes(int index) const; + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >& + _internal_sdpmlineindexes() const; + void _internal_add_sdpmlineindexes(uint32_t value); + ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >* + _internal_mutable_sdpmlineindexes(); + public: + uint32_t sdpmlineindexes(int index) const; + void set_sdpmlineindexes(int index, uint32_t value); + void add_sdpmlineindexes(uint32_t value); + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >& + sdpmlineindexes() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >* + mutable_sdpmlineindexes(); + + // repeated string sdpMids = 4; + int sdpmids_size() const; + private: + int _internal_sdpmids_size() const; + public: + void clear_sdpmids(); + const std::string& sdpmids(int index) const; + std::string* mutable_sdpmids(int index); + void set_sdpmids(int index, const std::string& value); + void set_sdpmids(int index, std::string&& value); + void set_sdpmids(int index, const char* value); + void set_sdpmids(int index, const char* value, size_t size); + std::string* add_sdpmids(); + void add_sdpmids(const std::string& value); + void add_sdpmids(std::string&& value); + void add_sdpmids(const char* value); + void add_sdpmids(const char* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& sdpmids() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_sdpmids(); + private: + const std::string& _internal_sdpmids(int index) const; + std::string* _internal_add_sdpmids(); + public: + + // required string uuid = 5; + bool has_uuid() const; + private: + bool _internal_has_uuid() const; + public: + void clear_uuid(); + const std::string& uuid() const; template - void set_profilepicture(ArgT0&& arg0, ArgT... args); - std::string* mutable_profilepicture(); - PROTOBUF_NODISCARD std::string* release_profilepicture(); - void set_allocated_profilepicture(std::string* profilepicture); + void set_uuid(ArgT0&& arg0, ArgT... args); + std::string* mutable_uuid(); + PROTOBUF_NODISCARD std::string* release_uuid(); + void set_allocated_uuid(std::string* uuid); private: - const std::string& _internal_profilepicture() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilepicture(const std::string& value); - std::string* _internal_mutable_profilepicture(); + const std::string& _internal_uuid() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_uuid(const std::string& value); + std::string* _internal_mutable_uuid(); public: - // @@protoc_insertion_point(class_scope:SessionProtos.LokiProfile) + // required .SessionProtos.CallMessage.Type type = 1; + bool has_type() const; + private: + bool _internal_has_type() const; + public: + void clear_type(); + ::SessionProtos::CallMessage_Type type() const; + void set_type(::SessionProtos::CallMessage_Type value); + private: + ::SessionProtos::CallMessage_Type _internal_type() const; + void _internal_set_type(::SessionProtos::CallMessage_Type value); + public: + + // @@protoc_insertion_point(class_scope:SessionProtos.CallMessage) private: class _Internal; + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr displayname_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilepicture_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField sdps_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t > sdpmlineindexes_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField sdpmids_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr uuid_; + int type_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class DataMessage_Quote_QuotedAttachment final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Quote.QuotedAttachment) */ { +class KeyPair final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.KeyPair) */ { public: - inline DataMessage_Quote_QuotedAttachment() : DataMessage_Quote_QuotedAttachment(nullptr) {} - ~DataMessage_Quote_QuotedAttachment() override; - explicit PROTOBUF_CONSTEXPR DataMessage_Quote_QuotedAttachment(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline KeyPair() : KeyPair(nullptr) {} + ~KeyPair() override; + explicit PROTOBUF_CONSTEXPR KeyPair(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - DataMessage_Quote_QuotedAttachment(const DataMessage_Quote_QuotedAttachment& from); - DataMessage_Quote_QuotedAttachment(DataMessage_Quote_QuotedAttachment&& from) noexcept - : DataMessage_Quote_QuotedAttachment() { + KeyPair(const KeyPair& from); + KeyPair(KeyPair&& from) noexcept + : KeyPair() { *this = ::std::move(from); } - inline DataMessage_Quote_QuotedAttachment& operator=(const DataMessage_Quote_QuotedAttachment& from) { + inline KeyPair& operator=(const KeyPair& from) { CopyFrom(from); return *this; } - inline DataMessage_Quote_QuotedAttachment& operator=(DataMessage_Quote_QuotedAttachment&& from) noexcept { + inline KeyPair& operator=(KeyPair&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -2296,20 +2355,20 @@ class DataMessage_Quote_QuotedAttachment final : return _internal_metadata_.mutable_unknown_fields(); } - static const DataMessage_Quote_QuotedAttachment& default_instance() { + static const KeyPair& default_instance() { return *internal_default_instance(); } - static inline const DataMessage_Quote_QuotedAttachment* internal_default_instance() { - return reinterpret_cast( - &_DataMessage_Quote_QuotedAttachment_default_instance_); + static inline const KeyPair* internal_default_instance() { + return reinterpret_cast( + &_KeyPair_default_instance_); } static constexpr int kIndexInFileMessages = 9; - friend void swap(DataMessage_Quote_QuotedAttachment& a, DataMessage_Quote_QuotedAttachment& b) { + friend void swap(KeyPair& a, KeyPair& b) { a.Swap(&b); } - inline void Swap(DataMessage_Quote_QuotedAttachment* other) { + inline void Swap(KeyPair* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -2322,7 +2381,7 @@ class DataMessage_Quote_QuotedAttachment final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataMessage_Quote_QuotedAttachment* other) { + void UnsafeArenaSwap(KeyPair* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -2330,12 +2389,12 @@ class DataMessage_Quote_QuotedAttachment final : // implements Message ---------------------------------------------- - DataMessage_Quote_QuotedAttachment* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + KeyPair* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const DataMessage_Quote_QuotedAttachment& from); - void MergeFrom(const DataMessage_Quote_QuotedAttachment& from); + void CopyFrom(const KeyPair& from); + void MergeFrom(const KeyPair& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -2349,15 +2408,15 @@ class DataMessage_Quote_QuotedAttachment final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(DataMessage_Quote_QuotedAttachment* other); + void InternalSwap(KeyPair* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataMessage.Quote.QuotedAttachment"; + return "SessionProtos.KeyPair"; } protected: - explicit DataMessage_Quote_QuotedAttachment(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit KeyPair(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -2365,143 +2424,87 @@ class DataMessage_Quote_QuotedAttachment final : // nested types ---------------------------------------------------- - typedef DataMessage_Quote_QuotedAttachment_Flags Flags; - static constexpr Flags VOICE_MESSAGE = - DataMessage_Quote_QuotedAttachment_Flags_VOICE_MESSAGE; - static inline bool Flags_IsValid(int value) { - return DataMessage_Quote_QuotedAttachment_Flags_IsValid(value); - } - static constexpr Flags Flags_MIN = - DataMessage_Quote_QuotedAttachment_Flags_Flags_MIN; - static constexpr Flags Flags_MAX = - DataMessage_Quote_QuotedAttachment_Flags_Flags_MAX; - static constexpr int Flags_ARRAYSIZE = - DataMessage_Quote_QuotedAttachment_Flags_Flags_ARRAYSIZE; - template - static inline const std::string& Flags_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function Flags_Name."); - return DataMessage_Quote_QuotedAttachment_Flags_Name(enum_t_value); - } - static inline bool Flags_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Flags* value) { - return DataMessage_Quote_QuotedAttachment_Flags_Parse(name, value); - } - // accessors ------------------------------------------------------- enum : int { - kContentTypeFieldNumber = 1, - kFileNameFieldNumber = 2, - kThumbnailFieldNumber = 3, - kFlagsFieldNumber = 4, + kPublicKeyFieldNumber = 1, + kPrivateKeyFieldNumber = 2, }; - // optional string contentType = 1; - bool has_contenttype() const; + // required bytes publicKey = 1; + bool has_publickey() const; private: - bool _internal_has_contenttype() const; + bool _internal_has_publickey() const; public: - void clear_contenttype(); - const std::string& contenttype() const; + void clear_publickey(); + const std::string& publickey() const; template - void set_contenttype(ArgT0&& arg0, ArgT... args); - std::string* mutable_contenttype(); - PROTOBUF_NODISCARD std::string* release_contenttype(); - void set_allocated_contenttype(std::string* contenttype); + void set_publickey(ArgT0&& arg0, ArgT... args); + std::string* mutable_publickey(); + PROTOBUF_NODISCARD std::string* release_publickey(); + void set_allocated_publickey(std::string* publickey); private: - const std::string& _internal_contenttype() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_contenttype(const std::string& value); - std::string* _internal_mutable_contenttype(); + const std::string& _internal_publickey() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_publickey(const std::string& value); + std::string* _internal_mutable_publickey(); public: - // optional string fileName = 2; - bool has_filename() const; + // required bytes privateKey = 2; + bool has_privatekey() const; private: - bool _internal_has_filename() const; + bool _internal_has_privatekey() const; public: - void clear_filename(); - const std::string& filename() const; + void clear_privatekey(); + const std::string& privatekey() const; template - void set_filename(ArgT0&& arg0, ArgT... args); - std::string* mutable_filename(); - PROTOBUF_NODISCARD std::string* release_filename(); - void set_allocated_filename(std::string* filename); - private: - const std::string& _internal_filename() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_filename(const std::string& value); - std::string* _internal_mutable_filename(); - public: - - // optional .SessionProtos.AttachmentPointer thumbnail = 3; - bool has_thumbnail() const; - private: - bool _internal_has_thumbnail() const; - public: - void clear_thumbnail(); - const ::SessionProtos::AttachmentPointer& thumbnail() const; - PROTOBUF_NODISCARD ::SessionProtos::AttachmentPointer* release_thumbnail(); - ::SessionProtos::AttachmentPointer* mutable_thumbnail(); - void set_allocated_thumbnail(::SessionProtos::AttachmentPointer* thumbnail); - private: - const ::SessionProtos::AttachmentPointer& _internal_thumbnail() const; - ::SessionProtos::AttachmentPointer* _internal_mutable_thumbnail(); - public: - void unsafe_arena_set_allocated_thumbnail( - ::SessionProtos::AttachmentPointer* thumbnail); - ::SessionProtos::AttachmentPointer* unsafe_arena_release_thumbnail(); - - // optional uint32 flags = 4; - bool has_flags() const; - private: - bool _internal_has_flags() const; - public: - void clear_flags(); - uint32_t flags() const; - void set_flags(uint32_t value); + void set_privatekey(ArgT0&& arg0, ArgT... args); + std::string* mutable_privatekey(); + PROTOBUF_NODISCARD std::string* release_privatekey(); + void set_allocated_privatekey(std::string* privatekey); private: - uint32_t _internal_flags() const; - void _internal_set_flags(uint32_t value); + const std::string& _internal_privatekey() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_privatekey(const std::string& value); + std::string* _internal_mutable_privatekey(); public: - // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.Quote.QuotedAttachment) + // @@protoc_insertion_point(class_scope:SessionProtos.KeyPair) private: class _Internal; + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr contenttype_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr filename_; - ::SessionProtos::AttachmentPointer* thumbnail_; - uint32_t flags_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr publickey_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr privatekey_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class DataMessage_Quote final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Quote) */ { +class DataExtractionNotification final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataExtractionNotification) */ { public: - inline DataMessage_Quote() : DataMessage_Quote(nullptr) {} - ~DataMessage_Quote() override; - explicit PROTOBUF_CONSTEXPR DataMessage_Quote(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline DataExtractionNotification() : DataExtractionNotification(nullptr) {} + ~DataExtractionNotification() override; + explicit PROTOBUF_CONSTEXPR DataExtractionNotification(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - DataMessage_Quote(const DataMessage_Quote& from); - DataMessage_Quote(DataMessage_Quote&& from) noexcept - : DataMessage_Quote() { + DataExtractionNotification(const DataExtractionNotification& from); + DataExtractionNotification(DataExtractionNotification&& from) noexcept + : DataExtractionNotification() { *this = ::std::move(from); } - inline DataMessage_Quote& operator=(const DataMessage_Quote& from) { + inline DataExtractionNotification& operator=(const DataExtractionNotification& from) { CopyFrom(from); return *this; } - inline DataMessage_Quote& operator=(DataMessage_Quote&& from) noexcept { + inline DataExtractionNotification& operator=(DataExtractionNotification&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -2522,20 +2525,20 @@ class DataMessage_Quote final : return _internal_metadata_.mutable_unknown_fields(); } - static const DataMessage_Quote& default_instance() { + static const DataExtractionNotification& default_instance() { return *internal_default_instance(); } - static inline const DataMessage_Quote* internal_default_instance() { - return reinterpret_cast( - &_DataMessage_Quote_default_instance_); + static inline const DataExtractionNotification* internal_default_instance() { + return reinterpret_cast( + &_DataExtractionNotification_default_instance_); } static constexpr int kIndexInFileMessages = 10; - friend void swap(DataMessage_Quote& a, DataMessage_Quote& b) { + friend void swap(DataExtractionNotification& a, DataExtractionNotification& b) { a.Swap(&b); } - inline void Swap(DataMessage_Quote* other) { + inline void Swap(DataExtractionNotification* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -2548,7 +2551,7 @@ class DataMessage_Quote final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataMessage_Quote* other) { + void UnsafeArenaSwap(DataExtractionNotification* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -2556,12 +2559,12 @@ class DataMessage_Quote final : // implements Message ---------------------------------------------- - DataMessage_Quote* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + DataExtractionNotification* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const DataMessage_Quote& from); - void MergeFrom(const DataMessage_Quote& from); + void CopyFrom(const DataExtractionNotification& from); + void MergeFrom(const DataExtractionNotification& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -2575,15 +2578,15 @@ class DataMessage_Quote final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(DataMessage_Quote* other); + void InternalSwap(DataExtractionNotification* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataMessage.Quote"; + return "SessionProtos.DataExtractionNotification"; } protected: - explicit DataMessage_Quote(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit DataExtractionNotification(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -2591,124 +2594,100 @@ class DataMessage_Quote final : // nested types ---------------------------------------------------- - typedef DataMessage_Quote_QuotedAttachment QuotedAttachment; + typedef DataExtractionNotification_Type Type; + static constexpr Type SCREENSHOT = + DataExtractionNotification_Type_SCREENSHOT; + static constexpr Type MEDIA_SAVED = + DataExtractionNotification_Type_MEDIA_SAVED; + static inline bool Type_IsValid(int value) { + return DataExtractionNotification_Type_IsValid(value); + } + static constexpr Type Type_MIN = + DataExtractionNotification_Type_Type_MIN; + static constexpr Type Type_MAX = + DataExtractionNotification_Type_Type_MAX; + static constexpr int Type_ARRAYSIZE = + DataExtractionNotification_Type_Type_ARRAYSIZE; + template + static inline const std::string& Type_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Type_Name."); + return DataExtractionNotification_Type_Name(enum_t_value); + } + static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Type* value) { + return DataExtractionNotification_Type_Parse(name, value); + } // accessors ------------------------------------------------------- enum : int { - kAttachmentsFieldNumber = 4, - kAuthorFieldNumber = 2, - kTextFieldNumber = 3, - kIdFieldNumber = 1, + kTimestampFieldNumber = 2, + kTypeFieldNumber = 1, }; - // repeated .SessionProtos.DataMessage.Quote.QuotedAttachment attachments = 4; - int attachments_size() const; + // optional uint64 timestamp = 2; + bool has_timestamp() const; private: - int _internal_attachments_size() const; + bool _internal_has_timestamp() const; public: - void clear_attachments(); - ::SessionProtos::DataMessage_Quote_QuotedAttachment* mutable_attachments(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Quote_QuotedAttachment >* - mutable_attachments(); + void clear_timestamp(); + uint64_t timestamp() const; + void set_timestamp(uint64_t value); private: - const ::SessionProtos::DataMessage_Quote_QuotedAttachment& _internal_attachments(int index) const; - ::SessionProtos::DataMessage_Quote_QuotedAttachment* _internal_add_attachments(); + uint64_t _internal_timestamp() const; + void _internal_set_timestamp(uint64_t value); public: - const ::SessionProtos::DataMessage_Quote_QuotedAttachment& attachments(int index) const; - ::SessionProtos::DataMessage_Quote_QuotedAttachment* add_attachments(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Quote_QuotedAttachment >& - attachments() const; - // required string author = 2; - bool has_author() const; + // required .SessionProtos.DataExtractionNotification.Type type = 1; + bool has_type() const; private: - bool _internal_has_author() const; + bool _internal_has_type() const; public: - void clear_author(); - const std::string& author() const; - template - void set_author(ArgT0&& arg0, ArgT... args); - std::string* mutable_author(); - PROTOBUF_NODISCARD std::string* release_author(); - void set_allocated_author(std::string* author); + void clear_type(); + ::SessionProtos::DataExtractionNotification_Type type() const; + void set_type(::SessionProtos::DataExtractionNotification_Type value); private: - const std::string& _internal_author() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_author(const std::string& value); - std::string* _internal_mutable_author(); + ::SessionProtos::DataExtractionNotification_Type _internal_type() const; + void _internal_set_type(::SessionProtos::DataExtractionNotification_Type value); public: - // optional string text = 3; - bool has_text() const; - private: - bool _internal_has_text() const; - public: - void clear_text(); - const std::string& text() const; - template - void set_text(ArgT0&& arg0, ArgT... args); - std::string* mutable_text(); - PROTOBUF_NODISCARD std::string* release_text(); - void set_allocated_text(std::string* text); - private: - const std::string& _internal_text() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_text(const std::string& value); - std::string* _internal_mutable_text(); - public: - - // required uint64 id = 1; - bool has_id() const; - private: - bool _internal_has_id() const; - public: - void clear_id(); - uint64_t id() const; - void set_id(uint64_t value); - private: - uint64_t _internal_id() const; - void _internal_set_id(uint64_t value); - public: - - // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.Quote) + // @@protoc_insertion_point(class_scope:SessionProtos.DataExtractionNotification) private: class _Internal; - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Quote_QuotedAttachment > attachments_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr author_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr text_; - uint64_t id_; + uint64_t timestamp_; + int type_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class DataMessage_Preview final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Preview) */ { +class LokiProfile final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.LokiProfile) */ { public: - inline DataMessage_Preview() : DataMessage_Preview(nullptr) {} - ~DataMessage_Preview() override; - explicit PROTOBUF_CONSTEXPR DataMessage_Preview(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline LokiProfile() : LokiProfile(nullptr) {} + ~LokiProfile() override; + explicit PROTOBUF_CONSTEXPR LokiProfile(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - DataMessage_Preview(const DataMessage_Preview& from); - DataMessage_Preview(DataMessage_Preview&& from) noexcept - : DataMessage_Preview() { + LokiProfile(const LokiProfile& from); + LokiProfile(LokiProfile&& from) noexcept + : LokiProfile() { *this = ::std::move(from); } - inline DataMessage_Preview& operator=(const DataMessage_Preview& from) { + inline LokiProfile& operator=(const LokiProfile& from) { CopyFrom(from); return *this; } - inline DataMessage_Preview& operator=(DataMessage_Preview&& from) noexcept { + inline LokiProfile& operator=(LokiProfile&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -2729,20 +2708,20 @@ class DataMessage_Preview final : return _internal_metadata_.mutable_unknown_fields(); } - static const DataMessage_Preview& default_instance() { + static const LokiProfile& default_instance() { return *internal_default_instance(); } - static inline const DataMessage_Preview* internal_default_instance() { - return reinterpret_cast( - &_DataMessage_Preview_default_instance_); + static inline const LokiProfile* internal_default_instance() { + return reinterpret_cast( + &_LokiProfile_default_instance_); } static constexpr int kIndexInFileMessages = 11; - friend void swap(DataMessage_Preview& a, DataMessage_Preview& b) { + friend void swap(LokiProfile& a, LokiProfile& b) { a.Swap(&b); } - inline void Swap(DataMessage_Preview* other) { + inline void Swap(LokiProfile* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -2755,7 +2734,7 @@ class DataMessage_Preview final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataMessage_Preview* other) { + void UnsafeArenaSwap(LokiProfile* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -2763,12 +2742,12 @@ class DataMessage_Preview final : // implements Message ---------------------------------------------- - DataMessage_Preview* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + LokiProfile* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const DataMessage_Preview& from); - void MergeFrom(const DataMessage_Preview& from); + void CopyFrom(const LokiProfile& from); + void MergeFrom(const LokiProfile& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -2782,15 +2761,15 @@ class DataMessage_Preview final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(DataMessage_Preview* other); + void InternalSwap(LokiProfile* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataMessage.Preview"; + return "SessionProtos.LokiProfile"; } protected: - explicit DataMessage_Preview(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit LokiProfile(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -2801,65 +2780,46 @@ class DataMessage_Preview final : // accessors ------------------------------------------------------- enum : int { - kUrlFieldNumber = 1, - kTitleFieldNumber = 2, - kImageFieldNumber = 3, + kDisplayNameFieldNumber = 1, + kProfilePictureFieldNumber = 2, }; - // required string url = 1; - bool has_url() const; + // optional string displayName = 1; + bool has_displayname() const; private: - bool _internal_has_url() const; + bool _internal_has_displayname() const; public: - void clear_url(); - const std::string& url() const; + void clear_displayname(); + const std::string& displayname() const; template - void set_url(ArgT0&& arg0, ArgT... args); - std::string* mutable_url(); - PROTOBUF_NODISCARD std::string* release_url(); - void set_allocated_url(std::string* url); + void set_displayname(ArgT0&& arg0, ArgT... args); + std::string* mutable_displayname(); + PROTOBUF_NODISCARD std::string* release_displayname(); + void set_allocated_displayname(std::string* displayname); private: - const std::string& _internal_url() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_url(const std::string& value); - std::string* _internal_mutable_url(); + const std::string& _internal_displayname() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_displayname(const std::string& value); + std::string* _internal_mutable_displayname(); public: - // optional string title = 2; - bool has_title() const; + // optional string profilePicture = 2; + bool has_profilepicture() const; private: - bool _internal_has_title() const; + bool _internal_has_profilepicture() const; public: - void clear_title(); - const std::string& title() const; + void clear_profilepicture(); + const std::string& profilepicture() const; template - void set_title(ArgT0&& arg0, ArgT... args); - std::string* mutable_title(); - PROTOBUF_NODISCARD std::string* release_title(); - void set_allocated_title(std::string* title); - private: - const std::string& _internal_title() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_title(const std::string& value); - std::string* _internal_mutable_title(); - public: - - // optional .SessionProtos.AttachmentPointer image = 3; - bool has_image() const; - private: - bool _internal_has_image() const; - public: - void clear_image(); - const ::SessionProtos::AttachmentPointer& image() const; - PROTOBUF_NODISCARD ::SessionProtos::AttachmentPointer* release_image(); - ::SessionProtos::AttachmentPointer* mutable_image(); - void set_allocated_image(::SessionProtos::AttachmentPointer* image); + void set_profilepicture(ArgT0&& arg0, ArgT... args); + std::string* mutable_profilepicture(); + PROTOBUF_NODISCARD std::string* release_profilepicture(); + void set_allocated_profilepicture(std::string* profilepicture); private: - const ::SessionProtos::AttachmentPointer& _internal_image() const; - ::SessionProtos::AttachmentPointer* _internal_mutable_image(); + const std::string& _internal_profilepicture() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilepicture(const std::string& value); + std::string* _internal_mutable_profilepicture(); public: - void unsafe_arena_set_allocated_image( - ::SessionProtos::AttachmentPointer* image); - ::SessionProtos::AttachmentPointer* unsafe_arena_release_image(); - // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.Preview) + // @@protoc_insertion_point(class_scope:SessionProtos.LokiProfile) private: class _Internal; @@ -2869,33 +2829,32 @@ class DataMessage_Preview final : struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr url_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr title_; - ::SessionProtos::AttachmentPointer* image_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr displayname_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilepicture_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class DataMessage_Reaction final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Reaction) */ { +class DataMessage_Quote_QuotedAttachment final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Quote.QuotedAttachment) */ { public: - inline DataMessage_Reaction() : DataMessage_Reaction(nullptr) {} - ~DataMessage_Reaction() override; - explicit PROTOBUF_CONSTEXPR DataMessage_Reaction(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline DataMessage_Quote_QuotedAttachment() : DataMessage_Quote_QuotedAttachment(nullptr) {} + ~DataMessage_Quote_QuotedAttachment() override; + explicit PROTOBUF_CONSTEXPR DataMessage_Quote_QuotedAttachment(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - DataMessage_Reaction(const DataMessage_Reaction& from); - DataMessage_Reaction(DataMessage_Reaction&& from) noexcept - : DataMessage_Reaction() { + DataMessage_Quote_QuotedAttachment(const DataMessage_Quote_QuotedAttachment& from); + DataMessage_Quote_QuotedAttachment(DataMessage_Quote_QuotedAttachment&& from) noexcept + : DataMessage_Quote_QuotedAttachment() { *this = ::std::move(from); } - inline DataMessage_Reaction& operator=(const DataMessage_Reaction& from) { + inline DataMessage_Quote_QuotedAttachment& operator=(const DataMessage_Quote_QuotedAttachment& from) { CopyFrom(from); return *this; } - inline DataMessage_Reaction& operator=(DataMessage_Reaction&& from) noexcept { + inline DataMessage_Quote_QuotedAttachment& operator=(DataMessage_Quote_QuotedAttachment&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -2916,20 +2875,20 @@ class DataMessage_Reaction final : return _internal_metadata_.mutable_unknown_fields(); } - static const DataMessage_Reaction& default_instance() { + static const DataMessage_Quote_QuotedAttachment& default_instance() { return *internal_default_instance(); } - static inline const DataMessage_Reaction* internal_default_instance() { - return reinterpret_cast( - &_DataMessage_Reaction_default_instance_); + static inline const DataMessage_Quote_QuotedAttachment* internal_default_instance() { + return reinterpret_cast( + &_DataMessage_Quote_QuotedAttachment_default_instance_); } static constexpr int kIndexInFileMessages = 12; - friend void swap(DataMessage_Reaction& a, DataMessage_Reaction& b) { + friend void swap(DataMessage_Quote_QuotedAttachment& a, DataMessage_Quote_QuotedAttachment& b) { a.Swap(&b); } - inline void Swap(DataMessage_Reaction* other) { + inline void Swap(DataMessage_Quote_QuotedAttachment* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -2942,7 +2901,7 @@ class DataMessage_Reaction final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataMessage_Reaction* other) { + void UnsafeArenaSwap(DataMessage_Quote_QuotedAttachment* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -2950,12 +2909,12 @@ class DataMessage_Reaction final : // implements Message ---------------------------------------------- - DataMessage_Reaction* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + DataMessage_Quote_QuotedAttachment* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const DataMessage_Reaction& from); - void MergeFrom(const DataMessage_Reaction& from); + void CopyFrom(const DataMessage_Quote_QuotedAttachment& from); + void MergeFrom(const DataMessage_Quote_QuotedAttachment& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -2969,15 +2928,15 @@ class DataMessage_Reaction final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(DataMessage_Reaction* other); + void InternalSwap(DataMessage_Quote_QuotedAttachment* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataMessage.Reaction"; + return "SessionProtos.DataMessage.Quote.QuotedAttachment"; } protected: - explicit DataMessage_Reaction(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit DataMessage_Quote_QuotedAttachment(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -2985,143 +2944,143 @@ class DataMessage_Reaction final : // nested types ---------------------------------------------------- - typedef DataMessage_Reaction_Action Action; - static constexpr Action REACT = - DataMessage_Reaction_Action_REACT; - static constexpr Action REMOVE = - DataMessage_Reaction_Action_REMOVE; - static inline bool Action_IsValid(int value) { - return DataMessage_Reaction_Action_IsValid(value); + typedef DataMessage_Quote_QuotedAttachment_Flags Flags; + static constexpr Flags VOICE_MESSAGE = + DataMessage_Quote_QuotedAttachment_Flags_VOICE_MESSAGE; + static inline bool Flags_IsValid(int value) { + return DataMessage_Quote_QuotedAttachment_Flags_IsValid(value); } - static constexpr Action Action_MIN = - DataMessage_Reaction_Action_Action_MIN; - static constexpr Action Action_MAX = - DataMessage_Reaction_Action_Action_MAX; - static constexpr int Action_ARRAYSIZE = - DataMessage_Reaction_Action_Action_ARRAYSIZE; + static constexpr Flags Flags_MIN = + DataMessage_Quote_QuotedAttachment_Flags_Flags_MIN; + static constexpr Flags Flags_MAX = + DataMessage_Quote_QuotedAttachment_Flags_Flags_MAX; + static constexpr int Flags_ARRAYSIZE = + DataMessage_Quote_QuotedAttachment_Flags_Flags_ARRAYSIZE; template - static inline const std::string& Action_Name(T enum_t_value) { - static_assert(::std::is_same::value || + static inline const std::string& Flags_Name(T enum_t_value) { + static_assert(::std::is_same::value || ::std::is_integral::value, - "Incorrect type passed to function Action_Name."); - return DataMessage_Reaction_Action_Name(enum_t_value); + "Incorrect type passed to function Flags_Name."); + return DataMessage_Quote_QuotedAttachment_Flags_Name(enum_t_value); } - static inline bool Action_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Action* value) { - return DataMessage_Reaction_Action_Parse(name, value); + static inline bool Flags_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Flags* value) { + return DataMessage_Quote_QuotedAttachment_Flags_Parse(name, value); } // accessors ------------------------------------------------------- enum : int { - kAuthorFieldNumber = 2, - kEmojiFieldNumber = 3, - kIdFieldNumber = 1, - kActionFieldNumber = 4, + kContentTypeFieldNumber = 1, + kFileNameFieldNumber = 2, + kThumbnailFieldNumber = 3, + kFlagsFieldNumber = 4, }; - // required string author = 2; - bool has_author() const; + // optional string contentType = 1; + bool has_contenttype() const; private: - bool _internal_has_author() const; + bool _internal_has_contenttype() const; public: - void clear_author(); - const std::string& author() const; + void clear_contenttype(); + const std::string& contenttype() const; template - void set_author(ArgT0&& arg0, ArgT... args); - std::string* mutable_author(); - PROTOBUF_NODISCARD std::string* release_author(); - void set_allocated_author(std::string* author); + void set_contenttype(ArgT0&& arg0, ArgT... args); + std::string* mutable_contenttype(); + PROTOBUF_NODISCARD std::string* release_contenttype(); + void set_allocated_contenttype(std::string* contenttype); private: - const std::string& _internal_author() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_author(const std::string& value); - std::string* _internal_mutable_author(); + const std::string& _internal_contenttype() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_contenttype(const std::string& value); + std::string* _internal_mutable_contenttype(); public: - // optional string emoji = 3; - bool has_emoji() const; + // optional string fileName = 2; + bool has_filename() const; private: - bool _internal_has_emoji() const; + bool _internal_has_filename() const; public: - void clear_emoji(); - const std::string& emoji() const; + void clear_filename(); + const std::string& filename() const; template - void set_emoji(ArgT0&& arg0, ArgT... args); - std::string* mutable_emoji(); - PROTOBUF_NODISCARD std::string* release_emoji(); - void set_allocated_emoji(std::string* emoji); + void set_filename(ArgT0&& arg0, ArgT... args); + std::string* mutable_filename(); + PROTOBUF_NODISCARD std::string* release_filename(); + void set_allocated_filename(std::string* filename); private: - const std::string& _internal_emoji() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_emoji(const std::string& value); - std::string* _internal_mutable_emoji(); + const std::string& _internal_filename() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_filename(const std::string& value); + std::string* _internal_mutable_filename(); public: - // required uint64 id = 1; - bool has_id() const; + // optional .SessionProtos.AttachmentPointer thumbnail = 3; + bool has_thumbnail() const; private: - bool _internal_has_id() const; + bool _internal_has_thumbnail() const; public: - void clear_id(); - uint64_t id() const; - void set_id(uint64_t value); + void clear_thumbnail(); + const ::SessionProtos::AttachmentPointer& thumbnail() const; + PROTOBUF_NODISCARD ::SessionProtos::AttachmentPointer* release_thumbnail(); + ::SessionProtos::AttachmentPointer* mutable_thumbnail(); + void set_allocated_thumbnail(::SessionProtos::AttachmentPointer* thumbnail); private: - uint64_t _internal_id() const; - void _internal_set_id(uint64_t value); + const ::SessionProtos::AttachmentPointer& _internal_thumbnail() const; + ::SessionProtos::AttachmentPointer* _internal_mutable_thumbnail(); public: + void unsafe_arena_set_allocated_thumbnail( + ::SessionProtos::AttachmentPointer* thumbnail); + ::SessionProtos::AttachmentPointer* unsafe_arena_release_thumbnail(); - // required .SessionProtos.DataMessage.Reaction.Action action = 4; - bool has_action() const; + // optional uint32 flags = 4; + bool has_flags() const; private: - bool _internal_has_action() const; + bool _internal_has_flags() const; public: - void clear_action(); - ::SessionProtos::DataMessage_Reaction_Action action() const; - void set_action(::SessionProtos::DataMessage_Reaction_Action value); + void clear_flags(); + uint32_t flags() const; + void set_flags(uint32_t value); private: - ::SessionProtos::DataMessage_Reaction_Action _internal_action() const; - void _internal_set_action(::SessionProtos::DataMessage_Reaction_Action value); + uint32_t _internal_flags() const; + void _internal_set_flags(uint32_t value); public: - // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.Reaction) + // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.Quote.QuotedAttachment) private: class _Internal; - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr author_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr emoji_; - uint64_t id_; - int action_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr contenttype_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr filename_; + ::SessionProtos::AttachmentPointer* thumbnail_; + uint32_t flags_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class DataMessage_OpenGroupInvitation final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.OpenGroupInvitation) */ { +class DataMessage_Quote final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Quote) */ { public: - inline DataMessage_OpenGroupInvitation() : DataMessage_OpenGroupInvitation(nullptr) {} - ~DataMessage_OpenGroupInvitation() override; - explicit PROTOBUF_CONSTEXPR DataMessage_OpenGroupInvitation(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline DataMessage_Quote() : DataMessage_Quote(nullptr) {} + ~DataMessage_Quote() override; + explicit PROTOBUF_CONSTEXPR DataMessage_Quote(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - DataMessage_OpenGroupInvitation(const DataMessage_OpenGroupInvitation& from); - DataMessage_OpenGroupInvitation(DataMessage_OpenGroupInvitation&& from) noexcept - : DataMessage_OpenGroupInvitation() { + DataMessage_Quote(const DataMessage_Quote& from); + DataMessage_Quote(DataMessage_Quote&& from) noexcept + : DataMessage_Quote() { *this = ::std::move(from); } - inline DataMessage_OpenGroupInvitation& operator=(const DataMessage_OpenGroupInvitation& from) { + inline DataMessage_Quote& operator=(const DataMessage_Quote& from) { CopyFrom(from); return *this; } - inline DataMessage_OpenGroupInvitation& operator=(DataMessage_OpenGroupInvitation&& from) noexcept { + inline DataMessage_Quote& operator=(DataMessage_Quote&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -3142,20 +3101,20 @@ class DataMessage_OpenGroupInvitation final : return _internal_metadata_.mutable_unknown_fields(); } - static const DataMessage_OpenGroupInvitation& default_instance() { + static const DataMessage_Quote& default_instance() { return *internal_default_instance(); } - static inline const DataMessage_OpenGroupInvitation* internal_default_instance() { - return reinterpret_cast( - &_DataMessage_OpenGroupInvitation_default_instance_); + static inline const DataMessage_Quote* internal_default_instance() { + return reinterpret_cast( + &_DataMessage_Quote_default_instance_); } static constexpr int kIndexInFileMessages = 13; - friend void swap(DataMessage_OpenGroupInvitation& a, DataMessage_OpenGroupInvitation& b) { + friend void swap(DataMessage_Quote& a, DataMessage_Quote& b) { a.Swap(&b); } - inline void Swap(DataMessage_OpenGroupInvitation* other) { + inline void Swap(DataMessage_Quote* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -3168,7 +3127,7 @@ class DataMessage_OpenGroupInvitation final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataMessage_OpenGroupInvitation* other) { + void UnsafeArenaSwap(DataMessage_Quote* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -3176,12 +3135,12 @@ class DataMessage_OpenGroupInvitation final : // implements Message ---------------------------------------------- - DataMessage_OpenGroupInvitation* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + DataMessage_Quote* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const DataMessage_OpenGroupInvitation& from); - void MergeFrom(const DataMessage_OpenGroupInvitation& from); + void CopyFrom(const DataMessage_Quote& from); + void MergeFrom(const DataMessage_Quote& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3195,15 +3154,15 @@ class DataMessage_OpenGroupInvitation final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(DataMessage_OpenGroupInvitation* other); + void InternalSwap(DataMessage_Quote* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataMessage.OpenGroupInvitation"; + return "SessionProtos.DataMessage.Quote"; } protected: - explicit DataMessage_OpenGroupInvitation(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit DataMessage_Quote(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -3211,49 +3170,84 @@ class DataMessage_OpenGroupInvitation final : // nested types ---------------------------------------------------- + typedef DataMessage_Quote_QuotedAttachment QuotedAttachment; + // accessors ------------------------------------------------------- enum : int { - kUrlFieldNumber = 1, - kNameFieldNumber = 3, + kAttachmentsFieldNumber = 4, + kAuthorFieldNumber = 2, + kTextFieldNumber = 3, + kIdFieldNumber = 1, }; - // required string url = 1; - bool has_url() const; + // repeated .SessionProtos.DataMessage.Quote.QuotedAttachment attachments = 4; + int attachments_size() const; private: - bool _internal_has_url() const; + int _internal_attachments_size() const; public: - void clear_url(); - const std::string& url() const; + void clear_attachments(); + ::SessionProtos::DataMessage_Quote_QuotedAttachment* mutable_attachments(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Quote_QuotedAttachment >* + mutable_attachments(); + private: + const ::SessionProtos::DataMessage_Quote_QuotedAttachment& _internal_attachments(int index) const; + ::SessionProtos::DataMessage_Quote_QuotedAttachment* _internal_add_attachments(); + public: + const ::SessionProtos::DataMessage_Quote_QuotedAttachment& attachments(int index) const; + ::SessionProtos::DataMessage_Quote_QuotedAttachment* add_attachments(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Quote_QuotedAttachment >& + attachments() const; + + // required string author = 2; + bool has_author() const; + private: + bool _internal_has_author() const; + public: + void clear_author(); + const std::string& author() const; template - void set_url(ArgT0&& arg0, ArgT... args); - std::string* mutable_url(); - PROTOBUF_NODISCARD std::string* release_url(); - void set_allocated_url(std::string* url); + void set_author(ArgT0&& arg0, ArgT... args); + std::string* mutable_author(); + PROTOBUF_NODISCARD std::string* release_author(); + void set_allocated_author(std::string* author); private: - const std::string& _internal_url() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_url(const std::string& value); - std::string* _internal_mutable_url(); + const std::string& _internal_author() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_author(const std::string& value); + std::string* _internal_mutable_author(); public: - // required string name = 3; - bool has_name() const; + // optional string text = 3; + bool has_text() const; private: - bool _internal_has_name() const; + bool _internal_has_text() const; public: - void clear_name(); - const std::string& name() const; + void clear_text(); + const std::string& text() const; template - void set_name(ArgT0&& arg0, ArgT... args); - std::string* mutable_name(); - PROTOBUF_NODISCARD std::string* release_name(); - void set_allocated_name(std::string* name); + void set_text(ArgT0&& arg0, ArgT... args); + std::string* mutable_text(); + PROTOBUF_NODISCARD std::string* release_text(); + void set_allocated_text(std::string* text); private: - const std::string& _internal_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); - std::string* _internal_mutable_name(); + const std::string& _internal_text() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_text(const std::string& value); + std::string* _internal_mutable_text(); public: - // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.OpenGroupInvitation) + // required uint64 id = 1; + bool has_id() const; + private: + bool _internal_has_id() const; + public: + void clear_id(); + uint64_t id() const; + void set_id(uint64_t value); + private: + uint64_t _internal_id() const; + void _internal_set_id(uint64_t value); + public: + + // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.Quote) private: class _Internal; @@ -3266,32 +3260,34 @@ class DataMessage_OpenGroupInvitation final : struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr url_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Quote_QuotedAttachment > attachments_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr author_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr text_; + uint64_t id_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class DataMessage_ClosedGroupControlMessage_KeyPairWrapper final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) */ { +class DataMessage_Preview final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Preview) */ { public: - inline DataMessage_ClosedGroupControlMessage_KeyPairWrapper() : DataMessage_ClosedGroupControlMessage_KeyPairWrapper(nullptr) {} - ~DataMessage_ClosedGroupControlMessage_KeyPairWrapper() override; - explicit PROTOBUF_CONSTEXPR DataMessage_ClosedGroupControlMessage_KeyPairWrapper(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline DataMessage_Preview() : DataMessage_Preview(nullptr) {} + ~DataMessage_Preview() override; + explicit PROTOBUF_CONSTEXPR DataMessage_Preview(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - DataMessage_ClosedGroupControlMessage_KeyPairWrapper(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from); - DataMessage_ClosedGroupControlMessage_KeyPairWrapper(DataMessage_ClosedGroupControlMessage_KeyPairWrapper&& from) noexcept - : DataMessage_ClosedGroupControlMessage_KeyPairWrapper() { + DataMessage_Preview(const DataMessage_Preview& from); + DataMessage_Preview(DataMessage_Preview&& from) noexcept + : DataMessage_Preview() { *this = ::std::move(from); } - inline DataMessage_ClosedGroupControlMessage_KeyPairWrapper& operator=(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from) { + inline DataMessage_Preview& operator=(const DataMessage_Preview& from) { CopyFrom(from); return *this; } - inline DataMessage_ClosedGroupControlMessage_KeyPairWrapper& operator=(DataMessage_ClosedGroupControlMessage_KeyPairWrapper&& from) noexcept { + inline DataMessage_Preview& operator=(DataMessage_Preview&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -3312,20 +3308,20 @@ class DataMessage_ClosedGroupControlMessage_KeyPairWrapper final : return _internal_metadata_.mutable_unknown_fields(); } - static const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& default_instance() { + static const DataMessage_Preview& default_instance() { return *internal_default_instance(); } - static inline const DataMessage_ClosedGroupControlMessage_KeyPairWrapper* internal_default_instance() { - return reinterpret_cast( - &_DataMessage_ClosedGroupControlMessage_KeyPairWrapper_default_instance_); + static inline const DataMessage_Preview* internal_default_instance() { + return reinterpret_cast( + &_DataMessage_Preview_default_instance_); } static constexpr int kIndexInFileMessages = 14; - friend void swap(DataMessage_ClosedGroupControlMessage_KeyPairWrapper& a, DataMessage_ClosedGroupControlMessage_KeyPairWrapper& b) { + friend void swap(DataMessage_Preview& a, DataMessage_Preview& b) { a.Swap(&b); } - inline void Swap(DataMessage_ClosedGroupControlMessage_KeyPairWrapper* other) { + inline void Swap(DataMessage_Preview* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -3338,7 +3334,7 @@ class DataMessage_ClosedGroupControlMessage_KeyPairWrapper final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataMessage_ClosedGroupControlMessage_KeyPairWrapper* other) { + void UnsafeArenaSwap(DataMessage_Preview* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -3346,12 +3342,12 @@ class DataMessage_ClosedGroupControlMessage_KeyPairWrapper final : // implements Message ---------------------------------------------- - DataMessage_ClosedGroupControlMessage_KeyPairWrapper* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + DataMessage_Preview* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from); - void MergeFrom(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from); + void CopyFrom(const DataMessage_Preview& from); + void MergeFrom(const DataMessage_Preview& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3365,15 +3361,15 @@ class DataMessage_ClosedGroupControlMessage_KeyPairWrapper final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(DataMessage_ClosedGroupControlMessage_KeyPairWrapper* other); + void InternalSwap(DataMessage_Preview* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper"; + return "SessionProtos.DataMessage.Preview"; } protected: - explicit DataMessage_ClosedGroupControlMessage_KeyPairWrapper(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit DataMessage_Preview(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -3384,84 +3380,101 @@ class DataMessage_ClosedGroupControlMessage_KeyPairWrapper final : // accessors ------------------------------------------------------- enum : int { - kPublicKeyFieldNumber = 1, - kEncryptedKeyPairFieldNumber = 2, + kUrlFieldNumber = 1, + kTitleFieldNumber = 2, + kImageFieldNumber = 3, }; - // required bytes publicKey = 1; - bool has_publickey() const; + // required string url = 1; + bool has_url() const; private: - bool _internal_has_publickey() const; + bool _internal_has_url() const; public: - void clear_publickey(); - const std::string& publickey() const; + void clear_url(); + const std::string& url() const; template - void set_publickey(ArgT0&& arg0, ArgT... args); - std::string* mutable_publickey(); - PROTOBUF_NODISCARD std::string* release_publickey(); - void set_allocated_publickey(std::string* publickey); + void set_url(ArgT0&& arg0, ArgT... args); + std::string* mutable_url(); + PROTOBUF_NODISCARD std::string* release_url(); + void set_allocated_url(std::string* url); private: - const std::string& _internal_publickey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_publickey(const std::string& value); - std::string* _internal_mutable_publickey(); + const std::string& _internal_url() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_url(const std::string& value); + std::string* _internal_mutable_url(); public: - // required bytes encryptedKeyPair = 2; - bool has_encryptedkeypair() const; + // optional string title = 2; + bool has_title() const; private: - bool _internal_has_encryptedkeypair() const; + bool _internal_has_title() const; public: - void clear_encryptedkeypair(); - const std::string& encryptedkeypair() const; + void clear_title(); + const std::string& title() const; template - void set_encryptedkeypair(ArgT0&& arg0, ArgT... args); - std::string* mutable_encryptedkeypair(); - PROTOBUF_NODISCARD std::string* release_encryptedkeypair(); - void set_allocated_encryptedkeypair(std::string* encryptedkeypair); + void set_title(ArgT0&& arg0, ArgT... args); + std::string* mutable_title(); + PROTOBUF_NODISCARD std::string* release_title(); + void set_allocated_title(std::string* title); private: - const std::string& _internal_encryptedkeypair() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_encryptedkeypair(const std::string& value); - std::string* _internal_mutable_encryptedkeypair(); + const std::string& _internal_title() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_title(const std::string& value); + std::string* _internal_mutable_title(); public: - // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) + // optional .SessionProtos.AttachmentPointer image = 3; + bool has_image() const; + private: + bool _internal_has_image() const; + public: + void clear_image(); + const ::SessionProtos::AttachmentPointer& image() const; + PROTOBUF_NODISCARD ::SessionProtos::AttachmentPointer* release_image(); + ::SessionProtos::AttachmentPointer* mutable_image(); + void set_allocated_image(::SessionProtos::AttachmentPointer* image); + private: + const ::SessionProtos::AttachmentPointer& _internal_image() const; + ::SessionProtos::AttachmentPointer* _internal_mutable_image(); + public: + void unsafe_arena_set_allocated_image( + ::SessionProtos::AttachmentPointer* image); + ::SessionProtos::AttachmentPointer* unsafe_arena_release_image(); + + // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.Preview) private: class _Internal; - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr publickey_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr encryptedkeypair_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr url_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr title_; + ::SessionProtos::AttachmentPointer* image_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class DataMessage_ClosedGroupControlMessage final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.ClosedGroupControlMessage) */ { +class DataMessage_Reaction final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Reaction) */ { public: - inline DataMessage_ClosedGroupControlMessage() : DataMessage_ClosedGroupControlMessage(nullptr) {} - ~DataMessage_ClosedGroupControlMessage() override; - explicit PROTOBUF_CONSTEXPR DataMessage_ClosedGroupControlMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline DataMessage_Reaction() : DataMessage_Reaction(nullptr) {} + ~DataMessage_Reaction() override; + explicit PROTOBUF_CONSTEXPR DataMessage_Reaction(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - DataMessage_ClosedGroupControlMessage(const DataMessage_ClosedGroupControlMessage& from); - DataMessage_ClosedGroupControlMessage(DataMessage_ClosedGroupControlMessage&& from) noexcept - : DataMessage_ClosedGroupControlMessage() { + DataMessage_Reaction(const DataMessage_Reaction& from); + DataMessage_Reaction(DataMessage_Reaction&& from) noexcept + : DataMessage_Reaction() { *this = ::std::move(from); } - inline DataMessage_ClosedGroupControlMessage& operator=(const DataMessage_ClosedGroupControlMessage& from) { + inline DataMessage_Reaction& operator=(const DataMessage_Reaction& from) { CopyFrom(from); return *this; } - inline DataMessage_ClosedGroupControlMessage& operator=(DataMessage_ClosedGroupControlMessage&& from) noexcept { + inline DataMessage_Reaction& operator=(DataMessage_Reaction&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -3482,20 +3495,20 @@ class DataMessage_ClosedGroupControlMessage final : return _internal_metadata_.mutable_unknown_fields(); } - static const DataMessage_ClosedGroupControlMessage& default_instance() { + static const DataMessage_Reaction& default_instance() { return *internal_default_instance(); } - static inline const DataMessage_ClosedGroupControlMessage* internal_default_instance() { - return reinterpret_cast( - &_DataMessage_ClosedGroupControlMessage_default_instance_); + static inline const DataMessage_Reaction* internal_default_instance() { + return reinterpret_cast( + &_DataMessage_Reaction_default_instance_); } static constexpr int kIndexInFileMessages = 15; - friend void swap(DataMessage_ClosedGroupControlMessage& a, DataMessage_ClosedGroupControlMessage& b) { + friend void swap(DataMessage_Reaction& a, DataMessage_Reaction& b) { a.Swap(&b); } - inline void Swap(DataMessage_ClosedGroupControlMessage* other) { + inline void Swap(DataMessage_Reaction* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -3508,7 +3521,7 @@ class DataMessage_ClosedGroupControlMessage final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataMessage_ClosedGroupControlMessage* other) { + void UnsafeArenaSwap(DataMessage_Reaction* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -3516,12 +3529,12 @@ class DataMessage_ClosedGroupControlMessage final : // implements Message ---------------------------------------------- - DataMessage_ClosedGroupControlMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + DataMessage_Reaction* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const DataMessage_ClosedGroupControlMessage& from); - void MergeFrom(const DataMessage_ClosedGroupControlMessage& from); + void CopyFrom(const DataMessage_Reaction& from); + void MergeFrom(const DataMessage_Reaction& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3535,15 +3548,15 @@ class DataMessage_ClosedGroupControlMessage final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(DataMessage_ClosedGroupControlMessage* other); + void InternalSwap(DataMessage_Reaction* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataMessage.ClosedGroupControlMessage"; + return "SessionProtos.DataMessage.Reaction"; } protected: - explicit DataMessage_ClosedGroupControlMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit DataMessage_Reaction(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -3551,244 +3564,143 @@ class DataMessage_ClosedGroupControlMessage final : // nested types ---------------------------------------------------- - typedef DataMessage_ClosedGroupControlMessage_KeyPairWrapper KeyPairWrapper; - - typedef DataMessage_ClosedGroupControlMessage_Type Type; - static constexpr Type NEW = - DataMessage_ClosedGroupControlMessage_Type_NEW; - static constexpr Type ENCRYPTION_KEY_PAIR = - DataMessage_ClosedGroupControlMessage_Type_ENCRYPTION_KEY_PAIR; - static constexpr Type NAME_CHANGE = - DataMessage_ClosedGroupControlMessage_Type_NAME_CHANGE; - static constexpr Type MEMBERS_ADDED = - DataMessage_ClosedGroupControlMessage_Type_MEMBERS_ADDED; - static constexpr Type MEMBERS_REMOVED = - DataMessage_ClosedGroupControlMessage_Type_MEMBERS_REMOVED; - static constexpr Type MEMBER_LEFT = - DataMessage_ClosedGroupControlMessage_Type_MEMBER_LEFT; - static constexpr Type ENCRYPTION_KEY_PAIR_REQUEST = - DataMessage_ClosedGroupControlMessage_Type_ENCRYPTION_KEY_PAIR_REQUEST; - static inline bool Type_IsValid(int value) { - return DataMessage_ClosedGroupControlMessage_Type_IsValid(value); + typedef DataMessage_Reaction_Action Action; + static constexpr Action REACT = + DataMessage_Reaction_Action_REACT; + static constexpr Action REMOVE = + DataMessage_Reaction_Action_REMOVE; + static inline bool Action_IsValid(int value) { + return DataMessage_Reaction_Action_IsValid(value); } - static constexpr Type Type_MIN = - DataMessage_ClosedGroupControlMessage_Type_Type_MIN; - static constexpr Type Type_MAX = - DataMessage_ClosedGroupControlMessage_Type_Type_MAX; - static constexpr int Type_ARRAYSIZE = - DataMessage_ClosedGroupControlMessage_Type_Type_ARRAYSIZE; + static constexpr Action Action_MIN = + DataMessage_Reaction_Action_Action_MIN; + static constexpr Action Action_MAX = + DataMessage_Reaction_Action_Action_MAX; + static constexpr int Action_ARRAYSIZE = + DataMessage_Reaction_Action_Action_ARRAYSIZE; template - static inline const std::string& Type_Name(T enum_t_value) { - static_assert(::std::is_same::value || + static inline const std::string& Action_Name(T enum_t_value) { + static_assert(::std::is_same::value || ::std::is_integral::value, - "Incorrect type passed to function Type_Name."); - return DataMessage_ClosedGroupControlMessage_Type_Name(enum_t_value); + "Incorrect type passed to function Action_Name."); + return DataMessage_Reaction_Action_Name(enum_t_value); } - static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Type* value) { - return DataMessage_ClosedGroupControlMessage_Type_Parse(name, value); + static inline bool Action_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Action* value) { + return DataMessage_Reaction_Action_Parse(name, value); } // accessors ------------------------------------------------------- enum : int { - kMembersFieldNumber = 5, - kAdminsFieldNumber = 6, - kWrappersFieldNumber = 7, - kPublicKeyFieldNumber = 2, - kNameFieldNumber = 3, - kEncryptionKeyPairFieldNumber = 4, - kExpirationTimerFieldNumber = 8, - kTypeFieldNumber = 1, + kAuthorFieldNumber = 2, + kEmojiFieldNumber = 3, + kIdFieldNumber = 1, + kActionFieldNumber = 4, }; - // repeated bytes members = 5; - int members_size() const; + // required string author = 2; + bool has_author() const; private: - int _internal_members_size() const; + bool _internal_has_author() const; public: - void clear_members(); - const std::string& members(int index) const; - std::string* mutable_members(int index); - void set_members(int index, const std::string& value); - void set_members(int index, std::string&& value); - void set_members(int index, const char* value); - void set_members(int index, const void* value, size_t size); - std::string* add_members(); - void add_members(const std::string& value); - void add_members(std::string&& value); - void add_members(const char* value); - void add_members(const void* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& members() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_members(); + void clear_author(); + const std::string& author() const; + template + void set_author(ArgT0&& arg0, ArgT... args); + std::string* mutable_author(); + PROTOBUF_NODISCARD std::string* release_author(); + void set_allocated_author(std::string* author); private: - const std::string& _internal_members(int index) const; - std::string* _internal_add_members(); + const std::string& _internal_author() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_author(const std::string& value); + std::string* _internal_mutable_author(); public: - // repeated bytes admins = 6; - int admins_size() const; + // optional string emoji = 3; + bool has_emoji() const; private: - int _internal_admins_size() const; - public: - void clear_admins(); - const std::string& admins(int index) const; - std::string* mutable_admins(int index); - void set_admins(int index, const std::string& value); - void set_admins(int index, std::string&& value); - void set_admins(int index, const char* value); - void set_admins(int index, const void* value, size_t size); - std::string* add_admins(); - void add_admins(const std::string& value); - void add_admins(std::string&& value); - void add_admins(const char* value); - void add_admins(const void* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& admins() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_admins(); - private: - const std::string& _internal_admins(int index) const; - std::string* _internal_add_admins(); - public: - - // repeated .SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper wrappers = 7; - int wrappers_size() const; - private: - int _internal_wrappers_size() const; - public: - void clear_wrappers(); - ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper* mutable_wrappers(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper >* - mutable_wrappers(); - private: - const ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper& _internal_wrappers(int index) const; - ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper* _internal_add_wrappers(); - public: - const ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper& wrappers(int index) const; - ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper* add_wrappers(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper >& - wrappers() const; - - // optional bytes publicKey = 2; - bool has_publickey() const; - private: - bool _internal_has_publickey() const; - public: - void clear_publickey(); - const std::string& publickey() const; - template - void set_publickey(ArgT0&& arg0, ArgT... args); - std::string* mutable_publickey(); - PROTOBUF_NODISCARD std::string* release_publickey(); - void set_allocated_publickey(std::string* publickey); - private: - const std::string& _internal_publickey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_publickey(const std::string& value); - std::string* _internal_mutable_publickey(); - public: - - // optional string name = 3; - bool has_name() const; - private: - bool _internal_has_name() const; + bool _internal_has_emoji() const; public: - void clear_name(); - const std::string& name() const; + void clear_emoji(); + const std::string& emoji() const; template - void set_name(ArgT0&& arg0, ArgT... args); - std::string* mutable_name(); - PROTOBUF_NODISCARD std::string* release_name(); - void set_allocated_name(std::string* name); - private: - const std::string& _internal_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); - std::string* _internal_mutable_name(); - public: - - // optional .SessionProtos.KeyPair encryptionKeyPair = 4; - bool has_encryptionkeypair() const; - private: - bool _internal_has_encryptionkeypair() const; - public: - void clear_encryptionkeypair(); - const ::SessionProtos::KeyPair& encryptionkeypair() const; - PROTOBUF_NODISCARD ::SessionProtos::KeyPair* release_encryptionkeypair(); - ::SessionProtos::KeyPair* mutable_encryptionkeypair(); - void set_allocated_encryptionkeypair(::SessionProtos::KeyPair* encryptionkeypair); + void set_emoji(ArgT0&& arg0, ArgT... args); + std::string* mutable_emoji(); + PROTOBUF_NODISCARD std::string* release_emoji(); + void set_allocated_emoji(std::string* emoji); private: - const ::SessionProtos::KeyPair& _internal_encryptionkeypair() const; - ::SessionProtos::KeyPair* _internal_mutable_encryptionkeypair(); + const std::string& _internal_emoji() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_emoji(const std::string& value); + std::string* _internal_mutable_emoji(); public: - void unsafe_arena_set_allocated_encryptionkeypair( - ::SessionProtos::KeyPair* encryptionkeypair); - ::SessionProtos::KeyPair* unsafe_arena_release_encryptionkeypair(); - // optional uint32 expirationTimer = 8; - bool has_expirationtimer() const; + // required uint64 id = 1; + bool has_id() const; private: - bool _internal_has_expirationtimer() const; + bool _internal_has_id() const; public: - void clear_expirationtimer(); - uint32_t expirationtimer() const; - void set_expirationtimer(uint32_t value); + void clear_id(); + uint64_t id() const; + void set_id(uint64_t value); private: - uint32_t _internal_expirationtimer() const; - void _internal_set_expirationtimer(uint32_t value); + uint64_t _internal_id() const; + void _internal_set_id(uint64_t value); public: - // required .SessionProtos.DataMessage.ClosedGroupControlMessage.Type type = 1; - bool has_type() const; + // required .SessionProtos.DataMessage.Reaction.Action action = 4; + bool has_action() const; private: - bool _internal_has_type() const; + bool _internal_has_action() const; public: - void clear_type(); - ::SessionProtos::DataMessage_ClosedGroupControlMessage_Type type() const; - void set_type(::SessionProtos::DataMessage_ClosedGroupControlMessage_Type value); + void clear_action(); + ::SessionProtos::DataMessage_Reaction_Action action() const; + void set_action(::SessionProtos::DataMessage_Reaction_Action value); private: - ::SessionProtos::DataMessage_ClosedGroupControlMessage_Type _internal_type() const; - void _internal_set_type(::SessionProtos::DataMessage_ClosedGroupControlMessage_Type value); + ::SessionProtos::DataMessage_Reaction_Action _internal_action() const; + void _internal_set_action(::SessionProtos::DataMessage_Reaction_Action value); public: - // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.ClosedGroupControlMessage) + // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.Reaction) private: class _Internal; + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField members_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField admins_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper > wrappers_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr publickey_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::SessionProtos::KeyPair* encryptionkeypair_; - uint32_t expirationtimer_; - int type_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr author_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr emoji_; + uint64_t id_; + int action_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class DataMessage final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage) */ { +class DataMessage_OpenGroupInvitation final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.OpenGroupInvitation) */ { public: - inline DataMessage() : DataMessage(nullptr) {} - ~DataMessage() override; - explicit PROTOBUF_CONSTEXPR DataMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline DataMessage_OpenGroupInvitation() : DataMessage_OpenGroupInvitation(nullptr) {} + ~DataMessage_OpenGroupInvitation() override; + explicit PROTOBUF_CONSTEXPR DataMessage_OpenGroupInvitation(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - DataMessage(const DataMessage& from); - DataMessage(DataMessage&& from) noexcept - : DataMessage() { + DataMessage_OpenGroupInvitation(const DataMessage_OpenGroupInvitation& from); + DataMessage_OpenGroupInvitation(DataMessage_OpenGroupInvitation&& from) noexcept + : DataMessage_OpenGroupInvitation() { *this = ::std::move(from); } - inline DataMessage& operator=(const DataMessage& from) { + inline DataMessage_OpenGroupInvitation& operator=(const DataMessage_OpenGroupInvitation& from) { CopyFrom(from); return *this; } - inline DataMessage& operator=(DataMessage&& from) noexcept { + inline DataMessage_OpenGroupInvitation& operator=(DataMessage_OpenGroupInvitation&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -3809,20 +3721,20 @@ class DataMessage final : return _internal_metadata_.mutable_unknown_fields(); } - static const DataMessage& default_instance() { + static const DataMessage_OpenGroupInvitation& default_instance() { return *internal_default_instance(); } - static inline const DataMessage* internal_default_instance() { - return reinterpret_cast( - &_DataMessage_default_instance_); + static inline const DataMessage_OpenGroupInvitation* internal_default_instance() { + return reinterpret_cast( + &_DataMessage_OpenGroupInvitation_default_instance_); } static constexpr int kIndexInFileMessages = 16; - friend void swap(DataMessage& a, DataMessage& b) { + friend void swap(DataMessage_OpenGroupInvitation& a, DataMessage_OpenGroupInvitation& b) { a.Swap(&b); } - inline void Swap(DataMessage* other) { + inline void Swap(DataMessage_OpenGroupInvitation* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -3835,7 +3747,7 @@ class DataMessage final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataMessage* other) { + void UnsafeArenaSwap(DataMessage_OpenGroupInvitation* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -3843,12 +3755,12 @@ class DataMessage final : // implements Message ---------------------------------------------- - DataMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + DataMessage_OpenGroupInvitation* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const DataMessage& from); - void MergeFrom(const DataMessage& from); + void CopyFrom(const DataMessage_OpenGroupInvitation& from); + void MergeFrom(const DataMessage_OpenGroupInvitation& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3862,15 +3774,15 @@ class DataMessage final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(DataMessage* other); + void InternalSwap(DataMessage_OpenGroupInvitation* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataMessage"; + return "SessionProtos.DataMessage.OpenGroupInvitation"; } protected: - explicit DataMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit DataMessage_OpenGroupInvitation(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -3878,334 +3790,87 @@ class DataMessage final : // nested types ---------------------------------------------------- - typedef DataMessage_Quote Quote; - typedef DataMessage_Preview Preview; - typedef DataMessage_Reaction Reaction; - typedef DataMessage_OpenGroupInvitation OpenGroupInvitation; - typedef DataMessage_ClosedGroupControlMessage ClosedGroupControlMessage; - - typedef DataMessage_Flags Flags; - static constexpr Flags EXPIRATION_TIMER_UPDATE = - DataMessage_Flags_EXPIRATION_TIMER_UPDATE; - static inline bool Flags_IsValid(int value) { - return DataMessage_Flags_IsValid(value); - } - static constexpr Flags Flags_MIN = - DataMessage_Flags_Flags_MIN; - static constexpr Flags Flags_MAX = - DataMessage_Flags_Flags_MAX; - static constexpr int Flags_ARRAYSIZE = - DataMessage_Flags_Flags_ARRAYSIZE; - template - static inline const std::string& Flags_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function Flags_Name."); - return DataMessage_Flags_Name(enum_t_value); - } - static inline bool Flags_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Flags* value) { - return DataMessage_Flags_Parse(name, value); - } - // accessors ------------------------------------------------------- enum : int { - kAttachmentsFieldNumber = 2, - kPreviewFieldNumber = 10, - kBodyFieldNumber = 1, - kProfileKeyFieldNumber = 6, - kSyncTargetFieldNumber = 105, - kQuoteFieldNumber = 8, - kReactionFieldNumber = 11, - kProfileFieldNumber = 101, - kOpenGroupInvitationFieldNumber = 102, - kClosedGroupControlMessageFieldNumber = 104, - kFlagsFieldNumber = 4, - kExpireTimerFieldNumber = 5, - kTimestampFieldNumber = 7, - kBlocksCommunityMessageRequestsFieldNumber = 106, + kUrlFieldNumber = 1, + kNameFieldNumber = 3, }; - // repeated .SessionProtos.AttachmentPointer attachments = 2; - int attachments_size() const; - private: - int _internal_attachments_size() const; - public: - void clear_attachments(); - ::SessionProtos::AttachmentPointer* mutable_attachments(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer >* - mutable_attachments(); + // required string url = 1; + bool has_url() const; private: - const ::SessionProtos::AttachmentPointer& _internal_attachments(int index) const; - ::SessionProtos::AttachmentPointer* _internal_add_attachments(); + bool _internal_has_url() const; public: - const ::SessionProtos::AttachmentPointer& attachments(int index) const; - ::SessionProtos::AttachmentPointer* add_attachments(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer >& - attachments() const; - - // repeated .SessionProtos.DataMessage.Preview preview = 10; - int preview_size() const; - private: - int _internal_preview_size() const; - public: - void clear_preview(); - ::SessionProtos::DataMessage_Preview* mutable_preview(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview >* - mutable_preview(); - private: - const ::SessionProtos::DataMessage_Preview& _internal_preview(int index) const; - ::SessionProtos::DataMessage_Preview* _internal_add_preview(); - public: - const ::SessionProtos::DataMessage_Preview& preview(int index) const; - ::SessionProtos::DataMessage_Preview* add_preview(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview >& - preview() const; - - // optional string body = 1; - bool has_body() const; - private: - bool _internal_has_body() const; - public: - void clear_body(); - const std::string& body() const; - template - void set_body(ArgT0&& arg0, ArgT... args); - std::string* mutable_body(); - PROTOBUF_NODISCARD std::string* release_body(); - void set_allocated_body(std::string* body); - private: - const std::string& _internal_body() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_body(const std::string& value); - std::string* _internal_mutable_body(); - public: - - // optional bytes profileKey = 6; - bool has_profilekey() const; - private: - bool _internal_has_profilekey() const; - public: - void clear_profilekey(); - const std::string& profilekey() const; + void clear_url(); + const std::string& url() const; template - void set_profilekey(ArgT0&& arg0, ArgT... args); - std::string* mutable_profilekey(); - PROTOBUF_NODISCARD std::string* release_profilekey(); - void set_allocated_profilekey(std::string* profilekey); + void set_url(ArgT0&& arg0, ArgT... args); + std::string* mutable_url(); + PROTOBUF_NODISCARD std::string* release_url(); + void set_allocated_url(std::string* url); private: - const std::string& _internal_profilekey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilekey(const std::string& value); - std::string* _internal_mutable_profilekey(); + const std::string& _internal_url() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_url(const std::string& value); + std::string* _internal_mutable_url(); public: - // optional string syncTarget = 105; - bool has_synctarget() const; + // required string name = 3; + bool has_name() const; private: - bool _internal_has_synctarget() const; + bool _internal_has_name() const; public: - void clear_synctarget(); - const std::string& synctarget() const; + void clear_name(); + const std::string& name() const; template - void set_synctarget(ArgT0&& arg0, ArgT... args); - std::string* mutable_synctarget(); - PROTOBUF_NODISCARD std::string* release_synctarget(); - void set_allocated_synctarget(std::string* synctarget); - private: - const std::string& _internal_synctarget() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_synctarget(const std::string& value); - std::string* _internal_mutable_synctarget(); - public: - - // optional .SessionProtos.DataMessage.Quote quote = 8; - bool has_quote() const; - private: - bool _internal_has_quote() const; - public: - void clear_quote(); - const ::SessionProtos::DataMessage_Quote& quote() const; - PROTOBUF_NODISCARD ::SessionProtos::DataMessage_Quote* release_quote(); - ::SessionProtos::DataMessage_Quote* mutable_quote(); - void set_allocated_quote(::SessionProtos::DataMessage_Quote* quote); - private: - const ::SessionProtos::DataMessage_Quote& _internal_quote() const; - ::SessionProtos::DataMessage_Quote* _internal_mutable_quote(); - public: - void unsafe_arena_set_allocated_quote( - ::SessionProtos::DataMessage_Quote* quote); - ::SessionProtos::DataMessage_Quote* unsafe_arena_release_quote(); - - // optional .SessionProtos.DataMessage.Reaction reaction = 11; - bool has_reaction() const; - private: - bool _internal_has_reaction() const; - public: - void clear_reaction(); - const ::SessionProtos::DataMessage_Reaction& reaction() const; - PROTOBUF_NODISCARD ::SessionProtos::DataMessage_Reaction* release_reaction(); - ::SessionProtos::DataMessage_Reaction* mutable_reaction(); - void set_allocated_reaction(::SessionProtos::DataMessage_Reaction* reaction); - private: - const ::SessionProtos::DataMessage_Reaction& _internal_reaction() const; - ::SessionProtos::DataMessage_Reaction* _internal_mutable_reaction(); - public: - void unsafe_arena_set_allocated_reaction( - ::SessionProtos::DataMessage_Reaction* reaction); - ::SessionProtos::DataMessage_Reaction* unsafe_arena_release_reaction(); - - // optional .SessionProtos.LokiProfile profile = 101; - bool has_profile() const; - private: - bool _internal_has_profile() const; - public: - void clear_profile(); - const ::SessionProtos::LokiProfile& profile() const; - PROTOBUF_NODISCARD ::SessionProtos::LokiProfile* release_profile(); - ::SessionProtos::LokiProfile* mutable_profile(); - void set_allocated_profile(::SessionProtos::LokiProfile* profile); - private: - const ::SessionProtos::LokiProfile& _internal_profile() const; - ::SessionProtos::LokiProfile* _internal_mutable_profile(); - public: - void unsafe_arena_set_allocated_profile( - ::SessionProtos::LokiProfile* profile); - ::SessionProtos::LokiProfile* unsafe_arena_release_profile(); - - // optional .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; - bool has_opengroupinvitation() const; - private: - bool _internal_has_opengroupinvitation() const; - public: - void clear_opengroupinvitation(); - const ::SessionProtos::DataMessage_OpenGroupInvitation& opengroupinvitation() const; - PROTOBUF_NODISCARD ::SessionProtos::DataMessage_OpenGroupInvitation* release_opengroupinvitation(); - ::SessionProtos::DataMessage_OpenGroupInvitation* mutable_opengroupinvitation(); - void set_allocated_opengroupinvitation(::SessionProtos::DataMessage_OpenGroupInvitation* opengroupinvitation); - private: - const ::SessionProtos::DataMessage_OpenGroupInvitation& _internal_opengroupinvitation() const; - ::SessionProtos::DataMessage_OpenGroupInvitation* _internal_mutable_opengroupinvitation(); - public: - void unsafe_arena_set_allocated_opengroupinvitation( - ::SessionProtos::DataMessage_OpenGroupInvitation* opengroupinvitation); - ::SessionProtos::DataMessage_OpenGroupInvitation* unsafe_arena_release_opengroupinvitation(); - - // optional .SessionProtos.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; - bool has_closedgroupcontrolmessage() const; - private: - bool _internal_has_closedgroupcontrolmessage() const; - public: - void clear_closedgroupcontrolmessage(); - const ::SessionProtos::DataMessage_ClosedGroupControlMessage& closedgroupcontrolmessage() const; - PROTOBUF_NODISCARD ::SessionProtos::DataMessage_ClosedGroupControlMessage* release_closedgroupcontrolmessage(); - ::SessionProtos::DataMessage_ClosedGroupControlMessage* mutable_closedgroupcontrolmessage(); - void set_allocated_closedgroupcontrolmessage(::SessionProtos::DataMessage_ClosedGroupControlMessage* closedgroupcontrolmessage); - private: - const ::SessionProtos::DataMessage_ClosedGroupControlMessage& _internal_closedgroupcontrolmessage() const; - ::SessionProtos::DataMessage_ClosedGroupControlMessage* _internal_mutable_closedgroupcontrolmessage(); - public: - void unsafe_arena_set_allocated_closedgroupcontrolmessage( - ::SessionProtos::DataMessage_ClosedGroupControlMessage* closedgroupcontrolmessage); - ::SessionProtos::DataMessage_ClosedGroupControlMessage* unsafe_arena_release_closedgroupcontrolmessage(); - - // optional uint32 flags = 4; - bool has_flags() const; - private: - bool _internal_has_flags() const; - public: - void clear_flags(); - uint32_t flags() const; - void set_flags(uint32_t value); - private: - uint32_t _internal_flags() const; - void _internal_set_flags(uint32_t value); - public: - - // optional uint32 expireTimer = 5; - bool has_expiretimer() const; - private: - bool _internal_has_expiretimer() const; - public: - void clear_expiretimer(); - uint32_t expiretimer() const; - void set_expiretimer(uint32_t value); - private: - uint32_t _internal_expiretimer() const; - void _internal_set_expiretimer(uint32_t value); - public: - - // optional uint64 timestamp = 7; - bool has_timestamp() const; - private: - bool _internal_has_timestamp() const; - public: - void clear_timestamp(); - uint64_t timestamp() const; - void set_timestamp(uint64_t value); - private: - uint64_t _internal_timestamp() const; - void _internal_set_timestamp(uint64_t value); - public: - - // optional bool blocksCommunityMessageRequests = 106; - bool has_blockscommunitymessagerequests() const; - private: - bool _internal_has_blockscommunitymessagerequests() const; - public: - void clear_blockscommunitymessagerequests(); - bool blockscommunitymessagerequests() const; - void set_blockscommunitymessagerequests(bool value); + void set_name(ArgT0&& arg0, ArgT... args); + std::string* mutable_name(); + PROTOBUF_NODISCARD std::string* release_name(); + void set_allocated_name(std::string* name); private: - bool _internal_blockscommunitymessagerequests() const; - void _internal_set_blockscommunitymessagerequests(bool value); + const std::string& _internal_name() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + std::string* _internal_mutable_name(); public: - // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage) + // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.OpenGroupInvitation) private: class _Internal; + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer > attachments_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview > preview_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr body_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilekey_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr synctarget_; - ::SessionProtos::DataMessage_Quote* quote_; - ::SessionProtos::DataMessage_Reaction* reaction_; - ::SessionProtos::LokiProfile* profile_; - ::SessionProtos::DataMessage_OpenGroupInvitation* opengroupinvitation_; - ::SessionProtos::DataMessage_ClosedGroupControlMessage* closedgroupcontrolmessage_; - uint32_t flags_; - uint32_t expiretimer_; - uint64_t timestamp_; - bool blockscommunitymessagerequests_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr url_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class ConfigurationMessage_ClosedGroup final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ConfigurationMessage.ClosedGroup) */ { +class DataMessage_ClosedGroupControlMessage_KeyPairWrapper final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) */ { public: - inline ConfigurationMessage_ClosedGroup() : ConfigurationMessage_ClosedGroup(nullptr) {} - ~ConfigurationMessage_ClosedGroup() override; - explicit PROTOBUF_CONSTEXPR ConfigurationMessage_ClosedGroup(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline DataMessage_ClosedGroupControlMessage_KeyPairWrapper() : DataMessage_ClosedGroupControlMessage_KeyPairWrapper(nullptr) {} + ~DataMessage_ClosedGroupControlMessage_KeyPairWrapper() override; + explicit PROTOBUF_CONSTEXPR DataMessage_ClosedGroupControlMessage_KeyPairWrapper(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ConfigurationMessage_ClosedGroup(const ConfigurationMessage_ClosedGroup& from); - ConfigurationMessage_ClosedGroup(ConfigurationMessage_ClosedGroup&& from) noexcept - : ConfigurationMessage_ClosedGroup() { + DataMessage_ClosedGroupControlMessage_KeyPairWrapper(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from); + DataMessage_ClosedGroupControlMessage_KeyPairWrapper(DataMessage_ClosedGroupControlMessage_KeyPairWrapper&& from) noexcept + : DataMessage_ClosedGroupControlMessage_KeyPairWrapper() { *this = ::std::move(from); } - inline ConfigurationMessage_ClosedGroup& operator=(const ConfigurationMessage_ClosedGroup& from) { + inline DataMessage_ClosedGroupControlMessage_KeyPairWrapper& operator=(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from) { CopyFrom(from); return *this; } - inline ConfigurationMessage_ClosedGroup& operator=(ConfigurationMessage_ClosedGroup&& from) noexcept { + inline DataMessage_ClosedGroupControlMessage_KeyPairWrapper& operator=(DataMessage_ClosedGroupControlMessage_KeyPairWrapper&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -4226,20 +3891,20 @@ class ConfigurationMessage_ClosedGroup final : return _internal_metadata_.mutable_unknown_fields(); } - static const ConfigurationMessage_ClosedGroup& default_instance() { + static const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& default_instance() { return *internal_default_instance(); } - static inline const ConfigurationMessage_ClosedGroup* internal_default_instance() { - return reinterpret_cast( - &_ConfigurationMessage_ClosedGroup_default_instance_); + static inline const DataMessage_ClosedGroupControlMessage_KeyPairWrapper* internal_default_instance() { + return reinterpret_cast( + &_DataMessage_ClosedGroupControlMessage_KeyPairWrapper_default_instance_); } static constexpr int kIndexInFileMessages = 17; - friend void swap(ConfigurationMessage_ClosedGroup& a, ConfigurationMessage_ClosedGroup& b) { + friend void swap(DataMessage_ClosedGroupControlMessage_KeyPairWrapper& a, DataMessage_ClosedGroupControlMessage_KeyPairWrapper& b) { a.Swap(&b); } - inline void Swap(ConfigurationMessage_ClosedGroup* other) { + inline void Swap(DataMessage_ClosedGroupControlMessage_KeyPairWrapper* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -4252,7 +3917,7 @@ class ConfigurationMessage_ClosedGroup final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ConfigurationMessage_ClosedGroup* other) { + void UnsafeArenaSwap(DataMessage_ClosedGroupControlMessage_KeyPairWrapper* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -4260,12 +3925,12 @@ class ConfigurationMessage_ClosedGroup final : // implements Message ---------------------------------------------- - ConfigurationMessage_ClosedGroup* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + DataMessage_ClosedGroupControlMessage_KeyPairWrapper* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const ConfigurationMessage_ClosedGroup& from); - void MergeFrom(const ConfigurationMessage_ClosedGroup& from); + void CopyFrom(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from); + void MergeFrom(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -4279,15 +3944,15 @@ class ConfigurationMessage_ClosedGroup final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(ConfigurationMessage_ClosedGroup* other); + void InternalSwap(DataMessage_ClosedGroupControlMessage_KeyPairWrapper* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.ConfigurationMessage.ClosedGroup"; + return "SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper"; } protected: - explicit ConfigurationMessage_ClosedGroup(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit DataMessage_ClosedGroupControlMessage_KeyPairWrapper(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -4298,62 +3963,10 @@ class ConfigurationMessage_ClosedGroup final : // accessors ------------------------------------------------------- enum : int { - kMembersFieldNumber = 4, - kAdminsFieldNumber = 5, kPublicKeyFieldNumber = 1, - kNameFieldNumber = 2, - kEncryptionKeyPairFieldNumber = 3, - kExpirationTimerFieldNumber = 6, + kEncryptedKeyPairFieldNumber = 2, }; - // repeated bytes members = 4; - int members_size() const; - private: - int _internal_members_size() const; - public: - void clear_members(); - const std::string& members(int index) const; - std::string* mutable_members(int index); - void set_members(int index, const std::string& value); - void set_members(int index, std::string&& value); - void set_members(int index, const char* value); - void set_members(int index, const void* value, size_t size); - std::string* add_members(); - void add_members(const std::string& value); - void add_members(std::string&& value); - void add_members(const char* value); - void add_members(const void* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& members() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_members(); - private: - const std::string& _internal_members(int index) const; - std::string* _internal_add_members(); - public: - - // repeated bytes admins = 5; - int admins_size() const; - private: - int _internal_admins_size() const; - public: - void clear_admins(); - const std::string& admins(int index) const; - std::string* mutable_admins(int index); - void set_admins(int index, const std::string& value); - void set_admins(int index, std::string&& value); - void set_admins(int index, const char* value); - void set_admins(int index, const void* value, size_t size); - std::string* add_admins(); - void add_admins(const std::string& value); - void add_admins(std::string&& value); - void add_admins(const char* value); - void add_admins(const void* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& admins() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_admins(); - private: - const std::string& _internal_admins(int index) const; - std::string* _internal_add_admins(); - public: - - // optional bytes publicKey = 1; + // required bytes publicKey = 1; bool has_publickey() const; private: bool _internal_has_publickey() const; @@ -4371,95 +3984,63 @@ class ConfigurationMessage_ClosedGroup final : std::string* _internal_mutable_publickey(); public: - // optional string name = 2; - bool has_name() const; + // required bytes encryptedKeyPair = 2; + bool has_encryptedkeypair() const; private: - bool _internal_has_name() const; + bool _internal_has_encryptedkeypair() const; public: - void clear_name(); - const std::string& name() const; + void clear_encryptedkeypair(); + const std::string& encryptedkeypair() const; template - void set_name(ArgT0&& arg0, ArgT... args); - std::string* mutable_name(); - PROTOBUF_NODISCARD std::string* release_name(); - void set_allocated_name(std::string* name); - private: - const std::string& _internal_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); - std::string* _internal_mutable_name(); - public: - - // optional .SessionProtos.KeyPair encryptionKeyPair = 3; - bool has_encryptionkeypair() const; - private: - bool _internal_has_encryptionkeypair() const; - public: - void clear_encryptionkeypair(); - const ::SessionProtos::KeyPair& encryptionkeypair() const; - PROTOBUF_NODISCARD ::SessionProtos::KeyPair* release_encryptionkeypair(); - ::SessionProtos::KeyPair* mutable_encryptionkeypair(); - void set_allocated_encryptionkeypair(::SessionProtos::KeyPair* encryptionkeypair); - private: - const ::SessionProtos::KeyPair& _internal_encryptionkeypair() const; - ::SessionProtos::KeyPair* _internal_mutable_encryptionkeypair(); - public: - void unsafe_arena_set_allocated_encryptionkeypair( - ::SessionProtos::KeyPair* encryptionkeypair); - ::SessionProtos::KeyPair* unsafe_arena_release_encryptionkeypair(); - - // optional uint32 expirationTimer = 6; - bool has_expirationtimer() const; - private: - bool _internal_has_expirationtimer() const; - public: - void clear_expirationtimer(); - uint32_t expirationtimer() const; - void set_expirationtimer(uint32_t value); + void set_encryptedkeypair(ArgT0&& arg0, ArgT... args); + std::string* mutable_encryptedkeypair(); + PROTOBUF_NODISCARD std::string* release_encryptedkeypair(); + void set_allocated_encryptedkeypair(std::string* encryptedkeypair); private: - uint32_t _internal_expirationtimer() const; - void _internal_set_expirationtimer(uint32_t value); + const std::string& _internal_encryptedkeypair() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_encryptedkeypair(const std::string& value); + std::string* _internal_mutable_encryptedkeypair(); public: - // @@protoc_insertion_point(class_scope:SessionProtos.ConfigurationMessage.ClosedGroup) + // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) private: class _Internal; + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField members_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField admins_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr publickey_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::SessionProtos::KeyPair* encryptionkeypair_; - uint32_t expirationtimer_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr encryptedkeypair_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class ConfigurationMessage_Contact final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ConfigurationMessage.Contact) */ { +class DataMessage_ClosedGroupControlMessage final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.ClosedGroupControlMessage) */ { public: - inline ConfigurationMessage_Contact() : ConfigurationMessage_Contact(nullptr) {} - ~ConfigurationMessage_Contact() override; - explicit PROTOBUF_CONSTEXPR ConfigurationMessage_Contact(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline DataMessage_ClosedGroupControlMessage() : DataMessage_ClosedGroupControlMessage(nullptr) {} + ~DataMessage_ClosedGroupControlMessage() override; + explicit PROTOBUF_CONSTEXPR DataMessage_ClosedGroupControlMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ConfigurationMessage_Contact(const ConfigurationMessage_Contact& from); - ConfigurationMessage_Contact(ConfigurationMessage_Contact&& from) noexcept - : ConfigurationMessage_Contact() { + DataMessage_ClosedGroupControlMessage(const DataMessage_ClosedGroupControlMessage& from); + DataMessage_ClosedGroupControlMessage(DataMessage_ClosedGroupControlMessage&& from) noexcept + : DataMessage_ClosedGroupControlMessage() { *this = ::std::move(from); } - inline ConfigurationMessage_Contact& operator=(const ConfigurationMessage_Contact& from) { + inline DataMessage_ClosedGroupControlMessage& operator=(const DataMessage_ClosedGroupControlMessage& from) { CopyFrom(from); return *this; } - inline ConfigurationMessage_Contact& operator=(ConfigurationMessage_Contact&& from) noexcept { + inline DataMessage_ClosedGroupControlMessage& operator=(DataMessage_ClosedGroupControlMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -4480,20 +4061,20 @@ class ConfigurationMessage_Contact final : return _internal_metadata_.mutable_unknown_fields(); } - static const ConfigurationMessage_Contact& default_instance() { + static const DataMessage_ClosedGroupControlMessage& default_instance() { return *internal_default_instance(); } - static inline const ConfigurationMessage_Contact* internal_default_instance() { - return reinterpret_cast( - &_ConfigurationMessage_Contact_default_instance_); + static inline const DataMessage_ClosedGroupControlMessage* internal_default_instance() { + return reinterpret_cast( + &_DataMessage_ClosedGroupControlMessage_default_instance_); } static constexpr int kIndexInFileMessages = 18; - friend void swap(ConfigurationMessage_Contact& a, ConfigurationMessage_Contact& b) { + friend void swap(DataMessage_ClosedGroupControlMessage& a, DataMessage_ClosedGroupControlMessage& b) { a.Swap(&b); } - inline void Swap(ConfigurationMessage_Contact* other) { + inline void Swap(DataMessage_ClosedGroupControlMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -4506,7 +4087,7 @@ class ConfigurationMessage_Contact final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ConfigurationMessage_Contact* other) { + void UnsafeArenaSwap(DataMessage_ClosedGroupControlMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -4514,12 +4095,12 @@ class ConfigurationMessage_Contact final : // implements Message ---------------------------------------------- - ConfigurationMessage_Contact* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + DataMessage_ClosedGroupControlMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const ConfigurationMessage_Contact& from); - void MergeFrom(const ConfigurationMessage_Contact& from); + void CopyFrom(const DataMessage_ClosedGroupControlMessage& from); + void MergeFrom(const DataMessage_ClosedGroupControlMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -4533,15 +4114,15 @@ class ConfigurationMessage_Contact final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(ConfigurationMessage_Contact* other); + void InternalSwap(DataMessage_ClosedGroupControlMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.ConfigurationMessage.Contact"; + return "SessionProtos.DataMessage.ClosedGroupControlMessage"; } protected: - explicit ConfigurationMessage_Contact(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit DataMessage_ClosedGroupControlMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -4549,18 +4130,123 @@ class ConfigurationMessage_Contact final : // nested types ---------------------------------------------------- + typedef DataMessage_ClosedGroupControlMessage_KeyPairWrapper KeyPairWrapper; + + typedef DataMessage_ClosedGroupControlMessage_Type Type; + static constexpr Type NEW = + DataMessage_ClosedGroupControlMessage_Type_NEW; + static constexpr Type ENCRYPTION_KEY_PAIR = + DataMessage_ClosedGroupControlMessage_Type_ENCRYPTION_KEY_PAIR; + static constexpr Type NAME_CHANGE = + DataMessage_ClosedGroupControlMessage_Type_NAME_CHANGE; + static constexpr Type MEMBERS_ADDED = + DataMessage_ClosedGroupControlMessage_Type_MEMBERS_ADDED; + static constexpr Type MEMBERS_REMOVED = + DataMessage_ClosedGroupControlMessage_Type_MEMBERS_REMOVED; + static constexpr Type MEMBER_LEFT = + DataMessage_ClosedGroupControlMessage_Type_MEMBER_LEFT; + static constexpr Type ENCRYPTION_KEY_PAIR_REQUEST = + DataMessage_ClosedGroupControlMessage_Type_ENCRYPTION_KEY_PAIR_REQUEST; + static inline bool Type_IsValid(int value) { + return DataMessage_ClosedGroupControlMessage_Type_IsValid(value); + } + static constexpr Type Type_MIN = + DataMessage_ClosedGroupControlMessage_Type_Type_MIN; + static constexpr Type Type_MAX = + DataMessage_ClosedGroupControlMessage_Type_Type_MAX; + static constexpr int Type_ARRAYSIZE = + DataMessage_ClosedGroupControlMessage_Type_Type_ARRAYSIZE; + template + static inline const std::string& Type_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Type_Name."); + return DataMessage_ClosedGroupControlMessage_Type_Name(enum_t_value); + } + static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Type* value) { + return DataMessage_ClosedGroupControlMessage_Type_Parse(name, value); + } + // accessors ------------------------------------------------------- enum : int { - kPublicKeyFieldNumber = 1, - kNameFieldNumber = 2, - kProfilePictureFieldNumber = 3, - kProfileKeyFieldNumber = 4, - kIsApprovedFieldNumber = 5, - kIsBlockedFieldNumber = 6, - kDidApproveMeFieldNumber = 7, + kMembersFieldNumber = 5, + kAdminsFieldNumber = 6, + kWrappersFieldNumber = 7, + kPublicKeyFieldNumber = 2, + kNameFieldNumber = 3, + kEncryptionKeyPairFieldNumber = 4, + kExpirationTimerFieldNumber = 8, + kTypeFieldNumber = 1, }; - // required bytes publicKey = 1; + // repeated bytes members = 5; + int members_size() const; + private: + int _internal_members_size() const; + public: + void clear_members(); + const std::string& members(int index) const; + std::string* mutable_members(int index); + void set_members(int index, const std::string& value); + void set_members(int index, std::string&& value); + void set_members(int index, const char* value); + void set_members(int index, const void* value, size_t size); + std::string* add_members(); + void add_members(const std::string& value); + void add_members(std::string&& value); + void add_members(const char* value); + void add_members(const void* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& members() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_members(); + private: + const std::string& _internal_members(int index) const; + std::string* _internal_add_members(); + public: + + // repeated bytes admins = 6; + int admins_size() const; + private: + int _internal_admins_size() const; + public: + void clear_admins(); + const std::string& admins(int index) const; + std::string* mutable_admins(int index); + void set_admins(int index, const std::string& value); + void set_admins(int index, std::string&& value); + void set_admins(int index, const char* value); + void set_admins(int index, const void* value, size_t size); + std::string* add_admins(); + void add_admins(const std::string& value); + void add_admins(std::string&& value); + void add_admins(const char* value); + void add_admins(const void* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& admins() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_admins(); + private: + const std::string& _internal_admins(int index) const; + std::string* _internal_add_admins(); + public: + + // repeated .SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper wrappers = 7; + int wrappers_size() const; + private: + int _internal_wrappers_size() const; + public: + void clear_wrappers(); + ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper* mutable_wrappers(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper >* + mutable_wrappers(); + private: + const ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper& _internal_wrappers(int index) const; + ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper* _internal_add_wrappers(); + public: + const ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper& wrappers(int index) const; + ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper* add_wrappers(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper >& + wrappers() const; + + // optional bytes publicKey = 2; bool has_publickey() const; private: bool _internal_has_publickey() const; @@ -4578,7 +4264,7 @@ class ConfigurationMessage_Contact final : std::string* _internal_mutable_publickey(); public: - // required string name = 2; + // optional string name = 3; bool has_name() const; private: bool _internal_has_name() const; @@ -4596,125 +4282,92 @@ class ConfigurationMessage_Contact final : std::string* _internal_mutable_name(); public: - // optional string profilePicture = 3; - bool has_profilepicture() const; - private: - bool _internal_has_profilepicture() const; - public: - void clear_profilepicture(); - const std::string& profilepicture() const; - template - void set_profilepicture(ArgT0&& arg0, ArgT... args); - std::string* mutable_profilepicture(); - PROTOBUF_NODISCARD std::string* release_profilepicture(); - void set_allocated_profilepicture(std::string* profilepicture); - private: - const std::string& _internal_profilepicture() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilepicture(const std::string& value); - std::string* _internal_mutable_profilepicture(); - public: - - // optional bytes profileKey = 4; - bool has_profilekey() const; - private: - bool _internal_has_profilekey() const; - public: - void clear_profilekey(); - const std::string& profilekey() const; - template - void set_profilekey(ArgT0&& arg0, ArgT... args); - std::string* mutable_profilekey(); - PROTOBUF_NODISCARD std::string* release_profilekey(); - void set_allocated_profilekey(std::string* profilekey); - private: - const std::string& _internal_profilekey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilekey(const std::string& value); - std::string* _internal_mutable_profilekey(); - public: - - // optional bool isApproved = 5; - bool has_isapproved() const; + // optional .SessionProtos.KeyPair encryptionKeyPair = 4; + bool has_encryptionkeypair() const; private: - bool _internal_has_isapproved() const; + bool _internal_has_encryptionkeypair() const; public: - void clear_isapproved(); - bool isapproved() const; - void set_isapproved(bool value); + void clear_encryptionkeypair(); + const ::SessionProtos::KeyPair& encryptionkeypair() const; + PROTOBUF_NODISCARD ::SessionProtos::KeyPair* release_encryptionkeypair(); + ::SessionProtos::KeyPair* mutable_encryptionkeypair(); + void set_allocated_encryptionkeypair(::SessionProtos::KeyPair* encryptionkeypair); private: - bool _internal_isapproved() const; - void _internal_set_isapproved(bool value); + const ::SessionProtos::KeyPair& _internal_encryptionkeypair() const; + ::SessionProtos::KeyPair* _internal_mutable_encryptionkeypair(); public: + void unsafe_arena_set_allocated_encryptionkeypair( + ::SessionProtos::KeyPair* encryptionkeypair); + ::SessionProtos::KeyPair* unsafe_arena_release_encryptionkeypair(); - // optional bool isBlocked = 6; - bool has_isblocked() const; + // optional uint32 expirationTimer = 8; + bool has_expirationtimer() const; private: - bool _internal_has_isblocked() const; + bool _internal_has_expirationtimer() const; public: - void clear_isblocked(); - bool isblocked() const; - void set_isblocked(bool value); + void clear_expirationtimer(); + uint32_t expirationtimer() const; + void set_expirationtimer(uint32_t value); private: - bool _internal_isblocked() const; - void _internal_set_isblocked(bool value); + uint32_t _internal_expirationtimer() const; + void _internal_set_expirationtimer(uint32_t value); public: - // optional bool didApproveMe = 7; - bool has_didapproveme() const; + // required .SessionProtos.DataMessage.ClosedGroupControlMessage.Type type = 1; + bool has_type() const; private: - bool _internal_has_didapproveme() const; + bool _internal_has_type() const; public: - void clear_didapproveme(); - bool didapproveme() const; - void set_didapproveme(bool value); + void clear_type(); + ::SessionProtos::DataMessage_ClosedGroupControlMessage_Type type() const; + void set_type(::SessionProtos::DataMessage_ClosedGroupControlMessage_Type value); private: - bool _internal_didapproveme() const; - void _internal_set_didapproveme(bool value); + ::SessionProtos::DataMessage_ClosedGroupControlMessage_Type _internal_type() const; + void _internal_set_type(::SessionProtos::DataMessage_ClosedGroupControlMessage_Type value); public: - // @@protoc_insertion_point(class_scope:SessionProtos.ConfigurationMessage.Contact) + // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.ClosedGroupControlMessage) private: class _Internal; - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField members_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField admins_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper > wrappers_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr publickey_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilepicture_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilekey_; - bool isapproved_; - bool isblocked_; - bool didapproveme_; + ::SessionProtos::KeyPair* encryptionkeypair_; + uint32_t expirationtimer_; + int type_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class ConfigurationMessage_ProProof final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ConfigurationMessage.ProProof) */ { +class DataMessage final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage) */ { public: - inline ConfigurationMessage_ProProof() : ConfigurationMessage_ProProof(nullptr) {} - ~ConfigurationMessage_ProProof() override; - explicit PROTOBUF_CONSTEXPR ConfigurationMessage_ProProof(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline DataMessage() : DataMessage(nullptr) {} + ~DataMessage() override; + explicit PROTOBUF_CONSTEXPR DataMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ConfigurationMessage_ProProof(const ConfigurationMessage_ProProof& from); - ConfigurationMessage_ProProof(ConfigurationMessage_ProProof&& from) noexcept - : ConfigurationMessage_ProProof() { + DataMessage(const DataMessage& from); + DataMessage(DataMessage&& from) noexcept + : DataMessage() { *this = ::std::move(from); } - inline ConfigurationMessage_ProProof& operator=(const ConfigurationMessage_ProProof& from) { + inline DataMessage& operator=(const DataMessage& from) { CopyFrom(from); return *this; } - inline ConfigurationMessage_ProProof& operator=(ConfigurationMessage_ProProof&& from) noexcept { + inline DataMessage& operator=(DataMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -4735,20 +4388,20 @@ class ConfigurationMessage_ProProof final : return _internal_metadata_.mutable_unknown_fields(); } - static const ConfigurationMessage_ProProof& default_instance() { + static const DataMessage& default_instance() { return *internal_default_instance(); } - static inline const ConfigurationMessage_ProProof* internal_default_instance() { - return reinterpret_cast( - &_ConfigurationMessage_ProProof_default_instance_); + static inline const DataMessage* internal_default_instance() { + return reinterpret_cast( + &_DataMessage_default_instance_); } static constexpr int kIndexInFileMessages = 19; - friend void swap(ConfigurationMessage_ProProof& a, ConfigurationMessage_ProProof& b) { + friend void swap(DataMessage& a, DataMessage& b) { a.Swap(&b); } - inline void Swap(ConfigurationMessage_ProProof* other) { + inline void Swap(DataMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -4761,7 +4414,7 @@ class ConfigurationMessage_ProProof final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ConfigurationMessage_ProProof* other) { + void UnsafeArenaSwap(DataMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -4769,12 +4422,12 @@ class ConfigurationMessage_ProProof final : // implements Message ---------------------------------------------- - ConfigurationMessage_ProProof* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + DataMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const ConfigurationMessage_ProProof& from); - void MergeFrom(const ConfigurationMessage_ProProof& from); + void CopyFrom(const DataMessage& from); + void MergeFrom(const DataMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -4788,15 +4441,15 @@ class ConfigurationMessage_ProProof final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(ConfigurationMessage_ProProof* other); + void InternalSwap(DataMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.ConfigurationMessage.ProProof"; + return "SessionProtos.DataMessage"; } protected: - explicit ConfigurationMessage_ProProof(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit DataMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -4804,307 +4457,334 @@ class ConfigurationMessage_ProProof final : // nested types ---------------------------------------------------- + typedef DataMessage_Quote Quote; + typedef DataMessage_Preview Preview; + typedef DataMessage_Reaction Reaction; + typedef DataMessage_OpenGroupInvitation OpenGroupInvitation; + typedef DataMessage_ClosedGroupControlMessage ClosedGroupControlMessage; + + typedef DataMessage_Flags Flags; + static constexpr Flags EXPIRATION_TIMER_UPDATE = + DataMessage_Flags_EXPIRATION_TIMER_UPDATE; + static inline bool Flags_IsValid(int value) { + return DataMessage_Flags_IsValid(value); + } + static constexpr Flags Flags_MIN = + DataMessage_Flags_Flags_MIN; + static constexpr Flags Flags_MAX = + DataMessage_Flags_Flags_MAX; + static constexpr int Flags_ARRAYSIZE = + DataMessage_Flags_Flags_ARRAYSIZE; + template + static inline const std::string& Flags_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Flags_Name."); + return DataMessage_Flags_Name(enum_t_value); + } + static inline bool Flags_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Flags* value) { + return DataMessage_Flags_Parse(name, value); + } + // accessors ------------------------------------------------------- enum : int { - kGenIndexHashFieldNumber = 2, - kRotatingPublicKeyFieldNumber = 3, - kSigFieldNumber = 5, - kExpiryUnixTsFieldNumber = 4, - kVersionFieldNumber = 1, - }; - // required bytes genIndexHash = 2; - bool has_genindexhash() const; - private: - bool _internal_has_genindexhash() const; - public: - void clear_genindexhash(); - const std::string& genindexhash() const; - template - void set_genindexhash(ArgT0&& arg0, ArgT... args); - std::string* mutable_genindexhash(); - PROTOBUF_NODISCARD std::string* release_genindexhash(); - void set_allocated_genindexhash(std::string* genindexhash); + kAttachmentsFieldNumber = 2, + kPreviewFieldNumber = 10, + kBodyFieldNumber = 1, + kProfileKeyFieldNumber = 6, + kSyncTargetFieldNumber = 105, + kQuoteFieldNumber = 8, + kReactionFieldNumber = 11, + kProfileFieldNumber = 101, + kOpenGroupInvitationFieldNumber = 102, + kClosedGroupControlMessageFieldNumber = 104, + kFlagsFieldNumber = 4, + kExpireTimerFieldNumber = 5, + kTimestampFieldNumber = 7, + kBlocksCommunityMessageRequestsFieldNumber = 106, + }; + // repeated .SessionProtos.AttachmentPointer attachments = 2; + int attachments_size() const; private: - const std::string& _internal_genindexhash() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_genindexhash(const std::string& value); - std::string* _internal_mutable_genindexhash(); + int _internal_attachments_size() const; + public: + void clear_attachments(); + ::SessionProtos::AttachmentPointer* mutable_attachments(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer >* + mutable_attachments(); + private: + const ::SessionProtos::AttachmentPointer& _internal_attachments(int index) const; + ::SessionProtos::AttachmentPointer* _internal_add_attachments(); public: + const ::SessionProtos::AttachmentPointer& attachments(int index) const; + ::SessionProtos::AttachmentPointer* add_attachments(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer >& + attachments() const; - // required bytes rotatingPublicKey = 3; - bool has_rotatingpublickey() const; + // repeated .SessionProtos.DataMessage.Preview preview = 10; + int preview_size() const; private: - bool _internal_has_rotatingpublickey() const; + int _internal_preview_size() const; public: - void clear_rotatingpublickey(); - const std::string& rotatingpublickey() const; - template - void set_rotatingpublickey(ArgT0&& arg0, ArgT... args); - std::string* mutable_rotatingpublickey(); - PROTOBUF_NODISCARD std::string* release_rotatingpublickey(); - void set_allocated_rotatingpublickey(std::string* rotatingpublickey); + void clear_preview(); + ::SessionProtos::DataMessage_Preview* mutable_preview(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview >* + mutable_preview(); private: - const std::string& _internal_rotatingpublickey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_rotatingpublickey(const std::string& value); - std::string* _internal_mutable_rotatingpublickey(); + const ::SessionProtos::DataMessage_Preview& _internal_preview(int index) const; + ::SessionProtos::DataMessage_Preview* _internal_add_preview(); public: + const ::SessionProtos::DataMessage_Preview& preview(int index) const; + ::SessionProtos::DataMessage_Preview* add_preview(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview >& + preview() const; - // required bytes sig = 5; - bool has_sig() const; + // optional string body = 1; + bool has_body() const; private: - bool _internal_has_sig() const; + bool _internal_has_body() const; public: - void clear_sig(); - const std::string& sig() const; + void clear_body(); + const std::string& body() const; template - void set_sig(ArgT0&& arg0, ArgT... args); - std::string* mutable_sig(); - PROTOBUF_NODISCARD std::string* release_sig(); - void set_allocated_sig(std::string* sig); + void set_body(ArgT0&& arg0, ArgT... args); + std::string* mutable_body(); + PROTOBUF_NODISCARD std::string* release_body(); + void set_allocated_body(std::string* body); private: - const std::string& _internal_sig() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_sig(const std::string& value); - std::string* _internal_mutable_sig(); + const std::string& _internal_body() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_body(const std::string& value); + std::string* _internal_mutable_body(); public: - // required uint64 expiryUnixTs = 4; - bool has_expiryunixts() const; + // optional bytes profileKey = 6; + bool has_profilekey() const; private: - bool _internal_has_expiryunixts() const; + bool _internal_has_profilekey() const; public: - void clear_expiryunixts(); - uint64_t expiryunixts() const; - void set_expiryunixts(uint64_t value); + void clear_profilekey(); + const std::string& profilekey() const; + template + void set_profilekey(ArgT0&& arg0, ArgT... args); + std::string* mutable_profilekey(); + PROTOBUF_NODISCARD std::string* release_profilekey(); + void set_allocated_profilekey(std::string* profilekey); private: - uint64_t _internal_expiryunixts() const; - void _internal_set_expiryunixts(uint64_t value); + const std::string& _internal_profilekey() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilekey(const std::string& value); + std::string* _internal_mutable_profilekey(); public: - // required uint32 version = 1; - bool has_version() const; + // optional string syncTarget = 105; + bool has_synctarget() const; private: - bool _internal_has_version() const; + bool _internal_has_synctarget() const; public: - void clear_version(); - uint32_t version() const; - void set_version(uint32_t value); + void clear_synctarget(); + const std::string& synctarget() const; + template + void set_synctarget(ArgT0&& arg0, ArgT... args); + std::string* mutable_synctarget(); + PROTOBUF_NODISCARD std::string* release_synctarget(); + void set_allocated_synctarget(std::string* synctarget); private: - uint32_t _internal_version() const; - void _internal_set_version(uint32_t value); + const std::string& _internal_synctarget() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_synctarget(const std::string& value); + std::string* _internal_mutable_synctarget(); public: - // @@protoc_insertion_point(class_scope:SessionProtos.ConfigurationMessage.ProProof) - private: - class _Internal; - - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr genindexhash_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr rotatingpublickey_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr sig_; - uint64_t expiryunixts_; - uint32_t version_; - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_SessionProtos_2eproto; -}; -// ------------------------------------------------------------------- - -class ConfigurationMessage_Pro final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ConfigurationMessage.Pro) */ { - public: - inline ConfigurationMessage_Pro() : ConfigurationMessage_Pro(nullptr) {} - ~ConfigurationMessage_Pro() override; - explicit PROTOBUF_CONSTEXPR ConfigurationMessage_Pro(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - ConfigurationMessage_Pro(const ConfigurationMessage_Pro& from); - ConfigurationMessage_Pro(ConfigurationMessage_Pro&& from) noexcept - : ConfigurationMessage_Pro() { - *this = ::std::move(from); - } - - inline ConfigurationMessage_Pro& operator=(const ConfigurationMessage_Pro& from) { - CopyFrom(from); - return *this; - } - inline ConfigurationMessage_Pro& operator=(ConfigurationMessage_Pro&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); - } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); - } - - static const ConfigurationMessage_Pro& default_instance() { - return *internal_default_instance(); - } - static inline const ConfigurationMessage_Pro* internal_default_instance() { - return reinterpret_cast( - &_ConfigurationMessage_Pro_default_instance_); - } - static constexpr int kIndexInFileMessages = - 20; - - friend void swap(ConfigurationMessage_Pro& a, ConfigurationMessage_Pro& b) { - a.Swap(&b); - } - inline void Swap(ConfigurationMessage_Pro* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(ConfigurationMessage_Pro* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - ConfigurationMessage_Pro* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const ConfigurationMessage_Pro& from); - void MergeFrom(const ConfigurationMessage_Pro& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } - + // optional .SessionProtos.DataMessage.Quote quote = 8; + bool has_quote() const; private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(ConfigurationMessage_Pro* other); - + bool _internal_has_quote() const; + public: + void clear_quote(); + const ::SessionProtos::DataMessage_Quote& quote() const; + PROTOBUF_NODISCARD ::SessionProtos::DataMessage_Quote* release_quote(); + ::SessionProtos::DataMessage_Quote* mutable_quote(); + void set_allocated_quote(::SessionProtos::DataMessage_Quote* quote); private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.ConfigurationMessage.Pro"; - } - protected: - explicit ConfigurationMessage_Pro(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + const ::SessionProtos::DataMessage_Quote& _internal_quote() const; + ::SessionProtos::DataMessage_Quote* _internal_mutable_quote(); public: + void unsafe_arena_set_allocated_quote( + ::SessionProtos::DataMessage_Quote* quote); + ::SessionProtos::DataMessage_Quote* unsafe_arena_release_quote(); - std::string GetTypeName() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kRotatingPrivKeyFieldNumber = 1, - kProofFieldNumber = 2, - }; - // required bytes rotatingPrivKey = 1; - bool has_rotatingprivkey() const; + // optional .SessionProtos.DataMessage.Reaction reaction = 11; + bool has_reaction() const; private: - bool _internal_has_rotatingprivkey() const; + bool _internal_has_reaction() const; public: - void clear_rotatingprivkey(); - const std::string& rotatingprivkey() const; - template - void set_rotatingprivkey(ArgT0&& arg0, ArgT... args); - std::string* mutable_rotatingprivkey(); - PROTOBUF_NODISCARD std::string* release_rotatingprivkey(); - void set_allocated_rotatingprivkey(std::string* rotatingprivkey); + void clear_reaction(); + const ::SessionProtos::DataMessage_Reaction& reaction() const; + PROTOBUF_NODISCARD ::SessionProtos::DataMessage_Reaction* release_reaction(); + ::SessionProtos::DataMessage_Reaction* mutable_reaction(); + void set_allocated_reaction(::SessionProtos::DataMessage_Reaction* reaction); private: - const std::string& _internal_rotatingprivkey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_rotatingprivkey(const std::string& value); - std::string* _internal_mutable_rotatingprivkey(); + const ::SessionProtos::DataMessage_Reaction& _internal_reaction() const; + ::SessionProtos::DataMessage_Reaction* _internal_mutable_reaction(); public: + void unsafe_arena_set_allocated_reaction( + ::SessionProtos::DataMessage_Reaction* reaction); + ::SessionProtos::DataMessage_Reaction* unsafe_arena_release_reaction(); - // required bytes proof = 2; - bool has_proof() const; + // optional .SessionProtos.LokiProfile profile = 101; + bool has_profile() const; private: - bool _internal_has_proof() const; + bool _internal_has_profile() const; public: - void clear_proof(); - const std::string& proof() const; - template - void set_proof(ArgT0&& arg0, ArgT... args); - std::string* mutable_proof(); - PROTOBUF_NODISCARD std::string* release_proof(); - void set_allocated_proof(std::string* proof); + void clear_profile(); + const ::SessionProtos::LokiProfile& profile() const; + PROTOBUF_NODISCARD ::SessionProtos::LokiProfile* release_profile(); + ::SessionProtos::LokiProfile* mutable_profile(); + void set_allocated_profile(::SessionProtos::LokiProfile* profile); + private: + const ::SessionProtos::LokiProfile& _internal_profile() const; + ::SessionProtos::LokiProfile* _internal_mutable_profile(); + public: + void unsafe_arena_set_allocated_profile( + ::SessionProtos::LokiProfile* profile); + ::SessionProtos::LokiProfile* unsafe_arena_release_profile(); + + // optional .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + bool has_opengroupinvitation() const; + private: + bool _internal_has_opengroupinvitation() const; + public: + void clear_opengroupinvitation(); + const ::SessionProtos::DataMessage_OpenGroupInvitation& opengroupinvitation() const; + PROTOBUF_NODISCARD ::SessionProtos::DataMessage_OpenGroupInvitation* release_opengroupinvitation(); + ::SessionProtos::DataMessage_OpenGroupInvitation* mutable_opengroupinvitation(); + void set_allocated_opengroupinvitation(::SessionProtos::DataMessage_OpenGroupInvitation* opengroupinvitation); + private: + const ::SessionProtos::DataMessage_OpenGroupInvitation& _internal_opengroupinvitation() const; + ::SessionProtos::DataMessage_OpenGroupInvitation* _internal_mutable_opengroupinvitation(); + public: + void unsafe_arena_set_allocated_opengroupinvitation( + ::SessionProtos::DataMessage_OpenGroupInvitation* opengroupinvitation); + ::SessionProtos::DataMessage_OpenGroupInvitation* unsafe_arena_release_opengroupinvitation(); + + // optional .SessionProtos.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; + bool has_closedgroupcontrolmessage() const; + private: + bool _internal_has_closedgroupcontrolmessage() const; + public: + void clear_closedgroupcontrolmessage(); + const ::SessionProtos::DataMessage_ClosedGroupControlMessage& closedgroupcontrolmessage() const; + PROTOBUF_NODISCARD ::SessionProtos::DataMessage_ClosedGroupControlMessage* release_closedgroupcontrolmessage(); + ::SessionProtos::DataMessage_ClosedGroupControlMessage* mutable_closedgroupcontrolmessage(); + void set_allocated_closedgroupcontrolmessage(::SessionProtos::DataMessage_ClosedGroupControlMessage* closedgroupcontrolmessage); + private: + const ::SessionProtos::DataMessage_ClosedGroupControlMessage& _internal_closedgroupcontrolmessage() const; + ::SessionProtos::DataMessage_ClosedGroupControlMessage* _internal_mutable_closedgroupcontrolmessage(); + public: + void unsafe_arena_set_allocated_closedgroupcontrolmessage( + ::SessionProtos::DataMessage_ClosedGroupControlMessage* closedgroupcontrolmessage); + ::SessionProtos::DataMessage_ClosedGroupControlMessage* unsafe_arena_release_closedgroupcontrolmessage(); + + // optional uint32 flags = 4; + bool has_flags() const; + private: + bool _internal_has_flags() const; + public: + void clear_flags(); + uint32_t flags() const; + void set_flags(uint32_t value); + private: + uint32_t _internal_flags() const; + void _internal_set_flags(uint32_t value); + public: + + // optional uint32 expireTimer = 5; + bool has_expiretimer() const; + private: + bool _internal_has_expiretimer() const; + public: + void clear_expiretimer(); + uint32_t expiretimer() const; + void set_expiretimer(uint32_t value); + private: + uint32_t _internal_expiretimer() const; + void _internal_set_expiretimer(uint32_t value); + public: + + // optional uint64 timestamp = 7; + bool has_timestamp() const; + private: + bool _internal_has_timestamp() const; + public: + void clear_timestamp(); + uint64_t timestamp() const; + void set_timestamp(uint64_t value); + private: + uint64_t _internal_timestamp() const; + void _internal_set_timestamp(uint64_t value); + public: + + // optional bool blocksCommunityMessageRequests = 106; + bool has_blockscommunitymessagerequests() const; + private: + bool _internal_has_blockscommunitymessagerequests() const; + public: + void clear_blockscommunitymessagerequests(); + bool blockscommunitymessagerequests() const; + void set_blockscommunitymessagerequests(bool value); private: - const std::string& _internal_proof() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_proof(const std::string& value); - std::string* _internal_mutable_proof(); + bool _internal_blockscommunitymessagerequests() const; + void _internal_set_blockscommunitymessagerequests(bool value); public: - // @@protoc_insertion_point(class_scope:SessionProtos.ConfigurationMessage.Pro) + // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage) private: class _Internal; - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr rotatingprivkey_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr proof_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer > attachments_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview > preview_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr body_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilekey_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr synctarget_; + ::SessionProtos::DataMessage_Quote* quote_; + ::SessionProtos::DataMessage_Reaction* reaction_; + ::SessionProtos::LokiProfile* profile_; + ::SessionProtos::DataMessage_OpenGroupInvitation* opengroupinvitation_; + ::SessionProtos::DataMessage_ClosedGroupControlMessage* closedgroupcontrolmessage_; + uint32_t flags_; + uint32_t expiretimer_; + uint64_t timestamp_; + bool blockscommunitymessagerequests_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class ConfigurationMessage final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ConfigurationMessage) */ { +class ConfigurationMessage_ClosedGroup final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ConfigurationMessage.ClosedGroup) */ { public: - inline ConfigurationMessage() : ConfigurationMessage(nullptr) {} - ~ConfigurationMessage() override; - explicit PROTOBUF_CONSTEXPR ConfigurationMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline ConfigurationMessage_ClosedGroup() : ConfigurationMessage_ClosedGroup(nullptr) {} + ~ConfigurationMessage_ClosedGroup() override; + explicit PROTOBUF_CONSTEXPR ConfigurationMessage_ClosedGroup(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ConfigurationMessage(const ConfigurationMessage& from); - ConfigurationMessage(ConfigurationMessage&& from) noexcept - : ConfigurationMessage() { + ConfigurationMessage_ClosedGroup(const ConfigurationMessage_ClosedGroup& from); + ConfigurationMessage_ClosedGroup(ConfigurationMessage_ClosedGroup&& from) noexcept + : ConfigurationMessage_ClosedGroup() { *this = ::std::move(from); } - inline ConfigurationMessage& operator=(const ConfigurationMessage& from) { + inline ConfigurationMessage_ClosedGroup& operator=(const ConfigurationMessage_ClosedGroup& from) { CopyFrom(from); return *this; } - inline ConfigurationMessage& operator=(ConfigurationMessage&& from) noexcept { + inline ConfigurationMessage_ClosedGroup& operator=(ConfigurationMessage_ClosedGroup&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -5125,20 +4805,20 @@ class ConfigurationMessage final : return _internal_metadata_.mutable_unknown_fields(); } - static const ConfigurationMessage& default_instance() { + static const ConfigurationMessage_ClosedGroup& default_instance() { return *internal_default_instance(); } - static inline const ConfigurationMessage* internal_default_instance() { - return reinterpret_cast( - &_ConfigurationMessage_default_instance_); + static inline const ConfigurationMessage_ClosedGroup* internal_default_instance() { + return reinterpret_cast( + &_ConfigurationMessage_ClosedGroup_default_instance_); } static constexpr int kIndexInFileMessages = - 21; + 20; - friend void swap(ConfigurationMessage& a, ConfigurationMessage& b) { + friend void swap(ConfigurationMessage_ClosedGroup& a, ConfigurationMessage_ClosedGroup& b) { a.Swap(&b); } - inline void Swap(ConfigurationMessage* other) { + inline void Swap(ConfigurationMessage_ClosedGroup* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -5151,7 +4831,7 @@ class ConfigurationMessage final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ConfigurationMessage* other) { + void UnsafeArenaSwap(ConfigurationMessage_ClosedGroup* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -5159,12 +4839,12 @@ class ConfigurationMessage final : // implements Message ---------------------------------------------- - ConfigurationMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + ConfigurationMessage_ClosedGroup* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const ConfigurationMessage& from); - void MergeFrom(const ConfigurationMessage& from); + void CopyFrom(const ConfigurationMessage_ClosedGroup& from); + void MergeFrom(const ConfigurationMessage_ClosedGroup& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -5178,15 +4858,15 @@ class ConfigurationMessage final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(ConfigurationMessage* other); + void InternalSwap(ConfigurationMessage_ClosedGroup* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.ConfigurationMessage"; + return "SessionProtos.ConfigurationMessage.ClosedGroup"; } protected: - explicit ConfigurationMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit ConfigurationMessage_ClosedGroup(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -5194,155 +4874,132 @@ class ConfigurationMessage final : // nested types ---------------------------------------------------- - typedef ConfigurationMessage_ClosedGroup ClosedGroup; - typedef ConfigurationMessage_Contact Contact; - typedef ConfigurationMessage_ProProof ProProof; - typedef ConfigurationMessage_Pro Pro; - // accessors ------------------------------------------------------- enum : int { - kClosedGroupsFieldNumber = 1, - kOpenGroupsFieldNumber = 2, - kContactsFieldNumber = 6, - kDisplayNameFieldNumber = 3, - kProfilePictureFieldNumber = 4, - kProfileKeyFieldNumber = 5, - kProFieldNumber = 7, + kMembersFieldNumber = 4, + kAdminsFieldNumber = 5, + kPublicKeyFieldNumber = 1, + kNameFieldNumber = 2, + kEncryptionKeyPairFieldNumber = 3, + kExpirationTimerFieldNumber = 6, }; - // repeated .SessionProtos.ConfigurationMessage.ClosedGroup closedGroups = 1; - int closedgroups_size() const; + // repeated bytes members = 4; + int members_size() const; private: - int _internal_closedgroups_size() const; + int _internal_members_size() const; public: - void clear_closedgroups(); - ::SessionProtos::ConfigurationMessage_ClosedGroup* mutable_closedgroups(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_ClosedGroup >* - mutable_closedgroups(); + void clear_members(); + const std::string& members(int index) const; + std::string* mutable_members(int index); + void set_members(int index, const std::string& value); + void set_members(int index, std::string&& value); + void set_members(int index, const char* value); + void set_members(int index, const void* value, size_t size); + std::string* add_members(); + void add_members(const std::string& value); + void add_members(std::string&& value); + void add_members(const char* value); + void add_members(const void* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& members() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_members(); private: - const ::SessionProtos::ConfigurationMessage_ClosedGroup& _internal_closedgroups(int index) const; - ::SessionProtos::ConfigurationMessage_ClosedGroup* _internal_add_closedgroups(); + const std::string& _internal_members(int index) const; + std::string* _internal_add_members(); public: - const ::SessionProtos::ConfigurationMessage_ClosedGroup& closedgroups(int index) const; - ::SessionProtos::ConfigurationMessage_ClosedGroup* add_closedgroups(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_ClosedGroup >& - closedgroups() const; - // repeated string openGroups = 2; - int opengroups_size() const; + // repeated bytes admins = 5; + int admins_size() const; private: - int _internal_opengroups_size() const; + int _internal_admins_size() const; public: - void clear_opengroups(); - const std::string& opengroups(int index) const; - std::string* mutable_opengroups(int index); - void set_opengroups(int index, const std::string& value); - void set_opengroups(int index, std::string&& value); - void set_opengroups(int index, const char* value); - void set_opengroups(int index, const char* value, size_t size); - std::string* add_opengroups(); - void add_opengroups(const std::string& value); - void add_opengroups(std::string&& value); - void add_opengroups(const char* value); - void add_opengroups(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& opengroups() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_opengroups(); - private: - const std::string& _internal_opengroups(int index) const; - std::string* _internal_add_opengroups(); - public: - - // repeated .SessionProtos.ConfigurationMessage.Contact contacts = 6; - int contacts_size() const; - private: - int _internal_contacts_size() const; - public: - void clear_contacts(); - ::SessionProtos::ConfigurationMessage_Contact* mutable_contacts(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_Contact >* - mutable_contacts(); + void clear_admins(); + const std::string& admins(int index) const; + std::string* mutable_admins(int index); + void set_admins(int index, const std::string& value); + void set_admins(int index, std::string&& value); + void set_admins(int index, const char* value); + void set_admins(int index, const void* value, size_t size); + std::string* add_admins(); + void add_admins(const std::string& value); + void add_admins(std::string&& value); + void add_admins(const char* value); + void add_admins(const void* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& admins() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_admins(); private: - const ::SessionProtos::ConfigurationMessage_Contact& _internal_contacts(int index) const; - ::SessionProtos::ConfigurationMessage_Contact* _internal_add_contacts(); + const std::string& _internal_admins(int index) const; + std::string* _internal_add_admins(); public: - const ::SessionProtos::ConfigurationMessage_Contact& contacts(int index) const; - ::SessionProtos::ConfigurationMessage_Contact* add_contacts(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_Contact >& - contacts() const; - // optional string displayName = 3; - bool has_displayname() const; + // optional bytes publicKey = 1; + bool has_publickey() const; private: - bool _internal_has_displayname() const; + bool _internal_has_publickey() const; public: - void clear_displayname(); - const std::string& displayname() const; + void clear_publickey(); + const std::string& publickey() const; template - void set_displayname(ArgT0&& arg0, ArgT... args); - std::string* mutable_displayname(); - PROTOBUF_NODISCARD std::string* release_displayname(); - void set_allocated_displayname(std::string* displayname); + void set_publickey(ArgT0&& arg0, ArgT... args); + std::string* mutable_publickey(); + PROTOBUF_NODISCARD std::string* release_publickey(); + void set_allocated_publickey(std::string* publickey); private: - const std::string& _internal_displayname() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_displayname(const std::string& value); - std::string* _internal_mutable_displayname(); + const std::string& _internal_publickey() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_publickey(const std::string& value); + std::string* _internal_mutable_publickey(); public: - // optional string profilePicture = 4; - bool has_profilepicture() const; + // optional string name = 2; + bool has_name() const; private: - bool _internal_has_profilepicture() const; + bool _internal_has_name() const; public: - void clear_profilepicture(); - const std::string& profilepicture() const; + void clear_name(); + const std::string& name() const; template - void set_profilepicture(ArgT0&& arg0, ArgT... args); - std::string* mutable_profilepicture(); - PROTOBUF_NODISCARD std::string* release_profilepicture(); - void set_allocated_profilepicture(std::string* profilepicture); + void set_name(ArgT0&& arg0, ArgT... args); + std::string* mutable_name(); + PROTOBUF_NODISCARD std::string* release_name(); + void set_allocated_name(std::string* name); private: - const std::string& _internal_profilepicture() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilepicture(const std::string& value); - std::string* _internal_mutable_profilepicture(); + const std::string& _internal_name() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + std::string* _internal_mutable_name(); public: - // optional bytes profileKey = 5; - bool has_profilekey() const; + // optional .SessionProtos.KeyPair encryptionKeyPair = 3; + bool has_encryptionkeypair() const; private: - bool _internal_has_profilekey() const; + bool _internal_has_encryptionkeypair() const; public: - void clear_profilekey(); - const std::string& profilekey() const; - template - void set_profilekey(ArgT0&& arg0, ArgT... args); - std::string* mutable_profilekey(); - PROTOBUF_NODISCARD std::string* release_profilekey(); - void set_allocated_profilekey(std::string* profilekey); + void clear_encryptionkeypair(); + const ::SessionProtos::KeyPair& encryptionkeypair() const; + PROTOBUF_NODISCARD ::SessionProtos::KeyPair* release_encryptionkeypair(); + ::SessionProtos::KeyPair* mutable_encryptionkeypair(); + void set_allocated_encryptionkeypair(::SessionProtos::KeyPair* encryptionkeypair); private: - const std::string& _internal_profilekey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilekey(const std::string& value); - std::string* _internal_mutable_profilekey(); + const ::SessionProtos::KeyPair& _internal_encryptionkeypair() const; + ::SessionProtos::KeyPair* _internal_mutable_encryptionkeypair(); public: + void unsafe_arena_set_allocated_encryptionkeypair( + ::SessionProtos::KeyPair* encryptionkeypair); + ::SessionProtos::KeyPair* unsafe_arena_release_encryptionkeypair(); - // optional .SessionProtos.ConfigurationMessage.Pro pro = 7; - bool has_pro() const; + // optional uint32 expirationTimer = 6; + bool has_expirationtimer() const; private: - bool _internal_has_pro() const; + bool _internal_has_expirationtimer() const; public: - void clear_pro(); - const ::SessionProtos::ConfigurationMessage_Pro& pro() const; - PROTOBUF_NODISCARD ::SessionProtos::ConfigurationMessage_Pro* release_pro(); - ::SessionProtos::ConfigurationMessage_Pro* mutable_pro(); - void set_allocated_pro(::SessionProtos::ConfigurationMessage_Pro* pro); + void clear_expirationtimer(); + uint32_t expirationtimer() const; + void set_expirationtimer(uint32_t value); private: - const ::SessionProtos::ConfigurationMessage_Pro& _internal_pro() const; - ::SessionProtos::ConfigurationMessage_Pro* _internal_mutable_pro(); + uint32_t _internal_expirationtimer() const; + void _internal_set_expirationtimer(uint32_t value); public: - void unsafe_arena_set_allocated_pro( - ::SessionProtos::ConfigurationMessage_Pro* pro); - ::SessionProtos::ConfigurationMessage_Pro* unsafe_arena_release_pro(); - // @@protoc_insertion_point(class_scope:SessionProtos.ConfigurationMessage) + // @@protoc_insertion_point(class_scope:SessionProtos.ConfigurationMessage.ClosedGroup) private: class _Internal; @@ -5352,37 +5009,36 @@ class ConfigurationMessage final : struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_ClosedGroup > closedgroups_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField opengroups_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_Contact > contacts_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr displayname_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilepicture_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilekey_; - ::SessionProtos::ConfigurationMessage_Pro* pro_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField members_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField admins_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr publickey_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::SessionProtos::KeyPair* encryptionkeypair_; + uint32_t expirationtimer_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class ReceiptMessage final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ReceiptMessage) */ { +class ConfigurationMessage_Contact final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ConfigurationMessage.Contact) */ { public: - inline ReceiptMessage() : ReceiptMessage(nullptr) {} - ~ReceiptMessage() override; - explicit PROTOBUF_CONSTEXPR ReceiptMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline ConfigurationMessage_Contact() : ConfigurationMessage_Contact(nullptr) {} + ~ConfigurationMessage_Contact() override; + explicit PROTOBUF_CONSTEXPR ConfigurationMessage_Contact(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ReceiptMessage(const ReceiptMessage& from); - ReceiptMessage(ReceiptMessage&& from) noexcept - : ReceiptMessage() { + ConfigurationMessage_Contact(const ConfigurationMessage_Contact& from); + ConfigurationMessage_Contact(ConfigurationMessage_Contact&& from) noexcept + : ConfigurationMessage_Contact() { *this = ::std::move(from); } - inline ReceiptMessage& operator=(const ReceiptMessage& from) { + inline ConfigurationMessage_Contact& operator=(const ConfigurationMessage_Contact& from) { CopyFrom(from); return *this; } - inline ReceiptMessage& operator=(ReceiptMessage&& from) noexcept { + inline ConfigurationMessage_Contact& operator=(ConfigurationMessage_Contact&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -5403,20 +5059,20 @@ class ReceiptMessage final : return _internal_metadata_.mutable_unknown_fields(); } - static const ReceiptMessage& default_instance() { + static const ConfigurationMessage_Contact& default_instance() { return *internal_default_instance(); } - static inline const ReceiptMessage* internal_default_instance() { - return reinterpret_cast( - &_ReceiptMessage_default_instance_); + static inline const ConfigurationMessage_Contact* internal_default_instance() { + return reinterpret_cast( + &_ConfigurationMessage_Contact_default_instance_); } static constexpr int kIndexInFileMessages = - 22; + 21; - friend void swap(ReceiptMessage& a, ReceiptMessage& b) { + friend void swap(ConfigurationMessage_Contact& a, ConfigurationMessage_Contact& b) { a.Swap(&b); } - inline void Swap(ReceiptMessage* other) { + inline void Swap(ConfigurationMessage_Contact* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -5429,7 +5085,7 @@ class ReceiptMessage final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ReceiptMessage* other) { + void UnsafeArenaSwap(ConfigurationMessage_Contact* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -5437,12 +5093,12 @@ class ReceiptMessage final : // implements Message ---------------------------------------------- - ReceiptMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + ConfigurationMessage_Contact* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const ReceiptMessage& from); - void MergeFrom(const ReceiptMessage& from); + void CopyFrom(const ConfigurationMessage_Contact& from); + void MergeFrom(const ConfigurationMessage_Contact& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -5456,15 +5112,15 @@ class ReceiptMessage final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(ReceiptMessage* other); + void InternalSwap(ConfigurationMessage_Contact* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.ReceiptMessage"; + return "SessionProtos.ConfigurationMessage.Contact"; } protected: - explicit ReceiptMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit ConfigurationMessage_Contact(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -5472,109 +5128,172 @@ class ReceiptMessage final : // nested types ---------------------------------------------------- - typedef ReceiptMessage_Type Type; - static constexpr Type DELIVERY = - ReceiptMessage_Type_DELIVERY; - static constexpr Type READ = - ReceiptMessage_Type_READ; - static inline bool Type_IsValid(int value) { - return ReceiptMessage_Type_IsValid(value); - } - static constexpr Type Type_MIN = - ReceiptMessage_Type_Type_MIN; - static constexpr Type Type_MAX = - ReceiptMessage_Type_Type_MAX; - static constexpr int Type_ARRAYSIZE = - ReceiptMessage_Type_Type_ARRAYSIZE; - template - static inline const std::string& Type_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function Type_Name."); - return ReceiptMessage_Type_Name(enum_t_value); - } - static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Type* value) { - return ReceiptMessage_Type_Parse(name, value); - } - // accessors ------------------------------------------------------- enum : int { - kTimestampFieldNumber = 2, - kTypeFieldNumber = 1, + kPublicKeyFieldNumber = 1, + kNameFieldNumber = 2, + kProfilePictureFieldNumber = 3, + kProfileKeyFieldNumber = 4, + kIsApprovedFieldNumber = 5, + kIsBlockedFieldNumber = 6, + kDidApproveMeFieldNumber = 7, }; - // repeated uint64 timestamp = 2; - int timestamp_size() const; + // required bytes publicKey = 1; + bool has_publickey() const; private: - int _internal_timestamp_size() const; + bool _internal_has_publickey() const; public: - void clear_timestamp(); + void clear_publickey(); + const std::string& publickey() const; + template + void set_publickey(ArgT0&& arg0, ArgT... args); + std::string* mutable_publickey(); + PROTOBUF_NODISCARD std::string* release_publickey(); + void set_allocated_publickey(std::string* publickey); private: - uint64_t _internal_timestamp(int index) const; - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& - _internal_timestamp() const; - void _internal_add_timestamp(uint64_t value); - ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* - _internal_mutable_timestamp(); + const std::string& _internal_publickey() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_publickey(const std::string& value); + std::string* _internal_mutable_publickey(); public: - uint64_t timestamp(int index) const; - void set_timestamp(int index, uint64_t value); - void add_timestamp(uint64_t value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& - timestamp() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* - mutable_timestamp(); - // required .SessionProtos.ReceiptMessage.Type type = 1; - bool has_type() const; + // required string name = 2; + bool has_name() const; private: - bool _internal_has_type() const; + bool _internal_has_name() const; public: - void clear_type(); - ::SessionProtos::ReceiptMessage_Type type() const; - void set_type(::SessionProtos::ReceiptMessage_Type value); + void clear_name(); + const std::string& name() const; + template + void set_name(ArgT0&& arg0, ArgT... args); + std::string* mutable_name(); + PROTOBUF_NODISCARD std::string* release_name(); + void set_allocated_name(std::string* name); private: - ::SessionProtos::ReceiptMessage_Type _internal_type() const; - void _internal_set_type(::SessionProtos::ReceiptMessage_Type value); + const std::string& _internal_name() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + std::string* _internal_mutable_name(); public: - // @@protoc_insertion_point(class_scope:SessionProtos.ReceiptMessage) + // optional string profilePicture = 3; + bool has_profilepicture() const; + private: + bool _internal_has_profilepicture() const; + public: + void clear_profilepicture(); + const std::string& profilepicture() const; + template + void set_profilepicture(ArgT0&& arg0, ArgT... args); + std::string* mutable_profilepicture(); + PROTOBUF_NODISCARD std::string* release_profilepicture(); + void set_allocated_profilepicture(std::string* profilepicture); + private: + const std::string& _internal_profilepicture() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilepicture(const std::string& value); + std::string* _internal_mutable_profilepicture(); + public: + + // optional bytes profileKey = 4; + bool has_profilekey() const; + private: + bool _internal_has_profilekey() const; + public: + void clear_profilekey(); + const std::string& profilekey() const; + template + void set_profilekey(ArgT0&& arg0, ArgT... args); + std::string* mutable_profilekey(); + PROTOBUF_NODISCARD std::string* release_profilekey(); + void set_allocated_profilekey(std::string* profilekey); + private: + const std::string& _internal_profilekey() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilekey(const std::string& value); + std::string* _internal_mutable_profilekey(); + public: + + // optional bool isApproved = 5; + bool has_isapproved() const; + private: + bool _internal_has_isapproved() const; + public: + void clear_isapproved(); + bool isapproved() const; + void set_isapproved(bool value); + private: + bool _internal_isapproved() const; + void _internal_set_isapproved(bool value); + public: + + // optional bool isBlocked = 6; + bool has_isblocked() const; + private: + bool _internal_has_isblocked() const; + public: + void clear_isblocked(); + bool isblocked() const; + void set_isblocked(bool value); + private: + bool _internal_isblocked() const; + void _internal_set_isblocked(bool value); + public: + + // optional bool didApproveMe = 7; + bool has_didapproveme() const; + private: + bool _internal_has_didapproveme() const; + public: + void clear_didapproveme(); + bool didapproveme() const; + void set_didapproveme(bool value); + private: + bool _internal_didapproveme() const; + void _internal_set_didapproveme(bool value); + public: + + // @@protoc_insertion_point(class_scope:SessionProtos.ConfigurationMessage.Contact) private: class _Internal; + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t > timestamp_; - int type_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr publickey_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilepicture_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilekey_; + bool isapproved_; + bool isblocked_; + bool didapproveme_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class AttachmentPointer final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.AttachmentPointer) */ { +class ConfigurationMessage final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ConfigurationMessage) */ { public: - inline AttachmentPointer() : AttachmentPointer(nullptr) {} - ~AttachmentPointer() override; - explicit PROTOBUF_CONSTEXPR AttachmentPointer(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline ConfigurationMessage() : ConfigurationMessage(nullptr) {} + ~ConfigurationMessage() override; + explicit PROTOBUF_CONSTEXPR ConfigurationMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - AttachmentPointer(const AttachmentPointer& from); - AttachmentPointer(AttachmentPointer&& from) noexcept - : AttachmentPointer() { + ConfigurationMessage(const ConfigurationMessage& from); + ConfigurationMessage(ConfigurationMessage&& from) noexcept + : ConfigurationMessage() { *this = ::std::move(from); } - inline AttachmentPointer& operator=(const AttachmentPointer& from) { + inline ConfigurationMessage& operator=(const ConfigurationMessage& from) { CopyFrom(from); return *this; } - inline AttachmentPointer& operator=(AttachmentPointer&& from) noexcept { + inline ConfigurationMessage& operator=(ConfigurationMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -5595,20 +5314,20 @@ class AttachmentPointer final : return _internal_metadata_.mutable_unknown_fields(); } - static const AttachmentPointer& default_instance() { + static const ConfigurationMessage& default_instance() { return *internal_default_instance(); } - static inline const AttachmentPointer* internal_default_instance() { - return reinterpret_cast( - &_AttachmentPointer_default_instance_); + static inline const ConfigurationMessage* internal_default_instance() { + return reinterpret_cast( + &_ConfigurationMessage_default_instance_); } static constexpr int kIndexInFileMessages = - 23; + 22; - friend void swap(AttachmentPointer& a, AttachmentPointer& b) { + friend void swap(ConfigurationMessage& a, ConfigurationMessage& b) { a.Swap(&b); } - inline void Swap(AttachmentPointer* other) { + inline void Swap(ConfigurationMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -5621,7 +5340,7 @@ class AttachmentPointer final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(AttachmentPointer* other) { + void UnsafeArenaSwap(ConfigurationMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -5629,12 +5348,12 @@ class AttachmentPointer final : // implements Message ---------------------------------------------- - AttachmentPointer* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + ConfigurationMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const AttachmentPointer& from); - void MergeFrom(const AttachmentPointer& from); + void CopyFrom(const ConfigurationMessage& from); + void MergeFrom(const ConfigurationMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -5648,15 +5367,15 @@ class AttachmentPointer final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(AttachmentPointer* other); + void InternalSwap(ConfigurationMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.AttachmentPointer"; + return "SessionProtos.ConfigurationMessage"; } protected: - explicit AttachmentPointer(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit ConfigurationMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -5664,238 +5383,153 @@ class AttachmentPointer final : // nested types ---------------------------------------------------- - typedef AttachmentPointer_Flags Flags; - static constexpr Flags VOICE_MESSAGE = - AttachmentPointer_Flags_VOICE_MESSAGE; - static inline bool Flags_IsValid(int value) { - return AttachmentPointer_Flags_IsValid(value); - } - static constexpr Flags Flags_MIN = - AttachmentPointer_Flags_Flags_MIN; - static constexpr Flags Flags_MAX = - AttachmentPointer_Flags_Flags_MAX; - static constexpr int Flags_ARRAYSIZE = - AttachmentPointer_Flags_Flags_ARRAYSIZE; - template - static inline const std::string& Flags_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function Flags_Name."); - return AttachmentPointer_Flags_Name(enum_t_value); - } - static inline bool Flags_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Flags* value) { - return AttachmentPointer_Flags_Parse(name, value); - } + typedef ConfigurationMessage_ClosedGroup ClosedGroup; + typedef ConfigurationMessage_Contact Contact; // accessors ------------------------------------------------------- enum : int { - kContentTypeFieldNumber = 2, - kKeyFieldNumber = 3, - kThumbnailFieldNumber = 5, - kDigestFieldNumber = 6, - kFileNameFieldNumber = 7, - kCaptionFieldNumber = 11, - kUrlFieldNumber = 101, - kIdFieldNumber = 1, - kSizeFieldNumber = 4, - kFlagsFieldNumber = 8, - kWidthFieldNumber = 9, - kHeightFieldNumber = 10, + kClosedGroupsFieldNumber = 1, + kOpenGroupsFieldNumber = 2, + kContactsFieldNumber = 6, + kDisplayNameFieldNumber = 3, + kProfilePictureFieldNumber = 4, + kProfileKeyFieldNumber = 5, + kProConfigFieldNumber = 7, }; - // optional string contentType = 2; - bool has_contenttype() const; + // repeated .SessionProtos.ConfigurationMessage.ClosedGroup closedGroups = 1; + int closedgroups_size() const; private: - bool _internal_has_contenttype() const; + int _internal_closedgroups_size() const; public: - void clear_contenttype(); - const std::string& contenttype() const; - template - void set_contenttype(ArgT0&& arg0, ArgT... args); - std::string* mutable_contenttype(); - PROTOBUF_NODISCARD std::string* release_contenttype(); - void set_allocated_contenttype(std::string* contenttype); + void clear_closedgroups(); + ::SessionProtos::ConfigurationMessage_ClosedGroup* mutable_closedgroups(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_ClosedGroup >* + mutable_closedgroups(); private: - const std::string& _internal_contenttype() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_contenttype(const std::string& value); - std::string* _internal_mutable_contenttype(); + const ::SessionProtos::ConfigurationMessage_ClosedGroup& _internal_closedgroups(int index) const; + ::SessionProtos::ConfigurationMessage_ClosedGroup* _internal_add_closedgroups(); public: + const ::SessionProtos::ConfigurationMessage_ClosedGroup& closedgroups(int index) const; + ::SessionProtos::ConfigurationMessage_ClosedGroup* add_closedgroups(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_ClosedGroup >& + closedgroups() const; - // optional bytes key = 3; - bool has_key() const; + // repeated string openGroups = 2; + int opengroups_size() const; private: - bool _internal_has_key() const; + int _internal_opengroups_size() const; public: - void clear_key(); - const std::string& key() const; - template - void set_key(ArgT0&& arg0, ArgT... args); - std::string* mutable_key(); - PROTOBUF_NODISCARD std::string* release_key(); - void set_allocated_key(std::string* key); + void clear_opengroups(); + const std::string& opengroups(int index) const; + std::string* mutable_opengroups(int index); + void set_opengroups(int index, const std::string& value); + void set_opengroups(int index, std::string&& value); + void set_opengroups(int index, const char* value); + void set_opengroups(int index, const char* value, size_t size); + std::string* add_opengroups(); + void add_opengroups(const std::string& value); + void add_opengroups(std::string&& value); + void add_opengroups(const char* value); + void add_opengroups(const char* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& opengroups() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_opengroups(); private: - const std::string& _internal_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_key(const std::string& value); - std::string* _internal_mutable_key(); + const std::string& _internal_opengroups(int index) const; + std::string* _internal_add_opengroups(); public: - // optional bytes thumbnail = 5; - bool has_thumbnail() const; - private: - bool _internal_has_thumbnail() const; - public: - void clear_thumbnail(); - const std::string& thumbnail() const; - template - void set_thumbnail(ArgT0&& arg0, ArgT... args); - std::string* mutable_thumbnail(); - PROTOBUF_NODISCARD std::string* release_thumbnail(); - void set_allocated_thumbnail(std::string* thumbnail); - private: - const std::string& _internal_thumbnail() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_thumbnail(const std::string& value); - std::string* _internal_mutable_thumbnail(); - public: - - // optional bytes digest = 6; - bool has_digest() const; + // repeated .SessionProtos.ConfigurationMessage.Contact contacts = 6; + int contacts_size() const; private: - bool _internal_has_digest() const; + int _internal_contacts_size() const; public: - void clear_digest(); - const std::string& digest() const; - template - void set_digest(ArgT0&& arg0, ArgT... args); - std::string* mutable_digest(); - PROTOBUF_NODISCARD std::string* release_digest(); - void set_allocated_digest(std::string* digest); + void clear_contacts(); + ::SessionProtos::ConfigurationMessage_Contact* mutable_contacts(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_Contact >* + mutable_contacts(); private: - const std::string& _internal_digest() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_digest(const std::string& value); - std::string* _internal_mutable_digest(); + const ::SessionProtos::ConfigurationMessage_Contact& _internal_contacts(int index) const; + ::SessionProtos::ConfigurationMessage_Contact* _internal_add_contacts(); public: + const ::SessionProtos::ConfigurationMessage_Contact& contacts(int index) const; + ::SessionProtos::ConfigurationMessage_Contact* add_contacts(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_Contact >& + contacts() const; - // optional string fileName = 7; - bool has_filename() const; + // optional string displayName = 3; + bool has_displayname() const; private: - bool _internal_has_filename() const; + bool _internal_has_displayname() const; public: - void clear_filename(); - const std::string& filename() const; + void clear_displayname(); + const std::string& displayname() const; template - void set_filename(ArgT0&& arg0, ArgT... args); - std::string* mutable_filename(); - PROTOBUF_NODISCARD std::string* release_filename(); - void set_allocated_filename(std::string* filename); + void set_displayname(ArgT0&& arg0, ArgT... args); + std::string* mutable_displayname(); + PROTOBUF_NODISCARD std::string* release_displayname(); + void set_allocated_displayname(std::string* displayname); private: - const std::string& _internal_filename() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_filename(const std::string& value); - std::string* _internal_mutable_filename(); + const std::string& _internal_displayname() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_displayname(const std::string& value); + std::string* _internal_mutable_displayname(); public: - // optional string caption = 11; - bool has_caption() const; + // optional string profilePicture = 4; + bool has_profilepicture() const; private: - bool _internal_has_caption() const; + bool _internal_has_profilepicture() const; public: - void clear_caption(); - const std::string& caption() const; + void clear_profilepicture(); + const std::string& profilepicture() const; template - void set_caption(ArgT0&& arg0, ArgT... args); - std::string* mutable_caption(); - PROTOBUF_NODISCARD std::string* release_caption(); - void set_allocated_caption(std::string* caption); + void set_profilepicture(ArgT0&& arg0, ArgT... args); + std::string* mutable_profilepicture(); + PROTOBUF_NODISCARD std::string* release_profilepicture(); + void set_allocated_profilepicture(std::string* profilepicture); private: - const std::string& _internal_caption() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_caption(const std::string& value); - std::string* _internal_mutable_caption(); + const std::string& _internal_profilepicture() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilepicture(const std::string& value); + std::string* _internal_mutable_profilepicture(); public: - // optional string url = 101; - bool has_url() const; + // optional bytes profileKey = 5; + bool has_profilekey() const; private: - bool _internal_has_url() const; + bool _internal_has_profilekey() const; public: - void clear_url(); - const std::string& url() const; + void clear_profilekey(); + const std::string& profilekey() const; template - void set_url(ArgT0&& arg0, ArgT... args); - std::string* mutable_url(); - PROTOBUF_NODISCARD std::string* release_url(); - void set_allocated_url(std::string* url); - private: - const std::string& _internal_url() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_url(const std::string& value); - std::string* _internal_mutable_url(); - public: - - // required fixed64 id = 1; - bool has_id() const; - private: - bool _internal_has_id() const; - public: - void clear_id(); - uint64_t id() const; - void set_id(uint64_t value); - private: - uint64_t _internal_id() const; - void _internal_set_id(uint64_t value); - public: - - // optional uint32 size = 4; - bool has_size() const; - private: - bool _internal_has_size() const; - public: - void clear_size(); - uint32_t size() const; - void set_size(uint32_t value); - private: - uint32_t _internal_size() const; - void _internal_set_size(uint32_t value); - public: - - // optional uint32 flags = 8; - bool has_flags() const; - private: - bool _internal_has_flags() const; - public: - void clear_flags(); - uint32_t flags() const; - void set_flags(uint32_t value); - private: - uint32_t _internal_flags() const; - void _internal_set_flags(uint32_t value); - public: - - // optional uint32 width = 9; - bool has_width() const; - private: - bool _internal_has_width() const; - public: - void clear_width(); - uint32_t width() const; - void set_width(uint32_t value); + void set_profilekey(ArgT0&& arg0, ArgT... args); + std::string* mutable_profilekey(); + PROTOBUF_NODISCARD std::string* release_profilekey(); + void set_allocated_profilekey(std::string* profilekey); private: - uint32_t _internal_width() const; - void _internal_set_width(uint32_t value); + const std::string& _internal_profilekey() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilekey(const std::string& value); + std::string* _internal_mutable_profilekey(); public: - // optional uint32 height = 10; - bool has_height() const; + // optional .SessionProtos.ProConfig proConfig = 7; + bool has_proconfig() const; private: - bool _internal_has_height() const; + bool _internal_has_proconfig() const; public: - void clear_height(); - uint32_t height() const; - void set_height(uint32_t value); + void clear_proconfig(); + const ::SessionProtos::ProConfig& proconfig() const; + PROTOBUF_NODISCARD ::SessionProtos::ProConfig* release_proconfig(); + ::SessionProtos::ProConfig* mutable_proconfig(); + void set_allocated_proconfig(::SessionProtos::ProConfig* proconfig); private: - uint32_t _internal_height() const; - void _internal_set_height(uint32_t value); + const ::SessionProtos::ProConfig& _internal_proconfig() const; + ::SessionProtos::ProConfig* _internal_mutable_proconfig(); public: + void unsafe_arena_set_allocated_proconfig( + ::SessionProtos::ProConfig* proconfig); + ::SessionProtos::ProConfig* unsafe_arena_release_proconfig(); - // @@protoc_insertion_point(class_scope:SessionProtos.AttachmentPointer) + // @@protoc_insertion_point(class_scope:SessionProtos.ConfigurationMessage) private: class _Internal; @@ -5905,42 +5539,37 @@ class AttachmentPointer final : struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr contenttype_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr key_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr thumbnail_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr digest_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr filename_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr caption_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr url_; - uint64_t id_; - uint32_t size_; - uint32_t flags_; - uint32_t width_; - uint32_t height_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_ClosedGroup > closedgroups_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField opengroups_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_Contact > contacts_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr displayname_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilepicture_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilekey_; + ::SessionProtos::ProConfig* proconfig_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class SharedConfigMessage final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.SharedConfigMessage) */ { +class ReceiptMessage final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ReceiptMessage) */ { public: - inline SharedConfigMessage() : SharedConfigMessage(nullptr) {} - ~SharedConfigMessage() override; - explicit PROTOBUF_CONSTEXPR SharedConfigMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline ReceiptMessage() : ReceiptMessage(nullptr) {} + ~ReceiptMessage() override; + explicit PROTOBUF_CONSTEXPR ReceiptMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - SharedConfigMessage(const SharedConfigMessage& from); - SharedConfigMessage(SharedConfigMessage&& from) noexcept - : SharedConfigMessage() { + ReceiptMessage(const ReceiptMessage& from); + ReceiptMessage(ReceiptMessage&& from) noexcept + : ReceiptMessage() { *this = ::std::move(from); } - inline SharedConfigMessage& operator=(const SharedConfigMessage& from) { + inline ReceiptMessage& operator=(const ReceiptMessage& from) { CopyFrom(from); return *this; } - inline SharedConfigMessage& operator=(SharedConfigMessage&& from) noexcept { + inline ReceiptMessage& operator=(ReceiptMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -5961,20 +5590,20 @@ class SharedConfigMessage final : return _internal_metadata_.mutable_unknown_fields(); } - static const SharedConfigMessage& default_instance() { + static const ReceiptMessage& default_instance() { return *internal_default_instance(); } - static inline const SharedConfigMessage* internal_default_instance() { - return reinterpret_cast( - &_SharedConfigMessage_default_instance_); + static inline const ReceiptMessage* internal_default_instance() { + return reinterpret_cast( + &_ReceiptMessage_default_instance_); } static constexpr int kIndexInFileMessages = - 24; + 23; - friend void swap(SharedConfigMessage& a, SharedConfigMessage& b) { + friend void swap(ReceiptMessage& a, ReceiptMessage& b) { a.Swap(&b); } - inline void Swap(SharedConfigMessage* other) { + inline void Swap(ReceiptMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -5987,7 +5616,7 @@ class SharedConfigMessage final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(SharedConfigMessage* other) { + void UnsafeArenaSwap(ReceiptMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -5995,12 +5624,12 @@ class SharedConfigMessage final : // implements Message ---------------------------------------------- - SharedConfigMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + ReceiptMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const SharedConfigMessage& from); - void MergeFrom(const SharedConfigMessage& from); + void CopyFrom(const ReceiptMessage& from); + void MergeFrom(const ReceiptMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -6014,15 +5643,15 @@ class SharedConfigMessage final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const; - void InternalSwap(SharedConfigMessage* other); + void InternalSwap(ReceiptMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.SharedConfigMessage"; + return "SessionProtos.ReceiptMessage"; } protected: - explicit SharedConfigMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit ReceiptMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -6030,667 +5659,1651 @@ class SharedConfigMessage final : // nested types ---------------------------------------------------- - typedef SharedConfigMessage_Kind Kind; - static constexpr Kind USER_PROFILE = - SharedConfigMessage_Kind_USER_PROFILE; - static constexpr Kind CONTACTS = - SharedConfigMessage_Kind_CONTACTS; - static constexpr Kind CONVO_INFO_VOLATILE = - SharedConfigMessage_Kind_CONVO_INFO_VOLATILE; - static constexpr Kind USER_GROUPS = - SharedConfigMessage_Kind_USER_GROUPS; - static inline bool Kind_IsValid(int value) { - return SharedConfigMessage_Kind_IsValid(value); - } - static constexpr Kind Kind_MIN = - SharedConfigMessage_Kind_Kind_MIN; - static constexpr Kind Kind_MAX = - SharedConfigMessage_Kind_Kind_MAX; - static constexpr int Kind_ARRAYSIZE = - SharedConfigMessage_Kind_Kind_ARRAYSIZE; + typedef ReceiptMessage_Type Type; + static constexpr Type DELIVERY = + ReceiptMessage_Type_DELIVERY; + static constexpr Type READ = + ReceiptMessage_Type_READ; + static inline bool Type_IsValid(int value) { + return ReceiptMessage_Type_IsValid(value); + } + static constexpr Type Type_MIN = + ReceiptMessage_Type_Type_MIN; + static constexpr Type Type_MAX = + ReceiptMessage_Type_Type_MAX; + static constexpr int Type_ARRAYSIZE = + ReceiptMessage_Type_Type_ARRAYSIZE; template - static inline const std::string& Kind_Name(T enum_t_value) { - static_assert(::std::is_same::value || + static inline const std::string& Type_Name(T enum_t_value) { + static_assert(::std::is_same::value || ::std::is_integral::value, - "Incorrect type passed to function Kind_Name."); - return SharedConfigMessage_Kind_Name(enum_t_value); + "Incorrect type passed to function Type_Name."); + return ReceiptMessage_Type_Name(enum_t_value); } - static inline bool Kind_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Kind* value) { - return SharedConfigMessage_Kind_Parse(name, value); + static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Type* value) { + return ReceiptMessage_Type_Parse(name, value); } // accessors ------------------------------------------------------- enum : int { - kDataFieldNumber = 3, - kSeqnoFieldNumber = 2, - kKindFieldNumber = 1, + kTimestampFieldNumber = 2, + kTypeFieldNumber = 1, }; - // required bytes data = 3; - bool has_data() const; - private: - bool _internal_has_data() const; - public: - void clear_data(); - const std::string& data() const; - template - void set_data(ArgT0&& arg0, ArgT... args); - std::string* mutable_data(); - PROTOBUF_NODISCARD std::string* release_data(); - void set_allocated_data(std::string* data); - private: - const std::string& _internal_data() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_data(const std::string& value); - std::string* _internal_mutable_data(); - public: - - // required int64 seqno = 2; - bool has_seqno() const; + // repeated uint64 timestamp = 2; + int timestamp_size() const; private: - bool _internal_has_seqno() const; + int _internal_timestamp_size() const; public: - void clear_seqno(); - int64_t seqno() const; - void set_seqno(int64_t value); + void clear_timestamp(); private: - int64_t _internal_seqno() const; - void _internal_set_seqno(int64_t value); + uint64_t _internal_timestamp(int index) const; + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& + _internal_timestamp() const; + void _internal_add_timestamp(uint64_t value); + ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* + _internal_mutable_timestamp(); public: + uint64_t timestamp(int index) const; + void set_timestamp(int index, uint64_t value); + void add_timestamp(uint64_t value); + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& + timestamp() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* + mutable_timestamp(); - // required .SessionProtos.SharedConfigMessage.Kind kind = 1; - bool has_kind() const; + // required .SessionProtos.ReceiptMessage.Type type = 1; + bool has_type() const; private: - bool _internal_has_kind() const; + bool _internal_has_type() const; public: - void clear_kind(); - ::SessionProtos::SharedConfigMessage_Kind kind() const; - void set_kind(::SessionProtos::SharedConfigMessage_Kind value); + void clear_type(); + ::SessionProtos::ReceiptMessage_Type type() const; + void set_type(::SessionProtos::ReceiptMessage_Type value); private: - ::SessionProtos::SharedConfigMessage_Kind _internal_kind() const; - void _internal_set_kind(::SessionProtos::SharedConfigMessage_Kind value); + ::SessionProtos::ReceiptMessage_Type _internal_type() const; + void _internal_set_type(::SessionProtos::ReceiptMessage_Type value); public: - // @@protoc_insertion_point(class_scope:SessionProtos.SharedConfigMessage) + // @@protoc_insertion_point(class_scope:SessionProtos.ReceiptMessage) private: class _Internal; - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr data_; - int64_t seqno_; - int kind_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t > timestamp_; + int type_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; -// =================================================================== +// ------------------------------------------------------------------- +class AttachmentPointer final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.AttachmentPointer) */ { + public: + inline AttachmentPointer() : AttachmentPointer(nullptr) {} + ~AttachmentPointer() override; + explicit PROTOBUF_CONSTEXPR AttachmentPointer(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); -// =================================================================== + AttachmentPointer(const AttachmentPointer& from); + AttachmentPointer(AttachmentPointer&& from) noexcept + : AttachmentPointer() { + *this = ::std::move(from); + } -#ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -// Envelope + inline AttachmentPointer& operator=(const AttachmentPointer& from) { + CopyFrom(from); + return *this; + } + inline AttachmentPointer& operator=(AttachmentPointer&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } -// required .SessionProtos.Envelope.Type type = 1; -inline bool Envelope::_internal_has_type() const { - bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; - return value; -} -inline bool Envelope::has_type() const { - return _internal_has_type(); -} -inline void Envelope::clear_type() { - _impl_.type_ = 6; - _impl_._has_bits_[0] &= ~0x00000020u; -} -inline ::SessionProtos::Envelope_Type Envelope::_internal_type() const { - return static_cast< ::SessionProtos::Envelope_Type >(_impl_.type_); -} -inline ::SessionProtos::Envelope_Type Envelope::type() const { - // @@protoc_insertion_point(field_get:SessionProtos.Envelope.type) - return _internal_type(); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + } + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const AttachmentPointer& default_instance() { + return *internal_default_instance(); + } + static inline const AttachmentPointer* internal_default_instance() { + return reinterpret_cast( + &_AttachmentPointer_default_instance_); + } + static constexpr int kIndexInFileMessages = + 24; + + friend void swap(AttachmentPointer& a, AttachmentPointer& b) { + a.Swap(&b); + } + inline void Swap(AttachmentPointer* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(AttachmentPointer* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + AttachmentPointer* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; + void CopyFrom(const AttachmentPointer& from); + void MergeFrom(const AttachmentPointer& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(AttachmentPointer* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "SessionProtos.AttachmentPointer"; + } + protected: + explicit AttachmentPointer(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + std::string GetTypeName() const final; + + // nested types ---------------------------------------------------- + + typedef AttachmentPointer_Flags Flags; + static constexpr Flags VOICE_MESSAGE = + AttachmentPointer_Flags_VOICE_MESSAGE; + static inline bool Flags_IsValid(int value) { + return AttachmentPointer_Flags_IsValid(value); + } + static constexpr Flags Flags_MIN = + AttachmentPointer_Flags_Flags_MIN; + static constexpr Flags Flags_MAX = + AttachmentPointer_Flags_Flags_MAX; + static constexpr int Flags_ARRAYSIZE = + AttachmentPointer_Flags_Flags_ARRAYSIZE; + template + static inline const std::string& Flags_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Flags_Name."); + return AttachmentPointer_Flags_Name(enum_t_value); + } + static inline bool Flags_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Flags* value) { + return AttachmentPointer_Flags_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + enum : int { + kContentTypeFieldNumber = 2, + kKeyFieldNumber = 3, + kThumbnailFieldNumber = 5, + kDigestFieldNumber = 6, + kFileNameFieldNumber = 7, + kCaptionFieldNumber = 11, + kUrlFieldNumber = 101, + kIdFieldNumber = 1, + kSizeFieldNumber = 4, + kFlagsFieldNumber = 8, + kWidthFieldNumber = 9, + kHeightFieldNumber = 10, + }; + // optional string contentType = 2; + bool has_contenttype() const; + private: + bool _internal_has_contenttype() const; + public: + void clear_contenttype(); + const std::string& contenttype() const; + template + void set_contenttype(ArgT0&& arg0, ArgT... args); + std::string* mutable_contenttype(); + PROTOBUF_NODISCARD std::string* release_contenttype(); + void set_allocated_contenttype(std::string* contenttype); + private: + const std::string& _internal_contenttype() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_contenttype(const std::string& value); + std::string* _internal_mutable_contenttype(); + public: + + // optional bytes key = 3; + bool has_key() const; + private: + bool _internal_has_key() const; + public: + void clear_key(); + const std::string& key() const; + template + void set_key(ArgT0&& arg0, ArgT... args); + std::string* mutable_key(); + PROTOBUF_NODISCARD std::string* release_key(); + void set_allocated_key(std::string* key); + private: + const std::string& _internal_key() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_key(const std::string& value); + std::string* _internal_mutable_key(); + public: + + // optional bytes thumbnail = 5; + bool has_thumbnail() const; + private: + bool _internal_has_thumbnail() const; + public: + void clear_thumbnail(); + const std::string& thumbnail() const; + template + void set_thumbnail(ArgT0&& arg0, ArgT... args); + std::string* mutable_thumbnail(); + PROTOBUF_NODISCARD std::string* release_thumbnail(); + void set_allocated_thumbnail(std::string* thumbnail); + private: + const std::string& _internal_thumbnail() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_thumbnail(const std::string& value); + std::string* _internal_mutable_thumbnail(); + public: + + // optional bytes digest = 6; + bool has_digest() const; + private: + bool _internal_has_digest() const; + public: + void clear_digest(); + const std::string& digest() const; + template + void set_digest(ArgT0&& arg0, ArgT... args); + std::string* mutable_digest(); + PROTOBUF_NODISCARD std::string* release_digest(); + void set_allocated_digest(std::string* digest); + private: + const std::string& _internal_digest() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_digest(const std::string& value); + std::string* _internal_mutable_digest(); + public: + + // optional string fileName = 7; + bool has_filename() const; + private: + bool _internal_has_filename() const; + public: + void clear_filename(); + const std::string& filename() const; + template + void set_filename(ArgT0&& arg0, ArgT... args); + std::string* mutable_filename(); + PROTOBUF_NODISCARD std::string* release_filename(); + void set_allocated_filename(std::string* filename); + private: + const std::string& _internal_filename() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_filename(const std::string& value); + std::string* _internal_mutable_filename(); + public: + + // optional string caption = 11; + bool has_caption() const; + private: + bool _internal_has_caption() const; + public: + void clear_caption(); + const std::string& caption() const; + template + void set_caption(ArgT0&& arg0, ArgT... args); + std::string* mutable_caption(); + PROTOBUF_NODISCARD std::string* release_caption(); + void set_allocated_caption(std::string* caption); + private: + const std::string& _internal_caption() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_caption(const std::string& value); + std::string* _internal_mutable_caption(); + public: + + // optional string url = 101; + bool has_url() const; + private: + bool _internal_has_url() const; + public: + void clear_url(); + const std::string& url() const; + template + void set_url(ArgT0&& arg0, ArgT... args); + std::string* mutable_url(); + PROTOBUF_NODISCARD std::string* release_url(); + void set_allocated_url(std::string* url); + private: + const std::string& _internal_url() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_url(const std::string& value); + std::string* _internal_mutable_url(); + public: + + // required fixed64 id = 1; + bool has_id() const; + private: + bool _internal_has_id() const; + public: + void clear_id(); + uint64_t id() const; + void set_id(uint64_t value); + private: + uint64_t _internal_id() const; + void _internal_set_id(uint64_t value); + public: + + // optional uint32 size = 4; + bool has_size() const; + private: + bool _internal_has_size() const; + public: + void clear_size(); + uint32_t size() const; + void set_size(uint32_t value); + private: + uint32_t _internal_size() const; + void _internal_set_size(uint32_t value); + public: + + // optional uint32 flags = 8; + bool has_flags() const; + private: + bool _internal_has_flags() const; + public: + void clear_flags(); + uint32_t flags() const; + void set_flags(uint32_t value); + private: + uint32_t _internal_flags() const; + void _internal_set_flags(uint32_t value); + public: + + // optional uint32 width = 9; + bool has_width() const; + private: + bool _internal_has_width() const; + public: + void clear_width(); + uint32_t width() const; + void set_width(uint32_t value); + private: + uint32_t _internal_width() const; + void _internal_set_width(uint32_t value); + public: + + // optional uint32 height = 10; + bool has_height() const; + private: + bool _internal_has_height() const; + public: + void clear_height(); + uint32_t height() const; + void set_height(uint32_t value); + private: + uint32_t _internal_height() const; + void _internal_set_height(uint32_t value); + public: + + // @@protoc_insertion_point(class_scope:SessionProtos.AttachmentPointer) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr contenttype_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr key_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr thumbnail_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr digest_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr filename_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr caption_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr url_; + uint64_t id_; + uint32_t size_; + uint32_t flags_; + uint32_t width_; + uint32_t height_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_SessionProtos_2eproto; +}; +// ------------------------------------------------------------------- + +class SharedConfigMessage final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.SharedConfigMessage) */ { + public: + inline SharedConfigMessage() : SharedConfigMessage(nullptr) {} + ~SharedConfigMessage() override; + explicit PROTOBUF_CONSTEXPR SharedConfigMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + SharedConfigMessage(const SharedConfigMessage& from); + SharedConfigMessage(SharedConfigMessage&& from) noexcept + : SharedConfigMessage() { + *this = ::std::move(from); + } + + inline SharedConfigMessage& operator=(const SharedConfigMessage& from) { + CopyFrom(from); + return *this; + } + inline SharedConfigMessage& operator=(SharedConfigMessage&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + } + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const SharedConfigMessage& default_instance() { + return *internal_default_instance(); + } + static inline const SharedConfigMessage* internal_default_instance() { + return reinterpret_cast( + &_SharedConfigMessage_default_instance_); + } + static constexpr int kIndexInFileMessages = + 25; + + friend void swap(SharedConfigMessage& a, SharedConfigMessage& b) { + a.Swap(&b); + } + inline void Swap(SharedConfigMessage* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(SharedConfigMessage* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + SharedConfigMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; + void CopyFrom(const SharedConfigMessage& from); + void MergeFrom(const SharedConfigMessage& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SharedConfigMessage* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "SessionProtos.SharedConfigMessage"; + } + protected: + explicit SharedConfigMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + std::string GetTypeName() const final; + + // nested types ---------------------------------------------------- + + typedef SharedConfigMessage_Kind Kind; + static constexpr Kind USER_PROFILE = + SharedConfigMessage_Kind_USER_PROFILE; + static constexpr Kind CONTACTS = + SharedConfigMessage_Kind_CONTACTS; + static constexpr Kind CONVO_INFO_VOLATILE = + SharedConfigMessage_Kind_CONVO_INFO_VOLATILE; + static constexpr Kind USER_GROUPS = + SharedConfigMessage_Kind_USER_GROUPS; + static inline bool Kind_IsValid(int value) { + return SharedConfigMessage_Kind_IsValid(value); + } + static constexpr Kind Kind_MIN = + SharedConfigMessage_Kind_Kind_MIN; + static constexpr Kind Kind_MAX = + SharedConfigMessage_Kind_Kind_MAX; + static constexpr int Kind_ARRAYSIZE = + SharedConfigMessage_Kind_Kind_ARRAYSIZE; + template + static inline const std::string& Kind_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Kind_Name."); + return SharedConfigMessage_Kind_Name(enum_t_value); + } + static inline bool Kind_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Kind* value) { + return SharedConfigMessage_Kind_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + enum : int { + kDataFieldNumber = 3, + kSeqnoFieldNumber = 2, + kKindFieldNumber = 1, + }; + // required bytes data = 3; + bool has_data() const; + private: + bool _internal_has_data() const; + public: + void clear_data(); + const std::string& data() const; + template + void set_data(ArgT0&& arg0, ArgT... args); + std::string* mutable_data(); + PROTOBUF_NODISCARD std::string* release_data(); + void set_allocated_data(std::string* data); + private: + const std::string& _internal_data() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_data(const std::string& value); + std::string* _internal_mutable_data(); + public: + + // required int64 seqno = 2; + bool has_seqno() const; + private: + bool _internal_has_seqno() const; + public: + void clear_seqno(); + int64_t seqno() const; + void set_seqno(int64_t value); + private: + int64_t _internal_seqno() const; + void _internal_set_seqno(int64_t value); + public: + + // required .SessionProtos.SharedConfigMessage.Kind kind = 1; + bool has_kind() const; + private: + bool _internal_has_kind() const; + public: + void clear_kind(); + ::SessionProtos::SharedConfigMessage_Kind kind() const; + void set_kind(::SessionProtos::SharedConfigMessage_Kind value); + private: + ::SessionProtos::SharedConfigMessage_Kind _internal_kind() const; + void _internal_set_kind(::SessionProtos::SharedConfigMessage_Kind value); + public: + + // @@protoc_insertion_point(class_scope:SessionProtos.SharedConfigMessage) + private: + class _Internal; + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr data_; + int64_t seqno_; + int kind_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_SessionProtos_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Envelope + +// required .SessionProtos.Envelope.Type type = 1; +inline bool Envelope::_internal_has_type() const { + bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; + return value; +} +inline bool Envelope::has_type() const { + return _internal_has_type(); +} +inline void Envelope::clear_type() { + _impl_.type_ = 6; + _impl_._has_bits_[0] &= ~0x00000020u; +} +inline ::SessionProtos::Envelope_Type Envelope::_internal_type() const { + return static_cast< ::SessionProtos::Envelope_Type >(_impl_.type_); +} +inline ::SessionProtos::Envelope_Type Envelope::type() const { + // @@protoc_insertion_point(field_get:SessionProtos.Envelope.type) + return _internal_type(); +} +inline void Envelope::_internal_set_type(::SessionProtos::Envelope_Type value) { + assert(::SessionProtos::Envelope_Type_IsValid(value)); + _impl_._has_bits_[0] |= 0x00000020u; + _impl_.type_ = value; +} +inline void Envelope::set_type(::SessionProtos::Envelope_Type value) { + _internal_set_type(value); + // @@protoc_insertion_point(field_set:SessionProtos.Envelope.type) +} + +// optional string source = 2; +inline bool Envelope::_internal_has_source() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool Envelope::has_source() const { + return _internal_has_source(); +} +inline void Envelope::clear_source() { + _impl_.source_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& Envelope::source() const { + // @@protoc_insertion_point(field_get:SessionProtos.Envelope.source) + return _internal_source(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Envelope::set_source(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.source_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.Envelope.source) +} +inline std::string* Envelope::mutable_source() { + std::string* _s = _internal_mutable_source(); + // @@protoc_insertion_point(field_mutable:SessionProtos.Envelope.source) + return _s; +} +inline const std::string& Envelope::_internal_source() const { + return _impl_.source_.Get(); +} +inline void Envelope::_internal_set_source(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.source_.Set(value, GetArenaForAllocation()); +} +inline std::string* Envelope::_internal_mutable_source() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.source_.Mutable(GetArenaForAllocation()); +} +inline std::string* Envelope::release_source() { + // @@protoc_insertion_point(field_release:SessionProtos.Envelope.source) + if (!_internal_has_source()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.source_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.source_.IsDefault()) { + _impl_.source_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void Envelope::set_allocated_source(std::string* source) { + if (source != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.source_.SetAllocated(source, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.source_.IsDefault()) { + _impl_.source_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.Envelope.source) +} + +// optional uint32 sourceDevice = 7; +inline bool Envelope::_internal_has_sourcedevice() const { + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; + return value; +} +inline bool Envelope::has_sourcedevice() const { + return _internal_has_sourcedevice(); +} +inline void Envelope::clear_sourcedevice() { + _impl_.sourcedevice_ = 0u; + _impl_._has_bits_[0] &= ~0x00000010u; +} +inline uint32_t Envelope::_internal_sourcedevice() const { + return _impl_.sourcedevice_; +} +inline uint32_t Envelope::sourcedevice() const { + // @@protoc_insertion_point(field_get:SessionProtos.Envelope.sourceDevice) + return _internal_sourcedevice(); +} +inline void Envelope::_internal_set_sourcedevice(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.sourcedevice_ = value; +} +inline void Envelope::set_sourcedevice(uint32_t value) { + _internal_set_sourcedevice(value); + // @@protoc_insertion_point(field_set:SessionProtos.Envelope.sourceDevice) +} + +// required uint64 timestamp = 5; +inline bool Envelope::_internal_has_timestamp() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; +} +inline bool Envelope::has_timestamp() const { + return _internal_has_timestamp(); +} +inline void Envelope::clear_timestamp() { + _impl_.timestamp_ = uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000004u; +} +inline uint64_t Envelope::_internal_timestamp() const { + return _impl_.timestamp_; +} +inline uint64_t Envelope::timestamp() const { + // @@protoc_insertion_point(field_get:SessionProtos.Envelope.timestamp) + return _internal_timestamp(); +} +inline void Envelope::_internal_set_timestamp(uint64_t value) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.timestamp_ = value; +} +inline void Envelope::set_timestamp(uint64_t value) { + _internal_set_timestamp(value); + // @@protoc_insertion_point(field_set:SessionProtos.Envelope.timestamp) +} + +// optional bytes content = 8; +inline bool Envelope::_internal_has_content() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool Envelope::has_content() const { + return _internal_has_content(); +} +inline void Envelope::clear_content() { + _impl_.content_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline const std::string& Envelope::content() const { + // @@protoc_insertion_point(field_get:SessionProtos.Envelope.content) + return _internal_content(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Envelope::set_content(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.content_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.Envelope.content) +} +inline std::string* Envelope::mutable_content() { + std::string* _s = _internal_mutable_content(); + // @@protoc_insertion_point(field_mutable:SessionProtos.Envelope.content) + return _s; +} +inline const std::string& Envelope::_internal_content() const { + return _impl_.content_.Get(); +} +inline void Envelope::_internal_set_content(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.content_.Set(value, GetArenaForAllocation()); +} +inline std::string* Envelope::_internal_mutable_content() { + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.content_.Mutable(GetArenaForAllocation()); +} +inline std::string* Envelope::release_content() { + // @@protoc_insertion_point(field_release:SessionProtos.Envelope.content) + if (!_internal_has_content()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.content_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.content_.IsDefault()) { + _impl_.content_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void Envelope::set_allocated_content(std::string* content) { + if (content != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + _impl_.content_.SetAllocated(content, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.content_.IsDefault()) { + _impl_.content_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.Envelope.content) +} + +// optional uint64 serverTimestamp = 10; +inline bool Envelope::_internal_has_servertimestamp() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + return value; +} +inline bool Envelope::has_servertimestamp() const { + return _internal_has_servertimestamp(); +} +inline void Envelope::clear_servertimestamp() { + _impl_.servertimestamp_ = uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000008u; +} +inline uint64_t Envelope::_internal_servertimestamp() const { + return _impl_.servertimestamp_; +} +inline uint64_t Envelope::servertimestamp() const { + // @@protoc_insertion_point(field_get:SessionProtos.Envelope.serverTimestamp) + return _internal_servertimestamp(); +} +inline void Envelope::_internal_set_servertimestamp(uint64_t value) { + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.servertimestamp_ = value; +} +inline void Envelope::set_servertimestamp(uint64_t value) { + _internal_set_servertimestamp(value); + // @@protoc_insertion_point(field_set:SessionProtos.Envelope.serverTimestamp) +} + +// ------------------------------------------------------------------- + +// TypingMessage + +// required uint64 timestamp = 1; +inline bool TypingMessage::_internal_has_timestamp() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool TypingMessage::has_timestamp() const { + return _internal_has_timestamp(); +} +inline void TypingMessage::clear_timestamp() { + _impl_.timestamp_ = uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline uint64_t TypingMessage::_internal_timestamp() const { + return _impl_.timestamp_; +} +inline uint64_t TypingMessage::timestamp() const { + // @@protoc_insertion_point(field_get:SessionProtos.TypingMessage.timestamp) + return _internal_timestamp(); +} +inline void TypingMessage::_internal_set_timestamp(uint64_t value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.timestamp_ = value; +} +inline void TypingMessage::set_timestamp(uint64_t value) { + _internal_set_timestamp(value); + // @@protoc_insertion_point(field_set:SessionProtos.TypingMessage.timestamp) +} + +// required .SessionProtos.TypingMessage.Action action = 2; +inline bool TypingMessage::_internal_has_action() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool TypingMessage::has_action() const { + return _internal_has_action(); +} +inline void TypingMessage::clear_action() { + _impl_.action_ = 0; + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline ::SessionProtos::TypingMessage_Action TypingMessage::_internal_action() const { + return static_cast< ::SessionProtos::TypingMessage_Action >(_impl_.action_); +} +inline ::SessionProtos::TypingMessage_Action TypingMessage::action() const { + // @@protoc_insertion_point(field_get:SessionProtos.TypingMessage.action) + return _internal_action(); +} +inline void TypingMessage::_internal_set_action(::SessionProtos::TypingMessage_Action value) { + assert(::SessionProtos::TypingMessage_Action_IsValid(value)); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.action_ = value; +} +inline void TypingMessage::set_action(::SessionProtos::TypingMessage_Action value) { + _internal_set_action(value); + // @@protoc_insertion_point(field_set:SessionProtos.TypingMessage.action) +} + +// ------------------------------------------------------------------- + +// UnsendRequest + +// required uint64 timestamp = 1; +inline bool UnsendRequest::_internal_has_timestamp() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool UnsendRequest::has_timestamp() const { + return _internal_has_timestamp(); +} +inline void UnsendRequest::clear_timestamp() { + _impl_.timestamp_ = uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline uint64_t UnsendRequest::_internal_timestamp() const { + return _impl_.timestamp_; +} +inline uint64_t UnsendRequest::timestamp() const { + // @@protoc_insertion_point(field_get:SessionProtos.UnsendRequest.timestamp) + return _internal_timestamp(); +} +inline void UnsendRequest::_internal_set_timestamp(uint64_t value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.timestamp_ = value; +} +inline void UnsendRequest::set_timestamp(uint64_t value) { + _internal_set_timestamp(value); + // @@protoc_insertion_point(field_set:SessionProtos.UnsendRequest.timestamp) +} + +// required string author = 2; +inline bool UnsendRequest::_internal_has_author() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool UnsendRequest::has_author() const { + return _internal_has_author(); +} +inline void UnsendRequest::clear_author() { + _impl_.author_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& UnsendRequest::author() const { + // @@protoc_insertion_point(field_get:SessionProtos.UnsendRequest.author) + return _internal_author(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void UnsendRequest::set_author(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.author_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.UnsendRequest.author) +} +inline std::string* UnsendRequest::mutable_author() { + std::string* _s = _internal_mutable_author(); + // @@protoc_insertion_point(field_mutable:SessionProtos.UnsendRequest.author) + return _s; +} +inline const std::string& UnsendRequest::_internal_author() const { + return _impl_.author_.Get(); +} +inline void UnsendRequest::_internal_set_author(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.author_.Set(value, GetArenaForAllocation()); +} +inline std::string* UnsendRequest::_internal_mutable_author() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.author_.Mutable(GetArenaForAllocation()); +} +inline std::string* UnsendRequest::release_author() { + // @@protoc_insertion_point(field_release:SessionProtos.UnsendRequest.author) + if (!_internal_has_author()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.author_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.author_.IsDefault()) { + _impl_.author_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void UnsendRequest::set_allocated_author(std::string* author) { + if (author != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.author_.SetAllocated(author, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.author_.IsDefault()) { + _impl_.author_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.UnsendRequest.author) +} + +// ------------------------------------------------------------------- + +// MessageRequestResponse + +// required bool isApproved = 1; +inline bool MessageRequestResponse::_internal_has_isapproved() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; +} +inline bool MessageRequestResponse::has_isapproved() const { + return _internal_has_isapproved(); +} +inline void MessageRequestResponse::clear_isapproved() { + _impl_.isapproved_ = false; + _impl_._has_bits_[0] &= ~0x00000004u; +} +inline bool MessageRequestResponse::_internal_isapproved() const { + return _impl_.isapproved_; +} +inline bool MessageRequestResponse::isapproved() const { + // @@protoc_insertion_point(field_get:SessionProtos.MessageRequestResponse.isApproved) + return _internal_isapproved(); +} +inline void MessageRequestResponse::_internal_set_isapproved(bool value) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.isapproved_ = value; +} +inline void MessageRequestResponse::set_isapproved(bool value) { + _internal_set_isapproved(value); + // @@protoc_insertion_point(field_set:SessionProtos.MessageRequestResponse.isApproved) +} + +// optional bytes profileKey = 2; +inline bool MessageRequestResponse::_internal_has_profilekey() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool MessageRequestResponse::has_profilekey() const { + return _internal_has_profilekey(); +} +inline void MessageRequestResponse::clear_profilekey() { + _impl_.profilekey_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& MessageRequestResponse::profilekey() const { + // @@protoc_insertion_point(field_get:SessionProtos.MessageRequestResponse.profileKey) + return _internal_profilekey(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void MessageRequestResponse::set_profilekey(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.profilekey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.MessageRequestResponse.profileKey) +} +inline std::string* MessageRequestResponse::mutable_profilekey() { + std::string* _s = _internal_mutable_profilekey(); + // @@protoc_insertion_point(field_mutable:SessionProtos.MessageRequestResponse.profileKey) + return _s; +} +inline const std::string& MessageRequestResponse::_internal_profilekey() const { + return _impl_.profilekey_.Get(); +} +inline void MessageRequestResponse::_internal_set_profilekey(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.profilekey_.Set(value, GetArenaForAllocation()); +} +inline std::string* MessageRequestResponse::_internal_mutable_profilekey() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.profilekey_.Mutable(GetArenaForAllocation()); +} +inline std::string* MessageRequestResponse::release_profilekey() { + // @@protoc_insertion_point(field_release:SessionProtos.MessageRequestResponse.profileKey) + if (!_internal_has_profilekey()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.profilekey_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.profilekey_.IsDefault()) { + _impl_.profilekey_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void MessageRequestResponse::set_allocated_profilekey(std::string* profilekey) { + if (profilekey != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.profilekey_.SetAllocated(profilekey, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.profilekey_.IsDefault()) { + _impl_.profilekey_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.MessageRequestResponse.profileKey) +} + +// optional .SessionProtos.LokiProfile profile = 3; +inline bool MessageRequestResponse::_internal_has_profile() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + PROTOBUF_ASSUME(!value || _impl_.profile_ != nullptr); + return value; +} +inline bool MessageRequestResponse::has_profile() const { + return _internal_has_profile(); +} +inline void MessageRequestResponse::clear_profile() { + if (_impl_.profile_ != nullptr) _impl_.profile_->Clear(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline const ::SessionProtos::LokiProfile& MessageRequestResponse::_internal_profile() const { + const ::SessionProtos::LokiProfile* p = _impl_.profile_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_LokiProfile_default_instance_); +} +inline const ::SessionProtos::LokiProfile& MessageRequestResponse::profile() const { + // @@protoc_insertion_point(field_get:SessionProtos.MessageRequestResponse.profile) + return _internal_profile(); +} +inline void MessageRequestResponse::unsafe_arena_set_allocated_profile( + ::SessionProtos::LokiProfile* profile) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.profile_); + } + _impl_.profile_ = profile; + if (profile) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.MessageRequestResponse.profile) +} +inline ::SessionProtos::LokiProfile* MessageRequestResponse::release_profile() { + _impl_._has_bits_[0] &= ~0x00000002u; + ::SessionProtos::LokiProfile* temp = _impl_.profile_; + _impl_.profile_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::SessionProtos::LokiProfile* MessageRequestResponse::unsafe_arena_release_profile() { + // @@protoc_insertion_point(field_release:SessionProtos.MessageRequestResponse.profile) + _impl_._has_bits_[0] &= ~0x00000002u; + ::SessionProtos::LokiProfile* temp = _impl_.profile_; + _impl_.profile_ = nullptr; + return temp; +} +inline ::SessionProtos::LokiProfile* MessageRequestResponse::_internal_mutable_profile() { + _impl_._has_bits_[0] |= 0x00000002u; + if (_impl_.profile_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::LokiProfile>(GetArenaForAllocation()); + _impl_.profile_ = p; + } + return _impl_.profile_; +} +inline ::SessionProtos::LokiProfile* MessageRequestResponse::mutable_profile() { + ::SessionProtos::LokiProfile* _msg = _internal_mutable_profile(); + // @@protoc_insertion_point(field_mutable:SessionProtos.MessageRequestResponse.profile) + return _msg; +} +inline void MessageRequestResponse::set_allocated_profile(::SessionProtos::LokiProfile* profile) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.profile_; + } + if (profile) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(profile); + if (message_arena != submessage_arena) { + profile = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, profile, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + _impl_.profile_ = profile; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.MessageRequestResponse.profile) +} + +// ------------------------------------------------------------------- + +// ProProof + +// required uint32 version = 1; +inline bool ProProof::_internal_has_version() const { + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; + return value; +} +inline bool ProProof::has_version() const { + return _internal_has_version(); +} +inline void ProProof::clear_version() { + _impl_.version_ = 0u; + _impl_._has_bits_[0] &= ~0x00000010u; +} +inline uint32_t ProProof::_internal_version() const { + return _impl_.version_; +} +inline uint32_t ProProof::version() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProProof.version) + return _internal_version(); } -inline void Envelope::_internal_set_type(::SessionProtos::Envelope_Type value) { - assert(::SessionProtos::Envelope_Type_IsValid(value)); - _impl_._has_bits_[0] |= 0x00000020u; - _impl_.type_ = value; +inline void ProProof::_internal_set_version(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.version_ = value; } -inline void Envelope::set_type(::SessionProtos::Envelope_Type value) { - _internal_set_type(value); - // @@protoc_insertion_point(field_set:SessionProtos.Envelope.type) +inline void ProProof::set_version(uint32_t value) { + _internal_set_version(value); + // @@protoc_insertion_point(field_set:SessionProtos.ProProof.version) } -// optional string source = 2; -inline bool Envelope::_internal_has_source() const { +// required bytes genIndexHash = 2; +inline bool ProProof::_internal_has_genindexhash() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool Envelope::has_source() const { - return _internal_has_source(); +inline bool ProProof::has_genindexhash() const { + return _internal_has_genindexhash(); } -inline void Envelope::clear_source() { - _impl_.source_.ClearToEmpty(); +inline void ProProof::clear_genindexhash() { + _impl_.genindexhash_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& Envelope::source() const { - // @@protoc_insertion_point(field_get:SessionProtos.Envelope.source) - return _internal_source(); +inline const std::string& ProProof::genindexhash() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProProof.genIndexHash) + return _internal_genindexhash(); } template inline PROTOBUF_ALWAYS_INLINE -void Envelope::set_source(ArgT0&& arg0, ArgT... args) { +void ProProof::set_genindexhash(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.source_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.Envelope.source) + _impl_.genindexhash_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.ProProof.genIndexHash) } -inline std::string* Envelope::mutable_source() { - std::string* _s = _internal_mutable_source(); - // @@protoc_insertion_point(field_mutable:SessionProtos.Envelope.source) +inline std::string* ProProof::mutable_genindexhash() { + std::string* _s = _internal_mutable_genindexhash(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ProProof.genIndexHash) return _s; } -inline const std::string& Envelope::_internal_source() const { - return _impl_.source_.Get(); +inline const std::string& ProProof::_internal_genindexhash() const { + return _impl_.genindexhash_.Get(); } -inline void Envelope::_internal_set_source(const std::string& value) { +inline void ProProof::_internal_set_genindexhash(const std::string& value) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.source_.Set(value, GetArenaForAllocation()); + _impl_.genindexhash_.Set(value, GetArenaForAllocation()); } -inline std::string* Envelope::_internal_mutable_source() { +inline std::string* ProProof::_internal_mutable_genindexhash() { _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.source_.Mutable(GetArenaForAllocation()); + return _impl_.genindexhash_.Mutable(GetArenaForAllocation()); } -inline std::string* Envelope::release_source() { - // @@protoc_insertion_point(field_release:SessionProtos.Envelope.source) - if (!_internal_has_source()) { +inline std::string* ProProof::release_genindexhash() { + // @@protoc_insertion_point(field_release:SessionProtos.ProProof.genIndexHash) + if (!_internal_has_genindexhash()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.source_.Release(); + auto* p = _impl_.genindexhash_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.source_.IsDefault()) { - _impl_.source_.Set("", GetArenaForAllocation()); + if (_impl_.genindexhash_.IsDefault()) { + _impl_.genindexhash_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void Envelope::set_allocated_source(std::string* source) { - if (source != nullptr) { +inline void ProProof::set_allocated_genindexhash(std::string* genindexhash) { + if (genindexhash != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; } else { _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.source_.SetAllocated(source, GetArenaForAllocation()); + _impl_.genindexhash_.SetAllocated(genindexhash, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.source_.IsDefault()) { - _impl_.source_.Set("", GetArenaForAllocation()); + if (_impl_.genindexhash_.IsDefault()) { + _impl_.genindexhash_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.Envelope.source) -} - -// optional uint32 sourceDevice = 7; -inline bool Envelope::_internal_has_sourcedevice() const { - bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; - return value; -} -inline bool Envelope::has_sourcedevice() const { - return _internal_has_sourcedevice(); -} -inline void Envelope::clear_sourcedevice() { - _impl_.sourcedevice_ = 0u; - _impl_._has_bits_[0] &= ~0x00000010u; -} -inline uint32_t Envelope::_internal_sourcedevice() const { - return _impl_.sourcedevice_; -} -inline uint32_t Envelope::sourcedevice() const { - // @@protoc_insertion_point(field_get:SessionProtos.Envelope.sourceDevice) - return _internal_sourcedevice(); -} -inline void Envelope::_internal_set_sourcedevice(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000010u; - _impl_.sourcedevice_ = value; -} -inline void Envelope::set_sourcedevice(uint32_t value) { - _internal_set_sourcedevice(value); - // @@protoc_insertion_point(field_set:SessionProtos.Envelope.sourceDevice) -} - -// required uint64 timestamp = 5; -inline bool Envelope::_internal_has_timestamp() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; - return value; -} -inline bool Envelope::has_timestamp() const { - return _internal_has_timestamp(); -} -inline void Envelope::clear_timestamp() { - _impl_.timestamp_ = uint64_t{0u}; - _impl_._has_bits_[0] &= ~0x00000004u; -} -inline uint64_t Envelope::_internal_timestamp() const { - return _impl_.timestamp_; -} -inline uint64_t Envelope::timestamp() const { - // @@protoc_insertion_point(field_get:SessionProtos.Envelope.timestamp) - return _internal_timestamp(); -} -inline void Envelope::_internal_set_timestamp(uint64_t value) { - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.timestamp_ = value; -} -inline void Envelope::set_timestamp(uint64_t value) { - _internal_set_timestamp(value); - // @@protoc_insertion_point(field_set:SessionProtos.Envelope.timestamp) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProProof.genIndexHash) } -// optional bytes content = 8; -inline bool Envelope::_internal_has_content() const { +// required bytes rotatingPublicKey = 3; +inline bool ProProof::_internal_has_rotatingpublickey() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } -inline bool Envelope::has_content() const { - return _internal_has_content(); +inline bool ProProof::has_rotatingpublickey() const { + return _internal_has_rotatingpublickey(); } -inline void Envelope::clear_content() { - _impl_.content_.ClearToEmpty(); +inline void ProProof::clear_rotatingpublickey() { + _impl_.rotatingpublickey_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000002u; } -inline const std::string& Envelope::content() const { - // @@protoc_insertion_point(field_get:SessionProtos.Envelope.content) - return _internal_content(); +inline const std::string& ProProof::rotatingpublickey() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProProof.rotatingPublicKey) + return _internal_rotatingpublickey(); } template inline PROTOBUF_ALWAYS_INLINE -void Envelope::set_content(ArgT0&& arg0, ArgT... args) { +void ProProof::set_rotatingpublickey(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.content_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.Envelope.content) + _impl_.rotatingpublickey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.ProProof.rotatingPublicKey) } -inline std::string* Envelope::mutable_content() { - std::string* _s = _internal_mutable_content(); - // @@protoc_insertion_point(field_mutable:SessionProtos.Envelope.content) +inline std::string* ProProof::mutable_rotatingpublickey() { + std::string* _s = _internal_mutable_rotatingpublickey(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ProProof.rotatingPublicKey) return _s; } -inline const std::string& Envelope::_internal_content() const { - return _impl_.content_.Get(); +inline const std::string& ProProof::_internal_rotatingpublickey() const { + return _impl_.rotatingpublickey_.Get(); } -inline void Envelope::_internal_set_content(const std::string& value) { +inline void ProProof::_internal_set_rotatingpublickey(const std::string& value) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.content_.Set(value, GetArenaForAllocation()); + _impl_.rotatingpublickey_.Set(value, GetArenaForAllocation()); } -inline std::string* Envelope::_internal_mutable_content() { +inline std::string* ProProof::_internal_mutable_rotatingpublickey() { _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.content_.Mutable(GetArenaForAllocation()); + return _impl_.rotatingpublickey_.Mutable(GetArenaForAllocation()); } -inline std::string* Envelope::release_content() { - // @@protoc_insertion_point(field_release:SessionProtos.Envelope.content) - if (!_internal_has_content()) { +inline std::string* ProProof::release_rotatingpublickey() { + // @@protoc_insertion_point(field_release:SessionProtos.ProProof.rotatingPublicKey) + if (!_internal_has_rotatingpublickey()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.content_.Release(); + auto* p = _impl_.rotatingpublickey_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.content_.IsDefault()) { - _impl_.content_.Set("", GetArenaForAllocation()); + if (_impl_.rotatingpublickey_.IsDefault()) { + _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void Envelope::set_allocated_content(std::string* content) { - if (content != nullptr) { +inline void ProProof::set_allocated_rotatingpublickey(std::string* rotatingpublickey) { + if (rotatingpublickey != nullptr) { _impl_._has_bits_[0] |= 0x00000002u; } else { _impl_._has_bits_[0] &= ~0x00000002u; } - _impl_.content_.SetAllocated(content, GetArenaForAllocation()); + _impl_.rotatingpublickey_.SetAllocated(rotatingpublickey, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.content_.IsDefault()) { - _impl_.content_.Set("", GetArenaForAllocation()); + if (_impl_.rotatingpublickey_.IsDefault()) { + _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.Envelope.content) -} - -// optional uint64 serverTimestamp = 10; -inline bool Envelope::_internal_has_servertimestamp() const { - bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; - return value; -} -inline bool Envelope::has_servertimestamp() const { - return _internal_has_servertimestamp(); -} -inline void Envelope::clear_servertimestamp() { - _impl_.servertimestamp_ = uint64_t{0u}; - _impl_._has_bits_[0] &= ~0x00000008u; -} -inline uint64_t Envelope::_internal_servertimestamp() const { - return _impl_.servertimestamp_; -} -inline uint64_t Envelope::servertimestamp() const { - // @@protoc_insertion_point(field_get:SessionProtos.Envelope.serverTimestamp) - return _internal_servertimestamp(); -} -inline void Envelope::_internal_set_servertimestamp(uint64_t value) { - _impl_._has_bits_[0] |= 0x00000008u; - _impl_.servertimestamp_ = value; -} -inline void Envelope::set_servertimestamp(uint64_t value) { - _internal_set_servertimestamp(value); - // @@protoc_insertion_point(field_set:SessionProtos.Envelope.serverTimestamp) -} - -// ------------------------------------------------------------------- - -// TypingMessage - -// required uint64 timestamp = 1; -inline bool TypingMessage::_internal_has_timestamp() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - return value; -} -inline bool TypingMessage::has_timestamp() const { - return _internal_has_timestamp(); -} -inline void TypingMessage::clear_timestamp() { - _impl_.timestamp_ = uint64_t{0u}; - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline uint64_t TypingMessage::_internal_timestamp() const { - return _impl_.timestamp_; -} -inline uint64_t TypingMessage::timestamp() const { - // @@protoc_insertion_point(field_get:SessionProtos.TypingMessage.timestamp) - return _internal_timestamp(); -} -inline void TypingMessage::_internal_set_timestamp(uint64_t value) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.timestamp_ = value; -} -inline void TypingMessage::set_timestamp(uint64_t value) { - _internal_set_timestamp(value); - // @@protoc_insertion_point(field_set:SessionProtos.TypingMessage.timestamp) -} - -// required .SessionProtos.TypingMessage.Action action = 2; -inline bool TypingMessage::_internal_has_action() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - return value; -} -inline bool TypingMessage::has_action() const { - return _internal_has_action(); -} -inline void TypingMessage::clear_action() { - _impl_.action_ = 0; - _impl_._has_bits_[0] &= ~0x00000002u; -} -inline ::SessionProtos::TypingMessage_Action TypingMessage::_internal_action() const { - return static_cast< ::SessionProtos::TypingMessage_Action >(_impl_.action_); -} -inline ::SessionProtos::TypingMessage_Action TypingMessage::action() const { - // @@protoc_insertion_point(field_get:SessionProtos.TypingMessage.action) - return _internal_action(); -} -inline void TypingMessage::_internal_set_action(::SessionProtos::TypingMessage_Action value) { - assert(::SessionProtos::TypingMessage_Action_IsValid(value)); - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.action_ = value; -} -inline void TypingMessage::set_action(::SessionProtos::TypingMessage_Action value) { - _internal_set_action(value); - // @@protoc_insertion_point(field_set:SessionProtos.TypingMessage.action) +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProProof.rotatingPublicKey) } -// ------------------------------------------------------------------- - -// UnsendRequest - -// required uint64 timestamp = 1; -inline bool UnsendRequest::_internal_has_timestamp() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; +// required uint64 expiryUnixTs = 4; +inline bool ProProof::_internal_has_expiryunixts() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; return value; } -inline bool UnsendRequest::has_timestamp() const { - return _internal_has_timestamp(); +inline bool ProProof::has_expiryunixts() const { + return _internal_has_expiryunixts(); } -inline void UnsendRequest::clear_timestamp() { - _impl_.timestamp_ = uint64_t{0u}; - _impl_._has_bits_[0] &= ~0x00000002u; +inline void ProProof::clear_expiryunixts() { + _impl_.expiryunixts_ = uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000008u; } -inline uint64_t UnsendRequest::_internal_timestamp() const { - return _impl_.timestamp_; +inline uint64_t ProProof::_internal_expiryunixts() const { + return _impl_.expiryunixts_; } -inline uint64_t UnsendRequest::timestamp() const { - // @@protoc_insertion_point(field_get:SessionProtos.UnsendRequest.timestamp) - return _internal_timestamp(); +inline uint64_t ProProof::expiryunixts() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProProof.expiryUnixTs) + return _internal_expiryunixts(); } -inline void UnsendRequest::_internal_set_timestamp(uint64_t value) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.timestamp_ = value; +inline void ProProof::_internal_set_expiryunixts(uint64_t value) { + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.expiryunixts_ = value; } -inline void UnsendRequest::set_timestamp(uint64_t value) { - _internal_set_timestamp(value); - // @@protoc_insertion_point(field_set:SessionProtos.UnsendRequest.timestamp) +inline void ProProof::set_expiryunixts(uint64_t value) { + _internal_set_expiryunixts(value); + // @@protoc_insertion_point(field_set:SessionProtos.ProProof.expiryUnixTs) } -// required string author = 2; -inline bool UnsendRequest::_internal_has_author() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; +// required bytes sig = 5; +inline bool ProProof::_internal_has_sig() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } -inline bool UnsendRequest::has_author() const { - return _internal_has_author(); +inline bool ProProof::has_sig() const { + return _internal_has_sig(); } -inline void UnsendRequest::clear_author() { - _impl_.author_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000001u; +inline void ProProof::clear_sig() { + _impl_.sig_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000004u; } -inline const std::string& UnsendRequest::author() const { - // @@protoc_insertion_point(field_get:SessionProtos.UnsendRequest.author) - return _internal_author(); +inline const std::string& ProProof::sig() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProProof.sig) + return _internal_sig(); } template inline PROTOBUF_ALWAYS_INLINE -void UnsendRequest::set_author(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.author_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.UnsendRequest.author) +void ProProof::set_sig(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.sig_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.ProProof.sig) } -inline std::string* UnsendRequest::mutable_author() { - std::string* _s = _internal_mutable_author(); - // @@protoc_insertion_point(field_mutable:SessionProtos.UnsendRequest.author) +inline std::string* ProProof::mutable_sig() { + std::string* _s = _internal_mutable_sig(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ProProof.sig) return _s; } -inline const std::string& UnsendRequest::_internal_author() const { - return _impl_.author_.Get(); +inline const std::string& ProProof::_internal_sig() const { + return _impl_.sig_.Get(); } -inline void UnsendRequest::_internal_set_author(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.author_.Set(value, GetArenaForAllocation()); +inline void ProProof::_internal_set_sig(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.sig_.Set(value, GetArenaForAllocation()); } -inline std::string* UnsendRequest::_internal_mutable_author() { - _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.author_.Mutable(GetArenaForAllocation()); +inline std::string* ProProof::_internal_mutable_sig() { + _impl_._has_bits_[0] |= 0x00000004u; + return _impl_.sig_.Mutable(GetArenaForAllocation()); } -inline std::string* UnsendRequest::release_author() { - // @@protoc_insertion_point(field_release:SessionProtos.UnsendRequest.author) - if (!_internal_has_author()) { +inline std::string* ProProof::release_sig() { + // @@protoc_insertion_point(field_release:SessionProtos.ProProof.sig) + if (!_internal_has_sig()) { return nullptr; } - _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.author_.Release(); + _impl_._has_bits_[0] &= ~0x00000004u; + auto* p = _impl_.sig_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.author_.IsDefault()) { - _impl_.author_.Set("", GetArenaForAllocation()); + if (_impl_.sig_.IsDefault()) { + _impl_.sig_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void UnsendRequest::set_allocated_author(std::string* author) { - if (author != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; +inline void ProProof::set_allocated_sig(std::string* sig) { + if (sig != nullptr) { + _impl_._has_bits_[0] |= 0x00000004u; } else { - _impl_._has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000004u; } - _impl_.author_.SetAllocated(author, GetArenaForAllocation()); + _impl_.sig_.SetAllocated(sig, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.author_.IsDefault()) { - _impl_.author_.Set("", GetArenaForAllocation()); + if (_impl_.sig_.IsDefault()) { + _impl_.sig_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.UnsendRequest.author) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProProof.sig) } // ------------------------------------------------------------------- -// MessageRequestResponse - -// required bool isApproved = 1; -inline bool MessageRequestResponse::_internal_has_isapproved() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; - return value; -} -inline bool MessageRequestResponse::has_isapproved() const { - return _internal_has_isapproved(); -} -inline void MessageRequestResponse::clear_isapproved() { - _impl_.isapproved_ = false; - _impl_._has_bits_[0] &= ~0x00000004u; -} -inline bool MessageRequestResponse::_internal_isapproved() const { - return _impl_.isapproved_; -} -inline bool MessageRequestResponse::isapproved() const { - // @@protoc_insertion_point(field_get:SessionProtos.MessageRequestResponse.isApproved) - return _internal_isapproved(); -} -inline void MessageRequestResponse::_internal_set_isapproved(bool value) { - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.isapproved_ = value; -} -inline void MessageRequestResponse::set_isapproved(bool value) { - _internal_set_isapproved(value); - // @@protoc_insertion_point(field_set:SessionProtos.MessageRequestResponse.isApproved) -} +// ProConfig -// optional bytes profileKey = 2; -inline bool MessageRequestResponse::_internal_has_profilekey() const { +// required bytes rotatingPrivKey = 1; +inline bool ProConfig::_internal_has_rotatingprivkey() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool MessageRequestResponse::has_profilekey() const { - return _internal_has_profilekey(); +inline bool ProConfig::has_rotatingprivkey() const { + return _internal_has_rotatingprivkey(); } -inline void MessageRequestResponse::clear_profilekey() { - _impl_.profilekey_.ClearToEmpty(); +inline void ProConfig::clear_rotatingprivkey() { + _impl_.rotatingprivkey_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& MessageRequestResponse::profilekey() const { - // @@protoc_insertion_point(field_get:SessionProtos.MessageRequestResponse.profileKey) - return _internal_profilekey(); +inline const std::string& ProConfig::rotatingprivkey() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProConfig.rotatingPrivKey) + return _internal_rotatingprivkey(); } template inline PROTOBUF_ALWAYS_INLINE -void MessageRequestResponse::set_profilekey(ArgT0&& arg0, ArgT... args) { +void ProConfig::set_rotatingprivkey(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.profilekey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.MessageRequestResponse.profileKey) + _impl_.rotatingprivkey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.ProConfig.rotatingPrivKey) } -inline std::string* MessageRequestResponse::mutable_profilekey() { - std::string* _s = _internal_mutable_profilekey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.MessageRequestResponse.profileKey) +inline std::string* ProConfig::mutable_rotatingprivkey() { + std::string* _s = _internal_mutable_rotatingprivkey(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ProConfig.rotatingPrivKey) return _s; } -inline const std::string& MessageRequestResponse::_internal_profilekey() const { - return _impl_.profilekey_.Get(); +inline const std::string& ProConfig::_internal_rotatingprivkey() const { + return _impl_.rotatingprivkey_.Get(); } -inline void MessageRequestResponse::_internal_set_profilekey(const std::string& value) { +inline void ProConfig::_internal_set_rotatingprivkey(const std::string& value) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.profilekey_.Set(value, GetArenaForAllocation()); + _impl_.rotatingprivkey_.Set(value, GetArenaForAllocation()); } -inline std::string* MessageRequestResponse::_internal_mutable_profilekey() { +inline std::string* ProConfig::_internal_mutable_rotatingprivkey() { _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.profilekey_.Mutable(GetArenaForAllocation()); + return _impl_.rotatingprivkey_.Mutable(GetArenaForAllocation()); } -inline std::string* MessageRequestResponse::release_profilekey() { - // @@protoc_insertion_point(field_release:SessionProtos.MessageRequestResponse.profileKey) - if (!_internal_has_profilekey()) { +inline std::string* ProConfig::release_rotatingprivkey() { + // @@protoc_insertion_point(field_release:SessionProtos.ProConfig.rotatingPrivKey) + if (!_internal_has_rotatingprivkey()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.profilekey_.Release(); + auto* p = _impl_.rotatingprivkey_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilekey_.IsDefault()) { - _impl_.profilekey_.Set("", GetArenaForAllocation()); + if (_impl_.rotatingprivkey_.IsDefault()) { + _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void MessageRequestResponse::set_allocated_profilekey(std::string* profilekey) { - if (profilekey != nullptr) { +inline void ProConfig::set_allocated_rotatingprivkey(std::string* rotatingprivkey) { + if (rotatingprivkey != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; } else { _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.profilekey_.SetAllocated(profilekey, GetArenaForAllocation()); + _impl_.rotatingprivkey_.SetAllocated(rotatingprivkey, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilekey_.IsDefault()) { - _impl_.profilekey_.Set("", GetArenaForAllocation()); + if (_impl_.rotatingprivkey_.IsDefault()) { + _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.MessageRequestResponse.profileKey) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProConfig.rotatingPrivKey) } -// optional .SessionProtos.LokiProfile profile = 3; -inline bool MessageRequestResponse::_internal_has_profile() const { +// required .SessionProtos.ProProof proof = 2; +inline bool ProConfig::_internal_has_proof() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - PROTOBUF_ASSUME(!value || _impl_.profile_ != nullptr); + PROTOBUF_ASSUME(!value || _impl_.proof_ != nullptr); return value; } -inline bool MessageRequestResponse::has_profile() const { - return _internal_has_profile(); +inline bool ProConfig::has_proof() const { + return _internal_has_proof(); } -inline void MessageRequestResponse::clear_profile() { - if (_impl_.profile_ != nullptr) _impl_.profile_->Clear(); +inline void ProConfig::clear_proof() { + if (_impl_.proof_ != nullptr) _impl_.proof_->Clear(); _impl_._has_bits_[0] &= ~0x00000002u; } -inline const ::SessionProtos::LokiProfile& MessageRequestResponse::_internal_profile() const { - const ::SessionProtos::LokiProfile* p = _impl_.profile_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_LokiProfile_default_instance_); +inline const ::SessionProtos::ProProof& ProConfig::_internal_proof() const { + const ::SessionProtos::ProProof* p = _impl_.proof_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_ProProof_default_instance_); } -inline const ::SessionProtos::LokiProfile& MessageRequestResponse::profile() const { - // @@protoc_insertion_point(field_get:SessionProtos.MessageRequestResponse.profile) - return _internal_profile(); +inline const ::SessionProtos::ProProof& ProConfig::proof() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProConfig.proof) + return _internal_proof(); } -inline void MessageRequestResponse::unsafe_arena_set_allocated_profile( - ::SessionProtos::LokiProfile* profile) { +inline void ProConfig::unsafe_arena_set_allocated_proof( + ::SessionProtos::ProProof* proof) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.profile_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.proof_); } - _impl_.profile_ = profile; - if (profile) { + _impl_.proof_ = proof; + if (proof) { _impl_._has_bits_[0] |= 0x00000002u; } else { _impl_._has_bits_[0] &= ~0x00000002u; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.MessageRequestResponse.profile) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.ProConfig.proof) } -inline ::SessionProtos::LokiProfile* MessageRequestResponse::release_profile() { +inline ::SessionProtos::ProProof* ProConfig::release_proof() { _impl_._has_bits_[0] &= ~0x00000002u; - ::SessionProtos::LokiProfile* temp = _impl_.profile_; - _impl_.profile_ = nullptr; + ::SessionProtos::ProProof* temp = _impl_.proof_; + _impl_.proof_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -6702,44 +7315,166 @@ inline ::SessionProtos::LokiProfile* MessageRequestResponse::release_profile() { #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::SessionProtos::LokiProfile* MessageRequestResponse::unsafe_arena_release_profile() { - // @@protoc_insertion_point(field_release:SessionProtos.MessageRequestResponse.profile) +inline ::SessionProtos::ProProof* ProConfig::unsafe_arena_release_proof() { + // @@protoc_insertion_point(field_release:SessionProtos.ProConfig.proof) _impl_._has_bits_[0] &= ~0x00000002u; - ::SessionProtos::LokiProfile* temp = _impl_.profile_; - _impl_.profile_ = nullptr; + ::SessionProtos::ProProof* temp = _impl_.proof_; + _impl_.proof_ = nullptr; + return temp; +} +inline ::SessionProtos::ProProof* ProConfig::_internal_mutable_proof() { + _impl_._has_bits_[0] |= 0x00000002u; + if (_impl_.proof_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::ProProof>(GetArenaForAllocation()); + _impl_.proof_ = p; + } + return _impl_.proof_; +} +inline ::SessionProtos::ProProof* ProConfig::mutable_proof() { + ::SessionProtos::ProProof* _msg = _internal_mutable_proof(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ProConfig.proof) + return _msg; +} +inline void ProConfig::set_allocated_proof(::SessionProtos::ProProof* proof) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.proof_; + } + if (proof) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(proof); + if (message_arena != submessage_arena) { + proof = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, proof, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + _impl_.proof_ = proof; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProConfig.proof) +} + +// ------------------------------------------------------------------- + +// ProMessageConfig + +// required .SessionProtos.ProProof proof = 1; +inline bool ProMessageConfig::_internal_has_proof() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.proof_ != nullptr); + return value; +} +inline bool ProMessageConfig::has_proof() const { + return _internal_has_proof(); +} +inline void ProMessageConfig::clear_proof() { + if (_impl_.proof_ != nullptr) _impl_.proof_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const ::SessionProtos::ProProof& ProMessageConfig::_internal_proof() const { + const ::SessionProtos::ProProof* p = _impl_.proof_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_ProProof_default_instance_); +} +inline const ::SessionProtos::ProProof& ProMessageConfig::proof() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProMessageConfig.proof) + return _internal_proof(); +} +inline void ProMessageConfig::unsafe_arena_set_allocated_proof( + ::SessionProtos::ProProof* proof) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.proof_); + } + _impl_.proof_ = proof; + if (proof) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.ProMessageConfig.proof) +} +inline ::SessionProtos::ProProof* ProMessageConfig::release_proof() { + _impl_._has_bits_[0] &= ~0x00000001u; + ::SessionProtos::ProProof* temp = _impl_.proof_; + _impl_.proof_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::SessionProtos::LokiProfile* MessageRequestResponse::_internal_mutable_profile() { - _impl_._has_bits_[0] |= 0x00000002u; - if (_impl_.profile_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::LokiProfile>(GetArenaForAllocation()); - _impl_.profile_ = p; +inline ::SessionProtos::ProProof* ProMessageConfig::unsafe_arena_release_proof() { + // @@protoc_insertion_point(field_release:SessionProtos.ProMessageConfig.proof) + _impl_._has_bits_[0] &= ~0x00000001u; + ::SessionProtos::ProProof* temp = _impl_.proof_; + _impl_.proof_ = nullptr; + return temp; +} +inline ::SessionProtos::ProProof* ProMessageConfig::_internal_mutable_proof() { + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.proof_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::ProProof>(GetArenaForAllocation()); + _impl_.proof_ = p; } - return _impl_.profile_; + return _impl_.proof_; } -inline ::SessionProtos::LokiProfile* MessageRequestResponse::mutable_profile() { - ::SessionProtos::LokiProfile* _msg = _internal_mutable_profile(); - // @@protoc_insertion_point(field_mutable:SessionProtos.MessageRequestResponse.profile) +inline ::SessionProtos::ProProof* ProMessageConfig::mutable_proof() { + ::SessionProtos::ProProof* _msg = _internal_mutable_proof(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ProMessageConfig.proof) return _msg; } -inline void MessageRequestResponse::set_allocated_profile(::SessionProtos::LokiProfile* profile) { +inline void ProMessageConfig::set_allocated_proof(::SessionProtos::ProProof* proof) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.profile_; + delete _impl_.proof_; } - if (profile) { + if (proof) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(profile); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(proof); if (message_arena != submessage_arena) { - profile = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, profile, submessage_arena); + proof = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, proof, submessage_arena); } - _impl_._has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _impl_._has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.profile_ = profile; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.MessageRequestResponse.profile) + _impl_.proof_ = proof; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProMessageConfig.proof) +} + +// required uint32 flags = 2; +inline bool ProMessageConfig::_internal_has_flags() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool ProMessageConfig::has_flags() const { + return _internal_has_flags(); +} +inline void ProMessageConfig::clear_flags() { + _impl_.flags_ = 0u; + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline uint32_t ProMessageConfig::_internal_flags() const { + return _impl_.flags_; +} +inline uint32_t ProMessageConfig::flags() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProMessageConfig.flags) + return _internal_flags(); +} +inline void ProMessageConfig::_internal_set_flags(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.flags_ = value; +} +inline void ProMessageConfig::set_flags(uint32_t value) { + _internal_set_flags(value); + // @@protoc_insertion_point(field_set:SessionProtos.ProMessageConfig.flags) } // ------------------------------------------------------------------- @@ -7556,6 +8291,96 @@ inline void Content::set_allocated_sharedconfigmessage(::SessionProtos::SharedCo // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.sharedConfigMessage) } +// optional .SessionProtos.ProMessageConfig proMessageConfig = 12; +inline bool Content::_internal_has_promessageconfig() const { + bool value = (_impl_._has_bits_[0] & 0x00000200u) != 0; + PROTOBUF_ASSUME(!value || _impl_.promessageconfig_ != nullptr); + return value; +} +inline bool Content::has_promessageconfig() const { + return _internal_has_promessageconfig(); +} +inline void Content::clear_promessageconfig() { + if (_impl_.promessageconfig_ != nullptr) _impl_.promessageconfig_->Clear(); + _impl_._has_bits_[0] &= ~0x00000200u; +} +inline const ::SessionProtos::ProMessageConfig& Content::_internal_promessageconfig() const { + const ::SessionProtos::ProMessageConfig* p = _impl_.promessageconfig_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_ProMessageConfig_default_instance_); +} +inline const ::SessionProtos::ProMessageConfig& Content::promessageconfig() const { + // @@protoc_insertion_point(field_get:SessionProtos.Content.proMessageConfig) + return _internal_promessageconfig(); +} +inline void Content::unsafe_arena_set_allocated_promessageconfig( + ::SessionProtos::ProMessageConfig* promessageconfig) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.promessageconfig_); + } + _impl_.promessageconfig_ = promessageconfig; + if (promessageconfig) { + _impl_._has_bits_[0] |= 0x00000200u; + } else { + _impl_._has_bits_[0] &= ~0x00000200u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.proMessageConfig) +} +inline ::SessionProtos::ProMessageConfig* Content::release_promessageconfig() { + _impl_._has_bits_[0] &= ~0x00000200u; + ::SessionProtos::ProMessageConfig* temp = _impl_.promessageconfig_; + _impl_.promessageconfig_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::SessionProtos::ProMessageConfig* Content::unsafe_arena_release_promessageconfig() { + // @@protoc_insertion_point(field_release:SessionProtos.Content.proMessageConfig) + _impl_._has_bits_[0] &= ~0x00000200u; + ::SessionProtos::ProMessageConfig* temp = _impl_.promessageconfig_; + _impl_.promessageconfig_ = nullptr; + return temp; +} +inline ::SessionProtos::ProMessageConfig* Content::_internal_mutable_promessageconfig() { + _impl_._has_bits_[0] |= 0x00000200u; + if (_impl_.promessageconfig_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::ProMessageConfig>(GetArenaForAllocation()); + _impl_.promessageconfig_ = p; + } + return _impl_.promessageconfig_; +} +inline ::SessionProtos::ProMessageConfig* Content::mutable_promessageconfig() { + ::SessionProtos::ProMessageConfig* _msg = _internal_mutable_promessageconfig(); + // @@protoc_insertion_point(field_mutable:SessionProtos.Content.proMessageConfig) + return _msg; +} +inline void Content::set_allocated_promessageconfig(::SessionProtos::ProMessageConfig* promessageconfig) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.promessageconfig_; + } + if (promessageconfig) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(promessageconfig); + if (message_arena != submessage_arena) { + promessageconfig = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, promessageconfig, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000200u; + } else { + _impl_._has_bits_[0] &= ~0x00000200u; + } + _impl_.promessageconfig_ = promessageconfig; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.proMessageConfig) +} + // ------------------------------------------------------------------- // CallMessage @@ -9838,716 +10663,316 @@ inline uint32_t DataMessage_ClosedGroupControlMessage::expirationtimer() const { } inline void DataMessage_ClosedGroupControlMessage::_internal_set_expirationtimer(uint32_t value) { _impl_._has_bits_[0] |= 0x00000008u; - _impl_.expirationtimer_ = value; -} -inline void DataMessage_ClosedGroupControlMessage::set_expirationtimer(uint32_t value) { - _internal_set_expirationtimer(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.ClosedGroupControlMessage.expirationTimer) -} - -// ------------------------------------------------------------------- - -// DataMessage - -// optional string body = 1; -inline bool DataMessage::_internal_has_body() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - return value; -} -inline bool DataMessage::has_body() const { - return _internal_has_body(); -} -inline void DataMessage::clear_body() { - _impl_.body_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const std::string& DataMessage::body() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.body) - return _internal_body(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void DataMessage::set_body(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.body_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.body) -} -inline std::string* DataMessage::mutable_body() { - std::string* _s = _internal_mutable_body(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.body) - return _s; -} -inline const std::string& DataMessage::_internal_body() const { - return _impl_.body_.Get(); -} -inline void DataMessage::_internal_set_body(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.body_.Set(value, GetArenaForAllocation()); -} -inline std::string* DataMessage::_internal_mutable_body() { - _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.body_.Mutable(GetArenaForAllocation()); -} -inline std::string* DataMessage::release_body() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.body) - if (!_internal_has_body()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.body_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.body_.IsDefault()) { - _impl_.body_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void DataMessage::set_allocated_body(std::string* body) { - if (body != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - _impl_.body_.SetAllocated(body, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.body_.IsDefault()) { - _impl_.body_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.body) -} - -// repeated .SessionProtos.AttachmentPointer attachments = 2; -inline int DataMessage::_internal_attachments_size() const { - return _impl_.attachments_.size(); -} -inline int DataMessage::attachments_size() const { - return _internal_attachments_size(); -} -inline void DataMessage::clear_attachments() { - _impl_.attachments_.Clear(); -} -inline ::SessionProtos::AttachmentPointer* DataMessage::mutable_attachments(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.attachments) - return _impl_.attachments_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer >* -DataMessage::mutable_attachments() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.DataMessage.attachments) - return &_impl_.attachments_; -} -inline const ::SessionProtos::AttachmentPointer& DataMessage::_internal_attachments(int index) const { - return _impl_.attachments_.Get(index); -} -inline const ::SessionProtos::AttachmentPointer& DataMessage::attachments(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.attachments) - return _internal_attachments(index); -} -inline ::SessionProtos::AttachmentPointer* DataMessage::_internal_add_attachments() { - return _impl_.attachments_.Add(); -} -inline ::SessionProtos::AttachmentPointer* DataMessage::add_attachments() { - ::SessionProtos::AttachmentPointer* _add = _internal_add_attachments(); - // @@protoc_insertion_point(field_add:SessionProtos.DataMessage.attachments) - return _add; -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer >& -DataMessage::attachments() const { - // @@protoc_insertion_point(field_list:SessionProtos.DataMessage.attachments) - return _impl_.attachments_; -} - -// optional uint32 flags = 4; -inline bool DataMessage::_internal_has_flags() const { - bool value = (_impl_._has_bits_[0] & 0x00000100u) != 0; - return value; -} -inline bool DataMessage::has_flags() const { - return _internal_has_flags(); -} -inline void DataMessage::clear_flags() { - _impl_.flags_ = 0u; - _impl_._has_bits_[0] &= ~0x00000100u; -} -inline uint32_t DataMessage::_internal_flags() const { - return _impl_.flags_; -} -inline uint32_t DataMessage::flags() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.flags) - return _internal_flags(); -} -inline void DataMessage::_internal_set_flags(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000100u; - _impl_.flags_ = value; -} -inline void DataMessage::set_flags(uint32_t value) { - _internal_set_flags(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.flags) -} - -// optional uint32 expireTimer = 5; -inline bool DataMessage::_internal_has_expiretimer() const { - bool value = (_impl_._has_bits_[0] & 0x00000200u) != 0; - return value; -} -inline bool DataMessage::has_expiretimer() const { - return _internal_has_expiretimer(); -} -inline void DataMessage::clear_expiretimer() { - _impl_.expiretimer_ = 0u; - _impl_._has_bits_[0] &= ~0x00000200u; -} -inline uint32_t DataMessage::_internal_expiretimer() const { - return _impl_.expiretimer_; -} -inline uint32_t DataMessage::expiretimer() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.expireTimer) - return _internal_expiretimer(); -} -inline void DataMessage::_internal_set_expiretimer(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000200u; - _impl_.expiretimer_ = value; + _impl_.expirationtimer_ = value; } -inline void DataMessage::set_expiretimer(uint32_t value) { - _internal_set_expiretimer(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.expireTimer) +inline void DataMessage_ClosedGroupControlMessage::set_expirationtimer(uint32_t value) { + _internal_set_expirationtimer(value); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.ClosedGroupControlMessage.expirationTimer) } -// optional bytes profileKey = 6; -inline bool DataMessage::_internal_has_profilekey() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; +// ------------------------------------------------------------------- + +// DataMessage + +// optional string body = 1; +inline bool DataMessage::_internal_has_body() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool DataMessage::has_profilekey() const { - return _internal_has_profilekey(); +inline bool DataMessage::has_body() const { + return _internal_has_body(); } -inline void DataMessage::clear_profilekey() { - _impl_.profilekey_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000002u; +inline void DataMessage::clear_body() { + _impl_.body_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& DataMessage::profilekey() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.profileKey) - return _internal_profilekey(); +inline const std::string& DataMessage::body() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.body) + return _internal_body(); } template inline PROTOBUF_ALWAYS_INLINE -void DataMessage::set_profilekey(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.profilekey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.profileKey) +void DataMessage::set_body(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.body_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.body) } -inline std::string* DataMessage::mutable_profilekey() { - std::string* _s = _internal_mutable_profilekey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.profileKey) +inline std::string* DataMessage::mutable_body() { + std::string* _s = _internal_mutable_body(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.body) return _s; } -inline const std::string& DataMessage::_internal_profilekey() const { - return _impl_.profilekey_.Get(); +inline const std::string& DataMessage::_internal_body() const { + return _impl_.body_.Get(); } -inline void DataMessage::_internal_set_profilekey(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.profilekey_.Set(value, GetArenaForAllocation()); +inline void DataMessage::_internal_set_body(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.body_.Set(value, GetArenaForAllocation()); } -inline std::string* DataMessage::_internal_mutable_profilekey() { - _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.profilekey_.Mutable(GetArenaForAllocation()); +inline std::string* DataMessage::_internal_mutable_body() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.body_.Mutable(GetArenaForAllocation()); } -inline std::string* DataMessage::release_profilekey() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.profileKey) - if (!_internal_has_profilekey()) { +inline std::string* DataMessage::release_body() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.body) + if (!_internal_has_body()) { return nullptr; } - _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.profilekey_.Release(); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.body_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilekey_.IsDefault()) { - _impl_.profilekey_.Set("", GetArenaForAllocation()); + if (_impl_.body_.IsDefault()) { + _impl_.body_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void DataMessage::set_allocated_profilekey(std::string* profilekey) { - if (profilekey != nullptr) { - _impl_._has_bits_[0] |= 0x00000002u; +inline void DataMessage::set_allocated_body(std::string* body) { + if (body != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; } else { - _impl_._has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.profilekey_.SetAllocated(profilekey, GetArenaForAllocation()); + _impl_.body_.SetAllocated(body, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilekey_.IsDefault()) { - _impl_.profilekey_.Set("", GetArenaForAllocation()); + if (_impl_.body_.IsDefault()) { + _impl_.body_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.profileKey) -} - -// optional uint64 timestamp = 7; -inline bool DataMessage::_internal_has_timestamp() const { - bool value = (_impl_._has_bits_[0] & 0x00000400u) != 0; - return value; -} -inline bool DataMessage::has_timestamp() const { - return _internal_has_timestamp(); -} -inline void DataMessage::clear_timestamp() { - _impl_.timestamp_ = uint64_t{0u}; - _impl_._has_bits_[0] &= ~0x00000400u; -} -inline uint64_t DataMessage::_internal_timestamp() const { - return _impl_.timestamp_; -} -inline uint64_t DataMessage::timestamp() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.timestamp) - return _internal_timestamp(); -} -inline void DataMessage::_internal_set_timestamp(uint64_t value) { - _impl_._has_bits_[0] |= 0x00000400u; - _impl_.timestamp_ = value; -} -inline void DataMessage::set_timestamp(uint64_t value) { - _internal_set_timestamp(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.timestamp) -} - -// optional .SessionProtos.DataMessage.Quote quote = 8; -inline bool DataMessage::_internal_has_quote() const { - bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; - PROTOBUF_ASSUME(!value || _impl_.quote_ != nullptr); - return value; -} -inline bool DataMessage::has_quote() const { - return _internal_has_quote(); -} -inline void DataMessage::clear_quote() { - if (_impl_.quote_ != nullptr) _impl_.quote_->Clear(); - _impl_._has_bits_[0] &= ~0x00000008u; -} -inline const ::SessionProtos::DataMessage_Quote& DataMessage::_internal_quote() const { - const ::SessionProtos::DataMessage_Quote* p = _impl_.quote_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_DataMessage_Quote_default_instance_); -} -inline const ::SessionProtos::DataMessage_Quote& DataMessage::quote() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.quote) - return _internal_quote(); -} -inline void DataMessage::unsafe_arena_set_allocated_quote( - ::SessionProtos::DataMessage_Quote* quote) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.quote_); - } - _impl_.quote_ = quote; - if (quote) { - _impl_._has_bits_[0] |= 0x00000008u; - } else { - _impl_._has_bits_[0] &= ~0x00000008u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.DataMessage.quote) -} -inline ::SessionProtos::DataMessage_Quote* DataMessage::release_quote() { - _impl_._has_bits_[0] &= ~0x00000008u; - ::SessionProtos::DataMessage_Quote* temp = _impl_.quote_; - _impl_.quote_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return temp; -} -inline ::SessionProtos::DataMessage_Quote* DataMessage::unsafe_arena_release_quote() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.quote) - _impl_._has_bits_[0] &= ~0x00000008u; - ::SessionProtos::DataMessage_Quote* temp = _impl_.quote_; - _impl_.quote_ = nullptr; - return temp; -} -inline ::SessionProtos::DataMessage_Quote* DataMessage::_internal_mutable_quote() { - _impl_._has_bits_[0] |= 0x00000008u; - if (_impl_.quote_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::DataMessage_Quote>(GetArenaForAllocation()); - _impl_.quote_ = p; - } - return _impl_.quote_; -} -inline ::SessionProtos::DataMessage_Quote* DataMessage::mutable_quote() { - ::SessionProtos::DataMessage_Quote* _msg = _internal_mutable_quote(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.quote) - return _msg; -} -inline void DataMessage::set_allocated_quote(::SessionProtos::DataMessage_Quote* quote) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete _impl_.quote_; - } - if (quote) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(quote); - if (message_arena != submessage_arena) { - quote = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, quote, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000008u; - } else { - _impl_._has_bits_[0] &= ~0x00000008u; - } - _impl_.quote_ = quote; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.quote) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.body) } -// repeated .SessionProtos.DataMessage.Preview preview = 10; -inline int DataMessage::_internal_preview_size() const { - return _impl_.preview_.size(); +// repeated .SessionProtos.AttachmentPointer attachments = 2; +inline int DataMessage::_internal_attachments_size() const { + return _impl_.attachments_.size(); } -inline int DataMessage::preview_size() const { - return _internal_preview_size(); +inline int DataMessage::attachments_size() const { + return _internal_attachments_size(); } -inline void DataMessage::clear_preview() { - _impl_.preview_.Clear(); +inline void DataMessage::clear_attachments() { + _impl_.attachments_.Clear(); } -inline ::SessionProtos::DataMessage_Preview* DataMessage::mutable_preview(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.preview) - return _impl_.preview_.Mutable(index); +inline ::SessionProtos::AttachmentPointer* DataMessage::mutable_attachments(int index) { + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.attachments) + return _impl_.attachments_.Mutable(index); } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview >* -DataMessage::mutable_preview() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.DataMessage.preview) - return &_impl_.preview_; +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer >* +DataMessage::mutable_attachments() { + // @@protoc_insertion_point(field_mutable_list:SessionProtos.DataMessage.attachments) + return &_impl_.attachments_; } -inline const ::SessionProtos::DataMessage_Preview& DataMessage::_internal_preview(int index) const { - return _impl_.preview_.Get(index); +inline const ::SessionProtos::AttachmentPointer& DataMessage::_internal_attachments(int index) const { + return _impl_.attachments_.Get(index); } -inline const ::SessionProtos::DataMessage_Preview& DataMessage::preview(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.preview) - return _internal_preview(index); +inline const ::SessionProtos::AttachmentPointer& DataMessage::attachments(int index) const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.attachments) + return _internal_attachments(index); } -inline ::SessionProtos::DataMessage_Preview* DataMessage::_internal_add_preview() { - return _impl_.preview_.Add(); +inline ::SessionProtos::AttachmentPointer* DataMessage::_internal_add_attachments() { + return _impl_.attachments_.Add(); } -inline ::SessionProtos::DataMessage_Preview* DataMessage::add_preview() { - ::SessionProtos::DataMessage_Preview* _add = _internal_add_preview(); - // @@protoc_insertion_point(field_add:SessionProtos.DataMessage.preview) +inline ::SessionProtos::AttachmentPointer* DataMessage::add_attachments() { + ::SessionProtos::AttachmentPointer* _add = _internal_add_attachments(); + // @@protoc_insertion_point(field_add:SessionProtos.DataMessage.attachments) return _add; } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview >& -DataMessage::preview() const { - // @@protoc_insertion_point(field_list:SessionProtos.DataMessage.preview) - return _impl_.preview_; +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer >& +DataMessage::attachments() const { + // @@protoc_insertion_point(field_list:SessionProtos.DataMessage.attachments) + return _impl_.attachments_; } -// optional .SessionProtos.DataMessage.Reaction reaction = 11; -inline bool DataMessage::_internal_has_reaction() const { - bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; - PROTOBUF_ASSUME(!value || _impl_.reaction_ != nullptr); +// optional uint32 flags = 4; +inline bool DataMessage::_internal_has_flags() const { + bool value = (_impl_._has_bits_[0] & 0x00000100u) != 0; return value; } -inline bool DataMessage::has_reaction() const { - return _internal_has_reaction(); +inline bool DataMessage::has_flags() const { + return _internal_has_flags(); } -inline void DataMessage::clear_reaction() { - if (_impl_.reaction_ != nullptr) _impl_.reaction_->Clear(); - _impl_._has_bits_[0] &= ~0x00000010u; +inline void DataMessage::clear_flags() { + _impl_.flags_ = 0u; + _impl_._has_bits_[0] &= ~0x00000100u; } -inline const ::SessionProtos::DataMessage_Reaction& DataMessage::_internal_reaction() const { - const ::SessionProtos::DataMessage_Reaction* p = _impl_.reaction_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_DataMessage_Reaction_default_instance_); +inline uint32_t DataMessage::_internal_flags() const { + return _impl_.flags_; } -inline const ::SessionProtos::DataMessage_Reaction& DataMessage::reaction() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.reaction) - return _internal_reaction(); +inline uint32_t DataMessage::flags() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.flags) + return _internal_flags(); } -inline void DataMessage::unsafe_arena_set_allocated_reaction( - ::SessionProtos::DataMessage_Reaction* reaction) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.reaction_); - } - _impl_.reaction_ = reaction; - if (reaction) { - _impl_._has_bits_[0] |= 0x00000010u; - } else { - _impl_._has_bits_[0] &= ~0x00000010u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.DataMessage.reaction) +inline void DataMessage::_internal_set_flags(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000100u; + _impl_.flags_ = value; } -inline ::SessionProtos::DataMessage_Reaction* DataMessage::release_reaction() { - _impl_._has_bits_[0] &= ~0x00000010u; - ::SessionProtos::DataMessage_Reaction* temp = _impl_.reaction_; - _impl_.reaction_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return temp; +inline void DataMessage::set_flags(uint32_t value) { + _internal_set_flags(value); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.flags) } -inline ::SessionProtos::DataMessage_Reaction* DataMessage::unsafe_arena_release_reaction() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.reaction) - _impl_._has_bits_[0] &= ~0x00000010u; - ::SessionProtos::DataMessage_Reaction* temp = _impl_.reaction_; - _impl_.reaction_ = nullptr; - return temp; + +// optional uint32 expireTimer = 5; +inline bool DataMessage::_internal_has_expiretimer() const { + bool value = (_impl_._has_bits_[0] & 0x00000200u) != 0; + return value; } -inline ::SessionProtos::DataMessage_Reaction* DataMessage::_internal_mutable_reaction() { - _impl_._has_bits_[0] |= 0x00000010u; - if (_impl_.reaction_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::DataMessage_Reaction>(GetArenaForAllocation()); - _impl_.reaction_ = p; - } - return _impl_.reaction_; +inline bool DataMessage::has_expiretimer() const { + return _internal_has_expiretimer(); } -inline ::SessionProtos::DataMessage_Reaction* DataMessage::mutable_reaction() { - ::SessionProtos::DataMessage_Reaction* _msg = _internal_mutable_reaction(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.reaction) - return _msg; +inline void DataMessage::clear_expiretimer() { + _impl_.expiretimer_ = 0u; + _impl_._has_bits_[0] &= ~0x00000200u; } -inline void DataMessage::set_allocated_reaction(::SessionProtos::DataMessage_Reaction* reaction) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete _impl_.reaction_; - } - if (reaction) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(reaction); - if (message_arena != submessage_arena) { - reaction = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, reaction, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000010u; - } else { - _impl_._has_bits_[0] &= ~0x00000010u; - } - _impl_.reaction_ = reaction; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.reaction) +inline uint32_t DataMessage::_internal_expiretimer() const { + return _impl_.expiretimer_; +} +inline uint32_t DataMessage::expiretimer() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.expireTimer) + return _internal_expiretimer(); +} +inline void DataMessage::_internal_set_expiretimer(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000200u; + _impl_.expiretimer_ = value; +} +inline void DataMessage::set_expiretimer(uint32_t value) { + _internal_set_expiretimer(value); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.expireTimer) } -// optional .SessionProtos.LokiProfile profile = 101; -inline bool DataMessage::_internal_has_profile() const { - bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; - PROTOBUF_ASSUME(!value || _impl_.profile_ != nullptr); +// optional bytes profileKey = 6; +inline bool DataMessage::_internal_has_profilekey() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } -inline bool DataMessage::has_profile() const { - return _internal_has_profile(); -} -inline void DataMessage::clear_profile() { - if (_impl_.profile_ != nullptr) _impl_.profile_->Clear(); - _impl_._has_bits_[0] &= ~0x00000020u; +inline bool DataMessage::has_profilekey() const { + return _internal_has_profilekey(); } -inline const ::SessionProtos::LokiProfile& DataMessage::_internal_profile() const { - const ::SessionProtos::LokiProfile* p = _impl_.profile_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_LokiProfile_default_instance_); +inline void DataMessage::clear_profilekey() { + _impl_.profilekey_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; } -inline const ::SessionProtos::LokiProfile& DataMessage::profile() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.profile) - return _internal_profile(); +inline const std::string& DataMessage::profilekey() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.profileKey) + return _internal_profilekey(); } -inline void DataMessage::unsafe_arena_set_allocated_profile( - ::SessionProtos::LokiProfile* profile) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.profile_); - } - _impl_.profile_ = profile; - if (profile) { - _impl_._has_bits_[0] |= 0x00000020u; - } else { - _impl_._has_bits_[0] &= ~0x00000020u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.DataMessage.profile) +template +inline PROTOBUF_ALWAYS_INLINE +void DataMessage::set_profilekey(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.profilekey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.profileKey) } -inline ::SessionProtos::LokiProfile* DataMessage::release_profile() { - _impl_._has_bits_[0] &= ~0x00000020u; - ::SessionProtos::LokiProfile* temp = _impl_.profile_; - _impl_.profile_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return temp; +inline std::string* DataMessage::mutable_profilekey() { + std::string* _s = _internal_mutable_profilekey(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.profileKey) + return _s; } -inline ::SessionProtos::LokiProfile* DataMessage::unsafe_arena_release_profile() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.profile) - _impl_._has_bits_[0] &= ~0x00000020u; - ::SessionProtos::LokiProfile* temp = _impl_.profile_; - _impl_.profile_ = nullptr; - return temp; +inline const std::string& DataMessage::_internal_profilekey() const { + return _impl_.profilekey_.Get(); } -inline ::SessionProtos::LokiProfile* DataMessage::_internal_mutable_profile() { - _impl_._has_bits_[0] |= 0x00000020u; - if (_impl_.profile_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::LokiProfile>(GetArenaForAllocation()); - _impl_.profile_ = p; - } - return _impl_.profile_; +inline void DataMessage::_internal_set_profilekey(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.profilekey_.Set(value, GetArenaForAllocation()); } -inline ::SessionProtos::LokiProfile* DataMessage::mutable_profile() { - ::SessionProtos::LokiProfile* _msg = _internal_mutable_profile(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.profile) - return _msg; +inline std::string* DataMessage::_internal_mutable_profilekey() { + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.profilekey_.Mutable(GetArenaForAllocation()); } -inline void DataMessage::set_allocated_profile(::SessionProtos::LokiProfile* profile) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete _impl_.profile_; +inline std::string* DataMessage::release_profilekey() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.profileKey) + if (!_internal_has_profilekey()) { + return nullptr; } - if (profile) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(profile); - if (message_arena != submessage_arena) { - profile = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, profile, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000020u; + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.profilekey_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.profilekey_.IsDefault()) { + _impl_.profilekey_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void DataMessage::set_allocated_profilekey(std::string* profilekey) { + if (profilekey != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; } else { - _impl_._has_bits_[0] &= ~0x00000020u; + _impl_._has_bits_[0] &= ~0x00000002u; } - _impl_.profile_ = profile; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.profile) + _impl_.profilekey_.SetAllocated(profilekey, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.profilekey_.IsDefault()) { + _impl_.profilekey_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.profileKey) } -// optional .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; -inline bool DataMessage::_internal_has_opengroupinvitation() const { - bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; - PROTOBUF_ASSUME(!value || _impl_.opengroupinvitation_ != nullptr); +// optional uint64 timestamp = 7; +inline bool DataMessage::_internal_has_timestamp() const { + bool value = (_impl_._has_bits_[0] & 0x00000400u) != 0; return value; } -inline bool DataMessage::has_opengroupinvitation() const { - return _internal_has_opengroupinvitation(); -} -inline void DataMessage::clear_opengroupinvitation() { - if (_impl_.opengroupinvitation_ != nullptr) _impl_.opengroupinvitation_->Clear(); - _impl_._has_bits_[0] &= ~0x00000040u; -} -inline const ::SessionProtos::DataMessage_OpenGroupInvitation& DataMessage::_internal_opengroupinvitation() const { - const ::SessionProtos::DataMessage_OpenGroupInvitation* p = _impl_.opengroupinvitation_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_DataMessage_OpenGroupInvitation_default_instance_); -} -inline const ::SessionProtos::DataMessage_OpenGroupInvitation& DataMessage::opengroupinvitation() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.openGroupInvitation) - return _internal_opengroupinvitation(); -} -inline void DataMessage::unsafe_arena_set_allocated_opengroupinvitation( - ::SessionProtos::DataMessage_OpenGroupInvitation* opengroupinvitation) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.opengroupinvitation_); - } - _impl_.opengroupinvitation_ = opengroupinvitation; - if (opengroupinvitation) { - _impl_._has_bits_[0] |= 0x00000040u; - } else { - _impl_._has_bits_[0] &= ~0x00000040u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.DataMessage.openGroupInvitation) +inline bool DataMessage::has_timestamp() const { + return _internal_has_timestamp(); } -inline ::SessionProtos::DataMessage_OpenGroupInvitation* DataMessage::release_opengroupinvitation() { - _impl_._has_bits_[0] &= ~0x00000040u; - ::SessionProtos::DataMessage_OpenGroupInvitation* temp = _impl_.opengroupinvitation_; - _impl_.opengroupinvitation_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return temp; +inline void DataMessage::clear_timestamp() { + _impl_.timestamp_ = uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000400u; } -inline ::SessionProtos::DataMessage_OpenGroupInvitation* DataMessage::unsafe_arena_release_opengroupinvitation() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.openGroupInvitation) - _impl_._has_bits_[0] &= ~0x00000040u; - ::SessionProtos::DataMessage_OpenGroupInvitation* temp = _impl_.opengroupinvitation_; - _impl_.opengroupinvitation_ = nullptr; - return temp; +inline uint64_t DataMessage::_internal_timestamp() const { + return _impl_.timestamp_; } -inline ::SessionProtos::DataMessage_OpenGroupInvitation* DataMessage::_internal_mutable_opengroupinvitation() { - _impl_._has_bits_[0] |= 0x00000040u; - if (_impl_.opengroupinvitation_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::DataMessage_OpenGroupInvitation>(GetArenaForAllocation()); - _impl_.opengroupinvitation_ = p; - } - return _impl_.opengroupinvitation_; +inline uint64_t DataMessage::timestamp() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.timestamp) + return _internal_timestamp(); } -inline ::SessionProtos::DataMessage_OpenGroupInvitation* DataMessage::mutable_opengroupinvitation() { - ::SessionProtos::DataMessage_OpenGroupInvitation* _msg = _internal_mutable_opengroupinvitation(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.openGroupInvitation) - return _msg; +inline void DataMessage::_internal_set_timestamp(uint64_t value) { + _impl_._has_bits_[0] |= 0x00000400u; + _impl_.timestamp_ = value; } -inline void DataMessage::set_allocated_opengroupinvitation(::SessionProtos::DataMessage_OpenGroupInvitation* opengroupinvitation) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete _impl_.opengroupinvitation_; - } - if (opengroupinvitation) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(opengroupinvitation); - if (message_arena != submessage_arena) { - opengroupinvitation = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, opengroupinvitation, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000040u; - } else { - _impl_._has_bits_[0] &= ~0x00000040u; - } - _impl_.opengroupinvitation_ = opengroupinvitation; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.openGroupInvitation) +inline void DataMessage::set_timestamp(uint64_t value) { + _internal_set_timestamp(value); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.timestamp) } -// optional .SessionProtos.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; -inline bool DataMessage::_internal_has_closedgroupcontrolmessage() const { - bool value = (_impl_._has_bits_[0] & 0x00000080u) != 0; - PROTOBUF_ASSUME(!value || _impl_.closedgroupcontrolmessage_ != nullptr); +// optional .SessionProtos.DataMessage.Quote quote = 8; +inline bool DataMessage::_internal_has_quote() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + PROTOBUF_ASSUME(!value || _impl_.quote_ != nullptr); return value; } -inline bool DataMessage::has_closedgroupcontrolmessage() const { - return _internal_has_closedgroupcontrolmessage(); +inline bool DataMessage::has_quote() const { + return _internal_has_quote(); } -inline void DataMessage::clear_closedgroupcontrolmessage() { - if (_impl_.closedgroupcontrolmessage_ != nullptr) _impl_.closedgroupcontrolmessage_->Clear(); - _impl_._has_bits_[0] &= ~0x00000080u; +inline void DataMessage::clear_quote() { + if (_impl_.quote_ != nullptr) _impl_.quote_->Clear(); + _impl_._has_bits_[0] &= ~0x00000008u; } -inline const ::SessionProtos::DataMessage_ClosedGroupControlMessage& DataMessage::_internal_closedgroupcontrolmessage() const { - const ::SessionProtos::DataMessage_ClosedGroupControlMessage* p = _impl_.closedgroupcontrolmessage_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_DataMessage_ClosedGroupControlMessage_default_instance_); +inline const ::SessionProtos::DataMessage_Quote& DataMessage::_internal_quote() const { + const ::SessionProtos::DataMessage_Quote* p = _impl_.quote_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_DataMessage_Quote_default_instance_); } -inline const ::SessionProtos::DataMessage_ClosedGroupControlMessage& DataMessage::closedgroupcontrolmessage() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.closedGroupControlMessage) - return _internal_closedgroupcontrolmessage(); +inline const ::SessionProtos::DataMessage_Quote& DataMessage::quote() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.quote) + return _internal_quote(); } -inline void DataMessage::unsafe_arena_set_allocated_closedgroupcontrolmessage( - ::SessionProtos::DataMessage_ClosedGroupControlMessage* closedgroupcontrolmessage) { +inline void DataMessage::unsafe_arena_set_allocated_quote( + ::SessionProtos::DataMessage_Quote* quote) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.closedgroupcontrolmessage_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.quote_); } - _impl_.closedgroupcontrolmessage_ = closedgroupcontrolmessage; - if (closedgroupcontrolmessage) { - _impl_._has_bits_[0] |= 0x00000080u; + _impl_.quote_ = quote; + if (quote) { + _impl_._has_bits_[0] |= 0x00000008u; } else { - _impl_._has_bits_[0] &= ~0x00000080u; + _impl_._has_bits_[0] &= ~0x00000008u; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.DataMessage.closedGroupControlMessage) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.DataMessage.quote) } -inline ::SessionProtos::DataMessage_ClosedGroupControlMessage* DataMessage::release_closedgroupcontrolmessage() { - _impl_._has_bits_[0] &= ~0x00000080u; - ::SessionProtos::DataMessage_ClosedGroupControlMessage* temp = _impl_.closedgroupcontrolmessage_; - _impl_.closedgroupcontrolmessage_ = nullptr; +inline ::SessionProtos::DataMessage_Quote* DataMessage::release_quote() { + _impl_._has_bits_[0] &= ~0x00000008u; + ::SessionProtos::DataMessage_Quote* temp = _impl_.quote_; + _impl_.quote_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -10559,321 +10984,215 @@ inline ::SessionProtos::DataMessage_ClosedGroupControlMessage* DataMessage::rele #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::SessionProtos::DataMessage_ClosedGroupControlMessage* DataMessage::unsafe_arena_release_closedgroupcontrolmessage() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.closedGroupControlMessage) - _impl_._has_bits_[0] &= ~0x00000080u; - ::SessionProtos::DataMessage_ClosedGroupControlMessage* temp = _impl_.closedgroupcontrolmessage_; - _impl_.closedgroupcontrolmessage_ = nullptr; +inline ::SessionProtos::DataMessage_Quote* DataMessage::unsafe_arena_release_quote() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.quote) + _impl_._has_bits_[0] &= ~0x00000008u; + ::SessionProtos::DataMessage_Quote* temp = _impl_.quote_; + _impl_.quote_ = nullptr; return temp; } -inline ::SessionProtos::DataMessage_ClosedGroupControlMessage* DataMessage::_internal_mutable_closedgroupcontrolmessage() { - _impl_._has_bits_[0] |= 0x00000080u; - if (_impl_.closedgroupcontrolmessage_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::DataMessage_ClosedGroupControlMessage>(GetArenaForAllocation()); - _impl_.closedgroupcontrolmessage_ = p; +inline ::SessionProtos::DataMessage_Quote* DataMessage::_internal_mutable_quote() { + _impl_._has_bits_[0] |= 0x00000008u; + if (_impl_.quote_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::DataMessage_Quote>(GetArenaForAllocation()); + _impl_.quote_ = p; } - return _impl_.closedgroupcontrolmessage_; + return _impl_.quote_; } -inline ::SessionProtos::DataMessage_ClosedGroupControlMessage* DataMessage::mutable_closedgroupcontrolmessage() { - ::SessionProtos::DataMessage_ClosedGroupControlMessage* _msg = _internal_mutable_closedgroupcontrolmessage(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.closedGroupControlMessage) +inline ::SessionProtos::DataMessage_Quote* DataMessage::mutable_quote() { + ::SessionProtos::DataMessage_Quote* _msg = _internal_mutable_quote(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.quote) return _msg; } -inline void DataMessage::set_allocated_closedgroupcontrolmessage(::SessionProtos::DataMessage_ClosedGroupControlMessage* closedgroupcontrolmessage) { +inline void DataMessage::set_allocated_quote(::SessionProtos::DataMessage_Quote* quote) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.closedgroupcontrolmessage_; - } - if (closedgroupcontrolmessage) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(closedgroupcontrolmessage); - if (message_arena != submessage_arena) { - closedgroupcontrolmessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, closedgroupcontrolmessage, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000080u; - } else { - _impl_._has_bits_[0] &= ~0x00000080u; - } - _impl_.closedgroupcontrolmessage_ = closedgroupcontrolmessage; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.closedGroupControlMessage) -} - -// optional string syncTarget = 105; -inline bool DataMessage::_internal_has_synctarget() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; - return value; -} -inline bool DataMessage::has_synctarget() const { - return _internal_has_synctarget(); -} -inline void DataMessage::clear_synctarget() { - _impl_.synctarget_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000004u; -} -inline const std::string& DataMessage::synctarget() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.syncTarget) - return _internal_synctarget(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void DataMessage::set_synctarget(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.synctarget_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.syncTarget) -} -inline std::string* DataMessage::mutable_synctarget() { - std::string* _s = _internal_mutable_synctarget(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.syncTarget) - return _s; -} -inline const std::string& DataMessage::_internal_synctarget() const { - return _impl_.synctarget_.Get(); -} -inline void DataMessage::_internal_set_synctarget(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.synctarget_.Set(value, GetArenaForAllocation()); -} -inline std::string* DataMessage::_internal_mutable_synctarget() { - _impl_._has_bits_[0] |= 0x00000004u; - return _impl_.synctarget_.Mutable(GetArenaForAllocation()); -} -inline std::string* DataMessage::release_synctarget() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.syncTarget) - if (!_internal_has_synctarget()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000004u; - auto* p = _impl_.synctarget_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.synctarget_.IsDefault()) { - _impl_.synctarget_.Set("", GetArenaForAllocation()); + delete _impl_.quote_; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void DataMessage::set_allocated_synctarget(std::string* synctarget) { - if (synctarget != nullptr) { - _impl_._has_bits_[0] |= 0x00000004u; + if (quote) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(quote); + if (message_arena != submessage_arena) { + quote = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, quote, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000008u; } else { - _impl_._has_bits_[0] &= ~0x00000004u; - } - _impl_.synctarget_.SetAllocated(synctarget, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.synctarget_.IsDefault()) { - _impl_.synctarget_.Set("", GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000008u; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.syncTarget) + _impl_.quote_ = quote; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.quote) } -// optional bool blocksCommunityMessageRequests = 106; -inline bool DataMessage::_internal_has_blockscommunitymessagerequests() const { - bool value = (_impl_._has_bits_[0] & 0x00000800u) != 0; - return value; -} -inline bool DataMessage::has_blockscommunitymessagerequests() const { - return _internal_has_blockscommunitymessagerequests(); +// repeated .SessionProtos.DataMessage.Preview preview = 10; +inline int DataMessage::_internal_preview_size() const { + return _impl_.preview_.size(); } -inline void DataMessage::clear_blockscommunitymessagerequests() { - _impl_.blockscommunitymessagerequests_ = false; - _impl_._has_bits_[0] &= ~0x00000800u; +inline int DataMessage::preview_size() const { + return _internal_preview_size(); } -inline bool DataMessage::_internal_blockscommunitymessagerequests() const { - return _impl_.blockscommunitymessagerequests_; +inline void DataMessage::clear_preview() { + _impl_.preview_.Clear(); } -inline bool DataMessage::blockscommunitymessagerequests() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.blocksCommunityMessageRequests) - return _internal_blockscommunitymessagerequests(); +inline ::SessionProtos::DataMessage_Preview* DataMessage::mutable_preview(int index) { + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.preview) + return _impl_.preview_.Mutable(index); } -inline void DataMessage::_internal_set_blockscommunitymessagerequests(bool value) { - _impl_._has_bits_[0] |= 0x00000800u; - _impl_.blockscommunitymessagerequests_ = value; +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview >* +DataMessage::mutable_preview() { + // @@protoc_insertion_point(field_mutable_list:SessionProtos.DataMessage.preview) + return &_impl_.preview_; } -inline void DataMessage::set_blockscommunitymessagerequests(bool value) { - _internal_set_blockscommunitymessagerequests(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.blocksCommunityMessageRequests) +inline const ::SessionProtos::DataMessage_Preview& DataMessage::_internal_preview(int index) const { + return _impl_.preview_.Get(index); } - -// ------------------------------------------------------------------- - -// ConfigurationMessage_ClosedGroup - -// optional bytes publicKey = 1; -inline bool ConfigurationMessage_ClosedGroup::_internal_has_publickey() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - return value; +inline const ::SessionProtos::DataMessage_Preview& DataMessage::preview(int index) const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.preview) + return _internal_preview(index); } -inline bool ConfigurationMessage_ClosedGroup::has_publickey() const { - return _internal_has_publickey(); +inline ::SessionProtos::DataMessage_Preview* DataMessage::_internal_add_preview() { + return _impl_.preview_.Add(); } -inline void ConfigurationMessage_ClosedGroup::clear_publickey() { - _impl_.publickey_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000001u; +inline ::SessionProtos::DataMessage_Preview* DataMessage::add_preview() { + ::SessionProtos::DataMessage_Preview* _add = _internal_add_preview(); + // @@protoc_insertion_point(field_add:SessionProtos.DataMessage.preview) + return _add; } -inline const std::string& ConfigurationMessage_ClosedGroup::publickey() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ClosedGroup.publicKey) - return _internal_publickey(); +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview >& +DataMessage::preview() const { + // @@protoc_insertion_point(field_list:SessionProtos.DataMessage.preview) + return _impl_.preview_; } -template -inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage_ClosedGroup::set_publickey(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.publickey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.publicKey) + +// optional .SessionProtos.DataMessage.Reaction reaction = 11; +inline bool DataMessage::_internal_has_reaction() const { + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; + PROTOBUF_ASSUME(!value || _impl_.reaction_ != nullptr); + return value; } -inline std::string* ConfigurationMessage_ClosedGroup::mutable_publickey() { - std::string* _s = _internal_mutable_publickey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.publicKey) - return _s; +inline bool DataMessage::has_reaction() const { + return _internal_has_reaction(); } -inline const std::string& ConfigurationMessage_ClosedGroup::_internal_publickey() const { - return _impl_.publickey_.Get(); +inline void DataMessage::clear_reaction() { + if (_impl_.reaction_ != nullptr) _impl_.reaction_->Clear(); + _impl_._has_bits_[0] &= ~0x00000010u; } -inline void ConfigurationMessage_ClosedGroup::_internal_set_publickey(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.publickey_.Set(value, GetArenaForAllocation()); +inline const ::SessionProtos::DataMessage_Reaction& DataMessage::_internal_reaction() const { + const ::SessionProtos::DataMessage_Reaction* p = _impl_.reaction_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_DataMessage_Reaction_default_instance_); } -inline std::string* ConfigurationMessage_ClosedGroup::_internal_mutable_publickey() { - _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.publickey_.Mutable(GetArenaForAllocation()); +inline const ::SessionProtos::DataMessage_Reaction& DataMessage::reaction() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.reaction) + return _internal_reaction(); } -inline std::string* ConfigurationMessage_ClosedGroup::release_publickey() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.ClosedGroup.publicKey) - if (!_internal_has_publickey()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.publickey_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.publickey_.IsDefault()) { - _impl_.publickey_.Set("", GetArenaForAllocation()); +inline void DataMessage::unsafe_arena_set_allocated_reaction( + ::SessionProtos::DataMessage_Reaction* reaction) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.reaction_); } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void ConfigurationMessage_ClosedGroup::set_allocated_publickey(std::string* publickey) { - if (publickey != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; + _impl_.reaction_ = reaction; + if (reaction) { + _impl_._has_bits_[0] |= 0x00000010u; } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - _impl_.publickey_.SetAllocated(publickey, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.publickey_.IsDefault()) { - _impl_.publickey_.Set("", GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000010u; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.ClosedGroup.publicKey) -} - -// optional string name = 2; -inline bool ConfigurationMessage_ClosedGroup::_internal_has_name() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - return value; -} -inline bool ConfigurationMessage_ClosedGroup::has_name() const { - return _internal_has_name(); -} -inline void ConfigurationMessage_ClosedGroup::clear_name() { - _impl_.name_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000002u; -} -inline const std::string& ConfigurationMessage_ClosedGroup::name() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ClosedGroup.name) - return _internal_name(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage_ClosedGroup::set_name(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.name) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.DataMessage.reaction) } -inline std::string* ConfigurationMessage_ClosedGroup::mutable_name() { - std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.name) - return _s; +inline ::SessionProtos::DataMessage_Reaction* DataMessage::release_reaction() { + _impl_._has_bits_[0] &= ~0x00000010u; + ::SessionProtos::DataMessage_Reaction* temp = _impl_.reaction_; + _impl_.reaction_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; } -inline const std::string& ConfigurationMessage_ClosedGroup::_internal_name() const { - return _impl_.name_.Get(); +inline ::SessionProtos::DataMessage_Reaction* DataMessage::unsafe_arena_release_reaction() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.reaction) + _impl_._has_bits_[0] &= ~0x00000010u; + ::SessionProtos::DataMessage_Reaction* temp = _impl_.reaction_; + _impl_.reaction_ = nullptr; + return temp; } -inline void ConfigurationMessage_ClosedGroup::_internal_set_name(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.name_.Set(value, GetArenaForAllocation()); +inline ::SessionProtos::DataMessage_Reaction* DataMessage::_internal_mutable_reaction() { + _impl_._has_bits_[0] |= 0x00000010u; + if (_impl_.reaction_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::DataMessage_Reaction>(GetArenaForAllocation()); + _impl_.reaction_ = p; + } + return _impl_.reaction_; } -inline std::string* ConfigurationMessage_ClosedGroup::_internal_mutable_name() { - _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.name_.Mutable(GetArenaForAllocation()); +inline ::SessionProtos::DataMessage_Reaction* DataMessage::mutable_reaction() { + ::SessionProtos::DataMessage_Reaction* _msg = _internal_mutable_reaction(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.reaction) + return _msg; } -inline std::string* ConfigurationMessage_ClosedGroup::release_name() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.ClosedGroup.name) - if (!_internal_has_name()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.name_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.name_.IsDefault()) { - _impl_.name_.Set("", GetArenaForAllocation()); +inline void DataMessage::set_allocated_reaction(::SessionProtos::DataMessage_Reaction* reaction) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.reaction_; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void ConfigurationMessage_ClosedGroup::set_allocated_name(std::string* name) { - if (name != nullptr) { - _impl_._has_bits_[0] |= 0x00000002u; + if (reaction) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(reaction); + if (message_arena != submessage_arena) { + reaction = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, reaction, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000010u; } else { - _impl_._has_bits_[0] &= ~0x00000002u; - } - _impl_.name_.SetAllocated(name, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.name_.IsDefault()) { - _impl_.name_.Set("", GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000010u; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.ClosedGroup.name) + _impl_.reaction_ = reaction; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.reaction) } -// optional .SessionProtos.KeyPair encryptionKeyPair = 3; -inline bool ConfigurationMessage_ClosedGroup::_internal_has_encryptionkeypair() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; - PROTOBUF_ASSUME(!value || _impl_.encryptionkeypair_ != nullptr); +// optional .SessionProtos.LokiProfile profile = 101; +inline bool DataMessage::_internal_has_profile() const { + bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; + PROTOBUF_ASSUME(!value || _impl_.profile_ != nullptr); return value; } -inline bool ConfigurationMessage_ClosedGroup::has_encryptionkeypair() const { - return _internal_has_encryptionkeypair(); +inline bool DataMessage::has_profile() const { + return _internal_has_profile(); } -inline void ConfigurationMessage_ClosedGroup::clear_encryptionkeypair() { - if (_impl_.encryptionkeypair_ != nullptr) _impl_.encryptionkeypair_->Clear(); - _impl_._has_bits_[0] &= ~0x00000004u; +inline void DataMessage::clear_profile() { + if (_impl_.profile_ != nullptr) _impl_.profile_->Clear(); + _impl_._has_bits_[0] &= ~0x00000020u; } -inline const ::SessionProtos::KeyPair& ConfigurationMessage_ClosedGroup::_internal_encryptionkeypair() const { - const ::SessionProtos::KeyPair* p = _impl_.encryptionkeypair_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_KeyPair_default_instance_); +inline const ::SessionProtos::LokiProfile& DataMessage::_internal_profile() const { + const ::SessionProtos::LokiProfile* p = _impl_.profile_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_LokiProfile_default_instance_); } -inline const ::SessionProtos::KeyPair& ConfigurationMessage_ClosedGroup::encryptionkeypair() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ClosedGroup.encryptionKeyPair) - return _internal_encryptionkeypair(); +inline const ::SessionProtos::LokiProfile& DataMessage::profile() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.profile) + return _internal_profile(); } -inline void ConfigurationMessage_ClosedGroup::unsafe_arena_set_allocated_encryptionkeypair( - ::SessionProtos::KeyPair* encryptionkeypair) { +inline void DataMessage::unsafe_arena_set_allocated_profile( + ::SessionProtos::LokiProfile* profile) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.encryptionkeypair_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.profile_); } - _impl_.encryptionkeypair_ = encryptionkeypair; - if (encryptionkeypair) { - _impl_._has_bits_[0] |= 0x00000004u; + _impl_.profile_ = profile; + if (profile) { + _impl_._has_bits_[0] |= 0x00000020u; } else { - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000020u; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.ConfigurationMessage.ClosedGroup.encryptionKeyPair) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.DataMessage.profile) } -inline ::SessionProtos::KeyPair* ConfigurationMessage_ClosedGroup::release_encryptionkeypair() { - _impl_._has_bits_[0] &= ~0x00000004u; - ::SessionProtos::KeyPair* temp = _impl_.encryptionkeypair_; - _impl_.encryptionkeypair_ = nullptr; +inline ::SessionProtos::LokiProfile* DataMessage::release_profile() { + _impl_._has_bits_[0] &= ~0x00000020u; + ::SessionProtos::LokiProfile* temp = _impl_.profile_; + _impl_.profile_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -10885,269 +11204,367 @@ inline ::SessionProtos::KeyPair* ConfigurationMessage_ClosedGroup::release_encry #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::SessionProtos::KeyPair* ConfigurationMessage_ClosedGroup::unsafe_arena_release_encryptionkeypair() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.ClosedGroup.encryptionKeyPair) - _impl_._has_bits_[0] &= ~0x00000004u; - ::SessionProtos::KeyPair* temp = _impl_.encryptionkeypair_; - _impl_.encryptionkeypair_ = nullptr; +inline ::SessionProtos::LokiProfile* DataMessage::unsafe_arena_release_profile() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.profile) + _impl_._has_bits_[0] &= ~0x00000020u; + ::SessionProtos::LokiProfile* temp = _impl_.profile_; + _impl_.profile_ = nullptr; return temp; } -inline ::SessionProtos::KeyPair* ConfigurationMessage_ClosedGroup::_internal_mutable_encryptionkeypair() { - _impl_._has_bits_[0] |= 0x00000004u; - if (_impl_.encryptionkeypair_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::KeyPair>(GetArenaForAllocation()); - _impl_.encryptionkeypair_ = p; +inline ::SessionProtos::LokiProfile* DataMessage::_internal_mutable_profile() { + _impl_._has_bits_[0] |= 0x00000020u; + if (_impl_.profile_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::LokiProfile>(GetArenaForAllocation()); + _impl_.profile_ = p; } - return _impl_.encryptionkeypair_; + return _impl_.profile_; } -inline ::SessionProtos::KeyPair* ConfigurationMessage_ClosedGroup::mutable_encryptionkeypair() { - ::SessionProtos::KeyPair* _msg = _internal_mutable_encryptionkeypair(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.encryptionKeyPair) +inline ::SessionProtos::LokiProfile* DataMessage::mutable_profile() { + ::SessionProtos::LokiProfile* _msg = _internal_mutable_profile(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.profile) return _msg; } -inline void ConfigurationMessage_ClosedGroup::set_allocated_encryptionkeypair(::SessionProtos::KeyPair* encryptionkeypair) { +inline void DataMessage::set_allocated_profile(::SessionProtos::LokiProfile* profile) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.encryptionkeypair_; + delete _impl_.profile_; } - if (encryptionkeypair) { + if (profile) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(encryptionkeypair); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(profile); if (message_arena != submessage_arena) { - encryptionkeypair = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, encryptionkeypair, submessage_arena); + profile = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, profile, submessage_arena); } - _impl_._has_bits_[0] |= 0x00000004u; + _impl_._has_bits_[0] |= 0x00000020u; } else { - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000020u; } - _impl_.encryptionkeypair_ = encryptionkeypair; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.ClosedGroup.encryptionKeyPair) + _impl_.profile_ = profile; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.profile) } -// repeated bytes members = 4; -inline int ConfigurationMessage_ClosedGroup::_internal_members_size() const { - return _impl_.members_.size(); -} -inline int ConfigurationMessage_ClosedGroup::members_size() const { - return _internal_members_size(); -} -inline void ConfigurationMessage_ClosedGroup::clear_members() { - _impl_.members_.Clear(); -} -inline std::string* ConfigurationMessage_ClosedGroup::add_members() { - std::string* _s = _internal_add_members(); - // @@protoc_insertion_point(field_add_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.members) - return _s; -} -inline const std::string& ConfigurationMessage_ClosedGroup::_internal_members(int index) const { - return _impl_.members_.Get(index); +// optional .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; +inline bool DataMessage::_internal_has_opengroupinvitation() const { + bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; + PROTOBUF_ASSUME(!value || _impl_.opengroupinvitation_ != nullptr); + return value; } -inline const std::string& ConfigurationMessage_ClosedGroup::members(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ClosedGroup.members) - return _internal_members(index); +inline bool DataMessage::has_opengroupinvitation() const { + return _internal_has_opengroupinvitation(); } -inline std::string* ConfigurationMessage_ClosedGroup::mutable_members(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.members) - return _impl_.members_.Mutable(index); +inline void DataMessage::clear_opengroupinvitation() { + if (_impl_.opengroupinvitation_ != nullptr) _impl_.opengroupinvitation_->Clear(); + _impl_._has_bits_[0] &= ~0x00000040u; } -inline void ConfigurationMessage_ClosedGroup::set_members(int index, const std::string& value) { - _impl_.members_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.members) +inline const ::SessionProtos::DataMessage_OpenGroupInvitation& DataMessage::_internal_opengroupinvitation() const { + const ::SessionProtos::DataMessage_OpenGroupInvitation* p = _impl_.opengroupinvitation_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_DataMessage_OpenGroupInvitation_default_instance_); } -inline void ConfigurationMessage_ClosedGroup::set_members(int index, std::string&& value) { - _impl_.members_.Mutable(index)->assign(std::move(value)); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.members) +inline const ::SessionProtos::DataMessage_OpenGroupInvitation& DataMessage::opengroupinvitation() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.openGroupInvitation) + return _internal_opengroupinvitation(); } -inline void ConfigurationMessage_ClosedGroup::set_members(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.members_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:SessionProtos.ConfigurationMessage.ClosedGroup.members) +inline void DataMessage::unsafe_arena_set_allocated_opengroupinvitation( + ::SessionProtos::DataMessage_OpenGroupInvitation* opengroupinvitation) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.opengroupinvitation_); + } + _impl_.opengroupinvitation_ = opengroupinvitation; + if (opengroupinvitation) { + _impl_._has_bits_[0] |= 0x00000040u; + } else { + _impl_._has_bits_[0] &= ~0x00000040u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.DataMessage.openGroupInvitation) } -inline void ConfigurationMessage_ClosedGroup::set_members(int index, const void* value, size_t size) { - _impl_.members_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:SessionProtos.ConfigurationMessage.ClosedGroup.members) +inline ::SessionProtos::DataMessage_OpenGroupInvitation* DataMessage::release_opengroupinvitation() { + _impl_._has_bits_[0] &= ~0x00000040u; + ::SessionProtos::DataMessage_OpenGroupInvitation* temp = _impl_.opengroupinvitation_; + _impl_.opengroupinvitation_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; } -inline std::string* ConfigurationMessage_ClosedGroup::_internal_add_members() { - return _impl_.members_.Add(); +inline ::SessionProtos::DataMessage_OpenGroupInvitation* DataMessage::unsafe_arena_release_opengroupinvitation() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.openGroupInvitation) + _impl_._has_bits_[0] &= ~0x00000040u; + ::SessionProtos::DataMessage_OpenGroupInvitation* temp = _impl_.opengroupinvitation_; + _impl_.opengroupinvitation_ = nullptr; + return temp; } -inline void ConfigurationMessage_ClosedGroup::add_members(const std::string& value) { - _impl_.members_.Add()->assign(value); - // @@protoc_insertion_point(field_add:SessionProtos.ConfigurationMessage.ClosedGroup.members) +inline ::SessionProtos::DataMessage_OpenGroupInvitation* DataMessage::_internal_mutable_opengroupinvitation() { + _impl_._has_bits_[0] |= 0x00000040u; + if (_impl_.opengroupinvitation_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::DataMessage_OpenGroupInvitation>(GetArenaForAllocation()); + _impl_.opengroupinvitation_ = p; + } + return _impl_.opengroupinvitation_; } -inline void ConfigurationMessage_ClosedGroup::add_members(std::string&& value) { - _impl_.members_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:SessionProtos.ConfigurationMessage.ClosedGroup.members) +inline ::SessionProtos::DataMessage_OpenGroupInvitation* DataMessage::mutable_opengroupinvitation() { + ::SessionProtos::DataMessage_OpenGroupInvitation* _msg = _internal_mutable_opengroupinvitation(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.openGroupInvitation) + return _msg; } -inline void ConfigurationMessage_ClosedGroup::add_members(const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.members_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:SessionProtos.ConfigurationMessage.ClosedGroup.members) +inline void DataMessage::set_allocated_opengroupinvitation(::SessionProtos::DataMessage_OpenGroupInvitation* opengroupinvitation) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.opengroupinvitation_; + } + if (opengroupinvitation) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(opengroupinvitation); + if (message_arena != submessage_arena) { + opengroupinvitation = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, opengroupinvitation, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000040u; + } else { + _impl_._has_bits_[0] &= ~0x00000040u; + } + _impl_.opengroupinvitation_ = opengroupinvitation; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.openGroupInvitation) } -inline void ConfigurationMessage_ClosedGroup::add_members(const void* value, size_t size) { - _impl_.members_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:SessionProtos.ConfigurationMessage.ClosedGroup.members) + +// optional .SessionProtos.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; +inline bool DataMessage::_internal_has_closedgroupcontrolmessage() const { + bool value = (_impl_._has_bits_[0] & 0x00000080u) != 0; + PROTOBUF_ASSUME(!value || _impl_.closedgroupcontrolmessage_ != nullptr); + return value; } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -ConfigurationMessage_ClosedGroup::members() const { - // @@protoc_insertion_point(field_list:SessionProtos.ConfigurationMessage.ClosedGroup.members) - return _impl_.members_; +inline bool DataMessage::has_closedgroupcontrolmessage() const { + return _internal_has_closedgroupcontrolmessage(); } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -ConfigurationMessage_ClosedGroup::mutable_members() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.ConfigurationMessage.ClosedGroup.members) - return &_impl_.members_; +inline void DataMessage::clear_closedgroupcontrolmessage() { + if (_impl_.closedgroupcontrolmessage_ != nullptr) _impl_.closedgroupcontrolmessage_->Clear(); + _impl_._has_bits_[0] &= ~0x00000080u; } - -// repeated bytes admins = 5; -inline int ConfigurationMessage_ClosedGroup::_internal_admins_size() const { - return _impl_.admins_.size(); +inline const ::SessionProtos::DataMessage_ClosedGroupControlMessage& DataMessage::_internal_closedgroupcontrolmessage() const { + const ::SessionProtos::DataMessage_ClosedGroupControlMessage* p = _impl_.closedgroupcontrolmessage_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_DataMessage_ClosedGroupControlMessage_default_instance_); } -inline int ConfigurationMessage_ClosedGroup::admins_size() const { - return _internal_admins_size(); +inline const ::SessionProtos::DataMessage_ClosedGroupControlMessage& DataMessage::closedgroupcontrolmessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.closedGroupControlMessage) + return _internal_closedgroupcontrolmessage(); } -inline void ConfigurationMessage_ClosedGroup::clear_admins() { - _impl_.admins_.Clear(); +inline void DataMessage::unsafe_arena_set_allocated_closedgroupcontrolmessage( + ::SessionProtos::DataMessage_ClosedGroupControlMessage* closedgroupcontrolmessage) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.closedgroupcontrolmessage_); + } + _impl_.closedgroupcontrolmessage_ = closedgroupcontrolmessage; + if (closedgroupcontrolmessage) { + _impl_._has_bits_[0] |= 0x00000080u; + } else { + _impl_._has_bits_[0] &= ~0x00000080u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.DataMessage.closedGroupControlMessage) } -inline std::string* ConfigurationMessage_ClosedGroup::add_admins() { - std::string* _s = _internal_add_admins(); - // @@protoc_insertion_point(field_add_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.admins) - return _s; +inline ::SessionProtos::DataMessage_ClosedGroupControlMessage* DataMessage::release_closedgroupcontrolmessage() { + _impl_._has_bits_[0] &= ~0x00000080u; + ::SessionProtos::DataMessage_ClosedGroupControlMessage* temp = _impl_.closedgroupcontrolmessage_; + _impl_.closedgroupcontrolmessage_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; } -inline const std::string& ConfigurationMessage_ClosedGroup::_internal_admins(int index) const { - return _impl_.admins_.Get(index); +inline ::SessionProtos::DataMessage_ClosedGroupControlMessage* DataMessage::unsafe_arena_release_closedgroupcontrolmessage() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.closedGroupControlMessage) + _impl_._has_bits_[0] &= ~0x00000080u; + ::SessionProtos::DataMessage_ClosedGroupControlMessage* temp = _impl_.closedgroupcontrolmessage_; + _impl_.closedgroupcontrolmessage_ = nullptr; + return temp; } -inline const std::string& ConfigurationMessage_ClosedGroup::admins(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ClosedGroup.admins) - return _internal_admins(index); +inline ::SessionProtos::DataMessage_ClosedGroupControlMessage* DataMessage::_internal_mutable_closedgroupcontrolmessage() { + _impl_._has_bits_[0] |= 0x00000080u; + if (_impl_.closedgroupcontrolmessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::DataMessage_ClosedGroupControlMessage>(GetArenaForAllocation()); + _impl_.closedgroupcontrolmessage_ = p; + } + return _impl_.closedgroupcontrolmessage_; } -inline std::string* ConfigurationMessage_ClosedGroup::mutable_admins(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.admins) - return _impl_.admins_.Mutable(index); +inline ::SessionProtos::DataMessage_ClosedGroupControlMessage* DataMessage::mutable_closedgroupcontrolmessage() { + ::SessionProtos::DataMessage_ClosedGroupControlMessage* _msg = _internal_mutable_closedgroupcontrolmessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.closedGroupControlMessage) + return _msg; } -inline void ConfigurationMessage_ClosedGroup::set_admins(int index, const std::string& value) { - _impl_.admins_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.admins) +inline void DataMessage::set_allocated_closedgroupcontrolmessage(::SessionProtos::DataMessage_ClosedGroupControlMessage* closedgroupcontrolmessage) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.closedgroupcontrolmessage_; + } + if (closedgroupcontrolmessage) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(closedgroupcontrolmessage); + if (message_arena != submessage_arena) { + closedgroupcontrolmessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, closedgroupcontrolmessage, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000080u; + } else { + _impl_._has_bits_[0] &= ~0x00000080u; + } + _impl_.closedgroupcontrolmessage_ = closedgroupcontrolmessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.closedGroupControlMessage) } -inline void ConfigurationMessage_ClosedGroup::set_admins(int index, std::string&& value) { - _impl_.admins_.Mutable(index)->assign(std::move(value)); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.admins) + +// optional string syncTarget = 105; +inline bool DataMessage::_internal_has_synctarget() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; } -inline void ConfigurationMessage_ClosedGroup::set_admins(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.admins_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:SessionProtos.ConfigurationMessage.ClosedGroup.admins) +inline bool DataMessage::has_synctarget() const { + return _internal_has_synctarget(); } -inline void ConfigurationMessage_ClosedGroup::set_admins(int index, const void* value, size_t size) { - _impl_.admins_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:SessionProtos.ConfigurationMessage.ClosedGroup.admins) +inline void DataMessage::clear_synctarget() { + _impl_.synctarget_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000004u; } -inline std::string* ConfigurationMessage_ClosedGroup::_internal_add_admins() { - return _impl_.admins_.Add(); +inline const std::string& DataMessage::synctarget() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.syncTarget) + return _internal_synctarget(); } -inline void ConfigurationMessage_ClosedGroup::add_admins(const std::string& value) { - _impl_.admins_.Add()->assign(value); - // @@protoc_insertion_point(field_add:SessionProtos.ConfigurationMessage.ClosedGroup.admins) +template +inline PROTOBUF_ALWAYS_INLINE +void DataMessage::set_synctarget(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.synctarget_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.syncTarget) } -inline void ConfigurationMessage_ClosedGroup::add_admins(std::string&& value) { - _impl_.admins_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:SessionProtos.ConfigurationMessage.ClosedGroup.admins) +inline std::string* DataMessage::mutable_synctarget() { + std::string* _s = _internal_mutable_synctarget(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.syncTarget) + return _s; } -inline void ConfigurationMessage_ClosedGroup::add_admins(const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.admins_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:SessionProtos.ConfigurationMessage.ClosedGroup.admins) +inline const std::string& DataMessage::_internal_synctarget() const { + return _impl_.synctarget_.Get(); } -inline void ConfigurationMessage_ClosedGroup::add_admins(const void* value, size_t size) { - _impl_.admins_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:SessionProtos.ConfigurationMessage.ClosedGroup.admins) +inline void DataMessage::_internal_set_synctarget(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.synctarget_.Set(value, GetArenaForAllocation()); } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -ConfigurationMessage_ClosedGroup::admins() const { - // @@protoc_insertion_point(field_list:SessionProtos.ConfigurationMessage.ClosedGroup.admins) - return _impl_.admins_; +inline std::string* DataMessage::_internal_mutable_synctarget() { + _impl_._has_bits_[0] |= 0x00000004u; + return _impl_.synctarget_.Mutable(GetArenaForAllocation()); } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -ConfigurationMessage_ClosedGroup::mutable_admins() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.ConfigurationMessage.ClosedGroup.admins) - return &_impl_.admins_; +inline std::string* DataMessage::release_synctarget() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.syncTarget) + if (!_internal_has_synctarget()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000004u; + auto* p = _impl_.synctarget_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.synctarget_.IsDefault()) { + _impl_.synctarget_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void DataMessage::set_allocated_synctarget(std::string* synctarget) { + if (synctarget != nullptr) { + _impl_._has_bits_[0] |= 0x00000004u; + } else { + _impl_._has_bits_[0] &= ~0x00000004u; + } + _impl_.synctarget_.SetAllocated(synctarget, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.synctarget_.IsDefault()) { + _impl_.synctarget_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.syncTarget) } -// optional uint32 expirationTimer = 6; -inline bool ConfigurationMessage_ClosedGroup::_internal_has_expirationtimer() const { - bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; +// optional bool blocksCommunityMessageRequests = 106; +inline bool DataMessage::_internal_has_blockscommunitymessagerequests() const { + bool value = (_impl_._has_bits_[0] & 0x00000800u) != 0; return value; } -inline bool ConfigurationMessage_ClosedGroup::has_expirationtimer() const { - return _internal_has_expirationtimer(); +inline bool DataMessage::has_blockscommunitymessagerequests() const { + return _internal_has_blockscommunitymessagerequests(); } -inline void ConfigurationMessage_ClosedGroup::clear_expirationtimer() { - _impl_.expirationtimer_ = 0u; - _impl_._has_bits_[0] &= ~0x00000008u; +inline void DataMessage::clear_blockscommunitymessagerequests() { + _impl_.blockscommunitymessagerequests_ = false; + _impl_._has_bits_[0] &= ~0x00000800u; } -inline uint32_t ConfigurationMessage_ClosedGroup::_internal_expirationtimer() const { - return _impl_.expirationtimer_; +inline bool DataMessage::_internal_blockscommunitymessagerequests() const { + return _impl_.blockscommunitymessagerequests_; } -inline uint32_t ConfigurationMessage_ClosedGroup::expirationtimer() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ClosedGroup.expirationTimer) - return _internal_expirationtimer(); +inline bool DataMessage::blockscommunitymessagerequests() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.blocksCommunityMessageRequests) + return _internal_blockscommunitymessagerequests(); } -inline void ConfigurationMessage_ClosedGroup::_internal_set_expirationtimer(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000008u; - _impl_.expirationtimer_ = value; +inline void DataMessage::_internal_set_blockscommunitymessagerequests(bool value) { + _impl_._has_bits_[0] |= 0x00000800u; + _impl_.blockscommunitymessagerequests_ = value; } -inline void ConfigurationMessage_ClosedGroup::set_expirationtimer(uint32_t value) { - _internal_set_expirationtimer(value); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.expirationTimer) +inline void DataMessage::set_blockscommunitymessagerequests(bool value) { + _internal_set_blockscommunitymessagerequests(value); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.blocksCommunityMessageRequests) } // ------------------------------------------------------------------- -// ConfigurationMessage_Contact +// ConfigurationMessage_ClosedGroup -// required bytes publicKey = 1; -inline bool ConfigurationMessage_Contact::_internal_has_publickey() const { +// optional bytes publicKey = 1; +inline bool ConfigurationMessage_ClosedGroup::_internal_has_publickey() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool ConfigurationMessage_Contact::has_publickey() const { +inline bool ConfigurationMessage_ClosedGroup::has_publickey() const { return _internal_has_publickey(); } -inline void ConfigurationMessage_Contact::clear_publickey() { +inline void ConfigurationMessage_ClosedGroup::clear_publickey() { _impl_.publickey_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& ConfigurationMessage_Contact::publickey() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.publicKey) +inline const std::string& ConfigurationMessage_ClosedGroup::publickey() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ClosedGroup.publicKey) return _internal_publickey(); } template inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage_Contact::set_publickey(ArgT0&& arg0, ArgT... args) { +void ConfigurationMessage_ClosedGroup::set_publickey(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000001u; _impl_.publickey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.publicKey) + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.publicKey) } -inline std::string* ConfigurationMessage_Contact::mutable_publickey() { +inline std::string* ConfigurationMessage_ClosedGroup::mutable_publickey() { std::string* _s = _internal_mutable_publickey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.Contact.publicKey) + // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.publicKey) return _s; } -inline const std::string& ConfigurationMessage_Contact::_internal_publickey() const { +inline const std::string& ConfigurationMessage_ClosedGroup::_internal_publickey() const { return _impl_.publickey_.Get(); } -inline void ConfigurationMessage_Contact::_internal_set_publickey(const std::string& value) { +inline void ConfigurationMessage_ClosedGroup::_internal_set_publickey(const std::string& value) { _impl_._has_bits_[0] |= 0x00000001u; _impl_.publickey_.Set(value, GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_Contact::_internal_mutable_publickey() { +inline std::string* ConfigurationMessage_ClosedGroup::_internal_mutable_publickey() { _impl_._has_bits_[0] |= 0x00000001u; return _impl_.publickey_.Mutable(GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_Contact::release_publickey() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.Contact.publicKey) +inline std::string* ConfigurationMessage_ClosedGroup::release_publickey() { + // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.ClosedGroup.publicKey) if (!_internal_has_publickey()) { return nullptr; } @@ -11160,7 +11577,7 @@ inline std::string* ConfigurationMessage_Contact::release_publickey() { #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void ConfigurationMessage_Contact::set_allocated_publickey(std::string* publickey) { +inline void ConfigurationMessage_ClosedGroup::set_allocated_publickey(std::string* publickey) { if (publickey != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; } else { @@ -11172,50 +11589,50 @@ inline void ConfigurationMessage_Contact::set_allocated_publickey(std::string* p _impl_.publickey_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.Contact.publicKey) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.ClosedGroup.publicKey) } -// required string name = 2; -inline bool ConfigurationMessage_Contact::_internal_has_name() const { +// optional string name = 2; +inline bool ConfigurationMessage_ClosedGroup::_internal_has_name() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } -inline bool ConfigurationMessage_Contact::has_name() const { +inline bool ConfigurationMessage_ClosedGroup::has_name() const { return _internal_has_name(); } -inline void ConfigurationMessage_Contact::clear_name() { +inline void ConfigurationMessage_ClosedGroup::clear_name() { _impl_.name_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000002u; } -inline const std::string& ConfigurationMessage_Contact::name() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.name) +inline const std::string& ConfigurationMessage_ClosedGroup::name() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ClosedGroup.name) return _internal_name(); } template inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage_Contact::set_name(ArgT0&& arg0, ArgT... args) { +void ConfigurationMessage_ClosedGroup::set_name(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000002u; _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.name) + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.name) } -inline std::string* ConfigurationMessage_Contact::mutable_name() { +inline std::string* ConfigurationMessage_ClosedGroup::mutable_name() { std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.Contact.name) + // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.name) return _s; } -inline const std::string& ConfigurationMessage_Contact::_internal_name() const { +inline const std::string& ConfigurationMessage_ClosedGroup::_internal_name() const { return _impl_.name_.Get(); } -inline void ConfigurationMessage_Contact::_internal_set_name(const std::string& value) { +inline void ConfigurationMessage_ClosedGroup::_internal_set_name(const std::string& value) { _impl_._has_bits_[0] |= 0x00000002u; _impl_.name_.Set(value, GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_Contact::_internal_mutable_name() { +inline std::string* ConfigurationMessage_ClosedGroup::_internal_mutable_name() { _impl_._has_bits_[0] |= 0x00000002u; return _impl_.name_.Mutable(GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_Contact::release_name() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.Contact.name) +inline std::string* ConfigurationMessage_ClosedGroup::release_name() { + // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.ClosedGroup.name) if (!_internal_has_name()) { return nullptr; } @@ -11228,7 +11645,7 @@ inline std::string* ConfigurationMessage_Contact::release_name() { #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void ConfigurationMessage_Contact::set_allocated_name(std::string* name) { +inline void ConfigurationMessage_ClosedGroup::set_allocated_name(std::string* name) { if (name != nullptr) { _impl_._has_bits_[0] |= 0x00000002u; } else { @@ -11240,631 +11657,635 @@ inline void ConfigurationMessage_Contact::set_allocated_name(std::string* name) _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.Contact.name) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.ClosedGroup.name) } -// optional string profilePicture = 3; -inline bool ConfigurationMessage_Contact::_internal_has_profilepicture() const { +// optional .SessionProtos.KeyPair encryptionKeyPair = 3; +inline bool ConfigurationMessage_ClosedGroup::_internal_has_encryptionkeypair() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + PROTOBUF_ASSUME(!value || _impl_.encryptionkeypair_ != nullptr); return value; } -inline bool ConfigurationMessage_Contact::has_profilepicture() const { - return _internal_has_profilepicture(); +inline bool ConfigurationMessage_ClosedGroup::has_encryptionkeypair() const { + return _internal_has_encryptionkeypair(); } -inline void ConfigurationMessage_Contact::clear_profilepicture() { - _impl_.profilepicture_.ClearToEmpty(); +inline void ConfigurationMessage_ClosedGroup::clear_encryptionkeypair() { + if (_impl_.encryptionkeypair_ != nullptr) _impl_.encryptionkeypair_->Clear(); _impl_._has_bits_[0] &= ~0x00000004u; } -inline const std::string& ConfigurationMessage_Contact::profilepicture() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.profilePicture) - return _internal_profilepicture(); +inline const ::SessionProtos::KeyPair& ConfigurationMessage_ClosedGroup::_internal_encryptionkeypair() const { + const ::SessionProtos::KeyPair* p = _impl_.encryptionkeypair_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_KeyPair_default_instance_); } -template -inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage_Contact::set_profilepicture(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.profilepicture_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.profilePicture) +inline const ::SessionProtos::KeyPair& ConfigurationMessage_ClosedGroup::encryptionkeypair() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ClosedGroup.encryptionKeyPair) + return _internal_encryptionkeypair(); } -inline std::string* ConfigurationMessage_Contact::mutable_profilepicture() { - std::string* _s = _internal_mutable_profilepicture(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.Contact.profilePicture) - return _s; +inline void ConfigurationMessage_ClosedGroup::unsafe_arena_set_allocated_encryptionkeypair( + ::SessionProtos::KeyPair* encryptionkeypair) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.encryptionkeypair_); + } + _impl_.encryptionkeypair_ = encryptionkeypair; + if (encryptionkeypair) { + _impl_._has_bits_[0] |= 0x00000004u; + } else { + _impl_._has_bits_[0] &= ~0x00000004u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.ConfigurationMessage.ClosedGroup.encryptionKeyPair) } -inline const std::string& ConfigurationMessage_Contact::_internal_profilepicture() const { - return _impl_.profilepicture_.Get(); +inline ::SessionProtos::KeyPair* ConfigurationMessage_ClosedGroup::release_encryptionkeypair() { + _impl_._has_bits_[0] &= ~0x00000004u; + ::SessionProtos::KeyPair* temp = _impl_.encryptionkeypair_; + _impl_.encryptionkeypair_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; } -inline void ConfigurationMessage_Contact::_internal_set_profilepicture(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.profilepicture_.Set(value, GetArenaForAllocation()); +inline ::SessionProtos::KeyPair* ConfigurationMessage_ClosedGroup::unsafe_arena_release_encryptionkeypair() { + // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.ClosedGroup.encryptionKeyPair) + _impl_._has_bits_[0] &= ~0x00000004u; + ::SessionProtos::KeyPair* temp = _impl_.encryptionkeypair_; + _impl_.encryptionkeypair_ = nullptr; + return temp; } -inline std::string* ConfigurationMessage_Contact::_internal_mutable_profilepicture() { +inline ::SessionProtos::KeyPair* ConfigurationMessage_ClosedGroup::_internal_mutable_encryptionkeypair() { _impl_._has_bits_[0] |= 0x00000004u; - return _impl_.profilepicture_.Mutable(GetArenaForAllocation()); -} -inline std::string* ConfigurationMessage_Contact::release_profilepicture() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.Contact.profilePicture) - if (!_internal_has_profilepicture()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000004u; - auto* p = _impl_.profilepicture_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilepicture_.IsDefault()) { - _impl_.profilepicture_.Set("", GetArenaForAllocation()); + if (_impl_.encryptionkeypair_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::KeyPair>(GetArenaForAllocation()); + _impl_.encryptionkeypair_ = p; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; + return _impl_.encryptionkeypair_; } -inline void ConfigurationMessage_Contact::set_allocated_profilepicture(std::string* profilepicture) { - if (profilepicture != nullptr) { +inline ::SessionProtos::KeyPair* ConfigurationMessage_ClosedGroup::mutable_encryptionkeypair() { + ::SessionProtos::KeyPair* _msg = _internal_mutable_encryptionkeypair(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.encryptionKeyPair) + return _msg; +} +inline void ConfigurationMessage_ClosedGroup::set_allocated_encryptionkeypair(::SessionProtos::KeyPair* encryptionkeypair) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.encryptionkeypair_; + } + if (encryptionkeypair) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(encryptionkeypair); + if (message_arena != submessage_arena) { + encryptionkeypair = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, encryptionkeypair, submessage_arena); + } _impl_._has_bits_[0] |= 0x00000004u; } else { _impl_._has_bits_[0] &= ~0x00000004u; } - _impl_.profilepicture_.SetAllocated(profilepicture, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilepicture_.IsDefault()) { - _impl_.profilepicture_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.Contact.profilePicture) + _impl_.encryptionkeypair_ = encryptionkeypair; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.ClosedGroup.encryptionKeyPair) } -// optional bytes profileKey = 4; -inline bool ConfigurationMessage_Contact::_internal_has_profilekey() const { - bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; - return value; -} -inline bool ConfigurationMessage_Contact::has_profilekey() const { - return _internal_has_profilekey(); -} -inline void ConfigurationMessage_Contact::clear_profilekey() { - _impl_.profilekey_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000008u; +// repeated bytes members = 4; +inline int ConfigurationMessage_ClosedGroup::_internal_members_size() const { + return _impl_.members_.size(); } -inline const std::string& ConfigurationMessage_Contact::profilekey() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.profileKey) - return _internal_profilekey(); +inline int ConfigurationMessage_ClosedGroup::members_size() const { + return _internal_members_size(); } -template -inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage_Contact::set_profilekey(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000008u; - _impl_.profilekey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.profileKey) +inline void ConfigurationMessage_ClosedGroup::clear_members() { + _impl_.members_.Clear(); } -inline std::string* ConfigurationMessage_Contact::mutable_profilekey() { - std::string* _s = _internal_mutable_profilekey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.Contact.profileKey) +inline std::string* ConfigurationMessage_ClosedGroup::add_members() { + std::string* _s = _internal_add_members(); + // @@protoc_insertion_point(field_add_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.members) return _s; } -inline const std::string& ConfigurationMessage_Contact::_internal_profilekey() const { - return _impl_.profilekey_.Get(); +inline const std::string& ConfigurationMessage_ClosedGroup::_internal_members(int index) const { + return _impl_.members_.Get(index); } -inline void ConfigurationMessage_Contact::_internal_set_profilekey(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000008u; - _impl_.profilekey_.Set(value, GetArenaForAllocation()); +inline const std::string& ConfigurationMessage_ClosedGroup::members(int index) const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ClosedGroup.members) + return _internal_members(index); } -inline std::string* ConfigurationMessage_Contact::_internal_mutable_profilekey() { - _impl_._has_bits_[0] |= 0x00000008u; - return _impl_.profilekey_.Mutable(GetArenaForAllocation()); +inline std::string* ConfigurationMessage_ClosedGroup::mutable_members(int index) { + // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.members) + return _impl_.members_.Mutable(index); } -inline std::string* ConfigurationMessage_Contact::release_profilekey() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.Contact.profileKey) - if (!_internal_has_profilekey()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000008u; - auto* p = _impl_.profilekey_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilekey_.IsDefault()) { - _impl_.profilekey_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; +inline void ConfigurationMessage_ClosedGroup::set_members(int index, const std::string& value) { + _impl_.members_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.members) } -inline void ConfigurationMessage_Contact::set_allocated_profilekey(std::string* profilekey) { - if (profilekey != nullptr) { - _impl_._has_bits_[0] |= 0x00000008u; - } else { - _impl_._has_bits_[0] &= ~0x00000008u; - } - _impl_.profilekey_.SetAllocated(profilekey, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilekey_.IsDefault()) { - _impl_.profilekey_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.Contact.profileKey) +inline void ConfigurationMessage_ClosedGroup::set_members(int index, std::string&& value) { + _impl_.members_.Mutable(index)->assign(std::move(value)); + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.members) } - -// optional bool isApproved = 5; -inline bool ConfigurationMessage_Contact::_internal_has_isapproved() const { - bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; - return value; +inline void ConfigurationMessage_ClosedGroup::set_members(int index, const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.members_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:SessionProtos.ConfigurationMessage.ClosedGroup.members) +} +inline void ConfigurationMessage_ClosedGroup::set_members(int index, const void* value, size_t size) { + _impl_.members_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:SessionProtos.ConfigurationMessage.ClosedGroup.members) } -inline bool ConfigurationMessage_Contact::has_isapproved() const { - return _internal_has_isapproved(); +inline std::string* ConfigurationMessage_ClosedGroup::_internal_add_members() { + return _impl_.members_.Add(); } -inline void ConfigurationMessage_Contact::clear_isapproved() { - _impl_.isapproved_ = false; - _impl_._has_bits_[0] &= ~0x00000010u; +inline void ConfigurationMessage_ClosedGroup::add_members(const std::string& value) { + _impl_.members_.Add()->assign(value); + // @@protoc_insertion_point(field_add:SessionProtos.ConfigurationMessage.ClosedGroup.members) } -inline bool ConfigurationMessage_Contact::_internal_isapproved() const { - return _impl_.isapproved_; +inline void ConfigurationMessage_ClosedGroup::add_members(std::string&& value) { + _impl_.members_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:SessionProtos.ConfigurationMessage.ClosedGroup.members) } -inline bool ConfigurationMessage_Contact::isapproved() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.isApproved) - return _internal_isapproved(); +inline void ConfigurationMessage_ClosedGroup::add_members(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.members_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:SessionProtos.ConfigurationMessage.ClosedGroup.members) } -inline void ConfigurationMessage_Contact::_internal_set_isapproved(bool value) { - _impl_._has_bits_[0] |= 0x00000010u; - _impl_.isapproved_ = value; +inline void ConfigurationMessage_ClosedGroup::add_members(const void* value, size_t size) { + _impl_.members_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:SessionProtos.ConfigurationMessage.ClosedGroup.members) } -inline void ConfigurationMessage_Contact::set_isapproved(bool value) { - _internal_set_isapproved(value); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.isApproved) +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& +ConfigurationMessage_ClosedGroup::members() const { + // @@protoc_insertion_point(field_list:SessionProtos.ConfigurationMessage.ClosedGroup.members) + return _impl_.members_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* +ConfigurationMessage_ClosedGroup::mutable_members() { + // @@protoc_insertion_point(field_mutable_list:SessionProtos.ConfigurationMessage.ClosedGroup.members) + return &_impl_.members_; } -// optional bool isBlocked = 6; -inline bool ConfigurationMessage_Contact::_internal_has_isblocked() const { - bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; - return value; +// repeated bytes admins = 5; +inline int ConfigurationMessage_ClosedGroup::_internal_admins_size() const { + return _impl_.admins_.size(); } -inline bool ConfigurationMessage_Contact::has_isblocked() const { - return _internal_has_isblocked(); +inline int ConfigurationMessage_ClosedGroup::admins_size() const { + return _internal_admins_size(); } -inline void ConfigurationMessage_Contact::clear_isblocked() { - _impl_.isblocked_ = false; - _impl_._has_bits_[0] &= ~0x00000020u; +inline void ConfigurationMessage_ClosedGroup::clear_admins() { + _impl_.admins_.Clear(); } -inline bool ConfigurationMessage_Contact::_internal_isblocked() const { - return _impl_.isblocked_; +inline std::string* ConfigurationMessage_ClosedGroup::add_admins() { + std::string* _s = _internal_add_admins(); + // @@protoc_insertion_point(field_add_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.admins) + return _s; } -inline bool ConfigurationMessage_Contact::isblocked() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.isBlocked) - return _internal_isblocked(); +inline const std::string& ConfigurationMessage_ClosedGroup::_internal_admins(int index) const { + return _impl_.admins_.Get(index); } -inline void ConfigurationMessage_Contact::_internal_set_isblocked(bool value) { - _impl_._has_bits_[0] |= 0x00000020u; - _impl_.isblocked_ = value; +inline const std::string& ConfigurationMessage_ClosedGroup::admins(int index) const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ClosedGroup.admins) + return _internal_admins(index); } -inline void ConfigurationMessage_Contact::set_isblocked(bool value) { - _internal_set_isblocked(value); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.isBlocked) +inline std::string* ConfigurationMessage_ClosedGroup::mutable_admins(int index) { + // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.admins) + return _impl_.admins_.Mutable(index); } - -// optional bool didApproveMe = 7; -inline bool ConfigurationMessage_Contact::_internal_has_didapproveme() const { - bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; - return value; +inline void ConfigurationMessage_ClosedGroup::set_admins(int index, const std::string& value) { + _impl_.admins_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.admins) } -inline bool ConfigurationMessage_Contact::has_didapproveme() const { - return _internal_has_didapproveme(); +inline void ConfigurationMessage_ClosedGroup::set_admins(int index, std::string&& value) { + _impl_.admins_.Mutable(index)->assign(std::move(value)); + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.admins) } -inline void ConfigurationMessage_Contact::clear_didapproveme() { - _impl_.didapproveme_ = false; - _impl_._has_bits_[0] &= ~0x00000040u; +inline void ConfigurationMessage_ClosedGroup::set_admins(int index, const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.admins_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:SessionProtos.ConfigurationMessage.ClosedGroup.admins) } -inline bool ConfigurationMessage_Contact::_internal_didapproveme() const { - return _impl_.didapproveme_; +inline void ConfigurationMessage_ClosedGroup::set_admins(int index, const void* value, size_t size) { + _impl_.admins_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:SessionProtos.ConfigurationMessage.ClosedGroup.admins) } -inline bool ConfigurationMessage_Contact::didapproveme() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.didApproveMe) - return _internal_didapproveme(); +inline std::string* ConfigurationMessage_ClosedGroup::_internal_add_admins() { + return _impl_.admins_.Add(); } -inline void ConfigurationMessage_Contact::_internal_set_didapproveme(bool value) { - _impl_._has_bits_[0] |= 0x00000040u; - _impl_.didapproveme_ = value; +inline void ConfigurationMessage_ClosedGroup::add_admins(const std::string& value) { + _impl_.admins_.Add()->assign(value); + // @@protoc_insertion_point(field_add:SessionProtos.ConfigurationMessage.ClosedGroup.admins) } -inline void ConfigurationMessage_Contact::set_didapproveme(bool value) { - _internal_set_didapproveme(value); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.didApproveMe) +inline void ConfigurationMessage_ClosedGroup::add_admins(std::string&& value) { + _impl_.admins_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:SessionProtos.ConfigurationMessage.ClosedGroup.admins) +} +inline void ConfigurationMessage_ClosedGroup::add_admins(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.admins_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:SessionProtos.ConfigurationMessage.ClosedGroup.admins) +} +inline void ConfigurationMessage_ClosedGroup::add_admins(const void* value, size_t size) { + _impl_.admins_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:SessionProtos.ConfigurationMessage.ClosedGroup.admins) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& +ConfigurationMessage_ClosedGroup::admins() const { + // @@protoc_insertion_point(field_list:SessionProtos.ConfigurationMessage.ClosedGroup.admins) + return _impl_.admins_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* +ConfigurationMessage_ClosedGroup::mutable_admins() { + // @@protoc_insertion_point(field_mutable_list:SessionProtos.ConfigurationMessage.ClosedGroup.admins) + return &_impl_.admins_; } -// ------------------------------------------------------------------- - -// ConfigurationMessage_ProProof - -// required uint32 version = 1; -inline bool ConfigurationMessage_ProProof::_internal_has_version() const { - bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; +// optional uint32 expirationTimer = 6; +inline bool ConfigurationMessage_ClosedGroup::_internal_has_expirationtimer() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; return value; } -inline bool ConfigurationMessage_ProProof::has_version() const { - return _internal_has_version(); +inline bool ConfigurationMessage_ClosedGroup::has_expirationtimer() const { + return _internal_has_expirationtimer(); } -inline void ConfigurationMessage_ProProof::clear_version() { - _impl_.version_ = 0u; - _impl_._has_bits_[0] &= ~0x00000010u; +inline void ConfigurationMessage_ClosedGroup::clear_expirationtimer() { + _impl_.expirationtimer_ = 0u; + _impl_._has_bits_[0] &= ~0x00000008u; } -inline uint32_t ConfigurationMessage_ProProof::_internal_version() const { - return _impl_.version_; +inline uint32_t ConfigurationMessage_ClosedGroup::_internal_expirationtimer() const { + return _impl_.expirationtimer_; } -inline uint32_t ConfigurationMessage_ProProof::version() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ProProof.version) - return _internal_version(); +inline uint32_t ConfigurationMessage_ClosedGroup::expirationtimer() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ClosedGroup.expirationTimer) + return _internal_expirationtimer(); } -inline void ConfigurationMessage_ProProof::_internal_set_version(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000010u; - _impl_.version_ = value; +inline void ConfigurationMessage_ClosedGroup::_internal_set_expirationtimer(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.expirationtimer_ = value; } -inline void ConfigurationMessage_ProProof::set_version(uint32_t value) { - _internal_set_version(value); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ProProof.version) +inline void ConfigurationMessage_ClosedGroup::set_expirationtimer(uint32_t value) { + _internal_set_expirationtimer(value); + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.expirationTimer) } -// required bytes genIndexHash = 2; -inline bool ConfigurationMessage_ProProof::_internal_has_genindexhash() const { +// ------------------------------------------------------------------- + +// ConfigurationMessage_Contact + +// required bytes publicKey = 1; +inline bool ConfigurationMessage_Contact::_internal_has_publickey() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool ConfigurationMessage_ProProof::has_genindexhash() const { - return _internal_has_genindexhash(); +inline bool ConfigurationMessage_Contact::has_publickey() const { + return _internal_has_publickey(); } -inline void ConfigurationMessage_ProProof::clear_genindexhash() { - _impl_.genindexhash_.ClearToEmpty(); +inline void ConfigurationMessage_Contact::clear_publickey() { + _impl_.publickey_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& ConfigurationMessage_ProProof::genindexhash() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ProProof.genIndexHash) - return _internal_genindexhash(); +inline const std::string& ConfigurationMessage_Contact::publickey() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.publicKey) + return _internal_publickey(); } template inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage_ProProof::set_genindexhash(ArgT0&& arg0, ArgT... args) { +void ConfigurationMessage_Contact::set_publickey(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.genindexhash_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ProProof.genIndexHash) + _impl_.publickey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.publicKey) } -inline std::string* ConfigurationMessage_ProProof::mutable_genindexhash() { - std::string* _s = _internal_mutable_genindexhash(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ProProof.genIndexHash) +inline std::string* ConfigurationMessage_Contact::mutable_publickey() { + std::string* _s = _internal_mutable_publickey(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.Contact.publicKey) return _s; } -inline const std::string& ConfigurationMessage_ProProof::_internal_genindexhash() const { - return _impl_.genindexhash_.Get(); +inline const std::string& ConfigurationMessage_Contact::_internal_publickey() const { + return _impl_.publickey_.Get(); } -inline void ConfigurationMessage_ProProof::_internal_set_genindexhash(const std::string& value) { +inline void ConfigurationMessage_Contact::_internal_set_publickey(const std::string& value) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.genindexhash_.Set(value, GetArenaForAllocation()); + _impl_.publickey_.Set(value, GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_ProProof::_internal_mutable_genindexhash() { +inline std::string* ConfigurationMessage_Contact::_internal_mutable_publickey() { _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.genindexhash_.Mutable(GetArenaForAllocation()); + return _impl_.publickey_.Mutable(GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_ProProof::release_genindexhash() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.ProProof.genIndexHash) - if (!_internal_has_genindexhash()) { +inline std::string* ConfigurationMessage_Contact::release_publickey() { + // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.Contact.publicKey) + if (!_internal_has_publickey()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.genindexhash_.Release(); + auto* p = _impl_.publickey_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.genindexhash_.IsDefault()) { - _impl_.genindexhash_.Set("", GetArenaForAllocation()); + if (_impl_.publickey_.IsDefault()) { + _impl_.publickey_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void ConfigurationMessage_ProProof::set_allocated_genindexhash(std::string* genindexhash) { - if (genindexhash != nullptr) { +inline void ConfigurationMessage_Contact::set_allocated_publickey(std::string* publickey) { + if (publickey != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; } else { _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.genindexhash_.SetAllocated(genindexhash, GetArenaForAllocation()); + _impl_.publickey_.SetAllocated(publickey, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.genindexhash_.IsDefault()) { - _impl_.genindexhash_.Set("", GetArenaForAllocation()); + if (_impl_.publickey_.IsDefault()) { + _impl_.publickey_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.ProProof.genIndexHash) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.Contact.publicKey) } -// required bytes rotatingPublicKey = 3; -inline bool ConfigurationMessage_ProProof::_internal_has_rotatingpublickey() const { +// required string name = 2; +inline bool ConfigurationMessage_Contact::_internal_has_name() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } -inline bool ConfigurationMessage_ProProof::has_rotatingpublickey() const { - return _internal_has_rotatingpublickey(); +inline bool ConfigurationMessage_Contact::has_name() const { + return _internal_has_name(); } -inline void ConfigurationMessage_ProProof::clear_rotatingpublickey() { - _impl_.rotatingpublickey_.ClearToEmpty(); +inline void ConfigurationMessage_Contact::clear_name() { + _impl_.name_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000002u; } -inline const std::string& ConfigurationMessage_ProProof::rotatingpublickey() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ProProof.rotatingPublicKey) - return _internal_rotatingpublickey(); +inline const std::string& ConfigurationMessage_Contact::name() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.name) + return _internal_name(); } template inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage_ProProof::set_rotatingpublickey(ArgT0&& arg0, ArgT... args) { +void ConfigurationMessage_Contact::set_name(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.rotatingpublickey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ProProof.rotatingPublicKey) + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.name) } -inline std::string* ConfigurationMessage_ProProof::mutable_rotatingpublickey() { - std::string* _s = _internal_mutable_rotatingpublickey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ProProof.rotatingPublicKey) +inline std::string* ConfigurationMessage_Contact::mutable_name() { + std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.Contact.name) return _s; } -inline const std::string& ConfigurationMessage_ProProof::_internal_rotatingpublickey() const { - return _impl_.rotatingpublickey_.Get(); +inline const std::string& ConfigurationMessage_Contact::_internal_name() const { + return _impl_.name_.Get(); } -inline void ConfigurationMessage_ProProof::_internal_set_rotatingpublickey(const std::string& value) { +inline void ConfigurationMessage_Contact::_internal_set_name(const std::string& value) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.rotatingpublickey_.Set(value, GetArenaForAllocation()); + _impl_.name_.Set(value, GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_ProProof::_internal_mutable_rotatingpublickey() { +inline std::string* ConfigurationMessage_Contact::_internal_mutable_name() { _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.rotatingpublickey_.Mutable(GetArenaForAllocation()); + return _impl_.name_.Mutable(GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_ProProof::release_rotatingpublickey() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.ProProof.rotatingPublicKey) - if (!_internal_has_rotatingpublickey()) { +inline std::string* ConfigurationMessage_Contact::release_name() { + // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.Contact.name) + if (!_internal_has_name()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.rotatingpublickey_.Release(); + auto* p = _impl_.name_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.rotatingpublickey_.IsDefault()) { - _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void ConfigurationMessage_ProProof::set_allocated_rotatingpublickey(std::string* rotatingpublickey) { - if (rotatingpublickey != nullptr) { +inline void ConfigurationMessage_Contact::set_allocated_name(std::string* name) { + if (name != nullptr) { _impl_._has_bits_[0] |= 0x00000002u; } else { _impl_._has_bits_[0] &= ~0x00000002u; } - _impl_.rotatingpublickey_.SetAllocated(rotatingpublickey, GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.rotatingpublickey_.IsDefault()) { - _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.ProProof.rotatingPublicKey) -} - -// required uint64 expiryUnixTs = 4; -inline bool ConfigurationMessage_ProProof::_internal_has_expiryunixts() const { - bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; - return value; -} -inline bool ConfigurationMessage_ProProof::has_expiryunixts() const { - return _internal_has_expiryunixts(); -} -inline void ConfigurationMessage_ProProof::clear_expiryunixts() { - _impl_.expiryunixts_ = uint64_t{0u}; - _impl_._has_bits_[0] &= ~0x00000008u; -} -inline uint64_t ConfigurationMessage_ProProof::_internal_expiryunixts() const { - return _impl_.expiryunixts_; -} -inline uint64_t ConfigurationMessage_ProProof::expiryunixts() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ProProof.expiryUnixTs) - return _internal_expiryunixts(); -} -inline void ConfigurationMessage_ProProof::_internal_set_expiryunixts(uint64_t value) { - _impl_._has_bits_[0] |= 0x00000008u; - _impl_.expiryunixts_ = value; -} -inline void ConfigurationMessage_ProProof::set_expiryunixts(uint64_t value) { - _internal_set_expiryunixts(value); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ProProof.expiryUnixTs) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.Contact.name) } -// required bytes sig = 5; -inline bool ConfigurationMessage_ProProof::_internal_has_sig() const { +// optional string profilePicture = 3; +inline bool ConfigurationMessage_Contact::_internal_has_profilepicture() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } -inline bool ConfigurationMessage_ProProof::has_sig() const { - return _internal_has_sig(); +inline bool ConfigurationMessage_Contact::has_profilepicture() const { + return _internal_has_profilepicture(); } -inline void ConfigurationMessage_ProProof::clear_sig() { - _impl_.sig_.ClearToEmpty(); +inline void ConfigurationMessage_Contact::clear_profilepicture() { + _impl_.profilepicture_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000004u; } -inline const std::string& ConfigurationMessage_ProProof::sig() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ProProof.sig) - return _internal_sig(); +inline const std::string& ConfigurationMessage_Contact::profilepicture() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.profilePicture) + return _internal_profilepicture(); } template inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage_ProProof::set_sig(ArgT0&& arg0, ArgT... args) { +void ConfigurationMessage_Contact::set_profilepicture(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000004u; - _impl_.sig_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ProProof.sig) + _impl_.profilepicture_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.profilePicture) } -inline std::string* ConfigurationMessage_ProProof::mutable_sig() { - std::string* _s = _internal_mutable_sig(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ProProof.sig) +inline std::string* ConfigurationMessage_Contact::mutable_profilepicture() { + std::string* _s = _internal_mutable_profilepicture(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.Contact.profilePicture) return _s; } -inline const std::string& ConfigurationMessage_ProProof::_internal_sig() const { - return _impl_.sig_.Get(); +inline const std::string& ConfigurationMessage_Contact::_internal_profilepicture() const { + return _impl_.profilepicture_.Get(); } -inline void ConfigurationMessage_ProProof::_internal_set_sig(const std::string& value) { +inline void ConfigurationMessage_Contact::_internal_set_profilepicture(const std::string& value) { _impl_._has_bits_[0] |= 0x00000004u; - _impl_.sig_.Set(value, GetArenaForAllocation()); + _impl_.profilepicture_.Set(value, GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_ProProof::_internal_mutable_sig() { +inline std::string* ConfigurationMessage_Contact::_internal_mutable_profilepicture() { _impl_._has_bits_[0] |= 0x00000004u; - return _impl_.sig_.Mutable(GetArenaForAllocation()); + return _impl_.profilepicture_.Mutable(GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_ProProof::release_sig() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.ProProof.sig) - if (!_internal_has_sig()) { +inline std::string* ConfigurationMessage_Contact::release_profilepicture() { + // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.Contact.profilePicture) + if (!_internal_has_profilepicture()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000004u; - auto* p = _impl_.sig_.Release(); + auto* p = _impl_.profilepicture_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.sig_.IsDefault()) { - _impl_.sig_.Set("", GetArenaForAllocation()); + if (_impl_.profilepicture_.IsDefault()) { + _impl_.profilepicture_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void ConfigurationMessage_ProProof::set_allocated_sig(std::string* sig) { - if (sig != nullptr) { +inline void ConfigurationMessage_Contact::set_allocated_profilepicture(std::string* profilepicture) { + if (profilepicture != nullptr) { _impl_._has_bits_[0] |= 0x00000004u; } else { _impl_._has_bits_[0] &= ~0x00000004u; } - _impl_.sig_.SetAllocated(sig, GetArenaForAllocation()); + _impl_.profilepicture_.SetAllocated(profilepicture, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.sig_.IsDefault()) { - _impl_.sig_.Set("", GetArenaForAllocation()); + if (_impl_.profilepicture_.IsDefault()) { + _impl_.profilepicture_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.ProProof.sig) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.Contact.profilePicture) } -// ------------------------------------------------------------------- - -// ConfigurationMessage_Pro - -// required bytes rotatingPrivKey = 1; -inline bool ConfigurationMessage_Pro::_internal_has_rotatingprivkey() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; +// optional bytes profileKey = 4; +inline bool ConfigurationMessage_Contact::_internal_has_profilekey() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; return value; } -inline bool ConfigurationMessage_Pro::has_rotatingprivkey() const { - return _internal_has_rotatingprivkey(); +inline bool ConfigurationMessage_Contact::has_profilekey() const { + return _internal_has_profilekey(); } -inline void ConfigurationMessage_Pro::clear_rotatingprivkey() { - _impl_.rotatingprivkey_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000001u; +inline void ConfigurationMessage_Contact::clear_profilekey() { + _impl_.profilekey_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000008u; } -inline const std::string& ConfigurationMessage_Pro::rotatingprivkey() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Pro.rotatingPrivKey) - return _internal_rotatingprivkey(); +inline const std::string& ConfigurationMessage_Contact::profilekey() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.profileKey) + return _internal_profilekey(); } template inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage_Pro::set_rotatingprivkey(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.rotatingprivkey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Pro.rotatingPrivKey) +void ConfigurationMessage_Contact::set_profilekey(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.profilekey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.profileKey) } -inline std::string* ConfigurationMessage_Pro::mutable_rotatingprivkey() { - std::string* _s = _internal_mutable_rotatingprivkey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.Pro.rotatingPrivKey) +inline std::string* ConfigurationMessage_Contact::mutable_profilekey() { + std::string* _s = _internal_mutable_profilekey(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.Contact.profileKey) return _s; } -inline const std::string& ConfigurationMessage_Pro::_internal_rotatingprivkey() const { - return _impl_.rotatingprivkey_.Get(); +inline const std::string& ConfigurationMessage_Contact::_internal_profilekey() const { + return _impl_.profilekey_.Get(); } -inline void ConfigurationMessage_Pro::_internal_set_rotatingprivkey(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.rotatingprivkey_.Set(value, GetArenaForAllocation()); +inline void ConfigurationMessage_Contact::_internal_set_profilekey(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.profilekey_.Set(value, GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_Pro::_internal_mutable_rotatingprivkey() { - _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.rotatingprivkey_.Mutable(GetArenaForAllocation()); +inline std::string* ConfigurationMessage_Contact::_internal_mutable_profilekey() { + _impl_._has_bits_[0] |= 0x00000008u; + return _impl_.profilekey_.Mutable(GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_Pro::release_rotatingprivkey() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.Pro.rotatingPrivKey) - if (!_internal_has_rotatingprivkey()) { +inline std::string* ConfigurationMessage_Contact::release_profilekey() { + // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.Contact.profileKey) + if (!_internal_has_profilekey()) { return nullptr; } - _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.rotatingprivkey_.Release(); + _impl_._has_bits_[0] &= ~0x00000008u; + auto* p = _impl_.profilekey_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.rotatingprivkey_.IsDefault()) { - _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); + if (_impl_.profilekey_.IsDefault()) { + _impl_.profilekey_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void ConfigurationMessage_Pro::set_allocated_rotatingprivkey(std::string* rotatingprivkey) { - if (rotatingprivkey != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; +inline void ConfigurationMessage_Contact::set_allocated_profilekey(std::string* profilekey) { + if (profilekey != nullptr) { + _impl_._has_bits_[0] |= 0x00000008u; } else { - _impl_._has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000008u; } - _impl_.rotatingprivkey_.SetAllocated(rotatingprivkey, GetArenaForAllocation()); + _impl_.profilekey_.SetAllocated(profilekey, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.rotatingprivkey_.IsDefault()) { - _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); + if (_impl_.profilekey_.IsDefault()) { + _impl_.profilekey_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.Pro.rotatingPrivKey) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.Contact.profileKey) } -// required bytes proof = 2; -inline bool ConfigurationMessage_Pro::_internal_has_proof() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; +// optional bool isApproved = 5; +inline bool ConfigurationMessage_Contact::_internal_has_isapproved() const { + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; return value; } -inline bool ConfigurationMessage_Pro::has_proof() const { - return _internal_has_proof(); +inline bool ConfigurationMessage_Contact::has_isapproved() const { + return _internal_has_isapproved(); } -inline void ConfigurationMessage_Pro::clear_proof() { - _impl_.proof_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000002u; +inline void ConfigurationMessage_Contact::clear_isapproved() { + _impl_.isapproved_ = false; + _impl_._has_bits_[0] &= ~0x00000010u; } -inline const std::string& ConfigurationMessage_Pro::proof() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Pro.proof) - return _internal_proof(); +inline bool ConfigurationMessage_Contact::_internal_isapproved() const { + return _impl_.isapproved_; } -template -inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage_Pro::set_proof(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.proof_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Pro.proof) +inline bool ConfigurationMessage_Contact::isapproved() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.isApproved) + return _internal_isapproved(); } -inline std::string* ConfigurationMessage_Pro::mutable_proof() { - std::string* _s = _internal_mutable_proof(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.Pro.proof) - return _s; +inline void ConfigurationMessage_Contact::_internal_set_isapproved(bool value) { + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.isapproved_ = value; } -inline const std::string& ConfigurationMessage_Pro::_internal_proof() const { - return _impl_.proof_.Get(); +inline void ConfigurationMessage_Contact::set_isapproved(bool value) { + _internal_set_isapproved(value); + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.isApproved) } -inline void ConfigurationMessage_Pro::_internal_set_proof(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.proof_.Set(value, GetArenaForAllocation()); + +// optional bool isBlocked = 6; +inline bool ConfigurationMessage_Contact::_internal_has_isblocked() const { + bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; + return value; } -inline std::string* ConfigurationMessage_Pro::_internal_mutable_proof() { - _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.proof_.Mutable(GetArenaForAllocation()); +inline bool ConfigurationMessage_Contact::has_isblocked() const { + return _internal_has_isblocked(); } -inline std::string* ConfigurationMessage_Pro::release_proof() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.Pro.proof) - if (!_internal_has_proof()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.proof_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.proof_.IsDefault()) { - _impl_.proof_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; +inline void ConfigurationMessage_Contact::clear_isblocked() { + _impl_.isblocked_ = false; + _impl_._has_bits_[0] &= ~0x00000020u; } -inline void ConfigurationMessage_Pro::set_allocated_proof(std::string* proof) { - if (proof != nullptr) { - _impl_._has_bits_[0] |= 0x00000002u; - } else { - _impl_._has_bits_[0] &= ~0x00000002u; - } - _impl_.proof_.SetAllocated(proof, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.proof_.IsDefault()) { - _impl_.proof_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.Pro.proof) +inline bool ConfigurationMessage_Contact::_internal_isblocked() const { + return _impl_.isblocked_; +} +inline bool ConfigurationMessage_Contact::isblocked() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.isBlocked) + return _internal_isblocked(); +} +inline void ConfigurationMessage_Contact::_internal_set_isblocked(bool value) { + _impl_._has_bits_[0] |= 0x00000020u; + _impl_.isblocked_ = value; +} +inline void ConfigurationMessage_Contact::set_isblocked(bool value) { + _internal_set_isblocked(value); + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.isBlocked) +} + +// optional bool didApproveMe = 7; +inline bool ConfigurationMessage_Contact::_internal_has_didapproveme() const { + bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; + return value; +} +inline bool ConfigurationMessage_Contact::has_didapproveme() const { + return _internal_has_didapproveme(); +} +inline void ConfigurationMessage_Contact::clear_didapproveme() { + _impl_.didapproveme_ = false; + _impl_._has_bits_[0] &= ~0x00000040u; +} +inline bool ConfigurationMessage_Contact::_internal_didapproveme() const { + return _impl_.didapproveme_; +} +inline bool ConfigurationMessage_Contact::didapproveme() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.didApproveMe) + return _internal_didapproveme(); +} +inline void ConfigurationMessage_Contact::_internal_set_didapproveme(bool value) { + _impl_._has_bits_[0] |= 0x00000040u; + _impl_.didapproveme_ = value; +} +inline void ConfigurationMessage_Contact::set_didapproveme(bool value) { + _internal_set_didapproveme(value); + // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.didApproveMe) } // ------------------------------------------------------------------- @@ -12230,45 +12651,45 @@ ConfigurationMessage::contacts() const { return _impl_.contacts_; } -// optional .SessionProtos.ConfigurationMessage.Pro pro = 7; -inline bool ConfigurationMessage::_internal_has_pro() const { +// optional .SessionProtos.ProConfig proConfig = 7; +inline bool ConfigurationMessage::_internal_has_proconfig() const { bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; - PROTOBUF_ASSUME(!value || _impl_.pro_ != nullptr); + PROTOBUF_ASSUME(!value || _impl_.proconfig_ != nullptr); return value; } -inline bool ConfigurationMessage::has_pro() const { - return _internal_has_pro(); +inline bool ConfigurationMessage::has_proconfig() const { + return _internal_has_proconfig(); } -inline void ConfigurationMessage::clear_pro() { - if (_impl_.pro_ != nullptr) _impl_.pro_->Clear(); +inline void ConfigurationMessage::clear_proconfig() { + if (_impl_.proconfig_ != nullptr) _impl_.proconfig_->Clear(); _impl_._has_bits_[0] &= ~0x00000008u; } -inline const ::SessionProtos::ConfigurationMessage_Pro& ConfigurationMessage::_internal_pro() const { - const ::SessionProtos::ConfigurationMessage_Pro* p = _impl_.pro_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_ConfigurationMessage_Pro_default_instance_); +inline const ::SessionProtos::ProConfig& ConfigurationMessage::_internal_proconfig() const { + const ::SessionProtos::ProConfig* p = _impl_.proconfig_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_ProConfig_default_instance_); } -inline const ::SessionProtos::ConfigurationMessage_Pro& ConfigurationMessage::pro() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.pro) - return _internal_pro(); +inline const ::SessionProtos::ProConfig& ConfigurationMessage::proconfig() const { + // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.proConfig) + return _internal_proconfig(); } -inline void ConfigurationMessage::unsafe_arena_set_allocated_pro( - ::SessionProtos::ConfigurationMessage_Pro* pro) { +inline void ConfigurationMessage::unsafe_arena_set_allocated_proconfig( + ::SessionProtos::ProConfig* proconfig) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.pro_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.proconfig_); } - _impl_.pro_ = pro; - if (pro) { + _impl_.proconfig_ = proconfig; + if (proconfig) { _impl_._has_bits_[0] |= 0x00000008u; } else { _impl_._has_bits_[0] &= ~0x00000008u; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.ConfigurationMessage.pro) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.ConfigurationMessage.proConfig) } -inline ::SessionProtos::ConfigurationMessage_Pro* ConfigurationMessage::release_pro() { +inline ::SessionProtos::ProConfig* ConfigurationMessage::release_proconfig() { _impl_._has_bits_[0] &= ~0x00000008u; - ::SessionProtos::ConfigurationMessage_Pro* temp = _impl_.pro_; - _impl_.pro_ = nullptr; + ::SessionProtos::ProConfig* temp = _impl_.proconfig_; + _impl_.proconfig_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -12280,44 +12701,44 @@ inline ::SessionProtos::ConfigurationMessage_Pro* ConfigurationMessage::release_ #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::SessionProtos::ConfigurationMessage_Pro* ConfigurationMessage::unsafe_arena_release_pro() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.pro) +inline ::SessionProtos::ProConfig* ConfigurationMessage::unsafe_arena_release_proconfig() { + // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.proConfig) _impl_._has_bits_[0] &= ~0x00000008u; - ::SessionProtos::ConfigurationMessage_Pro* temp = _impl_.pro_; - _impl_.pro_ = nullptr; + ::SessionProtos::ProConfig* temp = _impl_.proconfig_; + _impl_.proconfig_ = nullptr; return temp; } -inline ::SessionProtos::ConfigurationMessage_Pro* ConfigurationMessage::_internal_mutable_pro() { +inline ::SessionProtos::ProConfig* ConfigurationMessage::_internal_mutable_proconfig() { _impl_._has_bits_[0] |= 0x00000008u; - if (_impl_.pro_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::ConfigurationMessage_Pro>(GetArenaForAllocation()); - _impl_.pro_ = p; + if (_impl_.proconfig_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::ProConfig>(GetArenaForAllocation()); + _impl_.proconfig_ = p; } - return _impl_.pro_; + return _impl_.proconfig_; } -inline ::SessionProtos::ConfigurationMessage_Pro* ConfigurationMessage::mutable_pro() { - ::SessionProtos::ConfigurationMessage_Pro* _msg = _internal_mutable_pro(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.pro) +inline ::SessionProtos::ProConfig* ConfigurationMessage::mutable_proconfig() { + ::SessionProtos::ProConfig* _msg = _internal_mutable_proconfig(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.proConfig) return _msg; } -inline void ConfigurationMessage::set_allocated_pro(::SessionProtos::ConfigurationMessage_Pro* pro) { +inline void ConfigurationMessage::set_allocated_proconfig(::SessionProtos::ProConfig* proconfig) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.pro_; + delete _impl_.proconfig_; } - if (pro) { + if (proconfig) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(pro); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(proconfig); if (message_arena != submessage_arena) { - pro = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, pro, submessage_arena); + proconfig = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, proconfig, submessage_arena); } _impl_._has_bits_[0] |= 0x00000008u; } else { _impl_._has_bits_[0] &= ~0x00000008u; } - _impl_.pro_ = pro; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.pro) + _impl_.proconfig_ = proconfig; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.proConfig) } // ------------------------------------------------------------------- @@ -13200,6 +13621,8 @@ inline void SharedConfigMessage::set_allocated_data(std::string* data) { // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) diff --git a/proto/SessionProtos.proto b/proto/SessionProtos.proto index cdac33c4..f1ab2da7 100644 --- a/proto/SessionProtos.proto +++ b/proto/SessionProtos.proto @@ -50,6 +50,23 @@ message MessageRequestResponse { optional LokiProfile profile = 3; } +message ProProof { + required uint32 version = 1; + required bytes genIndexHash = 2; + required bytes rotatingPublicKey = 3; + required uint64 expiryUnixTs = 4; + required bytes sig = 5; +} + +message ProConfig { + required bytes rotatingPrivKey = 1; + required ProProof proof = 2; +} +message ProMessageConfig { + required ProProof proof = 1; + required uint32 flags = 2; +} + message Content { optional DataMessage dataMessage = 1; optional CallMessage callMessage = 3; @@ -60,6 +77,7 @@ message Content { optional UnsendRequest unsendRequest = 9; optional MessageRequestResponse messageRequestResponse = 10; optional SharedConfigMessage sharedConfigMessage = 11; + optional ProMessageConfig proMessageConfig = 12; } message CallMessage { @@ -234,26 +252,13 @@ message ConfigurationMessage { optional bool didApproveMe = 7; // added for msg requests } - message ProProof { - required uint32 version = 1; - required bytes genIndexHash = 2; - required bytes rotatingPublicKey = 3; - required uint64 expiryUnixTs = 4; - required bytes sig = 5; - } - - message Pro { - required bytes rotatingPrivKey = 1; - required bytes proof = 2; - } - repeated ClosedGroup closedGroups = 1; repeated string openGroups = 2; optional string displayName = 3; optional string profilePicture = 4; optional bytes profileKey = 5; repeated Contact contacts = 6; - optional Pro pro = 7; + optional ProConfig proConfig = 7; } message ReceiptMessage { diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c0f411c0..72f3db32 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -89,6 +89,7 @@ target_link_libraries(crypto util PRIVATE libsodium::sodium-internal + libsession::protos ) target_link_libraries(config diff --git a/src/config/pro.cpp b/src/config/pro.cpp index d090f217..72a064ec 100644 --- a/src/config/pro.cpp +++ b/src/config/pro.cpp @@ -69,24 +69,24 @@ bool pro_verify_internal( namespace session::config { -static_assert(sizeof(((Pro*)0)->rotating_privkey) == crypto_sign_ed25519_SECRETKEYBYTES); -static_assert(sizeof(((Proof*)0)->gen_index_hash) == 32); -static_assert(sizeof(((Proof*)0)->rotating_pubkey) == crypto_sign_ed25519_PUBLICKEYBYTES); -static_assert(sizeof(((Proof*)0)->sig) == crypto_sign_ed25519_BYTES); +static_assert(sizeof(((ProConfig*)0)->rotating_privkey) == crypto_sign_ed25519_SECRETKEYBYTES); +static_assert(sizeof(((ProProof*)0)->gen_index_hash) == 32); +static_assert(sizeof(((ProProof*)0)->rotating_pubkey) == crypto_sign_ed25519_PUBLICKEYBYTES); +static_assert(sizeof(((ProProof*)0)->sig) == crypto_sign_ed25519_BYTES); -bool Proof::verify(const array_uc32& verify_pubkey) const { +bool ProProof::verify(const array_uc32& verify_pubkey) const { array_uc32 hash_to_sign = hash(); bool result = proof_verify_internal(hash_to_sign, sig, verify_pubkey); return result; } -array_uc32 Proof::hash() const { +array_uc32 ProProof::hash() const { array_uc32 result = proof_hash_internal( version, gen_index_hash, rotating_pubkey, expiry_unix_ts.time_since_epoch().count()); return result; } -bool Proof::load(const dict& root) { +bool ProProof::load(const dict& root) { std::optional version = maybe_int(root, "v"); std::optional> maybe_gen_index_hash = maybe_vector(root, "g"); std::optional> maybe_rotating_pubkey = maybe_vector(root, "r"); @@ -111,7 +111,7 @@ bool Proof::load(const dict& root) { return true; } -bool Pro::verify(const array_uc32& verify_pubkey) const { +bool ProConfig::verify(const array_uc32& verify_pubkey) const { uint64_t expiry_unix_ts = proof.expiry_unix_ts.time_since_epoch().count(); bool result = pro_verify_internal( rotating_privkey, @@ -124,7 +124,7 @@ bool Pro::verify(const array_uc32& verify_pubkey) const { return result; } -bool Pro::load(const dict& root) { +bool ProConfig::load(const dict& root) { // Get proof fields sitting in 'p' dictionary auto p_it = root.find("p"); if (p_it == root.end()) diff --git a/src/config/user_profile.cpp b/src/config/user_profile.cpp index c3f652d6..34709d93 100644 --- a/src/config/user_profile.cpp +++ b/src/config/user_profile.cpp @@ -119,21 +119,21 @@ std::chrono::sys_seconds UserProfile::get_profile_updated() const { return std::chrono::sys_seconds{}; } -std::optional UserProfile::get_pro_data() const { - std::optional result = {}; +std::optional UserProfile::get_pro_data() const { + std::optional result = {}; if (const config::dict* s = data["s"].dict(); s) { - Pro pro = {}; + ProConfig pro = {}; if (pro.load(*s)) result = std::move(pro); } return result; } -void UserProfile::set_pro_data(Pro const &pro) { +void UserProfile::set_pro_data(ProConfig const &pro) { auto root = data["s"]; root["r"] = pro.rotating_privkey; - const Proof& pro_proof = pro.proof; + const ProProof& pro_proof = pro.proof; auto proof_dict = root["p"]; proof_dict["v"] = pro_proof.version; proof_dict["g"] = pro_proof.gen_index_hash; diff --git a/src/pro.cpp b/src/pro.cpp index 37ae59b5..f629dc21 100644 --- a/src/pro.cpp +++ b/src/pro.cpp @@ -4,51 +4,14 @@ #include #include -#include +#include #include +#include +#include "SessionProtos.pb.h" namespace session::pro { -constexpr array_uc32 BACKEND_PUBKEY = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - static_assert(BACKEND_PUBKEY.size() == crypto_sign_ed25519_PUBLICKEYBYTES); - -struct add_payment_request { - std::uint8_t version; - array_uc32 master_pkey; - array_uc32 rotating_pkey; - array_uc32 payment_token; - array_uc32 master_sig; - array_uc32 rotating_sig; - std::string to_json() const; -}; - -struct get_proof_request { - std::uint8_t version; - array_uc32 master_pkey; - array_uc32 rotating_pkey; - std::chrono::seconds unix_ts_s; - array_uc32 master_sig; - array_uc32 rotating_sig; - std::string to_json() const; -}; - -struct master_rotating_sigs { - array_uc64 master_sig; - array_uc64 rotating_sig; -}; - -struct revocation_item { - array_uc32 gen_index_hash; - std::chrono::seconds expiry_unix_ts; -}; - -master_rotating_sigs build_get_proof_sigs(const array_uc64& master_privkey, const array_uc64& rotating_privkey, std::chrono::seconds unix_ts); -master_rotating_sigs build_add_payment_sigs(const array_uc64& master_privkey, const array_uc64& rotating_privkey, const array_uc32& payment_token_hash, std::chrono::seconds unix_ts); - master_rotating_sigs build_get_proof_sigs( const array_uc64& master_privkey, const array_uc64& rotating_privkey, std::chrono::seconds unix_ts) { // Derive the public keys @@ -144,4 +107,69 @@ std::string add_payment_request::to_json() const { oxenc::to_hex(rotating_sig)); return result; } + +DecryptIncomingWithPro decrypt_incoming_with_pro_metadata( + std::span ed25519_privkey, + std::span ciphertext, + std::chrono::sys_seconds unix_ts) { + DecryptIncomingWithPro result = {}; + std::tie(result.plaintext, result.ed25519_pubkey) = session::decrypt_incoming(ed25519_privkey, ciphertext); + + SessionProtos::Content content = {}; + if (!content.ParseFromArray(result.plaintext.data(), result.plaintext.size())) + throw std::runtime_error{"Parse decrypted message for pro metadata failed"}; + + if (content.has_promessageconfig()) { + const SessionProtos::ProMessageConfig& config = content.promessageconfig(); + if (!config.has_proof()) + throw std::runtime_error("Parse decrypted message failed, pro config missing proof"); + if (!config.has_flags()) + throw std::runtime_error("Parse decrypted message failed, pro config missing flags"); + + const SessionProtos::ProProof& proto_proof = config.proof(); + std::uint32_t proto_flags = config.flags(); + + if ((proto_flags & ~session::pro::FeatureFlag_All) > 0) + throw std::runtime_error("Parse decrypted message failed, pro config specified invalid flags"); + + // Parse the proof from protobufs + session::config::ProProof& proof = result.pro_proof; + // clang-format off + size_t proof_errors = 0; + proof_errors += !proto_proof.has_version() || proto_proof.version() != static_cast(session::config::ProProofVersion_v0); + proof_errors += !proto_proof.has_genindexhash() || proto_proof.genindexhash().size() != proof.gen_index_hash.max_size(); + proof_errors += !proto_proof.has_rotatingpublickey() || proto_proof.rotatingpublickey().size() != proof.rotating_pubkey.max_size(); + proof_errors += !proto_proof.has_expiryunixts(); + proof_errors += !proto_proof.has_sig() || proto_proof.sig().size() != proof.sig.max_size(); + // clang-format on + + if (proof_errors == 0) + throw std::runtime_error("Parse decrypted message failed, pro metadata was malformed"); + + // Fill out result, we have parsed successfully + result.pro_flags = proto_flags; + + std::memcpy( + proof.gen_index_hash.data(), + proto_proof.genindexhash().data(), + proto_proof.genindexhash().size()); + std::memcpy( + proof.rotating_pubkey.data(), + proto_proof.rotatingpublickey().data(), + proto_proof.rotatingpublickey().size()); + proof.expiry_unix_ts = + std::chrono::sys_seconds(std::chrono::seconds(proto_proof.expiryunixts())); + std::memcpy(proof.sig.data(), proto_proof.sig().data(), proto_proof.sig().size()); + + if (proof.verify(session::pro::BACKEND_PUBKEY)) + result.pro_status = Status::Valid; + + if (result.pro_status == Status::Valid) { + if (unix_ts >= result.pro_proof.expiry_unix_ts) + result.pro_status = Status::Expired; + } + } + return result; +} + } // namespace session::pro diff --git a/tests/test_config_pro.cpp b/tests/test_config_pro.cpp index bc803974..75d02941 100644 --- a/tests/test_config_pro.cpp +++ b/tests/test_config_pro.cpp @@ -16,7 +16,7 @@ TEST_CASE("Pro", "[config][pro]") { } // Setup the Pro data structure - session::config::Pro pro = {}; + session::config::ProConfig pro = {}; { pro.rotating_privkey = rotating_sk; pro.proof.version = 0; @@ -52,7 +52,7 @@ TEST_CASE("Pro", "[config][pro]") { session::config::dict good_dict; { // clang-format off - const session::config::Proof& proof = pro.proof; + const session::config::ProProof& proof = pro.proof; good_dict = { {"r", std::string(reinterpret_cast(rotating_sk.data()), rotating_sk.size())}, {"p", session::config::dict{ @@ -65,7 +65,7 @@ TEST_CASE("Pro", "[config][pro]") { }; // clang-format on - session::config::Pro loaded_pro = {}; + session::config::ProConfig loaded_pro = {}; CHECK(loaded_pro.load(good_dict)); CHECK(loaded_pro.rotating_privkey == pro.rotating_privkey); CHECK(loaded_pro.proof.version == pro.proof.version); @@ -83,7 +83,7 @@ TEST_CASE("Pro", "[config][pro]") { broken_sig[0] = ~broken_sig[0]; // Break the sig // clang-format off - const session::config::Proof& proof = pro.proof; + const session::config::ProProof& proof = pro.proof; bad_dict = { {"r", std::string(reinterpret_cast(rotating_sk.data()), rotating_sk.size())}, {"p", session::config::dict{ @@ -96,7 +96,7 @@ TEST_CASE("Pro", "[config][pro]") { }; // clang-format on - session::config::Pro loaded_pro = {}; + session::config::ProConfig loaded_pro = {}; CHECK(loaded_pro.load(bad_dict)); CHECK_FALSE(loaded_pro.verify(signing_pk)); } From f23f718f76a0bafd6b777bec3aa722ad96c35660 Mon Sep 17 00:00:00 2001 From: doylet Date: Fri, 8 Aug 2025 10:56:48 +1000 Subject: [PATCH 13/59] Update Session protobuf files to session-ios at 084e58f --- proto/SessionProtos.pb.cc | 11562 ++++++++++++++++----------------- proto/SessionProtos.pb.h | 12294 ++++++++++++++++++------------------ proto/SessionProtos.proto | 209 +- 3 files changed, 11795 insertions(+), 12270 deletions(-) diff --git a/proto/SessionProtos.pb.cc b/proto/SessionProtos.pb.cc index c65c09b5..7d80eabf 100644 --- a/proto/SessionProtos.pb.cc +++ b/proto/SessionProtos.pb.cc @@ -8,7 +8,10 @@ #include #include #include -#include +#include +#include +#include +#include // @@protoc_insertion_point(includes) #include @@ -83,54 +86,6 @@ struct MessageRequestResponseDefaultTypeInternal { }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageRequestResponseDefaultTypeInternal _MessageRequestResponse_default_instance_; -PROTOBUF_CONSTEXPR ProProof::ProProof( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_._has_bits_)*/{} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_.genindexhash_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.rotatingpublickey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.sig_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.expiryunixts_)*/uint64_t{0u} - , /*decltype(_impl_.version_)*/0u} {} -struct ProProofDefaultTypeInternal { - PROTOBUF_CONSTEXPR ProProofDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~ProProofDefaultTypeInternal() {} - union { - ProProof _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProProofDefaultTypeInternal _ProProof_default_instance_; -PROTOBUF_CONSTEXPR ProConfig::ProConfig( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_._has_bits_)*/{} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_.rotatingprivkey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.proof_)*/nullptr} {} -struct ProConfigDefaultTypeInternal { - PROTOBUF_CONSTEXPR ProConfigDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~ProConfigDefaultTypeInternal() {} - union { - ProConfig _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProConfigDefaultTypeInternal _ProConfig_default_instance_; -PROTOBUF_CONSTEXPR ProMessageConfig::ProMessageConfig( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_._has_bits_)*/{} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_.proof_)*/nullptr - , /*decltype(_impl_.flags_)*/0u} {} -struct ProMessageConfigDefaultTypeInternal { - PROTOBUF_CONSTEXPR ProMessageConfigDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~ProMessageConfigDefaultTypeInternal() {} - union { - ProMessageConfig _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProMessageConfigDefaultTypeInternal _ProMessageConfig_default_instance_; PROTOBUF_CONSTEXPR Content::Content( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_._has_bits_)*/{} @@ -139,12 +94,13 @@ PROTOBUF_CONSTEXPR Content::Content( , /*decltype(_impl_.callmessage_)*/nullptr , /*decltype(_impl_.receiptmessage_)*/nullptr , /*decltype(_impl_.typingmessage_)*/nullptr - , /*decltype(_impl_.configurationmessage_)*/nullptr , /*decltype(_impl_.dataextractionnotification_)*/nullptr , /*decltype(_impl_.unsendrequest_)*/nullptr , /*decltype(_impl_.messagerequestresponse_)*/nullptr , /*decltype(_impl_.sharedconfigmessage_)*/nullptr - , /*decltype(_impl_.promessageconfig_)*/nullptr} {} + , /*decltype(_impl_.expirationtype_)*/0 + , /*decltype(_impl_.expirationtimer_)*/0u + , /*decltype(_impl_.sigtimestamp_)*/uint64_t{0u}} {} struct ContentDefaultTypeInternal { PROTOBUF_CONSTEXPR ContentDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -299,42 +255,6 @@ struct DataMessage_OpenGroupInvitationDefaultTypeInternal { }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DataMessage_OpenGroupInvitationDefaultTypeInternal _DataMessage_OpenGroupInvitation_default_instance_; -PROTOBUF_CONSTEXPR DataMessage_ClosedGroupControlMessage_KeyPairWrapper::DataMessage_ClosedGroupControlMessage_KeyPairWrapper( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_._has_bits_)*/{} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_.publickey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.encryptedkeypair_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {} -struct DataMessage_ClosedGroupControlMessage_KeyPairWrapperDefaultTypeInternal { - PROTOBUF_CONSTEXPR DataMessage_ClosedGroupControlMessage_KeyPairWrapperDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~DataMessage_ClosedGroupControlMessage_KeyPairWrapperDefaultTypeInternal() {} - union { - DataMessage_ClosedGroupControlMessage_KeyPairWrapper _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DataMessage_ClosedGroupControlMessage_KeyPairWrapperDefaultTypeInternal _DataMessage_ClosedGroupControlMessage_KeyPairWrapper_default_instance_; -PROTOBUF_CONSTEXPR DataMessage_ClosedGroupControlMessage::DataMessage_ClosedGroupControlMessage( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_._has_bits_)*/{} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_.members_)*/{} - , /*decltype(_impl_.admins_)*/{} - , /*decltype(_impl_.wrappers_)*/{} - , /*decltype(_impl_.publickey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.encryptionkeypair_)*/nullptr - , /*decltype(_impl_.expirationtimer_)*/0u - , /*decltype(_impl_.type_)*/1} {} -struct DataMessage_ClosedGroupControlMessageDefaultTypeInternal { - PROTOBUF_CONSTEXPR DataMessage_ClosedGroupControlMessageDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~DataMessage_ClosedGroupControlMessageDefaultTypeInternal() {} - union { - DataMessage_ClosedGroupControlMessage _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DataMessage_ClosedGroupControlMessageDefaultTypeInternal _DataMessage_ClosedGroupControlMessage_default_instance_; PROTOBUF_CONSTEXPR DataMessage::DataMessage( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_._has_bits_)*/{} @@ -348,10 +268,9 @@ PROTOBUF_CONSTEXPR DataMessage::DataMessage( , /*decltype(_impl_.reaction_)*/nullptr , /*decltype(_impl_.profile_)*/nullptr , /*decltype(_impl_.opengroupinvitation_)*/nullptr - , /*decltype(_impl_.closedgroupcontrolmessage_)*/nullptr - , /*decltype(_impl_.flags_)*/0u - , /*decltype(_impl_.expiretimer_)*/0u + , /*decltype(_impl_.groupupdatemessage_)*/nullptr , /*decltype(_impl_.timestamp_)*/uint64_t{0u} + , /*decltype(_impl_.flags_)*/0u , /*decltype(_impl_.blockscommunitymessagerequests_)*/false} {} struct DataMessageDefaultTypeInternal { PROTOBUF_CONSTEXPR DataMessageDefaultTypeInternal() @@ -362,65 +281,6 @@ struct DataMessageDefaultTypeInternal { }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DataMessageDefaultTypeInternal _DataMessage_default_instance_; -PROTOBUF_CONSTEXPR ConfigurationMessage_ClosedGroup::ConfigurationMessage_ClosedGroup( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_._has_bits_)*/{} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_.members_)*/{} - , /*decltype(_impl_.admins_)*/{} - , /*decltype(_impl_.publickey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.encryptionkeypair_)*/nullptr - , /*decltype(_impl_.expirationtimer_)*/0u} {} -struct ConfigurationMessage_ClosedGroupDefaultTypeInternal { - PROTOBUF_CONSTEXPR ConfigurationMessage_ClosedGroupDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~ConfigurationMessage_ClosedGroupDefaultTypeInternal() {} - union { - ConfigurationMessage_ClosedGroup _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ConfigurationMessage_ClosedGroupDefaultTypeInternal _ConfigurationMessage_ClosedGroup_default_instance_; -PROTOBUF_CONSTEXPR ConfigurationMessage_Contact::ConfigurationMessage_Contact( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_._has_bits_)*/{} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_.publickey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.profilepicture_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.profilekey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.isapproved_)*/false - , /*decltype(_impl_.isblocked_)*/false - , /*decltype(_impl_.didapproveme_)*/false} {} -struct ConfigurationMessage_ContactDefaultTypeInternal { - PROTOBUF_CONSTEXPR ConfigurationMessage_ContactDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~ConfigurationMessage_ContactDefaultTypeInternal() {} - union { - ConfigurationMessage_Contact _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ConfigurationMessage_ContactDefaultTypeInternal _ConfigurationMessage_Contact_default_instance_; -PROTOBUF_CONSTEXPR ConfigurationMessage::ConfigurationMessage( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_._has_bits_)*/{} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_.closedgroups_)*/{} - , /*decltype(_impl_.opengroups_)*/{} - , /*decltype(_impl_.contacts_)*/{} - , /*decltype(_impl_.displayname_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.profilepicture_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.profilekey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.proconfig_)*/nullptr} {} -struct ConfigurationMessageDefaultTypeInternal { - PROTOBUF_CONSTEXPR ConfigurationMessageDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~ConfigurationMessageDefaultTypeInternal() {} - union { - ConfigurationMessage _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ConfigurationMessageDefaultTypeInternal _ConfigurationMessage_default_instance_; PROTOBUF_CONSTEXPR ReceiptMessage::ReceiptMessage( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_._has_bits_)*/{} @@ -477,8 +337,735 @@ struct SharedConfigMessageDefaultTypeInternal { }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SharedConfigMessageDefaultTypeInternal _SharedConfigMessage_default_instance_; +PROTOBUF_CONSTEXPR GroupUpdateMessage::GroupUpdateMessage( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.invitemessage_)*/nullptr + , /*decltype(_impl_.infochangemessage_)*/nullptr + , /*decltype(_impl_.memberchangemessage_)*/nullptr + , /*decltype(_impl_.promotemessage_)*/nullptr + , /*decltype(_impl_.memberleftmessage_)*/nullptr + , /*decltype(_impl_.inviteresponse_)*/nullptr + , /*decltype(_impl_.deletemembercontent_)*/nullptr + , /*decltype(_impl_.memberleftnotificationmessage_)*/nullptr} {} +struct GroupUpdateMessageDefaultTypeInternal { + PROTOBUF_CONSTEXPR GroupUpdateMessageDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~GroupUpdateMessageDefaultTypeInternal() {} + union { + GroupUpdateMessage _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GroupUpdateMessageDefaultTypeInternal _GroupUpdateMessage_default_instance_; +PROTOBUF_CONSTEXPR GroupUpdateInviteMessage::GroupUpdateInviteMessage( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.groupsessionid_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.memberauthdata_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.adminsignature_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {} +struct GroupUpdateInviteMessageDefaultTypeInternal { + PROTOBUF_CONSTEXPR GroupUpdateInviteMessageDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~GroupUpdateInviteMessageDefaultTypeInternal() {} + union { + GroupUpdateInviteMessage _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GroupUpdateInviteMessageDefaultTypeInternal _GroupUpdateInviteMessage_default_instance_; +PROTOBUF_CONSTEXPR GroupUpdatePromoteMessage::GroupUpdatePromoteMessage( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.groupidentityseed_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {} +struct GroupUpdatePromoteMessageDefaultTypeInternal { + PROTOBUF_CONSTEXPR GroupUpdatePromoteMessageDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~GroupUpdatePromoteMessageDefaultTypeInternal() {} + union { + GroupUpdatePromoteMessage _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GroupUpdatePromoteMessageDefaultTypeInternal _GroupUpdatePromoteMessage_default_instance_; +PROTOBUF_CONSTEXPR GroupUpdateInfoChangeMessage::GroupUpdateInfoChangeMessage( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.updatedname_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.adminsignature_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.updatedexpiration_)*/0u + , /*decltype(_impl_.type_)*/1} {} +struct GroupUpdateInfoChangeMessageDefaultTypeInternal { + PROTOBUF_CONSTEXPR GroupUpdateInfoChangeMessageDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~GroupUpdateInfoChangeMessageDefaultTypeInternal() {} + union { + GroupUpdateInfoChangeMessage _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GroupUpdateInfoChangeMessageDefaultTypeInternal _GroupUpdateInfoChangeMessage_default_instance_; +PROTOBUF_CONSTEXPR GroupUpdateMemberChangeMessage::GroupUpdateMemberChangeMessage( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.membersessionids_)*/{} + , /*decltype(_impl_.adminsignature_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.historyshared_)*/false + , /*decltype(_impl_.type_)*/1} {} +struct GroupUpdateMemberChangeMessageDefaultTypeInternal { + PROTOBUF_CONSTEXPR GroupUpdateMemberChangeMessageDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~GroupUpdateMemberChangeMessageDefaultTypeInternal() {} + union { + GroupUpdateMemberChangeMessage _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GroupUpdateMemberChangeMessageDefaultTypeInternal _GroupUpdateMemberChangeMessage_default_instance_; +PROTOBUF_CONSTEXPR GroupUpdateMemberLeftMessage::GroupUpdateMemberLeftMessage( + ::_pbi::ConstantInitialized) {} +struct GroupUpdateMemberLeftMessageDefaultTypeInternal { + PROTOBUF_CONSTEXPR GroupUpdateMemberLeftMessageDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~GroupUpdateMemberLeftMessageDefaultTypeInternal() {} + union { + GroupUpdateMemberLeftMessage _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GroupUpdateMemberLeftMessageDefaultTypeInternal _GroupUpdateMemberLeftMessage_default_instance_; +PROTOBUF_CONSTEXPR GroupUpdateMemberLeftNotificationMessage::GroupUpdateMemberLeftNotificationMessage( + ::_pbi::ConstantInitialized) {} +struct GroupUpdateMemberLeftNotificationMessageDefaultTypeInternal { + PROTOBUF_CONSTEXPR GroupUpdateMemberLeftNotificationMessageDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~GroupUpdateMemberLeftNotificationMessageDefaultTypeInternal() {} + union { + GroupUpdateMemberLeftNotificationMessage _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GroupUpdateMemberLeftNotificationMessageDefaultTypeInternal _GroupUpdateMemberLeftNotificationMessage_default_instance_; +PROTOBUF_CONSTEXPR GroupUpdateInviteResponseMessage::GroupUpdateInviteResponseMessage( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.isapproved_)*/false} {} +struct GroupUpdateInviteResponseMessageDefaultTypeInternal { + PROTOBUF_CONSTEXPR GroupUpdateInviteResponseMessageDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~GroupUpdateInviteResponseMessageDefaultTypeInternal() {} + union { + GroupUpdateInviteResponseMessage _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GroupUpdateInviteResponseMessageDefaultTypeInternal _GroupUpdateInviteResponseMessage_default_instance_; +PROTOBUF_CONSTEXPR GroupUpdateDeleteMemberContentMessage::GroupUpdateDeleteMemberContentMessage( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.membersessionids_)*/{} + , /*decltype(_impl_.messagehashes_)*/{} + , /*decltype(_impl_.adminsignature_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {} +struct GroupUpdateDeleteMemberContentMessageDefaultTypeInternal { + PROTOBUF_CONSTEXPR GroupUpdateDeleteMemberContentMessageDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~GroupUpdateDeleteMemberContentMessageDefaultTypeInternal() {} + union { + GroupUpdateDeleteMemberContentMessage _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GroupUpdateDeleteMemberContentMessageDefaultTypeInternal _GroupUpdateDeleteMemberContentMessage_default_instance_; } // namespace SessionProtos +static ::_pb::Metadata file_level_metadata_SessionProtos_2eproto[27]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_SessionProtos_2eproto[13]; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_SessionProtos_2eproto = nullptr; + +const uint32_t TableStruct_SessionProtos_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _impl_.type_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _impl_.source_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _impl_.sourcedevice_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _impl_.timestamp_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _impl_.content_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _impl_.servertimestamp_), + 5, + 0, + 4, + 2, + 1, + 3, + PROTOBUF_FIELD_OFFSET(::SessionProtos::TypingMessage, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::TypingMessage, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::TypingMessage, _impl_.timestamp_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::TypingMessage, _impl_.action_), + 0, + 1, + PROTOBUF_FIELD_OFFSET(::SessionProtos::UnsendRequest, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::UnsendRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::UnsendRequest, _impl_.timestamp_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::UnsendRequest, _impl_.author_), + 1, + 0, + PROTOBUF_FIELD_OFFSET(::SessionProtos::MessageRequestResponse, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::MessageRequestResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::MessageRequestResponse, _impl_.isapproved_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::MessageRequestResponse, _impl_.profilekey_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::MessageRequestResponse, _impl_.profile_), + 2, + 0, + 1, + PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.datamessage_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.callmessage_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.receiptmessage_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.typingmessage_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.dataextractionnotification_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.unsendrequest_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.messagerequestresponse_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.sharedconfigmessage_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.expirationtype_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.expirationtimer_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.sigtimestamp_), + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + PROTOBUF_FIELD_OFFSET(::SessionProtos::CallMessage, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::CallMessage, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::CallMessage, _impl_.type_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::CallMessage, _impl_.sdps_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::CallMessage, _impl_.sdpmlineindexes_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::CallMessage, _impl_.sdpmids_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::CallMessage, _impl_.uuid_), + 1, + ~0u, + ~0u, + ~0u, + 0, + PROTOBUF_FIELD_OFFSET(::SessionProtos::KeyPair, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::KeyPair, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::KeyPair, _impl_.publickey_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::KeyPair, _impl_.privatekey_), + 0, + 1, + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataExtractionNotification, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataExtractionNotification, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataExtractionNotification, _impl_.type_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataExtractionNotification, _impl_.timestamp_), + 1, + 0, + PROTOBUF_FIELD_OFFSET(::SessionProtos::LokiProfile, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::LokiProfile, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::LokiProfile, _impl_.displayname_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::LokiProfile, _impl_.profilepicture_), + 0, + 1, + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote_QuotedAttachment, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote_QuotedAttachment, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote_QuotedAttachment, _impl_.contenttype_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote_QuotedAttachment, _impl_.filename_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote_QuotedAttachment, _impl_.thumbnail_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote_QuotedAttachment, _impl_.flags_), + 0, + 1, + 2, + 3, + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote, _impl_.id_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote, _impl_.author_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote, _impl_.text_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote, _impl_.attachments_), + 2, + 0, + 1, + ~0u, + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Preview, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Preview, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Preview, _impl_.url_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Preview, _impl_.title_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Preview, _impl_.image_), + 0, + 1, + 2, + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Reaction, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Reaction, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Reaction, _impl_.id_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Reaction, _impl_.author_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Reaction, _impl_.emoji_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Reaction, _impl_.action_), + 2, + 0, + 1, + 3, + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_OpenGroupInvitation, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_OpenGroupInvitation, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_OpenGroupInvitation, _impl_.url_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_OpenGroupInvitation, _impl_.name_), + 0, + 1, + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.body_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.attachments_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.flags_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.profilekey_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.timestamp_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.quote_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.preview_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.reaction_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.profile_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.opengroupinvitation_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.synctarget_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.blockscommunitymessagerequests_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.groupupdatemessage_), + 0, + ~0u, + 9, + 1, + 8, + 3, + ~0u, + 4, + 5, + 6, + 2, + 10, + 7, + PROTOBUF_FIELD_OFFSET(::SessionProtos::ReceiptMessage, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::ReceiptMessage, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::ReceiptMessage, _impl_.type_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::ReceiptMessage, _impl_.timestamp_), + 0, + ~0u, + PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.id_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.contenttype_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.key_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.size_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.thumbnail_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.digest_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.filename_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.flags_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.width_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.height_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.caption_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.url_), + 7, + 0, + 1, + 8, + 2, + 3, + 4, + 9, + 10, + 11, + 5, + 6, + PROTOBUF_FIELD_OFFSET(::SessionProtos::SharedConfigMessage, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::SharedConfigMessage, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::SharedConfigMessage, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::SharedConfigMessage, _impl_.seqno_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::SharedConfigMessage, _impl_.data_), + 2, + 1, + 0, + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _impl_.invitemessage_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _impl_.infochangemessage_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _impl_.memberchangemessage_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _impl_.promotemessage_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _impl_.memberleftmessage_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _impl_.inviteresponse_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _impl_.deletemembercontent_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _impl_.memberleftnotificationmessage_), + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInviteMessage, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInviteMessage, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInviteMessage, _impl_.groupsessionid_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInviteMessage, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInviteMessage, _impl_.memberauthdata_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInviteMessage, _impl_.adminsignature_), + 0, + 1, + 2, + 3, + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdatePromoteMessage, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdatePromoteMessage, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdatePromoteMessage, _impl_.groupidentityseed_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdatePromoteMessage, _impl_.name_), + 0, + 1, + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInfoChangeMessage, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInfoChangeMessage, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInfoChangeMessage, _impl_.type_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInfoChangeMessage, _impl_.updatedname_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInfoChangeMessage, _impl_.updatedexpiration_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInfoChangeMessage, _impl_.adminsignature_), + 3, + 0, + 2, + 1, + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMemberChangeMessage, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMemberChangeMessage, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMemberChangeMessage, _impl_.type_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMemberChangeMessage, _impl_.membersessionids_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMemberChangeMessage, _impl_.historyshared_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMemberChangeMessage, _impl_.adminsignature_), + 2, + ~0u, + 1, + 0, + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMemberLeftMessage, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMemberLeftNotificationMessage, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInviteResponseMessage, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInviteResponseMessage, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInviteResponseMessage, _impl_.isapproved_), + 0, + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateDeleteMemberContentMessage, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateDeleteMemberContentMessage, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateDeleteMemberContentMessage, _impl_.membersessionids_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateDeleteMemberContentMessage, _impl_.messagehashes_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateDeleteMemberContentMessage, _impl_.adminsignature_), + ~0u, + ~0u, + 0, +}; +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, 12, -1, sizeof(::SessionProtos::Envelope)}, + { 18, 26, -1, sizeof(::SessionProtos::TypingMessage)}, + { 28, 36, -1, sizeof(::SessionProtos::UnsendRequest)}, + { 38, 47, -1, sizeof(::SessionProtos::MessageRequestResponse)}, + { 50, 67, -1, sizeof(::SessionProtos::Content)}, + { 78, 89, -1, sizeof(::SessionProtos::CallMessage)}, + { 94, 102, -1, sizeof(::SessionProtos::KeyPair)}, + { 104, 112, -1, sizeof(::SessionProtos::DataExtractionNotification)}, + { 114, 122, -1, sizeof(::SessionProtos::LokiProfile)}, + { 124, 134, -1, sizeof(::SessionProtos::DataMessage_Quote_QuotedAttachment)}, + { 138, 148, -1, sizeof(::SessionProtos::DataMessage_Quote)}, + { 152, 161, -1, sizeof(::SessionProtos::DataMessage_Preview)}, + { 164, 174, -1, sizeof(::SessionProtos::DataMessage_Reaction)}, + { 178, 186, -1, sizeof(::SessionProtos::DataMessage_OpenGroupInvitation)}, + { 188, 207, -1, sizeof(::SessionProtos::DataMessage)}, + { 220, 228, -1, sizeof(::SessionProtos::ReceiptMessage)}, + { 230, 248, -1, sizeof(::SessionProtos::AttachmentPointer)}, + { 260, 269, -1, sizeof(::SessionProtos::SharedConfigMessage)}, + { 272, 286, -1, sizeof(::SessionProtos::GroupUpdateMessage)}, + { 294, 304, -1, sizeof(::SessionProtos::GroupUpdateInviteMessage)}, + { 308, 316, -1, sizeof(::SessionProtos::GroupUpdatePromoteMessage)}, + { 318, 328, -1, sizeof(::SessionProtos::GroupUpdateInfoChangeMessage)}, + { 332, 342, -1, sizeof(::SessionProtos::GroupUpdateMemberChangeMessage)}, + { 346, -1, -1, sizeof(::SessionProtos::GroupUpdateMemberLeftMessage)}, + { 352, -1, -1, sizeof(::SessionProtos::GroupUpdateMemberLeftNotificationMessage)}, + { 358, 365, -1, sizeof(::SessionProtos::GroupUpdateInviteResponseMessage)}, + { 366, 375, -1, sizeof(::SessionProtos::GroupUpdateDeleteMemberContentMessage)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::SessionProtos::_Envelope_default_instance_._instance, + &::SessionProtos::_TypingMessage_default_instance_._instance, + &::SessionProtos::_UnsendRequest_default_instance_._instance, + &::SessionProtos::_MessageRequestResponse_default_instance_._instance, + &::SessionProtos::_Content_default_instance_._instance, + &::SessionProtos::_CallMessage_default_instance_._instance, + &::SessionProtos::_KeyPair_default_instance_._instance, + &::SessionProtos::_DataExtractionNotification_default_instance_._instance, + &::SessionProtos::_LokiProfile_default_instance_._instance, + &::SessionProtos::_DataMessage_Quote_QuotedAttachment_default_instance_._instance, + &::SessionProtos::_DataMessage_Quote_default_instance_._instance, + &::SessionProtos::_DataMessage_Preview_default_instance_._instance, + &::SessionProtos::_DataMessage_Reaction_default_instance_._instance, + &::SessionProtos::_DataMessage_OpenGroupInvitation_default_instance_._instance, + &::SessionProtos::_DataMessage_default_instance_._instance, + &::SessionProtos::_ReceiptMessage_default_instance_._instance, + &::SessionProtos::_AttachmentPointer_default_instance_._instance, + &::SessionProtos::_SharedConfigMessage_default_instance_._instance, + &::SessionProtos::_GroupUpdateMessage_default_instance_._instance, + &::SessionProtos::_GroupUpdateInviteMessage_default_instance_._instance, + &::SessionProtos::_GroupUpdatePromoteMessage_default_instance_._instance, + &::SessionProtos::_GroupUpdateInfoChangeMessage_default_instance_._instance, + &::SessionProtos::_GroupUpdateMemberChangeMessage_default_instance_._instance, + &::SessionProtos::_GroupUpdateMemberLeftMessage_default_instance_._instance, + &::SessionProtos::_GroupUpdateMemberLeftNotificationMessage_default_instance_._instance, + &::SessionProtos::_GroupUpdateInviteResponseMessage_default_instance_._instance, + &::SessionProtos::_GroupUpdateDeleteMemberContentMessage_default_instance_._instance, +}; + +const char descriptor_table_protodef_SessionProtos_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\023SessionProtos.proto\022\rSessionProtos\"\320\001\n" + "\010Envelope\022*\n\004type\030\001 \002(\0162\034.SessionProtos." + "Envelope.Type\022\016\n\006source\030\002 \001(\t\022\024\n\014sourceD" + "evice\030\007 \001(\r\022\021\n\ttimestamp\030\005 \002(\004\022\017\n\007conten" + "t\030\010 \001(\014\022\027\n\017serverTimestamp\030\n \001(\004\"5\n\004Type" + "\022\023\n\017SESSION_MESSAGE\020\006\022\030\n\024CLOSED_GROUP_ME" + "SSAGE\020\007\"{\n\rTypingMessage\022\021\n\ttimestamp\030\001 " + "\002(\004\0223\n\006action\030\002 \002(\0162#.SessionProtos.Typi" + "ngMessage.Action\"\"\n\006Action\022\013\n\007STARTED\020\000\022" + "\013\n\007STOPPED\020\001\"2\n\rUnsendRequest\022\021\n\ttimesta" + "mp\030\001 \002(\004\022\016\n\006author\030\002 \002(\t\"m\n\026MessageReque" + "stResponse\022\022\n\nisApproved\030\001 \002(\010\022\022\n\nprofil" + "eKey\030\002 \001(\014\022+\n\007profile\030\003 \001(\0132\032.SessionPro" + "tos.LokiProfile\"\236\005\n\007Content\022/\n\013dataMessa" + "ge\030\001 \001(\0132\032.SessionProtos.DataMessage\022/\n\013" + "callMessage\030\003 \001(\0132\032.SessionProtos.CallMe" + "ssage\0225\n\016receiptMessage\030\005 \001(\0132\035.SessionP" + "rotos.ReceiptMessage\0223\n\rtypingMessage\030\006 " + "\001(\0132\034.SessionProtos.TypingMessage\022M\n\032dat" + "aExtractionNotification\030\010 \001(\0132).SessionP" + "rotos.DataExtractionNotification\0223\n\runse" + "ndRequest\030\t \001(\0132\034.SessionProtos.UnsendRe" + "quest\022E\n\026messageRequestResponse\030\n \001(\0132%." + "SessionProtos.MessageRequestResponse\022\?\n\023" + "sharedConfigMessage\030\013 \001(\0132\".SessionProto" + "s.SharedConfigMessage\022=\n\016expirationType\030" + "\014 \001(\0162%.SessionProtos.Content.Expiration" + "Type\022\027\n\017expirationTimer\030\r \001(\r\022\024\n\014sigTime" + "stamp\030\017 \001(\004\"K\n\016ExpirationType\022\013\n\007UNKNOWN" + "\020\000\022\025\n\021DELETE_AFTER_READ\020\001\022\025\n\021DELETE_AFTE" + "R_SEND\020\002\"\352\001\n\013CallMessage\022-\n\004type\030\001 \002(\0162\037" + ".SessionProtos.CallMessage.Type\022\014\n\004sdps\030" + "\002 \003(\t\022\027\n\017sdpMLineIndexes\030\003 \003(\r\022\017\n\007sdpMid" + "s\030\004 \003(\t\022\014\n\004uuid\030\005 \002(\t\"f\n\004Type\022\r\n\tPRE_OFF" + "ER\020\006\022\t\n\005OFFER\020\001\022\n\n\006ANSWER\020\002\022\026\n\022PROVISION" + "AL_ANSWER\020\003\022\022\n\016ICE_CANDIDATES\020\004\022\014\n\010END_C" + "ALL\020\005\"0\n\007KeyPair\022\021\n\tpublicKey\030\001 \002(\014\022\022\n\np" + "rivateKey\030\002 \002(\014\"\226\001\n\032DataExtractionNotifi" + "cation\022<\n\004type\030\001 \002(\0162..SessionProtos.Dat" + "aExtractionNotification.Type\022\021\n\ttimestam" + "p\030\002 \001(\004\"\'\n\004Type\022\016\n\nSCREENSHOT\020\001\022\017\n\013MEDIA" + "_SAVED\020\002\":\n\013LokiProfile\022\023\n\013displayName\030\001" + " \001(\t\022\026\n\016profilePicture\030\002 \001(\t\"\367\010\n\013DataMes" + "sage\022\014\n\004body\030\001 \001(\t\0225\n\013attachments\030\002 \003(\0132" + " .SessionProtos.AttachmentPointer\022\r\n\005fla" + "gs\030\004 \001(\r\022\022\n\nprofileKey\030\006 \001(\014\022\021\n\ttimestam" + "p\030\007 \001(\004\022/\n\005quote\030\010 \001(\0132 .SessionProtos.D" + "ataMessage.Quote\0223\n\007preview\030\n \003(\0132\".Sess" + "ionProtos.DataMessage.Preview\0225\n\010reactio" + "n\030\013 \001(\0132#.SessionProtos.DataMessage.Reac" + "tion\022+\n\007profile\030e \001(\0132\032.SessionProtos.Lo" + "kiProfile\022K\n\023openGroupInvitation\030f \001(\0132." + ".SessionProtos.DataMessage.OpenGroupInvi" + "tation\022\022\n\nsyncTarget\030i \001(\t\022&\n\036blocksComm" + "unityMessageRequests\030j \001(\010\022=\n\022groupUpdat" + "eMessage\030x \001(\0132!.SessionProtos.GroupUpda" + "teMessage\032\225\002\n\005Quote\022\n\n\002id\030\001 \002(\004\022\016\n\006autho" + "r\030\002 \002(\t\022\014\n\004text\030\003 \001(\t\022F\n\013attachments\030\004 \003" + "(\01321.SessionProtos.DataMessage.Quote.Quo" + "tedAttachment\032\231\001\n\020QuotedAttachment\022\023\n\013co" + "ntentType\030\001 \001(\t\022\020\n\010fileName\030\002 \001(\t\0223\n\tthu" + "mbnail\030\003 \001(\0132 .SessionProtos.AttachmentP" + "ointer\022\r\n\005flags\030\004 \001(\r\"\032\n\005Flags\022\021\n\rVOICE_" + "MESSAGE\020\001\032V\n\007Preview\022\013\n\003url\030\001 \002(\t\022\r\n\005tit" + "le\030\002 \001(\t\022/\n\005image\030\003 \001(\0132 .SessionProtos." + "AttachmentPointer\032\222\001\n\010Reaction\022\n\n\002id\030\001 \002" + "(\004\022\016\n\006author\030\002 \002(\t\022\r\n\005emoji\030\003 \001(\t\022:\n\006act" + "ion\030\004 \002(\0162*.SessionProtos.DataMessage.Re" + "action.Action\"\037\n\006Action\022\t\n\005REACT\020\000\022\n\n\006RE" + "MOVE\020\001\0320\n\023OpenGroupInvitation\022\013\n\003url\030\001 \002" + "(\t\022\014\n\004name\030\003 \002(\t\"$\n\005Flags\022\033\n\027EXPIRATION_" + "TIMER_UPDATE\020\002\"u\n\016ReceiptMessage\0220\n\004type" + "\030\001 \002(\0162\".SessionProtos.ReceiptMessage.Ty" + "pe\022\021\n\ttimestamp\030\002 \003(\004\"\036\n\004Type\022\014\n\010DELIVER" + "Y\020\000\022\010\n\004READ\020\001\"\354\001\n\021AttachmentPointer\022\n\n\002i" + "d\030\001 \002(\006\022\023\n\013contentType\030\002 \001(\t\022\013\n\003key\030\003 \001(" + "\014\022\014\n\004size\030\004 \001(\r\022\021\n\tthumbnail\030\005 \001(\014\022\016\n\006di" + "gest\030\006 \001(\014\022\020\n\010fileName\030\007 \001(\t\022\r\n\005flags\030\010 " + "\001(\r\022\r\n\005width\030\t \001(\r\022\016\n\006height\030\n \001(\r\022\017\n\007ca" + "ption\030\013 \001(\t\022\013\n\003url\030e \001(\t\"\032\n\005Flags\022\021\n\rVOI" + "CE_MESSAGE\020\001\"\273\001\n\023SharedConfigMessage\0225\n\004" + "kind\030\001 \002(\0162\'.SessionProtos.SharedConfigM" + "essage.Kind\022\r\n\005seqno\030\002 \002(\003\022\014\n\004data\030\003 \002(\014" + "\"P\n\004Kind\022\020\n\014USER_PROFILE\020\001\022\014\n\010CONTACTS\020\002" + "\022\027\n\023CONVO_INFO_VOLATILE\020\003\022\017\n\013USER_GROUPS" + "\020\004\"\356\004\n\022GroupUpdateMessage\022>\n\rinviteMessa" + "ge\030\001 \001(\0132\'.SessionProtos.GroupUpdateInvi" + "teMessage\022F\n\021infoChangeMessage\030\002 \001(\0132+.S" + "essionProtos.GroupUpdateInfoChangeMessag" + "e\022J\n\023memberChangeMessage\030\003 \001(\0132-.Session" + "Protos.GroupUpdateMemberChangeMessage\022@\n" + "\016promoteMessage\030\004 \001(\0132(.SessionProtos.Gr" + "oupUpdatePromoteMessage\022F\n\021memberLeftMes" + "sage\030\005 \001(\0132+.SessionProtos.GroupUpdateMe" + "mberLeftMessage\022G\n\016inviteResponse\030\006 \001(\0132" + "/.SessionProtos.GroupUpdateInviteRespons" + "eMessage\022Q\n\023deleteMemberContent\030\007 \001(\01324." + "SessionProtos.GroupUpdateDeleteMemberCon" + "tentMessage\022^\n\035memberLeftNotificationMes" + "sage\030\010 \001(\01327.SessionProtos.GroupUpdateMe" + "mberLeftNotificationMessage\"p\n\030GroupUpda" + "teInviteMessage\022\026\n\016groupSessionId\030\001 \002(\t\022" + "\014\n\004name\030\002 \002(\t\022\026\n\016memberAuthData\030\003 \002(\014\022\026\n" + "\016adminSignature\030\004 \002(\014\"D\n\031GroupUpdateProm" + "oteMessage\022\031\n\021groupIdentitySeed\030\001 \002(\014\022\014\n" + "\004name\030\002 \002(\t\"\337\001\n\034GroupUpdateInfoChangeMes" + "sage\022>\n\004type\030\001 \002(\01620.SessionProtos.Group" + "UpdateInfoChangeMessage.Type\022\023\n\013updatedN" + "ame\030\002 \001(\t\022\031\n\021updatedExpiration\030\003 \001(\r\022\026\n\016" + "adminSignature\030\004 \002(\014\"7\n\004Type\022\010\n\004NAME\020\001\022\n" + "\n\006AVATAR\020\002\022\031\n\025DISAPPEARING_MESSAGES\020\003\"\331\001" + "\n\036GroupUpdateMemberChangeMessage\022@\n\004type" + "\030\001 \002(\01622.SessionProtos.GroupUpdateMember" + "ChangeMessage.Type\022\030\n\020memberSessionIds\030\002" + " \003(\t\022\025\n\rhistoryShared\030\003 \001(\010\022\026\n\016adminSign" + "ature\030\004 \002(\014\",\n\004Type\022\t\n\005ADDED\020\001\022\013\n\007REMOVE" + "D\020\002\022\014\n\010PROMOTED\020\003\"\036\n\034GroupUpdateMemberLe" + "ftMessage\"*\n(GroupUpdateMemberLeftNotifi" + "cationMessage\"6\n GroupUpdateInviteRespon" + "seMessage\022\022\n\nisApproved\030\001 \002(\010\"p\n%GroupUp" + "dateDeleteMemberContentMessage\022\030\n\020member" + "SessionIds\030\001 \003(\t\022\025\n\rmessageHashes\030\002 \003(\t\022" + "\026\n\016adminSignature\030\003 \001(\014" + ; +static ::_pbi::once_flag descriptor_table_SessionProtos_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_SessionProtos_2eproto = { + false, false, 4903, descriptor_table_protodef_SessionProtos_2eproto, + "SessionProtos.proto", + &descriptor_table_SessionProtos_2eproto_once, nullptr, 0, 27, + schemas, file_default_instances, TableStruct_SessionProtos_2eproto::offsets, + file_level_metadata_SessionProtos_2eproto, file_level_enum_descriptors_SessionProtos_2eproto, + file_level_service_descriptors_SessionProtos_2eproto, +}; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_SessionProtos_2eproto_getter() { + return &descriptor_table_SessionProtos_2eproto; +} + +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_SessionProtos_2eproto(&descriptor_table_SessionProtos_2eproto); namespace SessionProtos { +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Envelope_Type_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); + return file_level_enum_descriptors_SessionProtos_2eproto[0]; +} bool Envelope_Type_IsValid(int value) { switch (value) { case 6: @@ -489,47 +1076,6 @@ bool Envelope_Type_IsValid(int value) { } } -static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed Envelope_Type_strings[2] = {}; - -static const char Envelope_Type_names[] = - "CLOSED_GROUP_MESSAGE" - "SESSION_MESSAGE"; - -static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry Envelope_Type_entries[] = { - { {Envelope_Type_names + 0, 20}, 7 }, - { {Envelope_Type_names + 20, 15}, 6 }, -}; - -static const int Envelope_Type_entries_by_number[] = { - 1, // 6 -> SESSION_MESSAGE - 0, // 7 -> CLOSED_GROUP_MESSAGE -}; - -const std::string& Envelope_Type_Name( - Envelope_Type value) { - static const bool dummy = - ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( - Envelope_Type_entries, - Envelope_Type_entries_by_number, - 2, Envelope_Type_strings); - (void) dummy; - int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( - Envelope_Type_entries, - Envelope_Type_entries_by_number, - 2, value); - return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : - Envelope_Type_strings[idx].get(); -} -bool Envelope_Type_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Envelope_Type* value) { - int int_value; - bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( - Envelope_Type_entries, 2, name, &int_value); - if (success) { - *value = static_cast(int_value); - } - return success; -} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr Envelope_Type Envelope::SESSION_MESSAGE; constexpr Envelope_Type Envelope::CLOSED_GROUP_MESSAGE; @@ -537,6 +1083,10 @@ constexpr Envelope_Type Envelope::Type_MIN; constexpr Envelope_Type Envelope::Type_MAX; constexpr int Envelope::Type_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* TypingMessage_Action_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); + return file_level_enum_descriptors_SessionProtos_2eproto[1]; +} bool TypingMessage_Action_IsValid(int value) { switch (value) { case 0: @@ -547,47 +1097,6 @@ bool TypingMessage_Action_IsValid(int value) { } } -static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed TypingMessage_Action_strings[2] = {}; - -static const char TypingMessage_Action_names[] = - "STARTED" - "STOPPED"; - -static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry TypingMessage_Action_entries[] = { - { {TypingMessage_Action_names + 0, 7}, 0 }, - { {TypingMessage_Action_names + 7, 7}, 1 }, -}; - -static const int TypingMessage_Action_entries_by_number[] = { - 0, // 0 -> STARTED - 1, // 1 -> STOPPED -}; - -const std::string& TypingMessage_Action_Name( - TypingMessage_Action value) { - static const bool dummy = - ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( - TypingMessage_Action_entries, - TypingMessage_Action_entries_by_number, - 2, TypingMessage_Action_strings); - (void) dummy; - int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( - TypingMessage_Action_entries, - TypingMessage_Action_entries_by_number, - 2, value); - return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : - TypingMessage_Action_strings[idx].get(); -} -bool TypingMessage_Action_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, TypingMessage_Action* value) { - int int_value; - bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( - TypingMessage_Action_entries, 2, name, &int_value); - if (success) { - *value = static_cast(int_value); - } - return success; -} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr TypingMessage_Action TypingMessage::STARTED; constexpr TypingMessage_Action TypingMessage::STOPPED; @@ -595,6 +1104,33 @@ constexpr TypingMessage_Action TypingMessage::Action_MIN; constexpr TypingMessage_Action TypingMessage::Action_MAX; constexpr int TypingMessage::Action_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Content_ExpirationType_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); + return file_level_enum_descriptors_SessionProtos_2eproto[2]; +} +bool Content_ExpirationType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +constexpr Content_ExpirationType Content::UNKNOWN; +constexpr Content_ExpirationType Content::DELETE_AFTER_READ; +constexpr Content_ExpirationType Content::DELETE_AFTER_SEND; +constexpr Content_ExpirationType Content::ExpirationType_MIN; +constexpr Content_ExpirationType Content::ExpirationType_MAX; +constexpr int Content::ExpirationType_ARRAYSIZE; +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* CallMessage_Type_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); + return file_level_enum_descriptors_SessionProtos_2eproto[3]; +} bool CallMessage_Type_IsValid(int value) { switch (value) { case 1: @@ -609,59 +1145,6 @@ bool CallMessage_Type_IsValid(int value) { } } -static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed CallMessage_Type_strings[6] = {}; - -static const char CallMessage_Type_names[] = - "ANSWER" - "END_CALL" - "ICE_CANDIDATES" - "OFFER" - "PRE_OFFER" - "PROVISIONAL_ANSWER"; - -static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry CallMessage_Type_entries[] = { - { {CallMessage_Type_names + 0, 6}, 2 }, - { {CallMessage_Type_names + 6, 8}, 5 }, - { {CallMessage_Type_names + 14, 14}, 4 }, - { {CallMessage_Type_names + 28, 5}, 1 }, - { {CallMessage_Type_names + 33, 9}, 6 }, - { {CallMessage_Type_names + 42, 18}, 3 }, -}; - -static const int CallMessage_Type_entries_by_number[] = { - 3, // 1 -> OFFER - 0, // 2 -> ANSWER - 5, // 3 -> PROVISIONAL_ANSWER - 2, // 4 -> ICE_CANDIDATES - 1, // 5 -> END_CALL - 4, // 6 -> PRE_OFFER -}; - -const std::string& CallMessage_Type_Name( - CallMessage_Type value) { - static const bool dummy = - ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( - CallMessage_Type_entries, - CallMessage_Type_entries_by_number, - 6, CallMessage_Type_strings); - (void) dummy; - int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( - CallMessage_Type_entries, - CallMessage_Type_entries_by_number, - 6, value); - return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : - CallMessage_Type_strings[idx].get(); -} -bool CallMessage_Type_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, CallMessage_Type* value) { - int int_value; - bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( - CallMessage_Type_entries, 6, name, &int_value); - if (success) { - *value = static_cast(int_value); - } - return success; -} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr CallMessage_Type CallMessage::PRE_OFFER; constexpr CallMessage_Type CallMessage::OFFER; @@ -673,6 +1156,10 @@ constexpr CallMessage_Type CallMessage::Type_MIN; constexpr CallMessage_Type CallMessage::Type_MAX; constexpr int CallMessage::Type_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataExtractionNotification_Type_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); + return file_level_enum_descriptors_SessionProtos_2eproto[4]; +} bool DataExtractionNotification_Type_IsValid(int value) { switch (value) { case 1: @@ -683,47 +1170,6 @@ bool DataExtractionNotification_Type_IsValid(int value) { } } -static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed DataExtractionNotification_Type_strings[2] = {}; - -static const char DataExtractionNotification_Type_names[] = - "MEDIA_SAVED" - "SCREENSHOT"; - -static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry DataExtractionNotification_Type_entries[] = { - { {DataExtractionNotification_Type_names + 0, 11}, 2 }, - { {DataExtractionNotification_Type_names + 11, 10}, 1 }, -}; - -static const int DataExtractionNotification_Type_entries_by_number[] = { - 1, // 1 -> SCREENSHOT - 0, // 2 -> MEDIA_SAVED -}; - -const std::string& DataExtractionNotification_Type_Name( - DataExtractionNotification_Type value) { - static const bool dummy = - ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( - DataExtractionNotification_Type_entries, - DataExtractionNotification_Type_entries_by_number, - 2, DataExtractionNotification_Type_strings); - (void) dummy; - int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( - DataExtractionNotification_Type_entries, - DataExtractionNotification_Type_entries_by_number, - 2, value); - return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : - DataExtractionNotification_Type_strings[idx].get(); -} -bool DataExtractionNotification_Type_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataExtractionNotification_Type* value) { - int int_value; - bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( - DataExtractionNotification_Type_entries, 2, name, &int_value); - if (success) { - *value = static_cast(int_value); - } - return success; -} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr DataExtractionNotification_Type DataExtractionNotification::SCREENSHOT; constexpr DataExtractionNotification_Type DataExtractionNotification::MEDIA_SAVED; @@ -731,6 +1177,10 @@ constexpr DataExtractionNotification_Type DataExtractionNotification::Type_MIN; constexpr DataExtractionNotification_Type DataExtractionNotification::Type_MAX; constexpr int DataExtractionNotification::Type_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataMessage_Quote_QuotedAttachment_Flags_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); + return file_level_enum_descriptors_SessionProtos_2eproto[5]; +} bool DataMessage_Quote_QuotedAttachment_Flags_IsValid(int value) { switch (value) { case 1: @@ -740,50 +1190,16 @@ bool DataMessage_Quote_QuotedAttachment_Flags_IsValid(int value) { } } -static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed DataMessage_Quote_QuotedAttachment_Flags_strings[1] = {}; - -static const char DataMessage_Quote_QuotedAttachment_Flags_names[] = - "VOICE_MESSAGE"; - -static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry DataMessage_Quote_QuotedAttachment_Flags_entries[] = { - { {DataMessage_Quote_QuotedAttachment_Flags_names + 0, 13}, 1 }, -}; - -static const int DataMessage_Quote_QuotedAttachment_Flags_entries_by_number[] = { - 0, // 1 -> VOICE_MESSAGE -}; - -const std::string& DataMessage_Quote_QuotedAttachment_Flags_Name( - DataMessage_Quote_QuotedAttachment_Flags value) { - static const bool dummy = - ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( - DataMessage_Quote_QuotedAttachment_Flags_entries, - DataMessage_Quote_QuotedAttachment_Flags_entries_by_number, - 1, DataMessage_Quote_QuotedAttachment_Flags_strings); - (void) dummy; - int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( - DataMessage_Quote_QuotedAttachment_Flags_entries, - DataMessage_Quote_QuotedAttachment_Flags_entries_by_number, - 1, value); - return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : - DataMessage_Quote_QuotedAttachment_Flags_strings[idx].get(); -} -bool DataMessage_Quote_QuotedAttachment_Flags_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_Quote_QuotedAttachment_Flags* value) { - int int_value; - bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( - DataMessage_Quote_QuotedAttachment_Flags_entries, 1, name, &int_value); - if (success) { - *value = static_cast(int_value); - } - return success; -} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr DataMessage_Quote_QuotedAttachment_Flags DataMessage_Quote_QuotedAttachment::VOICE_MESSAGE; constexpr DataMessage_Quote_QuotedAttachment_Flags DataMessage_Quote_QuotedAttachment::Flags_MIN; constexpr DataMessage_Quote_QuotedAttachment_Flags DataMessage_Quote_QuotedAttachment::Flags_MAX; constexpr int DataMessage_Quote_QuotedAttachment::Flags_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataMessage_Reaction_Action_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); + return file_level_enum_descriptors_SessionProtos_2eproto[6]; +} bool DataMessage_Reaction_Action_IsValid(int value) { switch (value) { case 0: @@ -794,47 +1210,6 @@ bool DataMessage_Reaction_Action_IsValid(int value) { } } -static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed DataMessage_Reaction_Action_strings[2] = {}; - -static const char DataMessage_Reaction_Action_names[] = - "REACT" - "REMOVE"; - -static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry DataMessage_Reaction_Action_entries[] = { - { {DataMessage_Reaction_Action_names + 0, 5}, 0 }, - { {DataMessage_Reaction_Action_names + 5, 6}, 1 }, -}; - -static const int DataMessage_Reaction_Action_entries_by_number[] = { - 0, // 0 -> REACT - 1, // 1 -> REMOVE -}; - -const std::string& DataMessage_Reaction_Action_Name( - DataMessage_Reaction_Action value) { - static const bool dummy = - ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( - DataMessage_Reaction_Action_entries, - DataMessage_Reaction_Action_entries_by_number, - 2, DataMessage_Reaction_Action_strings); - (void) dummy; - int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( - DataMessage_Reaction_Action_entries, - DataMessage_Reaction_Action_entries_by_number, - 2, value); - return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : - DataMessage_Reaction_Action_strings[idx].get(); -} -bool DataMessage_Reaction_Action_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_Reaction_Action* value) { - int int_value; - bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( - DataMessage_Reaction_Action_entries, 2, name, &int_value); - if (success) { - *value = static_cast(int_value); - } - return success; -} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr DataMessage_Reaction_Action DataMessage_Reaction::REACT; constexpr DataMessage_Reaction_Action DataMessage_Reaction::REMOVE; @@ -842,89 +1217,10 @@ constexpr DataMessage_Reaction_Action DataMessage_Reaction::Action_MIN; constexpr DataMessage_Reaction_Action DataMessage_Reaction::Action_MAX; constexpr int DataMessage_Reaction::Action_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -bool DataMessage_ClosedGroupControlMessage_Type_IsValid(int value) { - switch (value) { - case 1: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - return true; - default: - return false; - } -} - -static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed DataMessage_ClosedGroupControlMessage_Type_strings[7] = {}; - -static const char DataMessage_ClosedGroupControlMessage_Type_names[] = - "ENCRYPTION_KEY_PAIR" - "ENCRYPTION_KEY_PAIR_REQUEST" - "MEMBERS_ADDED" - "MEMBERS_REMOVED" - "MEMBER_LEFT" - "NAME_CHANGE" - "NEW"; - -static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry DataMessage_ClosedGroupControlMessage_Type_entries[] = { - { {DataMessage_ClosedGroupControlMessage_Type_names + 0, 19}, 3 }, - { {DataMessage_ClosedGroupControlMessage_Type_names + 19, 27}, 8 }, - { {DataMessage_ClosedGroupControlMessage_Type_names + 46, 13}, 5 }, - { {DataMessage_ClosedGroupControlMessage_Type_names + 59, 15}, 6 }, - { {DataMessage_ClosedGroupControlMessage_Type_names + 74, 11}, 7 }, - { {DataMessage_ClosedGroupControlMessage_Type_names + 85, 11}, 4 }, - { {DataMessage_ClosedGroupControlMessage_Type_names + 96, 3}, 1 }, -}; - -static const int DataMessage_ClosedGroupControlMessage_Type_entries_by_number[] = { - 6, // 1 -> NEW - 0, // 3 -> ENCRYPTION_KEY_PAIR - 5, // 4 -> NAME_CHANGE - 2, // 5 -> MEMBERS_ADDED - 3, // 6 -> MEMBERS_REMOVED - 4, // 7 -> MEMBER_LEFT - 1, // 8 -> ENCRYPTION_KEY_PAIR_REQUEST -}; - -const std::string& DataMessage_ClosedGroupControlMessage_Type_Name( - DataMessage_ClosedGroupControlMessage_Type value) { - static const bool dummy = - ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( - DataMessage_ClosedGroupControlMessage_Type_entries, - DataMessage_ClosedGroupControlMessage_Type_entries_by_number, - 7, DataMessage_ClosedGroupControlMessage_Type_strings); - (void) dummy; - int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( - DataMessage_ClosedGroupControlMessage_Type_entries, - DataMessage_ClosedGroupControlMessage_Type_entries_by_number, - 7, value); - return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : - DataMessage_ClosedGroupControlMessage_Type_strings[idx].get(); -} -bool DataMessage_ClosedGroupControlMessage_Type_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_ClosedGroupControlMessage_Type* value) { - int int_value; - bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( - DataMessage_ClosedGroupControlMessage_Type_entries, 7, name, &int_value); - if (success) { - *value = static_cast(int_value); - } - return success; +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataMessage_Flags_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); + return file_level_enum_descriptors_SessionProtos_2eproto[7]; } -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -constexpr DataMessage_ClosedGroupControlMessage_Type DataMessage_ClosedGroupControlMessage::NEW; -constexpr DataMessage_ClosedGroupControlMessage_Type DataMessage_ClosedGroupControlMessage::ENCRYPTION_KEY_PAIR; -constexpr DataMessage_ClosedGroupControlMessage_Type DataMessage_ClosedGroupControlMessage::NAME_CHANGE; -constexpr DataMessage_ClosedGroupControlMessage_Type DataMessage_ClosedGroupControlMessage::MEMBERS_ADDED; -constexpr DataMessage_ClosedGroupControlMessage_Type DataMessage_ClosedGroupControlMessage::MEMBERS_REMOVED; -constexpr DataMessage_ClosedGroupControlMessage_Type DataMessage_ClosedGroupControlMessage::MEMBER_LEFT; -constexpr DataMessage_ClosedGroupControlMessage_Type DataMessage_ClosedGroupControlMessage::ENCRYPTION_KEY_PAIR_REQUEST; -constexpr DataMessage_ClosedGroupControlMessage_Type DataMessage_ClosedGroupControlMessage::Type_MIN; -constexpr DataMessage_ClosedGroupControlMessage_Type DataMessage_ClosedGroupControlMessage::Type_MAX; -constexpr int DataMessage_ClosedGroupControlMessage::Type_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) bool DataMessage_Flags_IsValid(int value) { switch (value) { case 2: @@ -934,50 +1230,16 @@ bool DataMessage_Flags_IsValid(int value) { } } -static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed DataMessage_Flags_strings[1] = {}; - -static const char DataMessage_Flags_names[] = - "EXPIRATION_TIMER_UPDATE"; - -static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry DataMessage_Flags_entries[] = { - { {DataMessage_Flags_names + 0, 23}, 2 }, -}; - -static const int DataMessage_Flags_entries_by_number[] = { - 0, // 2 -> EXPIRATION_TIMER_UPDATE -}; - -const std::string& DataMessage_Flags_Name( - DataMessage_Flags value) { - static const bool dummy = - ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( - DataMessage_Flags_entries, - DataMessage_Flags_entries_by_number, - 1, DataMessage_Flags_strings); - (void) dummy; - int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( - DataMessage_Flags_entries, - DataMessage_Flags_entries_by_number, - 1, value); - return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : - DataMessage_Flags_strings[idx].get(); -} -bool DataMessage_Flags_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_Flags* value) { - int int_value; - bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( - DataMessage_Flags_entries, 1, name, &int_value); - if (success) { - *value = static_cast(int_value); - } - return success; -} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr DataMessage_Flags DataMessage::EXPIRATION_TIMER_UPDATE; constexpr DataMessage_Flags DataMessage::Flags_MIN; constexpr DataMessage_Flags DataMessage::Flags_MAX; constexpr int DataMessage::Flags_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ReceiptMessage_Type_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); + return file_level_enum_descriptors_SessionProtos_2eproto[8]; +} bool ReceiptMessage_Type_IsValid(int value) { switch (value) { case 0: @@ -988,47 +1250,6 @@ bool ReceiptMessage_Type_IsValid(int value) { } } -static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed ReceiptMessage_Type_strings[2] = {}; - -static const char ReceiptMessage_Type_names[] = - "DELIVERY" - "READ"; - -static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry ReceiptMessage_Type_entries[] = { - { {ReceiptMessage_Type_names + 0, 8}, 0 }, - { {ReceiptMessage_Type_names + 8, 4}, 1 }, -}; - -static const int ReceiptMessage_Type_entries_by_number[] = { - 0, // 0 -> DELIVERY - 1, // 1 -> READ -}; - -const std::string& ReceiptMessage_Type_Name( - ReceiptMessage_Type value) { - static const bool dummy = - ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( - ReceiptMessage_Type_entries, - ReceiptMessage_Type_entries_by_number, - 2, ReceiptMessage_Type_strings); - (void) dummy; - int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( - ReceiptMessage_Type_entries, - ReceiptMessage_Type_entries_by_number, - 2, value); - return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : - ReceiptMessage_Type_strings[idx].get(); -} -bool ReceiptMessage_Type_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ReceiptMessage_Type* value) { - int int_value; - bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( - ReceiptMessage_Type_entries, 2, name, &int_value); - if (success) { - *value = static_cast(int_value); - } - return success; -} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr ReceiptMessage_Type ReceiptMessage::DELIVERY; constexpr ReceiptMessage_Type ReceiptMessage::READ; @@ -1036,6 +1257,10 @@ constexpr ReceiptMessage_Type ReceiptMessage::Type_MIN; constexpr ReceiptMessage_Type ReceiptMessage::Type_MAX; constexpr int ReceiptMessage::Type_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* AttachmentPointer_Flags_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); + return file_level_enum_descriptors_SessionProtos_2eproto[9]; +} bool AttachmentPointer_Flags_IsValid(int value) { switch (value) { case 1: @@ -1045,50 +1270,16 @@ bool AttachmentPointer_Flags_IsValid(int value) { } } -static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed AttachmentPointer_Flags_strings[1] = {}; - -static const char AttachmentPointer_Flags_names[] = - "VOICE_MESSAGE"; - -static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry AttachmentPointer_Flags_entries[] = { - { {AttachmentPointer_Flags_names + 0, 13}, 1 }, -}; - -static const int AttachmentPointer_Flags_entries_by_number[] = { - 0, // 1 -> VOICE_MESSAGE -}; - -const std::string& AttachmentPointer_Flags_Name( - AttachmentPointer_Flags value) { - static const bool dummy = - ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( - AttachmentPointer_Flags_entries, - AttachmentPointer_Flags_entries_by_number, - 1, AttachmentPointer_Flags_strings); - (void) dummy; - int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( - AttachmentPointer_Flags_entries, - AttachmentPointer_Flags_entries_by_number, - 1, value); - return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : - AttachmentPointer_Flags_strings[idx].get(); -} -bool AttachmentPointer_Flags_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, AttachmentPointer_Flags* value) { - int int_value; - bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( - AttachmentPointer_Flags_entries, 1, name, &int_value); - if (success) { - *value = static_cast(int_value); - } - return success; -} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr AttachmentPointer_Flags AttachmentPointer::VOICE_MESSAGE; constexpr AttachmentPointer_Flags AttachmentPointer::Flags_MIN; constexpr AttachmentPointer_Flags AttachmentPointer::Flags_MAX; constexpr int AttachmentPointer::Flags_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SharedConfigMessage_Kind_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); + return file_level_enum_descriptors_SessionProtos_2eproto[10]; +} bool SharedConfigMessage_Kind_IsValid(int value) { switch (value) { case 1: @@ -1101,53 +1292,6 @@ bool SharedConfigMessage_Kind_IsValid(int value) { } } -static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed SharedConfigMessage_Kind_strings[4] = {}; - -static const char SharedConfigMessage_Kind_names[] = - "CONTACTS" - "CONVO_INFO_VOLATILE" - "USER_GROUPS" - "USER_PROFILE"; - -static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry SharedConfigMessage_Kind_entries[] = { - { {SharedConfigMessage_Kind_names + 0, 8}, 2 }, - { {SharedConfigMessage_Kind_names + 8, 19}, 3 }, - { {SharedConfigMessage_Kind_names + 27, 11}, 4 }, - { {SharedConfigMessage_Kind_names + 38, 12}, 1 }, -}; - -static const int SharedConfigMessage_Kind_entries_by_number[] = { - 3, // 1 -> USER_PROFILE - 0, // 2 -> CONTACTS - 1, // 3 -> CONVO_INFO_VOLATILE - 2, // 4 -> USER_GROUPS -}; - -const std::string& SharedConfigMessage_Kind_Name( - SharedConfigMessage_Kind value) { - static const bool dummy = - ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( - SharedConfigMessage_Kind_entries, - SharedConfigMessage_Kind_entries_by_number, - 4, SharedConfigMessage_Kind_strings); - (void) dummy; - int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( - SharedConfigMessage_Kind_entries, - SharedConfigMessage_Kind_entries_by_number, - 4, value); - return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : - SharedConfigMessage_Kind_strings[idx].get(); -} -bool SharedConfigMessage_Kind_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, SharedConfigMessage_Kind* value) { - int int_value; - bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( - SharedConfigMessage_Kind_entries, 4, name, &int_value); - if (success) { - *value = static_cast(int_value); - } - return success; -} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr SharedConfigMessage_Kind SharedConfigMessage::USER_PROFILE; constexpr SharedConfigMessage_Kind SharedConfigMessage::CONTACTS; @@ -1157,7 +1301,53 @@ constexpr SharedConfigMessage_Kind SharedConfigMessage::Kind_MIN; constexpr SharedConfigMessage_Kind SharedConfigMessage::Kind_MAX; constexpr int SharedConfigMessage::Kind_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) - +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GroupUpdateInfoChangeMessage_Type_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); + return file_level_enum_descriptors_SessionProtos_2eproto[11]; +} +bool GroupUpdateInfoChangeMessage_Type_IsValid(int value) { + switch (value) { + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +constexpr GroupUpdateInfoChangeMessage_Type GroupUpdateInfoChangeMessage::NAME; +constexpr GroupUpdateInfoChangeMessage_Type GroupUpdateInfoChangeMessage::AVATAR; +constexpr GroupUpdateInfoChangeMessage_Type GroupUpdateInfoChangeMessage::DISAPPEARING_MESSAGES; +constexpr GroupUpdateInfoChangeMessage_Type GroupUpdateInfoChangeMessage::Type_MIN; +constexpr GroupUpdateInfoChangeMessage_Type GroupUpdateInfoChangeMessage::Type_MAX; +constexpr int GroupUpdateInfoChangeMessage::Type_ARRAYSIZE; +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GroupUpdateMemberChangeMessage_Type_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); + return file_level_enum_descriptors_SessionProtos_2eproto[12]; +} +bool GroupUpdateMemberChangeMessage_Type_IsValid(int value) { + switch (value) { + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +constexpr GroupUpdateMemberChangeMessage_Type GroupUpdateMemberChangeMessage::ADDED; +constexpr GroupUpdateMemberChangeMessage_Type GroupUpdateMemberChangeMessage::REMOVED; +constexpr GroupUpdateMemberChangeMessage_Type GroupUpdateMemberChangeMessage::PROMOTED; +constexpr GroupUpdateMemberChangeMessage_Type GroupUpdateMemberChangeMessage::Type_MIN; +constexpr GroupUpdateMemberChangeMessage_Type GroupUpdateMemberChangeMessage::Type_MAX; +constexpr int GroupUpdateMemberChangeMessage::Type_ARRAYSIZE; +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) + // =================================================================== class Envelope::_Internal { @@ -1188,12 +1378,12 @@ class Envelope::_Internal { Envelope::Envelope(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.Envelope) } Envelope::Envelope(const Envelope& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { + : ::PROTOBUF_NAMESPACE_ID::Message() { Envelope* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -1205,7 +1395,7 @@ Envelope::Envelope(const Envelope& from) , decltype(_impl_.sourcedevice_){} , decltype(_impl_.type_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); _impl_.source_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.source_.Set("", GetArenaForAllocation()); @@ -1254,7 +1444,7 @@ inline void Envelope::SharedCtor( Envelope::~Envelope() { // @@protoc_insertion_point(destructor:SessionProtos.Envelope) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } @@ -1293,7 +1483,7 @@ void Envelope::Clear() { _impl_.type_ = 6; } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } const char* Envelope::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -1322,6 +1512,9 @@ const char* Envelope::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) auto str = _internal_mutable_source(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.Envelope.source"); + #endif // !NDEBUG } else goto handle_unusual; continue; @@ -1372,7 +1565,7 @@ const char* Envelope::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -1401,6 +1594,10 @@ uint8_t* Envelope::_InternalSerialize( // optional string source = 2; if (cached_has_bits & 0x00000001u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_source().data(), static_cast(this->_internal_source().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.Envelope.source"); target = stream->WriteStringMaybeAliased( 2, this->_internal_source(), target); } @@ -1430,8 +1627,8 @@ uint8_t* Envelope::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.Envelope) return target; @@ -1502,22 +1699,19 @@ size_t Envelope::ByteSizeLong() const { } } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); - } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void Envelope::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Envelope::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Envelope::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Envelope::GetClassData() const { return &_class_data_; } -void Envelope::MergeFrom(const Envelope& from) { - Envelope* const _this = this; + +void Envelope::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.Envelope) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -1545,7 +1739,7 @@ void Envelope::MergeFrom(const Envelope& from) { } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } void Envelope::CopyFrom(const Envelope& from) { @@ -1583,11 +1777,12 @@ void Envelope::InternalSwap(Envelope* other) { swap(_impl_.type_, other->_impl_.type_); } -std::string Envelope::GetTypeName() const { - return "SessionProtos.Envelope"; +::PROTOBUF_NAMESPACE_ID::Metadata Envelope::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[0]); } - // =================================================================== class TypingMessage::_Internal { @@ -1606,12 +1801,12 @@ class TypingMessage::_Internal { TypingMessage::TypingMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.TypingMessage) } TypingMessage::TypingMessage(const TypingMessage& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { + : ::PROTOBUF_NAMESPACE_ID::Message() { TypingMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -1619,7 +1814,7 @@ TypingMessage::TypingMessage(const TypingMessage& from) , decltype(_impl_.timestamp_){} , decltype(_impl_.action_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); ::memcpy(&_impl_.timestamp_, &from._impl_.timestamp_, static_cast(reinterpret_cast(&_impl_.action_) - reinterpret_cast(&_impl_.timestamp_)) + sizeof(_impl_.action_)); @@ -1640,7 +1835,7 @@ inline void TypingMessage::SharedCtor( TypingMessage::~TypingMessage() { // @@protoc_insertion_point(destructor:SessionProtos.TypingMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } @@ -1668,7 +1863,7 @@ void TypingMessage::Clear() { reinterpret_cast(&_impl_.timestamp_)) + sizeof(_impl_.action_)); } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } const char* TypingMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -1711,7 +1906,7 @@ const char* TypingMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -1745,8 +1940,8 @@ uint8_t* TypingMessage::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.TypingMessage) return target; @@ -1788,22 +1983,19 @@ size_t TypingMessage::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); - } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void TypingMessage::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TypingMessage::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + TypingMessage::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TypingMessage::GetClassData() const { return &_class_data_; } + -void TypingMessage::MergeFrom(const TypingMessage& from) { - TypingMessage* const _this = this; +void TypingMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.TypingMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -1819,7 +2011,7 @@ void TypingMessage::MergeFrom(const TypingMessage& from) { } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } void TypingMessage::CopyFrom(const TypingMessage& from) { @@ -1846,11 +2038,12 @@ void TypingMessage::InternalSwap(TypingMessage* other) { reinterpret_cast(&other->_impl_.timestamp_)); } -std::string TypingMessage::GetTypeName() const { - return "SessionProtos.TypingMessage"; +::PROTOBUF_NAMESPACE_ID::Metadata TypingMessage::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[1]); } - // =================================================================== class UnsendRequest::_Internal { @@ -1869,12 +2062,12 @@ class UnsendRequest::_Internal { UnsendRequest::UnsendRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.UnsendRequest) } UnsendRequest::UnsendRequest(const UnsendRequest& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { + : ::PROTOBUF_NAMESPACE_ID::Message() { UnsendRequest* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -1882,7 +2075,7 @@ UnsendRequest::UnsendRequest(const UnsendRequest& from) , decltype(_impl_.author_){} , decltype(_impl_.timestamp_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); _impl_.author_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.author_.Set("", GetArenaForAllocation()); @@ -1913,7 +2106,7 @@ inline void UnsendRequest::SharedCtor( UnsendRequest::~UnsendRequest() { // @@protoc_insertion_point(destructor:SessionProtos.UnsendRequest) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } @@ -1941,7 +2134,7 @@ void UnsendRequest::Clear() { } _impl_.timestamp_ = uint64_t{0u}; _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } const char* UnsendRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -1966,6 +2159,9 @@ const char* UnsendRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* auto str = _internal_mutable_author(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.UnsendRequest.author"); + #endif // !NDEBUG } else goto handle_unusual; continue; @@ -1980,7 +2176,7 @@ const char* UnsendRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -2008,13 +2204,17 @@ uint8_t* UnsendRequest::_InternalSerialize( // required string author = 2; if (cached_has_bits & 0x00000001u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_author().data(), static_cast(this->_internal_author().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.UnsendRequest.author"); target = stream->WriteStringMaybeAliased( 2, this->_internal_author(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.UnsendRequest) return target; @@ -2058,22 +2258,19 @@ size_t UnsendRequest::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); - } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void UnsendRequest::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData UnsendRequest::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + UnsendRequest::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*UnsendRequest::GetClassData() const { return &_class_data_; } -void UnsendRequest::MergeFrom(const UnsendRequest& from) { - UnsendRequest* const _this = this; + +void UnsendRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.UnsendRequest) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -2089,7 +2286,7 @@ void UnsendRequest::MergeFrom(const UnsendRequest& from) { } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } void UnsendRequest::CopyFrom(const UnsendRequest& from) { @@ -2117,11 +2314,12 @@ void UnsendRequest::InternalSwap(UnsendRequest* other) { swap(_impl_.timestamp_, other->_impl_.timestamp_); } -std::string UnsendRequest::GetTypeName() const { - return "SessionProtos.UnsendRequest"; +::PROTOBUF_NAMESPACE_ID::Metadata UnsendRequest::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[2]); } - // =================================================================== class MessageRequestResponse::_Internal { @@ -2148,12 +2346,12 @@ MessageRequestResponse::_Internal::profile(const MessageRequestResponse* msg) { } MessageRequestResponse::MessageRequestResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.MessageRequestResponse) } MessageRequestResponse::MessageRequestResponse(const MessageRequestResponse& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { + : ::PROTOBUF_NAMESPACE_ID::Message() { MessageRequestResponse* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -2162,7 +2360,7 @@ MessageRequestResponse::MessageRequestResponse(const MessageRequestResponse& fro , decltype(_impl_.profile_){nullptr} , decltype(_impl_.isapproved_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); _impl_.profilekey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.profilekey_.Set("", GetArenaForAllocation()); @@ -2197,7 +2395,7 @@ inline void MessageRequestResponse::SharedCtor( MessageRequestResponse::~MessageRequestResponse() { // @@protoc_insertion_point(destructor:SessionProtos.MessageRequestResponse) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } @@ -2232,7 +2430,7 @@ void MessageRequestResponse::Clear() { } _impl_.isapproved_ = false; _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } const char* MessageRequestResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -2279,7 +2477,7 @@ const char* MessageRequestResponse::_InternalParse(const char* ptr, ::_pbi::Pars } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -2319,8 +2517,8 @@ uint8_t* MessageRequestResponse::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.MessageRequestResponse) return target; @@ -2355,22 +2553,19 @@ size_t MessageRequestResponse::ByteSizeLong() const { } } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); - } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void MessageRequestResponse::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MessageRequestResponse::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + MessageRequestResponse::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*MessageRequestResponse::GetClassData() const { return &_class_data_; } + -void MessageRequestResponse::MergeFrom(const MessageRequestResponse& from) { - MessageRequestResponse* const _this = this; +void MessageRequestResponse::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.MessageRequestResponse) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -2390,7 +2585,7 @@ void MessageRequestResponse::MergeFrom(const MessageRequestResponse& from) { } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } void MessageRequestResponse::CopyFrom(const MessageRequestResponse& from) { @@ -2423,207 +2618,341 @@ void MessageRequestResponse::InternalSwap(MessageRequestResponse* other) { reinterpret_cast(&other->_impl_.profile_)); } -std::string MessageRequestResponse::GetTypeName() const { - return "SessionProtos.MessageRequestResponse"; +::PROTOBUF_NAMESPACE_ID::Metadata MessageRequestResponse::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[3]); } - // =================================================================== -class ProProof::_Internal { +class Content::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_version(HasBits* has_bits) { - (*has_bits)[0] |= 16u; - } - static void set_has_genindexhash(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static const ::SessionProtos::DataMessage& datamessage(const Content* msg); + static void set_has_datamessage(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_rotatingpublickey(HasBits* has_bits) { + static const ::SessionProtos::CallMessage& callmessage(const Content* msg); + static void set_has_callmessage(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static void set_has_expiryunixts(HasBits* has_bits) { + static const ::SessionProtos::ReceiptMessage& receiptmessage(const Content* msg); + static void set_has_receiptmessage(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static const ::SessionProtos::TypingMessage& typingmessage(const Content* msg); + static void set_has_typingmessage(HasBits* has_bits) { (*has_bits)[0] |= 8u; } - static void set_has_sig(HasBits* has_bits) { - (*has_bits)[0] |= 4u; + static const ::SessionProtos::DataExtractionNotification& dataextractionnotification(const Content* msg); + static void set_has_dataextractionnotification(HasBits* has_bits) { + (*has_bits)[0] |= 16u; } - static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x0000001f) ^ 0x0000001f) != 0; + static const ::SessionProtos::UnsendRequest& unsendrequest(const Content* msg); + static void set_has_unsendrequest(HasBits* has_bits) { + (*has_bits)[0] |= 32u; + } + static const ::SessionProtos::MessageRequestResponse& messagerequestresponse(const Content* msg); + static void set_has_messagerequestresponse(HasBits* has_bits) { + (*has_bits)[0] |= 64u; + } + static const ::SessionProtos::SharedConfigMessage& sharedconfigmessage(const Content* msg); + static void set_has_sharedconfigmessage(HasBits* has_bits) { + (*has_bits)[0] |= 128u; + } + static void set_has_expirationtype(HasBits* has_bits) { + (*has_bits)[0] |= 256u; + } + static void set_has_expirationtimer(HasBits* has_bits) { + (*has_bits)[0] |= 512u; + } + static void set_has_sigtimestamp(HasBits* has_bits) { + (*has_bits)[0] |= 1024u; } }; -ProProof::ProProof(::PROTOBUF_NAMESPACE_ID::Arena* arena, +const ::SessionProtos::DataMessage& +Content::_Internal::datamessage(const Content* msg) { + return *msg->_impl_.datamessage_; +} +const ::SessionProtos::CallMessage& +Content::_Internal::callmessage(const Content* msg) { + return *msg->_impl_.callmessage_; +} +const ::SessionProtos::ReceiptMessage& +Content::_Internal::receiptmessage(const Content* msg) { + return *msg->_impl_.receiptmessage_; +} +const ::SessionProtos::TypingMessage& +Content::_Internal::typingmessage(const Content* msg) { + return *msg->_impl_.typingmessage_; +} +const ::SessionProtos::DataExtractionNotification& +Content::_Internal::dataextractionnotification(const Content* msg) { + return *msg->_impl_.dataextractionnotification_; +} +const ::SessionProtos::UnsendRequest& +Content::_Internal::unsendrequest(const Content* msg) { + return *msg->_impl_.unsendrequest_; +} +const ::SessionProtos::MessageRequestResponse& +Content::_Internal::messagerequestresponse(const Content* msg) { + return *msg->_impl_.messagerequestresponse_; +} +const ::SessionProtos::SharedConfigMessage& +Content::_Internal::sharedconfigmessage(const Content* msg) { + return *msg->_impl_.sharedconfigmessage_; +} +Content::Content(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.ProProof) + // @@protoc_insertion_point(arena_constructor:SessionProtos.Content) } -ProProof::ProProof(const ProProof& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - ProProof* const _this = this; (void)_this; +Content::Content(const Content& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Content* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.genindexhash_){} - , decltype(_impl_.rotatingpublickey_){} - , decltype(_impl_.sig_){} - , decltype(_impl_.expiryunixts_){} - , decltype(_impl_.version_){}}; - - _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.genindexhash_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.genindexhash_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_genindexhash()) { - _this->_impl_.genindexhash_.Set(from._internal_genindexhash(), - _this->GetArenaForAllocation()); + , decltype(_impl_.datamessage_){nullptr} + , decltype(_impl_.callmessage_){nullptr} + , decltype(_impl_.receiptmessage_){nullptr} + , decltype(_impl_.typingmessage_){nullptr} + , decltype(_impl_.dataextractionnotification_){nullptr} + , decltype(_impl_.unsendrequest_){nullptr} + , decltype(_impl_.messagerequestresponse_){nullptr} + , decltype(_impl_.sharedconfigmessage_){nullptr} + , decltype(_impl_.expirationtype_){} + , decltype(_impl_.expirationtimer_){} + , decltype(_impl_.sigtimestamp_){}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_datamessage()) { + _this->_impl_.datamessage_ = new ::SessionProtos::DataMessage(*from._impl_.datamessage_); } - _impl_.rotatingpublickey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_rotatingpublickey()) { - _this->_impl_.rotatingpublickey_.Set(from._internal_rotatingpublickey(), - _this->GetArenaForAllocation()); + if (from._internal_has_callmessage()) { + _this->_impl_.callmessage_ = new ::SessionProtos::CallMessage(*from._impl_.callmessage_); } - _impl_.sig_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.sig_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_sig()) { - _this->_impl_.sig_.Set(from._internal_sig(), - _this->GetArenaForAllocation()); + if (from._internal_has_receiptmessage()) { + _this->_impl_.receiptmessage_ = new ::SessionProtos::ReceiptMessage(*from._impl_.receiptmessage_); + } + if (from._internal_has_typingmessage()) { + _this->_impl_.typingmessage_ = new ::SessionProtos::TypingMessage(*from._impl_.typingmessage_); + } + if (from._internal_has_dataextractionnotification()) { + _this->_impl_.dataextractionnotification_ = new ::SessionProtos::DataExtractionNotification(*from._impl_.dataextractionnotification_); + } + if (from._internal_has_unsendrequest()) { + _this->_impl_.unsendrequest_ = new ::SessionProtos::UnsendRequest(*from._impl_.unsendrequest_); + } + if (from._internal_has_messagerequestresponse()) { + _this->_impl_.messagerequestresponse_ = new ::SessionProtos::MessageRequestResponse(*from._impl_.messagerequestresponse_); + } + if (from._internal_has_sharedconfigmessage()) { + _this->_impl_.sharedconfigmessage_ = new ::SessionProtos::SharedConfigMessage(*from._impl_.sharedconfigmessage_); } - ::memcpy(&_impl_.expiryunixts_, &from._impl_.expiryunixts_, - static_cast(reinterpret_cast(&_impl_.version_) - - reinterpret_cast(&_impl_.expiryunixts_)) + sizeof(_impl_.version_)); - // @@protoc_insertion_point(copy_constructor:SessionProtos.ProProof) + ::memcpy(&_impl_.expirationtype_, &from._impl_.expirationtype_, + static_cast(reinterpret_cast(&_impl_.sigtimestamp_) - + reinterpret_cast(&_impl_.expirationtype_)) + sizeof(_impl_.sigtimestamp_)); + // @@protoc_insertion_point(copy_constructor:SessionProtos.Content) } -inline void ProProof::SharedCtor( +inline void Content::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.genindexhash_){} - , decltype(_impl_.rotatingpublickey_){} - , decltype(_impl_.sig_){} - , decltype(_impl_.expiryunixts_){uint64_t{0u}} - , decltype(_impl_.version_){0u} + , decltype(_impl_.datamessage_){nullptr} + , decltype(_impl_.callmessage_){nullptr} + , decltype(_impl_.receiptmessage_){nullptr} + , decltype(_impl_.typingmessage_){nullptr} + , decltype(_impl_.dataextractionnotification_){nullptr} + , decltype(_impl_.unsendrequest_){nullptr} + , decltype(_impl_.messagerequestresponse_){nullptr} + , decltype(_impl_.sharedconfigmessage_){nullptr} + , decltype(_impl_.expirationtype_){0} + , decltype(_impl_.expirationtimer_){0u} + , decltype(_impl_.sigtimestamp_){uint64_t{0u}} }; - _impl_.genindexhash_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.genindexhash_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.rotatingpublickey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.sig_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.sig_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -ProProof::~ProProof() { - // @@protoc_insertion_point(destructor:SessionProtos.ProProof) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +Content::~Content() { + // @@protoc_insertion_point(destructor:SessionProtos.Content) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void ProProof::SharedDtor() { +inline void Content::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.genindexhash_.Destroy(); - _impl_.rotatingpublickey_.Destroy(); - _impl_.sig_.Destroy(); + if (this != internal_default_instance()) delete _impl_.datamessage_; + if (this != internal_default_instance()) delete _impl_.callmessage_; + if (this != internal_default_instance()) delete _impl_.receiptmessage_; + if (this != internal_default_instance()) delete _impl_.typingmessage_; + if (this != internal_default_instance()) delete _impl_.dataextractionnotification_; + if (this != internal_default_instance()) delete _impl_.unsendrequest_; + if (this != internal_default_instance()) delete _impl_.messagerequestresponse_; + if (this != internal_default_instance()) delete _impl_.sharedconfigmessage_; } -void ProProof::SetCachedSize(int size) const { +void Content::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void ProProof::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.ProProof) +void Content::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.Content) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x000000ffu) { if (cached_has_bits & 0x00000001u) { - _impl_.genindexhash_.ClearNonDefaultToEmpty(); + GOOGLE_DCHECK(_impl_.datamessage_ != nullptr); + _impl_.datamessage_->Clear(); } if (cached_has_bits & 0x00000002u) { - _impl_.rotatingpublickey_.ClearNonDefaultToEmpty(); + GOOGLE_DCHECK(_impl_.callmessage_ != nullptr); + _impl_.callmessage_->Clear(); } if (cached_has_bits & 0x00000004u) { - _impl_.sig_.ClearNonDefaultToEmpty(); + GOOGLE_DCHECK(_impl_.receiptmessage_ != nullptr); + _impl_.receiptmessage_->Clear(); + } + if (cached_has_bits & 0x00000008u) { + GOOGLE_DCHECK(_impl_.typingmessage_ != nullptr); + _impl_.typingmessage_->Clear(); + } + if (cached_has_bits & 0x00000010u) { + GOOGLE_DCHECK(_impl_.dataextractionnotification_ != nullptr); + _impl_.dataextractionnotification_->Clear(); + } + if (cached_has_bits & 0x00000020u) { + GOOGLE_DCHECK(_impl_.unsendrequest_ != nullptr); + _impl_.unsendrequest_->Clear(); + } + if (cached_has_bits & 0x00000040u) { + GOOGLE_DCHECK(_impl_.messagerequestresponse_ != nullptr); + _impl_.messagerequestresponse_->Clear(); + } + if (cached_has_bits & 0x00000080u) { + GOOGLE_DCHECK(_impl_.sharedconfigmessage_ != nullptr); + _impl_.sharedconfigmessage_->Clear(); } } - if (cached_has_bits & 0x00000018u) { - ::memset(&_impl_.expiryunixts_, 0, static_cast( - reinterpret_cast(&_impl_.version_) - - reinterpret_cast(&_impl_.expiryunixts_)) + sizeof(_impl_.version_)); + if (cached_has_bits & 0x00000700u) { + ::memset(&_impl_.expirationtype_, 0, static_cast( + reinterpret_cast(&_impl_.sigtimestamp_) - + reinterpret_cast(&_impl_.expirationtype_)) + sizeof(_impl_.sigtimestamp_)); } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ProProof::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* Content::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required uint32 version = 1; + // optional .SessionProtos.DataMessage dataMessage = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _Internal::set_has_version(&has_bits); - _impl_.version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // required bytes genIndexHash = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_genindexhash(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_datamessage(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // required bytes rotatingPublicKey = 3; + // optional .SessionProtos.CallMessage callMessage = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_rotatingpublickey(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + ptr = ctx->ParseMessage(_internal_mutable_callmessage(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // required uint64 expiryUnixTs = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - _Internal::set_has_expiryunixts(&has_bits); - _impl_.expiryunixts_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + // optional .SessionProtos.ReceiptMessage receiptMessage = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + ptr = ctx->ParseMessage(_internal_mutable_receiptmessage(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // required bytes sig = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { - auto str = _internal_mutable_sig(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + // optional .SessionProtos.TypingMessage typingMessage = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { + ptr = ctx->ParseMessage(_internal_mutable_typingmessage(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { + ptr = ctx->ParseMessage(_internal_mutable_dataextractionnotification(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.UnsendRequest unsendRequest = 9; + case 9: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { + ptr = ctx->ParseMessage(_internal_mutable_unsendrequest(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; + case 10: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 82)) { + ptr = ctx->ParseMessage(_internal_mutable_messagerequestresponse(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; + case 11: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 90)) { + ptr = ctx->ParseMessage(_internal_mutable_sharedconfigmessage(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.Content.ExpirationType expirationType = 12; + case 12: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 96)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + if (PROTOBUF_PREDICT_TRUE(::SessionProtos::Content_ExpirationType_IsValid(val))) { + _internal_set_expirationtype(static_cast<::SessionProtos::Content_ExpirationType>(val)); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(12, val, mutable_unknown_fields()); + } + } else + goto handle_unusual; + continue; + // optional uint32 expirationTimer = 13; + case 13: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 104)) { + _Internal::set_has_expirationtimer(&has_bits); + _impl_.expirationtimer_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional uint64 sigTimestamp = 15; + case 15: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 120)) { + _Internal::set_has_sigtimestamp(&has_bits); + _impl_.sigtimestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else goto handle_unusual; @@ -2639,7 +2968,7 @@ const char* ProProof::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -2652,334 +2981,488 @@ const char* ProProof::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) #undef CHK_ } -uint8_t* ProProof::_InternalSerialize( +uint8_t* Content::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ProProof) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.Content) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required uint32 version = 1; - if (cached_has_bits & 0x00000010u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_version(), target); - } - - // required bytes genIndexHash = 2; + // optional .SessionProtos.DataMessage dataMessage = 1; if (cached_has_bits & 0x00000001u) { - target = stream->WriteBytesMaybeAliased( - 2, this->_internal_genindexhash(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::datamessage(this), + _Internal::datamessage(this).GetCachedSize(), target, stream); } - // required bytes rotatingPublicKey = 3; + // optional .SessionProtos.CallMessage callMessage = 3; if (cached_has_bits & 0x00000002u) { - target = stream->WriteBytesMaybeAliased( - 3, this->_internal_rotatingpublickey(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::callmessage(this), + _Internal::callmessage(this).GetCachedSize(), target, stream); } - // required uint64 expiryUnixTs = 4; - if (cached_has_bits & 0x00000008u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_expiryunixts(), target); + // optional .SessionProtos.ReceiptMessage receiptMessage = 5; + if (cached_has_bits & 0x00000004u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(5, _Internal::receiptmessage(this), + _Internal::receiptmessage(this).GetCachedSize(), target, stream); } - // required bytes sig = 5; - if (cached_has_bits & 0x00000004u) { - target = stream->WriteBytesMaybeAliased( - 5, this->_internal_sig(), target); + // optional .SessionProtos.TypingMessage typingMessage = 6; + if (cached_has_bits & 0x00000008u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(6, _Internal::typingmessage(this), + _Internal::typingmessage(this).GetCachedSize(), target, stream); } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + // optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; + if (cached_has_bits & 0x00000010u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(8, _Internal::dataextractionnotification(this), + _Internal::dataextractionnotification(this).GetCachedSize(), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ProProof) - return target; -} -size_t ProProof::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.ProProof) - size_t total_size = 0; + // optional .SessionProtos.UnsendRequest unsendRequest = 9; + if (cached_has_bits & 0x00000020u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(9, _Internal::unsendrequest(this), + _Internal::unsendrequest(this).GetCachedSize(), target, stream); + } - if (_internal_has_genindexhash()) { - // required bytes genIndexHash = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_genindexhash()); + // optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; + if (cached_has_bits & 0x00000040u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(10, _Internal::messagerequestresponse(this), + _Internal::messagerequestresponse(this).GetCachedSize(), target, stream); } - if (_internal_has_rotatingpublickey()) { - // required bytes rotatingPublicKey = 3; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_rotatingpublickey()); + // optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; + if (cached_has_bits & 0x00000080u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(11, _Internal::sharedconfigmessage(this), + _Internal::sharedconfigmessage(this).GetCachedSize(), target, stream); } - if (_internal_has_sig()) { - // required bytes sig = 5; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_sig()); + // optional .SessionProtos.Content.ExpirationType expirationType = 12; + if (cached_has_bits & 0x00000100u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 12, this->_internal_expirationtype(), target); } - if (_internal_has_expiryunixts()) { - // required uint64 expiryUnixTs = 4; - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_expiryunixts()); + // optional uint32 expirationTimer = 13; + if (cached_has_bits & 0x00000200u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(13, this->_internal_expirationtimer(), target); } - if (_internal_has_version()) { - // required uint32 version = 1; - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_version()); + // optional uint64 sigTimestamp = 15; + if (cached_has_bits & 0x00000400u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(15, this->_internal_sigtimestamp(), target); } - return total_size; + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.Content) + return target; } -size_t ProProof::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ProProof) + +size_t Content::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.Content) size_t total_size = 0; - if (((_impl_._has_bits_[0] & 0x0000001f) ^ 0x0000001f) == 0) { // All required fields are present. - // required bytes genIndexHash = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_genindexhash()); + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; - // required bytes rotatingPublicKey = 3; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_rotatingpublickey()); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x000000ffu) { + // optional .SessionProtos.DataMessage dataMessage = 1; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.datamessage_); + } - // required bytes sig = 5; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_sig()); + // optional .SessionProtos.CallMessage callMessage = 3; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.callmessage_); + } + + // optional .SessionProtos.ReceiptMessage receiptMessage = 5; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.receiptmessage_); + } + + // optional .SessionProtos.TypingMessage typingMessage = 6; + if (cached_has_bits & 0x00000008u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.typingmessage_); + } - // required uint64 expiryUnixTs = 4; - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_expiryunixts()); + // optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; + if (cached_has_bits & 0x00000010u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.dataextractionnotification_); + } - // required uint32 version = 1; - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_version()); + // optional .SessionProtos.UnsendRequest unsendRequest = 9; + if (cached_has_bits & 0x00000020u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.unsendrequest_); + } + + // optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; + if (cached_has_bits & 0x00000040u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.messagerequestresponse_); + } + + // optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; + if (cached_has_bits & 0x00000080u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.sharedconfigmessage_); + } - } else { - total_size += RequiredFieldsByteSizeFallback(); } - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; + if (cached_has_bits & 0x00000700u) { + // optional .SessionProtos.Content.ExpirationType expirationType = 12; + if (cached_has_bits & 0x00000100u) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_expirationtype()); + } + + // optional uint32 expirationTimer = 13; + if (cached_has_bits & 0x00000200u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_expirationtimer()); + } + + // optional uint64 sigTimestamp = 15; + if (cached_has_bits & 0x00000400u) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_sigtimestamp()); + } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void ProProof::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Content::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Content::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Content::GetClassData() const { return &_class_data_; } -void ProProof::MergeFrom(const ProProof& from) { - ProProof* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ProProof) + +void Content::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.Content) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x0000001fu) { + if (cached_has_bits & 0x000000ffu) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_genindexhash(from._internal_genindexhash()); + _this->_internal_mutable_datamessage()->::SessionProtos::DataMessage::MergeFrom( + from._internal_datamessage()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_rotatingpublickey(from._internal_rotatingpublickey()); + _this->_internal_mutable_callmessage()->::SessionProtos::CallMessage::MergeFrom( + from._internal_callmessage()); } if (cached_has_bits & 0x00000004u) { - _this->_internal_set_sig(from._internal_sig()); + _this->_internal_mutable_receiptmessage()->::SessionProtos::ReceiptMessage::MergeFrom( + from._internal_receiptmessage()); } if (cached_has_bits & 0x00000008u) { - _this->_impl_.expiryunixts_ = from._impl_.expiryunixts_; + _this->_internal_mutable_typingmessage()->::SessionProtos::TypingMessage::MergeFrom( + from._internal_typingmessage()); } if (cached_has_bits & 0x00000010u) { - _this->_impl_.version_ = from._impl_.version_; + _this->_internal_mutable_dataextractionnotification()->::SessionProtos::DataExtractionNotification::MergeFrom( + from._internal_dataextractionnotification()); + } + if (cached_has_bits & 0x00000020u) { + _this->_internal_mutable_unsendrequest()->::SessionProtos::UnsendRequest::MergeFrom( + from._internal_unsendrequest()); + } + if (cached_has_bits & 0x00000040u) { + _this->_internal_mutable_messagerequestresponse()->::SessionProtos::MessageRequestResponse::MergeFrom( + from._internal_messagerequestresponse()); + } + if (cached_has_bits & 0x00000080u) { + _this->_internal_mutable_sharedconfigmessage()->::SessionProtos::SharedConfigMessage::MergeFrom( + from._internal_sharedconfigmessage()); + } + } + if (cached_has_bits & 0x00000700u) { + if (cached_has_bits & 0x00000100u) { + _this->_impl_.expirationtype_ = from._impl_.expirationtype_; + } + if (cached_has_bits & 0x00000200u) { + _this->_impl_.expirationtimer_ = from._impl_.expirationtimer_; + } + if (cached_has_bits & 0x00000400u) { + _this->_impl_.sigtimestamp_ = from._impl_.sigtimestamp_; } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void ProProof::CopyFrom(const ProProof& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ProProof) +void Content::CopyFrom(const Content& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.Content) if (&from == this) return; Clear(); MergeFrom(from); } -bool ProProof::IsInitialized() const { - if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; - return true; -} - -void ProProof::InternalSwap(ProProof* other) { - using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.genindexhash_, lhs_arena, - &other->_impl_.genindexhash_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.rotatingpublickey_, lhs_arena, - &other->_impl_.rotatingpublickey_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.sig_, lhs_arena, - &other->_impl_.sig_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(ProProof, _impl_.version_) - + sizeof(ProProof::_impl_.version_) - - PROTOBUF_FIELD_OFFSET(ProProof, _impl_.expiryunixts_)>( - reinterpret_cast(&_impl_.expiryunixts_), - reinterpret_cast(&other->_impl_.expiryunixts_)); +bool Content::IsInitialized() const { + if (_internal_has_datamessage()) { + if (!_impl_.datamessage_->IsInitialized()) return false; + } + if (_internal_has_callmessage()) { + if (!_impl_.callmessage_->IsInitialized()) return false; + } + if (_internal_has_receiptmessage()) { + if (!_impl_.receiptmessage_->IsInitialized()) return false; + } + if (_internal_has_typingmessage()) { + if (!_impl_.typingmessage_->IsInitialized()) return false; + } + if (_internal_has_dataextractionnotification()) { + if (!_impl_.dataextractionnotification_->IsInitialized()) return false; + } + if (_internal_has_unsendrequest()) { + if (!_impl_.unsendrequest_->IsInitialized()) return false; + } + if (_internal_has_messagerequestresponse()) { + if (!_impl_.messagerequestresponse_->IsInitialized()) return false; + } + if (_internal_has_sharedconfigmessage()) { + if (!_impl_.sharedconfigmessage_->IsInitialized()) return false; + } + return true; } -std::string ProProof::GetTypeName() const { - return "SessionProtos.ProProof"; +void Content::InternalSwap(Content* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(Content, _impl_.sigtimestamp_) + + sizeof(Content::_impl_.sigtimestamp_) + - PROTOBUF_FIELD_OFFSET(Content, _impl_.datamessage_)>( + reinterpret_cast(&_impl_.datamessage_), + reinterpret_cast(&other->_impl_.datamessage_)); } +::PROTOBUF_NAMESPACE_ID::Metadata Content::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[4]); +} // =================================================================== -class ProConfig::_Internal { +class CallMessage::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_rotatingprivkey(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } - static const ::SessionProtos::ProProof& proof(const ProConfig* msg); - static void set_has_proof(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_type(HasBits* has_bits) { (*has_bits)[0] |= 2u; } + static void set_has_uuid(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } static bool MissingRequiredFields(const HasBits& has_bits) { return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; } }; -const ::SessionProtos::ProProof& -ProConfig::_Internal::proof(const ProConfig* msg) { - return *msg->_impl_.proof_; -} -ProConfig::ProConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena, +CallMessage::CallMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.ProConfig) + // @@protoc_insertion_point(arena_constructor:SessionProtos.CallMessage) } -ProConfig::ProConfig(const ProConfig& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - ProConfig* const _this = this; (void)_this; +CallMessage::CallMessage(const CallMessage& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + CallMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.rotatingprivkey_){} - , decltype(_impl_.proof_){nullptr}}; + , decltype(_impl_.sdps_){from._impl_.sdps_} + , decltype(_impl_.sdpmlineindexes_){from._impl_.sdpmlineindexes_} + , decltype(_impl_.sdpmids_){from._impl_.sdpmids_} + , decltype(_impl_.uuid_){} + , decltype(_impl_.type_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.rotatingprivkey_.InitDefault(); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.uuid_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); + _impl_.uuid_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_rotatingprivkey()) { - _this->_impl_.rotatingprivkey_.Set(from._internal_rotatingprivkey(), + if (from._internal_has_uuid()) { + _this->_impl_.uuid_.Set(from._internal_uuid(), _this->GetArenaForAllocation()); } - if (from._internal_has_proof()) { - _this->_impl_.proof_ = new ::SessionProtos::ProProof(*from._impl_.proof_); - } - // @@protoc_insertion_point(copy_constructor:SessionProtos.ProConfig) + _this->_impl_.type_ = from._impl_.type_; + // @@protoc_insertion_point(copy_constructor:SessionProtos.CallMessage) } -inline void ProConfig::SharedCtor( +inline void CallMessage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.rotatingprivkey_){} - , decltype(_impl_.proof_){nullptr} + , decltype(_impl_.sdps_){arena} + , decltype(_impl_.sdpmlineindexes_){arena} + , decltype(_impl_.sdpmids_){arena} + , decltype(_impl_.uuid_){} + , decltype(_impl_.type_){6} }; - _impl_.rotatingprivkey_.InitDefault(); + _impl_.uuid_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); + _impl_.uuid_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -ProConfig::~ProConfig() { - // @@protoc_insertion_point(destructor:SessionProtos.ProConfig) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +CallMessage::~CallMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.CallMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void ProConfig::SharedDtor() { +inline void CallMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.rotatingprivkey_.Destroy(); - if (this != internal_default_instance()) delete _impl_.proof_; + _impl_.sdps_.~RepeatedPtrField(); + _impl_.sdpmlineindexes_.~RepeatedField(); + _impl_.sdpmids_.~RepeatedPtrField(); + _impl_.uuid_.Destroy(); } -void ProConfig::SetCachedSize(int size) const { +void CallMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void ProConfig::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.ProConfig) +void CallMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.CallMessage) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + _impl_.sdps_.Clear(); + _impl_.sdpmlineindexes_.Clear(); + _impl_.sdpmids_.Clear(); cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _impl_.rotatingprivkey_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(_impl_.proof_ != nullptr); - _impl_.proof_->Clear(); + _impl_.uuid_.ClearNonDefaultToEmpty(); } + _impl_.type_ = 6; } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ProConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* CallMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required bytes rotatingPrivKey = 1; + // required .SessionProtos.CallMessage.Type type = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_rotatingprivkey(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); + if (PROTOBUF_PREDICT_TRUE(::SessionProtos::CallMessage_Type_IsValid(val))) { + _internal_set_type(static_cast<::SessionProtos::CallMessage_Type>(val)); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields()); + } } else goto handle_unusual; continue; - // required .SessionProtos.ProProof proof = 2; + // repeated string sdps = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - ptr = ctx->ParseMessage(_internal_mutable_proof(), ptr); + ptr -= 1; + do { + ptr += 1; + auto str = _internal_add_sdps(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.CallMessage.sdps"); + #endif // !NDEBUG + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); + } else + goto handle_unusual; + continue; + // repeated uint32 sdpMLineIndexes = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + ptr -= 1; + do { + ptr += 1; + _internal_add_sdpmlineindexes(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr)); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<24>(ptr)); + } else if (static_cast(tag) == 26) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_sdpmlineindexes(), ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // repeated string sdpMids = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr -= 1; + do { + ptr += 1; + auto str = _internal_add_sdpmids(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.CallMessage.sdpMids"); + #endif // !NDEBUG + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); + } else + goto handle_unusual; + continue; + // required string uuid = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + auto str = _internal_mutable_uuid(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.CallMessage.uuid"); + #endif // !NDEBUG } else goto handle_unusual; continue; @@ -2994,7 +3477,7 @@ const char* ProConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -3007,68 +3490,96 @@ const char* ProConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx #undef CHK_ } -uint8_t* ProConfig::_InternalSerialize( +uint8_t* CallMessage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ProConfig) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.CallMessage) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required bytes rotatingPrivKey = 1; - if (cached_has_bits & 0x00000001u) { - target = stream->WriteBytesMaybeAliased( - 1, this->_internal_rotatingprivkey(), target); + // required .SessionProtos.CallMessage.Type type = 1; + if (cached_has_bits & 0x00000002u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this->_internal_type(), target); } - // required .SessionProtos.ProProof proof = 2; - if (cached_has_bits & 0x00000002u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::proof(this), - _Internal::proof(this).GetCachedSize(), target, stream); + // repeated string sdps = 2; + for (int i = 0, n = this->_internal_sdps_size(); i < n; i++) { + const auto& s = this->_internal_sdps(i); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + s.data(), static_cast(s.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.CallMessage.sdps"); + target = stream->WriteString(2, s, target); + } + + // repeated uint32 sdpMLineIndexes = 3; + for (int i = 0, n = this->_internal_sdpmlineindexes_size(); i < n; i++) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_sdpmlineindexes(i), target); + } + + // repeated string sdpMids = 4; + for (int i = 0, n = this->_internal_sdpmids_size(); i < n; i++) { + const auto& s = this->_internal_sdpmids(i); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + s.data(), static_cast(s.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.CallMessage.sdpMids"); + target = stream->WriteString(4, s, target); + } + + // required string uuid = 5; + if (cached_has_bits & 0x00000001u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_uuid().data(), static_cast(this->_internal_uuid().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.CallMessage.uuid"); + target = stream->WriteStringMaybeAliased( + 5, this->_internal_uuid(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ProConfig) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.CallMessage) return target; } -size_t ProConfig::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.ProConfig) +size_t CallMessage::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.CallMessage) size_t total_size = 0; - if (_internal_has_rotatingprivkey()) { - // required bytes rotatingPrivKey = 1; + if (_internal_has_uuid()) { + // required string uuid = 5; total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_rotatingprivkey()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_uuid()); } - if (_internal_has_proof()) { - // required .SessionProtos.ProProof proof = 2; + if (_internal_has_type()) { + // required .SessionProtos.CallMessage.Type type = 1; total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.proof_); + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); } return total_size; } -size_t ProConfig::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ProConfig) +size_t CallMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.CallMessage) size_t total_size = 0; if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. - // required bytes rotatingPrivKey = 1; + // required string uuid = 5; total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_rotatingprivkey()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_uuid()); - // required .SessionProtos.ProProof proof = 2; + // required .SessionProtos.CallMessage.Type type = 1; total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.proof_); + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); } else { total_size += RequiredFieldsByteSizeFallback(); @@ -3077,83 +3588,108 @@ size_t ProConfig::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + // repeated string sdps = 2; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.sdps_.size()); + for (int i = 0, n = _impl_.sdps_.size(); i < n; i++) { + total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + _impl_.sdps_.Get(i)); + } + + // repeated uint32 sdpMLineIndexes = 3; + { + size_t data_size = ::_pbi::WireFormatLite:: + UInt32Size(this->_impl_.sdpmlineindexes_); + total_size += 1 * + ::_pbi::FromIntSize(this->_internal_sdpmlineindexes_size()); + total_size += data_size; + } + + // repeated string sdpMids = 4; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.sdpmids_.size()); + for (int i = 0, n = _impl_.sdpmids_.size(); i < n; i++) { + total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + _impl_.sdpmids_.Get(i)); } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} -void ProConfig::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void ProConfig::MergeFrom(const ProConfig& from) { - ProConfig* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ProConfig) +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData CallMessage::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + CallMessage::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CallMessage::GetClassData() const { return &_class_data_; } + + +void CallMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.CallMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; + _this->_impl_.sdps_.MergeFrom(from._impl_.sdps_); + _this->_impl_.sdpmlineindexes_.MergeFrom(from._impl_.sdpmlineindexes_); + _this->_impl_.sdpmids_.MergeFrom(from._impl_.sdpmids_); cached_has_bits = from._impl_._has_bits_[0]; if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_rotatingprivkey(from._internal_rotatingprivkey()); + _this->_internal_set_uuid(from._internal_uuid()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_mutable_proof()->::SessionProtos::ProProof::MergeFrom( - from._internal_proof()); + _this->_impl_.type_ = from._impl_.type_; } + _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void ProConfig::CopyFrom(const ProConfig& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ProConfig) +void CallMessage::CopyFrom(const CallMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.CallMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool ProConfig::IsInitialized() const { +bool CallMessage::IsInitialized() const { if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; - if (_internal_has_proof()) { - if (!_impl_.proof_->IsInitialized()) return false; - } return true; } -void ProConfig::InternalSwap(ProConfig* other) { +void CallMessage::InternalSwap(CallMessage* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.sdps_.InternalSwap(&other->_impl_.sdps_); + _impl_.sdpmlineindexes_.InternalSwap(&other->_impl_.sdpmlineindexes_); + _impl_.sdpmids_.InternalSwap(&other->_impl_.sdpmids_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.rotatingprivkey_, lhs_arena, - &other->_impl_.rotatingprivkey_, rhs_arena + &_impl_.uuid_, lhs_arena, + &other->_impl_.uuid_, rhs_arena ); - swap(_impl_.proof_, other->_impl_.proof_); + swap(_impl_.type_, other->_impl_.type_); } -std::string ProConfig::GetTypeName() const { - return "SessionProtos.ProConfig"; +::PROTOBUF_NAMESPACE_ID::Metadata CallMessage::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[5]); } - // =================================================================== -class ProMessageConfig::_Internal { +class KeyPair::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static const ::SessionProtos::ProProof& proof(const ProMessageConfig* msg); - static void set_has_proof(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_publickey(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_flags(HasBits* has_bits) { + static void set_has_privatekey(HasBits* has_bits) { (*has_bits)[0] |= 2u; } static bool MissingRequiredFields(const HasBits& has_bits) { @@ -3161,99 +3697,120 @@ class ProMessageConfig::_Internal { } }; -const ::SessionProtos::ProProof& -ProMessageConfig::_Internal::proof(const ProMessageConfig* msg) { - return *msg->_impl_.proof_; -} -ProMessageConfig::ProMessageConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena, +KeyPair::KeyPair(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.ProMessageConfig) + // @@protoc_insertion_point(arena_constructor:SessionProtos.KeyPair) } -ProMessageConfig::ProMessageConfig(const ProMessageConfig& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - ProMessageConfig* const _this = this; (void)_this; +KeyPair::KeyPair(const KeyPair& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + KeyPair* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.proof_){nullptr} - , decltype(_impl_.flags_){}}; + , decltype(_impl_.publickey_){} + , decltype(_impl_.privatekey_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from._internal_has_proof()) { - _this->_impl_.proof_ = new ::SessionProtos::ProProof(*from._impl_.proof_); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.publickey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.publickey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_publickey()) { + _this->_impl_.publickey_.Set(from._internal_publickey(), + _this->GetArenaForAllocation()); } - _this->_impl_.flags_ = from._impl_.flags_; - // @@protoc_insertion_point(copy_constructor:SessionProtos.ProMessageConfig) + _impl_.privatekey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.privatekey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_privatekey()) { + _this->_impl_.privatekey_.Set(from._internal_privatekey(), + _this->GetArenaForAllocation()); + } + // @@protoc_insertion_point(copy_constructor:SessionProtos.KeyPair) } -inline void ProMessageConfig::SharedCtor( +inline void KeyPair::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.proof_){nullptr} - , decltype(_impl_.flags_){0u} + , decltype(_impl_.publickey_){} + , decltype(_impl_.privatekey_){} }; + _impl_.publickey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.publickey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.privatekey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.privatekey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -ProMessageConfig::~ProMessageConfig() { - // @@protoc_insertion_point(destructor:SessionProtos.ProMessageConfig) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +KeyPair::~KeyPair() { + // @@protoc_insertion_point(destructor:SessionProtos.KeyPair) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void ProMessageConfig::SharedDtor() { +inline void KeyPair::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - if (this != internal_default_instance()) delete _impl_.proof_; + _impl_.publickey_.Destroy(); + _impl_.privatekey_.Destroy(); } -void ProMessageConfig::SetCachedSize(int size) const { +void KeyPair::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void ProMessageConfig::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.ProMessageConfig) +void KeyPair::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.KeyPair) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - GOOGLE_DCHECK(_impl_.proof_ != nullptr); - _impl_.proof_->Clear(); + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _impl_.publickey_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000002u) { + _impl_.privatekey_.ClearNonDefaultToEmpty(); + } } - _impl_.flags_ = 0u; _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ProMessageConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* KeyPair::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required .SessionProtos.ProProof proof = 1; + // required bytes publicKey = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - ptr = ctx->ParseMessage(_internal_mutable_proof(), ptr); + auto str = _internal_mutable_publickey(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // required uint32 flags = 2; + // required bytes privateKey = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { - _Internal::set_has_flags(&has_bits); - _impl_.flags_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_privatekey(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; @@ -3269,7 +3826,7 @@ const char* ProMessageConfig::_InternalParse(const char* ptr, ::_pbi::ParseConte } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -3282,64 +3839,67 @@ const char* ProMessageConfig::_InternalParse(const char* ptr, ::_pbi::ParseConte #undef CHK_ } -uint8_t* ProMessageConfig::_InternalSerialize( +uint8_t* KeyPair::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ProMessageConfig) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.KeyPair) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required .SessionProtos.ProProof proof = 1; + // required bytes publicKey = 1; if (cached_has_bits & 0x00000001u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, _Internal::proof(this), - _Internal::proof(this).GetCachedSize(), target, stream); + target = stream->WriteBytesMaybeAliased( + 1, this->_internal_publickey(), target); } - // required uint32 flags = 2; + // required bytes privateKey = 2; if (cached_has_bits & 0x00000002u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_flags(), target); + target = stream->WriteBytesMaybeAliased( + 2, this->_internal_privatekey(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ProMessageConfig) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.KeyPair) return target; } -size_t ProMessageConfig::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.ProMessageConfig) +size_t KeyPair::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.KeyPair) size_t total_size = 0; - if (_internal_has_proof()) { - // required .SessionProtos.ProProof proof = 1; + if (_internal_has_publickey()) { + // required bytes publicKey = 1; total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.proof_); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_publickey()); } - if (_internal_has_flags()) { - // required uint32 flags = 2; - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); + if (_internal_has_privatekey()) { + // required bytes privateKey = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_privatekey()); } return total_size; } -size_t ProMessageConfig::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ProMessageConfig) +size_t KeyPair::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.KeyPair) size_t total_size = 0; if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. - // required .SessionProtos.ProProof proof = 1; + // required bytes publicKey = 1; total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.proof_); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_publickey()); - // required uint32 flags = 2; - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); + // required bytes privateKey = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_privatekey()); } else { total_size += RequiredFieldsByteSizeFallback(); @@ -3348,23 +3908,20 @@ size_t ProMessageConfig::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); - } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void ProMessageConfig::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData KeyPair::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + KeyPair::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*KeyPair::GetClassData() const { return &_class_data_; } -void ProMessageConfig::MergeFrom(const ProMessageConfig& from) { - ProMessageConfig* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ProMessageConfig) + +void KeyPair::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.KeyPair) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -3372,378 +3929,156 @@ void ProMessageConfig::MergeFrom(const ProMessageConfig& from) { cached_has_bits = from._impl_._has_bits_[0]; if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _this->_internal_mutable_proof()->::SessionProtos::ProProof::MergeFrom( - from._internal_proof()); + _this->_internal_set_publickey(from._internal_publickey()); } if (cached_has_bits & 0x00000002u) { - _this->_impl_.flags_ = from._impl_.flags_; + _this->_internal_set_privatekey(from._internal_privatekey()); } - _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void ProMessageConfig::CopyFrom(const ProMessageConfig& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ProMessageConfig) +void KeyPair::CopyFrom(const KeyPair& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.KeyPair) if (&from == this) return; Clear(); MergeFrom(from); } -bool ProMessageConfig::IsInitialized() const { +bool KeyPair::IsInitialized() const { if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; - if (_internal_has_proof()) { - if (!_impl_.proof_->IsInitialized()) return false; - } return true; } -void ProMessageConfig::InternalSwap(ProMessageConfig* other) { +void KeyPair::InternalSwap(KeyPair* other) { using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(ProMessageConfig, _impl_.flags_) - + sizeof(ProMessageConfig::_impl_.flags_) - - PROTOBUF_FIELD_OFFSET(ProMessageConfig, _impl_.proof_)>( - reinterpret_cast(&_impl_.proof_), - reinterpret_cast(&other->_impl_.proof_)); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.publickey_, lhs_arena, + &other->_impl_.publickey_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.privatekey_, lhs_arena, + &other->_impl_.privatekey_, rhs_arena + ); } -std::string ProMessageConfig::GetTypeName() const { - return "SessionProtos.ProMessageConfig"; +::PROTOBUF_NAMESPACE_ID::Metadata KeyPair::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[6]); } - // =================================================================== -class Content::_Internal { +class DataExtractionNotification::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static const ::SessionProtos::DataMessage& datamessage(const Content* msg); - static void set_has_datamessage(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } - static const ::SessionProtos::CallMessage& callmessage(const Content* msg); - static void set_has_callmessage(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_type(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static const ::SessionProtos::ReceiptMessage& receiptmessage(const Content* msg); - static void set_has_receiptmessage(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } - static const ::SessionProtos::TypingMessage& typingmessage(const Content* msg); - static void set_has_typingmessage(HasBits* has_bits) { - (*has_bits)[0] |= 8u; - } - static const ::SessionProtos::ConfigurationMessage& configurationmessage(const Content* msg); - static void set_has_configurationmessage(HasBits* has_bits) { - (*has_bits)[0] |= 16u; - } - static const ::SessionProtos::DataExtractionNotification& dataextractionnotification(const Content* msg); - static void set_has_dataextractionnotification(HasBits* has_bits) { - (*has_bits)[0] |= 32u; - } - static const ::SessionProtos::UnsendRequest& unsendrequest(const Content* msg); - static void set_has_unsendrequest(HasBits* has_bits) { - (*has_bits)[0] |= 64u; - } - static const ::SessionProtos::MessageRequestResponse& messagerequestresponse(const Content* msg); - static void set_has_messagerequestresponse(HasBits* has_bits) { - (*has_bits)[0] |= 128u; - } - static const ::SessionProtos::SharedConfigMessage& sharedconfigmessage(const Content* msg); - static void set_has_sharedconfigmessage(HasBits* has_bits) { - (*has_bits)[0] |= 256u; + static void set_has_timestamp(HasBits* has_bits) { + (*has_bits)[0] |= 1u; } - static const ::SessionProtos::ProMessageConfig& promessageconfig(const Content* msg); - static void set_has_promessageconfig(HasBits* has_bits) { - (*has_bits)[0] |= 512u; + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x00000002) ^ 0x00000002) != 0; } }; -const ::SessionProtos::DataMessage& -Content::_Internal::datamessage(const Content* msg) { - return *msg->_impl_.datamessage_; -} -const ::SessionProtos::CallMessage& -Content::_Internal::callmessage(const Content* msg) { - return *msg->_impl_.callmessage_; -} -const ::SessionProtos::ReceiptMessage& -Content::_Internal::receiptmessage(const Content* msg) { - return *msg->_impl_.receiptmessage_; -} -const ::SessionProtos::TypingMessage& -Content::_Internal::typingmessage(const Content* msg) { - return *msg->_impl_.typingmessage_; -} -const ::SessionProtos::ConfigurationMessage& -Content::_Internal::configurationmessage(const Content* msg) { - return *msg->_impl_.configurationmessage_; -} -const ::SessionProtos::DataExtractionNotification& -Content::_Internal::dataextractionnotification(const Content* msg) { - return *msg->_impl_.dataextractionnotification_; -} -const ::SessionProtos::UnsendRequest& -Content::_Internal::unsendrequest(const Content* msg) { - return *msg->_impl_.unsendrequest_; -} -const ::SessionProtos::MessageRequestResponse& -Content::_Internal::messagerequestresponse(const Content* msg) { - return *msg->_impl_.messagerequestresponse_; -} -const ::SessionProtos::SharedConfigMessage& -Content::_Internal::sharedconfigmessage(const Content* msg) { - return *msg->_impl_.sharedconfigmessage_; -} -const ::SessionProtos::ProMessageConfig& -Content::_Internal::promessageconfig(const Content* msg) { - return *msg->_impl_.promessageconfig_; -} -Content::Content(::PROTOBUF_NAMESPACE_ID::Arena* arena, +DataExtractionNotification::DataExtractionNotification(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.Content) + // @@protoc_insertion_point(arena_constructor:SessionProtos.DataExtractionNotification) } -Content::Content(const Content& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - Content* const _this = this; (void)_this; +DataExtractionNotification::DataExtractionNotification(const DataExtractionNotification& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + DataExtractionNotification* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.datamessage_){nullptr} - , decltype(_impl_.callmessage_){nullptr} - , decltype(_impl_.receiptmessage_){nullptr} - , decltype(_impl_.typingmessage_){nullptr} - , decltype(_impl_.configurationmessage_){nullptr} - , decltype(_impl_.dataextractionnotification_){nullptr} - , decltype(_impl_.unsendrequest_){nullptr} - , decltype(_impl_.messagerequestresponse_){nullptr} - , decltype(_impl_.sharedconfigmessage_){nullptr} - , decltype(_impl_.promessageconfig_){nullptr}}; + , decltype(_impl_.timestamp_){} + , decltype(_impl_.type_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from._internal_has_datamessage()) { - _this->_impl_.datamessage_ = new ::SessionProtos::DataMessage(*from._impl_.datamessage_); - } - if (from._internal_has_callmessage()) { - _this->_impl_.callmessage_ = new ::SessionProtos::CallMessage(*from._impl_.callmessage_); - } - if (from._internal_has_receiptmessage()) { - _this->_impl_.receiptmessage_ = new ::SessionProtos::ReceiptMessage(*from._impl_.receiptmessage_); - } - if (from._internal_has_typingmessage()) { - _this->_impl_.typingmessage_ = new ::SessionProtos::TypingMessage(*from._impl_.typingmessage_); - } - if (from._internal_has_configurationmessage()) { - _this->_impl_.configurationmessage_ = new ::SessionProtos::ConfigurationMessage(*from._impl_.configurationmessage_); - } - if (from._internal_has_dataextractionnotification()) { - _this->_impl_.dataextractionnotification_ = new ::SessionProtos::DataExtractionNotification(*from._impl_.dataextractionnotification_); - } - if (from._internal_has_unsendrequest()) { - _this->_impl_.unsendrequest_ = new ::SessionProtos::UnsendRequest(*from._impl_.unsendrequest_); - } - if (from._internal_has_messagerequestresponse()) { - _this->_impl_.messagerequestresponse_ = new ::SessionProtos::MessageRequestResponse(*from._impl_.messagerequestresponse_); - } - if (from._internal_has_sharedconfigmessage()) { - _this->_impl_.sharedconfigmessage_ = new ::SessionProtos::SharedConfigMessage(*from._impl_.sharedconfigmessage_); - } - if (from._internal_has_promessageconfig()) { - _this->_impl_.promessageconfig_ = new ::SessionProtos::ProMessageConfig(*from._impl_.promessageconfig_); - } - // @@protoc_insertion_point(copy_constructor:SessionProtos.Content) + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&_impl_.timestamp_, &from._impl_.timestamp_, + static_cast(reinterpret_cast(&_impl_.type_) - + reinterpret_cast(&_impl_.timestamp_)) + sizeof(_impl_.type_)); + // @@protoc_insertion_point(copy_constructor:SessionProtos.DataExtractionNotification) } -inline void Content::SharedCtor( +inline void DataExtractionNotification::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.datamessage_){nullptr} - , decltype(_impl_.callmessage_){nullptr} - , decltype(_impl_.receiptmessage_){nullptr} - , decltype(_impl_.typingmessage_){nullptr} - , decltype(_impl_.configurationmessage_){nullptr} - , decltype(_impl_.dataextractionnotification_){nullptr} - , decltype(_impl_.unsendrequest_){nullptr} - , decltype(_impl_.messagerequestresponse_){nullptr} - , decltype(_impl_.sharedconfigmessage_){nullptr} - , decltype(_impl_.promessageconfig_){nullptr} + , decltype(_impl_.timestamp_){uint64_t{0u}} + , decltype(_impl_.type_){1} }; } -Content::~Content() { - // @@protoc_insertion_point(destructor:SessionProtos.Content) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +DataExtractionNotification::~DataExtractionNotification() { + // @@protoc_insertion_point(destructor:SessionProtos.DataExtractionNotification) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void Content::SharedDtor() { +inline void DataExtractionNotification::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - if (this != internal_default_instance()) delete _impl_.datamessage_; - if (this != internal_default_instance()) delete _impl_.callmessage_; - if (this != internal_default_instance()) delete _impl_.receiptmessage_; - if (this != internal_default_instance()) delete _impl_.typingmessage_; - if (this != internal_default_instance()) delete _impl_.configurationmessage_; - if (this != internal_default_instance()) delete _impl_.dataextractionnotification_; - if (this != internal_default_instance()) delete _impl_.unsendrequest_; - if (this != internal_default_instance()) delete _impl_.messagerequestresponse_; - if (this != internal_default_instance()) delete _impl_.sharedconfigmessage_; - if (this != internal_default_instance()) delete _impl_.promessageconfig_; } -void Content::SetCachedSize(int size) const { +void DataExtractionNotification::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void Content::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.Content) +void DataExtractionNotification::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.DataExtractionNotification) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x000000ffu) { - if (cached_has_bits & 0x00000001u) { - GOOGLE_DCHECK(_impl_.datamessage_ != nullptr); - _impl_.datamessage_->Clear(); - } - if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(_impl_.callmessage_ != nullptr); - _impl_.callmessage_->Clear(); - } - if (cached_has_bits & 0x00000004u) { - GOOGLE_DCHECK(_impl_.receiptmessage_ != nullptr); - _impl_.receiptmessage_->Clear(); - } - if (cached_has_bits & 0x00000008u) { - GOOGLE_DCHECK(_impl_.typingmessage_ != nullptr); - _impl_.typingmessage_->Clear(); - } - if (cached_has_bits & 0x00000010u) { - GOOGLE_DCHECK(_impl_.configurationmessage_ != nullptr); - _impl_.configurationmessage_->Clear(); - } - if (cached_has_bits & 0x00000020u) { - GOOGLE_DCHECK(_impl_.dataextractionnotification_ != nullptr); - _impl_.dataextractionnotification_->Clear(); - } - if (cached_has_bits & 0x00000040u) { - GOOGLE_DCHECK(_impl_.unsendrequest_ != nullptr); - _impl_.unsendrequest_->Clear(); - } - if (cached_has_bits & 0x00000080u) { - GOOGLE_DCHECK(_impl_.messagerequestresponse_ != nullptr); - _impl_.messagerequestresponse_->Clear(); - } - } - if (cached_has_bits & 0x00000300u) { - if (cached_has_bits & 0x00000100u) { - GOOGLE_DCHECK(_impl_.sharedconfigmessage_ != nullptr); - _impl_.sharedconfigmessage_->Clear(); - } - if (cached_has_bits & 0x00000200u) { - GOOGLE_DCHECK(_impl_.promessageconfig_ != nullptr); - _impl_.promessageconfig_->Clear(); - } + if (cached_has_bits & 0x00000003u) { + _impl_.timestamp_ = uint64_t{0u}; + _impl_.type_ = 1; } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* Content::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* DataExtractionNotification::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // optional .SessionProtos.DataMessage dataMessage = 1; + // required .SessionProtos.DataExtractionNotification.Type type = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - ptr = ctx->ParseMessage(_internal_mutable_datamessage(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.CallMessage callMessage = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - ptr = ctx->ParseMessage(_internal_mutable_callmessage(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.ReceiptMessage receiptMessage = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { - ptr = ctx->ParseMessage(_internal_mutable_receiptmessage(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.TypingMessage typingMessage = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { - ptr = ctx->ParseMessage(_internal_mutable_typingmessage(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.ConfigurationMessage configurationMessage = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { - ptr = ctx->ParseMessage(_internal_mutable_configurationmessage(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { - ptr = ctx->ParseMessage(_internal_mutable_dataextractionnotification(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.UnsendRequest unsendRequest = 9; - case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { - ptr = ctx->ParseMessage(_internal_mutable_unsendrequest(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; - case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 82)) { - ptr = ctx->ParseMessage(_internal_mutable_messagerequestresponse(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; - case 11: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 90)) { - ptr = ctx->ParseMessage(_internal_mutable_sharedconfigmessage(), ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); + if (PROTOBUF_PREDICT_TRUE(::SessionProtos::DataExtractionNotification_Type_IsValid(val))) { + _internal_set_type(static_cast<::SessionProtos::DataExtractionNotification_Type>(val)); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields()); + } } else goto handle_unusual; continue; - // optional .SessionProtos.ProMessageConfig proMessageConfig = 12; - case 12: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 98)) { - ptr = ctx->ParseMessage(_internal_mutable_promessageconfig(), ptr); + // optional uint64 timestamp = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _Internal::set_has_timestamp(&has_bits); + _impl_.timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else goto handle_unusual; @@ -3759,7 +4094,7 @@ const char* Content::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -3772,478 +4107,244 @@ const char* Content::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) #undef CHK_ } -uint8_t* Content::_InternalSerialize( +uint8_t* DataExtractionNotification::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.Content) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataExtractionNotification) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // optional .SessionProtos.DataMessage dataMessage = 1; - if (cached_has_bits & 0x00000001u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, _Internal::datamessage(this), - _Internal::datamessage(this).GetCachedSize(), target, stream); - } - - // optional .SessionProtos.CallMessage callMessage = 3; + // required .SessionProtos.DataExtractionNotification.Type type = 1; if (cached_has_bits & 0x00000002u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::callmessage(this), - _Internal::callmessage(this).GetCachedSize(), target, stream); - } - - // optional .SessionProtos.ReceiptMessage receiptMessage = 5; - if (cached_has_bits & 0x00000004u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(5, _Internal::receiptmessage(this), - _Internal::receiptmessage(this).GetCachedSize(), target, stream); - } - - // optional .SessionProtos.TypingMessage typingMessage = 6; - if (cached_has_bits & 0x00000008u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(6, _Internal::typingmessage(this), - _Internal::typingmessage(this).GetCachedSize(), target, stream); - } - - // optional .SessionProtos.ConfigurationMessage configurationMessage = 7; - if (cached_has_bits & 0x00000010u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(7, _Internal::configurationmessage(this), - _Internal::configurationmessage(this).GetCachedSize(), target, stream); + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this->_internal_type(), target); } - // optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; - if (cached_has_bits & 0x00000020u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(8, _Internal::dataextractionnotification(this), - _Internal::dataextractionnotification(this).GetCachedSize(), target, stream); + // optional uint64 timestamp = 2; + if (cached_has_bits & 0x00000001u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_timestamp(), target); } - // optional .SessionProtos.UnsendRequest unsendRequest = 9; - if (cached_has_bits & 0x00000040u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(9, _Internal::unsendrequest(this), - _Internal::unsendrequest(this).GetCachedSize(), target, stream); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataExtractionNotification) + return target; +} - // optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; - if (cached_has_bits & 0x00000080u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(10, _Internal::messagerequestresponse(this), - _Internal::messagerequestresponse(this).GetCachedSize(), target, stream); - } +size_t DataExtractionNotification::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataExtractionNotification) + size_t total_size = 0; - // optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; - if (cached_has_bits & 0x00000100u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(11, _Internal::sharedconfigmessage(this), - _Internal::sharedconfigmessage(this).GetCachedSize(), target, stream); + // required .SessionProtos.DataExtractionNotification.Type type = 1; + if (_internal_has_type()) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); } + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; - // optional .SessionProtos.ProMessageConfig proMessageConfig = 12; - if (cached_has_bits & 0x00000200u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(12, _Internal::promessageconfig(this), - _Internal::promessageconfig(this).GetCachedSize(), target, stream); + // optional uint64 timestamp = 2; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_timestamp()); } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); - } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.Content) - return target; + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -size_t Content::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.Content) - size_t total_size = 0; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DataExtractionNotification::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + DataExtractionNotification::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DataExtractionNotification::GetClassData() const { return &_class_data_; } + +void DataExtractionNotification::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataExtractionNotification) + GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x000000ffu) { - // optional .SessionProtos.DataMessage dataMessage = 1; + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.datamessage_); + _this->_impl_.timestamp_ = from._impl_.timestamp_; } - - // optional .SessionProtos.CallMessage callMessage = 3; if (cached_has_bits & 0x00000002u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.callmessage_); + _this->_impl_.type_ = from._impl_.type_; } + _this->_impl_._has_bits_[0] |= cached_has_bits; + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} - // optional .SessionProtos.ReceiptMessage receiptMessage = 5; - if (cached_has_bits & 0x00000004u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.receiptmessage_); - } - - // optional .SessionProtos.TypingMessage typingMessage = 6; - if (cached_has_bits & 0x00000008u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.typingmessage_); - } - - // optional .SessionProtos.ConfigurationMessage configurationMessage = 7; - if (cached_has_bits & 0x00000010u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.configurationmessage_); - } - - // optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; - if (cached_has_bits & 0x00000020u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.dataextractionnotification_); - } - - // optional .SessionProtos.UnsendRequest unsendRequest = 9; - if (cached_has_bits & 0x00000040u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.unsendrequest_); - } - - // optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; - if (cached_has_bits & 0x00000080u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.messagerequestresponse_); - } - - } - if (cached_has_bits & 0x00000300u) { - // optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; - if (cached_has_bits & 0x00000100u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.sharedconfigmessage_); - } - - // optional .SessionProtos.ProMessageConfig proMessageConfig = 12; - if (cached_has_bits & 0x00000200u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.promessageconfig_); - } - - } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); - } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void Content::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} - -void Content::MergeFrom(const Content& from) { - Content* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.Content) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x000000ffu) { - if (cached_has_bits & 0x00000001u) { - _this->_internal_mutable_datamessage()->::SessionProtos::DataMessage::MergeFrom( - from._internal_datamessage()); - } - if (cached_has_bits & 0x00000002u) { - _this->_internal_mutable_callmessage()->::SessionProtos::CallMessage::MergeFrom( - from._internal_callmessage()); - } - if (cached_has_bits & 0x00000004u) { - _this->_internal_mutable_receiptmessage()->::SessionProtos::ReceiptMessage::MergeFrom( - from._internal_receiptmessage()); - } - if (cached_has_bits & 0x00000008u) { - _this->_internal_mutable_typingmessage()->::SessionProtos::TypingMessage::MergeFrom( - from._internal_typingmessage()); - } - if (cached_has_bits & 0x00000010u) { - _this->_internal_mutable_configurationmessage()->::SessionProtos::ConfigurationMessage::MergeFrom( - from._internal_configurationmessage()); - } - if (cached_has_bits & 0x00000020u) { - _this->_internal_mutable_dataextractionnotification()->::SessionProtos::DataExtractionNotification::MergeFrom( - from._internal_dataextractionnotification()); - } - if (cached_has_bits & 0x00000040u) { - _this->_internal_mutable_unsendrequest()->::SessionProtos::UnsendRequest::MergeFrom( - from._internal_unsendrequest()); - } - if (cached_has_bits & 0x00000080u) { - _this->_internal_mutable_messagerequestresponse()->::SessionProtos::MessageRequestResponse::MergeFrom( - from._internal_messagerequestresponse()); - } - } - if (cached_has_bits & 0x00000300u) { - if (cached_has_bits & 0x00000100u) { - _this->_internal_mutable_sharedconfigmessage()->::SessionProtos::SharedConfigMessage::MergeFrom( - from._internal_sharedconfigmessage()); - } - if (cached_has_bits & 0x00000200u) { - _this->_internal_mutable_promessageconfig()->::SessionProtos::ProMessageConfig::MergeFrom( - from._internal_promessageconfig()); - } - } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); -} - -void Content::CopyFrom(const Content& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.Content) +void DataExtractionNotification::CopyFrom(const DataExtractionNotification& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataExtractionNotification) if (&from == this) return; Clear(); MergeFrom(from); } -bool Content::IsInitialized() const { - if (_internal_has_datamessage()) { - if (!_impl_.datamessage_->IsInitialized()) return false; - } - if (_internal_has_callmessage()) { - if (!_impl_.callmessage_->IsInitialized()) return false; - } - if (_internal_has_receiptmessage()) { - if (!_impl_.receiptmessage_->IsInitialized()) return false; - } - if (_internal_has_typingmessage()) { - if (!_impl_.typingmessage_->IsInitialized()) return false; - } - if (_internal_has_configurationmessage()) { - if (!_impl_.configurationmessage_->IsInitialized()) return false; - } - if (_internal_has_dataextractionnotification()) { - if (!_impl_.dataextractionnotification_->IsInitialized()) return false; - } - if (_internal_has_unsendrequest()) { - if (!_impl_.unsendrequest_->IsInitialized()) return false; - } - if (_internal_has_messagerequestresponse()) { - if (!_impl_.messagerequestresponse_->IsInitialized()) return false; - } - if (_internal_has_sharedconfigmessage()) { - if (!_impl_.sharedconfigmessage_->IsInitialized()) return false; - } - if (_internal_has_promessageconfig()) { - if (!_impl_.promessageconfig_->IsInitialized()) return false; - } +bool DataExtractionNotification::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; return true; } -void Content::InternalSwap(Content* other) { +void DataExtractionNotification::InternalSwap(DataExtractionNotification* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(Content, _impl_.promessageconfig_) - + sizeof(Content::_impl_.promessageconfig_) - - PROTOBUF_FIELD_OFFSET(Content, _impl_.datamessage_)>( - reinterpret_cast(&_impl_.datamessage_), - reinterpret_cast(&other->_impl_.datamessage_)); + swap(_impl_.timestamp_, other->_impl_.timestamp_); + swap(_impl_.type_, other->_impl_.type_); } -std::string Content::GetTypeName() const { - return "SessionProtos.Content"; +::PROTOBUF_NAMESPACE_ID::Metadata DataExtractionNotification::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[7]); } - // =================================================================== -class CallMessage::_Internal { +class LokiProfile::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_type(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } - static void set_has_uuid(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_displayname(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; + static void set_has_profilepicture(HasBits* has_bits) { + (*has_bits)[0] |= 2u; } }; -CallMessage::CallMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, +LokiProfile::LokiProfile(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.CallMessage) + // @@protoc_insertion_point(arena_constructor:SessionProtos.LokiProfile) } -CallMessage::CallMessage(const CallMessage& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - CallMessage* const _this = this; (void)_this; +LokiProfile::LokiProfile(const LokiProfile& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + LokiProfile* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.sdps_){from._impl_.sdps_} - , decltype(_impl_.sdpmlineindexes_){from._impl_.sdpmlineindexes_} - , decltype(_impl_.sdpmids_){from._impl_.sdpmids_} - , decltype(_impl_.uuid_){} - , decltype(_impl_.type_){}}; + , decltype(_impl_.displayname_){} + , decltype(_impl_.profilepicture_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.uuid_.InitDefault(); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.displayname_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.uuid_.Set("", GetArenaForAllocation()); + _impl_.displayname_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_uuid()) { - _this->_impl_.uuid_.Set(from._internal_uuid(), + if (from._internal_has_displayname()) { + _this->_impl_.displayname_.Set(from._internal_displayname(), _this->GetArenaForAllocation()); } - _this->_impl_.type_ = from._impl_.type_; - // @@protoc_insertion_point(copy_constructor:SessionProtos.CallMessage) + _impl_.profilepicture_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.profilepicture_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_profilepicture()) { + _this->_impl_.profilepicture_.Set(from._internal_profilepicture(), + _this->GetArenaForAllocation()); + } + // @@protoc_insertion_point(copy_constructor:SessionProtos.LokiProfile) } -inline void CallMessage::SharedCtor( +inline void LokiProfile::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.sdps_){arena} - , decltype(_impl_.sdpmlineindexes_){arena} - , decltype(_impl_.sdpmids_){arena} - , decltype(_impl_.uuid_){} - , decltype(_impl_.type_){6} + , decltype(_impl_.displayname_){} + , decltype(_impl_.profilepicture_){} }; - _impl_.uuid_.InitDefault(); + _impl_.displayname_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.uuid_.Set("", GetArenaForAllocation()); + _impl_.displayname_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.profilepicture_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.profilepicture_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -CallMessage::~CallMessage() { - // @@protoc_insertion_point(destructor:SessionProtos.CallMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +LokiProfile::~LokiProfile() { + // @@protoc_insertion_point(destructor:SessionProtos.LokiProfile) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void CallMessage::SharedDtor() { +inline void LokiProfile::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.sdps_.~RepeatedPtrField(); - _impl_.sdpmlineindexes_.~RepeatedField(); - _impl_.sdpmids_.~RepeatedPtrField(); - _impl_.uuid_.Destroy(); + _impl_.displayname_.Destroy(); + _impl_.profilepicture_.Destroy(); } -void CallMessage::SetCachedSize(int size) const { +void LokiProfile::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void CallMessage::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.CallMessage) +void LokiProfile::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.LokiProfile) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.sdps_.Clear(); - _impl_.sdpmlineindexes_.Clear(); - _impl_.sdpmids_.Clear(); cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _impl_.uuid_.ClearNonDefaultToEmpty(); + _impl_.displayname_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000002u) { + _impl_.profilepicture_.ClearNonDefaultToEmpty(); } - _impl_.type_ = 6; } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* CallMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* LokiProfile::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required .SessionProtos.CallMessage.Type type = 1; + // optional string displayName = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_displayname(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - if (PROTOBUF_PREDICT_TRUE(::SessionProtos::CallMessage_Type_IsValid(val))) { - _internal_set_type(static_cast<::SessionProtos::CallMessage_Type>(val)); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields()); - } + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.LokiProfile.displayName"); + #endif // !NDEBUG } else goto handle_unusual; continue; - // repeated string sdps = 2; + // optional string profilePicture = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - ptr -= 1; - do { - ptr += 1; - auto str = _internal_add_sdps(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); - } else - goto handle_unusual; - continue; - // repeated uint32 sdpMLineIndexes = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { - ptr -= 1; - do { - ptr += 1; - _internal_add_sdpmlineindexes(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr)); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<24>(ptr)); - } else if (static_cast(tag) == 26) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_sdpmlineindexes(), ptr, ctx); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // repeated string sdpMids = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { - ptr -= 1; - do { - ptr += 1; - auto str = _internal_add_sdpmids(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); - } else - goto handle_unusual; - continue; - // required string uuid = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { - auto str = _internal_mutable_uuid(); + auto str = _internal_mutable_profilepicture(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.LokiProfile.profilePicture"); + #endif // !NDEBUG } else goto handle_unusual; continue; @@ -4258,7 +4359,7 @@ const char* CallMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* c } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -4271,318 +4372,305 @@ const char* CallMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* c #undef CHK_ } -uint8_t* CallMessage::_InternalSerialize( +uint8_t* LokiProfile::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.CallMessage) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.LokiProfile) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required .SessionProtos.CallMessage.Type type = 1; - if (cached_has_bits & 0x00000002u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 1, this->_internal_type(), target); - } - - // repeated string sdps = 2; - for (int i = 0, n = this->_internal_sdps_size(); i < n; i++) { - const auto& s = this->_internal_sdps(i); - target = stream->WriteString(2, s, target); - } - - // repeated uint32 sdpMLineIndexes = 3; - for (int i = 0, n = this->_internal_sdpmlineindexes_size(); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_sdpmlineindexes(i), target); - } - - // repeated string sdpMids = 4; - for (int i = 0, n = this->_internal_sdpmids_size(); i < n; i++) { - const auto& s = this->_internal_sdpmids(i); - target = stream->WriteString(4, s, target); + // optional string displayName = 1; + if (cached_has_bits & 0x00000001u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_displayname().data(), static_cast(this->_internal_displayname().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.LokiProfile.displayName"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_displayname(), target); } - // required string uuid = 5; - if (cached_has_bits & 0x00000001u) { + // optional string profilePicture = 2; + if (cached_has_bits & 0x00000002u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_profilepicture().data(), static_cast(this->_internal_profilepicture().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.LokiProfile.profilePicture"); target = stream->WriteStringMaybeAliased( - 5, this->_internal_uuid(), target); + 2, this->_internal_profilepicture(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.CallMessage) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.LokiProfile) return target; } -size_t CallMessage::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.CallMessage) - size_t total_size = 0; - - if (_internal_has_uuid()) { - // required string uuid = 5; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_uuid()); - } - - if (_internal_has_type()) { - // required .SessionProtos.CallMessage.Type type = 1; - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); - } - - return total_size; -} -size_t CallMessage::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.CallMessage) +size_t LokiProfile::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.LokiProfile) size_t total_size = 0; - if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. - // required string uuid = 5; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_uuid()); - - // required .SessionProtos.CallMessage.Type type = 1; - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); - - } else { - total_size += RequiredFieldsByteSizeFallback(); - } uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // repeated string sdps = 2; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.sdps_.size()); - for (int i = 0, n = _impl_.sdps_.size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - _impl_.sdps_.Get(i)); - } - - // repeated uint32 sdpMLineIndexes = 3; - { - size_t data_size = ::_pbi::WireFormatLite:: - UInt32Size(this->_impl_.sdpmlineindexes_); - total_size += 1 * - ::_pbi::FromIntSize(this->_internal_sdpmlineindexes_size()); - total_size += data_size; - } + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + // optional string displayName = 1; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_displayname()); + } - // repeated string sdpMids = 4; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.sdpmids_.size()); - for (int i = 0, n = _impl_.sdpmids_.size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - _impl_.sdpmids_.Get(i)); - } + // optional string profilePicture = 2; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_profilepicture()); + } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void CallMessage::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData LokiProfile::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + LokiProfile::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*LokiProfile::GetClassData() const { return &_class_data_; } -void CallMessage::MergeFrom(const CallMessage& from) { - CallMessage* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.CallMessage) + +void LokiProfile::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.LokiProfile) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.sdps_.MergeFrom(from._impl_.sdps_); - _this->_impl_.sdpmlineindexes_.MergeFrom(from._impl_.sdpmlineindexes_); - _this->_impl_.sdpmids_.MergeFrom(from._impl_.sdpmids_); cached_has_bits = from._impl_._has_bits_[0]; if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_uuid(from._internal_uuid()); + _this->_internal_set_displayname(from._internal_displayname()); } if (cached_has_bits & 0x00000002u) { - _this->_impl_.type_ = from._impl_.type_; + _this->_internal_set_profilepicture(from._internal_profilepicture()); } - _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void CallMessage::CopyFrom(const CallMessage& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.CallMessage) +void LokiProfile::CopyFrom(const LokiProfile& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.LokiProfile) if (&from == this) return; Clear(); MergeFrom(from); } -bool CallMessage::IsInitialized() const { - if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; +bool LokiProfile::IsInitialized() const { return true; } -void CallMessage::InternalSwap(CallMessage* other) { +void LokiProfile::InternalSwap(LokiProfile* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.sdps_.InternalSwap(&other->_impl_.sdps_); - _impl_.sdpmlineindexes_.InternalSwap(&other->_impl_.sdpmlineindexes_); - _impl_.sdpmids_.InternalSwap(&other->_impl_.sdpmids_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.uuid_, lhs_arena, - &other->_impl_.uuid_, rhs_arena + &_impl_.displayname_, lhs_arena, + &other->_impl_.displayname_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.profilepicture_, lhs_arena, + &other->_impl_.profilepicture_, rhs_arena ); - swap(_impl_.type_, other->_impl_.type_); } -std::string CallMessage::GetTypeName() const { - return "SessionProtos.CallMessage"; +::PROTOBUF_NAMESPACE_ID::Metadata LokiProfile::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[8]); } - // =================================================================== -class KeyPair::_Internal { +class DataMessage_Quote_QuotedAttachment::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_publickey(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_contenttype(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_privatekey(HasBits* has_bits) { + static void set_has_filename(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; + static const ::SessionProtos::AttachmentPointer& thumbnail(const DataMessage_Quote_QuotedAttachment* msg); + static void set_has_thumbnail(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static void set_has_flags(HasBits* has_bits) { + (*has_bits)[0] |= 8u; } }; -KeyPair::KeyPair(::PROTOBUF_NAMESPACE_ID::Arena* arena, +const ::SessionProtos::AttachmentPointer& +DataMessage_Quote_QuotedAttachment::_Internal::thumbnail(const DataMessage_Quote_QuotedAttachment* msg) { + return *msg->_impl_.thumbnail_; +} +DataMessage_Quote_QuotedAttachment::DataMessage_Quote_QuotedAttachment(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.KeyPair) + // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Quote.QuotedAttachment) } -KeyPair::KeyPair(const KeyPair& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - KeyPair* const _this = this; (void)_this; +DataMessage_Quote_QuotedAttachment::DataMessage_Quote_QuotedAttachment(const DataMessage_Quote_QuotedAttachment& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + DataMessage_Quote_QuotedAttachment* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.publickey_){} - , decltype(_impl_.privatekey_){}}; + , decltype(_impl_.contenttype_){} + , decltype(_impl_.filename_){} + , decltype(_impl_.thumbnail_){nullptr} + , decltype(_impl_.flags_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.publickey_.InitDefault(); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.contenttype_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.Set("", GetArenaForAllocation()); + _impl_.contenttype_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_publickey()) { - _this->_impl_.publickey_.Set(from._internal_publickey(), + if (from._internal_has_contenttype()) { + _this->_impl_.contenttype_.Set(from._internal_contenttype(), _this->GetArenaForAllocation()); } - _impl_.privatekey_.InitDefault(); + _impl_.filename_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.privatekey_.Set("", GetArenaForAllocation()); + _impl_.filename_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_privatekey()) { - _this->_impl_.privatekey_.Set(from._internal_privatekey(), + if (from._internal_has_filename()) { + _this->_impl_.filename_.Set(from._internal_filename(), _this->GetArenaForAllocation()); } - // @@protoc_insertion_point(copy_constructor:SessionProtos.KeyPair) + if (from._internal_has_thumbnail()) { + _this->_impl_.thumbnail_ = new ::SessionProtos::AttachmentPointer(*from._impl_.thumbnail_); + } + _this->_impl_.flags_ = from._impl_.flags_; + // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.Quote.QuotedAttachment) } -inline void KeyPair::SharedCtor( +inline void DataMessage_Quote_QuotedAttachment::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.publickey_){} - , decltype(_impl_.privatekey_){} - }; - _impl_.publickey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.Set("", GetArenaForAllocation()); + , decltype(_impl_.contenttype_){} + , decltype(_impl_.filename_){} + , decltype(_impl_.thumbnail_){nullptr} + , decltype(_impl_.flags_){0u} + }; + _impl_.contenttype_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.contenttype_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.privatekey_.InitDefault(); + _impl_.filename_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.privatekey_.Set("", GetArenaForAllocation()); + _impl_.filename_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -KeyPair::~KeyPair() { - // @@protoc_insertion_point(destructor:SessionProtos.KeyPair) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +DataMessage_Quote_QuotedAttachment::~DataMessage_Quote_QuotedAttachment() { + // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Quote.QuotedAttachment) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void KeyPair::SharedDtor() { +inline void DataMessage_Quote_QuotedAttachment::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.publickey_.Destroy(); - _impl_.privatekey_.Destroy(); + _impl_.contenttype_.Destroy(); + _impl_.filename_.Destroy(); + if (this != internal_default_instance()) delete _impl_.thumbnail_; } -void KeyPair::SetCachedSize(int size) const { +void DataMessage_Quote_QuotedAttachment::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void KeyPair::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.KeyPair) +void DataMessage_Quote_QuotedAttachment::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.Quote.QuotedAttachment) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x00000001u) { - _impl_.publickey_.ClearNonDefaultToEmpty(); + _impl_.contenttype_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.privatekey_.ClearNonDefaultToEmpty(); + _impl_.filename_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000004u) { + GOOGLE_DCHECK(_impl_.thumbnail_ != nullptr); + _impl_.thumbnail_->Clear(); } } + _impl_.flags_ = 0u; _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* KeyPair::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* DataMessage_Quote_QuotedAttachment::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required bytes publicKey = 1; + // optional string contentType = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_publickey(); + auto str = _internal_mutable_contenttype(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.Quote.QuotedAttachment.contentType"); + #endif // !NDEBUG } else goto handle_unusual; continue; - // required bytes privateKey = 2; + // optional string fileName = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_privatekey(); + auto str = _internal_mutable_filename(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.Quote.QuotedAttachment.fileName"); + #endif // !NDEBUG + } else + goto handle_unusual; + continue; + // optional .SessionProtos.AttachmentPointer thumbnail = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr = ctx->ParseMessage(_internal_mutable_thumbnail(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional uint32 flags = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + _Internal::set_has_flags(&has_bits); + _impl_.flags_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); } else goto handle_unusual; continue; @@ -4597,7 +4685,7 @@ const char* KeyPair::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -4610,249 +4698,341 @@ const char* KeyPair::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) #undef CHK_ } -uint8_t* KeyPair::_InternalSerialize( +uint8_t* DataMessage_Quote_QuotedAttachment::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.KeyPair) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.Quote.QuotedAttachment) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required bytes publicKey = 1; + // optional string contentType = 1; if (cached_has_bits & 0x00000001u) { - target = stream->WriteBytesMaybeAliased( - 1, this->_internal_publickey(), target); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_contenttype().data(), static_cast(this->_internal_contenttype().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.DataMessage.Quote.QuotedAttachment.contentType"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_contenttype(), target); } - // required bytes privateKey = 2; + // optional string fileName = 2; if (cached_has_bits & 0x00000002u) { - target = stream->WriteBytesMaybeAliased( - 2, this->_internal_privatekey(), target); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_filename().data(), static_cast(this->_internal_filename().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.DataMessage.Quote.QuotedAttachment.fileName"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_filename(), target); } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + // optional .SessionProtos.AttachmentPointer thumbnail = 3; + if (cached_has_bits & 0x00000004u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::thumbnail(this), + _Internal::thumbnail(this).GetCachedSize(), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.KeyPair) - return target; -} - -size_t KeyPair::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.KeyPair) - size_t total_size = 0; - if (_internal_has_publickey()) { - // required bytes publicKey = 1; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_publickey()); + // optional uint32 flags = 4; + if (cached_has_bits & 0x00000008u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_flags(), target); } - if (_internal_has_privatekey()) { - // required bytes privateKey = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_privatekey()); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - - return total_size; + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Quote.QuotedAttachment) + return target; } -size_t KeyPair::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.KeyPair) - size_t total_size = 0; - - if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. - // required bytes publicKey = 1; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_publickey()); - // required bytes privateKey = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_privatekey()); +size_t DataMessage_Quote_QuotedAttachment::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.Quote.QuotedAttachment) + size_t total_size = 0; - } else { - total_size += RequiredFieldsByteSizeFallback(); - } uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x0000000fu) { + // optional string contentType = 1; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_contenttype()); + } + + // optional string fileName = 2; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_filename()); + } + + // optional .SessionProtos.AttachmentPointer thumbnail = 3; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.thumbnail_); + } + + // optional uint32 flags = 4; + if (cached_has_bits & 0x00000008u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); + } + } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void KeyPair::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DataMessage_Quote_QuotedAttachment::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + DataMessage_Quote_QuotedAttachment::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DataMessage_Quote_QuotedAttachment::GetClassData() const { return &_class_data_; } -void KeyPair::MergeFrom(const KeyPair& from) { - KeyPair* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.KeyPair) + +void DataMessage_Quote_QuotedAttachment::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Quote.QuotedAttachment) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x0000000fu) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_publickey(from._internal_publickey()); + _this->_internal_set_contenttype(from._internal_contenttype()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_privatekey(from._internal_privatekey()); + _this->_internal_set_filename(from._internal_filename()); } + if (cached_has_bits & 0x00000004u) { + _this->_internal_mutable_thumbnail()->::SessionProtos::AttachmentPointer::MergeFrom( + from._internal_thumbnail()); + } + if (cached_has_bits & 0x00000008u) { + _this->_impl_.flags_ = from._impl_.flags_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void KeyPair::CopyFrom(const KeyPair& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.KeyPair) +void DataMessage_Quote_QuotedAttachment::CopyFrom(const DataMessage_Quote_QuotedAttachment& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.Quote.QuotedAttachment) if (&from == this) return; Clear(); MergeFrom(from); } -bool KeyPair::IsInitialized() const { - if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; +bool DataMessage_Quote_QuotedAttachment::IsInitialized() const { + if (_internal_has_thumbnail()) { + if (!_impl_.thumbnail_->IsInitialized()) return false; + } return true; } -void KeyPair::InternalSwap(KeyPair* other) { +void DataMessage_Quote_QuotedAttachment::InternalSwap(DataMessage_Quote_QuotedAttachment* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.publickey_, lhs_arena, - &other->_impl_.publickey_, rhs_arena + &_impl_.contenttype_, lhs_arena, + &other->_impl_.contenttype_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.privatekey_, lhs_arena, - &other->_impl_.privatekey_, rhs_arena + &_impl_.filename_, lhs_arena, + &other->_impl_.filename_, rhs_arena ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(DataMessage_Quote_QuotedAttachment, _impl_.flags_) + + sizeof(DataMessage_Quote_QuotedAttachment::_impl_.flags_) + - PROTOBUF_FIELD_OFFSET(DataMessage_Quote_QuotedAttachment, _impl_.thumbnail_)>( + reinterpret_cast(&_impl_.thumbnail_), + reinterpret_cast(&other->_impl_.thumbnail_)); } -std::string KeyPair::GetTypeName() const { - return "SessionProtos.KeyPair"; +::PROTOBUF_NAMESPACE_ID::Metadata DataMessage_Quote_QuotedAttachment::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[9]); } - // =================================================================== -class DataExtractionNotification::_Internal { +class DataMessage_Quote::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_type(HasBits* has_bits) { - (*has_bits)[0] |= 2u; + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_id(HasBits* has_bits) { + (*has_bits)[0] |= 4u; } - static void set_has_timestamp(HasBits* has_bits) { + static void set_has_author(HasBits* has_bits) { (*has_bits)[0] |= 1u; } + static void set_has_text(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000002) ^ 0x00000002) != 0; + return ((has_bits[0] & 0x00000005) ^ 0x00000005) != 0; } }; -DataExtractionNotification::DataExtractionNotification(::PROTOBUF_NAMESPACE_ID::Arena* arena, +DataMessage_Quote::DataMessage_Quote(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.DataExtractionNotification) + // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Quote) } -DataExtractionNotification::DataExtractionNotification(const DataExtractionNotification& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataExtractionNotification* const _this = this; (void)_this; +DataMessage_Quote::DataMessage_Quote(const DataMessage_Quote& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + DataMessage_Quote* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.timestamp_){} - , decltype(_impl_.type_){}}; - - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::memcpy(&_impl_.timestamp_, &from._impl_.timestamp_, - static_cast(reinterpret_cast(&_impl_.type_) - - reinterpret_cast(&_impl_.timestamp_)) + sizeof(_impl_.type_)); - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataExtractionNotification) -} + , decltype(_impl_.attachments_){from._impl_.attachments_} + , decltype(_impl_.author_){} + , decltype(_impl_.text_){} + , decltype(_impl_.id_){}}; -inline void DataExtractionNotification::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_._has_bits_){} - , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.timestamp_){uint64_t{0u}} - , decltype(_impl_.type_){1} - }; + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.author_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.author_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_author()) { + _this->_impl_.author_.Set(from._internal_author(), + _this->GetArenaForAllocation()); + } + _impl_.text_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.text_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_text()) { + _this->_impl_.text_.Set(from._internal_text(), + _this->GetArenaForAllocation()); + } + _this->_impl_.id_ = from._impl_.id_; + // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.Quote) } -DataExtractionNotification::~DataExtractionNotification() { - // @@protoc_insertion_point(destructor:SessionProtos.DataExtractionNotification) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +inline void DataMessage_Quote::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.attachments_){arena} + , decltype(_impl_.author_){} + , decltype(_impl_.text_){} + , decltype(_impl_.id_){uint64_t{0u}} + }; + _impl_.author_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.author_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.text_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.text_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +DataMessage_Quote::~DataMessage_Quote() { + // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Quote) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void DataExtractionNotification::SharedDtor() { +inline void DataMessage_Quote::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.attachments_.~RepeatedPtrField(); + _impl_.author_.Destroy(); + _impl_.text_.Destroy(); } -void DataExtractionNotification::SetCachedSize(int size) const { +void DataMessage_Quote::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataExtractionNotification::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataExtractionNotification) +void DataMessage_Quote::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.Quote) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + _impl_.attachments_.Clear(); cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000003u) { - _impl_.timestamp_ = uint64_t{0u}; - _impl_.type_ = 1; + if (cached_has_bits & 0x00000001u) { + _impl_.author_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000002u) { + _impl_.text_.ClearNonDefaultToEmpty(); + } } + _impl_.id_ = uint64_t{0u}; _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* DataExtractionNotification::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* DataMessage_Quote::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required .SessionProtos.DataExtractionNotification.Type type = 1; + // required uint64 id = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + _Internal::set_has_id(&has_bits); + _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - if (PROTOBUF_PREDICT_TRUE(::SessionProtos::DataExtractionNotification_Type_IsValid(val))) { - _internal_set_type(static_cast<::SessionProtos::DataExtractionNotification_Type>(val)); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields()); - } } else goto handle_unusual; continue; - // optional uint64 timestamp = 2; + // required string author = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { - _Internal::set_has_timestamp(&has_bits); - _impl_.timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_author(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.Quote.author"); + #endif // !NDEBUG + } else + goto handle_unusual; + continue; + // optional string text = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + auto str = _internal_mutable_text(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.Quote.text"); + #endif // !NDEBUG + } else + goto handle_unusual; + continue; + // repeated .SessionProtos.DataMessage.Quote.QuotedAttachment attachments = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_attachments(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); } else goto handle_unusual; continue; @@ -4867,7 +5047,7 @@ const char* DataExtractionNotification::_InternalParse(const char* ptr, ::_pbi:: } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -4880,240 +5060,344 @@ const char* DataExtractionNotification::_InternalParse(const char* ptr, ::_pbi:: #undef CHK_ } -uint8_t* DataExtractionNotification::_InternalSerialize( +uint8_t* DataMessage_Quote::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataExtractionNotification) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.Quote) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required .SessionProtos.DataExtractionNotification.Type type = 1; - if (cached_has_bits & 0x00000002u) { + // required uint64 id = 1; + if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 1, this->_internal_type(), target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_id(), target); } - // optional uint64 timestamp = 2; + // required string author = 2; if (cached_has_bits & 0x00000001u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_timestamp(), target); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_author().data(), static_cast(this->_internal_author().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.DataMessage.Quote.author"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_author(), target); + } + + // optional string text = 3; + if (cached_has_bits & 0x00000002u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_text().data(), static_cast(this->_internal_text().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.DataMessage.Quote.text"); + target = stream->WriteStringMaybeAliased( + 3, this->_internal_text(), target); + } + + // repeated .SessionProtos.DataMessage.Quote.QuotedAttachment attachments = 4; + for (unsigned i = 0, + n = static_cast(this->_internal_attachments_size()); i < n; i++) { + const auto& repfield = this->_internal_attachments(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(4, repfield, repfield.GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataExtractionNotification) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Quote) return target; } -size_t DataExtractionNotification::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataExtractionNotification) +size_t DataMessage_Quote::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.DataMessage.Quote) size_t total_size = 0; - // required .SessionProtos.DataExtractionNotification.Type type = 1; - if (_internal_has_type()) { + if (_internal_has_author()) { + // required string author = 2; total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_author()); + } + + if (_internal_has_id()) { + // required uint64 id = 1; + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id()); + } + + return total_size; +} +size_t DataMessage_Quote::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.Quote) + size_t total_size = 0; + + if (((_impl_._has_bits_[0] & 0x00000005) ^ 0x00000005) == 0) { // All required fields are present. + // required string author = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_author()); + + // required uint64 id = 1; + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id()); + + } else { + total_size += RequiredFieldsByteSizeFallback(); } uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // optional uint64 timestamp = 2; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_timestamp()); + // repeated .SessionProtos.DataMessage.Quote.QuotedAttachment attachments = 4; + total_size += 1UL * this->_internal_attachments_size(); + for (const auto& msg : this->_impl_.attachments_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + // optional string text = 3; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_text()); } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} -void DataExtractionNotification::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void DataExtractionNotification::MergeFrom(const DataExtractionNotification& from) { - DataExtractionNotification* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataExtractionNotification) +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DataMessage_Quote::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + DataMessage_Quote::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DataMessage_Quote::GetClassData() const { return &_class_data_; } + + +void DataMessage_Quote::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Quote) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; + _this->_impl_.attachments_.MergeFrom(from._impl_.attachments_); cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x00000001u) { - _this->_impl_.timestamp_ = from._impl_.timestamp_; + _this->_internal_set_author(from._internal_author()); } if (cached_has_bits & 0x00000002u) { - _this->_impl_.type_ = from._impl_.type_; + _this->_internal_set_text(from._internal_text()); + } + if (cached_has_bits & 0x00000004u) { + _this->_impl_.id_ = from._impl_.id_; } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void DataExtractionNotification::CopyFrom(const DataExtractionNotification& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataExtractionNotification) +void DataMessage_Quote::CopyFrom(const DataMessage_Quote& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.Quote) if (&from == this) return; Clear(); MergeFrom(from); } -bool DataExtractionNotification::IsInitialized() const { +bool DataMessage_Quote::IsInitialized() const { if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; + if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.attachments_)) + return false; return true; } -void DataExtractionNotification::InternalSwap(DataExtractionNotification* other) { +void DataMessage_Quote::InternalSwap(DataMessage_Quote* other) { using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - swap(_impl_.timestamp_, other->_impl_.timestamp_); - swap(_impl_.type_, other->_impl_.type_); + _impl_.attachments_.InternalSwap(&other->_impl_.attachments_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.author_, lhs_arena, + &other->_impl_.author_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.text_, lhs_arena, + &other->_impl_.text_, rhs_arena + ); + swap(_impl_.id_, other->_impl_.id_); } -std::string DataExtractionNotification::GetTypeName() const { - return "SessionProtos.DataExtractionNotification"; +::PROTOBUF_NAMESPACE_ID::Metadata DataMessage_Quote::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[10]); } - // =================================================================== -class LokiProfile::_Internal { +class DataMessage_Preview::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_displayname(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_url(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_profilepicture(HasBits* has_bits) { + static void set_has_title(HasBits* has_bits) { (*has_bits)[0] |= 2u; } + static const ::SessionProtos::AttachmentPointer& image(const DataMessage_Preview* msg); + static void set_has_image(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0; + } }; -LokiProfile::LokiProfile(::PROTOBUF_NAMESPACE_ID::Arena* arena, +const ::SessionProtos::AttachmentPointer& +DataMessage_Preview::_Internal::image(const DataMessage_Preview* msg) { + return *msg->_impl_.image_; +} +DataMessage_Preview::DataMessage_Preview(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.LokiProfile) + // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Preview) } -LokiProfile::LokiProfile(const LokiProfile& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - LokiProfile* const _this = this; (void)_this; +DataMessage_Preview::DataMessage_Preview(const DataMessage_Preview& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + DataMessage_Preview* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.displayname_){} - , decltype(_impl_.profilepicture_){}}; + , decltype(_impl_.url_){} + , decltype(_impl_.title_){} + , decltype(_impl_.image_){nullptr}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.displayname_.InitDefault(); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.url_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.displayname_.Set("", GetArenaForAllocation()); + _impl_.url_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_displayname()) { - _this->_impl_.displayname_.Set(from._internal_displayname(), + if (from._internal_has_url()) { + _this->_impl_.url_.Set(from._internal_url(), _this->GetArenaForAllocation()); } - _impl_.profilepicture_.InitDefault(); + _impl_.title_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilepicture_.Set("", GetArenaForAllocation()); + _impl_.title_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_profilepicture()) { - _this->_impl_.profilepicture_.Set(from._internal_profilepicture(), + if (from._internal_has_title()) { + _this->_impl_.title_.Set(from._internal_title(), _this->GetArenaForAllocation()); } - // @@protoc_insertion_point(copy_constructor:SessionProtos.LokiProfile) + if (from._internal_has_image()) { + _this->_impl_.image_ = new ::SessionProtos::AttachmentPointer(*from._impl_.image_); + } + // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.Preview) } -inline void LokiProfile::SharedCtor( +inline void DataMessage_Preview::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.displayname_){} - , decltype(_impl_.profilepicture_){} + , decltype(_impl_.url_){} + , decltype(_impl_.title_){} + , decltype(_impl_.image_){nullptr} }; - _impl_.displayname_.InitDefault(); + _impl_.url_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.displayname_.Set("", GetArenaForAllocation()); + _impl_.url_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilepicture_.InitDefault(); + _impl_.title_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilepicture_.Set("", GetArenaForAllocation()); + _impl_.title_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -LokiProfile::~LokiProfile() { - // @@protoc_insertion_point(destructor:SessionProtos.LokiProfile) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +DataMessage_Preview::~DataMessage_Preview() { + // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Preview) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void LokiProfile::SharedDtor() { +inline void DataMessage_Preview::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.displayname_.Destroy(); - _impl_.profilepicture_.Destroy(); + _impl_.url_.Destroy(); + _impl_.title_.Destroy(); + if (this != internal_default_instance()) delete _impl_.image_; } -void LokiProfile::SetCachedSize(int size) const { +void DataMessage_Preview::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void LokiProfile::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.LokiProfile) +void DataMessage_Preview::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.Preview) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x00000001u) { - _impl_.displayname_.ClearNonDefaultToEmpty(); + _impl_.url_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.profilepicture_.ClearNonDefaultToEmpty(); + _impl_.title_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000004u) { + GOOGLE_DCHECK(_impl_.image_ != nullptr); + _impl_.image_->Clear(); } } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* LokiProfile::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* DataMessage_Preview::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // optional string displayName = 1; + // required string url = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_displayname(); + auto str = _internal_mutable_url(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.Preview.url"); + #endif // !NDEBUG } else goto handle_unusual; continue; - // optional string profilePicture = 2; + // optional string title = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_profilepicture(); + auto str = _internal_mutable_title(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.Preview.title"); + #endif // !NDEBUG + } else + goto handle_unusual; + continue; + // optional .SessionProtos.AttachmentPointer image = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr = ctx->ParseMessage(_internal_mutable_image(), ptr); + CHK_(ptr); } else goto handle_unusual; continue; @@ -5128,7 +5412,7 @@ const char* LokiProfile::_InternalParse(const char* ptr, ::_pbi::ParseContext* c } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -5141,293 +5425,328 @@ const char* LokiProfile::_InternalParse(const char* ptr, ::_pbi::ParseContext* c #undef CHK_ } -uint8_t* LokiProfile::_InternalSerialize( +uint8_t* DataMessage_Preview::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.LokiProfile) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.Preview) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // optional string displayName = 1; + // required string url = 1; if (cached_has_bits & 0x00000001u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_url().data(), static_cast(this->_internal_url().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.DataMessage.Preview.url"); target = stream->WriteStringMaybeAliased( - 1, this->_internal_displayname(), target); + 1, this->_internal_url(), target); } - // optional string profilePicture = 2; + // optional string title = 2; if (cached_has_bits & 0x00000002u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_title().data(), static_cast(this->_internal_title().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.DataMessage.Preview.title"); target = stream->WriteStringMaybeAliased( - 2, this->_internal_profilepicture(), target); + 2, this->_internal_title(), target); + } + + // optional .SessionProtos.AttachmentPointer image = 3; + if (cached_has_bits & 0x00000004u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::image(this), + _Internal::image(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.LokiProfile) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Preview) return target; } -size_t LokiProfile::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.LokiProfile) +size_t DataMessage_Preview::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.Preview) size_t total_size = 0; + // required string url = 1; + if (_internal_has_url()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_url()); + } uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - // optional string displayName = 1; - if (cached_has_bits & 0x00000001u) { + if (cached_has_bits & 0x00000006u) { + // optional string title = 2; + if (cached_has_bits & 0x00000002u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_displayname()); + this->_internal_title()); } - // optional string profilePicture = 2; - if (cached_has_bits & 0x00000002u) { + // optional .SessionProtos.AttachmentPointer image = 3; + if (cached_has_bits & 0x00000004u) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_profilepicture()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.image_); } } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); - } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void LokiProfile::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DataMessage_Preview::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + DataMessage_Preview::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DataMessage_Preview::GetClassData() const { return &_class_data_; } -void LokiProfile::MergeFrom(const LokiProfile& from) { - LokiProfile* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.LokiProfile) + +void DataMessage_Preview::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Preview) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_displayname(from._internal_displayname()); + _this->_internal_set_url(from._internal_url()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_profilepicture(from._internal_profilepicture()); + _this->_internal_set_title(from._internal_title()); + } + if (cached_has_bits & 0x00000004u) { + _this->_internal_mutable_image()->::SessionProtos::AttachmentPointer::MergeFrom( + from._internal_image()); } } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void LokiProfile::CopyFrom(const LokiProfile& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.LokiProfile) +void DataMessage_Preview::CopyFrom(const DataMessage_Preview& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.Preview) if (&from == this) return; Clear(); MergeFrom(from); } -bool LokiProfile::IsInitialized() const { +bool DataMessage_Preview::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; + if (_internal_has_image()) { + if (!_impl_.image_->IsInitialized()) return false; + } return true; } -void LokiProfile::InternalSwap(LokiProfile* other) { +void DataMessage_Preview::InternalSwap(DataMessage_Preview* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.displayname_, lhs_arena, - &other->_impl_.displayname_, rhs_arena + &_impl_.url_, lhs_arena, + &other->_impl_.url_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.profilepicture_, lhs_arena, - &other->_impl_.profilepicture_, rhs_arena + &_impl_.title_, lhs_arena, + &other->_impl_.title_, rhs_arena ); + swap(_impl_.image_, other->_impl_.image_); } -std::string LokiProfile::GetTypeName() const { - return "SessionProtos.LokiProfile"; +::PROTOBUF_NAMESPACE_ID::Metadata DataMessage_Preview::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[11]); } - // =================================================================== -class DataMessage_Quote_QuotedAttachment::_Internal { +class DataMessage_Reaction::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_contenttype(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_id(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static void set_has_author(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_filename(HasBits* has_bits) { + static void set_has_emoji(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static const ::SessionProtos::AttachmentPointer& thumbnail(const DataMessage_Quote_QuotedAttachment* msg); - static void set_has_thumbnail(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } - static void set_has_flags(HasBits* has_bits) { + static void set_has_action(HasBits* has_bits) { (*has_bits)[0] |= 8u; } + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x0000000d) ^ 0x0000000d) != 0; + } }; -const ::SessionProtos::AttachmentPointer& -DataMessage_Quote_QuotedAttachment::_Internal::thumbnail(const DataMessage_Quote_QuotedAttachment* msg) { - return *msg->_impl_.thumbnail_; -} -DataMessage_Quote_QuotedAttachment::DataMessage_Quote_QuotedAttachment(::PROTOBUF_NAMESPACE_ID::Arena* arena, +DataMessage_Reaction::DataMessage_Reaction(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Quote.QuotedAttachment) + // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Reaction) } -DataMessage_Quote_QuotedAttachment::DataMessage_Quote_QuotedAttachment(const DataMessage_Quote_QuotedAttachment& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataMessage_Quote_QuotedAttachment* const _this = this; (void)_this; +DataMessage_Reaction::DataMessage_Reaction(const DataMessage_Reaction& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + DataMessage_Reaction* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.contenttype_){} - , decltype(_impl_.filename_){} - , decltype(_impl_.thumbnail_){nullptr} - , decltype(_impl_.flags_){}}; + , decltype(_impl_.author_){} + , decltype(_impl_.emoji_){} + , decltype(_impl_.id_){} + , decltype(_impl_.action_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.contenttype_.InitDefault(); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.author_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.contenttype_.Set("", GetArenaForAllocation()); + _impl_.author_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_contenttype()) { - _this->_impl_.contenttype_.Set(from._internal_contenttype(), + if (from._internal_has_author()) { + _this->_impl_.author_.Set(from._internal_author(), _this->GetArenaForAllocation()); } - _impl_.filename_.InitDefault(); + _impl_.emoji_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.filename_.Set("", GetArenaForAllocation()); + _impl_.emoji_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_filename()) { - _this->_impl_.filename_.Set(from._internal_filename(), + if (from._internal_has_emoji()) { + _this->_impl_.emoji_.Set(from._internal_emoji(), _this->GetArenaForAllocation()); } - if (from._internal_has_thumbnail()) { - _this->_impl_.thumbnail_ = new ::SessionProtos::AttachmentPointer(*from._impl_.thumbnail_); - } - _this->_impl_.flags_ = from._impl_.flags_; - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.Quote.QuotedAttachment) + ::memcpy(&_impl_.id_, &from._impl_.id_, + static_cast(reinterpret_cast(&_impl_.action_) - + reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.action_)); + // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.Reaction) } -inline void DataMessage_Quote_QuotedAttachment::SharedCtor( +inline void DataMessage_Reaction::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.contenttype_){} - , decltype(_impl_.filename_){} - , decltype(_impl_.thumbnail_){nullptr} - , decltype(_impl_.flags_){0u} + , decltype(_impl_.author_){} + , decltype(_impl_.emoji_){} + , decltype(_impl_.id_){uint64_t{0u}} + , decltype(_impl_.action_){0} }; - _impl_.contenttype_.InitDefault(); + _impl_.author_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.contenttype_.Set("", GetArenaForAllocation()); + _impl_.author_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.filename_.InitDefault(); + _impl_.emoji_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.filename_.Set("", GetArenaForAllocation()); + _impl_.emoji_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -DataMessage_Quote_QuotedAttachment::~DataMessage_Quote_QuotedAttachment() { - // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Quote.QuotedAttachment) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +DataMessage_Reaction::~DataMessage_Reaction() { + // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Reaction) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void DataMessage_Quote_QuotedAttachment::SharedDtor() { +inline void DataMessage_Reaction::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.contenttype_.Destroy(); - _impl_.filename_.Destroy(); - if (this != internal_default_instance()) delete _impl_.thumbnail_; + _impl_.author_.Destroy(); + _impl_.emoji_.Destroy(); } -void DataMessage_Quote_QuotedAttachment::SetCachedSize(int size) const { +void DataMessage_Reaction::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataMessage_Quote_QuotedAttachment::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.Quote.QuotedAttachment) +void DataMessage_Reaction::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.Reaction) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _impl_.contenttype_.ClearNonDefaultToEmpty(); + _impl_.author_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.filename_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000004u) { - GOOGLE_DCHECK(_impl_.thumbnail_ != nullptr); - _impl_.thumbnail_->Clear(); + _impl_.emoji_.ClearNonDefaultToEmpty(); } } - _impl_.flags_ = 0u; + if (cached_has_bits & 0x0000000cu) { + ::memset(&_impl_.id_, 0, static_cast( + reinterpret_cast(&_impl_.action_) - + reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.action_)); + } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* DataMessage_Quote_QuotedAttachment::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* DataMessage_Reaction::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // optional string contentType = 1; + // required uint64 id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_contenttype(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _Internal::set_has_id(&has_bits); + _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else goto handle_unusual; continue; - // optional string fileName = 2; + // required string author = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_filename(); + auto str = _internal_mutable_author(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.Reaction.author"); + #endif // !NDEBUG } else goto handle_unusual; continue; - // optional .SessionProtos.AttachmentPointer thumbnail = 3; + // optional string emoji = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - ptr = ctx->ParseMessage(_internal_mutable_thumbnail(), ptr); + auto str = _internal_mutable_emoji(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.Reaction.emoji"); + #endif // !NDEBUG } else goto handle_unusual; continue; - // optional uint32 flags = 4; + // required .SessionProtos.DataMessage.Reaction.Action action = 4; case 4: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - _Internal::set_has_flags(&has_bits); - _impl_.flags_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); + if (PROTOBUF_PREDICT_TRUE(::SessionProtos::DataMessage_Reaction_Action_IsValid(val))) { + _internal_set_action(static_cast<::SessionProtos::DataMessage_Reaction_Action>(val)); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields()); + } } else goto handle_unusual; continue; @@ -5442,7 +5761,7 @@ const char* DataMessage_Quote_QuotedAttachment::_InternalParse(const char* ptr, } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -5455,100 +5774,124 @@ const char* DataMessage_Quote_QuotedAttachment::_InternalParse(const char* ptr, #undef CHK_ } -uint8_t* DataMessage_Quote_QuotedAttachment::_InternalSerialize( +uint8_t* DataMessage_Reaction::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.Quote.QuotedAttachment) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.Reaction) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // optional string contentType = 1; + // required uint64 id = 1; + if (cached_has_bits & 0x00000004u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_id(), target); + } + + // required string author = 2; if (cached_has_bits & 0x00000001u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_author().data(), static_cast(this->_internal_author().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.DataMessage.Reaction.author"); target = stream->WriteStringMaybeAliased( - 1, this->_internal_contenttype(), target); + 2, this->_internal_author(), target); } - // optional string fileName = 2; + // optional string emoji = 3; if (cached_has_bits & 0x00000002u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_emoji().data(), static_cast(this->_internal_emoji().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.DataMessage.Reaction.emoji"); target = stream->WriteStringMaybeAliased( - 2, this->_internal_filename(), target); - } - - // optional .SessionProtos.AttachmentPointer thumbnail = 3; - if (cached_has_bits & 0x00000004u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::thumbnail(this), - _Internal::thumbnail(this).GetCachedSize(), target, stream); + 3, this->_internal_emoji(), target); } - // optional uint32 flags = 4; + // required .SessionProtos.DataMessage.Reaction.Action action = 4; if (cached_has_bits & 0x00000008u) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_flags(), target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 4, this->_internal_action(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Quote.QuotedAttachment) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Reaction) return target; } -size_t DataMessage_Quote_QuotedAttachment::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.Quote.QuotedAttachment) +size_t DataMessage_Reaction::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.DataMessage.Reaction) size_t total_size = 0; - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; + if (_internal_has_author()) { + // required string author = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_author()); + } - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { - // optional string contentType = 1; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_contenttype()); - } + if (_internal_has_id()) { + // required uint64 id = 1; + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id()); + } - // optional string fileName = 2; - if (cached_has_bits & 0x00000002u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_filename()); - } + if (_internal_has_action()) { + // required .SessionProtos.DataMessage.Reaction.Action action = 4; + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_action()); + } - // optional .SessionProtos.AttachmentPointer thumbnail = 3; - if (cached_has_bits & 0x00000004u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.thumbnail_); - } + return total_size; +} +size_t DataMessage_Reaction::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.Reaction) + size_t total_size = 0; - // optional uint32 flags = 4; - if (cached_has_bits & 0x00000008u) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); - } + if (((_impl_._has_bits_[0] & 0x0000000d) ^ 0x0000000d) == 0) { // All required fields are present. + // required string author = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_author()); + + // required uint64 id = 1; + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id()); + + // required .SessionProtos.DataMessage.Reaction.Action action = 4; + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_action()); + } else { + total_size += RequiredFieldsByteSizeFallback(); } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // optional string emoji = 3; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_emoji()); } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} -void DataMessage_Quote_QuotedAttachment::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void DataMessage_Quote_QuotedAttachment::MergeFrom(const DataMessage_Quote_QuotedAttachment& from) { - DataMessage_Quote_QuotedAttachment* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Quote.QuotedAttachment) +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DataMessage_Reaction::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + DataMessage_Reaction::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DataMessage_Reaction::GetClassData() const { return &_class_data_; } + + +void DataMessage_Reaction::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Reaction) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -5556,228 +5899,199 @@ void DataMessage_Quote_QuotedAttachment::MergeFrom(const DataMessage_Quote_Quote cached_has_bits = from._impl_._has_bits_[0]; if (cached_has_bits & 0x0000000fu) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_contenttype(from._internal_contenttype()); + _this->_internal_set_author(from._internal_author()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_filename(from._internal_filename()); + _this->_internal_set_emoji(from._internal_emoji()); } if (cached_has_bits & 0x00000004u) { - _this->_internal_mutable_thumbnail()->::SessionProtos::AttachmentPointer::MergeFrom( - from._internal_thumbnail()); + _this->_impl_.id_ = from._impl_.id_; } if (cached_has_bits & 0x00000008u) { - _this->_impl_.flags_ = from._impl_.flags_; + _this->_impl_.action_ = from._impl_.action_; } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void DataMessage_Quote_QuotedAttachment::CopyFrom(const DataMessage_Quote_QuotedAttachment& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.Quote.QuotedAttachment) +void DataMessage_Reaction::CopyFrom(const DataMessage_Reaction& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.Reaction) if (&from == this) return; Clear(); MergeFrom(from); } -bool DataMessage_Quote_QuotedAttachment::IsInitialized() const { - if (_internal_has_thumbnail()) { - if (!_impl_.thumbnail_->IsInitialized()) return false; - } +bool DataMessage_Reaction::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; return true; } -void DataMessage_Quote_QuotedAttachment::InternalSwap(DataMessage_Quote_QuotedAttachment* other) { +void DataMessage_Reaction::InternalSwap(DataMessage_Reaction* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.contenttype_, lhs_arena, - &other->_impl_.contenttype_, rhs_arena + &_impl_.author_, lhs_arena, + &other->_impl_.author_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.filename_, lhs_arena, - &other->_impl_.filename_, rhs_arena + &_impl_.emoji_, lhs_arena, + &other->_impl_.emoji_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(DataMessage_Quote_QuotedAttachment, _impl_.flags_) - + sizeof(DataMessage_Quote_QuotedAttachment::_impl_.flags_) - - PROTOBUF_FIELD_OFFSET(DataMessage_Quote_QuotedAttachment, _impl_.thumbnail_)>( - reinterpret_cast(&_impl_.thumbnail_), - reinterpret_cast(&other->_impl_.thumbnail_)); + PROTOBUF_FIELD_OFFSET(DataMessage_Reaction, _impl_.action_) + + sizeof(DataMessage_Reaction::_impl_.action_) + - PROTOBUF_FIELD_OFFSET(DataMessage_Reaction, _impl_.id_)>( + reinterpret_cast(&_impl_.id_), + reinterpret_cast(&other->_impl_.id_)); } -std::string DataMessage_Quote_QuotedAttachment::GetTypeName() const { - return "SessionProtos.DataMessage.Quote.QuotedAttachment"; +::PROTOBUF_NAMESPACE_ID::Metadata DataMessage_Reaction::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[12]); } - // =================================================================== -class DataMessage_Quote::_Internal { +class DataMessage_OpenGroupInvitation::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_id(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } - static void set_has_author(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_url(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_text(HasBits* has_bits) { + static void set_has_name(HasBits* has_bits) { (*has_bits)[0] |= 2u; } static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000005) ^ 0x00000005) != 0; + return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; } }; -DataMessage_Quote::DataMessage_Quote(::PROTOBUF_NAMESPACE_ID::Arena* arena, +DataMessage_OpenGroupInvitation::DataMessage_OpenGroupInvitation(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Quote) + // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.OpenGroupInvitation) } -DataMessage_Quote::DataMessage_Quote(const DataMessage_Quote& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataMessage_Quote* const _this = this; (void)_this; +DataMessage_OpenGroupInvitation::DataMessage_OpenGroupInvitation(const DataMessage_OpenGroupInvitation& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + DataMessage_OpenGroupInvitation* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.attachments_){from._impl_.attachments_} - , decltype(_impl_.author_){} - , decltype(_impl_.text_){} - , decltype(_impl_.id_){}}; + , decltype(_impl_.url_){} + , decltype(_impl_.name_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.author_.InitDefault(); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.url_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.author_.Set("", GetArenaForAllocation()); + _impl_.url_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_author()) { - _this->_impl_.author_.Set(from._internal_author(), + if (from._internal_has_url()) { + _this->_impl_.url_.Set(from._internal_url(), _this->GetArenaForAllocation()); } - _impl_.text_.InitDefault(); + _impl_.name_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.text_.Set("", GetArenaForAllocation()); + _impl_.name_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_text()) { - _this->_impl_.text_.Set(from._internal_text(), + if (from._internal_has_name()) { + _this->_impl_.name_.Set(from._internal_name(), _this->GetArenaForAllocation()); } - _this->_impl_.id_ = from._impl_.id_; - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.Quote) + // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.OpenGroupInvitation) } -inline void DataMessage_Quote::SharedCtor( +inline void DataMessage_OpenGroupInvitation::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.attachments_){arena} - , decltype(_impl_.author_){} - , decltype(_impl_.text_){} - , decltype(_impl_.id_){uint64_t{0u}} + , decltype(_impl_.url_){} + , decltype(_impl_.name_){} }; - _impl_.author_.InitDefault(); + _impl_.url_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.author_.Set("", GetArenaForAllocation()); + _impl_.url_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.text_.InitDefault(); + _impl_.name_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.text_.Set("", GetArenaForAllocation()); + _impl_.name_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -DataMessage_Quote::~DataMessage_Quote() { - // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Quote) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +DataMessage_OpenGroupInvitation::~DataMessage_OpenGroupInvitation() { + // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.OpenGroupInvitation) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void DataMessage_Quote::SharedDtor() { +inline void DataMessage_OpenGroupInvitation::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.attachments_.~RepeatedPtrField(); - _impl_.author_.Destroy(); - _impl_.text_.Destroy(); + _impl_.url_.Destroy(); + _impl_.name_.Destroy(); } -void DataMessage_Quote::SetCachedSize(int size) const { +void DataMessage_OpenGroupInvitation::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataMessage_Quote::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.Quote) +void DataMessage_OpenGroupInvitation::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.OpenGroupInvitation) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.attachments_.Clear(); cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _impl_.author_.ClearNonDefaultToEmpty(); + _impl_.url_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.text_.ClearNonDefaultToEmpty(); + _impl_.name_.ClearNonDefaultToEmpty(); } } - _impl_.id_ = uint64_t{0u}; _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* DataMessage_Quote::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* DataMessage_OpenGroupInvitation::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required uint64 id = 1; + // required string url = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _Internal::set_has_id(&has_bits); - _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // required string author = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_author(); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_url(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.OpenGroupInvitation.url"); + #endif // !NDEBUG } else goto handle_unusual; continue; - // optional string text = 3; + // required string name = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_text(); + auto str = _internal_mutable_name(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - } else - goto handle_unusual; - continue; - // repeated .SessionProtos.DataMessage.Quote.QuotedAttachment attachments = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_attachments(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.OpenGroupInvitation.name"); + #endif // !NDEBUG } else goto handle_unusual; continue; @@ -5792,7 +6106,7 @@ const char* DataMessage_Quote::_InternalParse(const char* ptr, ::_pbi::ParseCont } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -5805,77 +6119,75 @@ const char* DataMessage_Quote::_InternalParse(const char* ptr, ::_pbi::ParseCont #undef CHK_ } -uint8_t* DataMessage_Quote::_InternalSerialize( +uint8_t* DataMessage_OpenGroupInvitation::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.Quote) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.OpenGroupInvitation) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required uint64 id = 1; - if (cached_has_bits & 0x00000004u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_id(), target); - } - - // required string author = 2; + // required string url = 1; if (cached_has_bits & 0x00000001u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_url().data(), static_cast(this->_internal_url().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.DataMessage.OpenGroupInvitation.url"); target = stream->WriteStringMaybeAliased( - 2, this->_internal_author(), target); + 1, this->_internal_url(), target); } - // optional string text = 3; + // required string name = 3; if (cached_has_bits & 0x00000002u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_name().data(), static_cast(this->_internal_name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.DataMessage.OpenGroupInvitation.name"); target = stream->WriteStringMaybeAliased( - 3, this->_internal_text(), target); - } - - // repeated .SessionProtos.DataMessage.Quote.QuotedAttachment attachments = 4; - for (unsigned i = 0, - n = static_cast(this->_internal_attachments_size()); i < n; i++) { - const auto& repfield = this->_internal_attachments(i); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(4, repfield, repfield.GetCachedSize(), target, stream); + 3, this->_internal_name(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Quote) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.OpenGroupInvitation) return target; } -size_t DataMessage_Quote::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.DataMessage.Quote) +size_t DataMessage_OpenGroupInvitation::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.DataMessage.OpenGroupInvitation) size_t total_size = 0; - if (_internal_has_author()) { - // required string author = 2; + if (_internal_has_url()) { + // required string url = 1; total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_author()); + this->_internal_url()); } - if (_internal_has_id()) { - // required uint64 id = 1; - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id()); + if (_internal_has_name()) { + // required string name = 3; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); } return total_size; } -size_t DataMessage_Quote::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.Quote) +size_t DataMessage_OpenGroupInvitation::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.OpenGroupInvitation) size_t total_size = 0; - if (((_impl_._has_bits_[0] & 0x00000005) ^ 0x00000005) == 0) { // All required fields are present. - // required string author = 2; + if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. + // required string url = 1; total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_author()); + this->_internal_url()); - // required uint64 id = 1; - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id()); + // required string name = 3; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); } else { total_size += RequiredFieldsByteSizeFallback(); @@ -5884,590 +6196,919 @@ size_t DataMessage_Quote::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // repeated .SessionProtos.DataMessage.Quote.QuotedAttachment attachments = 4; - total_size += 1UL * this->_internal_attachments_size(); - for (const auto& msg : this->_impl_.attachments_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // optional string text = 3; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000002u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_text()); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); - } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void DataMessage_Quote::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DataMessage_OpenGroupInvitation::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + DataMessage_OpenGroupInvitation::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DataMessage_OpenGroupInvitation::GetClassData() const { return &_class_data_; } -void DataMessage_Quote::MergeFrom(const DataMessage_Quote& from) { - DataMessage_Quote* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Quote) + +void DataMessage_OpenGroupInvitation::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.OpenGroupInvitation) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.attachments_.MergeFrom(from._impl_.attachments_); cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_author(from._internal_author()); + _this->_internal_set_url(from._internal_url()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_text(from._internal_text()); - } - if (cached_has_bits & 0x00000004u) { - _this->_impl_.id_ = from._impl_.id_; + _this->_internal_set_name(from._internal_name()); } - _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void DataMessage_Quote::CopyFrom(const DataMessage_Quote& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.Quote) +void DataMessage_OpenGroupInvitation::CopyFrom(const DataMessage_OpenGroupInvitation& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.OpenGroupInvitation) if (&from == this) return; Clear(); MergeFrom(from); } -bool DataMessage_Quote::IsInitialized() const { +bool DataMessage_OpenGroupInvitation::IsInitialized() const { if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; - if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.attachments_)) - return false; return true; } -void DataMessage_Quote::InternalSwap(DataMessage_Quote* other) { +void DataMessage_OpenGroupInvitation::InternalSwap(DataMessage_OpenGroupInvitation* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.attachments_.InternalSwap(&other->_impl_.attachments_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.author_, lhs_arena, - &other->_impl_.author_, rhs_arena + &_impl_.url_, lhs_arena, + &other->_impl_.url_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.text_, lhs_arena, - &other->_impl_.text_, rhs_arena + &_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena ); - swap(_impl_.id_, other->_impl_.id_); } -std::string DataMessage_Quote::GetTypeName() const { - return "SessionProtos.DataMessage.Quote"; +::PROTOBUF_NAMESPACE_ID::Metadata DataMessage_OpenGroupInvitation::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[13]); } - // =================================================================== -class DataMessage_Preview::_Internal { +class DataMessage::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_url(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_body(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_title(HasBits* has_bits) { + static void set_has_flags(HasBits* has_bits) { + (*has_bits)[0] |= 512u; + } + static void set_has_profilekey(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static const ::SessionProtos::AttachmentPointer& image(const DataMessage_Preview* msg); - static void set_has_image(HasBits* has_bits) { + static void set_has_timestamp(HasBits* has_bits) { + (*has_bits)[0] |= 256u; + } + static const ::SessionProtos::DataMessage_Quote& quote(const DataMessage* msg); + static void set_has_quote(HasBits* has_bits) { + (*has_bits)[0] |= 8u; + } + static const ::SessionProtos::DataMessage_Reaction& reaction(const DataMessage* msg); + static void set_has_reaction(HasBits* has_bits) { + (*has_bits)[0] |= 16u; + } + static const ::SessionProtos::LokiProfile& profile(const DataMessage* msg); + static void set_has_profile(HasBits* has_bits) { + (*has_bits)[0] |= 32u; + } + static const ::SessionProtos::DataMessage_OpenGroupInvitation& opengroupinvitation(const DataMessage* msg); + static void set_has_opengroupinvitation(HasBits* has_bits) { + (*has_bits)[0] |= 64u; + } + static void set_has_synctarget(HasBits* has_bits) { (*has_bits)[0] |= 4u; } - static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0; + static void set_has_blockscommunitymessagerequests(HasBits* has_bits) { + (*has_bits)[0] |= 1024u; + } + static const ::SessionProtos::GroupUpdateMessage& groupupdatemessage(const DataMessage* msg); + static void set_has_groupupdatemessage(HasBits* has_bits) { + (*has_bits)[0] |= 128u; } }; -const ::SessionProtos::AttachmentPointer& -DataMessage_Preview::_Internal::image(const DataMessage_Preview* msg) { - return *msg->_impl_.image_; +const ::SessionProtos::DataMessage_Quote& +DataMessage::_Internal::quote(const DataMessage* msg) { + return *msg->_impl_.quote_; } -DataMessage_Preview::DataMessage_Preview(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Preview) +const ::SessionProtos::DataMessage_Reaction& +DataMessage::_Internal::reaction(const DataMessage* msg) { + return *msg->_impl_.reaction_; } -DataMessage_Preview::DataMessage_Preview(const DataMessage_Preview& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataMessage_Preview* const _this = this; (void)_this; - new (&_impl_) Impl_{ +const ::SessionProtos::LokiProfile& +DataMessage::_Internal::profile(const DataMessage* msg) { + return *msg->_impl_.profile_; +} +const ::SessionProtos::DataMessage_OpenGroupInvitation& +DataMessage::_Internal::opengroupinvitation(const DataMessage* msg) { + return *msg->_impl_.opengroupinvitation_; +} +const ::SessionProtos::GroupUpdateMessage& +DataMessage::_Internal::groupupdatemessage(const DataMessage* msg) { + return *msg->_impl_.groupupdatemessage_; +} +DataMessage::DataMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage) +} +DataMessage::DataMessage(const DataMessage& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + DataMessage* const _this = this; (void)_this; + new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.url_){} - , decltype(_impl_.title_){} - , decltype(_impl_.image_){nullptr}}; + , decltype(_impl_.attachments_){from._impl_.attachments_} + , decltype(_impl_.preview_){from._impl_.preview_} + , decltype(_impl_.body_){} + , decltype(_impl_.profilekey_){} + , decltype(_impl_.synctarget_){} + , decltype(_impl_.quote_){nullptr} + , decltype(_impl_.reaction_){nullptr} + , decltype(_impl_.profile_){nullptr} + , decltype(_impl_.opengroupinvitation_){nullptr} + , decltype(_impl_.groupupdatemessage_){nullptr} + , decltype(_impl_.timestamp_){} + , decltype(_impl_.flags_){} + , decltype(_impl_.blockscommunitymessagerequests_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.url_.InitDefault(); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.body_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.url_.Set("", GetArenaForAllocation()); + _impl_.body_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_url()) { - _this->_impl_.url_.Set(from._internal_url(), + if (from._internal_has_body()) { + _this->_impl_.body_.Set(from._internal_body(), _this->GetArenaForAllocation()); } - _impl_.title_.InitDefault(); + _impl_.profilekey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.title_.Set("", GetArenaForAllocation()); + _impl_.profilekey_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_title()) { - _this->_impl_.title_.Set(from._internal_title(), + if (from._internal_has_profilekey()) { + _this->_impl_.profilekey_.Set(from._internal_profilekey(), _this->GetArenaForAllocation()); } - if (from._internal_has_image()) { - _this->_impl_.image_ = new ::SessionProtos::AttachmentPointer(*from._impl_.image_); + _impl_.synctarget_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.synctarget_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_synctarget()) { + _this->_impl_.synctarget_.Set(from._internal_synctarget(), + _this->GetArenaForAllocation()); } - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.Preview) + if (from._internal_has_quote()) { + _this->_impl_.quote_ = new ::SessionProtos::DataMessage_Quote(*from._impl_.quote_); + } + if (from._internal_has_reaction()) { + _this->_impl_.reaction_ = new ::SessionProtos::DataMessage_Reaction(*from._impl_.reaction_); + } + if (from._internal_has_profile()) { + _this->_impl_.profile_ = new ::SessionProtos::LokiProfile(*from._impl_.profile_); + } + if (from._internal_has_opengroupinvitation()) { + _this->_impl_.opengroupinvitation_ = new ::SessionProtos::DataMessage_OpenGroupInvitation(*from._impl_.opengroupinvitation_); + } + if (from._internal_has_groupupdatemessage()) { + _this->_impl_.groupupdatemessage_ = new ::SessionProtos::GroupUpdateMessage(*from._impl_.groupupdatemessage_); + } + ::memcpy(&_impl_.timestamp_, &from._impl_.timestamp_, + static_cast(reinterpret_cast(&_impl_.blockscommunitymessagerequests_) - + reinterpret_cast(&_impl_.timestamp_)) + sizeof(_impl_.blockscommunitymessagerequests_)); + // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage) } -inline void DataMessage_Preview::SharedCtor( +inline void DataMessage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.url_){} - , decltype(_impl_.title_){} - , decltype(_impl_.image_){nullptr} + , decltype(_impl_.attachments_){arena} + , decltype(_impl_.preview_){arena} + , decltype(_impl_.body_){} + , decltype(_impl_.profilekey_){} + , decltype(_impl_.synctarget_){} + , decltype(_impl_.quote_){nullptr} + , decltype(_impl_.reaction_){nullptr} + , decltype(_impl_.profile_){nullptr} + , decltype(_impl_.opengroupinvitation_){nullptr} + , decltype(_impl_.groupupdatemessage_){nullptr} + , decltype(_impl_.timestamp_){uint64_t{0u}} + , decltype(_impl_.flags_){0u} + , decltype(_impl_.blockscommunitymessagerequests_){false} }; - _impl_.url_.InitDefault(); + _impl_.body_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.url_.Set("", GetArenaForAllocation()); + _impl_.body_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.title_.InitDefault(); + _impl_.profilekey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.title_.Set("", GetArenaForAllocation()); + _impl_.profilekey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.synctarget_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.synctarget_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -DataMessage_Preview::~DataMessage_Preview() { - // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Preview) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +DataMessage::~DataMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.DataMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void DataMessage_Preview::SharedDtor() { +inline void DataMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.url_.Destroy(); - _impl_.title_.Destroy(); - if (this != internal_default_instance()) delete _impl_.image_; + _impl_.attachments_.~RepeatedPtrField(); + _impl_.preview_.~RepeatedPtrField(); + _impl_.body_.Destroy(); + _impl_.profilekey_.Destroy(); + _impl_.synctarget_.Destroy(); + if (this != internal_default_instance()) delete _impl_.quote_; + if (this != internal_default_instance()) delete _impl_.reaction_; + if (this != internal_default_instance()) delete _impl_.profile_; + if (this != internal_default_instance()) delete _impl_.opengroupinvitation_; + if (this != internal_default_instance()) delete _impl_.groupupdatemessage_; } -void DataMessage_Preview::SetCachedSize(int size) const { +void DataMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataMessage_Preview::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.Preview) +void DataMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + _impl_.attachments_.Clear(); + _impl_.preview_.Clear(); cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x000000ffu) { if (cached_has_bits & 0x00000001u) { - _impl_.url_.ClearNonDefaultToEmpty(); + _impl_.body_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.title_.ClearNonDefaultToEmpty(); + _impl_.profilekey_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000004u) { - GOOGLE_DCHECK(_impl_.image_ != nullptr); - _impl_.image_->Clear(); + _impl_.synctarget_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000008u) { + GOOGLE_DCHECK(_impl_.quote_ != nullptr); + _impl_.quote_->Clear(); + } + if (cached_has_bits & 0x00000010u) { + GOOGLE_DCHECK(_impl_.reaction_ != nullptr); + _impl_.reaction_->Clear(); + } + if (cached_has_bits & 0x00000020u) { + GOOGLE_DCHECK(_impl_.profile_ != nullptr); + _impl_.profile_->Clear(); + } + if (cached_has_bits & 0x00000040u) { + GOOGLE_DCHECK(_impl_.opengroupinvitation_ != nullptr); + _impl_.opengroupinvitation_->Clear(); + } + if (cached_has_bits & 0x00000080u) { + GOOGLE_DCHECK(_impl_.groupupdatemessage_ != nullptr); + _impl_.groupupdatemessage_->Clear(); } } + if (cached_has_bits & 0x00000700u) { + ::memset(&_impl_.timestamp_, 0, static_cast( + reinterpret_cast(&_impl_.blockscommunitymessagerequests_) - + reinterpret_cast(&_impl_.timestamp_)) + sizeof(_impl_.blockscommunitymessagerequests_)); + } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* DataMessage_Preview::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* DataMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required string url = 1; + // optional string body = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_url(); + auto str = _internal_mutable_body(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.body"); + #endif // !NDEBUG } else goto handle_unusual; continue; - // optional string title = 2; + // repeated .SessionProtos.AttachmentPointer attachments = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_title(); + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_attachments(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); + } else + goto handle_unusual; + continue; + // optional uint32 flags = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + _Internal::set_has_flags(&has_bits); + _impl_.flags_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional bytes profileKey = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { + auto str = _internal_mutable_profilekey(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional .SessionProtos.AttachmentPointer image = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - ptr = ctx->ParseMessage(_internal_mutable_image(), ptr); + // optional uint64 timestamp = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { + _Internal::set_has_timestamp(&has_bits); + _impl_.timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else goto handle_unusual; continue; - default: - goto handle_unusual; - } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields(), - ptr, ctx); - CHK_(ptr != nullptr); - } // while -message_done: - _impl_._has_bits_.Or(has_bits); - return ptr; -failure: - ptr = nullptr; - goto message_done; -#undef CHK_ -} - -uint8_t* DataMessage_Preview::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.Preview) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // required string url = 1; - if (cached_has_bits & 0x00000001u) { - target = stream->WriteStringMaybeAliased( - 1, this->_internal_url(), target); - } - - // optional string title = 2; - if (cached_has_bits & 0x00000002u) { - target = stream->WriteStringMaybeAliased( - 2, this->_internal_title(), target); - } - - // optional .SessionProtos.AttachmentPointer image = 3; - if (cached_has_bits & 0x00000004u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::image(this), - _Internal::image(this).GetCachedSize(), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); - } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Preview) - return target; -} - -size_t DataMessage_Preview::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.Preview) - size_t total_size = 0; + // optional .SessionProtos.DataMessage.Quote quote = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { + ptr = ctx->ParseMessage(_internal_mutable_quote(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // repeated .SessionProtos.DataMessage.Preview preview = 10; + case 10: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 82)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_preview(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<82>(ptr)); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.DataMessage.Reaction reaction = 11; + case 11: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 90)) { + ptr = ctx->ParseMessage(_internal_mutable_reaction(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.LokiProfile profile = 101; + case 101: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + ptr = ctx->ParseMessage(_internal_mutable_profile(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + case 102: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { + ptr = ctx->ParseMessage(_internal_mutable_opengroupinvitation(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional string syncTarget = 105; + case 105: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { + auto str = _internal_mutable_synctarget(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.syncTarget"); + #endif // !NDEBUG + } else + goto handle_unusual; + continue; + // optional bool blocksCommunityMessageRequests = 106; + case 106: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 80)) { + _Internal::set_has_blockscommunitymessagerequests(&has_bits); + _impl_.blockscommunitymessagerequests_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.GroupUpdateMessage groupUpdateMessage = 120; + case 120: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 194)) { + ptr = ctx->ParseMessage(_internal_mutable_groupupdatemessage(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} - // required string url = 1; - if (_internal_has_url()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_url()); - } +uint8_t* DataMessage::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage) uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000006u) { - // optional string title = 2; - if (cached_has_bits & 0x00000002u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_title()); - } + // optional string body = 1; + if (cached_has_bits & 0x00000001u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_body().data(), static_cast(this->_internal_body().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.DataMessage.body"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_body(), target); + } - // optional .SessionProtos.AttachmentPointer image = 3; - if (cached_has_bits & 0x00000004u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.image_); - } + // repeated .SessionProtos.AttachmentPointer attachments = 2; + for (unsigned i = 0, + n = static_cast(this->_internal_attachments_size()); i < n; i++) { + const auto& repfield = this->_internal_attachments(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); + } + + // optional uint32 flags = 4; + if (cached_has_bits & 0x00000200u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_flags(), target); + } + + // optional bytes profileKey = 6; + if (cached_has_bits & 0x00000002u) { + target = stream->WriteBytesMaybeAliased( + 6, this->_internal_profilekey(), target); + } + + // optional uint64 timestamp = 7; + if (cached_has_bits & 0x00000100u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(7, this->_internal_timestamp(), target); + } + + // optional .SessionProtos.DataMessage.Quote quote = 8; + if (cached_has_bits & 0x00000008u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(8, _Internal::quote(this), + _Internal::quote(this).GetCachedSize(), target, stream); + } + + // repeated .SessionProtos.DataMessage.Preview preview = 10; + for (unsigned i = 0, + n = static_cast(this->_internal_preview_size()); i < n; i++) { + const auto& repfield = this->_internal_preview(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(10, repfield, repfield.GetCachedSize(), target, stream); + } + + // optional .SessionProtos.DataMessage.Reaction reaction = 11; + if (cached_has_bits & 0x00000010u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(11, _Internal::reaction(this), + _Internal::reaction(this).GetCachedSize(), target, stream); + } + + // optional .SessionProtos.LokiProfile profile = 101; + if (cached_has_bits & 0x00000020u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(101, _Internal::profile(this), + _Internal::profile(this).GetCachedSize(), target, stream); + } + + // optional .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + if (cached_has_bits & 0x00000040u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(102, _Internal::opengroupinvitation(this), + _Internal::opengroupinvitation(this).GetCachedSize(), target, stream); + } + + // optional string syncTarget = 105; + if (cached_has_bits & 0x00000004u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_synctarget().data(), static_cast(this->_internal_synctarget().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.DataMessage.syncTarget"); + target = stream->WriteStringMaybeAliased( + 105, this->_internal_synctarget(), target); + } + + // optional bool blocksCommunityMessageRequests = 106; + if (cached_has_bits & 0x00000400u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(106, this->_internal_blockscommunitymessagerequests(), target); + } + // optional .SessionProtos.GroupUpdateMessage groupUpdateMessage = 120; + if (cached_has_bits & 0x00000080u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(120, _Internal::groupupdatemessage(this), + _Internal::groupupdatemessage(this).GetCachedSize(), target, stream); } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage) + return target; } -void DataMessage_Preview::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} +size_t DataMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage) + size_t total_size = 0; -void DataMessage_Preview::MergeFrom(const DataMessage_Preview& from) { - DataMessage_Preview* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Preview) - GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { + // repeated .SessionProtos.AttachmentPointer attachments = 2; + total_size += 1UL * this->_internal_attachments_size(); + for (const auto& msg : this->_impl_.attachments_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // repeated .SessionProtos.DataMessage.Preview preview = 10; + total_size += 1UL * this->_internal_preview_size(); + for (const auto& msg : this->_impl_.preview_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x000000ffu) { + // optional string body = 1; if (cached_has_bits & 0x00000001u) { - _this->_internal_set_url(from._internal_url()); + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_body()); } + + // optional bytes profileKey = 6; if (cached_has_bits & 0x00000002u) { - _this->_internal_set_title(from._internal_title()); + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_profilekey()); } + + // optional string syncTarget = 105; if (cached_has_bits & 0x00000004u) { - _this->_internal_mutable_image()->::SessionProtos::AttachmentPointer::MergeFrom( - from._internal_image()); + total_size += 2 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_synctarget()); } - } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); -} -void DataMessage_Preview::CopyFrom(const DataMessage_Preview& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.Preview) - if (&from == this) return; - Clear(); - MergeFrom(from); -} + // optional .SessionProtos.DataMessage.Quote quote = 8; + if (cached_has_bits & 0x00000008u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.quote_); + } -bool DataMessage_Preview::IsInitialized() const { - if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; - if (_internal_has_image()) { - if (!_impl_.image_->IsInitialized()) return false; + // optional .SessionProtos.DataMessage.Reaction reaction = 11; + if (cached_has_bits & 0x00000010u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.reaction_); + } + + // optional .SessionProtos.LokiProfile profile = 101; + if (cached_has_bits & 0x00000020u) { + total_size += 2 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.profile_); + } + + // optional .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + if (cached_has_bits & 0x00000040u) { + total_size += 2 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.opengroupinvitation_); + } + + // optional .SessionProtos.GroupUpdateMessage groupUpdateMessage = 120; + if (cached_has_bits & 0x00000080u) { + total_size += 2 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.groupupdatemessage_); + } + + } + if (cached_has_bits & 0x00000700u) { + // optional uint64 timestamp = 7; + if (cached_has_bits & 0x00000100u) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_timestamp()); + } + + // optional uint32 flags = 4; + if (cached_has_bits & 0x00000200u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); + } + + // optional bool blocksCommunityMessageRequests = 106; + if (cached_has_bits & 0x00000400u) { + total_size += 2 + 1; + } + + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DataMessage::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + DataMessage::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DataMessage::GetClassData() const { return &_class_data_; } + + +void DataMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.attachments_.MergeFrom(from._impl_.attachments_); + _this->_impl_.preview_.MergeFrom(from._impl_.preview_); + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x000000ffu) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_body(from._internal_body()); + } + if (cached_has_bits & 0x00000002u) { + _this->_internal_set_profilekey(from._internal_profilekey()); + } + if (cached_has_bits & 0x00000004u) { + _this->_internal_set_synctarget(from._internal_synctarget()); + } + if (cached_has_bits & 0x00000008u) { + _this->_internal_mutable_quote()->::SessionProtos::DataMessage_Quote::MergeFrom( + from._internal_quote()); + } + if (cached_has_bits & 0x00000010u) { + _this->_internal_mutable_reaction()->::SessionProtos::DataMessage_Reaction::MergeFrom( + from._internal_reaction()); + } + if (cached_has_bits & 0x00000020u) { + _this->_internal_mutable_profile()->::SessionProtos::LokiProfile::MergeFrom( + from._internal_profile()); + } + if (cached_has_bits & 0x00000040u) { + _this->_internal_mutable_opengroupinvitation()->::SessionProtos::DataMessage_OpenGroupInvitation::MergeFrom( + from._internal_opengroupinvitation()); + } + if (cached_has_bits & 0x00000080u) { + _this->_internal_mutable_groupupdatemessage()->::SessionProtos::GroupUpdateMessage::MergeFrom( + from._internal_groupupdatemessage()); + } + } + if (cached_has_bits & 0x00000700u) { + if (cached_has_bits & 0x00000100u) { + _this->_impl_.timestamp_ = from._impl_.timestamp_; + } + if (cached_has_bits & 0x00000200u) { + _this->_impl_.flags_ = from._impl_.flags_; + } + if (cached_has_bits & 0x00000400u) { + _this->_impl_.blockscommunitymessagerequests_ = from._impl_.blockscommunitymessagerequests_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void DataMessage::CopyFrom(const DataMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DataMessage::IsInitialized() const { + if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.attachments_)) + return false; + if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.preview_)) + return false; + if (_internal_has_quote()) { + if (!_impl_.quote_->IsInitialized()) return false; + } + if (_internal_has_reaction()) { + if (!_impl_.reaction_->IsInitialized()) return false; + } + if (_internal_has_opengroupinvitation()) { + if (!_impl_.opengroupinvitation_->IsInitialized()) return false; + } + if (_internal_has_groupupdatemessage()) { + if (!_impl_.groupupdatemessage_->IsInitialized()) return false; } return true; } -void DataMessage_Preview::InternalSwap(DataMessage_Preview* other) { +void DataMessage::InternalSwap(DataMessage* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.attachments_.InternalSwap(&other->_impl_.attachments_); + _impl_.preview_.InternalSwap(&other->_impl_.preview_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.url_, lhs_arena, - &other->_impl_.url_, rhs_arena + &_impl_.body_, lhs_arena, + &other->_impl_.body_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.title_, lhs_arena, - &other->_impl_.title_, rhs_arena + &_impl_.profilekey_, lhs_arena, + &other->_impl_.profilekey_, rhs_arena ); - swap(_impl_.image_, other->_impl_.image_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.synctarget_, lhs_arena, + &other->_impl_.synctarget_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(DataMessage, _impl_.blockscommunitymessagerequests_) + + sizeof(DataMessage::_impl_.blockscommunitymessagerequests_) + - PROTOBUF_FIELD_OFFSET(DataMessage, _impl_.quote_)>( + reinterpret_cast(&_impl_.quote_), + reinterpret_cast(&other->_impl_.quote_)); } -std::string DataMessage_Preview::GetTypeName() const { - return "SessionProtos.DataMessage.Preview"; +::PROTOBUF_NAMESPACE_ID::Metadata DataMessage::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[14]); } - // =================================================================== -class DataMessage_Reaction::_Internal { +class ReceiptMessage::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_id(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } - static void set_has_author(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_type(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_emoji(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } - static void set_has_action(HasBits* has_bits) { - (*has_bits)[0] |= 8u; - } static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x0000000d) ^ 0x0000000d) != 0; + return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0; } }; -DataMessage_Reaction::DataMessage_Reaction(::PROTOBUF_NAMESPACE_ID::Arena* arena, +ReceiptMessage::ReceiptMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Reaction) + // @@protoc_insertion_point(arena_constructor:SessionProtos.ReceiptMessage) } -DataMessage_Reaction::DataMessage_Reaction(const DataMessage_Reaction& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataMessage_Reaction* const _this = this; (void)_this; +ReceiptMessage::ReceiptMessage(const ReceiptMessage& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + ReceiptMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.author_){} - , decltype(_impl_.emoji_){} - , decltype(_impl_.id_){} - , decltype(_impl_.action_){}}; + , decltype(_impl_.timestamp_){from._impl_.timestamp_} + , decltype(_impl_.type_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.author_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.author_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_author()) { - _this->_impl_.author_.Set(from._internal_author(), - _this->GetArenaForAllocation()); - } - _impl_.emoji_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.emoji_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_emoji()) { - _this->_impl_.emoji_.Set(from._internal_emoji(), - _this->GetArenaForAllocation()); - } - ::memcpy(&_impl_.id_, &from._impl_.id_, - static_cast(reinterpret_cast(&_impl_.action_) - - reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.action_)); - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.Reaction) + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_impl_.type_ = from._impl_.type_; + // @@protoc_insertion_point(copy_constructor:SessionProtos.ReceiptMessage) } -inline void DataMessage_Reaction::SharedCtor( +inline void ReceiptMessage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.author_){} - , decltype(_impl_.emoji_){} - , decltype(_impl_.id_){uint64_t{0u}} - , decltype(_impl_.action_){0} + , decltype(_impl_.timestamp_){arena} + , decltype(_impl_.type_){0} }; - _impl_.author_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.author_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.emoji_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.emoji_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -DataMessage_Reaction::~DataMessage_Reaction() { - // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Reaction) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +ReceiptMessage::~ReceiptMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.ReceiptMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void DataMessage_Reaction::SharedDtor() { +inline void ReceiptMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.author_.Destroy(); - _impl_.emoji_.Destroy(); + _impl_.timestamp_.~RepeatedField(); } -void DataMessage_Reaction::SetCachedSize(int size) const { +void ReceiptMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataMessage_Reaction::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.Reaction) +void ReceiptMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.ReceiptMessage) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - if (cached_has_bits & 0x00000001u) { - _impl_.author_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000002u) { - _impl_.emoji_.ClearNonDefaultToEmpty(); - } - } - if (cached_has_bits & 0x0000000cu) { - ::memset(&_impl_.id_, 0, static_cast( - reinterpret_cast(&_impl_.action_) - - reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.action_)); - } + _impl_.timestamp_.Clear(); + _impl_.type_ = 0; _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* DataMessage_Reaction::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* ReceiptMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required uint64 id = 1; + // required .SessionProtos.ReceiptMessage.Type type = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _Internal::set_has_id(&has_bits); - _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // required string author = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_author(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional string emoji = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_emoji(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); + if (PROTOBUF_PREDICT_TRUE(::SessionProtos::ReceiptMessage_Type_IsValid(val))) { + _internal_set_type(static_cast<::SessionProtos::ReceiptMessage_Type>(val)); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields()); + } } else goto handle_unusual; continue; - // required .SessionProtos.DataMessage.Reaction.Action action = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + // repeated uint64 timestamp = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + ptr -= 1; + do { + ptr += 1; + _internal_add_timestamp(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr)); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<16>(ptr)); + } else if (static_cast(tag) == 18) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_timestamp(), ptr, ctx); CHK_(ptr); - if (PROTOBUF_PREDICT_TRUE(::SessionProtos::DataMessage_Reaction_Action_IsValid(val))) { - _internal_set_action(static_cast<::SessionProtos::DataMessage_Reaction_Action>(val)); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields()); - } } else goto handle_unusual; continue; @@ -6482,7 +7123,7 @@ const char* DataMessage_Reaction::_InternalParse(const char* ptr, ::_pbi::ParseC } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -6495,312 +7136,479 @@ const char* DataMessage_Reaction::_InternalParse(const char* ptr, ::_pbi::ParseC #undef CHK_ } -uint8_t* DataMessage_Reaction::_InternalSerialize( +uint8_t* ReceiptMessage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.Reaction) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ReceiptMessage) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required uint64 id = 1; - if (cached_has_bits & 0x00000004u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_id(), target); - } - - // required string author = 2; + // required .SessionProtos.ReceiptMessage.Type type = 1; if (cached_has_bits & 0x00000001u) { - target = stream->WriteStringMaybeAliased( - 2, this->_internal_author(), target); - } - - // optional string emoji = 3; - if (cached_has_bits & 0x00000002u) { - target = stream->WriteStringMaybeAliased( - 3, this->_internal_emoji(), target); + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this->_internal_type(), target); } - // required .SessionProtos.DataMessage.Reaction.Action action = 4; - if (cached_has_bits & 0x00000008u) { + // repeated uint64 timestamp = 2; + for (int i = 0, n = this->_internal_timestamp_size(); i < n; i++) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 4, this->_internal_action(), target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_timestamp(i), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Reaction) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ReceiptMessage) return target; } -size_t DataMessage_Reaction::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.DataMessage.Reaction) - size_t total_size = 0; - - if (_internal_has_author()) { - // required string author = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_author()); - } - - if (_internal_has_id()) { - // required uint64 id = 1; - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id()); - } - - if (_internal_has_action()) { - // required .SessionProtos.DataMessage.Reaction.Action action = 4; - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_action()); - } - - return total_size; -} -size_t DataMessage_Reaction::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.Reaction) +size_t ReceiptMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ReceiptMessage) size_t total_size = 0; - if (((_impl_._has_bits_[0] & 0x0000000d) ^ 0x0000000d) == 0) { // All required fields are present. - // required string author = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_author()); - - // required uint64 id = 1; - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id()); - - // required .SessionProtos.DataMessage.Reaction.Action action = 4; + // required .SessionProtos.ReceiptMessage.Type type = 1; + if (_internal_has_type()) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_action()); - - } else { - total_size += RequiredFieldsByteSizeFallback(); + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); } uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // optional string emoji = 3; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000002u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_emoji()); + // repeated uint64 timestamp = 2; + { + size_t data_size = ::_pbi::WireFormatLite:: + UInt64Size(this->_impl_.timestamp_); + total_size += 1 * + ::_pbi::FromIntSize(this->_internal_timestamp_size()); + total_size += data_size; } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); - } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void DataMessage_Reaction::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ReceiptMessage::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + ReceiptMessage::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ReceiptMessage::GetClassData() const { return &_class_data_; } -void DataMessage_Reaction::MergeFrom(const DataMessage_Reaction& from) { - DataMessage_Reaction* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Reaction) + +void ReceiptMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ReceiptMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; - cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { - if (cached_has_bits & 0x00000001u) { - _this->_internal_set_author(from._internal_author()); - } - if (cached_has_bits & 0x00000002u) { - _this->_internal_set_emoji(from._internal_emoji()); - } - if (cached_has_bits & 0x00000004u) { - _this->_impl_.id_ = from._impl_.id_; - } - if (cached_has_bits & 0x00000008u) { - _this->_impl_.action_ = from._impl_.action_; - } - _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_impl_.timestamp_.MergeFrom(from._impl_.timestamp_); + if (from._internal_has_type()) { + _this->_internal_set_type(from._internal_type()); } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void DataMessage_Reaction::CopyFrom(const DataMessage_Reaction& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.Reaction) +void ReceiptMessage::CopyFrom(const ReceiptMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ReceiptMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool DataMessage_Reaction::IsInitialized() const { +bool ReceiptMessage::IsInitialized() const { if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; return true; } -void DataMessage_Reaction::InternalSwap(DataMessage_Reaction* other) { +void ReceiptMessage::InternalSwap(ReceiptMessage* other) { using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.author_, lhs_arena, - &other->_impl_.author_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.emoji_, lhs_arena, - &other->_impl_.emoji_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(DataMessage_Reaction, _impl_.action_) - + sizeof(DataMessage_Reaction::_impl_.action_) - - PROTOBUF_FIELD_OFFSET(DataMessage_Reaction, _impl_.id_)>( - reinterpret_cast(&_impl_.id_), - reinterpret_cast(&other->_impl_.id_)); + _impl_.timestamp_.InternalSwap(&other->_impl_.timestamp_); + swap(_impl_.type_, other->_impl_.type_); } -std::string DataMessage_Reaction::GetTypeName() const { - return "SessionProtos.DataMessage.Reaction"; +::PROTOBUF_NAMESPACE_ID::Metadata ReceiptMessage::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[15]); } - // =================================================================== -class DataMessage_OpenGroupInvitation::_Internal { +class AttachmentPointer::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_url(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_id(HasBits* has_bits) { + (*has_bits)[0] |= 128u; + } + static void set_has_contenttype(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_name(HasBits* has_bits) { + static void set_has_key(HasBits* has_bits) { (*has_bits)[0] |= 2u; } + static void set_has_size(HasBits* has_bits) { + (*has_bits)[0] |= 256u; + } + static void set_has_thumbnail(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static void set_has_digest(HasBits* has_bits) { + (*has_bits)[0] |= 8u; + } + static void set_has_filename(HasBits* has_bits) { + (*has_bits)[0] |= 16u; + } + static void set_has_flags(HasBits* has_bits) { + (*has_bits)[0] |= 512u; + } + static void set_has_width(HasBits* has_bits) { + (*has_bits)[0] |= 1024u; + } + static void set_has_height(HasBits* has_bits) { + (*has_bits)[0] |= 2048u; + } + static void set_has_caption(HasBits* has_bits) { + (*has_bits)[0] |= 32u; + } + static void set_has_url(HasBits* has_bits) { + (*has_bits)[0] |= 64u; + } static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; + return ((has_bits[0] & 0x00000080) ^ 0x00000080) != 0; } }; -DataMessage_OpenGroupInvitation::DataMessage_OpenGroupInvitation(::PROTOBUF_NAMESPACE_ID::Arena* arena, +AttachmentPointer::AttachmentPointer(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.OpenGroupInvitation) + // @@protoc_insertion_point(arena_constructor:SessionProtos.AttachmentPointer) } -DataMessage_OpenGroupInvitation::DataMessage_OpenGroupInvitation(const DataMessage_OpenGroupInvitation& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataMessage_OpenGroupInvitation* const _this = this; (void)_this; +AttachmentPointer::AttachmentPointer(const AttachmentPointer& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + AttachmentPointer* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.contenttype_){} + , decltype(_impl_.key_){} + , decltype(_impl_.thumbnail_){} + , decltype(_impl_.digest_){} + , decltype(_impl_.filename_){} + , decltype(_impl_.caption_){} , decltype(_impl_.url_){} - , decltype(_impl_.name_){}}; + , decltype(_impl_.id_){} + , decltype(_impl_.size_){} + , decltype(_impl_.flags_){} + , decltype(_impl_.width_){} + , decltype(_impl_.height_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.url_.InitDefault(); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.contenttype_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.url_.Set("", GetArenaForAllocation()); + _impl_.contenttype_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_url()) { - _this->_impl_.url_.Set(from._internal_url(), + if (from._internal_has_contenttype()) { + _this->_impl_.contenttype_.Set(from._internal_contenttype(), _this->GetArenaForAllocation()); } - _impl_.name_.InitDefault(); + _impl_.key_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); + _impl_.key_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_name()) { - _this->_impl_.name_.Set(from._internal_name(), + if (from._internal_has_key()) { + _this->_impl_.key_.Set(from._internal_key(), _this->GetArenaForAllocation()); } - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.OpenGroupInvitation) + _impl_.thumbnail_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.thumbnail_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_thumbnail()) { + _this->_impl_.thumbnail_.Set(from._internal_thumbnail(), + _this->GetArenaForAllocation()); + } + _impl_.digest_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.digest_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_digest()) { + _this->_impl_.digest_.Set(from._internal_digest(), + _this->GetArenaForAllocation()); + } + _impl_.filename_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.filename_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_filename()) { + _this->_impl_.filename_.Set(from._internal_filename(), + _this->GetArenaForAllocation()); + } + _impl_.caption_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.caption_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_caption()) { + _this->_impl_.caption_.Set(from._internal_caption(), + _this->GetArenaForAllocation()); + } + _impl_.url_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.url_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_url()) { + _this->_impl_.url_.Set(from._internal_url(), + _this->GetArenaForAllocation()); + } + ::memcpy(&_impl_.id_, &from._impl_.id_, + static_cast(reinterpret_cast(&_impl_.height_) - + reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.height_)); + // @@protoc_insertion_point(copy_constructor:SessionProtos.AttachmentPointer) } -inline void DataMessage_OpenGroupInvitation::SharedCtor( +inline void AttachmentPointer::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.contenttype_){} + , decltype(_impl_.key_){} + , decltype(_impl_.thumbnail_){} + , decltype(_impl_.digest_){} + , decltype(_impl_.filename_){} + , decltype(_impl_.caption_){} , decltype(_impl_.url_){} - , decltype(_impl_.name_){} + , decltype(_impl_.id_){uint64_t{0u}} + , decltype(_impl_.size_){0u} + , decltype(_impl_.flags_){0u} + , decltype(_impl_.width_){0u} + , decltype(_impl_.height_){0u} }; - _impl_.url_.InitDefault(); + _impl_.contenttype_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.url_.Set("", GetArenaForAllocation()); + _impl_.contenttype_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.InitDefault(); + _impl_.key_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); + _impl_.key_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.thumbnail_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.thumbnail_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.digest_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.digest_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.filename_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.filename_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.caption_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.caption_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.url_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.url_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -DataMessage_OpenGroupInvitation::~DataMessage_OpenGroupInvitation() { - // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.OpenGroupInvitation) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +AttachmentPointer::~AttachmentPointer() { + // @@protoc_insertion_point(destructor:SessionProtos.AttachmentPointer) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void DataMessage_OpenGroupInvitation::SharedDtor() { +inline void AttachmentPointer::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.contenttype_.Destroy(); + _impl_.key_.Destroy(); + _impl_.thumbnail_.Destroy(); + _impl_.digest_.Destroy(); + _impl_.filename_.Destroy(); + _impl_.caption_.Destroy(); _impl_.url_.Destroy(); - _impl_.name_.Destroy(); } -void DataMessage_OpenGroupInvitation::SetCachedSize(int size) const { +void AttachmentPointer::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataMessage_OpenGroupInvitation::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.OpenGroupInvitation) +void AttachmentPointer::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.AttachmentPointer) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x0000007fu) { if (cached_has_bits & 0x00000001u) { - _impl_.url_.ClearNonDefaultToEmpty(); + _impl_.contenttype_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.name_.ClearNonDefaultToEmpty(); + _impl_.key_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000004u) { + _impl_.thumbnail_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000008u) { + _impl_.digest_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000010u) { + _impl_.filename_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000020u) { + _impl_.caption_.ClearNonDefaultToEmpty(); } + if (cached_has_bits & 0x00000040u) { + _impl_.url_.ClearNonDefaultToEmpty(); + } + } + _impl_.id_ = uint64_t{0u}; + if (cached_has_bits & 0x00000f00u) { + ::memset(&_impl_.size_, 0, static_cast( + reinterpret_cast(&_impl_.height_) - + reinterpret_cast(&_impl_.size_)) + sizeof(_impl_.height_)); } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* DataMessage_OpenGroupInvitation::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* AttachmentPointer::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required string url = 1; + // required fixed64 id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_url(); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 9)) { + _Internal::set_has_id(&has_bits); + _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(uint64_t); + } else + goto handle_unusual; + continue; + // optional string contentType = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_contenttype(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.AttachmentPointer.contentType"); + #endif // !NDEBUG } else goto handle_unusual; continue; - // required string name = 3; + // optional bytes key = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_name(); + auto str = _internal_mutable_key(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional uint32 size = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + _Internal::set_has_size(&has_bits); + _impl_.size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional bytes thumbnail = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + auto str = _internal_mutable_thumbnail(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional bytes digest = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { + auto str = _internal_mutable_digest(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional string fileName = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { + auto str = _internal_mutable_filename(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.AttachmentPointer.fileName"); + #endif // !NDEBUG + } else + goto handle_unusual; + continue; + // optional uint32 flags = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 64)) { + _Internal::set_has_flags(&has_bits); + _impl_.flags_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional uint32 width = 9; + case 9: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 72)) { + _Internal::set_has_width(&has_bits); + _impl_.width_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional uint32 height = 10; + case 10: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 80)) { + _Internal::set_has_height(&has_bits); + _impl_.height_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional string caption = 11; + case 11: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 90)) { + auto str = _internal_mutable_caption(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.AttachmentPointer.caption"); + #endif // !NDEBUG + } else + goto handle_unusual; + continue; + // optional string url = 101; + case 101: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + auto str = _internal_mutable_url(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.AttachmentPointer.url"); + #endif // !NDEBUG } else goto handle_unusual; continue; @@ -6815,7 +7623,7 @@ const char* DataMessage_OpenGroupInvitation::_InternalParse(const char* ptr, ::_ } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -6828,270 +7636,455 @@ const char* DataMessage_OpenGroupInvitation::_InternalParse(const char* ptr, ::_ #undef CHK_ } -uint8_t* DataMessage_OpenGroupInvitation::_InternalSerialize( +uint8_t* AttachmentPointer::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.OpenGroupInvitation) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.AttachmentPointer) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required string url = 1; + // required fixed64 id = 1; + if (cached_has_bits & 0x00000080u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteFixed64ToArray(1, this->_internal_id(), target); + } + + // optional string contentType = 2; if (cached_has_bits & 0x00000001u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_contenttype().data(), static_cast(this->_internal_contenttype().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.AttachmentPointer.contentType"); target = stream->WriteStringMaybeAliased( - 1, this->_internal_url(), target); + 2, this->_internal_contenttype(), target); } - // required string name = 3; + // optional bytes key = 3; if (cached_has_bits & 0x00000002u) { - target = stream->WriteStringMaybeAliased( - 3, this->_internal_name(), target); + target = stream->WriteBytesMaybeAliased( + 3, this->_internal_key(), target); } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + // optional uint32 size = 4; + if (cached_has_bits & 0x00000100u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_size(), target); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.OpenGroupInvitation) - return target; -} -size_t DataMessage_OpenGroupInvitation::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.DataMessage.OpenGroupInvitation) - size_t total_size = 0; + // optional bytes thumbnail = 5; + if (cached_has_bits & 0x00000004u) { + target = stream->WriteBytesMaybeAliased( + 5, this->_internal_thumbnail(), target); + } - if (_internal_has_url()) { - // required string url = 1; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_url()); + // optional bytes digest = 6; + if (cached_has_bits & 0x00000008u) { + target = stream->WriteBytesMaybeAliased( + 6, this->_internal_digest(), target); } - if (_internal_has_name()) { - // required string name = 3; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); + // optional string fileName = 7; + if (cached_has_bits & 0x00000010u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_filename().data(), static_cast(this->_internal_filename().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.AttachmentPointer.fileName"); + target = stream->WriteStringMaybeAliased( + 7, this->_internal_filename(), target); } - return total_size; -} -size_t DataMessage_OpenGroupInvitation::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.OpenGroupInvitation) - size_t total_size = 0; + // optional uint32 flags = 8; + if (cached_has_bits & 0x00000200u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(8, this->_internal_flags(), target); + } - if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. - // required string url = 1; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_url()); + // optional uint32 width = 9; + if (cached_has_bits & 0x00000400u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(9, this->_internal_width(), target); + } - // required string name = 3; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); + // optional uint32 height = 10; + if (cached_has_bits & 0x00000800u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(10, this->_internal_height(), target); + } - } else { - total_size += RequiredFieldsByteSizeFallback(); + // optional string caption = 11; + if (cached_has_bits & 0x00000020u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_caption().data(), static_cast(this->_internal_caption().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.AttachmentPointer.caption"); + target = stream->WriteStringMaybeAliased( + 11, this->_internal_caption(), target); + } + + // optional string url = 101; + if (cached_has_bits & 0x00000040u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_url().data(), static_cast(this->_internal_url().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.AttachmentPointer.url"); + target = stream->WriteStringMaybeAliased( + 101, this->_internal_url(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.AttachmentPointer) + return target; +} + +size_t AttachmentPointer::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.AttachmentPointer) + size_t total_size = 0; + + // required fixed64 id = 1; + if (_internal_has_id()) { + total_size += 1 + 8; } uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x0000007fu) { + // optional string contentType = 2; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_contenttype()); + } + + // optional bytes key = 3; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_key()); + } + + // optional bytes thumbnail = 5; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_thumbnail()); + } + + // optional bytes digest = 6; + if (cached_has_bits & 0x00000008u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_digest()); + } + + // optional string fileName = 7; + if (cached_has_bits & 0x00000010u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_filename()); + } + + // optional string caption = 11; + if (cached_has_bits & 0x00000020u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_caption()); + } + + // optional string url = 101; + if (cached_has_bits & 0x00000040u) { + total_size += 2 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_url()); + } + } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} + if (cached_has_bits & 0x00000f00u) { + // optional uint32 size = 4; + if (cached_has_bits & 0x00000100u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_size()); + } + + // optional uint32 flags = 8; + if (cached_has_bits & 0x00000200u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); + } + + // optional uint32 width = 9; + if (cached_has_bits & 0x00000400u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_width()); + } + + // optional uint32 height = 10; + if (cached_has_bits & 0x00000800u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_height()); + } -void DataMessage_OpenGroupInvitation::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void DataMessage_OpenGroupInvitation::MergeFrom(const DataMessage_OpenGroupInvitation& from) { - DataMessage_OpenGroupInvitation* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.OpenGroupInvitation) +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData AttachmentPointer::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + AttachmentPointer::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*AttachmentPointer::GetClassData() const { return &_class_data_; } + + +void AttachmentPointer::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.AttachmentPointer) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x000000ffu) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_url(from._internal_url()); + _this->_internal_set_contenttype(from._internal_contenttype()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_name(from._internal_name()); + _this->_internal_set_key(from._internal_key()); + } + if (cached_has_bits & 0x00000004u) { + _this->_internal_set_thumbnail(from._internal_thumbnail()); + } + if (cached_has_bits & 0x00000008u) { + _this->_internal_set_digest(from._internal_digest()); + } + if (cached_has_bits & 0x00000010u) { + _this->_internal_set_filename(from._internal_filename()); + } + if (cached_has_bits & 0x00000020u) { + _this->_internal_set_caption(from._internal_caption()); + } + if (cached_has_bits & 0x00000040u) { + _this->_internal_set_url(from._internal_url()); + } + if (cached_has_bits & 0x00000080u) { + _this->_impl_.id_ = from._impl_.id_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + } + if (cached_has_bits & 0x00000f00u) { + if (cached_has_bits & 0x00000100u) { + _this->_impl_.size_ = from._impl_.size_; + } + if (cached_has_bits & 0x00000200u) { + _this->_impl_.flags_ = from._impl_.flags_; + } + if (cached_has_bits & 0x00000400u) { + _this->_impl_.width_ = from._impl_.width_; + } + if (cached_has_bits & 0x00000800u) { + _this->_impl_.height_ = from._impl_.height_; } + _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void DataMessage_OpenGroupInvitation::CopyFrom(const DataMessage_OpenGroupInvitation& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.OpenGroupInvitation) +void AttachmentPointer::CopyFrom(const AttachmentPointer& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.AttachmentPointer) if (&from == this) return; Clear(); MergeFrom(from); } -bool DataMessage_OpenGroupInvitation::IsInitialized() const { +bool AttachmentPointer::IsInitialized() const { if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; return true; } -void DataMessage_OpenGroupInvitation::InternalSwap(DataMessage_OpenGroupInvitation* other) { +void AttachmentPointer::InternalSwap(AttachmentPointer* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.url_, lhs_arena, - &other->_impl_.url_, rhs_arena + &_impl_.contenttype_, lhs_arena, + &other->_impl_.contenttype_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.name_, lhs_arena, - &other->_impl_.name_, rhs_arena + &_impl_.key_, lhs_arena, + &other->_impl_.key_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.thumbnail_, lhs_arena, + &other->_impl_.thumbnail_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.digest_, lhs_arena, + &other->_impl_.digest_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.filename_, lhs_arena, + &other->_impl_.filename_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.caption_, lhs_arena, + &other->_impl_.caption_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.url_, lhs_arena, + &other->_impl_.url_, rhs_arena ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(AttachmentPointer, _impl_.height_) + + sizeof(AttachmentPointer::_impl_.height_) + - PROTOBUF_FIELD_OFFSET(AttachmentPointer, _impl_.id_)>( + reinterpret_cast(&_impl_.id_), + reinterpret_cast(&other->_impl_.id_)); } -std::string DataMessage_OpenGroupInvitation::GetTypeName() const { - return "SessionProtos.DataMessage.OpenGroupInvitation"; +::PROTOBUF_NAMESPACE_ID::Metadata AttachmentPointer::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[16]); } - // =================================================================== -class DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_Internal { +class SharedConfigMessage::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_publickey(HasBits* has_bits) { - (*has_bits)[0] |= 1u; + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_kind(HasBits* has_bits) { + (*has_bits)[0] |= 4u; } - static void set_has_encryptedkeypair(HasBits* has_bits) { + static void set_has_seqno(HasBits* has_bits) { (*has_bits)[0] |= 2u; } + static void set_has_data(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; + return ((has_bits[0] & 0x00000007) ^ 0x00000007) != 0; } }; -DataMessage_ClosedGroupControlMessage_KeyPairWrapper::DataMessage_ClosedGroupControlMessage_KeyPairWrapper(::PROTOBUF_NAMESPACE_ID::Arena* arena, +SharedConfigMessage::SharedConfigMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) + // @@protoc_insertion_point(arena_constructor:SessionProtos.SharedConfigMessage) } -DataMessage_ClosedGroupControlMessage_KeyPairWrapper::DataMessage_ClosedGroupControlMessage_KeyPairWrapper(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataMessage_ClosedGroupControlMessage_KeyPairWrapper* const _this = this; (void)_this; +SharedConfigMessage::SharedConfigMessage(const SharedConfigMessage& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + SharedConfigMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.publickey_){} - , decltype(_impl_.encryptedkeypair_){}}; + , decltype(_impl_.data_){} + , decltype(_impl_.seqno_){} + , decltype(_impl_.kind_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.publickey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_publickey()) { - _this->_impl_.publickey_.Set(from._internal_publickey(), - _this->GetArenaForAllocation()); - } - _impl_.encryptedkeypair_.InitDefault(); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.data_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.encryptedkeypair_.Set("", GetArenaForAllocation()); + _impl_.data_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_encryptedkeypair()) { - _this->_impl_.encryptedkeypair_.Set(from._internal_encryptedkeypair(), + if (from._internal_has_data()) { + _this->_impl_.data_.Set(from._internal_data(), _this->GetArenaForAllocation()); } - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) + ::memcpy(&_impl_.seqno_, &from._impl_.seqno_, + static_cast(reinterpret_cast(&_impl_.kind_) - + reinterpret_cast(&_impl_.seqno_)) + sizeof(_impl_.kind_)); + // @@protoc_insertion_point(copy_constructor:SessionProtos.SharedConfigMessage) } -inline void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::SharedCtor( +inline void SharedConfigMessage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.publickey_){} - , decltype(_impl_.encryptedkeypair_){} + , decltype(_impl_.data_){} + , decltype(_impl_.seqno_){int64_t{0}} + , decltype(_impl_.kind_){1} }; - _impl_.publickey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.encryptedkeypair_.InitDefault(); + _impl_.data_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.encryptedkeypair_.Set("", GetArenaForAllocation()); + _impl_.data_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -DataMessage_ClosedGroupControlMessage_KeyPairWrapper::~DataMessage_ClosedGroupControlMessage_KeyPairWrapper() { - // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +SharedConfigMessage::~SharedConfigMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.SharedConfigMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::SharedDtor() { +inline void SharedConfigMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.publickey_.Destroy(); - _impl_.encryptedkeypair_.Destroy(); + _impl_.data_.Destroy(); } -void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::SetCachedSize(int size) const { +void SharedConfigMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) +void SharedConfigMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.SharedConfigMessage) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - if (cached_has_bits & 0x00000001u) { - _impl_.publickey_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000002u) { - _impl_.encryptedkeypair_.ClearNonDefaultToEmpty(); - } + if (cached_has_bits & 0x00000001u) { + _impl_.data_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000006u) { + _impl_.seqno_ = int64_t{0}; + _impl_.kind_ = 1; } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* SharedConfigMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required bytes publicKey = 1; + // required .SessionProtos.SharedConfigMessage.Kind kind = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_publickey(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); + if (PROTOBUF_PREDICT_TRUE(::SessionProtos::SharedConfigMessage_Kind_IsValid(val))) { + _internal_set_kind(static_cast<::SessionProtos::SharedConfigMessage_Kind>(val)); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields()); + } } else goto handle_unusual; continue; - // required bytes encryptedKeyPair = 2; + // required int64 seqno = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_encryptedkeypair(); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _Internal::set_has_seqno(&has_bits); + _impl_.seqno_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // required bytes data = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + auto str = _internal_mutable_data(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else @@ -7108,7 +8101,7 @@ const char* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_InternalParse } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -7121,67 +8114,80 @@ const char* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_InternalParse #undef CHK_ } -uint8_t* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_InternalSerialize( +uint8_t* SharedConfigMessage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.SharedConfigMessage) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required bytes publicKey = 1; - if (cached_has_bits & 0x00000001u) { - target = stream->WriteBytesMaybeAliased( - 1, this->_internal_publickey(), target); + // required .SessionProtos.SharedConfigMessage.Kind kind = 1; + if (cached_has_bits & 0x00000004u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this->_internal_kind(), target); } - // required bytes encryptedKeyPair = 2; + // required int64 seqno = 2; if (cached_has_bits & 0x00000002u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_seqno(), target); + } + + // required bytes data = 3; + if (cached_has_bits & 0x00000001u) { target = stream->WriteBytesMaybeAliased( - 2, this->_internal_encryptedkeypair(), target); + 3, this->_internal_data(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.SharedConfigMessage) return target; } -size_t DataMessage_ClosedGroupControlMessage_KeyPairWrapper::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) +size_t SharedConfigMessage::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.SharedConfigMessage) size_t total_size = 0; - if (_internal_has_publickey()) { - // required bytes publicKey = 1; + if (_internal_has_data()) { + // required bytes data = 3; total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_publickey()); + this->_internal_data()); + } + + if (_internal_has_seqno()) { + // required int64 seqno = 2; + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_seqno()); } - if (_internal_has_encryptedkeypair()) { - // required bytes encryptedKeyPair = 2; + if (_internal_has_kind()) { + // required .SessionProtos.SharedConfigMessage.Kind kind = 1; total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_encryptedkeypair()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); } return total_size; } -size_t DataMessage_ClosedGroupControlMessage_KeyPairWrapper::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) +size_t SharedConfigMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.SharedConfigMessage) size_t total_size = 0; - if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. - // required bytes publicKey = 1; + if (((_impl_._has_bits_[0] & 0x00000007) ^ 0x00000007) == 0) { // All required fields are present. + // required bytes data = 3; total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_publickey()); + this->_internal_data()); + + // required int64 seqno = 2; + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_seqno()); - // required bytes encryptedKeyPair = 2; + // required .SessionProtos.SharedConfigMessage.Kind kind = 1; total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_encryptedkeypair()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); } else { total_size += RequiredFieldsByteSizeFallback(); @@ -7190,320 +8196,347 @@ size_t DataMessage_ClosedGroupControlMessage_KeyPairWrapper::ByteSizeLong() cons // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); - } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SharedConfigMessage::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + SharedConfigMessage::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SharedConfigMessage::GetClassData() const { return &_class_data_; } + -void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::MergeFrom(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from) { - DataMessage_ClosedGroupControlMessage_KeyPairWrapper* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) +void SharedConfigMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.SharedConfigMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_publickey(from._internal_publickey()); + _this->_internal_set_data(from._internal_data()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_encryptedkeypair(from._internal_encryptedkeypair()); + _this->_impl_.seqno_ = from._impl_.seqno_; } + if (cached_has_bits & 0x00000004u) { + _this->_impl_.kind_ = from._impl_.kind_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::CopyFrom(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) +void SharedConfigMessage::CopyFrom(const SharedConfigMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.SharedConfigMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool DataMessage_ClosedGroupControlMessage_KeyPairWrapper::IsInitialized() const { +bool SharedConfigMessage::IsInitialized() const { if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; return true; } -void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::InternalSwap(DataMessage_ClosedGroupControlMessage_KeyPairWrapper* other) { +void SharedConfigMessage::InternalSwap(SharedConfigMessage* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.publickey_, lhs_arena, - &other->_impl_.publickey_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.encryptedkeypair_, lhs_arena, - &other->_impl_.encryptedkeypair_, rhs_arena + &_impl_.data_, lhs_arena, + &other->_impl_.data_, rhs_arena ); + swap(_impl_.seqno_, other->_impl_.seqno_); + swap(_impl_.kind_, other->_impl_.kind_); } -std::string DataMessage_ClosedGroupControlMessage_KeyPairWrapper::GetTypeName() const { - return "SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper"; +::PROTOBUF_NAMESPACE_ID::Metadata SharedConfigMessage::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[17]); } - // =================================================================== -class DataMessage_ClosedGroupControlMessage::_Internal { +class GroupUpdateMessage::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_type(HasBits* has_bits) { - (*has_bits)[0] |= 16u; - } - static void set_has_publickey(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static const ::SessionProtos::GroupUpdateInviteMessage& invitemessage(const GroupUpdateMessage* msg); + static void set_has_invitemessage(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_name(HasBits* has_bits) { + static const ::SessionProtos::GroupUpdateInfoChangeMessage& infochangemessage(const GroupUpdateMessage* msg); + static void set_has_infochangemessage(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static const ::SessionProtos::KeyPair& encryptionkeypair(const DataMessage_ClosedGroupControlMessage* msg); - static void set_has_encryptionkeypair(HasBits* has_bits) { + static const ::SessionProtos::GroupUpdateMemberChangeMessage& memberchangemessage(const GroupUpdateMessage* msg); + static void set_has_memberchangemessage(HasBits* has_bits) { (*has_bits)[0] |= 4u; } - static void set_has_expirationtimer(HasBits* has_bits) { + static const ::SessionProtos::GroupUpdatePromoteMessage& promotemessage(const GroupUpdateMessage* msg); + static void set_has_promotemessage(HasBits* has_bits) { (*has_bits)[0] |= 8u; } - static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000010) ^ 0x00000010) != 0; + static const ::SessionProtos::GroupUpdateMemberLeftMessage& memberleftmessage(const GroupUpdateMessage* msg); + static void set_has_memberleftmessage(HasBits* has_bits) { + (*has_bits)[0] |= 16u; + } + static const ::SessionProtos::GroupUpdateInviteResponseMessage& inviteresponse(const GroupUpdateMessage* msg); + static void set_has_inviteresponse(HasBits* has_bits) { + (*has_bits)[0] |= 32u; + } + static const ::SessionProtos::GroupUpdateDeleteMemberContentMessage& deletemembercontent(const GroupUpdateMessage* msg); + static void set_has_deletemembercontent(HasBits* has_bits) { + (*has_bits)[0] |= 64u; + } + static const ::SessionProtos::GroupUpdateMemberLeftNotificationMessage& memberleftnotificationmessage(const GroupUpdateMessage* msg); + static void set_has_memberleftnotificationmessage(HasBits* has_bits) { + (*has_bits)[0] |= 128u; } }; -const ::SessionProtos::KeyPair& -DataMessage_ClosedGroupControlMessage::_Internal::encryptionkeypair(const DataMessage_ClosedGroupControlMessage* msg) { - return *msg->_impl_.encryptionkeypair_; +const ::SessionProtos::GroupUpdateInviteMessage& +GroupUpdateMessage::_Internal::invitemessage(const GroupUpdateMessage* msg) { + return *msg->_impl_.invitemessage_; +} +const ::SessionProtos::GroupUpdateInfoChangeMessage& +GroupUpdateMessage::_Internal::infochangemessage(const GroupUpdateMessage* msg) { + return *msg->_impl_.infochangemessage_; +} +const ::SessionProtos::GroupUpdateMemberChangeMessage& +GroupUpdateMessage::_Internal::memberchangemessage(const GroupUpdateMessage* msg) { + return *msg->_impl_.memberchangemessage_; +} +const ::SessionProtos::GroupUpdatePromoteMessage& +GroupUpdateMessage::_Internal::promotemessage(const GroupUpdateMessage* msg) { + return *msg->_impl_.promotemessage_; +} +const ::SessionProtos::GroupUpdateMemberLeftMessage& +GroupUpdateMessage::_Internal::memberleftmessage(const GroupUpdateMessage* msg) { + return *msg->_impl_.memberleftmessage_; +} +const ::SessionProtos::GroupUpdateInviteResponseMessage& +GroupUpdateMessage::_Internal::inviteresponse(const GroupUpdateMessage* msg) { + return *msg->_impl_.inviteresponse_; } -DataMessage_ClosedGroupControlMessage::DataMessage_ClosedGroupControlMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, +const ::SessionProtos::GroupUpdateDeleteMemberContentMessage& +GroupUpdateMessage::_Internal::deletemembercontent(const GroupUpdateMessage* msg) { + return *msg->_impl_.deletemembercontent_; +} +const ::SessionProtos::GroupUpdateMemberLeftNotificationMessage& +GroupUpdateMessage::_Internal::memberleftnotificationmessage(const GroupUpdateMessage* msg) { + return *msg->_impl_.memberleftnotificationmessage_; +} +GroupUpdateMessage::GroupUpdateMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.ClosedGroupControlMessage) + // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdateMessage) } -DataMessage_ClosedGroupControlMessage::DataMessage_ClosedGroupControlMessage(const DataMessage_ClosedGroupControlMessage& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataMessage_ClosedGroupControlMessage* const _this = this; (void)_this; +GroupUpdateMessage::GroupUpdateMessage(const GroupUpdateMessage& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + GroupUpdateMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.members_){from._impl_.members_} - , decltype(_impl_.admins_){from._impl_.admins_} - , decltype(_impl_.wrappers_){from._impl_.wrappers_} - , decltype(_impl_.publickey_){} - , decltype(_impl_.name_){} - , decltype(_impl_.encryptionkeypair_){nullptr} - , decltype(_impl_.expirationtimer_){} - , decltype(_impl_.type_){}}; + , decltype(_impl_.invitemessage_){nullptr} + , decltype(_impl_.infochangemessage_){nullptr} + , decltype(_impl_.memberchangemessage_){nullptr} + , decltype(_impl_.promotemessage_){nullptr} + , decltype(_impl_.memberleftmessage_){nullptr} + , decltype(_impl_.inviteresponse_){nullptr} + , decltype(_impl_.deletemembercontent_){nullptr} + , decltype(_impl_.memberleftnotificationmessage_){nullptr}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.publickey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_publickey()) { - _this->_impl_.publickey_.Set(from._internal_publickey(), - _this->GetArenaForAllocation()); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_invitemessage()) { + _this->_impl_.invitemessage_ = new ::SessionProtos::GroupUpdateInviteMessage(*from._impl_.invitemessage_); } - _impl_.name_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_name()) { - _this->_impl_.name_.Set(from._internal_name(), - _this->GetArenaForAllocation()); + if (from._internal_has_infochangemessage()) { + _this->_impl_.infochangemessage_ = new ::SessionProtos::GroupUpdateInfoChangeMessage(*from._impl_.infochangemessage_); } - if (from._internal_has_encryptionkeypair()) { - _this->_impl_.encryptionkeypair_ = new ::SessionProtos::KeyPair(*from._impl_.encryptionkeypair_); + if (from._internal_has_memberchangemessage()) { + _this->_impl_.memberchangemessage_ = new ::SessionProtos::GroupUpdateMemberChangeMessage(*from._impl_.memberchangemessage_); } - ::memcpy(&_impl_.expirationtimer_, &from._impl_.expirationtimer_, - static_cast(reinterpret_cast(&_impl_.type_) - - reinterpret_cast(&_impl_.expirationtimer_)) + sizeof(_impl_.type_)); - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.ClosedGroupControlMessage) + if (from._internal_has_promotemessage()) { + _this->_impl_.promotemessage_ = new ::SessionProtos::GroupUpdatePromoteMessage(*from._impl_.promotemessage_); + } + if (from._internal_has_memberleftmessage()) { + _this->_impl_.memberleftmessage_ = new ::SessionProtos::GroupUpdateMemberLeftMessage(*from._impl_.memberleftmessage_); + } + if (from._internal_has_inviteresponse()) { + _this->_impl_.inviteresponse_ = new ::SessionProtos::GroupUpdateInviteResponseMessage(*from._impl_.inviteresponse_); + } + if (from._internal_has_deletemembercontent()) { + _this->_impl_.deletemembercontent_ = new ::SessionProtos::GroupUpdateDeleteMemberContentMessage(*from._impl_.deletemembercontent_); + } + if (from._internal_has_memberleftnotificationmessage()) { + _this->_impl_.memberleftnotificationmessage_ = new ::SessionProtos::GroupUpdateMemberLeftNotificationMessage(*from._impl_.memberleftnotificationmessage_); + } + // @@protoc_insertion_point(copy_constructor:SessionProtos.GroupUpdateMessage) } -inline void DataMessage_ClosedGroupControlMessage::SharedCtor( +inline void GroupUpdateMessage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.members_){arena} - , decltype(_impl_.admins_){arena} - , decltype(_impl_.wrappers_){arena} - , decltype(_impl_.publickey_){} - , decltype(_impl_.name_){} - , decltype(_impl_.encryptionkeypair_){nullptr} - , decltype(_impl_.expirationtimer_){0u} - , decltype(_impl_.type_){1} + , decltype(_impl_.invitemessage_){nullptr} + , decltype(_impl_.infochangemessage_){nullptr} + , decltype(_impl_.memberchangemessage_){nullptr} + , decltype(_impl_.promotemessage_){nullptr} + , decltype(_impl_.memberleftmessage_){nullptr} + , decltype(_impl_.inviteresponse_){nullptr} + , decltype(_impl_.deletemembercontent_){nullptr} + , decltype(_impl_.memberleftnotificationmessage_){nullptr} }; - _impl_.publickey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -DataMessage_ClosedGroupControlMessage::~DataMessage_ClosedGroupControlMessage() { - // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.ClosedGroupControlMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +GroupUpdateMessage::~GroupUpdateMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void DataMessage_ClosedGroupControlMessage::SharedDtor() { +inline void GroupUpdateMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.members_.~RepeatedPtrField(); - _impl_.admins_.~RepeatedPtrField(); - _impl_.wrappers_.~RepeatedPtrField(); - _impl_.publickey_.Destroy(); - _impl_.name_.Destroy(); - if (this != internal_default_instance()) delete _impl_.encryptionkeypair_; + if (this != internal_default_instance()) delete _impl_.invitemessage_; + if (this != internal_default_instance()) delete _impl_.infochangemessage_; + if (this != internal_default_instance()) delete _impl_.memberchangemessage_; + if (this != internal_default_instance()) delete _impl_.promotemessage_; + if (this != internal_default_instance()) delete _impl_.memberleftmessage_; + if (this != internal_default_instance()) delete _impl_.inviteresponse_; + if (this != internal_default_instance()) delete _impl_.deletemembercontent_; + if (this != internal_default_instance()) delete _impl_.memberleftnotificationmessage_; } -void DataMessage_ClosedGroupControlMessage::SetCachedSize(int size) const { +void GroupUpdateMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataMessage_ClosedGroupControlMessage::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.ClosedGroupControlMessage) +void GroupUpdateMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.GroupUpdateMessage) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.members_.Clear(); - _impl_.admins_.Clear(); - _impl_.wrappers_.Clear(); cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x000000ffu) { if (cached_has_bits & 0x00000001u) { - _impl_.publickey_.ClearNonDefaultToEmpty(); + GOOGLE_DCHECK(_impl_.invitemessage_ != nullptr); + _impl_.invitemessage_->Clear(); } if (cached_has_bits & 0x00000002u) { - _impl_.name_.ClearNonDefaultToEmpty(); + GOOGLE_DCHECK(_impl_.infochangemessage_ != nullptr); + _impl_.infochangemessage_->Clear(); } if (cached_has_bits & 0x00000004u) { - GOOGLE_DCHECK(_impl_.encryptionkeypair_ != nullptr); - _impl_.encryptionkeypair_->Clear(); + GOOGLE_DCHECK(_impl_.memberchangemessage_ != nullptr); + _impl_.memberchangemessage_->Clear(); + } + if (cached_has_bits & 0x00000008u) { + GOOGLE_DCHECK(_impl_.promotemessage_ != nullptr); + _impl_.promotemessage_->Clear(); + } + if (cached_has_bits & 0x00000010u) { + GOOGLE_DCHECK(_impl_.memberleftmessage_ != nullptr); + _impl_.memberleftmessage_->Clear(); + } + if (cached_has_bits & 0x00000020u) { + GOOGLE_DCHECK(_impl_.inviteresponse_ != nullptr); + _impl_.inviteresponse_->Clear(); + } + if (cached_has_bits & 0x00000040u) { + GOOGLE_DCHECK(_impl_.deletemembercontent_ != nullptr); + _impl_.deletemembercontent_->Clear(); + } + if (cached_has_bits & 0x00000080u) { + GOOGLE_DCHECK(_impl_.memberleftnotificationmessage_ != nullptr); + _impl_.memberleftnotificationmessage_->Clear(); } - } - if (cached_has_bits & 0x00000018u) { - _impl_.expirationtimer_ = 0u; - _impl_.type_ = 1; } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* DataMessage_ClosedGroupControlMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* GroupUpdateMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required .SessionProtos.DataMessage.ClosedGroupControlMessage.Type type = 1; + // optional .SessionProtos.GroupUpdateInviteMessage inviteMessage = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_invitemessage(), ptr); CHK_(ptr); - if (PROTOBUF_PREDICT_TRUE(::SessionProtos::DataMessage_ClosedGroupControlMessage_Type_IsValid(val))) { - _internal_set_type(static_cast<::SessionProtos::DataMessage_ClosedGroupControlMessage_Type>(val)); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields()); - } } else goto handle_unusual; continue; - // optional bytes publicKey = 2; + // optional .SessionProtos.GroupUpdateInfoChangeMessage infoChangeMessage = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_publickey(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + ptr = ctx->ParseMessage(_internal_mutable_infochangemessage(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // optional string name = 3; + // optional .SessionProtos.GroupUpdateMemberChangeMessage memberChangeMessage = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_name(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + ptr = ctx->ParseMessage(_internal_mutable_memberchangemessage(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // optional .SessionProtos.KeyPair encryptionKeyPair = 4; + // optional .SessionProtos.GroupUpdatePromoteMessage promoteMessage = 4; case 4: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { - ptr = ctx->ParseMessage(_internal_mutable_encryptionkeypair(), ptr); + ptr = ctx->ParseMessage(_internal_mutable_promotemessage(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // repeated bytes members = 5; + // optional .SessionProtos.GroupUpdateMemberLeftMessage memberLeftMessage = 5; case 5: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { - ptr -= 1; - do { - ptr += 1; - auto str = _internal_add_members(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr)); + ptr = ctx->ParseMessage(_internal_mutable_memberleftmessage(), ptr); + CHK_(ptr); } else goto handle_unusual; continue; - // repeated bytes admins = 6; + // optional .SessionProtos.GroupUpdateInviteResponseMessage inviteResponse = 6; case 6: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { - ptr -= 1; - do { - ptr += 1; - auto str = _internal_add_admins(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr)); + ptr = ctx->ParseMessage(_internal_mutable_inviteresponse(), ptr); + CHK_(ptr); } else goto handle_unusual; continue; - // repeated .SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper wrappers = 7; + // optional .SessionProtos.GroupUpdateDeleteMemberContentMessage deleteMemberContent = 7; case 7: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_wrappers(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<58>(ptr)); + ptr = ctx->ParseMessage(_internal_mutable_deletemembercontent(), ptr); + CHK_(ptr); } else goto handle_unusual; continue; - // optional uint32 expirationTimer = 8; + // optional .SessionProtos.GroupUpdateMemberLeftNotificationMessage memberLeftNotificationMessage = 8; case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 64)) { - _Internal::set_has_expirationtimer(&has_bits); - _impl_.expirationtimer_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { + ptr = ctx->ParseMessage(_internal_mutable_memberleftnotificationmessage(), ptr); CHK_(ptr); } else goto handle_unusual; @@ -7519,7 +8552,7 @@ const char* DataMessage_ClosedGroupControlMessage::_InternalParse(const char* pt } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -7532,618 +8565,440 @@ const char* DataMessage_ClosedGroupControlMessage::_InternalParse(const char* pt #undef CHK_ } -uint8_t* DataMessage_ClosedGroupControlMessage::_InternalSerialize( +uint8_t* GroupUpdateMessage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage.ClosedGroupControlMessage) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.GroupUpdateMessage) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required .SessionProtos.DataMessage.ClosedGroupControlMessage.Type type = 1; - if (cached_has_bits & 0x00000010u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 1, this->_internal_type(), target); - } - - // optional bytes publicKey = 2; + // optional .SessionProtos.GroupUpdateInviteMessage inviteMessage = 1; if (cached_has_bits & 0x00000001u) { - target = stream->WriteBytesMaybeAliased( - 2, this->_internal_publickey(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::invitemessage(this), + _Internal::invitemessage(this).GetCachedSize(), target, stream); } - // optional string name = 3; + // optional .SessionProtos.GroupUpdateInfoChangeMessage infoChangeMessage = 2; if (cached_has_bits & 0x00000002u) { - target = stream->WriteStringMaybeAliased( - 3, this->_internal_name(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::infochangemessage(this), + _Internal::infochangemessage(this).GetCachedSize(), target, stream); } - // optional .SessionProtos.KeyPair encryptionKeyPair = 4; + // optional .SessionProtos.GroupUpdateMemberChangeMessage memberChangeMessage = 3; if (cached_has_bits & 0x00000004u) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::encryptionkeypair(this), - _Internal::encryptionkeypair(this).GetCachedSize(), target, stream); + InternalWriteMessage(3, _Internal::memberchangemessage(this), + _Internal::memberchangemessage(this).GetCachedSize(), target, stream); } - // repeated bytes members = 5; - for (int i = 0, n = this->_internal_members_size(); i < n; i++) { - const auto& s = this->_internal_members(i); - target = stream->WriteBytes(5, s, target); + // optional .SessionProtos.GroupUpdatePromoteMessage promoteMessage = 4; + if (cached_has_bits & 0x00000008u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(4, _Internal::promotemessage(this), + _Internal::promotemessage(this).GetCachedSize(), target, stream); } - // repeated bytes admins = 6; - for (int i = 0, n = this->_internal_admins_size(); i < n; i++) { - const auto& s = this->_internal_admins(i); - target = stream->WriteBytes(6, s, target); + // optional .SessionProtos.GroupUpdateMemberLeftMessage memberLeftMessage = 5; + if (cached_has_bits & 0x00000010u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(5, _Internal::memberleftmessage(this), + _Internal::memberleftmessage(this).GetCachedSize(), target, stream); } - // repeated .SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper wrappers = 7; - for (unsigned i = 0, - n = static_cast(this->_internal_wrappers_size()); i < n; i++) { - const auto& repfield = this->_internal_wrappers(i); + // optional .SessionProtos.GroupUpdateInviteResponseMessage inviteResponse = 6; + if (cached_has_bits & 0x00000020u) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(7, repfield, repfield.GetCachedSize(), target, stream); + InternalWriteMessage(6, _Internal::inviteresponse(this), + _Internal::inviteresponse(this).GetCachedSize(), target, stream); } - // optional uint32 expirationTimer = 8; - if (cached_has_bits & 0x00000008u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(8, this->_internal_expirationtimer(), target); + // optional .SessionProtos.GroupUpdateDeleteMemberContentMessage deleteMemberContent = 7; + if (cached_has_bits & 0x00000040u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(7, _Internal::deletemembercontent(this), + _Internal::deletemembercontent(this).GetCachedSize(), target, stream); + } + + // optional .SessionProtos.GroupUpdateMemberLeftNotificationMessage memberLeftNotificationMessage = 8; + if (cached_has_bits & 0x00000080u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(8, _Internal::memberleftnotificationmessage(this), + _Internal::memberleftnotificationmessage(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.ClosedGroupControlMessage) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateMessage) return target; } -size_t DataMessage_ClosedGroupControlMessage::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.ClosedGroupControlMessage) +size_t GroupUpdateMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.GroupUpdateMessage) size_t total_size = 0; - // required .SessionProtos.DataMessage.ClosedGroupControlMessage.Type type = 1; - if (_internal_has_type()) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); - } uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // repeated bytes members = 5; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.members_.size()); - for (int i = 0, n = _impl_.members_.size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - _impl_.members_.Get(i)); - } - - // repeated bytes admins = 6; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.admins_.size()); - for (int i = 0, n = _impl_.admins_.size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - _impl_.admins_.Get(i)); - } - - // repeated .SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper wrappers = 7; - total_size += 1UL * this->_internal_wrappers_size(); - for (const auto& msg : this->_impl_.wrappers_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { - // optional bytes publicKey = 2; + if (cached_has_bits & 0x000000ffu) { + // optional .SessionProtos.GroupUpdateInviteMessage inviteMessage = 1; if (cached_has_bits & 0x00000001u) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_publickey()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.invitemessage_); } - // optional string name = 3; + // optional .SessionProtos.GroupUpdateInfoChangeMessage infoChangeMessage = 2; if (cached_has_bits & 0x00000002u) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.infochangemessage_); } - // optional .SessionProtos.KeyPair encryptionKeyPair = 4; + // optional .SessionProtos.GroupUpdateMemberChangeMessage memberChangeMessage = 3; if (cached_has_bits & 0x00000004u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.encryptionkeypair_); + *_impl_.memberchangemessage_); } - // optional uint32 expirationTimer = 8; + // optional .SessionProtos.GroupUpdatePromoteMessage promoteMessage = 4; if (cached_has_bits & 0x00000008u) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_expirationtimer()); + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.promotemessage_); + } + + // optional .SessionProtos.GroupUpdateMemberLeftMessage memberLeftMessage = 5; + if (cached_has_bits & 0x00000010u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.memberleftmessage_); + } + + // optional .SessionProtos.GroupUpdateInviteResponseMessage inviteResponse = 6; + if (cached_has_bits & 0x00000020u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.inviteresponse_); + } + + // optional .SessionProtos.GroupUpdateDeleteMemberContentMessage deleteMemberContent = 7; + if (cached_has_bits & 0x00000040u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.deletemembercontent_); + } + + // optional .SessionProtos.GroupUpdateMemberLeftNotificationMessage memberLeftNotificationMessage = 8; + if (cached_has_bits & 0x00000080u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.memberleftnotificationmessage_); } } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); - } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void DataMessage_ClosedGroupControlMessage::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GroupUpdateMessage::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + GroupUpdateMessage::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GroupUpdateMessage::GetClassData() const { return &_class_data_; } -void DataMessage_ClosedGroupControlMessage::MergeFrom(const DataMessage_ClosedGroupControlMessage& from) { - DataMessage_ClosedGroupControlMessage* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.ClosedGroupControlMessage) + +void GroupUpdateMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.GroupUpdateMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.members_.MergeFrom(from._impl_.members_); - _this->_impl_.admins_.MergeFrom(from._impl_.admins_); - _this->_impl_.wrappers_.MergeFrom(from._impl_.wrappers_); cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x0000001fu) { + if (cached_has_bits & 0x000000ffu) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_publickey(from._internal_publickey()); + _this->_internal_mutable_invitemessage()->::SessionProtos::GroupUpdateInviteMessage::MergeFrom( + from._internal_invitemessage()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_name(from._internal_name()); + _this->_internal_mutable_infochangemessage()->::SessionProtos::GroupUpdateInfoChangeMessage::MergeFrom( + from._internal_infochangemessage()); } if (cached_has_bits & 0x00000004u) { - _this->_internal_mutable_encryptionkeypair()->::SessionProtos::KeyPair::MergeFrom( - from._internal_encryptionkeypair()); + _this->_internal_mutable_memberchangemessage()->::SessionProtos::GroupUpdateMemberChangeMessage::MergeFrom( + from._internal_memberchangemessage()); } if (cached_has_bits & 0x00000008u) { - _this->_impl_.expirationtimer_ = from._impl_.expirationtimer_; + _this->_internal_mutable_promotemessage()->::SessionProtos::GroupUpdatePromoteMessage::MergeFrom( + from._internal_promotemessage()); } if (cached_has_bits & 0x00000010u) { - _this->_impl_.type_ = from._impl_.type_; + _this->_internal_mutable_memberleftmessage()->::SessionProtos::GroupUpdateMemberLeftMessage::MergeFrom( + from._internal_memberleftmessage()); + } + if (cached_has_bits & 0x00000020u) { + _this->_internal_mutable_inviteresponse()->::SessionProtos::GroupUpdateInviteResponseMessage::MergeFrom( + from._internal_inviteresponse()); + } + if (cached_has_bits & 0x00000040u) { + _this->_internal_mutable_deletemembercontent()->::SessionProtos::GroupUpdateDeleteMemberContentMessage::MergeFrom( + from._internal_deletemembercontent()); + } + if (cached_has_bits & 0x00000080u) { + _this->_internal_mutable_memberleftnotificationmessage()->::SessionProtos::GroupUpdateMemberLeftNotificationMessage::MergeFrom( + from._internal_memberleftnotificationmessage()); } - _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void DataMessage_ClosedGroupControlMessage::CopyFrom(const DataMessage_ClosedGroupControlMessage& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.ClosedGroupControlMessage) +void GroupUpdateMessage::CopyFrom(const GroupUpdateMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.GroupUpdateMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool DataMessage_ClosedGroupControlMessage::IsInitialized() const { - if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; - if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.wrappers_)) - return false; - if (_internal_has_encryptionkeypair()) { - if (!_impl_.encryptionkeypair_->IsInitialized()) return false; +bool GroupUpdateMessage::IsInitialized() const { + if (_internal_has_invitemessage()) { + if (!_impl_.invitemessage_->IsInitialized()) return false; + } + if (_internal_has_infochangemessage()) { + if (!_impl_.infochangemessage_->IsInitialized()) return false; + } + if (_internal_has_memberchangemessage()) { + if (!_impl_.memberchangemessage_->IsInitialized()) return false; + } + if (_internal_has_promotemessage()) { + if (!_impl_.promotemessage_->IsInitialized()) return false; + } + if (_internal_has_inviteresponse()) { + if (!_impl_.inviteresponse_->IsInitialized()) return false; } return true; } -void DataMessage_ClosedGroupControlMessage::InternalSwap(DataMessage_ClosedGroupControlMessage* other) { +void GroupUpdateMessage::InternalSwap(GroupUpdateMessage* other) { using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.members_.InternalSwap(&other->_impl_.members_); - _impl_.admins_.InternalSwap(&other->_impl_.admins_); - _impl_.wrappers_.InternalSwap(&other->_impl_.wrappers_); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.publickey_, lhs_arena, - &other->_impl_.publickey_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.name_, lhs_arena, - &other->_impl_.name_, rhs_arena - ); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(DataMessage_ClosedGroupControlMessage, _impl_.expirationtimer_) - + sizeof(DataMessage_ClosedGroupControlMessage::_impl_.expirationtimer_) - - PROTOBUF_FIELD_OFFSET(DataMessage_ClosedGroupControlMessage, _impl_.encryptionkeypair_)>( - reinterpret_cast(&_impl_.encryptionkeypair_), - reinterpret_cast(&other->_impl_.encryptionkeypair_)); - swap(_impl_.type_, other->_impl_.type_); + PROTOBUF_FIELD_OFFSET(GroupUpdateMessage, _impl_.memberleftnotificationmessage_) + + sizeof(GroupUpdateMessage::_impl_.memberleftnotificationmessage_) + - PROTOBUF_FIELD_OFFSET(GroupUpdateMessage, _impl_.invitemessage_)>( + reinterpret_cast(&_impl_.invitemessage_), + reinterpret_cast(&other->_impl_.invitemessage_)); } -std::string DataMessage_ClosedGroupControlMessage::GetTypeName() const { - return "SessionProtos.DataMessage.ClosedGroupControlMessage"; +::PROTOBUF_NAMESPACE_ID::Metadata GroupUpdateMessage::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[18]); } - // =================================================================== -class DataMessage::_Internal { +class GroupUpdateInviteMessage::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_body(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_groupsessionid(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_flags(HasBits* has_bits) { - (*has_bits)[0] |= 256u; - } - static void set_has_expiretimer(HasBits* has_bits) { - (*has_bits)[0] |= 512u; - } - static void set_has_profilekey(HasBits* has_bits) { + static void set_has_name(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static void set_has_timestamp(HasBits* has_bits) { - (*has_bits)[0] |= 1024u; + static void set_has_memberauthdata(HasBits* has_bits) { + (*has_bits)[0] |= 4u; } - static const ::SessionProtos::DataMessage_Quote& quote(const DataMessage* msg); - static void set_has_quote(HasBits* has_bits) { + static void set_has_adminsignature(HasBits* has_bits) { (*has_bits)[0] |= 8u; } - static const ::SessionProtos::DataMessage_Reaction& reaction(const DataMessage* msg); - static void set_has_reaction(HasBits* has_bits) { - (*has_bits)[0] |= 16u; - } - static const ::SessionProtos::LokiProfile& profile(const DataMessage* msg); - static void set_has_profile(HasBits* has_bits) { - (*has_bits)[0] |= 32u; - } - static const ::SessionProtos::DataMessage_OpenGroupInvitation& opengroupinvitation(const DataMessage* msg); - static void set_has_opengroupinvitation(HasBits* has_bits) { - (*has_bits)[0] |= 64u; - } - static const ::SessionProtos::DataMessage_ClosedGroupControlMessage& closedgroupcontrolmessage(const DataMessage* msg); - static void set_has_closedgroupcontrolmessage(HasBits* has_bits) { - (*has_bits)[0] |= 128u; - } - static void set_has_synctarget(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } - static void set_has_blockscommunitymessagerequests(HasBits* has_bits) { - (*has_bits)[0] |= 2048u; + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x0000000f) ^ 0x0000000f) != 0; } }; -const ::SessionProtos::DataMessage_Quote& -DataMessage::_Internal::quote(const DataMessage* msg) { - return *msg->_impl_.quote_; -} -const ::SessionProtos::DataMessage_Reaction& -DataMessage::_Internal::reaction(const DataMessage* msg) { - return *msg->_impl_.reaction_; -} -const ::SessionProtos::LokiProfile& -DataMessage::_Internal::profile(const DataMessage* msg) { - return *msg->_impl_.profile_; -} -const ::SessionProtos::DataMessage_OpenGroupInvitation& -DataMessage::_Internal::opengroupinvitation(const DataMessage* msg) { - return *msg->_impl_.opengroupinvitation_; -} -const ::SessionProtos::DataMessage_ClosedGroupControlMessage& -DataMessage::_Internal::closedgroupcontrolmessage(const DataMessage* msg) { - return *msg->_impl_.closedgroupcontrolmessage_; -} -DataMessage::DataMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, +GroupUpdateInviteMessage::GroupUpdateInviteMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage) + // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdateInviteMessage) } -DataMessage::DataMessage(const DataMessage& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataMessage* const _this = this; (void)_this; +GroupUpdateInviteMessage::GroupUpdateInviteMessage(const GroupUpdateInviteMessage& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + GroupUpdateInviteMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.attachments_){from._impl_.attachments_} - , decltype(_impl_.preview_){from._impl_.preview_} - , decltype(_impl_.body_){} - , decltype(_impl_.profilekey_){} - , decltype(_impl_.synctarget_){} - , decltype(_impl_.quote_){nullptr} - , decltype(_impl_.reaction_){nullptr} - , decltype(_impl_.profile_){nullptr} - , decltype(_impl_.opengroupinvitation_){nullptr} - , decltype(_impl_.closedgroupcontrolmessage_){nullptr} - , decltype(_impl_.flags_){} - , decltype(_impl_.expiretimer_){} - , decltype(_impl_.timestamp_){} - , decltype(_impl_.blockscommunitymessagerequests_){}}; + , decltype(_impl_.groupsessionid_){} + , decltype(_impl_.name_){} + , decltype(_impl_.memberauthdata_){} + , decltype(_impl_.adminsignature_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.body_.InitDefault(); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.groupsessionid_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.body_.Set("", GetArenaForAllocation()); + _impl_.groupsessionid_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_body()) { - _this->_impl_.body_.Set(from._internal_body(), + if (from._internal_has_groupsessionid()) { + _this->_impl_.groupsessionid_.Set(from._internal_groupsessionid(), _this->GetArenaForAllocation()); } - _impl_.profilekey_.InitDefault(); + _impl_.name_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilekey_.Set("", GetArenaForAllocation()); + _impl_.name_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_profilekey()) { - _this->_impl_.profilekey_.Set(from._internal_profilekey(), + if (from._internal_has_name()) { + _this->_impl_.name_.Set(from._internal_name(), _this->GetArenaForAllocation()); } - _impl_.synctarget_.InitDefault(); + _impl_.memberauthdata_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.synctarget_.Set("", GetArenaForAllocation()); + _impl_.memberauthdata_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_synctarget()) { - _this->_impl_.synctarget_.Set(from._internal_synctarget(), + if (from._internal_has_memberauthdata()) { + _this->_impl_.memberauthdata_.Set(from._internal_memberauthdata(), _this->GetArenaForAllocation()); } - if (from._internal_has_quote()) { - _this->_impl_.quote_ = new ::SessionProtos::DataMessage_Quote(*from._impl_.quote_); - } - if (from._internal_has_reaction()) { - _this->_impl_.reaction_ = new ::SessionProtos::DataMessage_Reaction(*from._impl_.reaction_); - } - if (from._internal_has_profile()) { - _this->_impl_.profile_ = new ::SessionProtos::LokiProfile(*from._impl_.profile_); - } - if (from._internal_has_opengroupinvitation()) { - _this->_impl_.opengroupinvitation_ = new ::SessionProtos::DataMessage_OpenGroupInvitation(*from._impl_.opengroupinvitation_); - } - if (from._internal_has_closedgroupcontrolmessage()) { - _this->_impl_.closedgroupcontrolmessage_ = new ::SessionProtos::DataMessage_ClosedGroupControlMessage(*from._impl_.closedgroupcontrolmessage_); + _impl_.adminsignature_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.adminsignature_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_adminsignature()) { + _this->_impl_.adminsignature_.Set(from._internal_adminsignature(), + _this->GetArenaForAllocation()); } - ::memcpy(&_impl_.flags_, &from._impl_.flags_, - static_cast(reinterpret_cast(&_impl_.blockscommunitymessagerequests_) - - reinterpret_cast(&_impl_.flags_)) + sizeof(_impl_.blockscommunitymessagerequests_)); - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage) + // @@protoc_insertion_point(copy_constructor:SessionProtos.GroupUpdateInviteMessage) } -inline void DataMessage::SharedCtor( +inline void GroupUpdateInviteMessage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.attachments_){arena} - , decltype(_impl_.preview_){arena} - , decltype(_impl_.body_){} - , decltype(_impl_.profilekey_){} - , decltype(_impl_.synctarget_){} - , decltype(_impl_.quote_){nullptr} - , decltype(_impl_.reaction_){nullptr} - , decltype(_impl_.profile_){nullptr} - , decltype(_impl_.opengroupinvitation_){nullptr} - , decltype(_impl_.closedgroupcontrolmessage_){nullptr} - , decltype(_impl_.flags_){0u} - , decltype(_impl_.expiretimer_){0u} - , decltype(_impl_.timestamp_){uint64_t{0u}} - , decltype(_impl_.blockscommunitymessagerequests_){false} + , decltype(_impl_.groupsessionid_){} + , decltype(_impl_.name_){} + , decltype(_impl_.memberauthdata_){} + , decltype(_impl_.adminsignature_){} }; - _impl_.body_.InitDefault(); + _impl_.groupsessionid_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.body_.Set("", GetArenaForAllocation()); + _impl_.groupsessionid_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilekey_.InitDefault(); + _impl_.name_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilekey_.Set("", GetArenaForAllocation()); + _impl_.name_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.synctarget_.InitDefault(); + _impl_.memberauthdata_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.synctarget_.Set("", GetArenaForAllocation()); + _impl_.memberauthdata_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -} + _impl_.adminsignature_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.adminsignature_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} -DataMessage::~DataMessage() { - // @@protoc_insertion_point(destructor:SessionProtos.DataMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +GroupUpdateInviteMessage::~GroupUpdateInviteMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateInviteMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void DataMessage::SharedDtor() { +inline void GroupUpdateInviteMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.attachments_.~RepeatedPtrField(); - _impl_.preview_.~RepeatedPtrField(); - _impl_.body_.Destroy(); - _impl_.profilekey_.Destroy(); - _impl_.synctarget_.Destroy(); - if (this != internal_default_instance()) delete _impl_.quote_; - if (this != internal_default_instance()) delete _impl_.reaction_; - if (this != internal_default_instance()) delete _impl_.profile_; - if (this != internal_default_instance()) delete _impl_.opengroupinvitation_; - if (this != internal_default_instance()) delete _impl_.closedgroupcontrolmessage_; + _impl_.groupsessionid_.Destroy(); + _impl_.name_.Destroy(); + _impl_.memberauthdata_.Destroy(); + _impl_.adminsignature_.Destroy(); } -void DataMessage::SetCachedSize(int size) const { +void GroupUpdateInviteMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataMessage::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage) +void GroupUpdateInviteMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.GroupUpdateInviteMessage) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.attachments_.Clear(); - _impl_.preview_.Clear(); cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x000000ffu) { + if (cached_has_bits & 0x0000000fu) { if (cached_has_bits & 0x00000001u) { - _impl_.body_.ClearNonDefaultToEmpty(); + _impl_.groupsessionid_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.profilekey_.ClearNonDefaultToEmpty(); + _impl_.name_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000004u) { - _impl_.synctarget_.ClearNonDefaultToEmpty(); + _impl_.memberauthdata_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000008u) { - GOOGLE_DCHECK(_impl_.quote_ != nullptr); - _impl_.quote_->Clear(); - } - if (cached_has_bits & 0x00000010u) { - GOOGLE_DCHECK(_impl_.reaction_ != nullptr); - _impl_.reaction_->Clear(); - } - if (cached_has_bits & 0x00000020u) { - GOOGLE_DCHECK(_impl_.profile_ != nullptr); - _impl_.profile_->Clear(); - } - if (cached_has_bits & 0x00000040u) { - GOOGLE_DCHECK(_impl_.opengroupinvitation_ != nullptr); - _impl_.opengroupinvitation_->Clear(); - } - if (cached_has_bits & 0x00000080u) { - GOOGLE_DCHECK(_impl_.closedgroupcontrolmessage_ != nullptr); - _impl_.closedgroupcontrolmessage_->Clear(); + _impl_.adminsignature_.ClearNonDefaultToEmpty(); } } - if (cached_has_bits & 0x00000f00u) { - ::memset(&_impl_.flags_, 0, static_cast( - reinterpret_cast(&_impl_.blockscommunitymessagerequests_) - - reinterpret_cast(&_impl_.flags_)) + sizeof(_impl_.blockscommunitymessagerequests_)); - } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* DataMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* GroupUpdateInviteMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // optional string body = 1; + // required string groupSessionId = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_body(); + auto str = _internal_mutable_groupsessionid(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.GroupUpdateInviteMessage.groupSessionId"); + #endif // !NDEBUG } else goto handle_unusual; continue; - // repeated .SessionProtos.AttachmentPointer attachments = 2; + // required string name = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_attachments(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); - } else - goto handle_unusual; - continue; - // optional uint32 flags = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - _Internal::set_has_flags(&has_bits); - _impl_.flags_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional uint32 expireTimer = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { - _Internal::set_has_expiretimer(&has_bits); - _impl_.expiretimer_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional bytes profileKey = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { - auto str = _internal_mutable_profilekey(); + auto str = _internal_mutable_name(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.GroupUpdateInviteMessage.name"); + #endif // !NDEBUG } else goto handle_unusual; continue; - // optional uint64 timestamp = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { - _Internal::set_has_timestamp(&has_bits); - _impl_.timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.DataMessage.Quote quote = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { - ptr = ctx->ParseMessage(_internal_mutable_quote(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // repeated .SessionProtos.DataMessage.Preview preview = 10; - case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 82)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_preview(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<82>(ptr)); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.DataMessage.Reaction reaction = 11; - case 11: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 90)) { - ptr = ctx->ParseMessage(_internal_mutable_reaction(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.LokiProfile profile = 101; - case 101: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { - ptr = ctx->ParseMessage(_internal_mutable_profile(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; - case 102: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { - ptr = ctx->ParseMessage(_internal_mutable_opengroupinvitation(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; - case 104: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { - ptr = ctx->ParseMessage(_internal_mutable_closedgroupcontrolmessage(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional string syncTarget = 105; - case 105: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { - auto str = _internal_mutable_synctarget(); + // required bytes memberAuthData = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + auto str = _internal_mutable_memberauthdata(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional bool blocksCommunityMessageRequests = 106; - case 106: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 80)) { - _Internal::set_has_blockscommunitymessagerequests(&has_bits); - _impl_.blockscommunitymessagerequests_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + // required bytes adminSignature = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + auto str = _internal_mutable_adminsignature(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; @@ -8159,7 +9014,7 @@ const char* DataMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* c } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -8172,400 +9027,235 @@ const char* DataMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* c #undef CHK_ } -uint8_t* DataMessage::_InternalSerialize( +uint8_t* GroupUpdateInviteMessage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.DataMessage) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.GroupUpdateInviteMessage) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // optional string body = 1; + // required string groupSessionId = 1; if (cached_has_bits & 0x00000001u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_groupsessionid().data(), static_cast(this->_internal_groupsessionid().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.GroupUpdateInviteMessage.groupSessionId"); target = stream->WriteStringMaybeAliased( - 1, this->_internal_body(), target); - } - - // repeated .SessionProtos.AttachmentPointer attachments = 2; - for (unsigned i = 0, - n = static_cast(this->_internal_attachments_size()); i < n; i++) { - const auto& repfield = this->_internal_attachments(i); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); - } - - // optional uint32 flags = 4; - if (cached_has_bits & 0x00000100u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_flags(), target); - } - - // optional uint32 expireTimer = 5; - if (cached_has_bits & 0x00000200u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_expiretimer(), target); + 1, this->_internal_groupsessionid(), target); } - // optional bytes profileKey = 6; + // required string name = 2; if (cached_has_bits & 0x00000002u) { - target = stream->WriteBytesMaybeAliased( - 6, this->_internal_profilekey(), target); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_name().data(), static_cast(this->_internal_name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.GroupUpdateInviteMessage.name"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_name(), target); } - // optional uint64 timestamp = 7; - if (cached_has_bits & 0x00000400u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray(7, this->_internal_timestamp(), target); + // required bytes memberAuthData = 3; + if (cached_has_bits & 0x00000004u) { + target = stream->WriteBytesMaybeAliased( + 3, this->_internal_memberauthdata(), target); } - // optional .SessionProtos.DataMessage.Quote quote = 8; + // required bytes adminSignature = 4; if (cached_has_bits & 0x00000008u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(8, _Internal::quote(this), - _Internal::quote(this).GetCachedSize(), target, stream); - } - - // repeated .SessionProtos.DataMessage.Preview preview = 10; - for (unsigned i = 0, - n = static_cast(this->_internal_preview_size()); i < n; i++) { - const auto& repfield = this->_internal_preview(i); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(10, repfield, repfield.GetCachedSize(), target, stream); + target = stream->WriteBytesMaybeAliased( + 4, this->_internal_adminsignature(), target); } - // optional .SessionProtos.DataMessage.Reaction reaction = 11; - if (cached_has_bits & 0x00000010u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(11, _Internal::reaction(this), - _Internal::reaction(this).GetCachedSize(), target, stream); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateInviteMessage) + return target; +} - // optional .SessionProtos.LokiProfile profile = 101; - if (cached_has_bits & 0x00000020u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(101, _Internal::profile(this), - _Internal::profile(this).GetCachedSize(), target, stream); - } +size_t GroupUpdateInviteMessage::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.GroupUpdateInviteMessage) + size_t total_size = 0; - // optional .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; - if (cached_has_bits & 0x00000040u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(102, _Internal::opengroupinvitation(this), - _Internal::opengroupinvitation(this).GetCachedSize(), target, stream); + if (_internal_has_groupsessionid()) { + // required string groupSessionId = 1; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_groupsessionid()); } - // optional .SessionProtos.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; - if (cached_has_bits & 0x00000080u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(104, _Internal::closedgroupcontrolmessage(this), - _Internal::closedgroupcontrolmessage(this).GetCachedSize(), target, stream); + if (_internal_has_name()) { + // required string name = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); } - // optional string syncTarget = 105; - if (cached_has_bits & 0x00000004u) { - target = stream->WriteStringMaybeAliased( - 105, this->_internal_synctarget(), target); + if (_internal_has_memberauthdata()) { + // required bytes memberAuthData = 3; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_memberauthdata()); } - // optional bool blocksCommunityMessageRequests = 106; - if (cached_has_bits & 0x00000800u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(106, this->_internal_blockscommunitymessagerequests(), target); + if (_internal_has_adminsignature()) { + // required bytes adminSignature = 4; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_adminsignature()); } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); - } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage) - return target; + return total_size; } - -size_t DataMessage::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage) +size_t GroupUpdateInviteMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.GroupUpdateInviteMessage) size_t total_size = 0; - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; + if (((_impl_._has_bits_[0] & 0x0000000f) ^ 0x0000000f) == 0) { // All required fields are present. + // required string groupSessionId = 1; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_groupsessionid()); - // repeated .SessionProtos.AttachmentPointer attachments = 2; - total_size += 1UL * this->_internal_attachments_size(); - for (const auto& msg : this->_impl_.attachments_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // repeated .SessionProtos.DataMessage.Preview preview = 10; - total_size += 1UL * this->_internal_preview_size(); - for (const auto& msg : this->_impl_.preview_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x000000ffu) { - // optional string body = 1; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_body()); - } - - // optional bytes profileKey = 6; - if (cached_has_bits & 0x00000002u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_profilekey()); - } - - // optional string syncTarget = 105; - if (cached_has_bits & 0x00000004u) { - total_size += 2 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_synctarget()); - } - - // optional .SessionProtos.DataMessage.Quote quote = 8; - if (cached_has_bits & 0x00000008u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.quote_); - } - - // optional .SessionProtos.DataMessage.Reaction reaction = 11; - if (cached_has_bits & 0x00000010u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.reaction_); - } - - // optional .SessionProtos.LokiProfile profile = 101; - if (cached_has_bits & 0x00000020u) { - total_size += 2 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.profile_); - } + // required string name = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); - // optional .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; - if (cached_has_bits & 0x00000040u) { - total_size += 2 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.opengroupinvitation_); - } + // required bytes memberAuthData = 3; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_memberauthdata()); - // optional .SessionProtos.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; - if (cached_has_bits & 0x00000080u) { - total_size += 2 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.closedgroupcontrolmessage_); - } + // required bytes adminSignature = 4; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_adminsignature()); + } else { + total_size += RequiredFieldsByteSizeFallback(); } - if (cached_has_bits & 0x00000f00u) { - // optional uint32 flags = 4; - if (cached_has_bits & 0x00000100u) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); - } - - // optional uint32 expireTimer = 5; - if (cached_has_bits & 0x00000200u) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_expiretimer()); - } - - // optional uint64 timestamp = 7; - if (cached_has_bits & 0x00000400u) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_timestamp()); - } - - // optional bool blocksCommunityMessageRequests = 106; - if (cached_has_bits & 0x00000800u) { - total_size += 2 + 1; - } + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; - } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); - } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void DataMessage::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GroupUpdateInviteMessage::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + GroupUpdateInviteMessage::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GroupUpdateInviteMessage::GetClassData() const { return &_class_data_; } -void DataMessage::MergeFrom(const DataMessage& from) { - DataMessage* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage) + +void GroupUpdateInviteMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.GroupUpdateInviteMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.attachments_.MergeFrom(from._impl_.attachments_); - _this->_impl_.preview_.MergeFrom(from._impl_.preview_); cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x000000ffu) { + if (cached_has_bits & 0x0000000fu) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_body(from._internal_body()); + _this->_internal_set_groupsessionid(from._internal_groupsessionid()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_profilekey(from._internal_profilekey()); + _this->_internal_set_name(from._internal_name()); } if (cached_has_bits & 0x00000004u) { - _this->_internal_set_synctarget(from._internal_synctarget()); + _this->_internal_set_memberauthdata(from._internal_memberauthdata()); } if (cached_has_bits & 0x00000008u) { - _this->_internal_mutable_quote()->::SessionProtos::DataMessage_Quote::MergeFrom( - from._internal_quote()); - } - if (cached_has_bits & 0x00000010u) { - _this->_internal_mutable_reaction()->::SessionProtos::DataMessage_Reaction::MergeFrom( - from._internal_reaction()); - } - if (cached_has_bits & 0x00000020u) { - _this->_internal_mutable_profile()->::SessionProtos::LokiProfile::MergeFrom( - from._internal_profile()); - } - if (cached_has_bits & 0x00000040u) { - _this->_internal_mutable_opengroupinvitation()->::SessionProtos::DataMessage_OpenGroupInvitation::MergeFrom( - from._internal_opengroupinvitation()); - } - if (cached_has_bits & 0x00000080u) { - _this->_internal_mutable_closedgroupcontrolmessage()->::SessionProtos::DataMessage_ClosedGroupControlMessage::MergeFrom( - from._internal_closedgroupcontrolmessage()); - } - } - if (cached_has_bits & 0x00000f00u) { - if (cached_has_bits & 0x00000100u) { - _this->_impl_.flags_ = from._impl_.flags_; - } - if (cached_has_bits & 0x00000200u) { - _this->_impl_.expiretimer_ = from._impl_.expiretimer_; + _this->_internal_set_adminsignature(from._internal_adminsignature()); } - if (cached_has_bits & 0x00000400u) { - _this->_impl_.timestamp_ = from._impl_.timestamp_; - } - if (cached_has_bits & 0x00000800u) { - _this->_impl_.blockscommunitymessagerequests_ = from._impl_.blockscommunitymessagerequests_; - } - _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void DataMessage::CopyFrom(const DataMessage& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage) +void GroupUpdateInviteMessage::CopyFrom(const GroupUpdateInviteMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.GroupUpdateInviteMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool DataMessage::IsInitialized() const { - if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.attachments_)) - return false; - if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.preview_)) - return false; - if (_internal_has_quote()) { - if (!_impl_.quote_->IsInitialized()) return false; - } - if (_internal_has_reaction()) { - if (!_impl_.reaction_->IsInitialized()) return false; - } - if (_internal_has_opengroupinvitation()) { - if (!_impl_.opengroupinvitation_->IsInitialized()) return false; - } - if (_internal_has_closedgroupcontrolmessage()) { - if (!_impl_.closedgroupcontrolmessage_->IsInitialized()) return false; - } +bool GroupUpdateInviteMessage::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; return true; } -void DataMessage::InternalSwap(DataMessage* other) { +void GroupUpdateInviteMessage::InternalSwap(GroupUpdateInviteMessage* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.attachments_.InternalSwap(&other->_impl_.attachments_); - _impl_.preview_.InternalSwap(&other->_impl_.preview_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.body_, lhs_arena, - &other->_impl_.body_, rhs_arena + &_impl_.groupsessionid_, lhs_arena, + &other->_impl_.groupsessionid_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.profilekey_, lhs_arena, - &other->_impl_.profilekey_, rhs_arena + &_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.synctarget_, lhs_arena, - &other->_impl_.synctarget_, rhs_arena + &_impl_.memberauthdata_, lhs_arena, + &other->_impl_.memberauthdata_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.adminsignature_, lhs_arena, + &other->_impl_.adminsignature_, rhs_arena ); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(DataMessage, _impl_.blockscommunitymessagerequests_) - + sizeof(DataMessage::_impl_.blockscommunitymessagerequests_) - - PROTOBUF_FIELD_OFFSET(DataMessage, _impl_.quote_)>( - reinterpret_cast(&_impl_.quote_), - reinterpret_cast(&other->_impl_.quote_)); } -std::string DataMessage::GetTypeName() const { - return "SessionProtos.DataMessage"; +::PROTOBUF_NAMESPACE_ID::Metadata GroupUpdateInviteMessage::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[19]); } - // =================================================================== -class ConfigurationMessage_ClosedGroup::_Internal { +class GroupUpdatePromoteMessage::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_publickey(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_groupidentityseed(HasBits* has_bits) { (*has_bits)[0] |= 1u; } static void set_has_name(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static const ::SessionProtos::KeyPair& encryptionkeypair(const ConfigurationMessage_ClosedGroup* msg); - static void set_has_encryptionkeypair(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } - static void set_has_expirationtimer(HasBits* has_bits) { - (*has_bits)[0] |= 8u; + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; } }; -const ::SessionProtos::KeyPair& -ConfigurationMessage_ClosedGroup::_Internal::encryptionkeypair(const ConfigurationMessage_ClosedGroup* msg) { - return *msg->_impl_.encryptionkeypair_; -} -ConfigurationMessage_ClosedGroup::ConfigurationMessage_ClosedGroup(::PROTOBUF_NAMESPACE_ID::Arena* arena, +GroupUpdatePromoteMessage::GroupUpdatePromoteMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.ConfigurationMessage.ClosedGroup) + // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdatePromoteMessage) } -ConfigurationMessage_ClosedGroup::ConfigurationMessage_ClosedGroup(const ConfigurationMessage_ClosedGroup& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - ConfigurationMessage_ClosedGroup* const _this = this; (void)_this; +GroupUpdatePromoteMessage::GroupUpdatePromoteMessage(const GroupUpdatePromoteMessage& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + GroupUpdatePromoteMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.members_){from._impl_.members_} - , decltype(_impl_.admins_){from._impl_.admins_} - , decltype(_impl_.publickey_){} - , decltype(_impl_.name_){} - , decltype(_impl_.encryptionkeypair_){nullptr} - , decltype(_impl_.expirationtimer_){}}; + , decltype(_impl_.groupidentityseed_){} + , decltype(_impl_.name_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.publickey_.InitDefault(); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.groupidentityseed_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.Set("", GetArenaForAllocation()); + _impl_.groupidentityseed_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_publickey()) { - _this->_impl_.publickey_.Set(from._internal_publickey(), + if (from._internal_has_groupidentityseed()) { + _this->_impl_.groupidentityseed_.Set(from._internal_groupidentityseed(), _this->GetArenaForAllocation()); } _impl_.name_.InitDefault(); @@ -8576,30 +9266,22 @@ ConfigurationMessage_ClosedGroup::ConfigurationMessage_ClosedGroup(const Configu _this->_impl_.name_.Set(from._internal_name(), _this->GetArenaForAllocation()); } - if (from._internal_has_encryptionkeypair()) { - _this->_impl_.encryptionkeypair_ = new ::SessionProtos::KeyPair(*from._impl_.encryptionkeypair_); - } - _this->_impl_.expirationtimer_ = from._impl_.expirationtimer_; - // @@protoc_insertion_point(copy_constructor:SessionProtos.ConfigurationMessage.ClosedGroup) + // @@protoc_insertion_point(copy_constructor:SessionProtos.GroupUpdatePromoteMessage) } -inline void ConfigurationMessage_ClosedGroup::SharedCtor( +inline void GroupUpdatePromoteMessage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.members_){arena} - , decltype(_impl_.admins_){arena} - , decltype(_impl_.publickey_){} + , decltype(_impl_.groupidentityseed_){} , decltype(_impl_.name_){} - , decltype(_impl_.encryptionkeypair_){nullptr} - , decltype(_impl_.expirationtimer_){0u} }; - _impl_.publickey_.InitDefault(); + _impl_.groupidentityseed_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.Set("", GetArenaForAllocation()); + _impl_.groupidentityseed_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.name_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -8607,121 +9289,69 @@ inline void ConfigurationMessage_ClosedGroup::SharedCtor( #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -ConfigurationMessage_ClosedGroup::~ConfigurationMessage_ClosedGroup() { - // @@protoc_insertion_point(destructor:SessionProtos.ConfigurationMessage.ClosedGroup) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +GroupUpdatePromoteMessage::~GroupUpdatePromoteMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdatePromoteMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void ConfigurationMessage_ClosedGroup::SharedDtor() { +inline void GroupUpdatePromoteMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.members_.~RepeatedPtrField(); - _impl_.admins_.~RepeatedPtrField(); - _impl_.publickey_.Destroy(); + _impl_.groupidentityseed_.Destroy(); _impl_.name_.Destroy(); - if (this != internal_default_instance()) delete _impl_.encryptionkeypair_; } -void ConfigurationMessage_ClosedGroup::SetCachedSize(int size) const { +void GroupUpdatePromoteMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void ConfigurationMessage_ClosedGroup::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.ConfigurationMessage.ClosedGroup) +void GroupUpdatePromoteMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.GroupUpdatePromoteMessage) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.members_.Clear(); - _impl_.admins_.Clear(); cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _impl_.publickey_.ClearNonDefaultToEmpty(); + _impl_.groupidentityseed_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { _impl_.name_.ClearNonDefaultToEmpty(); } - if (cached_has_bits & 0x00000004u) { - GOOGLE_DCHECK(_impl_.encryptionkeypair_ != nullptr); - _impl_.encryptionkeypair_->Clear(); - } } - _impl_.expirationtimer_ = 0u; _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ConfigurationMessage_ClosedGroup::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* GroupUpdatePromoteMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // optional bytes publicKey = 1; + // required bytes groupIdentitySeed = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_publickey(); + auto str = _internal_mutable_groupidentityseed(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional string name = 2; + // required string name = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_name(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.KeyPair encryptionKeyPair = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - ptr = ctx->ParseMessage(_internal_mutable_encryptionkeypair(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // repeated bytes members = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { - ptr -= 1; - do { - ptr += 1; - auto str = _internal_add_members(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); - } else - goto handle_unusual; - continue; - // repeated bytes admins = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { - ptr -= 1; - do { - ptr += 1; - auto str = _internal_add_admins(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr)); - } else - goto handle_unusual; - continue; - // optional uint32 expirationTimer = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { - _Internal::set_has_expirationtimer(&has_bits); - _impl_.expirationtimer_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.GroupUpdatePromoteMessage.name"); + #endif // !NDEBUG } else goto handle_unusual; continue; @@ -8736,7 +9366,7 @@ const char* ConfigurationMessage_ClosedGroup::_InternalParse(const char* ptr, :: } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -8749,439 +9379,319 @@ const char* ConfigurationMessage_ClosedGroup::_InternalParse(const char* ptr, :: #undef CHK_ } -uint8_t* ConfigurationMessage_ClosedGroup::_InternalSerialize( +uint8_t* GroupUpdatePromoteMessage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ConfigurationMessage.ClosedGroup) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.GroupUpdatePromoteMessage) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // optional bytes publicKey = 1; + // required bytes groupIdentitySeed = 1; if (cached_has_bits & 0x00000001u) { target = stream->WriteBytesMaybeAliased( - 1, this->_internal_publickey(), target); + 1, this->_internal_groupidentityseed(), target); } - // optional string name = 2; + // required string name = 2; if (cached_has_bits & 0x00000002u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_name().data(), static_cast(this->_internal_name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.GroupUpdatePromoteMessage.name"); target = stream->WriteStringMaybeAliased( 2, this->_internal_name(), target); } - // optional .SessionProtos.KeyPair encryptionKeyPair = 3; - if (cached_has_bits & 0x00000004u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::encryptionkeypair(this), - _Internal::encryptionkeypair(this).GetCachedSize(), target, stream); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdatePromoteMessage) + return target; +} - // repeated bytes members = 4; - for (int i = 0, n = this->_internal_members_size(); i < n; i++) { - const auto& s = this->_internal_members(i); - target = stream->WriteBytes(4, s, target); - } +size_t GroupUpdatePromoteMessage::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.GroupUpdatePromoteMessage) + size_t total_size = 0; - // repeated bytes admins = 5; - for (int i = 0, n = this->_internal_admins_size(); i < n; i++) { - const auto& s = this->_internal_admins(i); - target = stream->WriteBytes(5, s, target); + if (_internal_has_groupidentityseed()) { + // required bytes groupIdentitySeed = 1; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_groupidentityseed()); } - // optional uint32 expirationTimer = 6; - if (cached_has_bits & 0x00000008u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(6, this->_internal_expirationtimer(), target); + if (_internal_has_name()) { + // required string name = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); - } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ConfigurationMessage.ClosedGroup) - return target; + return total_size; } - -size_t ConfigurationMessage_ClosedGroup::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ConfigurationMessage.ClosedGroup) +size_t GroupUpdatePromoteMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.GroupUpdatePromoteMessage) size_t total_size = 0; - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; + if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. + // required bytes groupIdentitySeed = 1; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_groupidentityseed()); - // repeated bytes members = 4; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.members_.size()); - for (int i = 0, n = _impl_.members_.size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - _impl_.members_.Get(i)); - } + // required string name = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); - // repeated bytes admins = 5; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.admins_.size()); - for (int i = 0, n = _impl_.admins_.size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - _impl_.admins_.Get(i)); + } else { + total_size += RequiredFieldsByteSizeFallback(); } + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { - // optional bytes publicKey = 1; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_publickey()); - } - - // optional string name = 2; - if (cached_has_bits & 0x00000002u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); - } - - // optional .SessionProtos.KeyPair encryptionKeyPair = 3; - if (cached_has_bits & 0x00000004u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.encryptionkeypair_); - } - - // optional uint32 expirationTimer = 6; - if (cached_has_bits & 0x00000008u) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_expirationtimer()); - } - - } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); - } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void ConfigurationMessage_ClosedGroup::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GroupUpdatePromoteMessage::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + GroupUpdatePromoteMessage::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GroupUpdatePromoteMessage::GetClassData() const { return &_class_data_; } + -void ConfigurationMessage_ClosedGroup::MergeFrom(const ConfigurationMessage_ClosedGroup& from) { - ConfigurationMessage_ClosedGroup* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ConfigurationMessage.ClosedGroup) +void GroupUpdatePromoteMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.GroupUpdatePromoteMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.members_.MergeFrom(from._impl_.members_); - _this->_impl_.admins_.MergeFrom(from._impl_.admins_); cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { + if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_publickey(from._internal_publickey()); + _this->_internal_set_groupidentityseed(from._internal_groupidentityseed()); } if (cached_has_bits & 0x00000002u) { _this->_internal_set_name(from._internal_name()); } - if (cached_has_bits & 0x00000004u) { - _this->_internal_mutable_encryptionkeypair()->::SessionProtos::KeyPair::MergeFrom( - from._internal_encryptionkeypair()); - } - if (cached_has_bits & 0x00000008u) { - _this->_impl_.expirationtimer_ = from._impl_.expirationtimer_; - } - _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void ConfigurationMessage_ClosedGroup::CopyFrom(const ConfigurationMessage_ClosedGroup& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ConfigurationMessage.ClosedGroup) +void GroupUpdatePromoteMessage::CopyFrom(const GroupUpdatePromoteMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.GroupUpdatePromoteMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool ConfigurationMessage_ClosedGroup::IsInitialized() const { - if (_internal_has_encryptionkeypair()) { - if (!_impl_.encryptionkeypair_->IsInitialized()) return false; - } +bool GroupUpdatePromoteMessage::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; return true; } -void ConfigurationMessage_ClosedGroup::InternalSwap(ConfigurationMessage_ClosedGroup* other) { +void GroupUpdatePromoteMessage::InternalSwap(GroupUpdatePromoteMessage* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.members_.InternalSwap(&other->_impl_.members_); - _impl_.admins_.InternalSwap(&other->_impl_.admins_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.publickey_, lhs_arena, - &other->_impl_.publickey_, rhs_arena + &_impl_.groupidentityseed_, lhs_arena, + &other->_impl_.groupidentityseed_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( &_impl_.name_, lhs_arena, &other->_impl_.name_, rhs_arena ); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(ConfigurationMessage_ClosedGroup, _impl_.expirationtimer_) - + sizeof(ConfigurationMessage_ClosedGroup::_impl_.expirationtimer_) - - PROTOBUF_FIELD_OFFSET(ConfigurationMessage_ClosedGroup, _impl_.encryptionkeypair_)>( - reinterpret_cast(&_impl_.encryptionkeypair_), - reinterpret_cast(&other->_impl_.encryptionkeypair_)); } -std::string ConfigurationMessage_ClosedGroup::GetTypeName() const { - return "SessionProtos.ConfigurationMessage.ClosedGroup"; +::PROTOBUF_NAMESPACE_ID::Metadata GroupUpdatePromoteMessage::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[20]); } - // =================================================================== -class ConfigurationMessage_Contact::_Internal { +class GroupUpdateInfoChangeMessage::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_publickey(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } - static void set_has_name(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } - static void set_has_profilepicture(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } - static void set_has_profilekey(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_type(HasBits* has_bits) { (*has_bits)[0] |= 8u; } - static void set_has_isapproved(HasBits* has_bits) { - (*has_bits)[0] |= 16u; + static void set_has_updatedname(HasBits* has_bits) { + (*has_bits)[0] |= 1u; } - static void set_has_isblocked(HasBits* has_bits) { - (*has_bits)[0] |= 32u; + static void set_has_updatedexpiration(HasBits* has_bits) { + (*has_bits)[0] |= 4u; } - static void set_has_didapproveme(HasBits* has_bits) { - (*has_bits)[0] |= 64u; + static void set_has_adminsignature(HasBits* has_bits) { + (*has_bits)[0] |= 2u; } static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; + return ((has_bits[0] & 0x0000000a) ^ 0x0000000a) != 0; } }; -ConfigurationMessage_Contact::ConfigurationMessage_Contact(::PROTOBUF_NAMESPACE_ID::Arena* arena, +GroupUpdateInfoChangeMessage::GroupUpdateInfoChangeMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.ConfigurationMessage.Contact) + // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdateInfoChangeMessage) } -ConfigurationMessage_Contact::ConfigurationMessage_Contact(const ConfigurationMessage_Contact& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - ConfigurationMessage_Contact* const _this = this; (void)_this; +GroupUpdateInfoChangeMessage::GroupUpdateInfoChangeMessage(const GroupUpdateInfoChangeMessage& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + GroupUpdateInfoChangeMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.publickey_){} - , decltype(_impl_.name_){} - , decltype(_impl_.profilepicture_){} - , decltype(_impl_.profilekey_){} - , decltype(_impl_.isapproved_){} - , decltype(_impl_.isblocked_){} - , decltype(_impl_.didapproveme_){}}; + , decltype(_impl_.updatedname_){} + , decltype(_impl_.adminsignature_){} + , decltype(_impl_.updatedexpiration_){} + , decltype(_impl_.type_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.publickey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_publickey()) { - _this->_impl_.publickey_.Set(from._internal_publickey(), - _this->GetArenaForAllocation()); - } - _impl_.name_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_name()) { - _this->_impl_.name_.Set(from._internal_name(), - _this->GetArenaForAllocation()); - } - _impl_.profilepicture_.InitDefault(); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.updatedname_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilepicture_.Set("", GetArenaForAllocation()); + _impl_.updatedname_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_profilepicture()) { - _this->_impl_.profilepicture_.Set(from._internal_profilepicture(), + if (from._internal_has_updatedname()) { + _this->_impl_.updatedname_.Set(from._internal_updatedname(), _this->GetArenaForAllocation()); } - _impl_.profilekey_.InitDefault(); + _impl_.adminsignature_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilekey_.Set("", GetArenaForAllocation()); + _impl_.adminsignature_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_profilekey()) { - _this->_impl_.profilekey_.Set(from._internal_profilekey(), + if (from._internal_has_adminsignature()) { + _this->_impl_.adminsignature_.Set(from._internal_adminsignature(), _this->GetArenaForAllocation()); } - ::memcpy(&_impl_.isapproved_, &from._impl_.isapproved_, - static_cast(reinterpret_cast(&_impl_.didapproveme_) - - reinterpret_cast(&_impl_.isapproved_)) + sizeof(_impl_.didapproveme_)); - // @@protoc_insertion_point(copy_constructor:SessionProtos.ConfigurationMessage.Contact) + ::memcpy(&_impl_.updatedexpiration_, &from._impl_.updatedexpiration_, + static_cast(reinterpret_cast(&_impl_.type_) - + reinterpret_cast(&_impl_.updatedexpiration_)) + sizeof(_impl_.type_)); + // @@protoc_insertion_point(copy_constructor:SessionProtos.GroupUpdateInfoChangeMessage) } -inline void ConfigurationMessage_Contact::SharedCtor( +inline void GroupUpdateInfoChangeMessage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.publickey_){} - , decltype(_impl_.name_){} - , decltype(_impl_.profilepicture_){} - , decltype(_impl_.profilekey_){} - , decltype(_impl_.isapproved_){false} - , decltype(_impl_.isblocked_){false} - , decltype(_impl_.didapproveme_){false} + , decltype(_impl_.updatedname_){} + , decltype(_impl_.adminsignature_){} + , decltype(_impl_.updatedexpiration_){0u} + , decltype(_impl_.type_){1} }; - _impl_.publickey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilepicture_.InitDefault(); + _impl_.updatedname_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilepicture_.Set("", GetArenaForAllocation()); + _impl_.updatedname_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilekey_.InitDefault(); + _impl_.adminsignature_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilekey_.Set("", GetArenaForAllocation()); + _impl_.adminsignature_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -ConfigurationMessage_Contact::~ConfigurationMessage_Contact() { - // @@protoc_insertion_point(destructor:SessionProtos.ConfigurationMessage.Contact) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +GroupUpdateInfoChangeMessage::~GroupUpdateInfoChangeMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateInfoChangeMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void ConfigurationMessage_Contact::SharedDtor() { +inline void GroupUpdateInfoChangeMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.publickey_.Destroy(); - _impl_.name_.Destroy(); - _impl_.profilepicture_.Destroy(); - _impl_.profilekey_.Destroy(); + _impl_.updatedname_.Destroy(); + _impl_.adminsignature_.Destroy(); } -void ConfigurationMessage_Contact::SetCachedSize(int size) const { +void GroupUpdateInfoChangeMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void ConfigurationMessage_Contact::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.ConfigurationMessage.Contact) +void GroupUpdateInfoChangeMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.GroupUpdateInfoChangeMessage) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { + if (cached_has_bits & 0x00000003u) { if (cached_has_bits & 0x00000001u) { - _impl_.publickey_.ClearNonDefaultToEmpty(); + _impl_.updatedname_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.name_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000004u) { - _impl_.profilepicture_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000008u) { - _impl_.profilekey_.ClearNonDefaultToEmpty(); + _impl_.adminsignature_.ClearNonDefaultToEmpty(); } } - ::memset(&_impl_.isapproved_, 0, static_cast( - reinterpret_cast(&_impl_.didapproveme_) - - reinterpret_cast(&_impl_.isapproved_)) + sizeof(_impl_.didapproveme_)); + if (cached_has_bits & 0x0000000cu) { + _impl_.updatedexpiration_ = 0u; + _impl_.type_ = 1; + } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ConfigurationMessage_Contact::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* GroupUpdateInfoChangeMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required bytes publicKey = 1; + // required .SessionProtos.GroupUpdateInfoChangeMessage.Type type = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_publickey(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); + if (PROTOBUF_PREDICT_TRUE(::SessionProtos::GroupUpdateInfoChangeMessage_Type_IsValid(val))) { + _internal_set_type(static_cast<::SessionProtos::GroupUpdateInfoChangeMessage_Type>(val)); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields()); + } } else goto handle_unusual; continue; - // required string name = 2; + // optional string updatedName = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_name(); + auto str = _internal_mutable_updatedname(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.GroupUpdateInfoChangeMessage.updatedName"); + #endif // !NDEBUG } else goto handle_unusual; continue; - // optional string profilePicture = 3; + // optional uint32 updatedExpiration = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_profilepicture(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _Internal::set_has_updatedexpiration(&has_bits); + _impl_.updatedexpiration_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; - // optional bytes profileKey = 4; + // required bytes adminSignature = 4; case 4: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { - auto str = _internal_mutable_profilekey(); + auto str = _internal_mutable_adminsignature(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional bool isApproved = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { - _Internal::set_has_isapproved(&has_bits); - _impl_.isapproved_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional bool isBlocked = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { - _Internal::set_has_isblocked(&has_bits); - _impl_.isblocked_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional bool didApproveMe = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { - _Internal::set_has_didapproveme(&has_bits); - _impl_.didapproveme_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; default: goto handle_unusual; } // switch @@ -9193,7 +9703,7 @@ const char* ConfigurationMessage_Contact::_InternalParse(const char* ptr, ::_pbi } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -9206,97 +9716,82 @@ const char* ConfigurationMessage_Contact::_InternalParse(const char* ptr, ::_pbi #undef CHK_ } -uint8_t* ConfigurationMessage_Contact::_InternalSerialize( +uint8_t* GroupUpdateInfoChangeMessage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ConfigurationMessage.Contact) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.GroupUpdateInfoChangeMessage) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required bytes publicKey = 1; - if (cached_has_bits & 0x00000001u) { - target = stream->WriteBytesMaybeAliased( - 1, this->_internal_publickey(), target); + // required .SessionProtos.GroupUpdateInfoChangeMessage.Type type = 1; + if (cached_has_bits & 0x00000008u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this->_internal_type(), target); } - // required string name = 2; - if (cached_has_bits & 0x00000002u) { + // optional string updatedName = 2; + if (cached_has_bits & 0x00000001u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->_internal_updatedname().data(), static_cast(this->_internal_updatedname().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.GroupUpdateInfoChangeMessage.updatedName"); target = stream->WriteStringMaybeAliased( - 2, this->_internal_name(), target); + 2, this->_internal_updatedname(), target); } - // optional string profilePicture = 3; + // optional uint32 updatedExpiration = 3; if (cached_has_bits & 0x00000004u) { - target = stream->WriteStringMaybeAliased( - 3, this->_internal_profilepicture(), target); - } - - // optional bytes profileKey = 4; - if (cached_has_bits & 0x00000008u) { - target = stream->WriteBytesMaybeAliased( - 4, this->_internal_profilekey(), target); - } - - // optional bool isApproved = 5; - if (cached_has_bits & 0x00000010u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_isapproved(), target); - } - - // optional bool isBlocked = 6; - if (cached_has_bits & 0x00000020u) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(6, this->_internal_isblocked(), target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_updatedexpiration(), target); } - // optional bool didApproveMe = 7; - if (cached_has_bits & 0x00000040u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(7, this->_internal_didapproveme(), target); + // required bytes adminSignature = 4; + if (cached_has_bits & 0x00000002u) { + target = stream->WriteBytesMaybeAliased( + 4, this->_internal_adminsignature(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ConfigurationMessage.Contact) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateInfoChangeMessage) return target; } -size_t ConfigurationMessage_Contact::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.ConfigurationMessage.Contact) +size_t GroupUpdateInfoChangeMessage::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.GroupUpdateInfoChangeMessage) size_t total_size = 0; - if (_internal_has_publickey()) { - // required bytes publicKey = 1; + if (_internal_has_adminsignature()) { + // required bytes adminSignature = 4; total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_publickey()); + this->_internal_adminsignature()); } - if (_internal_has_name()) { - // required string name = 2; + if (_internal_has_type()) { + // required .SessionProtos.GroupUpdateInfoChangeMessage.Type type = 1; total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); } return total_size; } -size_t ConfigurationMessage_Contact::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ConfigurationMessage.Contact) +size_t GroupUpdateInfoChangeMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.GroupUpdateInfoChangeMessage) size_t total_size = 0; - if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. - // required bytes publicKey = 1; + if (((_impl_._has_bits_[0] & 0x0000000a) ^ 0x0000000a) == 0) { // All required fields are present. + // required bytes adminSignature = 4; total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_publickey()); + this->_internal_adminsignature()); - // required string name = 2; + // required .SessionProtos.GroupUpdateInfoChangeMessage.Type type = 1; total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); } else { total_size += RequiredFieldsByteSizeFallback(); @@ -9305,373 +9800,254 @@ size_t ConfigurationMessage_Contact::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + // optional string updatedName = 2; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000007cu) { - // optional string profilePicture = 3; - if (cached_has_bits & 0x00000004u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_profilepicture()); - } + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_updatedname()); + } - // optional bytes profileKey = 4; - if (cached_has_bits & 0x00000008u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_profilekey()); - } + // optional uint32 updatedExpiration = 3; + if (cached_has_bits & 0x00000004u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_updatedexpiration()); + } - // optional bool isApproved = 5; - if (cached_has_bits & 0x00000010u) { - total_size += 1 + 1; - } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} - // optional bool isBlocked = 6; - if (cached_has_bits & 0x00000020u) { - total_size += 1 + 1; - } - - // optional bool didApproveMe = 7; - if (cached_has_bits & 0x00000040u) { - total_size += 1 + 1; - } - - } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); - } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GroupUpdateInfoChangeMessage::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + GroupUpdateInfoChangeMessage::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GroupUpdateInfoChangeMessage::GetClassData() const { return &_class_data_; } -void ConfigurationMessage_Contact::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} -void ConfigurationMessage_Contact::MergeFrom(const ConfigurationMessage_Contact& from) { - ConfigurationMessage_Contact* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ConfigurationMessage.Contact) +void GroupUpdateInfoChangeMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.GroupUpdateInfoChangeMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x0000007fu) { + if (cached_has_bits & 0x0000000fu) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_publickey(from._internal_publickey()); + _this->_internal_set_updatedname(from._internal_updatedname()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_name(from._internal_name()); + _this->_internal_set_adminsignature(from._internal_adminsignature()); } if (cached_has_bits & 0x00000004u) { - _this->_internal_set_profilepicture(from._internal_profilepicture()); + _this->_impl_.updatedexpiration_ = from._impl_.updatedexpiration_; } if (cached_has_bits & 0x00000008u) { - _this->_internal_set_profilekey(from._internal_profilekey()); - } - if (cached_has_bits & 0x00000010u) { - _this->_impl_.isapproved_ = from._impl_.isapproved_; - } - if (cached_has_bits & 0x00000020u) { - _this->_impl_.isblocked_ = from._impl_.isblocked_; - } - if (cached_has_bits & 0x00000040u) { - _this->_impl_.didapproveme_ = from._impl_.didapproveme_; + _this->_impl_.type_ = from._impl_.type_; } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void ConfigurationMessage_Contact::CopyFrom(const ConfigurationMessage_Contact& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ConfigurationMessage.Contact) +void GroupUpdateInfoChangeMessage::CopyFrom(const GroupUpdateInfoChangeMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.GroupUpdateInfoChangeMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool ConfigurationMessage_Contact::IsInitialized() const { +bool GroupUpdateInfoChangeMessage::IsInitialized() const { if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; return true; } -void ConfigurationMessage_Contact::InternalSwap(ConfigurationMessage_Contact* other) { +void GroupUpdateInfoChangeMessage::InternalSwap(GroupUpdateInfoChangeMessage* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.publickey_, lhs_arena, - &other->_impl_.publickey_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.name_, lhs_arena, - &other->_impl_.name_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.profilepicture_, lhs_arena, - &other->_impl_.profilepicture_, rhs_arena + &_impl_.updatedname_, lhs_arena, + &other->_impl_.updatedname_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.profilekey_, lhs_arena, - &other->_impl_.profilekey_, rhs_arena + &_impl_.adminsignature_, lhs_arena, + &other->_impl_.adminsignature_, rhs_arena ); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(ConfigurationMessage_Contact, _impl_.didapproveme_) - + sizeof(ConfigurationMessage_Contact::_impl_.didapproveme_) - - PROTOBUF_FIELD_OFFSET(ConfigurationMessage_Contact, _impl_.isapproved_)>( - reinterpret_cast(&_impl_.isapproved_), - reinterpret_cast(&other->_impl_.isapproved_)); + swap(_impl_.updatedexpiration_, other->_impl_.updatedexpiration_); + swap(_impl_.type_, other->_impl_.type_); } -std::string ConfigurationMessage_Contact::GetTypeName() const { - return "SessionProtos.ConfigurationMessage.Contact"; +::PROTOBUF_NAMESPACE_ID::Metadata GroupUpdateInfoChangeMessage::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[21]); } - // =================================================================== -class ConfigurationMessage::_Internal { +class GroupUpdateMemberChangeMessage::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_displayname(HasBits* has_bits) { - (*has_bits)[0] |= 1u; + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_type(HasBits* has_bits) { + (*has_bits)[0] |= 4u; } - static void set_has_profilepicture(HasBits* has_bits) { + static void set_has_historyshared(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static void set_has_profilekey(HasBits* has_bits) { - (*has_bits)[0] |= 4u; + static void set_has_adminsignature(HasBits* has_bits) { + (*has_bits)[0] |= 1u; } - static const ::SessionProtos::ProConfig& proconfig(const ConfigurationMessage* msg); - static void set_has_proconfig(HasBits* has_bits) { - (*has_bits)[0] |= 8u; + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x00000005) ^ 0x00000005) != 0; } }; -const ::SessionProtos::ProConfig& -ConfigurationMessage::_Internal::proconfig(const ConfigurationMessage* msg) { - return *msg->_impl_.proconfig_; -} -ConfigurationMessage::ConfigurationMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, +GroupUpdateMemberChangeMessage::GroupUpdateMemberChangeMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.ConfigurationMessage) + // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdateMemberChangeMessage) } -ConfigurationMessage::ConfigurationMessage(const ConfigurationMessage& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - ConfigurationMessage* const _this = this; (void)_this; +GroupUpdateMemberChangeMessage::GroupUpdateMemberChangeMessage(const GroupUpdateMemberChangeMessage& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + GroupUpdateMemberChangeMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.closedgroups_){from._impl_.closedgroups_} - , decltype(_impl_.opengroups_){from._impl_.opengroups_} - , decltype(_impl_.contacts_){from._impl_.contacts_} - , decltype(_impl_.displayname_){} - , decltype(_impl_.profilepicture_){} - , decltype(_impl_.profilekey_){} - , decltype(_impl_.proconfig_){nullptr}}; + , decltype(_impl_.membersessionids_){from._impl_.membersessionids_} + , decltype(_impl_.adminsignature_){} + , decltype(_impl_.historyshared_){} + , decltype(_impl_.type_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.displayname_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.displayname_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_displayname()) { - _this->_impl_.displayname_.Set(from._internal_displayname(), - _this->GetArenaForAllocation()); - } - _impl_.profilepicture_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilepicture_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_profilepicture()) { - _this->_impl_.profilepicture_.Set(from._internal_profilepicture(), - _this->GetArenaForAllocation()); - } - _impl_.profilekey_.InitDefault(); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.adminsignature_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilekey_.Set("", GetArenaForAllocation()); + _impl_.adminsignature_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_profilekey()) { - _this->_impl_.profilekey_.Set(from._internal_profilekey(), + if (from._internal_has_adminsignature()) { + _this->_impl_.adminsignature_.Set(from._internal_adminsignature(), _this->GetArenaForAllocation()); } - if (from._internal_has_proconfig()) { - _this->_impl_.proconfig_ = new ::SessionProtos::ProConfig(*from._impl_.proconfig_); - } - // @@protoc_insertion_point(copy_constructor:SessionProtos.ConfigurationMessage) + ::memcpy(&_impl_.historyshared_, &from._impl_.historyshared_, + static_cast(reinterpret_cast(&_impl_.type_) - + reinterpret_cast(&_impl_.historyshared_)) + sizeof(_impl_.type_)); + // @@protoc_insertion_point(copy_constructor:SessionProtos.GroupUpdateMemberChangeMessage) } -inline void ConfigurationMessage::SharedCtor( +inline void GroupUpdateMemberChangeMessage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.closedgroups_){arena} - , decltype(_impl_.opengroups_){arena} - , decltype(_impl_.contacts_){arena} - , decltype(_impl_.displayname_){} - , decltype(_impl_.profilepicture_){} - , decltype(_impl_.profilekey_){} - , decltype(_impl_.proconfig_){nullptr} + , decltype(_impl_.membersessionids_){arena} + , decltype(_impl_.adminsignature_){} + , decltype(_impl_.historyshared_){false} + , decltype(_impl_.type_){1} }; - _impl_.displayname_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.displayname_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilepicture_.InitDefault(); + _impl_.adminsignature_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilepicture_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilekey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilekey_.Set("", GetArenaForAllocation()); + _impl_.adminsignature_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -ConfigurationMessage::~ConfigurationMessage() { - // @@protoc_insertion_point(destructor:SessionProtos.ConfigurationMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +GroupUpdateMemberChangeMessage::~GroupUpdateMemberChangeMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateMemberChangeMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void ConfigurationMessage::SharedDtor() { +inline void GroupUpdateMemberChangeMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.closedgroups_.~RepeatedPtrField(); - _impl_.opengroups_.~RepeatedPtrField(); - _impl_.contacts_.~RepeatedPtrField(); - _impl_.displayname_.Destroy(); - _impl_.profilepicture_.Destroy(); - _impl_.profilekey_.Destroy(); - if (this != internal_default_instance()) delete _impl_.proconfig_; + _impl_.membersessionids_.~RepeatedPtrField(); + _impl_.adminsignature_.Destroy(); } -void ConfigurationMessage::SetCachedSize(int size) const { +void GroupUpdateMemberChangeMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void ConfigurationMessage::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.ConfigurationMessage) +void GroupUpdateMemberChangeMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.GroupUpdateMemberChangeMessage) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.closedgroups_.Clear(); - _impl_.opengroups_.Clear(); - _impl_.contacts_.Clear(); + _impl_.membersessionids_.Clear(); cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { - if (cached_has_bits & 0x00000001u) { - _impl_.displayname_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000002u) { - _impl_.profilepicture_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000004u) { - _impl_.profilekey_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000008u) { - GOOGLE_DCHECK(_impl_.proconfig_ != nullptr); - _impl_.proconfig_->Clear(); - } + if (cached_has_bits & 0x00000001u) { + _impl_.adminsignature_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000006u) { + _impl_.historyshared_ = false; + _impl_.type_ = 1; } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* ConfigurationMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* GroupUpdateMemberChangeMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // repeated .SessionProtos.ConfigurationMessage.ClosedGroup closedGroups = 1; + // required .SessionProtos.GroupUpdateMemberChangeMessage.Type type = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_closedgroups(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + if (PROTOBUF_PREDICT_TRUE(::SessionProtos::GroupUpdateMemberChangeMessage_Type_IsValid(val))) { + _internal_set_type(static_cast<::SessionProtos::GroupUpdateMemberChangeMessage_Type>(val)); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields()); + } } else goto handle_unusual; continue; - // repeated string openGroups = 2; + // repeated string memberSessionIds = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr -= 1; do { ptr += 1; - auto str = _internal_add_opengroups(); + auto str = _internal_add_membersessionids(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds"); + #endif // !NDEBUG if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); } else goto handle_unusual; continue; - // optional string displayName = 3; + // optional bool historyShared = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_displayname(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _Internal::set_has_historyshared(&has_bits); + _impl_.historyshared_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else goto handle_unusual; continue; - // optional string profilePicture = 4; + // required bytes adminSignature = 4; case 4: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { - auto str = _internal_mutable_profilepicture(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional bytes profileKey = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { - auto str = _internal_mutable_profilekey(); + auto str = _internal_mutable_adminsignature(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // repeated .SessionProtos.ConfigurationMessage.Contact contacts = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_contacts(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr)); - } else - goto handle_unusual; - continue; - // optional .SessionProtos.ProConfig proConfig = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { - ptr = ctx->ParseMessage(_internal_mutable_proconfig(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; default: goto handle_unusual; } // switch @@ -9683,7 +10059,7 @@ const char* ConfigurationMessage::_InternalParse(const char* ptr, ::_pbi::ParseC } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -9696,816 +10072,335 @@ const char* ConfigurationMessage::_InternalParse(const char* ptr, ::_pbi::ParseC #undef CHK_ } -uint8_t* ConfigurationMessage::_InternalSerialize( +uint8_t* GroupUpdateMemberChangeMessage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ConfigurationMessage) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.GroupUpdateMemberChangeMessage) uint32_t cached_has_bits = 0; (void) cached_has_bits; - // repeated .SessionProtos.ConfigurationMessage.ClosedGroup closedGroups = 1; - for (unsigned i = 0, - n = static_cast(this->_internal_closedgroups_size()); i < n; i++) { - const auto& repfield = this->_internal_closedgroups(i); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream); + cached_has_bits = _impl_._has_bits_[0]; + // required .SessionProtos.GroupUpdateMemberChangeMessage.Type type = 1; + if (cached_has_bits & 0x00000004u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this->_internal_type(), target); } - // repeated string openGroups = 2; - for (int i = 0, n = this->_internal_opengroups_size(); i < n; i++) { - const auto& s = this->_internal_opengroups(i); + // repeated string memberSessionIds = 2; + for (int i = 0, n = this->_internal_membersessionids_size(); i < n; i++) { + const auto& s = this->_internal_membersessionids(i); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + s.data(), static_cast(s.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds"); target = stream->WriteString(2, s, target); } - cached_has_bits = _impl_._has_bits_[0]; - // optional string displayName = 3; - if (cached_has_bits & 0x00000001u) { - target = stream->WriteStringMaybeAliased( - 3, this->_internal_displayname(), target); - } - - // optional string profilePicture = 4; + // optional bool historyShared = 3; if (cached_has_bits & 0x00000002u) { - target = stream->WriteStringMaybeAliased( - 4, this->_internal_profilepicture(), target); + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_historyshared(), target); } - // optional bytes profileKey = 5; - if (cached_has_bits & 0x00000004u) { + // required bytes adminSignature = 4; + if (cached_has_bits & 0x00000001u) { target = stream->WriteBytesMaybeAliased( - 5, this->_internal_profilekey(), target); + 4, this->_internal_adminsignature(), target); } - // repeated .SessionProtos.ConfigurationMessage.Contact contacts = 6; - for (unsigned i = 0, - n = static_cast(this->_internal_contacts_size()); i < n; i++) { - const auto& repfield = this->_internal_contacts(i); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(6, repfield, repfield.GetCachedSize(), target, stream); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateMemberChangeMessage) + return target; +} - // optional .SessionProtos.ProConfig proConfig = 7; - if (cached_has_bits & 0x00000008u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(7, _Internal::proconfig(this), - _Internal::proconfig(this).GetCachedSize(), target, stream); +size_t GroupUpdateMemberChangeMessage::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.GroupUpdateMemberChangeMessage) + size_t total_size = 0; + + if (_internal_has_adminsignature()) { + // required bytes adminSignature = 4; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_adminsignature()); } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + if (_internal_has_type()) { + // required .SessionProtos.GroupUpdateMemberChangeMessage.Type type = 1; + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ConfigurationMessage) - return target; -} -size_t ConfigurationMessage::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ConfigurationMessage) + return total_size; +} +size_t GroupUpdateMemberChangeMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.GroupUpdateMemberChangeMessage) size_t total_size = 0; + if (((_impl_._has_bits_[0] & 0x00000005) ^ 0x00000005) == 0) { // All required fields are present. + // required bytes adminSignature = 4; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_adminsignature()); + + // required .SessionProtos.GroupUpdateMemberChangeMessage.Type type = 1; + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); + + } else { + total_size += RequiredFieldsByteSizeFallback(); + } uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // repeated .SessionProtos.ConfigurationMessage.ClosedGroup closedGroups = 1; - total_size += 1UL * this->_internal_closedgroups_size(); - for (const auto& msg : this->_impl_.closedgroups_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // repeated string openGroups = 2; + // repeated string memberSessionIds = 2; total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.opengroups_.size()); - for (int i = 0, n = _impl_.opengroups_.size(); i < n; i++) { + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.membersessionids_.size()); + for (int i = 0, n = _impl_.membersessionids_.size(); i < n; i++) { total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - _impl_.opengroups_.Get(i)); - } - - // repeated .SessionProtos.ConfigurationMessage.Contact contacts = 6; - total_size += 1UL * this->_internal_contacts_size(); - for (const auto& msg : this->_impl_.contacts_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + _impl_.membersessionids_.Get(i)); } + // optional bool historyShared = 3; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { - // optional string displayName = 3; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_displayname()); - } - - // optional string profilePicture = 4; - if (cached_has_bits & 0x00000002u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_profilepicture()); - } - - // optional bytes profileKey = 5; - if (cached_has_bits & 0x00000004u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_profilekey()); - } - - // optional .SessionProtos.ProConfig proConfig = 7; - if (cached_has_bits & 0x00000008u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.proconfig_); - } - - } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + if (cached_has_bits & 0x00000002u) { + total_size += 1 + 1; } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} -void ConfigurationMessage::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void ConfigurationMessage::MergeFrom(const ConfigurationMessage& from) { - ConfigurationMessage* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ConfigurationMessage) +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GroupUpdateMemberChangeMessage::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + GroupUpdateMemberChangeMessage::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GroupUpdateMemberChangeMessage::GetClassData() const { return &_class_data_; } + + +void GroupUpdateMemberChangeMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.GroupUpdateMemberChangeMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.closedgroups_.MergeFrom(from._impl_.closedgroups_); - _this->_impl_.opengroups_.MergeFrom(from._impl_.opengroups_); - _this->_impl_.contacts_.MergeFrom(from._impl_.contacts_); + _this->_impl_.membersessionids_.MergeFrom(from._impl_.membersessionids_); cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { + if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_displayname(from._internal_displayname()); + _this->_internal_set_adminsignature(from._internal_adminsignature()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_profilepicture(from._internal_profilepicture()); + _this->_impl_.historyshared_ = from._impl_.historyshared_; } if (cached_has_bits & 0x00000004u) { - _this->_internal_set_profilekey(from._internal_profilekey()); - } - if (cached_has_bits & 0x00000008u) { - _this->_internal_mutable_proconfig()->::SessionProtos::ProConfig::MergeFrom( - from._internal_proconfig()); + _this->_impl_.type_ = from._impl_.type_; } + _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void ConfigurationMessage::CopyFrom(const ConfigurationMessage& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ConfigurationMessage) +void GroupUpdateMemberChangeMessage::CopyFrom(const GroupUpdateMemberChangeMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.GroupUpdateMemberChangeMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool ConfigurationMessage::IsInitialized() const { - if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.closedgroups_)) - return false; - if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.contacts_)) - return false; - if (_internal_has_proconfig()) { - if (!_impl_.proconfig_->IsInitialized()) return false; - } +bool GroupUpdateMemberChangeMessage::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; return true; } -void ConfigurationMessage::InternalSwap(ConfigurationMessage* other) { +void GroupUpdateMemberChangeMessage::InternalSwap(GroupUpdateMemberChangeMessage* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.closedgroups_.InternalSwap(&other->_impl_.closedgroups_); - _impl_.opengroups_.InternalSwap(&other->_impl_.opengroups_); - _impl_.contacts_.InternalSwap(&other->_impl_.contacts_); + _impl_.membersessionids_.InternalSwap(&other->_impl_.membersessionids_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.displayname_, lhs_arena, - &other->_impl_.displayname_, rhs_arena + &_impl_.adminsignature_, lhs_arena, + &other->_impl_.adminsignature_, rhs_arena ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.profilepicture_, lhs_arena, - &other->_impl_.profilepicture_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.profilekey_, lhs_arena, - &other->_impl_.profilekey_, rhs_arena - ); - swap(_impl_.proconfig_, other->_impl_.proconfig_); + swap(_impl_.historyshared_, other->_impl_.historyshared_); + swap(_impl_.type_, other->_impl_.type_); } -std::string ConfigurationMessage::GetTypeName() const { - return "SessionProtos.ConfigurationMessage"; +::PROTOBUF_NAMESPACE_ID::Metadata GroupUpdateMemberChangeMessage::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[22]); } - // =================================================================== -class ReceiptMessage::_Internal { +class GroupUpdateMemberLeftMessage::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_type(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } - static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0; - } }; -ReceiptMessage::ReceiptMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, +GroupUpdateMemberLeftMessage::GroupUpdateMemberLeftMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.ReceiptMessage) + : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase(arena, is_message_owned) { + // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdateMemberLeftMessage) } -ReceiptMessage::ReceiptMessage(const ReceiptMessage& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - ReceiptMessage* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_._has_bits_){from._impl_._has_bits_} - , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.timestamp_){from._impl_.timestamp_} - , decltype(_impl_.type_){}}; - - _internal_metadata_.MergeFrom(from._internal_metadata_); - _this->_impl_.type_ = from._impl_.type_; - // @@protoc_insertion_point(copy_constructor:SessionProtos.ReceiptMessage) +GroupUpdateMemberLeftMessage::GroupUpdateMemberLeftMessage(const GroupUpdateMemberLeftMessage& from) + : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase() { + GroupUpdateMemberLeftMessage* const _this = this; (void)_this; + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:SessionProtos.GroupUpdateMemberLeftMessage) } -inline void ReceiptMessage::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_._has_bits_){} - , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.timestamp_){arena} - , decltype(_impl_.type_){0} - }; -} -ReceiptMessage::~ReceiptMessage() { - // @@protoc_insertion_point(destructor:SessionProtos.ReceiptMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { - (void)arena; - return; - } - SharedDtor(); -} -inline void ReceiptMessage::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.timestamp_.~RepeatedField(); -} -void ReceiptMessage::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} -void ReceiptMessage::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.ReceiptMessage) - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GroupUpdateMemberLeftMessage::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl, + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl, +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GroupUpdateMemberLeftMessage::GetClassData() const { return &_class_data_; } - _impl_.timestamp_.Clear(); - _impl_.type_ = 0; - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); -} -const char* ReceiptMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - _Internal::HasBits has_bits{}; - while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); - switch (tag >> 3) { - // required .SessionProtos.ReceiptMessage.Type type = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - if (PROTOBUF_PREDICT_TRUE(::SessionProtos::ReceiptMessage_Type_IsValid(val))) { - _internal_set_type(static_cast<::SessionProtos::ReceiptMessage_Type>(val)); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields()); - } - } else - goto handle_unusual; - continue; - // repeated uint64 timestamp = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { - ptr -= 1; - do { - ptr += 1; - _internal_add_timestamp(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr)); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<16>(ptr)); - } else if (static_cast(tag) == 18) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_timestamp(), ptr, ctx); - CHK_(ptr); - } else - goto handle_unusual; - continue; - default: - goto handle_unusual; - } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields(), - ptr, ctx); - CHK_(ptr != nullptr); - } // while -message_done: - _impl_._has_bits_.Or(has_bits); - return ptr; -failure: - ptr = nullptr; - goto message_done; -#undef CHK_ -} -uint8_t* ReceiptMessage::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ReceiptMessage) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - cached_has_bits = _impl_._has_bits_[0]; - // required .SessionProtos.ReceiptMessage.Type type = 1; - if (cached_has_bits & 0x00000001u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 1, this->_internal_type(), target); - } - // repeated uint64 timestamp = 2; - for (int i = 0, n = this->_internal_timestamp_size(); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_timestamp(i), target); - } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); - } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ReceiptMessage) - return target; -} -size_t ReceiptMessage::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ReceiptMessage) - size_t total_size = 0; +::PROTOBUF_NAMESPACE_ID::Metadata GroupUpdateMemberLeftMessage::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[23]); +} - // required .SessionProtos.ReceiptMessage.Type type = 1; - if (_internal_has_type()) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); - } - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; +// =================================================================== - // repeated uint64 timestamp = 2; - { - size_t data_size = ::_pbi::WireFormatLite:: - UInt64Size(this->_impl_.timestamp_); - total_size += 1 * - ::_pbi::FromIntSize(this->_internal_timestamp_size()); - total_size += data_size; - } +class GroupUpdateMemberLeftNotificationMessage::_Internal { + public: +}; - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); - } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; +GroupUpdateMemberLeftNotificationMessage::GroupUpdateMemberLeftNotificationMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase(arena, is_message_owned) { + // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdateMemberLeftNotificationMessage) } - -void ReceiptMessage::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); +GroupUpdateMemberLeftNotificationMessage::GroupUpdateMemberLeftNotificationMessage(const GroupUpdateMemberLeftNotificationMessage& from) + : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase() { + GroupUpdateMemberLeftNotificationMessage* const _this = this; (void)_this; + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:SessionProtos.GroupUpdateMemberLeftNotificationMessage) } -void ReceiptMessage::MergeFrom(const ReceiptMessage& from) { - ReceiptMessage* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ReceiptMessage) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - _this->_impl_.timestamp_.MergeFrom(from._impl_.timestamp_); - if (from._internal_has_type()) { - _this->_internal_set_type(from._internal_type()); - } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); -} -void ReceiptMessage::CopyFrom(const ReceiptMessage& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ReceiptMessage) - if (&from == this) return; - Clear(); - MergeFrom(from); -} -bool ReceiptMessage::IsInitialized() const { - if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; - return true; -} -void ReceiptMessage::InternalSwap(ReceiptMessage* other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.timestamp_.InternalSwap(&other->_impl_.timestamp_); - swap(_impl_.type_, other->_impl_.type_); -} +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GroupUpdateMemberLeftNotificationMessage::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl, + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl, +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GroupUpdateMemberLeftNotificationMessage::GetClassData() const { return &_class_data_; } + + + -std::string ReceiptMessage::GetTypeName() const { - return "SessionProtos.ReceiptMessage"; -} + +::PROTOBUF_NAMESPACE_ID::Metadata GroupUpdateMemberLeftNotificationMessage::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[24]); +} + // =================================================================== -class AttachmentPointer::_Internal { +class GroupUpdateInviteResponseMessage::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_id(HasBits* has_bits) { - (*has_bits)[0] |= 128u; - } - static void set_has_contenttype(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_isapproved(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_key(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } - static void set_has_size(HasBits* has_bits) { - (*has_bits)[0] |= 256u; - } - static void set_has_thumbnail(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } - static void set_has_digest(HasBits* has_bits) { - (*has_bits)[0] |= 8u; - } - static void set_has_filename(HasBits* has_bits) { - (*has_bits)[0] |= 16u; - } - static void set_has_flags(HasBits* has_bits) { - (*has_bits)[0] |= 512u; - } - static void set_has_width(HasBits* has_bits) { - (*has_bits)[0] |= 1024u; - } - static void set_has_height(HasBits* has_bits) { - (*has_bits)[0] |= 2048u; - } - static void set_has_caption(HasBits* has_bits) { - (*has_bits)[0] |= 32u; - } - static void set_has_url(HasBits* has_bits) { - (*has_bits)[0] |= 64u; - } static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000080) ^ 0x00000080) != 0; + return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0; } }; -AttachmentPointer::AttachmentPointer(::PROTOBUF_NAMESPACE_ID::Arena* arena, +GroupUpdateInviteResponseMessage::GroupUpdateInviteResponseMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.AttachmentPointer) + // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdateInviteResponseMessage) } -AttachmentPointer::AttachmentPointer(const AttachmentPointer& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - AttachmentPointer* const _this = this; (void)_this; +GroupUpdateInviteResponseMessage::GroupUpdateInviteResponseMessage(const GroupUpdateInviteResponseMessage& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + GroupUpdateInviteResponseMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.contenttype_){} - , decltype(_impl_.key_){} - , decltype(_impl_.thumbnail_){} - , decltype(_impl_.digest_){} - , decltype(_impl_.filename_){} - , decltype(_impl_.caption_){} - , decltype(_impl_.url_){} - , decltype(_impl_.id_){} - , decltype(_impl_.size_){} - , decltype(_impl_.flags_){} - , decltype(_impl_.width_){} - , decltype(_impl_.height_){}}; + , decltype(_impl_.isapproved_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.contenttype_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.contenttype_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_contenttype()) { - _this->_impl_.contenttype_.Set(from._internal_contenttype(), - _this->GetArenaForAllocation()); - } - _impl_.key_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.key_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_key()) { - _this->_impl_.key_.Set(from._internal_key(), - _this->GetArenaForAllocation()); - } - _impl_.thumbnail_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.thumbnail_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_thumbnail()) { - _this->_impl_.thumbnail_.Set(from._internal_thumbnail(), - _this->GetArenaForAllocation()); - } - _impl_.digest_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.digest_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_digest()) { - _this->_impl_.digest_.Set(from._internal_digest(), - _this->GetArenaForAllocation()); - } - _impl_.filename_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.filename_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_filename()) { - _this->_impl_.filename_.Set(from._internal_filename(), - _this->GetArenaForAllocation()); - } - _impl_.caption_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.caption_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_caption()) { - _this->_impl_.caption_.Set(from._internal_caption(), - _this->GetArenaForAllocation()); - } - _impl_.url_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.url_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_url()) { - _this->_impl_.url_.Set(from._internal_url(), - _this->GetArenaForAllocation()); - } - ::memcpy(&_impl_.id_, &from._impl_.id_, - static_cast(reinterpret_cast(&_impl_.height_) - - reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.height_)); - // @@protoc_insertion_point(copy_constructor:SessionProtos.AttachmentPointer) + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_impl_.isapproved_ = from._impl_.isapproved_; + // @@protoc_insertion_point(copy_constructor:SessionProtos.GroupUpdateInviteResponseMessage) } -inline void AttachmentPointer::SharedCtor( +inline void GroupUpdateInviteResponseMessage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} - , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.contenttype_){} - , decltype(_impl_.key_){} - , decltype(_impl_.thumbnail_){} - , decltype(_impl_.digest_){} - , decltype(_impl_.filename_){} - , decltype(_impl_.caption_){} - , decltype(_impl_.url_){} - , decltype(_impl_.id_){uint64_t{0u}} - , decltype(_impl_.size_){0u} - , decltype(_impl_.flags_){0u} - , decltype(_impl_.width_){0u} - , decltype(_impl_.height_){0u} - }; - _impl_.contenttype_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.contenttype_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.key_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.key_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.thumbnail_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.thumbnail_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.digest_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.digest_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.filename_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.filename_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.caption_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.caption_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.url_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.url_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -} - -AttachmentPointer::~AttachmentPointer() { - // @@protoc_insertion_point(destructor:SessionProtos.AttachmentPointer) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { - (void)arena; - return; - } - SharedDtor(); -} - -inline void AttachmentPointer::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.contenttype_.Destroy(); - _impl_.key_.Destroy(); - _impl_.thumbnail_.Destroy(); - _impl_.digest_.Destroy(); - _impl_.filename_.Destroy(); - _impl_.caption_.Destroy(); - _impl_.url_.Destroy(); -} - -void AttachmentPointer::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} - -void AttachmentPointer::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.AttachmentPointer) - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000007fu) { - if (cached_has_bits & 0x00000001u) { - _impl_.contenttype_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000002u) { - _impl_.key_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000004u) { - _impl_.thumbnail_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000008u) { - _impl_.digest_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000010u) { - _impl_.filename_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000020u) { - _impl_.caption_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000040u) { - _impl_.url_.ClearNonDefaultToEmpty(); - } - } - _impl_.id_ = uint64_t{0u}; - if (cached_has_bits & 0x00000f00u) { - ::memset(&_impl_.size_, 0, static_cast( - reinterpret_cast(&_impl_.height_) - - reinterpret_cast(&_impl_.size_)) + sizeof(_impl_.height_)); - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); -} - -const char* AttachmentPointer::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - _Internal::HasBits has_bits{}; - while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); - switch (tag >> 3) { - // required fixed64 id = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 9)) { - _Internal::set_has_id(&has_bits); - _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); - ptr += sizeof(uint64_t); - } else - goto handle_unusual; - continue; - // optional string contentType = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_contenttype(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional bytes key = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_key(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional uint32 size = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - _Internal::set_has_size(&has_bits); - _impl_.size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional bytes thumbnail = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { - auto str = _internal_mutable_thumbnail(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional bytes digest = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { - auto str = _internal_mutable_digest(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional string fileName = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { - auto str = _internal_mutable_filename(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional uint32 flags = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 64)) { - _Internal::set_has_flags(&has_bits); - _impl_.flags_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional uint32 width = 9; - case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 72)) { - _Internal::set_has_width(&has_bits); - _impl_.width_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional uint32 height = 10; - case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 80)) { - _Internal::set_has_height(&has_bits); - _impl_.height_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional string caption = 11; - case 11: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 90)) { - auto str = _internal_mutable_caption(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional string url = 101; - case 101: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { - auto str = _internal_mutable_url(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.isapproved_){false} + }; +} + +GroupUpdateInviteResponseMessage::~GroupUpdateInviteResponseMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateInviteResponseMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void GroupUpdateInviteResponseMessage::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void GroupUpdateInviteResponseMessage::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void GroupUpdateInviteResponseMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.GroupUpdateInviteResponseMessage) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.isapproved_ = false; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* GroupUpdateInviteResponseMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // required bool isApproved = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _Internal::set_has_isapproved(&has_bits); + _impl_.isapproved_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else goto handle_unusual; @@ -10521,7 +10416,7 @@ const char* AttachmentPointer::_InternalParse(const char* ptr, ::_pbi::ParseCont } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -10534,441 +10429,224 @@ const char* AttachmentPointer::_InternalParse(const char* ptr, ::_pbi::ParseCont #undef CHK_ } -uint8_t* AttachmentPointer::_InternalSerialize( +uint8_t* GroupUpdateInviteResponseMessage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.AttachmentPointer) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.GroupUpdateInviteResponseMessage) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required fixed64 id = 1; - if (cached_has_bits & 0x00000080u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteFixed64ToArray(1, this->_internal_id(), target); - } - - // optional string contentType = 2; + // required bool isApproved = 1; if (cached_has_bits & 0x00000001u) { - target = stream->WriteStringMaybeAliased( - 2, this->_internal_contenttype(), target); - } - - // optional bytes key = 3; - if (cached_has_bits & 0x00000002u) { - target = stream->WriteBytesMaybeAliased( - 3, this->_internal_key(), target); - } - - // optional uint32 size = 4; - if (cached_has_bits & 0x00000100u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_size(), target); - } - - // optional bytes thumbnail = 5; - if (cached_has_bits & 0x00000004u) { - target = stream->WriteBytesMaybeAliased( - 5, this->_internal_thumbnail(), target); - } - - // optional bytes digest = 6; - if (cached_has_bits & 0x00000008u) { - target = stream->WriteBytesMaybeAliased( - 6, this->_internal_digest(), target); - } - - // optional string fileName = 7; - if (cached_has_bits & 0x00000010u) { - target = stream->WriteStringMaybeAliased( - 7, this->_internal_filename(), target); - } - - // optional uint32 flags = 8; - if (cached_has_bits & 0x00000200u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(8, this->_internal_flags(), target); - } - - // optional uint32 width = 9; - if (cached_has_bits & 0x00000400u) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(9, this->_internal_width(), target); - } - - // optional uint32 height = 10; - if (cached_has_bits & 0x00000800u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(10, this->_internal_height(), target); - } - - // optional string caption = 11; - if (cached_has_bits & 0x00000020u) { - target = stream->WriteStringMaybeAliased( - 11, this->_internal_caption(), target); - } - - // optional string url = 101; - if (cached_has_bits & 0x00000040u) { - target = stream->WriteStringMaybeAliased( - 101, this->_internal_url(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); - } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.AttachmentPointer) - return target; -} - -size_t AttachmentPointer::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.AttachmentPointer) - size_t total_size = 0; - - // required fixed64 id = 1; - if (_internal_has_id()) { - total_size += 1 + 8; - } - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000007fu) { - // optional string contentType = 2; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_contenttype()); - } - - // optional bytes key = 3; - if (cached_has_bits & 0x00000002u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_key()); - } - - // optional bytes thumbnail = 5; - if (cached_has_bits & 0x00000004u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_thumbnail()); - } - - // optional bytes digest = 6; - if (cached_has_bits & 0x00000008u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_digest()); - } - - // optional string fileName = 7; - if (cached_has_bits & 0x00000010u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_filename()); - } - - // optional string caption = 11; - if (cached_has_bits & 0x00000020u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_caption()); - } - - // optional string url = 101; - if (cached_has_bits & 0x00000040u) { - total_size += 2 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_url()); - } - - } - if (cached_has_bits & 0x00000f00u) { - // optional uint32 size = 4; - if (cached_has_bits & 0x00000100u) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_size()); - } - - // optional uint32 flags = 8; - if (cached_has_bits & 0x00000200u) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); - } - - // optional uint32 width = 9; - if (cached_has_bits & 0x00000400u) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_width()); - } - - // optional uint32 height = 10; - if (cached_has_bits & 0x00000800u) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_height()); - } - - } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); - } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void AttachmentPointer::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} - -void AttachmentPointer::MergeFrom(const AttachmentPointer& from) { - AttachmentPointer* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.AttachmentPointer) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x000000ffu) { - if (cached_has_bits & 0x00000001u) { - _this->_internal_set_contenttype(from._internal_contenttype()); - } - if (cached_has_bits & 0x00000002u) { - _this->_internal_set_key(from._internal_key()); - } - if (cached_has_bits & 0x00000004u) { - _this->_internal_set_thumbnail(from._internal_thumbnail()); - } - if (cached_has_bits & 0x00000008u) { - _this->_internal_set_digest(from._internal_digest()); - } - if (cached_has_bits & 0x00000010u) { - _this->_internal_set_filename(from._internal_filename()); - } - if (cached_has_bits & 0x00000020u) { - _this->_internal_set_caption(from._internal_caption()); - } - if (cached_has_bits & 0x00000040u) { - _this->_internal_set_url(from._internal_url()); - } - if (cached_has_bits & 0x00000080u) { - _this->_impl_.id_ = from._impl_.id_; - } - _this->_impl_._has_bits_[0] |= cached_has_bits; - } - if (cached_has_bits & 0x00000f00u) { - if (cached_has_bits & 0x00000100u) { - _this->_impl_.size_ = from._impl_.size_; - } - if (cached_has_bits & 0x00000200u) { - _this->_impl_.flags_ = from._impl_.flags_; - } - if (cached_has_bits & 0x00000400u) { - _this->_impl_.width_ = from._impl_.width_; - } - if (cached_has_bits & 0x00000800u) { - _this->_impl_.height_ = from._impl_.height_; - } - _this->_impl_._has_bits_[0] |= cached_has_bits; + target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_isapproved(), target); } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateInviteResponseMessage) + return target; } -void AttachmentPointer::CopyFrom(const AttachmentPointer& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.AttachmentPointer) +size_t GroupUpdateInviteResponseMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.GroupUpdateInviteResponseMessage) + size_t total_size = 0; + + // required bool isApproved = 1; + if (_internal_has_isapproved()) { + total_size += 1 + 1; + } + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GroupUpdateInviteResponseMessage::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + GroupUpdateInviteResponseMessage::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GroupUpdateInviteResponseMessage::GetClassData() const { return &_class_data_; } + + +void GroupUpdateInviteResponseMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.GroupUpdateInviteResponseMessage) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_has_isapproved()) { + _this->_internal_set_isapproved(from._internal_isapproved()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void GroupUpdateInviteResponseMessage::CopyFrom(const GroupUpdateInviteResponseMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.GroupUpdateInviteResponseMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool AttachmentPointer::IsInitialized() const { +bool GroupUpdateInviteResponseMessage::IsInitialized() const { if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; return true; } -void AttachmentPointer::InternalSwap(AttachmentPointer* other) { +void GroupUpdateInviteResponseMessage::InternalSwap(GroupUpdateInviteResponseMessage* other) { using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.contenttype_, lhs_arena, - &other->_impl_.contenttype_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.key_, lhs_arena, - &other->_impl_.key_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.thumbnail_, lhs_arena, - &other->_impl_.thumbnail_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.digest_, lhs_arena, - &other->_impl_.digest_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.filename_, lhs_arena, - &other->_impl_.filename_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.caption_, lhs_arena, - &other->_impl_.caption_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.url_, lhs_arena, - &other->_impl_.url_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(AttachmentPointer, _impl_.height_) - + sizeof(AttachmentPointer::_impl_.height_) - - PROTOBUF_FIELD_OFFSET(AttachmentPointer, _impl_.id_)>( - reinterpret_cast(&_impl_.id_), - reinterpret_cast(&other->_impl_.id_)); + swap(_impl_.isapproved_, other->_impl_.isapproved_); } -std::string AttachmentPointer::GetTypeName() const { - return "SessionProtos.AttachmentPointer"; +::PROTOBUF_NAMESPACE_ID::Metadata GroupUpdateInviteResponseMessage::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[25]); } - // =================================================================== -class SharedConfigMessage::_Internal { +class GroupUpdateDeleteMemberContentMessage::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_kind(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } - static void set_has_seqno(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } - static void set_has_data(HasBits* has_bits) { + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_adminsignature(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000007) ^ 0x00000007) != 0; - } }; -SharedConfigMessage::SharedConfigMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, +GroupUpdateDeleteMemberContentMessage::GroupUpdateDeleteMemberContentMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.SharedConfigMessage) + // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdateDeleteMemberContentMessage) } -SharedConfigMessage::SharedConfigMessage(const SharedConfigMessage& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - SharedConfigMessage* const _this = this; (void)_this; +GroupUpdateDeleteMemberContentMessage::GroupUpdateDeleteMemberContentMessage(const GroupUpdateDeleteMemberContentMessage& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + GroupUpdateDeleteMemberContentMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.data_){} - , decltype(_impl_.seqno_){} - , decltype(_impl_.kind_){}}; + , decltype(_impl_.membersessionids_){from._impl_.membersessionids_} + , decltype(_impl_.messagehashes_){from._impl_.messagehashes_} + , decltype(_impl_.adminsignature_){}}; - _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.data_.InitDefault(); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.adminsignature_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.data_.Set("", GetArenaForAllocation()); + _impl_.adminsignature_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_data()) { - _this->_impl_.data_.Set(from._internal_data(), + if (from._internal_has_adminsignature()) { + _this->_impl_.adminsignature_.Set(from._internal_adminsignature(), _this->GetArenaForAllocation()); } - ::memcpy(&_impl_.seqno_, &from._impl_.seqno_, - static_cast(reinterpret_cast(&_impl_.kind_) - - reinterpret_cast(&_impl_.seqno_)) + sizeof(_impl_.kind_)); - // @@protoc_insertion_point(copy_constructor:SessionProtos.SharedConfigMessage) + // @@protoc_insertion_point(copy_constructor:SessionProtos.GroupUpdateDeleteMemberContentMessage) } -inline void SharedConfigMessage::SharedCtor( +inline void GroupUpdateDeleteMemberContentMessage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.data_){} - , decltype(_impl_.seqno_){int64_t{0}} - , decltype(_impl_.kind_){1} + , decltype(_impl_.membersessionids_){arena} + , decltype(_impl_.messagehashes_){arena} + , decltype(_impl_.adminsignature_){} }; - _impl_.data_.InitDefault(); + _impl_.adminsignature_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.data_.Set("", GetArenaForAllocation()); + _impl_.adminsignature_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -SharedConfigMessage::~SharedConfigMessage() { - // @@protoc_insertion_point(destructor:SessionProtos.SharedConfigMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena()) { +GroupUpdateDeleteMemberContentMessage::~GroupUpdateDeleteMemberContentMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateDeleteMemberContentMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; } SharedDtor(); } -inline void SharedConfigMessage::SharedDtor() { +inline void GroupUpdateDeleteMemberContentMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.data_.Destroy(); + _impl_.membersessionids_.~RepeatedPtrField(); + _impl_.messagehashes_.~RepeatedPtrField(); + _impl_.adminsignature_.Destroy(); } -void SharedConfigMessage::SetCachedSize(int size) const { +void GroupUpdateDeleteMemberContentMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void SharedConfigMessage::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.SharedConfigMessage) +void GroupUpdateDeleteMemberContentMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.GroupUpdateDeleteMemberContentMessage) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + _impl_.membersessionids_.Clear(); + _impl_.messagehashes_.Clear(); cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000001u) { - _impl_.data_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000006u) { - _impl_.seqno_ = int64_t{0}; - _impl_.kind_ = 1; + _impl_.adminsignature_.ClearNonDefaultToEmpty(); } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* SharedConfigMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* GroupUpdateDeleteMemberContentMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required .SessionProtos.SharedConfigMessage.Kind kind = 1; + // repeated string memberSessionIds = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - if (PROTOBUF_PREDICT_TRUE(::SessionProtos::SharedConfigMessage_Kind_IsValid(val))) { - _internal_set_kind(static_cast<::SessionProtos::SharedConfigMessage_Kind>(val)); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields()); - } + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr -= 1; + do { + ptr += 1; + auto str = _internal_add_membersessionids(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds"); + #endif // !NDEBUG + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); } else goto handle_unusual; continue; - // required int64 seqno = 2; + // repeated string messageHashes = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { - _Internal::set_has_seqno(&has_bits); - _impl_.seqno_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr -= 1; + do { + ptr += 1; + auto str = _internal_add_messagehashes(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + #ifndef NDEBUG + ::_pbi::VerifyUTF8(str, "SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes"); + #endif // !NDEBUG + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); } else goto handle_unusual; continue; - // required bytes data = 3; + // optional bytes adminSignature = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_data(); + auto str = _internal_mutable_adminsignature(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else @@ -10985,7 +10663,7 @@ const char* SharedConfigMessage::_InternalParse(const char* ptr, ::_pbi::ParseCo } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields(), + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -10998,156 +10676,136 @@ const char* SharedConfigMessage::_InternalParse(const char* ptr, ::_pbi::ParseCo #undef CHK_ } -uint8_t* SharedConfigMessage::_InternalSerialize( +uint8_t* GroupUpdateDeleteMemberContentMessage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.SharedConfigMessage) + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.GroupUpdateDeleteMemberContentMessage) uint32_t cached_has_bits = 0; (void) cached_has_bits; - cached_has_bits = _impl_._has_bits_[0]; - // required .SessionProtos.SharedConfigMessage.Kind kind = 1; - if (cached_has_bits & 0x00000004u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 1, this->_internal_kind(), target); - } - - // required int64 seqno = 2; - if (cached_has_bits & 0x00000002u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_seqno(), target); + // repeated string memberSessionIds = 1; + for (int i = 0, n = this->_internal_membersessionids_size(); i < n; i++) { + const auto& s = this->_internal_membersessionids(i); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + s.data(), static_cast(s.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds"); + target = stream->WriteString(1, s, target); + } + + // repeated string messageHashes = 2; + for (int i = 0, n = this->_internal_messagehashes_size(); i < n; i++) { + const auto& s = this->_internal_messagehashes(i); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + s.data(), static_cast(s.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes"); + target = stream->WriteString(2, s, target); } - // required bytes data = 3; + cached_has_bits = _impl_._has_bits_[0]; + // optional bytes adminSignature = 3; if (cached_has_bits & 0x00000001u) { target = stream->WriteBytesMaybeAliased( - 3, this->_internal_data(), target); + 3, this->_internal_adminsignature(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), - static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.SharedConfigMessage) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateDeleteMemberContentMessage) return target; } -size_t SharedConfigMessage::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.SharedConfigMessage) +size_t GroupUpdateDeleteMemberContentMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.GroupUpdateDeleteMemberContentMessage) size_t total_size = 0; - if (_internal_has_data()) { - // required bytes data = 3; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_data()); - } + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; - if (_internal_has_seqno()) { - // required int64 seqno = 2; - total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_seqno()); + // repeated string memberSessionIds = 1; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.membersessionids_.size()); + for (int i = 0, n = _impl_.membersessionids_.size(); i < n; i++) { + total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + _impl_.membersessionids_.Get(i)); } - if (_internal_has_kind()) { - // required .SessionProtos.SharedConfigMessage.Kind kind = 1; - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + // repeated string messageHashes = 2; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.messagehashes_.size()); + for (int i = 0, n = _impl_.messagehashes_.size(); i < n; i++) { + total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + _impl_.messagehashes_.Get(i)); } - return total_size; -} -size_t SharedConfigMessage::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.SharedConfigMessage) - size_t total_size = 0; - - if (((_impl_._has_bits_[0] & 0x00000007) ^ 0x00000007) == 0) { // All required fields are present. - // required bytes data = 3; + // optional bytes adminSignature = 3; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_data()); - - // required int64 seqno = 2; - total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_seqno()); - - // required .SessionProtos.SharedConfigMessage.Kind kind = 1; - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); - - } else { - total_size += RequiredFieldsByteSizeFallback(); + this->_internal_adminsignature()); } - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); - } - int cached_size = ::_pbi::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -void SharedConfigMessage::CheckTypeAndMergeFrom( - const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( - &from)); -} +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GroupUpdateDeleteMemberContentMessage::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + GroupUpdateDeleteMemberContentMessage::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GroupUpdateDeleteMemberContentMessage::GetClassData() const { return &_class_data_; } -void SharedConfigMessage::MergeFrom(const SharedConfigMessage& from) { - SharedConfigMessage* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.SharedConfigMessage) + +void GroupUpdateDeleteMemberContentMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.GroupUpdateDeleteMemberContentMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; - cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - if (cached_has_bits & 0x00000001u) { - _this->_internal_set_data(from._internal_data()); - } - if (cached_has_bits & 0x00000002u) { - _this->_impl_.seqno_ = from._impl_.seqno_; - } - if (cached_has_bits & 0x00000004u) { - _this->_impl_.kind_ = from._impl_.kind_; - } - _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_impl_.membersessionids_.MergeFrom(from._impl_.membersessionids_); + _this->_impl_.messagehashes_.MergeFrom(from._impl_.messagehashes_); + if (from._internal_has_adminsignature()) { + _this->_internal_set_adminsignature(from._internal_adminsignature()); } - _this->_internal_metadata_.MergeFrom(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void SharedConfigMessage::CopyFrom(const SharedConfigMessage& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.SharedConfigMessage) +void GroupUpdateDeleteMemberContentMessage::CopyFrom(const GroupUpdateDeleteMemberContentMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.GroupUpdateDeleteMemberContentMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool SharedConfigMessage::IsInitialized() const { - if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; +bool GroupUpdateDeleteMemberContentMessage::IsInitialized() const { return true; } -void SharedConfigMessage::InternalSwap(SharedConfigMessage* other) { +void GroupUpdateDeleteMemberContentMessage::InternalSwap(GroupUpdateDeleteMemberContentMessage* other) { using std::swap; auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.membersessionids_.InternalSwap(&other->_impl_.membersessionids_); + _impl_.messagehashes_.InternalSwap(&other->_impl_.messagehashes_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.data_, lhs_arena, - &other->_impl_.data_, rhs_arena + &_impl_.adminsignature_, lhs_arena, + &other->_impl_.adminsignature_, rhs_arena ); - swap(_impl_.seqno_, other->_impl_.seqno_); - swap(_impl_.kind_, other->_impl_.kind_); } -std::string SharedConfigMessage::GetTypeName() const { - return "SessionProtos.SharedConfigMessage"; +::PROTOBUF_NAMESPACE_ID::Metadata GroupUpdateDeleteMemberContentMessage::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[26]); } - // @@protoc_insertion_point(namespace_scope) } // namespace SessionProtos PROTOBUF_NAMESPACE_OPEN @@ -11167,18 +10825,6 @@ template<> PROTOBUF_NOINLINE ::SessionProtos::MessageRequestResponse* Arena::CreateMaybeMessage< ::SessionProtos::MessageRequestResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::SessionProtos::MessageRequestResponse >(arena); } -template<> PROTOBUF_NOINLINE ::SessionProtos::ProProof* -Arena::CreateMaybeMessage< ::SessionProtos::ProProof >(Arena* arena) { - return Arena::CreateMessageInternal< ::SessionProtos::ProProof >(arena); -} -template<> PROTOBUF_NOINLINE ::SessionProtos::ProConfig* -Arena::CreateMaybeMessage< ::SessionProtos::ProConfig >(Arena* arena) { - return Arena::CreateMessageInternal< ::SessionProtos::ProConfig >(arena); -} -template<> PROTOBUF_NOINLINE ::SessionProtos::ProMessageConfig* -Arena::CreateMaybeMessage< ::SessionProtos::ProMessageConfig >(Arena* arena) { - return Arena::CreateMessageInternal< ::SessionProtos::ProMessageConfig >(arena); -} template<> PROTOBUF_NOINLINE ::SessionProtos::Content* Arena::CreateMaybeMessage< ::SessionProtos::Content >(Arena* arena) { return Arena::CreateMessageInternal< ::SessionProtos::Content >(arena); @@ -11219,30 +10865,10 @@ template<> PROTOBUF_NOINLINE ::SessionProtos::DataMessage_OpenGroupInvitation* Arena::CreateMaybeMessage< ::SessionProtos::DataMessage_OpenGroupInvitation >(Arena* arena) { return Arena::CreateMessageInternal< ::SessionProtos::DataMessage_OpenGroupInvitation >(arena); } -template<> PROTOBUF_NOINLINE ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper* -Arena::CreateMaybeMessage< ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper >(Arena* arena) { - return Arena::CreateMessageInternal< ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper >(arena); -} -template<> PROTOBUF_NOINLINE ::SessionProtos::DataMessage_ClosedGroupControlMessage* -Arena::CreateMaybeMessage< ::SessionProtos::DataMessage_ClosedGroupControlMessage >(Arena* arena) { - return Arena::CreateMessageInternal< ::SessionProtos::DataMessage_ClosedGroupControlMessage >(arena); -} template<> PROTOBUF_NOINLINE ::SessionProtos::DataMessage* Arena::CreateMaybeMessage< ::SessionProtos::DataMessage >(Arena* arena) { return Arena::CreateMessageInternal< ::SessionProtos::DataMessage >(arena); } -template<> PROTOBUF_NOINLINE ::SessionProtos::ConfigurationMessage_ClosedGroup* -Arena::CreateMaybeMessage< ::SessionProtos::ConfigurationMessage_ClosedGroup >(Arena* arena) { - return Arena::CreateMessageInternal< ::SessionProtos::ConfigurationMessage_ClosedGroup >(arena); -} -template<> PROTOBUF_NOINLINE ::SessionProtos::ConfigurationMessage_Contact* -Arena::CreateMaybeMessage< ::SessionProtos::ConfigurationMessage_Contact >(Arena* arena) { - return Arena::CreateMessageInternal< ::SessionProtos::ConfigurationMessage_Contact >(arena); -} -template<> PROTOBUF_NOINLINE ::SessionProtos::ConfigurationMessage* -Arena::CreateMaybeMessage< ::SessionProtos::ConfigurationMessage >(Arena* arena) { - return Arena::CreateMessageInternal< ::SessionProtos::ConfigurationMessage >(arena); -} template<> PROTOBUF_NOINLINE ::SessionProtos::ReceiptMessage* Arena::CreateMaybeMessage< ::SessionProtos::ReceiptMessage >(Arena* arena) { return Arena::CreateMessageInternal< ::SessionProtos::ReceiptMessage >(arena); @@ -11255,6 +10881,42 @@ template<> PROTOBUF_NOINLINE ::SessionProtos::SharedConfigMessage* Arena::CreateMaybeMessage< ::SessionProtos::SharedConfigMessage >(Arena* arena) { return Arena::CreateMessageInternal< ::SessionProtos::SharedConfigMessage >(arena); } +template<> PROTOBUF_NOINLINE ::SessionProtos::GroupUpdateMessage* +Arena::CreateMaybeMessage< ::SessionProtos::GroupUpdateMessage >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::GroupUpdateMessage >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::GroupUpdateInviteMessage* +Arena::CreateMaybeMessage< ::SessionProtos::GroupUpdateInviteMessage >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::GroupUpdateInviteMessage >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::GroupUpdatePromoteMessage* +Arena::CreateMaybeMessage< ::SessionProtos::GroupUpdatePromoteMessage >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::GroupUpdatePromoteMessage >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::GroupUpdateInfoChangeMessage* +Arena::CreateMaybeMessage< ::SessionProtos::GroupUpdateInfoChangeMessage >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::GroupUpdateInfoChangeMessage >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::GroupUpdateMemberChangeMessage* +Arena::CreateMaybeMessage< ::SessionProtos::GroupUpdateMemberChangeMessage >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::GroupUpdateMemberChangeMessage >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::GroupUpdateMemberLeftMessage* +Arena::CreateMaybeMessage< ::SessionProtos::GroupUpdateMemberLeftMessage >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::GroupUpdateMemberLeftMessage >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* +Arena::CreateMaybeMessage< ::SessionProtos::GroupUpdateMemberLeftNotificationMessage >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::GroupUpdateMemberLeftNotificationMessage >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::GroupUpdateInviteResponseMessage* +Arena::CreateMaybeMessage< ::SessionProtos::GroupUpdateInviteResponseMessage >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::GroupUpdateInviteResponseMessage >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::GroupUpdateDeleteMemberContentMessage* +Arena::CreateMaybeMessage< ::SessionProtos::GroupUpdateDeleteMemberContentMessage >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::GroupUpdateDeleteMemberContentMessage >(arena); +} PROTOBUF_NAMESPACE_CLOSE // @@protoc_insertion_point(global_scope) diff --git a/proto/SessionProtos.pb.h b/proto/SessionProtos.pb.h index ee1c8b5e..faea8749 100644 --- a/proto/SessionProtos.pb.h +++ b/proto/SessionProtos.pb.h @@ -23,12 +23,15 @@ #include #include #include +#include #include #include -#include +#include +#include #include // IWYU pragma: export #include // IWYU pragma: export -#include +#include +#include // @@protoc_insertion_point(includes) #include #define PROTOBUF_INTERNAL_EXPORT_SessionProtos_2eproto @@ -42,6 +45,7 @@ PROTOBUF_NAMESPACE_CLOSE struct TableStruct_SessionProtos_2eproto { static const uint32_t offsets[]; }; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_SessionProtos_2eproto; namespace SessionProtos { class AttachmentPointer; struct AttachmentPointerDefaultTypeInternal; @@ -49,15 +53,6 @@ extern AttachmentPointerDefaultTypeInternal _AttachmentPointer_default_instance_ class CallMessage; struct CallMessageDefaultTypeInternal; extern CallMessageDefaultTypeInternal _CallMessage_default_instance_; -class ConfigurationMessage; -struct ConfigurationMessageDefaultTypeInternal; -extern ConfigurationMessageDefaultTypeInternal _ConfigurationMessage_default_instance_; -class ConfigurationMessage_ClosedGroup; -struct ConfigurationMessage_ClosedGroupDefaultTypeInternal; -extern ConfigurationMessage_ClosedGroupDefaultTypeInternal _ConfigurationMessage_ClosedGroup_default_instance_; -class ConfigurationMessage_Contact; -struct ConfigurationMessage_ContactDefaultTypeInternal; -extern ConfigurationMessage_ContactDefaultTypeInternal _ConfigurationMessage_Contact_default_instance_; class Content; struct ContentDefaultTypeInternal; extern ContentDefaultTypeInternal _Content_default_instance_; @@ -67,12 +62,6 @@ extern DataExtractionNotificationDefaultTypeInternal _DataExtractionNotification class DataMessage; struct DataMessageDefaultTypeInternal; extern DataMessageDefaultTypeInternal _DataMessage_default_instance_; -class DataMessage_ClosedGroupControlMessage; -struct DataMessage_ClosedGroupControlMessageDefaultTypeInternal; -extern DataMessage_ClosedGroupControlMessageDefaultTypeInternal _DataMessage_ClosedGroupControlMessage_default_instance_; -class DataMessage_ClosedGroupControlMessage_KeyPairWrapper; -struct DataMessage_ClosedGroupControlMessage_KeyPairWrapperDefaultTypeInternal; -extern DataMessage_ClosedGroupControlMessage_KeyPairWrapperDefaultTypeInternal _DataMessage_ClosedGroupControlMessage_KeyPairWrapper_default_instance_; class DataMessage_OpenGroupInvitation; struct DataMessage_OpenGroupInvitationDefaultTypeInternal; extern DataMessage_OpenGroupInvitationDefaultTypeInternal _DataMessage_OpenGroupInvitation_default_instance_; @@ -91,6 +80,33 @@ extern DataMessage_ReactionDefaultTypeInternal _DataMessage_Reaction_default_ins class Envelope; struct EnvelopeDefaultTypeInternal; extern EnvelopeDefaultTypeInternal _Envelope_default_instance_; +class GroupUpdateDeleteMemberContentMessage; +struct GroupUpdateDeleteMemberContentMessageDefaultTypeInternal; +extern GroupUpdateDeleteMemberContentMessageDefaultTypeInternal _GroupUpdateDeleteMemberContentMessage_default_instance_; +class GroupUpdateInfoChangeMessage; +struct GroupUpdateInfoChangeMessageDefaultTypeInternal; +extern GroupUpdateInfoChangeMessageDefaultTypeInternal _GroupUpdateInfoChangeMessage_default_instance_; +class GroupUpdateInviteMessage; +struct GroupUpdateInviteMessageDefaultTypeInternal; +extern GroupUpdateInviteMessageDefaultTypeInternal _GroupUpdateInviteMessage_default_instance_; +class GroupUpdateInviteResponseMessage; +struct GroupUpdateInviteResponseMessageDefaultTypeInternal; +extern GroupUpdateInviteResponseMessageDefaultTypeInternal _GroupUpdateInviteResponseMessage_default_instance_; +class GroupUpdateMemberChangeMessage; +struct GroupUpdateMemberChangeMessageDefaultTypeInternal; +extern GroupUpdateMemberChangeMessageDefaultTypeInternal _GroupUpdateMemberChangeMessage_default_instance_; +class GroupUpdateMemberLeftMessage; +struct GroupUpdateMemberLeftMessageDefaultTypeInternal; +extern GroupUpdateMemberLeftMessageDefaultTypeInternal _GroupUpdateMemberLeftMessage_default_instance_; +class GroupUpdateMemberLeftNotificationMessage; +struct GroupUpdateMemberLeftNotificationMessageDefaultTypeInternal; +extern GroupUpdateMemberLeftNotificationMessageDefaultTypeInternal _GroupUpdateMemberLeftNotificationMessage_default_instance_; +class GroupUpdateMessage; +struct GroupUpdateMessageDefaultTypeInternal; +extern GroupUpdateMessageDefaultTypeInternal _GroupUpdateMessage_default_instance_; +class GroupUpdatePromoteMessage; +struct GroupUpdatePromoteMessageDefaultTypeInternal; +extern GroupUpdatePromoteMessageDefaultTypeInternal _GroupUpdatePromoteMessage_default_instance_; class KeyPair; struct KeyPairDefaultTypeInternal; extern KeyPairDefaultTypeInternal _KeyPair_default_instance_; @@ -100,15 +116,6 @@ extern LokiProfileDefaultTypeInternal _LokiProfile_default_instance_; class MessageRequestResponse; struct MessageRequestResponseDefaultTypeInternal; extern MessageRequestResponseDefaultTypeInternal _MessageRequestResponse_default_instance_; -class ProConfig; -struct ProConfigDefaultTypeInternal; -extern ProConfigDefaultTypeInternal _ProConfig_default_instance_; -class ProMessageConfig; -struct ProMessageConfigDefaultTypeInternal; -extern ProMessageConfigDefaultTypeInternal _ProMessageConfig_default_instance_; -class ProProof; -struct ProProofDefaultTypeInternal; -extern ProProofDefaultTypeInternal _ProProof_default_instance_; class ReceiptMessage; struct ReceiptMessageDefaultTypeInternal; extern ReceiptMessageDefaultTypeInternal _ReceiptMessage_default_instance_; @@ -125,26 +132,27 @@ extern UnsendRequestDefaultTypeInternal _UnsendRequest_default_instance_; PROTOBUF_NAMESPACE_OPEN template<> ::SessionProtos::AttachmentPointer* Arena::CreateMaybeMessage<::SessionProtos::AttachmentPointer>(Arena*); template<> ::SessionProtos::CallMessage* Arena::CreateMaybeMessage<::SessionProtos::CallMessage>(Arena*); -template<> ::SessionProtos::ConfigurationMessage* Arena::CreateMaybeMessage<::SessionProtos::ConfigurationMessage>(Arena*); -template<> ::SessionProtos::ConfigurationMessage_ClosedGroup* Arena::CreateMaybeMessage<::SessionProtos::ConfigurationMessage_ClosedGroup>(Arena*); -template<> ::SessionProtos::ConfigurationMessage_Contact* Arena::CreateMaybeMessage<::SessionProtos::ConfigurationMessage_Contact>(Arena*); template<> ::SessionProtos::Content* Arena::CreateMaybeMessage<::SessionProtos::Content>(Arena*); template<> ::SessionProtos::DataExtractionNotification* Arena::CreateMaybeMessage<::SessionProtos::DataExtractionNotification>(Arena*); template<> ::SessionProtos::DataMessage* Arena::CreateMaybeMessage<::SessionProtos::DataMessage>(Arena*); -template<> ::SessionProtos::DataMessage_ClosedGroupControlMessage* Arena::CreateMaybeMessage<::SessionProtos::DataMessage_ClosedGroupControlMessage>(Arena*); -template<> ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper* Arena::CreateMaybeMessage<::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper>(Arena*); template<> ::SessionProtos::DataMessage_OpenGroupInvitation* Arena::CreateMaybeMessage<::SessionProtos::DataMessage_OpenGroupInvitation>(Arena*); template<> ::SessionProtos::DataMessage_Preview* Arena::CreateMaybeMessage<::SessionProtos::DataMessage_Preview>(Arena*); template<> ::SessionProtos::DataMessage_Quote* Arena::CreateMaybeMessage<::SessionProtos::DataMessage_Quote>(Arena*); template<> ::SessionProtos::DataMessage_Quote_QuotedAttachment* Arena::CreateMaybeMessage<::SessionProtos::DataMessage_Quote_QuotedAttachment>(Arena*); template<> ::SessionProtos::DataMessage_Reaction* Arena::CreateMaybeMessage<::SessionProtos::DataMessage_Reaction>(Arena*); template<> ::SessionProtos::Envelope* Arena::CreateMaybeMessage<::SessionProtos::Envelope>(Arena*); +template<> ::SessionProtos::GroupUpdateDeleteMemberContentMessage* Arena::CreateMaybeMessage<::SessionProtos::GroupUpdateDeleteMemberContentMessage>(Arena*); +template<> ::SessionProtos::GroupUpdateInfoChangeMessage* Arena::CreateMaybeMessage<::SessionProtos::GroupUpdateInfoChangeMessage>(Arena*); +template<> ::SessionProtos::GroupUpdateInviteMessage* Arena::CreateMaybeMessage<::SessionProtos::GroupUpdateInviteMessage>(Arena*); +template<> ::SessionProtos::GroupUpdateInviteResponseMessage* Arena::CreateMaybeMessage<::SessionProtos::GroupUpdateInviteResponseMessage>(Arena*); +template<> ::SessionProtos::GroupUpdateMemberChangeMessage* Arena::CreateMaybeMessage<::SessionProtos::GroupUpdateMemberChangeMessage>(Arena*); +template<> ::SessionProtos::GroupUpdateMemberLeftMessage* Arena::CreateMaybeMessage<::SessionProtos::GroupUpdateMemberLeftMessage>(Arena*); +template<> ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* Arena::CreateMaybeMessage<::SessionProtos::GroupUpdateMemberLeftNotificationMessage>(Arena*); +template<> ::SessionProtos::GroupUpdateMessage* Arena::CreateMaybeMessage<::SessionProtos::GroupUpdateMessage>(Arena*); +template<> ::SessionProtos::GroupUpdatePromoteMessage* Arena::CreateMaybeMessage<::SessionProtos::GroupUpdatePromoteMessage>(Arena*); template<> ::SessionProtos::KeyPair* Arena::CreateMaybeMessage<::SessionProtos::KeyPair>(Arena*); template<> ::SessionProtos::LokiProfile* Arena::CreateMaybeMessage<::SessionProtos::LokiProfile>(Arena*); template<> ::SessionProtos::MessageRequestResponse* Arena::CreateMaybeMessage<::SessionProtos::MessageRequestResponse>(Arena*); -template<> ::SessionProtos::ProConfig* Arena::CreateMaybeMessage<::SessionProtos::ProConfig>(Arena*); -template<> ::SessionProtos::ProMessageConfig* Arena::CreateMaybeMessage<::SessionProtos::ProMessageConfig>(Arena*); -template<> ::SessionProtos::ProProof* Arena::CreateMaybeMessage<::SessionProtos::ProProof>(Arena*); template<> ::SessionProtos::ReceiptMessage* Arena::CreateMaybeMessage<::SessionProtos::ReceiptMessage>(Arena*); template<> ::SessionProtos::SharedConfigMessage* Arena::CreateMaybeMessage<::SessionProtos::SharedConfigMessage>(Arena*); template<> ::SessionProtos::TypingMessage* Arena::CreateMaybeMessage<::SessionProtos::TypingMessage>(Arena*); @@ -161,16 +169,20 @@ constexpr Envelope_Type Envelope_Type_Type_MIN = Envelope_Type_SESSION_MESSAGE; constexpr Envelope_Type Envelope_Type_Type_MAX = Envelope_Type_CLOSED_GROUP_MESSAGE; constexpr int Envelope_Type_Type_ARRAYSIZE = Envelope_Type_Type_MAX + 1; -const std::string& Envelope_Type_Name(Envelope_Type value); +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Envelope_Type_descriptor(); template inline const std::string& Envelope_Type_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function Envelope_Type_Name."); - return Envelope_Type_Name(static_cast(enum_t_value)); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + Envelope_Type_descriptor(), enum_t_value); +} +inline bool Envelope_Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Envelope_Type* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + Envelope_Type_descriptor(), name, value); } -bool Envelope_Type_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Envelope_Type* value); enum TypingMessage_Action : int { TypingMessage_Action_STARTED = 0, TypingMessage_Action_STOPPED = 1 @@ -180,16 +192,44 @@ constexpr TypingMessage_Action TypingMessage_Action_Action_MIN = TypingMessage_A constexpr TypingMessage_Action TypingMessage_Action_Action_MAX = TypingMessage_Action_STOPPED; constexpr int TypingMessage_Action_Action_ARRAYSIZE = TypingMessage_Action_Action_MAX + 1; -const std::string& TypingMessage_Action_Name(TypingMessage_Action value); +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* TypingMessage_Action_descriptor(); template inline const std::string& TypingMessage_Action_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function TypingMessage_Action_Name."); - return TypingMessage_Action_Name(static_cast(enum_t_value)); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + TypingMessage_Action_descriptor(), enum_t_value); +} +inline bool TypingMessage_Action_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, TypingMessage_Action* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + TypingMessage_Action_descriptor(), name, value); +} +enum Content_ExpirationType : int { + Content_ExpirationType_UNKNOWN = 0, + Content_ExpirationType_DELETE_AFTER_READ = 1, + Content_ExpirationType_DELETE_AFTER_SEND = 2 +}; +bool Content_ExpirationType_IsValid(int value); +constexpr Content_ExpirationType Content_ExpirationType_ExpirationType_MIN = Content_ExpirationType_UNKNOWN; +constexpr Content_ExpirationType Content_ExpirationType_ExpirationType_MAX = Content_ExpirationType_DELETE_AFTER_SEND; +constexpr int Content_ExpirationType_ExpirationType_ARRAYSIZE = Content_ExpirationType_ExpirationType_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Content_ExpirationType_descriptor(); +template +inline const std::string& Content_ExpirationType_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Content_ExpirationType_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + Content_ExpirationType_descriptor(), enum_t_value); +} +inline bool Content_ExpirationType_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Content_ExpirationType* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + Content_ExpirationType_descriptor(), name, value); } -bool TypingMessage_Action_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, TypingMessage_Action* value); enum CallMessage_Type : int { CallMessage_Type_PRE_OFFER = 6, CallMessage_Type_OFFER = 1, @@ -203,16 +243,20 @@ constexpr CallMessage_Type CallMessage_Type_Type_MIN = CallMessage_Type_OFFER; constexpr CallMessage_Type CallMessage_Type_Type_MAX = CallMessage_Type_PRE_OFFER; constexpr int CallMessage_Type_Type_ARRAYSIZE = CallMessage_Type_Type_MAX + 1; -const std::string& CallMessage_Type_Name(CallMessage_Type value); +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* CallMessage_Type_descriptor(); template inline const std::string& CallMessage_Type_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function CallMessage_Type_Name."); - return CallMessage_Type_Name(static_cast(enum_t_value)); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + CallMessage_Type_descriptor(), enum_t_value); +} +inline bool CallMessage_Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, CallMessage_Type* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + CallMessage_Type_descriptor(), name, value); } -bool CallMessage_Type_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, CallMessage_Type* value); enum DataExtractionNotification_Type : int { DataExtractionNotification_Type_SCREENSHOT = 1, DataExtractionNotification_Type_MEDIA_SAVED = 2 @@ -222,16 +266,20 @@ constexpr DataExtractionNotification_Type DataExtractionNotification_Type_Type_M constexpr DataExtractionNotification_Type DataExtractionNotification_Type_Type_MAX = DataExtractionNotification_Type_MEDIA_SAVED; constexpr int DataExtractionNotification_Type_Type_ARRAYSIZE = DataExtractionNotification_Type_Type_MAX + 1; -const std::string& DataExtractionNotification_Type_Name(DataExtractionNotification_Type value); +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataExtractionNotification_Type_descriptor(); template inline const std::string& DataExtractionNotification_Type_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function DataExtractionNotification_Type_Name."); - return DataExtractionNotification_Type_Name(static_cast(enum_t_value)); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + DataExtractionNotification_Type_descriptor(), enum_t_value); +} +inline bool DataExtractionNotification_Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataExtractionNotification_Type* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + DataExtractionNotification_Type_descriptor(), name, value); } -bool DataExtractionNotification_Type_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataExtractionNotification_Type* value); enum DataMessage_Quote_QuotedAttachment_Flags : int { DataMessage_Quote_QuotedAttachment_Flags_VOICE_MESSAGE = 1 }; @@ -240,16 +288,20 @@ constexpr DataMessage_Quote_QuotedAttachment_Flags DataMessage_Quote_QuotedAttac constexpr DataMessage_Quote_QuotedAttachment_Flags DataMessage_Quote_QuotedAttachment_Flags_Flags_MAX = DataMessage_Quote_QuotedAttachment_Flags_VOICE_MESSAGE; constexpr int DataMessage_Quote_QuotedAttachment_Flags_Flags_ARRAYSIZE = DataMessage_Quote_QuotedAttachment_Flags_Flags_MAX + 1; -const std::string& DataMessage_Quote_QuotedAttachment_Flags_Name(DataMessage_Quote_QuotedAttachment_Flags value); +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataMessage_Quote_QuotedAttachment_Flags_descriptor(); template inline const std::string& DataMessage_Quote_QuotedAttachment_Flags_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function DataMessage_Quote_QuotedAttachment_Flags_Name."); - return DataMessage_Quote_QuotedAttachment_Flags_Name(static_cast(enum_t_value)); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + DataMessage_Quote_QuotedAttachment_Flags_descriptor(), enum_t_value); +} +inline bool DataMessage_Quote_QuotedAttachment_Flags_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_Quote_QuotedAttachment_Flags* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + DataMessage_Quote_QuotedAttachment_Flags_descriptor(), name, value); } -bool DataMessage_Quote_QuotedAttachment_Flags_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_Quote_QuotedAttachment_Flags* value); enum DataMessage_Reaction_Action : int { DataMessage_Reaction_Action_REACT = 0, DataMessage_Reaction_Action_REMOVE = 1 @@ -259,40 +311,20 @@ constexpr DataMessage_Reaction_Action DataMessage_Reaction_Action_Action_MIN = D constexpr DataMessage_Reaction_Action DataMessage_Reaction_Action_Action_MAX = DataMessage_Reaction_Action_REMOVE; constexpr int DataMessage_Reaction_Action_Action_ARRAYSIZE = DataMessage_Reaction_Action_Action_MAX + 1; -const std::string& DataMessage_Reaction_Action_Name(DataMessage_Reaction_Action value); +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataMessage_Reaction_Action_descriptor(); template inline const std::string& DataMessage_Reaction_Action_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function DataMessage_Reaction_Action_Name."); - return DataMessage_Reaction_Action_Name(static_cast(enum_t_value)); -} -bool DataMessage_Reaction_Action_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_Reaction_Action* value); -enum DataMessage_ClosedGroupControlMessage_Type : int { - DataMessage_ClosedGroupControlMessage_Type_NEW = 1, - DataMessage_ClosedGroupControlMessage_Type_ENCRYPTION_KEY_PAIR = 3, - DataMessage_ClosedGroupControlMessage_Type_NAME_CHANGE = 4, - DataMessage_ClosedGroupControlMessage_Type_MEMBERS_ADDED = 5, - DataMessage_ClosedGroupControlMessage_Type_MEMBERS_REMOVED = 6, - DataMessage_ClosedGroupControlMessage_Type_MEMBER_LEFT = 7, - DataMessage_ClosedGroupControlMessage_Type_ENCRYPTION_KEY_PAIR_REQUEST = 8 -}; -bool DataMessage_ClosedGroupControlMessage_Type_IsValid(int value); -constexpr DataMessage_ClosedGroupControlMessage_Type DataMessage_ClosedGroupControlMessage_Type_Type_MIN = DataMessage_ClosedGroupControlMessage_Type_NEW; -constexpr DataMessage_ClosedGroupControlMessage_Type DataMessage_ClosedGroupControlMessage_Type_Type_MAX = DataMessage_ClosedGroupControlMessage_Type_ENCRYPTION_KEY_PAIR_REQUEST; -constexpr int DataMessage_ClosedGroupControlMessage_Type_Type_ARRAYSIZE = DataMessage_ClosedGroupControlMessage_Type_Type_MAX + 1; - -const std::string& DataMessage_ClosedGroupControlMessage_Type_Name(DataMessage_ClosedGroupControlMessage_Type value); -template -inline const std::string& DataMessage_ClosedGroupControlMessage_Type_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function DataMessage_ClosedGroupControlMessage_Type_Name."); - return DataMessage_ClosedGroupControlMessage_Type_Name(static_cast(enum_t_value)); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + DataMessage_Reaction_Action_descriptor(), enum_t_value); +} +inline bool DataMessage_Reaction_Action_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_Reaction_Action* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + DataMessage_Reaction_Action_descriptor(), name, value); } -bool DataMessage_ClosedGroupControlMessage_Type_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_ClosedGroupControlMessage_Type* value); enum DataMessage_Flags : int { DataMessage_Flags_EXPIRATION_TIMER_UPDATE = 2 }; @@ -301,16 +333,20 @@ constexpr DataMessage_Flags DataMessage_Flags_Flags_MIN = DataMessage_Flags_EXPI constexpr DataMessage_Flags DataMessage_Flags_Flags_MAX = DataMessage_Flags_EXPIRATION_TIMER_UPDATE; constexpr int DataMessage_Flags_Flags_ARRAYSIZE = DataMessage_Flags_Flags_MAX + 1; -const std::string& DataMessage_Flags_Name(DataMessage_Flags value); +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataMessage_Flags_descriptor(); template inline const std::string& DataMessage_Flags_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function DataMessage_Flags_Name."); - return DataMessage_Flags_Name(static_cast(enum_t_value)); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + DataMessage_Flags_descriptor(), enum_t_value); +} +inline bool DataMessage_Flags_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_Flags* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + DataMessage_Flags_descriptor(), name, value); } -bool DataMessage_Flags_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_Flags* value); enum ReceiptMessage_Type : int { ReceiptMessage_Type_DELIVERY = 0, ReceiptMessage_Type_READ = 1 @@ -320,16 +356,20 @@ constexpr ReceiptMessage_Type ReceiptMessage_Type_Type_MIN = ReceiptMessage_Type constexpr ReceiptMessage_Type ReceiptMessage_Type_Type_MAX = ReceiptMessage_Type_READ; constexpr int ReceiptMessage_Type_Type_ARRAYSIZE = ReceiptMessage_Type_Type_MAX + 1; -const std::string& ReceiptMessage_Type_Name(ReceiptMessage_Type value); +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ReceiptMessage_Type_descriptor(); template inline const std::string& ReceiptMessage_Type_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function ReceiptMessage_Type_Name."); - return ReceiptMessage_Type_Name(static_cast(enum_t_value)); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + ReceiptMessage_Type_descriptor(), enum_t_value); +} +inline bool ReceiptMessage_Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ReceiptMessage_Type* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + ReceiptMessage_Type_descriptor(), name, value); } -bool ReceiptMessage_Type_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ReceiptMessage_Type* value); enum AttachmentPointer_Flags : int { AttachmentPointer_Flags_VOICE_MESSAGE = 1 }; @@ -338,16 +378,20 @@ constexpr AttachmentPointer_Flags AttachmentPointer_Flags_Flags_MIN = Attachment constexpr AttachmentPointer_Flags AttachmentPointer_Flags_Flags_MAX = AttachmentPointer_Flags_VOICE_MESSAGE; constexpr int AttachmentPointer_Flags_Flags_ARRAYSIZE = AttachmentPointer_Flags_Flags_MAX + 1; -const std::string& AttachmentPointer_Flags_Name(AttachmentPointer_Flags value); +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* AttachmentPointer_Flags_descriptor(); template inline const std::string& AttachmentPointer_Flags_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function AttachmentPointer_Flags_Name."); - return AttachmentPointer_Flags_Name(static_cast(enum_t_value)); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + AttachmentPointer_Flags_descriptor(), enum_t_value); +} +inline bool AttachmentPointer_Flags_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, AttachmentPointer_Flags* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + AttachmentPointer_Flags_descriptor(), name, value); } -bool AttachmentPointer_Flags_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, AttachmentPointer_Flags* value); enum SharedConfigMessage_Kind : int { SharedConfigMessage_Kind_USER_PROFILE = 1, SharedConfigMessage_Kind_CONTACTS = 2, @@ -359,20 +403,72 @@ constexpr SharedConfigMessage_Kind SharedConfigMessage_Kind_Kind_MIN = SharedCon constexpr SharedConfigMessage_Kind SharedConfigMessage_Kind_Kind_MAX = SharedConfigMessage_Kind_USER_GROUPS; constexpr int SharedConfigMessage_Kind_Kind_ARRAYSIZE = SharedConfigMessage_Kind_Kind_MAX + 1; -const std::string& SharedConfigMessage_Kind_Name(SharedConfigMessage_Kind value); +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SharedConfigMessage_Kind_descriptor(); template inline const std::string& SharedConfigMessage_Kind_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function SharedConfigMessage_Kind_Name."); - return SharedConfigMessage_Kind_Name(static_cast(enum_t_value)); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + SharedConfigMessage_Kind_descriptor(), enum_t_value); +} +inline bool SharedConfigMessage_Kind_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, SharedConfigMessage_Kind* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + SharedConfigMessage_Kind_descriptor(), name, value); +} +enum GroupUpdateInfoChangeMessage_Type : int { + GroupUpdateInfoChangeMessage_Type_NAME = 1, + GroupUpdateInfoChangeMessage_Type_AVATAR = 2, + GroupUpdateInfoChangeMessage_Type_DISAPPEARING_MESSAGES = 3 +}; +bool GroupUpdateInfoChangeMessage_Type_IsValid(int value); +constexpr GroupUpdateInfoChangeMessage_Type GroupUpdateInfoChangeMessage_Type_Type_MIN = GroupUpdateInfoChangeMessage_Type_NAME; +constexpr GroupUpdateInfoChangeMessage_Type GroupUpdateInfoChangeMessage_Type_Type_MAX = GroupUpdateInfoChangeMessage_Type_DISAPPEARING_MESSAGES; +constexpr int GroupUpdateInfoChangeMessage_Type_Type_ARRAYSIZE = GroupUpdateInfoChangeMessage_Type_Type_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GroupUpdateInfoChangeMessage_Type_descriptor(); +template +inline const std::string& GroupUpdateInfoChangeMessage_Type_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function GroupUpdateInfoChangeMessage_Type_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + GroupUpdateInfoChangeMessage_Type_descriptor(), enum_t_value); +} +inline bool GroupUpdateInfoChangeMessage_Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, GroupUpdateInfoChangeMessage_Type* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + GroupUpdateInfoChangeMessage_Type_descriptor(), name, value); +} +enum GroupUpdateMemberChangeMessage_Type : int { + GroupUpdateMemberChangeMessage_Type_ADDED = 1, + GroupUpdateMemberChangeMessage_Type_REMOVED = 2, + GroupUpdateMemberChangeMessage_Type_PROMOTED = 3 +}; +bool GroupUpdateMemberChangeMessage_Type_IsValid(int value); +constexpr GroupUpdateMemberChangeMessage_Type GroupUpdateMemberChangeMessage_Type_Type_MIN = GroupUpdateMemberChangeMessage_Type_ADDED; +constexpr GroupUpdateMemberChangeMessage_Type GroupUpdateMemberChangeMessage_Type_Type_MAX = GroupUpdateMemberChangeMessage_Type_PROMOTED; +constexpr int GroupUpdateMemberChangeMessage_Type_Type_ARRAYSIZE = GroupUpdateMemberChangeMessage_Type_Type_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GroupUpdateMemberChangeMessage_Type_descriptor(); +template +inline const std::string& GroupUpdateMemberChangeMessage_Type_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function GroupUpdateMemberChangeMessage_Type_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + GroupUpdateMemberChangeMessage_Type_descriptor(), enum_t_value); +} +inline bool GroupUpdateMemberChangeMessage_Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, GroupUpdateMemberChangeMessage_Type* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + GroupUpdateMemberChangeMessage_Type_descriptor(), name, value); } -bool SharedConfigMessage_Kind_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, SharedConfigMessage_Kind* value); // =================================================================== class Envelope final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.Envelope) */ { + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.Envelope) */ { public: inline Envelope() : Envelope(nullptr) {} ~Envelope() override; @@ -402,13 +498,22 @@ class Envelope final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } static const Envelope& default_instance() { return *internal_default_instance(); } @@ -446,9 +551,15 @@ class Envelope final : Envelope* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const Envelope& from); - void MergeFrom(const Envelope& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Envelope& from) { + Envelope::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -461,7 +572,7 @@ class Envelope final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; + void SetCachedSize(int size) const final; void InternalSwap(Envelope* other); private: @@ -474,7 +585,10 @@ class Envelope final : bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; // nested types ---------------------------------------------------- @@ -492,6 +606,10 @@ class Envelope final : Envelope_Type_Type_MAX; static constexpr int Type_ARRAYSIZE = Envelope_Type_Type_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + Type_descriptor() { + return Envelope_Type_descriptor(); + } template static inline const std::string& Type_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -628,7 +746,7 @@ class Envelope final : // ------------------------------------------------------------------- class TypingMessage final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.TypingMessage) */ { + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.TypingMessage) */ { public: inline TypingMessage() : TypingMessage(nullptr) {} ~TypingMessage() override; @@ -658,13 +776,22 @@ class TypingMessage final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } static const TypingMessage& default_instance() { return *internal_default_instance(); } @@ -702,9 +829,15 @@ class TypingMessage final : TypingMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const TypingMessage& from); - void MergeFrom(const TypingMessage& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const TypingMessage& from) { + TypingMessage::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -717,7 +850,7 @@ class TypingMessage final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; + void SetCachedSize(int size) const final; void InternalSwap(TypingMessage* other); private: @@ -730,7 +863,10 @@ class TypingMessage final : bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; // nested types ---------------------------------------------------- @@ -748,6 +884,10 @@ class TypingMessage final : TypingMessage_Action_Action_MAX; static constexpr int Action_ARRAYSIZE = TypingMessage_Action_Action_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + Action_descriptor() { + return TypingMessage_Action_descriptor(); + } template static inline const std::string& Action_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -814,7 +954,7 @@ class TypingMessage final : // ------------------------------------------------------------------- class UnsendRequest final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.UnsendRequest) */ { + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.UnsendRequest) */ { public: inline UnsendRequest() : UnsendRequest(nullptr) {} ~UnsendRequest() override; @@ -844,13 +984,22 @@ class UnsendRequest final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } static const UnsendRequest& default_instance() { return *internal_default_instance(); } @@ -888,9 +1037,15 @@ class UnsendRequest final : UnsendRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const UnsendRequest& from); - void MergeFrom(const UnsendRequest& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const UnsendRequest& from) { + UnsendRequest::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -903,7 +1058,7 @@ class UnsendRequest final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; + void SetCachedSize(int size) const final; void InternalSwap(UnsendRequest* other); private: @@ -916,7 +1071,10 @@ class UnsendRequest final : bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; // nested types ---------------------------------------------------- @@ -979,7 +1137,7 @@ class UnsendRequest final : // ------------------------------------------------------------------- class MessageRequestResponse final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.MessageRequestResponse) */ { + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.MessageRequestResponse) */ { public: inline MessageRequestResponse() : MessageRequestResponse(nullptr) {} ~MessageRequestResponse() override; @@ -1009,13 +1167,22 @@ class MessageRequestResponse final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } static const MessageRequestResponse& default_instance() { return *internal_default_instance(); } @@ -1053,9 +1220,15 @@ class MessageRequestResponse final : MessageRequestResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const MessageRequestResponse& from); - void MergeFrom(const MessageRequestResponse& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const MessageRequestResponse& from) { + MessageRequestResponse::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1068,7 +1241,7 @@ class MessageRequestResponse final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; + void SetCachedSize(int size) const final; void InternalSwap(MessageRequestResponse* other); private: @@ -1081,7 +1254,10 @@ class MessageRequestResponse final : bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; // nested types ---------------------------------------------------- @@ -1160,24 +1336,24 @@ class MessageRequestResponse final : }; // ------------------------------------------------------------------- -class ProProof final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ProProof) */ { +class Content final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.Content) */ { public: - inline ProProof() : ProProof(nullptr) {} - ~ProProof() override; - explicit PROTOBUF_CONSTEXPR ProProof(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline Content() : Content(nullptr) {} + ~Content() override; + explicit PROTOBUF_CONSTEXPR Content(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ProProof(const ProProof& from); - ProProof(ProProof&& from) noexcept - : ProProof() { + Content(const Content& from); + Content(Content&& from) noexcept + : Content() { *this = ::std::move(from); } - inline ProProof& operator=(const ProProof& from) { + inline Content& operator=(const Content& from) { CopyFrom(from); return *this; } - inline ProProof& operator=(ProProof&& from) noexcept { + inline Content& operator=(Content&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1191,27 +1367,36 @@ class ProProof final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const ProProof& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Content& default_instance() { return *internal_default_instance(); } - static inline const ProProof* internal_default_instance() { - return reinterpret_cast( - &_ProProof_default_instance_); + static inline const Content* internal_default_instance() { + return reinterpret_cast( + &_Content_default_instance_); } static constexpr int kIndexInFileMessages = 4; - friend void swap(ProProof& a, ProProof& b) { + friend void swap(Content& a, Content& b) { a.Swap(&b); } - inline void Swap(ProProof* other) { + inline void Swap(Content* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1224,7 +1409,7 @@ class ProProof final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ProProof* other) { + void UnsafeArenaSwap(Content* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1232,12 +1417,18 @@ class ProProof final : // implements Message ---------------------------------------------- - ProProof* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Content* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Content& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Content& from) { + Content::MergeImpl(*this, from); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const ProProof& from); - void MergeFrom(const ProProof& from); + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1250,154 +1441,301 @@ class ProProof final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(ProProof* other); + void SetCachedSize(int size) const final; + void InternalSwap(Content* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.ProProof"; + return "SessionProtos.Content"; } protected: - explicit ProProof(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit Content(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; // nested types ---------------------------------------------------- + typedef Content_ExpirationType ExpirationType; + static constexpr ExpirationType UNKNOWN = + Content_ExpirationType_UNKNOWN; + static constexpr ExpirationType DELETE_AFTER_READ = + Content_ExpirationType_DELETE_AFTER_READ; + static constexpr ExpirationType DELETE_AFTER_SEND = + Content_ExpirationType_DELETE_AFTER_SEND; + static inline bool ExpirationType_IsValid(int value) { + return Content_ExpirationType_IsValid(value); + } + static constexpr ExpirationType ExpirationType_MIN = + Content_ExpirationType_ExpirationType_MIN; + static constexpr ExpirationType ExpirationType_MAX = + Content_ExpirationType_ExpirationType_MAX; + static constexpr int ExpirationType_ARRAYSIZE = + Content_ExpirationType_ExpirationType_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + ExpirationType_descriptor() { + return Content_ExpirationType_descriptor(); + } + template + static inline const std::string& ExpirationType_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function ExpirationType_Name."); + return Content_ExpirationType_Name(enum_t_value); + } + static inline bool ExpirationType_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + ExpirationType* value) { + return Content_ExpirationType_Parse(name, value); + } + // accessors ------------------------------------------------------- enum : int { - kGenIndexHashFieldNumber = 2, - kRotatingPublicKeyFieldNumber = 3, - kSigFieldNumber = 5, - kExpiryUnixTsFieldNumber = 4, - kVersionFieldNumber = 1, + kDataMessageFieldNumber = 1, + kCallMessageFieldNumber = 3, + kReceiptMessageFieldNumber = 5, + kTypingMessageFieldNumber = 6, + kDataExtractionNotificationFieldNumber = 8, + kUnsendRequestFieldNumber = 9, + kMessageRequestResponseFieldNumber = 10, + kSharedConfigMessageFieldNumber = 11, + kExpirationTypeFieldNumber = 12, + kExpirationTimerFieldNumber = 13, + kSigTimestampFieldNumber = 15, }; - // required bytes genIndexHash = 2; - bool has_genindexhash() const; + // optional .SessionProtos.DataMessage dataMessage = 1; + bool has_datamessage() const; private: - bool _internal_has_genindexhash() const; + bool _internal_has_datamessage() const; public: - void clear_genindexhash(); - const std::string& genindexhash() const; - template - void set_genindexhash(ArgT0&& arg0, ArgT... args); - std::string* mutable_genindexhash(); - PROTOBUF_NODISCARD std::string* release_genindexhash(); - void set_allocated_genindexhash(std::string* genindexhash); + void clear_datamessage(); + const ::SessionProtos::DataMessage& datamessage() const; + PROTOBUF_NODISCARD ::SessionProtos::DataMessage* release_datamessage(); + ::SessionProtos::DataMessage* mutable_datamessage(); + void set_allocated_datamessage(::SessionProtos::DataMessage* datamessage); private: - const std::string& _internal_genindexhash() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_genindexhash(const std::string& value); - std::string* _internal_mutable_genindexhash(); + const ::SessionProtos::DataMessage& _internal_datamessage() const; + ::SessionProtos::DataMessage* _internal_mutable_datamessage(); public: + void unsafe_arena_set_allocated_datamessage( + ::SessionProtos::DataMessage* datamessage); + ::SessionProtos::DataMessage* unsafe_arena_release_datamessage(); - // required bytes rotatingPublicKey = 3; - bool has_rotatingpublickey() const; + // optional .SessionProtos.CallMessage callMessage = 3; + bool has_callmessage() const; private: - bool _internal_has_rotatingpublickey() const; + bool _internal_has_callmessage() const; public: - void clear_rotatingpublickey(); - const std::string& rotatingpublickey() const; - template - void set_rotatingpublickey(ArgT0&& arg0, ArgT... args); - std::string* mutable_rotatingpublickey(); - PROTOBUF_NODISCARD std::string* release_rotatingpublickey(); - void set_allocated_rotatingpublickey(std::string* rotatingpublickey); + void clear_callmessage(); + const ::SessionProtos::CallMessage& callmessage() const; + PROTOBUF_NODISCARD ::SessionProtos::CallMessage* release_callmessage(); + ::SessionProtos::CallMessage* mutable_callmessage(); + void set_allocated_callmessage(::SessionProtos::CallMessage* callmessage); + private: + const ::SessionProtos::CallMessage& _internal_callmessage() const; + ::SessionProtos::CallMessage* _internal_mutable_callmessage(); + public: + void unsafe_arena_set_allocated_callmessage( + ::SessionProtos::CallMessage* callmessage); + ::SessionProtos::CallMessage* unsafe_arena_release_callmessage(); + + // optional .SessionProtos.ReceiptMessage receiptMessage = 5; + bool has_receiptmessage() const; + private: + bool _internal_has_receiptmessage() const; + public: + void clear_receiptmessage(); + const ::SessionProtos::ReceiptMessage& receiptmessage() const; + PROTOBUF_NODISCARD ::SessionProtos::ReceiptMessage* release_receiptmessage(); + ::SessionProtos::ReceiptMessage* mutable_receiptmessage(); + void set_allocated_receiptmessage(::SessionProtos::ReceiptMessage* receiptmessage); private: - const std::string& _internal_rotatingpublickey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_rotatingpublickey(const std::string& value); - std::string* _internal_mutable_rotatingpublickey(); + const ::SessionProtos::ReceiptMessage& _internal_receiptmessage() const; + ::SessionProtos::ReceiptMessage* _internal_mutable_receiptmessage(); public: + void unsafe_arena_set_allocated_receiptmessage( + ::SessionProtos::ReceiptMessage* receiptmessage); + ::SessionProtos::ReceiptMessage* unsafe_arena_release_receiptmessage(); - // required bytes sig = 5; - bool has_sig() const; + // optional .SessionProtos.TypingMessage typingMessage = 6; + bool has_typingmessage() const; private: - bool _internal_has_sig() const; + bool _internal_has_typingmessage() const; public: - void clear_sig(); - const std::string& sig() const; - template - void set_sig(ArgT0&& arg0, ArgT... args); - std::string* mutable_sig(); - PROTOBUF_NODISCARD std::string* release_sig(); - void set_allocated_sig(std::string* sig); + void clear_typingmessage(); + const ::SessionProtos::TypingMessage& typingmessage() const; + PROTOBUF_NODISCARD ::SessionProtos::TypingMessage* release_typingmessage(); + ::SessionProtos::TypingMessage* mutable_typingmessage(); + void set_allocated_typingmessage(::SessionProtos::TypingMessage* typingmessage); + private: + const ::SessionProtos::TypingMessage& _internal_typingmessage() const; + ::SessionProtos::TypingMessage* _internal_mutable_typingmessage(); + public: + void unsafe_arena_set_allocated_typingmessage( + ::SessionProtos::TypingMessage* typingmessage); + ::SessionProtos::TypingMessage* unsafe_arena_release_typingmessage(); + + // optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; + bool has_dataextractionnotification() const; + private: + bool _internal_has_dataextractionnotification() const; + public: + void clear_dataextractionnotification(); + const ::SessionProtos::DataExtractionNotification& dataextractionnotification() const; + PROTOBUF_NODISCARD ::SessionProtos::DataExtractionNotification* release_dataextractionnotification(); + ::SessionProtos::DataExtractionNotification* mutable_dataextractionnotification(); + void set_allocated_dataextractionnotification(::SessionProtos::DataExtractionNotification* dataextractionnotification); + private: + const ::SessionProtos::DataExtractionNotification& _internal_dataextractionnotification() const; + ::SessionProtos::DataExtractionNotification* _internal_mutable_dataextractionnotification(); + public: + void unsafe_arena_set_allocated_dataextractionnotification( + ::SessionProtos::DataExtractionNotification* dataextractionnotification); + ::SessionProtos::DataExtractionNotification* unsafe_arena_release_dataextractionnotification(); + + // optional .SessionProtos.UnsendRequest unsendRequest = 9; + bool has_unsendrequest() const; + private: + bool _internal_has_unsendrequest() const; + public: + void clear_unsendrequest(); + const ::SessionProtos::UnsendRequest& unsendrequest() const; + PROTOBUF_NODISCARD ::SessionProtos::UnsendRequest* release_unsendrequest(); + ::SessionProtos::UnsendRequest* mutable_unsendrequest(); + void set_allocated_unsendrequest(::SessionProtos::UnsendRequest* unsendrequest); + private: + const ::SessionProtos::UnsendRequest& _internal_unsendrequest() const; + ::SessionProtos::UnsendRequest* _internal_mutable_unsendrequest(); + public: + void unsafe_arena_set_allocated_unsendrequest( + ::SessionProtos::UnsendRequest* unsendrequest); + ::SessionProtos::UnsendRequest* unsafe_arena_release_unsendrequest(); + + // optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; + bool has_messagerequestresponse() const; + private: + bool _internal_has_messagerequestresponse() const; + public: + void clear_messagerequestresponse(); + const ::SessionProtos::MessageRequestResponse& messagerequestresponse() const; + PROTOBUF_NODISCARD ::SessionProtos::MessageRequestResponse* release_messagerequestresponse(); + ::SessionProtos::MessageRequestResponse* mutable_messagerequestresponse(); + void set_allocated_messagerequestresponse(::SessionProtos::MessageRequestResponse* messagerequestresponse); + private: + const ::SessionProtos::MessageRequestResponse& _internal_messagerequestresponse() const; + ::SessionProtos::MessageRequestResponse* _internal_mutable_messagerequestresponse(); + public: + void unsafe_arena_set_allocated_messagerequestresponse( + ::SessionProtos::MessageRequestResponse* messagerequestresponse); + ::SessionProtos::MessageRequestResponse* unsafe_arena_release_messagerequestresponse(); + + // optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; + bool has_sharedconfigmessage() const; + private: + bool _internal_has_sharedconfigmessage() const; + public: + void clear_sharedconfigmessage(); + const ::SessionProtos::SharedConfigMessage& sharedconfigmessage() const; + PROTOBUF_NODISCARD ::SessionProtos::SharedConfigMessage* release_sharedconfigmessage(); + ::SessionProtos::SharedConfigMessage* mutable_sharedconfigmessage(); + void set_allocated_sharedconfigmessage(::SessionProtos::SharedConfigMessage* sharedconfigmessage); + private: + const ::SessionProtos::SharedConfigMessage& _internal_sharedconfigmessage() const; + ::SessionProtos::SharedConfigMessage* _internal_mutable_sharedconfigmessage(); + public: + void unsafe_arena_set_allocated_sharedconfigmessage( + ::SessionProtos::SharedConfigMessage* sharedconfigmessage); + ::SessionProtos::SharedConfigMessage* unsafe_arena_release_sharedconfigmessage(); + + // optional .SessionProtos.Content.ExpirationType expirationType = 12; + bool has_expirationtype() const; + private: + bool _internal_has_expirationtype() const; + public: + void clear_expirationtype(); + ::SessionProtos::Content_ExpirationType expirationtype() const; + void set_expirationtype(::SessionProtos::Content_ExpirationType value); private: - const std::string& _internal_sig() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_sig(const std::string& value); - std::string* _internal_mutable_sig(); + ::SessionProtos::Content_ExpirationType _internal_expirationtype() const; + void _internal_set_expirationtype(::SessionProtos::Content_ExpirationType value); public: - // required uint64 expiryUnixTs = 4; - bool has_expiryunixts() const; + // optional uint32 expirationTimer = 13; + bool has_expirationtimer() const; private: - bool _internal_has_expiryunixts() const; + bool _internal_has_expirationtimer() const; public: - void clear_expiryunixts(); - uint64_t expiryunixts() const; - void set_expiryunixts(uint64_t value); + void clear_expirationtimer(); + uint32_t expirationtimer() const; + void set_expirationtimer(uint32_t value); private: - uint64_t _internal_expiryunixts() const; - void _internal_set_expiryunixts(uint64_t value); + uint32_t _internal_expirationtimer() const; + void _internal_set_expirationtimer(uint32_t value); public: - // required uint32 version = 1; - bool has_version() const; + // optional uint64 sigTimestamp = 15; + bool has_sigtimestamp() const; private: - bool _internal_has_version() const; + bool _internal_has_sigtimestamp() const; public: - void clear_version(); - uint32_t version() const; - void set_version(uint32_t value); + void clear_sigtimestamp(); + uint64_t sigtimestamp() const; + void set_sigtimestamp(uint64_t value); private: - uint32_t _internal_version() const; - void _internal_set_version(uint32_t value); + uint64_t _internal_sigtimestamp() const; + void _internal_set_sigtimestamp(uint64_t value); public: - // @@protoc_insertion_point(class_scope:SessionProtos.ProProof) + // @@protoc_insertion_point(class_scope:SessionProtos.Content) private: class _Internal; - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr genindexhash_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr rotatingpublickey_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr sig_; - uint64_t expiryunixts_; - uint32_t version_; + ::SessionProtos::DataMessage* datamessage_; + ::SessionProtos::CallMessage* callmessage_; + ::SessionProtos::ReceiptMessage* receiptmessage_; + ::SessionProtos::TypingMessage* typingmessage_; + ::SessionProtos::DataExtractionNotification* dataextractionnotification_; + ::SessionProtos::UnsendRequest* unsendrequest_; + ::SessionProtos::MessageRequestResponse* messagerequestresponse_; + ::SessionProtos::SharedConfigMessage* sharedconfigmessage_; + int expirationtype_; + uint32_t expirationtimer_; + uint64_t sigtimestamp_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class ProConfig final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ProConfig) */ { +class CallMessage final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.CallMessage) */ { public: - inline ProConfig() : ProConfig(nullptr) {} - ~ProConfig() override; - explicit PROTOBUF_CONSTEXPR ProConfig(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline CallMessage() : CallMessage(nullptr) {} + ~CallMessage() override; + explicit PROTOBUF_CONSTEXPR CallMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ProConfig(const ProConfig& from); - ProConfig(ProConfig&& from) noexcept - : ProConfig() { + CallMessage(const CallMessage& from); + CallMessage(CallMessage&& from) noexcept + : CallMessage() { *this = ::std::move(from); } - inline ProConfig& operator=(const ProConfig& from) { + inline CallMessage& operator=(const CallMessage& from) { CopyFrom(from); return *this; } - inline ProConfig& operator=(ProConfig&& from) noexcept { + inline CallMessage& operator=(CallMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1411,27 +1749,36 @@ class ProConfig final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const ProConfig& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const CallMessage& default_instance() { return *internal_default_instance(); } - static inline const ProConfig* internal_default_instance() { - return reinterpret_cast( - &_ProConfig_default_instance_); + static inline const CallMessage* internal_default_instance() { + return reinterpret_cast( + &_CallMessage_default_instance_); } static constexpr int kIndexInFileMessages = 5; - friend void swap(ProConfig& a, ProConfig& b) { + friend void swap(CallMessage& a, CallMessage& b) { a.Swap(&b); } - inline void Swap(ProConfig* other) { + inline void Swap(CallMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1444,7 +1791,7 @@ class ProConfig final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ProConfig* other) { + void UnsafeArenaSwap(CallMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1452,12 +1799,18 @@ class ProConfig final : // implements Message ---------------------------------------------- - ProConfig* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + CallMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const CallMessage& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const CallMessage& from) { + CallMessage::MergeImpl(*this, from); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const ProConfig& from); - void MergeFrom(const ProConfig& from); + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1470,66 +1823,175 @@ class ProConfig final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(ProConfig* other); + void SetCachedSize(int size) const final; + void InternalSwap(CallMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.ProConfig"; + return "SessionProtos.CallMessage"; } protected: - explicit ProConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit CallMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; // nested types ---------------------------------------------------- + typedef CallMessage_Type Type; + static constexpr Type PRE_OFFER = + CallMessage_Type_PRE_OFFER; + static constexpr Type OFFER = + CallMessage_Type_OFFER; + static constexpr Type ANSWER = + CallMessage_Type_ANSWER; + static constexpr Type PROVISIONAL_ANSWER = + CallMessage_Type_PROVISIONAL_ANSWER; + static constexpr Type ICE_CANDIDATES = + CallMessage_Type_ICE_CANDIDATES; + static constexpr Type END_CALL = + CallMessage_Type_END_CALL; + static inline bool Type_IsValid(int value) { + return CallMessage_Type_IsValid(value); + } + static constexpr Type Type_MIN = + CallMessage_Type_Type_MIN; + static constexpr Type Type_MAX = + CallMessage_Type_Type_MAX; + static constexpr int Type_ARRAYSIZE = + CallMessage_Type_Type_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + Type_descriptor() { + return CallMessage_Type_descriptor(); + } + template + static inline const std::string& Type_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Type_Name."); + return CallMessage_Type_Name(enum_t_value); + } + static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Type* value) { + return CallMessage_Type_Parse(name, value); + } + // accessors ------------------------------------------------------- enum : int { - kRotatingPrivKeyFieldNumber = 1, - kProofFieldNumber = 2, + kSdpsFieldNumber = 2, + kSdpMLineIndexesFieldNumber = 3, + kSdpMidsFieldNumber = 4, + kUuidFieldNumber = 5, + kTypeFieldNumber = 1, }; - // required bytes rotatingPrivKey = 1; - bool has_rotatingprivkey() const; + // repeated string sdps = 2; + int sdps_size() const; + private: + int _internal_sdps_size() const; + public: + void clear_sdps(); + const std::string& sdps(int index) const; + std::string* mutable_sdps(int index); + void set_sdps(int index, const std::string& value); + void set_sdps(int index, std::string&& value); + void set_sdps(int index, const char* value); + void set_sdps(int index, const char* value, size_t size); + std::string* add_sdps(); + void add_sdps(const std::string& value); + void add_sdps(std::string&& value); + void add_sdps(const char* value); + void add_sdps(const char* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& sdps() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_sdps(); + private: + const std::string& _internal_sdps(int index) const; + std::string* _internal_add_sdps(); + public: + + // repeated uint32 sdpMLineIndexes = 3; + int sdpmlineindexes_size() const; + private: + int _internal_sdpmlineindexes_size() const; + public: + void clear_sdpmlineindexes(); + private: + uint32_t _internal_sdpmlineindexes(int index) const; + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >& + _internal_sdpmlineindexes() const; + void _internal_add_sdpmlineindexes(uint32_t value); + ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >* + _internal_mutable_sdpmlineindexes(); + public: + uint32_t sdpmlineindexes(int index) const; + void set_sdpmlineindexes(int index, uint32_t value); + void add_sdpmlineindexes(uint32_t value); + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >& + sdpmlineindexes() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >* + mutable_sdpmlineindexes(); + + // repeated string sdpMids = 4; + int sdpmids_size() const; + private: + int _internal_sdpmids_size() const; + public: + void clear_sdpmids(); + const std::string& sdpmids(int index) const; + std::string* mutable_sdpmids(int index); + void set_sdpmids(int index, const std::string& value); + void set_sdpmids(int index, std::string&& value); + void set_sdpmids(int index, const char* value); + void set_sdpmids(int index, const char* value, size_t size); + std::string* add_sdpmids(); + void add_sdpmids(const std::string& value); + void add_sdpmids(std::string&& value); + void add_sdpmids(const char* value); + void add_sdpmids(const char* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& sdpmids() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_sdpmids(); + private: + const std::string& _internal_sdpmids(int index) const; + std::string* _internal_add_sdpmids(); + public: + + // required string uuid = 5; + bool has_uuid() const; private: - bool _internal_has_rotatingprivkey() const; + bool _internal_has_uuid() const; public: - void clear_rotatingprivkey(); - const std::string& rotatingprivkey() const; + void clear_uuid(); + const std::string& uuid() const; template - void set_rotatingprivkey(ArgT0&& arg0, ArgT... args); - std::string* mutable_rotatingprivkey(); - PROTOBUF_NODISCARD std::string* release_rotatingprivkey(); - void set_allocated_rotatingprivkey(std::string* rotatingprivkey); + void set_uuid(ArgT0&& arg0, ArgT... args); + std::string* mutable_uuid(); + PROTOBUF_NODISCARD std::string* release_uuid(); + void set_allocated_uuid(std::string* uuid); private: - const std::string& _internal_rotatingprivkey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_rotatingprivkey(const std::string& value); - std::string* _internal_mutable_rotatingprivkey(); + const std::string& _internal_uuid() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_uuid(const std::string& value); + std::string* _internal_mutable_uuid(); public: - // required .SessionProtos.ProProof proof = 2; - bool has_proof() const; + // required .SessionProtos.CallMessage.Type type = 1; + bool has_type() const; private: - bool _internal_has_proof() const; + bool _internal_has_type() const; public: - void clear_proof(); - const ::SessionProtos::ProProof& proof() const; - PROTOBUF_NODISCARD ::SessionProtos::ProProof* release_proof(); - ::SessionProtos::ProProof* mutable_proof(); - void set_allocated_proof(::SessionProtos::ProProof* proof); + void clear_type(); + ::SessionProtos::CallMessage_Type type() const; + void set_type(::SessionProtos::CallMessage_Type value); private: - const ::SessionProtos::ProProof& _internal_proof() const; - ::SessionProtos::ProProof* _internal_mutable_proof(); + ::SessionProtos::CallMessage_Type _internal_type() const; + void _internal_set_type(::SessionProtos::CallMessage_Type value); public: - void unsafe_arena_set_allocated_proof( - ::SessionProtos::ProProof* proof); - ::SessionProtos::ProProof* unsafe_arena_release_proof(); - // @@protoc_insertion_point(class_scope:SessionProtos.ProConfig) + // @@protoc_insertion_point(class_scope:SessionProtos.CallMessage) private: class _Internal; @@ -1542,32 +2004,35 @@ class ProConfig final : struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr rotatingprivkey_; - ::SessionProtos::ProProof* proof_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField sdps_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t > sdpmlineindexes_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField sdpmids_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr uuid_; + int type_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class ProMessageConfig final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ProMessageConfig) */ { +class KeyPair final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.KeyPair) */ { public: - inline ProMessageConfig() : ProMessageConfig(nullptr) {} - ~ProMessageConfig() override; - explicit PROTOBUF_CONSTEXPR ProMessageConfig(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline KeyPair() : KeyPair(nullptr) {} + ~KeyPair() override; + explicit PROTOBUF_CONSTEXPR KeyPair(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ProMessageConfig(const ProMessageConfig& from); - ProMessageConfig(ProMessageConfig&& from) noexcept - : ProMessageConfig() { + KeyPair(const KeyPair& from); + KeyPair(KeyPair&& from) noexcept + : KeyPair() { *this = ::std::move(from); } - inline ProMessageConfig& operator=(const ProMessageConfig& from) { + inline KeyPair& operator=(const KeyPair& from) { CopyFrom(from); return *this; } - inline ProMessageConfig& operator=(ProMessageConfig&& from) noexcept { + inline KeyPair& operator=(KeyPair&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1581,27 +2046,36 @@ class ProMessageConfig final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const ProMessageConfig& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const KeyPair& default_instance() { return *internal_default_instance(); } - static inline const ProMessageConfig* internal_default_instance() { - return reinterpret_cast( - &_ProMessageConfig_default_instance_); + static inline const KeyPair* internal_default_instance() { + return reinterpret_cast( + &_KeyPair_default_instance_); } static constexpr int kIndexInFileMessages = 6; - friend void swap(ProMessageConfig& a, ProMessageConfig& b) { + friend void swap(KeyPair& a, KeyPair& b) { a.Swap(&b); } - inline void Swap(ProMessageConfig* other) { + inline void Swap(KeyPair* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1614,7 +2088,7 @@ class ProMessageConfig final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ProMessageConfig* other) { + void UnsafeArenaSwap(KeyPair* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1622,12 +2096,18 @@ class ProMessageConfig final : // implements Message ---------------------------------------------- - ProMessageConfig* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + KeyPair* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const KeyPair& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const KeyPair& from) { + KeyPair::MergeImpl(*this, from); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const ProMessageConfig& from); - void MergeFrom(const ProMessageConfig& from); + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1640,61 +2120,69 @@ class ProMessageConfig final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(ProMessageConfig* other); + void SetCachedSize(int size) const final; + void InternalSwap(KeyPair* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.ProMessageConfig"; + return "SessionProtos.KeyPair"; } protected: - explicit ProMessageConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit KeyPair(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { - kProofFieldNumber = 1, - kFlagsFieldNumber = 2, + kPublicKeyFieldNumber = 1, + kPrivateKeyFieldNumber = 2, }; - // required .SessionProtos.ProProof proof = 1; - bool has_proof() const; + // required bytes publicKey = 1; + bool has_publickey() const; private: - bool _internal_has_proof() const; + bool _internal_has_publickey() const; public: - void clear_proof(); - const ::SessionProtos::ProProof& proof() const; - PROTOBUF_NODISCARD ::SessionProtos::ProProof* release_proof(); - ::SessionProtos::ProProof* mutable_proof(); - void set_allocated_proof(::SessionProtos::ProProof* proof); + void clear_publickey(); + const std::string& publickey() const; + template + void set_publickey(ArgT0&& arg0, ArgT... args); + std::string* mutable_publickey(); + PROTOBUF_NODISCARD std::string* release_publickey(); + void set_allocated_publickey(std::string* publickey); private: - const ::SessionProtos::ProProof& _internal_proof() const; - ::SessionProtos::ProProof* _internal_mutable_proof(); + const std::string& _internal_publickey() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_publickey(const std::string& value); + std::string* _internal_mutable_publickey(); public: - void unsafe_arena_set_allocated_proof( - ::SessionProtos::ProProof* proof); - ::SessionProtos::ProProof* unsafe_arena_release_proof(); - // required uint32 flags = 2; - bool has_flags() const; + // required bytes privateKey = 2; + bool has_privatekey() const; private: - bool _internal_has_flags() const; + bool _internal_has_privatekey() const; public: - void clear_flags(); - uint32_t flags() const; - void set_flags(uint32_t value); + void clear_privatekey(); + const std::string& privatekey() const; + template + void set_privatekey(ArgT0&& arg0, ArgT... args); + std::string* mutable_privatekey(); + PROTOBUF_NODISCARD std::string* release_privatekey(); + void set_allocated_privatekey(std::string* privatekey); private: - uint32_t _internal_flags() const; - void _internal_set_flags(uint32_t value); + const std::string& _internal_privatekey() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_privatekey(const std::string& value); + std::string* _internal_mutable_privatekey(); public: - // @@protoc_insertion_point(class_scope:SessionProtos.ProMessageConfig) + // @@protoc_insertion_point(class_scope:SessionProtos.KeyPair) private: class _Internal; @@ -1707,32 +2195,32 @@ class ProMessageConfig final : struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::SessionProtos::ProProof* proof_; - uint32_t flags_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr publickey_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr privatekey_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class Content final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.Content) */ { +class DataExtractionNotification final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.DataExtractionNotification) */ { public: - inline Content() : Content(nullptr) {} - ~Content() override; - explicit PROTOBUF_CONSTEXPR Content(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline DataExtractionNotification() : DataExtractionNotification(nullptr) {} + ~DataExtractionNotification() override; + explicit PROTOBUF_CONSTEXPR DataExtractionNotification(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - Content(const Content& from); - Content(Content&& from) noexcept - : Content() { + DataExtractionNotification(const DataExtractionNotification& from); + DataExtractionNotification(DataExtractionNotification&& from) noexcept + : DataExtractionNotification() { *this = ::std::move(from); } - inline Content& operator=(const Content& from) { + inline DataExtractionNotification& operator=(const DataExtractionNotification& from) { CopyFrom(from); return *this; } - inline Content& operator=(Content&& from) noexcept { + inline DataExtractionNotification& operator=(DataExtractionNotification&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1746,27 +2234,36 @@ class Content final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const Content& default_instance() { - return *internal_default_instance(); + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); } - static inline const Content* internal_default_instance() { - return reinterpret_cast( - &_Content_default_instance_); + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const DataExtractionNotification& default_instance() { + return *internal_default_instance(); + } + static inline const DataExtractionNotification* internal_default_instance() { + return reinterpret_cast( + &_DataExtractionNotification_default_instance_); } static constexpr int kIndexInFileMessages = 7; - friend void swap(Content& a, Content& b) { + friend void swap(DataExtractionNotification& a, DataExtractionNotification& b) { a.Swap(&b); } - inline void Swap(Content* other) { + inline void Swap(DataExtractionNotification* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1779,7 +2276,7 @@ class Content final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(Content* other) { + void UnsafeArenaSwap(DataExtractionNotification* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1787,12 +2284,18 @@ class Content final : // implements Message ---------------------------------------------- - Content* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + DataExtractionNotification* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const Content& from); - void MergeFrom(const Content& from); + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const DataExtractionNotification& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const DataExtractionNotification& from) { + DataExtractionNotification::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1805,218 +2308,89 @@ class Content final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(Content* other); + void SetCachedSize(int size) const final; + void InternalSwap(DataExtractionNotification* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.Content"; + return "SessionProtos.DataExtractionNotification"; } protected: - explicit Content(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit DataExtractionNotification(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; // nested types ---------------------------------------------------- + typedef DataExtractionNotification_Type Type; + static constexpr Type SCREENSHOT = + DataExtractionNotification_Type_SCREENSHOT; + static constexpr Type MEDIA_SAVED = + DataExtractionNotification_Type_MEDIA_SAVED; + static inline bool Type_IsValid(int value) { + return DataExtractionNotification_Type_IsValid(value); + } + static constexpr Type Type_MIN = + DataExtractionNotification_Type_Type_MIN; + static constexpr Type Type_MAX = + DataExtractionNotification_Type_Type_MAX; + static constexpr int Type_ARRAYSIZE = + DataExtractionNotification_Type_Type_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + Type_descriptor() { + return DataExtractionNotification_Type_descriptor(); + } + template + static inline const std::string& Type_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Type_Name."); + return DataExtractionNotification_Type_Name(enum_t_value); + } + static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Type* value) { + return DataExtractionNotification_Type_Parse(name, value); + } + // accessors ------------------------------------------------------- enum : int { - kDataMessageFieldNumber = 1, - kCallMessageFieldNumber = 3, - kReceiptMessageFieldNumber = 5, - kTypingMessageFieldNumber = 6, - kConfigurationMessageFieldNumber = 7, - kDataExtractionNotificationFieldNumber = 8, - kUnsendRequestFieldNumber = 9, - kMessageRequestResponseFieldNumber = 10, - kSharedConfigMessageFieldNumber = 11, - kProMessageConfigFieldNumber = 12, + kTimestampFieldNumber = 2, + kTypeFieldNumber = 1, }; - // optional .SessionProtos.DataMessage dataMessage = 1; - bool has_datamessage() const; - private: - bool _internal_has_datamessage() const; - public: - void clear_datamessage(); - const ::SessionProtos::DataMessage& datamessage() const; - PROTOBUF_NODISCARD ::SessionProtos::DataMessage* release_datamessage(); - ::SessionProtos::DataMessage* mutable_datamessage(); - void set_allocated_datamessage(::SessionProtos::DataMessage* datamessage); - private: - const ::SessionProtos::DataMessage& _internal_datamessage() const; - ::SessionProtos::DataMessage* _internal_mutable_datamessage(); - public: - void unsafe_arena_set_allocated_datamessage( - ::SessionProtos::DataMessage* datamessage); - ::SessionProtos::DataMessage* unsafe_arena_release_datamessage(); - - // optional .SessionProtos.CallMessage callMessage = 3; - bool has_callmessage() const; - private: - bool _internal_has_callmessage() const; - public: - void clear_callmessage(); - const ::SessionProtos::CallMessage& callmessage() const; - PROTOBUF_NODISCARD ::SessionProtos::CallMessage* release_callmessage(); - ::SessionProtos::CallMessage* mutable_callmessage(); - void set_allocated_callmessage(::SessionProtos::CallMessage* callmessage); - private: - const ::SessionProtos::CallMessage& _internal_callmessage() const; - ::SessionProtos::CallMessage* _internal_mutable_callmessage(); - public: - void unsafe_arena_set_allocated_callmessage( - ::SessionProtos::CallMessage* callmessage); - ::SessionProtos::CallMessage* unsafe_arena_release_callmessage(); - - // optional .SessionProtos.ReceiptMessage receiptMessage = 5; - bool has_receiptmessage() const; - private: - bool _internal_has_receiptmessage() const; - public: - void clear_receiptmessage(); - const ::SessionProtos::ReceiptMessage& receiptmessage() const; - PROTOBUF_NODISCARD ::SessionProtos::ReceiptMessage* release_receiptmessage(); - ::SessionProtos::ReceiptMessage* mutable_receiptmessage(); - void set_allocated_receiptmessage(::SessionProtos::ReceiptMessage* receiptmessage); - private: - const ::SessionProtos::ReceiptMessage& _internal_receiptmessage() const; - ::SessionProtos::ReceiptMessage* _internal_mutable_receiptmessage(); - public: - void unsafe_arena_set_allocated_receiptmessage( - ::SessionProtos::ReceiptMessage* receiptmessage); - ::SessionProtos::ReceiptMessage* unsafe_arena_release_receiptmessage(); - - // optional .SessionProtos.TypingMessage typingMessage = 6; - bool has_typingmessage() const; - private: - bool _internal_has_typingmessage() const; - public: - void clear_typingmessage(); - const ::SessionProtos::TypingMessage& typingmessage() const; - PROTOBUF_NODISCARD ::SessionProtos::TypingMessage* release_typingmessage(); - ::SessionProtos::TypingMessage* mutable_typingmessage(); - void set_allocated_typingmessage(::SessionProtos::TypingMessage* typingmessage); - private: - const ::SessionProtos::TypingMessage& _internal_typingmessage() const; - ::SessionProtos::TypingMessage* _internal_mutable_typingmessage(); - public: - void unsafe_arena_set_allocated_typingmessage( - ::SessionProtos::TypingMessage* typingmessage); - ::SessionProtos::TypingMessage* unsafe_arena_release_typingmessage(); - - // optional .SessionProtos.ConfigurationMessage configurationMessage = 7; - bool has_configurationmessage() const; - private: - bool _internal_has_configurationmessage() const; - public: - void clear_configurationmessage(); - const ::SessionProtos::ConfigurationMessage& configurationmessage() const; - PROTOBUF_NODISCARD ::SessionProtos::ConfigurationMessage* release_configurationmessage(); - ::SessionProtos::ConfigurationMessage* mutable_configurationmessage(); - void set_allocated_configurationmessage(::SessionProtos::ConfigurationMessage* configurationmessage); - private: - const ::SessionProtos::ConfigurationMessage& _internal_configurationmessage() const; - ::SessionProtos::ConfigurationMessage* _internal_mutable_configurationmessage(); - public: - void unsafe_arena_set_allocated_configurationmessage( - ::SessionProtos::ConfigurationMessage* configurationmessage); - ::SessionProtos::ConfigurationMessage* unsafe_arena_release_configurationmessage(); - - // optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; - bool has_dataextractionnotification() const; - private: - bool _internal_has_dataextractionnotification() const; - public: - void clear_dataextractionnotification(); - const ::SessionProtos::DataExtractionNotification& dataextractionnotification() const; - PROTOBUF_NODISCARD ::SessionProtos::DataExtractionNotification* release_dataextractionnotification(); - ::SessionProtos::DataExtractionNotification* mutable_dataextractionnotification(); - void set_allocated_dataextractionnotification(::SessionProtos::DataExtractionNotification* dataextractionnotification); - private: - const ::SessionProtos::DataExtractionNotification& _internal_dataextractionnotification() const; - ::SessionProtos::DataExtractionNotification* _internal_mutable_dataextractionnotification(); - public: - void unsafe_arena_set_allocated_dataextractionnotification( - ::SessionProtos::DataExtractionNotification* dataextractionnotification); - ::SessionProtos::DataExtractionNotification* unsafe_arena_release_dataextractionnotification(); - - // optional .SessionProtos.UnsendRequest unsendRequest = 9; - bool has_unsendrequest() const; - private: - bool _internal_has_unsendrequest() const; - public: - void clear_unsendrequest(); - const ::SessionProtos::UnsendRequest& unsendrequest() const; - PROTOBUF_NODISCARD ::SessionProtos::UnsendRequest* release_unsendrequest(); - ::SessionProtos::UnsendRequest* mutable_unsendrequest(); - void set_allocated_unsendrequest(::SessionProtos::UnsendRequest* unsendrequest); - private: - const ::SessionProtos::UnsendRequest& _internal_unsendrequest() const; - ::SessionProtos::UnsendRequest* _internal_mutable_unsendrequest(); - public: - void unsafe_arena_set_allocated_unsendrequest( - ::SessionProtos::UnsendRequest* unsendrequest); - ::SessionProtos::UnsendRequest* unsafe_arena_release_unsendrequest(); - - // optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; - bool has_messagerequestresponse() const; - private: - bool _internal_has_messagerequestresponse() const; - public: - void clear_messagerequestresponse(); - const ::SessionProtos::MessageRequestResponse& messagerequestresponse() const; - PROTOBUF_NODISCARD ::SessionProtos::MessageRequestResponse* release_messagerequestresponse(); - ::SessionProtos::MessageRequestResponse* mutable_messagerequestresponse(); - void set_allocated_messagerequestresponse(::SessionProtos::MessageRequestResponse* messagerequestresponse); - private: - const ::SessionProtos::MessageRequestResponse& _internal_messagerequestresponse() const; - ::SessionProtos::MessageRequestResponse* _internal_mutable_messagerequestresponse(); - public: - void unsafe_arena_set_allocated_messagerequestresponse( - ::SessionProtos::MessageRequestResponse* messagerequestresponse); - ::SessionProtos::MessageRequestResponse* unsafe_arena_release_messagerequestresponse(); - - // optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; - bool has_sharedconfigmessage() const; + // optional uint64 timestamp = 2; + bool has_timestamp() const; private: - bool _internal_has_sharedconfigmessage() const; + bool _internal_has_timestamp() const; public: - void clear_sharedconfigmessage(); - const ::SessionProtos::SharedConfigMessage& sharedconfigmessage() const; - PROTOBUF_NODISCARD ::SessionProtos::SharedConfigMessage* release_sharedconfigmessage(); - ::SessionProtos::SharedConfigMessage* mutable_sharedconfigmessage(); - void set_allocated_sharedconfigmessage(::SessionProtos::SharedConfigMessage* sharedconfigmessage); + void clear_timestamp(); + uint64_t timestamp() const; + void set_timestamp(uint64_t value); private: - const ::SessionProtos::SharedConfigMessage& _internal_sharedconfigmessage() const; - ::SessionProtos::SharedConfigMessage* _internal_mutable_sharedconfigmessage(); + uint64_t _internal_timestamp() const; + void _internal_set_timestamp(uint64_t value); public: - void unsafe_arena_set_allocated_sharedconfigmessage( - ::SessionProtos::SharedConfigMessage* sharedconfigmessage); - ::SessionProtos::SharedConfigMessage* unsafe_arena_release_sharedconfigmessage(); - // optional .SessionProtos.ProMessageConfig proMessageConfig = 12; - bool has_promessageconfig() const; + // required .SessionProtos.DataExtractionNotification.Type type = 1; + bool has_type() const; private: - bool _internal_has_promessageconfig() const; + bool _internal_has_type() const; public: - void clear_promessageconfig(); - const ::SessionProtos::ProMessageConfig& promessageconfig() const; - PROTOBUF_NODISCARD ::SessionProtos::ProMessageConfig* release_promessageconfig(); - ::SessionProtos::ProMessageConfig* mutable_promessageconfig(); - void set_allocated_promessageconfig(::SessionProtos::ProMessageConfig* promessageconfig); + void clear_type(); + ::SessionProtos::DataExtractionNotification_Type type() const; + void set_type(::SessionProtos::DataExtractionNotification_Type value); private: - const ::SessionProtos::ProMessageConfig& _internal_promessageconfig() const; - ::SessionProtos::ProMessageConfig* _internal_mutable_promessageconfig(); + ::SessionProtos::DataExtractionNotification_Type _internal_type() const; + void _internal_set_type(::SessionProtos::DataExtractionNotification_Type value); public: - void unsafe_arena_set_allocated_promessageconfig( - ::SessionProtos::ProMessageConfig* promessageconfig); - ::SessionProtos::ProMessageConfig* unsafe_arena_release_promessageconfig(); - // @@protoc_insertion_point(class_scope:SessionProtos.Content) + // @@protoc_insertion_point(class_scope:SessionProtos.DataExtractionNotification) private: class _Internal; @@ -2026,40 +2400,32 @@ class Content final : struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::SessionProtos::DataMessage* datamessage_; - ::SessionProtos::CallMessage* callmessage_; - ::SessionProtos::ReceiptMessage* receiptmessage_; - ::SessionProtos::TypingMessage* typingmessage_; - ::SessionProtos::ConfigurationMessage* configurationmessage_; - ::SessionProtos::DataExtractionNotification* dataextractionnotification_; - ::SessionProtos::UnsendRequest* unsendrequest_; - ::SessionProtos::MessageRequestResponse* messagerequestresponse_; - ::SessionProtos::SharedConfigMessage* sharedconfigmessage_; - ::SessionProtos::ProMessageConfig* promessageconfig_; + uint64_t timestamp_; + int type_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class CallMessage final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.CallMessage) */ { +class LokiProfile final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.LokiProfile) */ { public: - inline CallMessage() : CallMessage(nullptr) {} - ~CallMessage() override; - explicit PROTOBUF_CONSTEXPR CallMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline LokiProfile() : LokiProfile(nullptr) {} + ~LokiProfile() override; + explicit PROTOBUF_CONSTEXPR LokiProfile(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - CallMessage(const CallMessage& from); - CallMessage(CallMessage&& from) noexcept - : CallMessage() { + LokiProfile(const LokiProfile& from); + LokiProfile(LokiProfile&& from) noexcept + : LokiProfile() { *this = ::std::move(from); } - inline CallMessage& operator=(const CallMessage& from) { + inline LokiProfile& operator=(const LokiProfile& from) { CopyFrom(from); return *this; } - inline CallMessage& operator=(CallMessage&& from) noexcept { + inline LokiProfile& operator=(LokiProfile&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -2073,27 +2439,36 @@ class CallMessage final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const CallMessage& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const LokiProfile& default_instance() { return *internal_default_instance(); } - static inline const CallMessage* internal_default_instance() { - return reinterpret_cast( - &_CallMessage_default_instance_); + static inline const LokiProfile* internal_default_instance() { + return reinterpret_cast( + &_LokiProfile_default_instance_); } static constexpr int kIndexInFileMessages = 8; - friend void swap(CallMessage& a, CallMessage& b) { + friend void swap(LokiProfile& a, LokiProfile& b) { a.Swap(&b); } - inline void Swap(CallMessage* other) { + inline void Swap(LokiProfile* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -2106,7 +2481,7 @@ class CallMessage final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(CallMessage* other) { + void UnsafeArenaSwap(LokiProfile* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -2114,12 +2489,18 @@ class CallMessage final : // implements Message ---------------------------------------------- - CallMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + LokiProfile* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const CallMessage& from); - void MergeFrom(const CallMessage& from); + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const LokiProfile& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const LokiProfile& from) { + LokiProfile::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -2132,209 +2513,104 @@ class CallMessage final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(CallMessage* other); + void SetCachedSize(int size) const final; + void InternalSwap(LokiProfile* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.CallMessage"; + return "SessionProtos.LokiProfile"; } protected: - explicit CallMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit LokiProfile(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - // nested types ---------------------------------------------------- + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - typedef CallMessage_Type Type; - static constexpr Type PRE_OFFER = - CallMessage_Type_PRE_OFFER; - static constexpr Type OFFER = - CallMessage_Type_OFFER; - static constexpr Type ANSWER = - CallMessage_Type_ANSWER; - static constexpr Type PROVISIONAL_ANSWER = - CallMessage_Type_PROVISIONAL_ANSWER; - static constexpr Type ICE_CANDIDATES = - CallMessage_Type_ICE_CANDIDATES; - static constexpr Type END_CALL = - CallMessage_Type_END_CALL; - static inline bool Type_IsValid(int value) { - return CallMessage_Type_IsValid(value); - } - static constexpr Type Type_MIN = - CallMessage_Type_Type_MIN; - static constexpr Type Type_MAX = - CallMessage_Type_Type_MAX; - static constexpr int Type_ARRAYSIZE = - CallMessage_Type_Type_ARRAYSIZE; - template - static inline const std::string& Type_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function Type_Name."); - return CallMessage_Type_Name(enum_t_value); - } - static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Type* value) { - return CallMessage_Type_Parse(name, value); - } + // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { - kSdpsFieldNumber = 2, - kSdpMLineIndexesFieldNumber = 3, - kSdpMidsFieldNumber = 4, - kUuidFieldNumber = 5, - kTypeFieldNumber = 1, + kDisplayNameFieldNumber = 1, + kProfilePictureFieldNumber = 2, }; - // repeated string sdps = 2; - int sdps_size() const; - private: - int _internal_sdps_size() const; - public: - void clear_sdps(); - const std::string& sdps(int index) const; - std::string* mutable_sdps(int index); - void set_sdps(int index, const std::string& value); - void set_sdps(int index, std::string&& value); - void set_sdps(int index, const char* value); - void set_sdps(int index, const char* value, size_t size); - std::string* add_sdps(); - void add_sdps(const std::string& value); - void add_sdps(std::string&& value); - void add_sdps(const char* value); - void add_sdps(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& sdps() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_sdps(); - private: - const std::string& _internal_sdps(int index) const; - std::string* _internal_add_sdps(); - public: - - // repeated uint32 sdpMLineIndexes = 3; - int sdpmlineindexes_size() const; - private: - int _internal_sdpmlineindexes_size() const; - public: - void clear_sdpmlineindexes(); - private: - uint32_t _internal_sdpmlineindexes(int index) const; - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >& - _internal_sdpmlineindexes() const; - void _internal_add_sdpmlineindexes(uint32_t value); - ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >* - _internal_mutable_sdpmlineindexes(); - public: - uint32_t sdpmlineindexes(int index) const; - void set_sdpmlineindexes(int index, uint32_t value); - void add_sdpmlineindexes(uint32_t value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >& - sdpmlineindexes() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >* - mutable_sdpmlineindexes(); - - // repeated string sdpMids = 4; - int sdpmids_size() const; - private: - int _internal_sdpmids_size() const; - public: - void clear_sdpmids(); - const std::string& sdpmids(int index) const; - std::string* mutable_sdpmids(int index); - void set_sdpmids(int index, const std::string& value); - void set_sdpmids(int index, std::string&& value); - void set_sdpmids(int index, const char* value); - void set_sdpmids(int index, const char* value, size_t size); - std::string* add_sdpmids(); - void add_sdpmids(const std::string& value); - void add_sdpmids(std::string&& value); - void add_sdpmids(const char* value); - void add_sdpmids(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& sdpmids() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_sdpmids(); - private: - const std::string& _internal_sdpmids(int index) const; - std::string* _internal_add_sdpmids(); - public: - - // required string uuid = 5; - bool has_uuid() const; + // optional string displayName = 1; + bool has_displayname() const; private: - bool _internal_has_uuid() const; + bool _internal_has_displayname() const; public: - void clear_uuid(); - const std::string& uuid() const; + void clear_displayname(); + const std::string& displayname() const; template - void set_uuid(ArgT0&& arg0, ArgT... args); - std::string* mutable_uuid(); - PROTOBUF_NODISCARD std::string* release_uuid(); - void set_allocated_uuid(std::string* uuid); + void set_displayname(ArgT0&& arg0, ArgT... args); + std::string* mutable_displayname(); + PROTOBUF_NODISCARD std::string* release_displayname(); + void set_allocated_displayname(std::string* displayname); private: - const std::string& _internal_uuid() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_uuid(const std::string& value); - std::string* _internal_mutable_uuid(); + const std::string& _internal_displayname() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_displayname(const std::string& value); + std::string* _internal_mutable_displayname(); public: - // required .SessionProtos.CallMessage.Type type = 1; - bool has_type() const; + // optional string profilePicture = 2; + bool has_profilepicture() const; private: - bool _internal_has_type() const; + bool _internal_has_profilepicture() const; public: - void clear_type(); - ::SessionProtos::CallMessage_Type type() const; - void set_type(::SessionProtos::CallMessage_Type value); + void clear_profilepicture(); + const std::string& profilepicture() const; + template + void set_profilepicture(ArgT0&& arg0, ArgT... args); + std::string* mutable_profilepicture(); + PROTOBUF_NODISCARD std::string* release_profilepicture(); + void set_allocated_profilepicture(std::string* profilepicture); private: - ::SessionProtos::CallMessage_Type _internal_type() const; - void _internal_set_type(::SessionProtos::CallMessage_Type value); + const std::string& _internal_profilepicture() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilepicture(const std::string& value); + std::string* _internal_mutable_profilepicture(); public: - // @@protoc_insertion_point(class_scope:SessionProtos.CallMessage) + // @@protoc_insertion_point(class_scope:SessionProtos.LokiProfile) private: class _Internal; - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField sdps_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t > sdpmlineindexes_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField sdpmids_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr uuid_; - int type_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr displayname_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilepicture_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class KeyPair final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.KeyPair) */ { +class DataMessage_Quote_QuotedAttachment final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Quote.QuotedAttachment) */ { public: - inline KeyPair() : KeyPair(nullptr) {} - ~KeyPair() override; - explicit PROTOBUF_CONSTEXPR KeyPair(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline DataMessage_Quote_QuotedAttachment() : DataMessage_Quote_QuotedAttachment(nullptr) {} + ~DataMessage_Quote_QuotedAttachment() override; + explicit PROTOBUF_CONSTEXPR DataMessage_Quote_QuotedAttachment(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - KeyPair(const KeyPair& from); - KeyPair(KeyPair&& from) noexcept - : KeyPair() { + DataMessage_Quote_QuotedAttachment(const DataMessage_Quote_QuotedAttachment& from); + DataMessage_Quote_QuotedAttachment(DataMessage_Quote_QuotedAttachment&& from) noexcept + : DataMessage_Quote_QuotedAttachment() { *this = ::std::move(from); } - inline KeyPair& operator=(const KeyPair& from) { + inline DataMessage_Quote_QuotedAttachment& operator=(const DataMessage_Quote_QuotedAttachment& from) { CopyFrom(from); return *this; } - inline KeyPair& operator=(KeyPair&& from) noexcept { + inline DataMessage_Quote_QuotedAttachment& operator=(DataMessage_Quote_QuotedAttachment&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -2348,27 +2624,36 @@ class KeyPair final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const KeyPair& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const DataMessage_Quote_QuotedAttachment& default_instance() { return *internal_default_instance(); } - static inline const KeyPair* internal_default_instance() { - return reinterpret_cast( - &_KeyPair_default_instance_); + static inline const DataMessage_Quote_QuotedAttachment* internal_default_instance() { + return reinterpret_cast( + &_DataMessage_Quote_QuotedAttachment_default_instance_); } static constexpr int kIndexInFileMessages = 9; - friend void swap(KeyPair& a, KeyPair& b) { + friend void swap(DataMessage_Quote_QuotedAttachment& a, DataMessage_Quote_QuotedAttachment& b) { a.Swap(&b); } - inline void Swap(KeyPair* other) { + inline void Swap(DataMessage_Quote_QuotedAttachment* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -2381,7 +2666,7 @@ class KeyPair final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(KeyPair* other) { + void UnsafeArenaSwap(DataMessage_Quote_QuotedAttachment* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -2389,12 +2674,18 @@ class KeyPair final : // implements Message ---------------------------------------------- - KeyPair* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + DataMessage_Quote_QuotedAttachment* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const KeyPair& from); - void MergeFrom(const KeyPair& from); + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const DataMessage_Quote_QuotedAttachment& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const DataMessage_Quote_QuotedAttachment& from) { + DataMessage_Quote_QuotedAttachment::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -2407,104 +2698,167 @@ class KeyPair final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(KeyPair* other); + void SetCachedSize(int size) const final; + void InternalSwap(DataMessage_Quote_QuotedAttachment* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.KeyPair"; + return "SessionProtos.DataMessage.Quote.QuotedAttachment"; } protected: - explicit KeyPair(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit DataMessage_Quote_QuotedAttachment(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - // nested types ---------------------------------------------------- + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - // accessors ------------------------------------------------------- + // nested types ---------------------------------------------------- - enum : int { - kPublicKeyFieldNumber = 1, - kPrivateKeyFieldNumber = 2, + typedef DataMessage_Quote_QuotedAttachment_Flags Flags; + static constexpr Flags VOICE_MESSAGE = + DataMessage_Quote_QuotedAttachment_Flags_VOICE_MESSAGE; + static inline bool Flags_IsValid(int value) { + return DataMessage_Quote_QuotedAttachment_Flags_IsValid(value); + } + static constexpr Flags Flags_MIN = + DataMessage_Quote_QuotedAttachment_Flags_Flags_MIN; + static constexpr Flags Flags_MAX = + DataMessage_Quote_QuotedAttachment_Flags_Flags_MAX; + static constexpr int Flags_ARRAYSIZE = + DataMessage_Quote_QuotedAttachment_Flags_Flags_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + Flags_descriptor() { + return DataMessage_Quote_QuotedAttachment_Flags_descriptor(); + } + template + static inline const std::string& Flags_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Flags_Name."); + return DataMessage_Quote_QuotedAttachment_Flags_Name(enum_t_value); + } + static inline bool Flags_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Flags* value) { + return DataMessage_Quote_QuotedAttachment_Flags_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + enum : int { + kContentTypeFieldNumber = 1, + kFileNameFieldNumber = 2, + kThumbnailFieldNumber = 3, + kFlagsFieldNumber = 4, }; - // required bytes publicKey = 1; - bool has_publickey() const; + // optional string contentType = 1; + bool has_contenttype() const; private: - bool _internal_has_publickey() const; + bool _internal_has_contenttype() const; public: - void clear_publickey(); - const std::string& publickey() const; + void clear_contenttype(); + const std::string& contenttype() const; template - void set_publickey(ArgT0&& arg0, ArgT... args); - std::string* mutable_publickey(); - PROTOBUF_NODISCARD std::string* release_publickey(); - void set_allocated_publickey(std::string* publickey); + void set_contenttype(ArgT0&& arg0, ArgT... args); + std::string* mutable_contenttype(); + PROTOBUF_NODISCARD std::string* release_contenttype(); + void set_allocated_contenttype(std::string* contenttype); private: - const std::string& _internal_publickey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_publickey(const std::string& value); - std::string* _internal_mutable_publickey(); + const std::string& _internal_contenttype() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_contenttype(const std::string& value); + std::string* _internal_mutable_contenttype(); public: - // required bytes privateKey = 2; - bool has_privatekey() const; + // optional string fileName = 2; + bool has_filename() const; private: - bool _internal_has_privatekey() const; + bool _internal_has_filename() const; public: - void clear_privatekey(); - const std::string& privatekey() const; + void clear_filename(); + const std::string& filename() const; template - void set_privatekey(ArgT0&& arg0, ArgT... args); - std::string* mutable_privatekey(); - PROTOBUF_NODISCARD std::string* release_privatekey(); - void set_allocated_privatekey(std::string* privatekey); + void set_filename(ArgT0&& arg0, ArgT... args); + std::string* mutable_filename(); + PROTOBUF_NODISCARD std::string* release_filename(); + void set_allocated_filename(std::string* filename); private: - const std::string& _internal_privatekey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_privatekey(const std::string& value); - std::string* _internal_mutable_privatekey(); + const std::string& _internal_filename() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_filename(const std::string& value); + std::string* _internal_mutable_filename(); public: - // @@protoc_insertion_point(class_scope:SessionProtos.KeyPair) + // optional .SessionProtos.AttachmentPointer thumbnail = 3; + bool has_thumbnail() const; + private: + bool _internal_has_thumbnail() const; + public: + void clear_thumbnail(); + const ::SessionProtos::AttachmentPointer& thumbnail() const; + PROTOBUF_NODISCARD ::SessionProtos::AttachmentPointer* release_thumbnail(); + ::SessionProtos::AttachmentPointer* mutable_thumbnail(); + void set_allocated_thumbnail(::SessionProtos::AttachmentPointer* thumbnail); + private: + const ::SessionProtos::AttachmentPointer& _internal_thumbnail() const; + ::SessionProtos::AttachmentPointer* _internal_mutable_thumbnail(); + public: + void unsafe_arena_set_allocated_thumbnail( + ::SessionProtos::AttachmentPointer* thumbnail); + ::SessionProtos::AttachmentPointer* unsafe_arena_release_thumbnail(); + + // optional uint32 flags = 4; + bool has_flags() const; + private: + bool _internal_has_flags() const; + public: + void clear_flags(); + uint32_t flags() const; + void set_flags(uint32_t value); + private: + uint32_t _internal_flags() const; + void _internal_set_flags(uint32_t value); + public: + + // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.Quote.QuotedAttachment) private: class _Internal; - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr publickey_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr privatekey_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr contenttype_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr filename_; + ::SessionProtos::AttachmentPointer* thumbnail_; + uint32_t flags_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class DataExtractionNotification final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataExtractionNotification) */ { +class DataMessage_Quote final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Quote) */ { public: - inline DataExtractionNotification() : DataExtractionNotification(nullptr) {} - ~DataExtractionNotification() override; - explicit PROTOBUF_CONSTEXPR DataExtractionNotification(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline DataMessage_Quote() : DataMessage_Quote(nullptr) {} + ~DataMessage_Quote() override; + explicit PROTOBUF_CONSTEXPR DataMessage_Quote(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - DataExtractionNotification(const DataExtractionNotification& from); - DataExtractionNotification(DataExtractionNotification&& from) noexcept - : DataExtractionNotification() { + DataMessage_Quote(const DataMessage_Quote& from); + DataMessage_Quote(DataMessage_Quote&& from) noexcept + : DataMessage_Quote() { *this = ::std::move(from); } - inline DataExtractionNotification& operator=(const DataExtractionNotification& from) { + inline DataMessage_Quote& operator=(const DataMessage_Quote& from) { CopyFrom(from); return *this; } - inline DataExtractionNotification& operator=(DataExtractionNotification&& from) noexcept { + inline DataMessage_Quote& operator=(DataMessage_Quote&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -2518,27 +2872,36 @@ class DataExtractionNotification final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const DataExtractionNotification& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const DataMessage_Quote& default_instance() { return *internal_default_instance(); } - static inline const DataExtractionNotification* internal_default_instance() { - return reinterpret_cast( - &_DataExtractionNotification_default_instance_); + static inline const DataMessage_Quote* internal_default_instance() { + return reinterpret_cast( + &_DataMessage_Quote_default_instance_); } static constexpr int kIndexInFileMessages = 10; - friend void swap(DataExtractionNotification& a, DataExtractionNotification& b) { + friend void swap(DataMessage_Quote& a, DataMessage_Quote& b) { a.Swap(&b); } - inline void Swap(DataExtractionNotification* other) { + inline void Swap(DataMessage_Quote* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -2551,7 +2914,7 @@ class DataExtractionNotification final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataExtractionNotification* other) { + void UnsafeArenaSwap(DataMessage_Quote* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -2559,12 +2922,18 @@ class DataExtractionNotification final : // implements Message ---------------------------------------------- - DataExtractionNotification* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + DataMessage_Quote* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const DataExtractionNotification& from); - void MergeFrom(const DataExtractionNotification& from); + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const DataMessage_Quote& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const DataMessage_Quote& from) { + DataMessage_Quote::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -2577,117 +2946,144 @@ class DataExtractionNotification final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(DataExtractionNotification* other); + void SetCachedSize(int size) const final; + void InternalSwap(DataMessage_Quote* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataExtractionNotification"; + return "SessionProtos.DataMessage.Quote"; } protected: - explicit DataExtractionNotification(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit DataMessage_Quote(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; // nested types ---------------------------------------------------- - typedef DataExtractionNotification_Type Type; - static constexpr Type SCREENSHOT = - DataExtractionNotification_Type_SCREENSHOT; - static constexpr Type MEDIA_SAVED = - DataExtractionNotification_Type_MEDIA_SAVED; - static inline bool Type_IsValid(int value) { - return DataExtractionNotification_Type_IsValid(value); - } - static constexpr Type Type_MIN = - DataExtractionNotification_Type_Type_MIN; - static constexpr Type Type_MAX = - DataExtractionNotification_Type_Type_MAX; - static constexpr int Type_ARRAYSIZE = - DataExtractionNotification_Type_Type_ARRAYSIZE; - template - static inline const std::string& Type_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function Type_Name."); - return DataExtractionNotification_Type_Name(enum_t_value); - } - static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Type* value) { - return DataExtractionNotification_Type_Parse(name, value); - } + typedef DataMessage_Quote_QuotedAttachment QuotedAttachment; // accessors ------------------------------------------------------- enum : int { - kTimestampFieldNumber = 2, - kTypeFieldNumber = 1, + kAttachmentsFieldNumber = 4, + kAuthorFieldNumber = 2, + kTextFieldNumber = 3, + kIdFieldNumber = 1, }; - // optional uint64 timestamp = 2; - bool has_timestamp() const; + // repeated .SessionProtos.DataMessage.Quote.QuotedAttachment attachments = 4; + int attachments_size() const; private: - bool _internal_has_timestamp() const; + int _internal_attachments_size() const; public: - void clear_timestamp(); - uint64_t timestamp() const; - void set_timestamp(uint64_t value); + void clear_attachments(); + ::SessionProtos::DataMessage_Quote_QuotedAttachment* mutable_attachments(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Quote_QuotedAttachment >* + mutable_attachments(); private: - uint64_t _internal_timestamp() const; - void _internal_set_timestamp(uint64_t value); + const ::SessionProtos::DataMessage_Quote_QuotedAttachment& _internal_attachments(int index) const; + ::SessionProtos::DataMessage_Quote_QuotedAttachment* _internal_add_attachments(); public: + const ::SessionProtos::DataMessage_Quote_QuotedAttachment& attachments(int index) const; + ::SessionProtos::DataMessage_Quote_QuotedAttachment* add_attachments(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Quote_QuotedAttachment >& + attachments() const; - // required .SessionProtos.DataExtractionNotification.Type type = 1; - bool has_type() const; + // required string author = 2; + bool has_author() const; private: - bool _internal_has_type() const; + bool _internal_has_author() const; public: - void clear_type(); - ::SessionProtos::DataExtractionNotification_Type type() const; - void set_type(::SessionProtos::DataExtractionNotification_Type value); + void clear_author(); + const std::string& author() const; + template + void set_author(ArgT0&& arg0, ArgT... args); + std::string* mutable_author(); + PROTOBUF_NODISCARD std::string* release_author(); + void set_allocated_author(std::string* author); private: - ::SessionProtos::DataExtractionNotification_Type _internal_type() const; - void _internal_set_type(::SessionProtos::DataExtractionNotification_Type value); + const std::string& _internal_author() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_author(const std::string& value); + std::string* _internal_mutable_author(); public: - // @@protoc_insertion_point(class_scope:SessionProtos.DataExtractionNotification) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; + // optional string text = 3; + bool has_text() const; + private: + bool _internal_has_text() const; + public: + void clear_text(); + const std::string& text() const; + template + void set_text(ArgT0&& arg0, ArgT... args); + std::string* mutable_text(); + PROTOBUF_NODISCARD std::string* release_text(); + void set_allocated_text(std::string* text); + private: + const std::string& _internal_text() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_text(const std::string& value); + std::string* _internal_mutable_text(); + public: + + // required uint64 id = 1; + bool has_id() const; + private: + bool _internal_has_id() const; + public: + void clear_id(); + uint64_t id() const; + void set_id(uint64_t value); + private: + uint64_t _internal_id() const; + void _internal_set_id(uint64_t value); + public: + + // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.Quote) + private: + class _Internal; + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - uint64_t timestamp_; - int type_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Quote_QuotedAttachment > attachments_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr author_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr text_; + uint64_t id_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class LokiProfile final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.LokiProfile) */ { +class DataMessage_Preview final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Preview) */ { public: - inline LokiProfile() : LokiProfile(nullptr) {} - ~LokiProfile() override; - explicit PROTOBUF_CONSTEXPR LokiProfile(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline DataMessage_Preview() : DataMessage_Preview(nullptr) {} + ~DataMessage_Preview() override; + explicit PROTOBUF_CONSTEXPR DataMessage_Preview(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - LokiProfile(const LokiProfile& from); - LokiProfile(LokiProfile&& from) noexcept - : LokiProfile() { + DataMessage_Preview(const DataMessage_Preview& from); + DataMessage_Preview(DataMessage_Preview&& from) noexcept + : DataMessage_Preview() { *this = ::std::move(from); } - inline LokiProfile& operator=(const LokiProfile& from) { + inline DataMessage_Preview& operator=(const DataMessage_Preview& from) { CopyFrom(from); return *this; } - inline LokiProfile& operator=(LokiProfile&& from) noexcept { + inline DataMessage_Preview& operator=(DataMessage_Preview&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -2701,27 +3097,36 @@ class LokiProfile final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const LokiProfile& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const DataMessage_Preview& default_instance() { return *internal_default_instance(); } - static inline const LokiProfile* internal_default_instance() { - return reinterpret_cast( - &_LokiProfile_default_instance_); + static inline const DataMessage_Preview* internal_default_instance() { + return reinterpret_cast( + &_DataMessage_Preview_default_instance_); } static constexpr int kIndexInFileMessages = 11; - friend void swap(LokiProfile& a, LokiProfile& b) { + friend void swap(DataMessage_Preview& a, DataMessage_Preview& b) { a.Swap(&b); } - inline void Swap(LokiProfile* other) { + inline void Swap(DataMessage_Preview* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -2734,7 +3139,7 @@ class LokiProfile final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(LokiProfile* other) { + void UnsafeArenaSwap(DataMessage_Preview* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -2742,12 +3147,18 @@ class LokiProfile final : // implements Message ---------------------------------------------- - LokiProfile* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + DataMessage_Preview* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const LokiProfile& from); - void MergeFrom(const LokiProfile& from); + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const DataMessage_Preview& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const DataMessage_Preview& from) { + DataMessage_Preview::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -2760,66 +3171,88 @@ class LokiProfile final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(LokiProfile* other); + void SetCachedSize(int size) const final; + void InternalSwap(DataMessage_Preview* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.LokiProfile"; + return "SessionProtos.DataMessage.Preview"; } protected: - explicit LokiProfile(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit DataMessage_Preview(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { - kDisplayNameFieldNumber = 1, - kProfilePictureFieldNumber = 2, + kUrlFieldNumber = 1, + kTitleFieldNumber = 2, + kImageFieldNumber = 3, }; - // optional string displayName = 1; - bool has_displayname() const; + // required string url = 1; + bool has_url() const; private: - bool _internal_has_displayname() const; + bool _internal_has_url() const; public: - void clear_displayname(); - const std::string& displayname() const; + void clear_url(); + const std::string& url() const; template - void set_displayname(ArgT0&& arg0, ArgT... args); - std::string* mutable_displayname(); - PROTOBUF_NODISCARD std::string* release_displayname(); - void set_allocated_displayname(std::string* displayname); + void set_url(ArgT0&& arg0, ArgT... args); + std::string* mutable_url(); + PROTOBUF_NODISCARD std::string* release_url(); + void set_allocated_url(std::string* url); private: - const std::string& _internal_displayname() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_displayname(const std::string& value); - std::string* _internal_mutable_displayname(); + const std::string& _internal_url() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_url(const std::string& value); + std::string* _internal_mutable_url(); public: - // optional string profilePicture = 2; - bool has_profilepicture() const; + // optional string title = 2; + bool has_title() const; private: - bool _internal_has_profilepicture() const; + bool _internal_has_title() const; public: - void clear_profilepicture(); - const std::string& profilepicture() const; + void clear_title(); + const std::string& title() const; template - void set_profilepicture(ArgT0&& arg0, ArgT... args); - std::string* mutable_profilepicture(); - PROTOBUF_NODISCARD std::string* release_profilepicture(); - void set_allocated_profilepicture(std::string* profilepicture); + void set_title(ArgT0&& arg0, ArgT... args); + std::string* mutable_title(); + PROTOBUF_NODISCARD std::string* release_title(); + void set_allocated_title(std::string* title); private: - const std::string& _internal_profilepicture() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilepicture(const std::string& value); - std::string* _internal_mutable_profilepicture(); + const std::string& _internal_title() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_title(const std::string& value); + std::string* _internal_mutable_title(); public: - // @@protoc_insertion_point(class_scope:SessionProtos.LokiProfile) + // optional .SessionProtos.AttachmentPointer image = 3; + bool has_image() const; + private: + bool _internal_has_image() const; + public: + void clear_image(); + const ::SessionProtos::AttachmentPointer& image() const; + PROTOBUF_NODISCARD ::SessionProtos::AttachmentPointer* release_image(); + ::SessionProtos::AttachmentPointer* mutable_image(); + void set_allocated_image(::SessionProtos::AttachmentPointer* image); + private: + const ::SessionProtos::AttachmentPointer& _internal_image() const; + ::SessionProtos::AttachmentPointer* _internal_mutable_image(); + public: + void unsafe_arena_set_allocated_image( + ::SessionProtos::AttachmentPointer* image); + ::SessionProtos::AttachmentPointer* unsafe_arena_release_image(); + + // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.Preview) private: class _Internal; @@ -2829,32 +3262,33 @@ class LokiProfile final : struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr displayname_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilepicture_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr url_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr title_; + ::SessionProtos::AttachmentPointer* image_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class DataMessage_Quote_QuotedAttachment final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Quote.QuotedAttachment) */ { +class DataMessage_Reaction final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Reaction) */ { public: - inline DataMessage_Quote_QuotedAttachment() : DataMessage_Quote_QuotedAttachment(nullptr) {} - ~DataMessage_Quote_QuotedAttachment() override; - explicit PROTOBUF_CONSTEXPR DataMessage_Quote_QuotedAttachment(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline DataMessage_Reaction() : DataMessage_Reaction(nullptr) {} + ~DataMessage_Reaction() override; + explicit PROTOBUF_CONSTEXPR DataMessage_Reaction(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - DataMessage_Quote_QuotedAttachment(const DataMessage_Quote_QuotedAttachment& from); - DataMessage_Quote_QuotedAttachment(DataMessage_Quote_QuotedAttachment&& from) noexcept - : DataMessage_Quote_QuotedAttachment() { + DataMessage_Reaction(const DataMessage_Reaction& from); + DataMessage_Reaction(DataMessage_Reaction&& from) noexcept + : DataMessage_Reaction() { *this = ::std::move(from); } - inline DataMessage_Quote_QuotedAttachment& operator=(const DataMessage_Quote_QuotedAttachment& from) { + inline DataMessage_Reaction& operator=(const DataMessage_Reaction& from) { CopyFrom(from); return *this; } - inline DataMessage_Quote_QuotedAttachment& operator=(DataMessage_Quote_QuotedAttachment&& from) noexcept { + inline DataMessage_Reaction& operator=(DataMessage_Reaction&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -2868,27 +3302,36 @@ class DataMessage_Quote_QuotedAttachment final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const DataMessage_Quote_QuotedAttachment& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const DataMessage_Reaction& default_instance() { return *internal_default_instance(); } - static inline const DataMessage_Quote_QuotedAttachment* internal_default_instance() { - return reinterpret_cast( - &_DataMessage_Quote_QuotedAttachment_default_instance_); + static inline const DataMessage_Reaction* internal_default_instance() { + return reinterpret_cast( + &_DataMessage_Reaction_default_instance_); } static constexpr int kIndexInFileMessages = 12; - friend void swap(DataMessage_Quote_QuotedAttachment& a, DataMessage_Quote_QuotedAttachment& b) { + friend void swap(DataMessage_Reaction& a, DataMessage_Reaction& b) { a.Swap(&b); } - inline void Swap(DataMessage_Quote_QuotedAttachment* other) { + inline void Swap(DataMessage_Reaction* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -2901,7 +3344,7 @@ class DataMessage_Quote_QuotedAttachment final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataMessage_Quote_QuotedAttachment* other) { + void UnsafeArenaSwap(DataMessage_Reaction* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -2909,12 +3352,18 @@ class DataMessage_Quote_QuotedAttachment final : // implements Message ---------------------------------------------- - DataMessage_Quote_QuotedAttachment* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + DataMessage_Reaction* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const DataMessage_Quote_QuotedAttachment& from); - void MergeFrom(const DataMessage_Quote_QuotedAttachment& from); + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const DataMessage_Reaction& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const DataMessage_Reaction& from) { + DataMessage_Reaction::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -2927,160 +3376,167 @@ class DataMessage_Quote_QuotedAttachment final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(DataMessage_Quote_QuotedAttachment* other); + void SetCachedSize(int size) const final; + void InternalSwap(DataMessage_Reaction* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataMessage.Quote.QuotedAttachment"; + return "SessionProtos.DataMessage.Reaction"; } protected: - explicit DataMessage_Quote_QuotedAttachment(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit DataMessage_Reaction(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; // nested types ---------------------------------------------------- - typedef DataMessage_Quote_QuotedAttachment_Flags Flags; - static constexpr Flags VOICE_MESSAGE = - DataMessage_Quote_QuotedAttachment_Flags_VOICE_MESSAGE; - static inline bool Flags_IsValid(int value) { - return DataMessage_Quote_QuotedAttachment_Flags_IsValid(value); + typedef DataMessage_Reaction_Action Action; + static constexpr Action REACT = + DataMessage_Reaction_Action_REACT; + static constexpr Action REMOVE = + DataMessage_Reaction_Action_REMOVE; + static inline bool Action_IsValid(int value) { + return DataMessage_Reaction_Action_IsValid(value); + } + static constexpr Action Action_MIN = + DataMessage_Reaction_Action_Action_MIN; + static constexpr Action Action_MAX = + DataMessage_Reaction_Action_Action_MAX; + static constexpr int Action_ARRAYSIZE = + DataMessage_Reaction_Action_Action_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + Action_descriptor() { + return DataMessage_Reaction_Action_descriptor(); } - static constexpr Flags Flags_MIN = - DataMessage_Quote_QuotedAttachment_Flags_Flags_MIN; - static constexpr Flags Flags_MAX = - DataMessage_Quote_QuotedAttachment_Flags_Flags_MAX; - static constexpr int Flags_ARRAYSIZE = - DataMessage_Quote_QuotedAttachment_Flags_Flags_ARRAYSIZE; template - static inline const std::string& Flags_Name(T enum_t_value) { - static_assert(::std::is_same::value || + static inline const std::string& Action_Name(T enum_t_value) { + static_assert(::std::is_same::value || ::std::is_integral::value, - "Incorrect type passed to function Flags_Name."); - return DataMessage_Quote_QuotedAttachment_Flags_Name(enum_t_value); + "Incorrect type passed to function Action_Name."); + return DataMessage_Reaction_Action_Name(enum_t_value); } - static inline bool Flags_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Flags* value) { - return DataMessage_Quote_QuotedAttachment_Flags_Parse(name, value); + static inline bool Action_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Action* value) { + return DataMessage_Reaction_Action_Parse(name, value); } // accessors ------------------------------------------------------- enum : int { - kContentTypeFieldNumber = 1, - kFileNameFieldNumber = 2, - kThumbnailFieldNumber = 3, - kFlagsFieldNumber = 4, + kAuthorFieldNumber = 2, + kEmojiFieldNumber = 3, + kIdFieldNumber = 1, + kActionFieldNumber = 4, }; - // optional string contentType = 1; - bool has_contenttype() const; + // required string author = 2; + bool has_author() const; private: - bool _internal_has_contenttype() const; + bool _internal_has_author() const; public: - void clear_contenttype(); - const std::string& contenttype() const; + void clear_author(); + const std::string& author() const; template - void set_contenttype(ArgT0&& arg0, ArgT... args); - std::string* mutable_contenttype(); - PROTOBUF_NODISCARD std::string* release_contenttype(); - void set_allocated_contenttype(std::string* contenttype); + void set_author(ArgT0&& arg0, ArgT... args); + std::string* mutable_author(); + PROTOBUF_NODISCARD std::string* release_author(); + void set_allocated_author(std::string* author); private: - const std::string& _internal_contenttype() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_contenttype(const std::string& value); - std::string* _internal_mutable_contenttype(); + const std::string& _internal_author() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_author(const std::string& value); + std::string* _internal_mutable_author(); public: - // optional string fileName = 2; - bool has_filename() const; + // optional string emoji = 3; + bool has_emoji() const; private: - bool _internal_has_filename() const; + bool _internal_has_emoji() const; public: - void clear_filename(); - const std::string& filename() const; + void clear_emoji(); + const std::string& emoji() const; template - void set_filename(ArgT0&& arg0, ArgT... args); - std::string* mutable_filename(); - PROTOBUF_NODISCARD std::string* release_filename(); - void set_allocated_filename(std::string* filename); + void set_emoji(ArgT0&& arg0, ArgT... args); + std::string* mutable_emoji(); + PROTOBUF_NODISCARD std::string* release_emoji(); + void set_allocated_emoji(std::string* emoji); private: - const std::string& _internal_filename() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_filename(const std::string& value); - std::string* _internal_mutable_filename(); + const std::string& _internal_emoji() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_emoji(const std::string& value); + std::string* _internal_mutable_emoji(); public: - // optional .SessionProtos.AttachmentPointer thumbnail = 3; - bool has_thumbnail() const; + // required uint64 id = 1; + bool has_id() const; private: - bool _internal_has_thumbnail() const; + bool _internal_has_id() const; public: - void clear_thumbnail(); - const ::SessionProtos::AttachmentPointer& thumbnail() const; - PROTOBUF_NODISCARD ::SessionProtos::AttachmentPointer* release_thumbnail(); - ::SessionProtos::AttachmentPointer* mutable_thumbnail(); - void set_allocated_thumbnail(::SessionProtos::AttachmentPointer* thumbnail); + void clear_id(); + uint64_t id() const; + void set_id(uint64_t value); private: - const ::SessionProtos::AttachmentPointer& _internal_thumbnail() const; - ::SessionProtos::AttachmentPointer* _internal_mutable_thumbnail(); + uint64_t _internal_id() const; + void _internal_set_id(uint64_t value); public: - void unsafe_arena_set_allocated_thumbnail( - ::SessionProtos::AttachmentPointer* thumbnail); - ::SessionProtos::AttachmentPointer* unsafe_arena_release_thumbnail(); - // optional uint32 flags = 4; - bool has_flags() const; + // required .SessionProtos.DataMessage.Reaction.Action action = 4; + bool has_action() const; private: - bool _internal_has_flags() const; + bool _internal_has_action() const; public: - void clear_flags(); - uint32_t flags() const; - void set_flags(uint32_t value); + void clear_action(); + ::SessionProtos::DataMessage_Reaction_Action action() const; + void set_action(::SessionProtos::DataMessage_Reaction_Action value); private: - uint32_t _internal_flags() const; - void _internal_set_flags(uint32_t value); + ::SessionProtos::DataMessage_Reaction_Action _internal_action() const; + void _internal_set_action(::SessionProtos::DataMessage_Reaction_Action value); public: - // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.Quote.QuotedAttachment) + // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.Reaction) private: class _Internal; + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr contenttype_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr filename_; - ::SessionProtos::AttachmentPointer* thumbnail_; - uint32_t flags_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr author_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr emoji_; + uint64_t id_; + int action_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class DataMessage_Quote final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Quote) */ { +class DataMessage_OpenGroupInvitation final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.OpenGroupInvitation) */ { public: - inline DataMessage_Quote() : DataMessage_Quote(nullptr) {} - ~DataMessage_Quote() override; - explicit PROTOBUF_CONSTEXPR DataMessage_Quote(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline DataMessage_OpenGroupInvitation() : DataMessage_OpenGroupInvitation(nullptr) {} + ~DataMessage_OpenGroupInvitation() override; + explicit PROTOBUF_CONSTEXPR DataMessage_OpenGroupInvitation(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - DataMessage_Quote(const DataMessage_Quote& from); - DataMessage_Quote(DataMessage_Quote&& from) noexcept - : DataMessage_Quote() { + DataMessage_OpenGroupInvitation(const DataMessage_OpenGroupInvitation& from); + DataMessage_OpenGroupInvitation(DataMessage_OpenGroupInvitation&& from) noexcept + : DataMessage_OpenGroupInvitation() { *this = ::std::move(from); } - inline DataMessage_Quote& operator=(const DataMessage_Quote& from) { + inline DataMessage_OpenGroupInvitation& operator=(const DataMessage_OpenGroupInvitation& from) { CopyFrom(from); return *this; } - inline DataMessage_Quote& operator=(DataMessage_Quote&& from) noexcept { + inline DataMessage_OpenGroupInvitation& operator=(DataMessage_OpenGroupInvitation&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -3094,27 +3550,36 @@ class DataMessage_Quote final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const DataMessage_Quote& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const DataMessage_OpenGroupInvitation& default_instance() { return *internal_default_instance(); } - static inline const DataMessage_Quote* internal_default_instance() { - return reinterpret_cast( - &_DataMessage_Quote_default_instance_); + static inline const DataMessage_OpenGroupInvitation* internal_default_instance() { + return reinterpret_cast( + &_DataMessage_OpenGroupInvitation_default_instance_); } static constexpr int kIndexInFileMessages = 13; - friend void swap(DataMessage_Quote& a, DataMessage_Quote& b) { + friend void swap(DataMessage_OpenGroupInvitation& a, DataMessage_OpenGroupInvitation& b) { a.Swap(&b); } - inline void Swap(DataMessage_Quote* other) { + inline void Swap(DataMessage_OpenGroupInvitation* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -3127,7 +3592,7 @@ class DataMessage_Quote final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataMessage_Quote* other) { + void UnsafeArenaSwap(DataMessage_OpenGroupInvitation* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -3135,12 +3600,18 @@ class DataMessage_Quote final : // implements Message ---------------------------------------------- - DataMessage_Quote* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + DataMessage_OpenGroupInvitation* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const DataMessage_Quote& from); - void MergeFrom(const DataMessage_Quote& from); + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const DataMessage_OpenGroupInvitation& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const DataMessage_OpenGroupInvitation& from) { + DataMessage_OpenGroupInvitation::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3153,101 +3624,69 @@ class DataMessage_Quote final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(DataMessage_Quote* other); + void SetCachedSize(int size) const final; + void InternalSwap(DataMessage_OpenGroupInvitation* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataMessage.Quote"; + return "SessionProtos.DataMessage.OpenGroupInvitation"; } protected: - explicit DataMessage_Quote(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit DataMessage_OpenGroupInvitation(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - // nested types ---------------------------------------------------- + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - typedef DataMessage_Quote_QuotedAttachment QuotedAttachment; + // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { - kAttachmentsFieldNumber = 4, - kAuthorFieldNumber = 2, - kTextFieldNumber = 3, - kIdFieldNumber = 1, + kUrlFieldNumber = 1, + kNameFieldNumber = 3, }; - // repeated .SessionProtos.DataMessage.Quote.QuotedAttachment attachments = 4; - int attachments_size() const; - private: - int _internal_attachments_size() const; - public: - void clear_attachments(); - ::SessionProtos::DataMessage_Quote_QuotedAttachment* mutable_attachments(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Quote_QuotedAttachment >* - mutable_attachments(); - private: - const ::SessionProtos::DataMessage_Quote_QuotedAttachment& _internal_attachments(int index) const; - ::SessionProtos::DataMessage_Quote_QuotedAttachment* _internal_add_attachments(); - public: - const ::SessionProtos::DataMessage_Quote_QuotedAttachment& attachments(int index) const; - ::SessionProtos::DataMessage_Quote_QuotedAttachment* add_attachments(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Quote_QuotedAttachment >& - attachments() const; - - // required string author = 2; - bool has_author() const; + // required string url = 1; + bool has_url() const; private: - bool _internal_has_author() const; + bool _internal_has_url() const; public: - void clear_author(); - const std::string& author() const; + void clear_url(); + const std::string& url() const; template - void set_author(ArgT0&& arg0, ArgT... args); - std::string* mutable_author(); - PROTOBUF_NODISCARD std::string* release_author(); - void set_allocated_author(std::string* author); + void set_url(ArgT0&& arg0, ArgT... args); + std::string* mutable_url(); + PROTOBUF_NODISCARD std::string* release_url(); + void set_allocated_url(std::string* url); private: - const std::string& _internal_author() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_author(const std::string& value); - std::string* _internal_mutable_author(); + const std::string& _internal_url() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_url(const std::string& value); + std::string* _internal_mutable_url(); public: - // optional string text = 3; - bool has_text() const; + // required string name = 3; + bool has_name() const; private: - bool _internal_has_text() const; + bool _internal_has_name() const; public: - void clear_text(); - const std::string& text() const; + void clear_name(); + const std::string& name() const; template - void set_text(ArgT0&& arg0, ArgT... args); - std::string* mutable_text(); - PROTOBUF_NODISCARD std::string* release_text(); - void set_allocated_text(std::string* text); - private: - const std::string& _internal_text() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_text(const std::string& value); - std::string* _internal_mutable_text(); - public: - - // required uint64 id = 1; - bool has_id() const; - private: - bool _internal_has_id() const; - public: - void clear_id(); - uint64_t id() const; - void set_id(uint64_t value); + void set_name(ArgT0&& arg0, ArgT... args); + std::string* mutable_name(); + PROTOBUF_NODISCARD std::string* release_name(); + void set_allocated_name(std::string* name); private: - uint64_t _internal_id() const; - void _internal_set_id(uint64_t value); + const std::string& _internal_name() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + std::string* _internal_mutable_name(); public: - // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.Quote) + // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.OpenGroupInvitation) private: class _Internal; @@ -3260,34 +3699,32 @@ class DataMessage_Quote final : struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Quote_QuotedAttachment > attachments_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr author_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr text_; - uint64_t id_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr url_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class DataMessage_Preview final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Preview) */ { +class DataMessage final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage) */ { public: - inline DataMessage_Preview() : DataMessage_Preview(nullptr) {} - ~DataMessage_Preview() override; - explicit PROTOBUF_CONSTEXPR DataMessage_Preview(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline DataMessage() : DataMessage(nullptr) {} + ~DataMessage() override; + explicit PROTOBUF_CONSTEXPR DataMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - DataMessage_Preview(const DataMessage_Preview& from); - DataMessage_Preview(DataMessage_Preview&& from) noexcept - : DataMessage_Preview() { + DataMessage(const DataMessage& from); + DataMessage(DataMessage&& from) noexcept + : DataMessage() { *this = ::std::move(from); } - inline DataMessage_Preview& operator=(const DataMessage_Preview& from) { + inline DataMessage& operator=(const DataMessage& from) { CopyFrom(from); return *this; } - inline DataMessage_Preview& operator=(DataMessage_Preview&& from) noexcept { + inline DataMessage& operator=(DataMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -3301,27 +3738,36 @@ class DataMessage_Preview final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const DataMessage_Preview& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const DataMessage& default_instance() { return *internal_default_instance(); } - static inline const DataMessage_Preview* internal_default_instance() { - return reinterpret_cast( - &_DataMessage_Preview_default_instance_); + static inline const DataMessage* internal_default_instance() { + return reinterpret_cast( + &_DataMessage_default_instance_); } static constexpr int kIndexInFileMessages = 14; - friend void swap(DataMessage_Preview& a, DataMessage_Preview& b) { + friend void swap(DataMessage& a, DataMessage& b) { a.Swap(&b); } - inline void Swap(DataMessage_Preview* other) { + inline void Swap(DataMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -3334,7 +3780,7 @@ class DataMessage_Preview final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataMessage_Preview* other) { + void UnsafeArenaSwap(DataMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -3342,12 +3788,18 @@ class DataMessage_Preview final : // implements Message ---------------------------------------------- - DataMessage_Preview* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + DataMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const DataMessage_Preview& from); - void MergeFrom(const DataMessage_Preview& from); + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const DataMessage& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const DataMessage& from) { + DataMessage::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3360,121 +3812,342 @@ class DataMessage_Preview final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(DataMessage_Preview* other); + void SetCachedSize(int size) const final; + void InternalSwap(DataMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataMessage.Preview"; + return "SessionProtos.DataMessage"; } protected: - explicit DataMessage_Preview(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit DataMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; // nested types ---------------------------------------------------- + typedef DataMessage_Quote Quote; + typedef DataMessage_Preview Preview; + typedef DataMessage_Reaction Reaction; + typedef DataMessage_OpenGroupInvitation OpenGroupInvitation; + + typedef DataMessage_Flags Flags; + static constexpr Flags EXPIRATION_TIMER_UPDATE = + DataMessage_Flags_EXPIRATION_TIMER_UPDATE; + static inline bool Flags_IsValid(int value) { + return DataMessage_Flags_IsValid(value); + } + static constexpr Flags Flags_MIN = + DataMessage_Flags_Flags_MIN; + static constexpr Flags Flags_MAX = + DataMessage_Flags_Flags_MAX; + static constexpr int Flags_ARRAYSIZE = + DataMessage_Flags_Flags_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + Flags_descriptor() { + return DataMessage_Flags_descriptor(); + } + template + static inline const std::string& Flags_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Flags_Name."); + return DataMessage_Flags_Name(enum_t_value); + } + static inline bool Flags_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Flags* value) { + return DataMessage_Flags_Parse(name, value); + } + // accessors ------------------------------------------------------- enum : int { - kUrlFieldNumber = 1, - kTitleFieldNumber = 2, - kImageFieldNumber = 3, + kAttachmentsFieldNumber = 2, + kPreviewFieldNumber = 10, + kBodyFieldNumber = 1, + kProfileKeyFieldNumber = 6, + kSyncTargetFieldNumber = 105, + kQuoteFieldNumber = 8, + kReactionFieldNumber = 11, + kProfileFieldNumber = 101, + kOpenGroupInvitationFieldNumber = 102, + kGroupUpdateMessageFieldNumber = 120, + kTimestampFieldNumber = 7, + kFlagsFieldNumber = 4, + kBlocksCommunityMessageRequestsFieldNumber = 106, }; - // required string url = 1; - bool has_url() const; + // repeated .SessionProtos.AttachmentPointer attachments = 2; + int attachments_size() const; private: - bool _internal_has_url() const; + int _internal_attachments_size() const; public: - void clear_url(); - const std::string& url() const; - template - void set_url(ArgT0&& arg0, ArgT... args); - std::string* mutable_url(); - PROTOBUF_NODISCARD std::string* release_url(); - void set_allocated_url(std::string* url); + void clear_attachments(); + ::SessionProtos::AttachmentPointer* mutable_attachments(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer >* + mutable_attachments(); private: - const std::string& _internal_url() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_url(const std::string& value); - std::string* _internal_mutable_url(); + const ::SessionProtos::AttachmentPointer& _internal_attachments(int index) const; + ::SessionProtos::AttachmentPointer* _internal_add_attachments(); + public: + const ::SessionProtos::AttachmentPointer& attachments(int index) const; + ::SessionProtos::AttachmentPointer* add_attachments(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer >& + attachments() const; + + // repeated .SessionProtos.DataMessage.Preview preview = 10; + int preview_size() const; + private: + int _internal_preview_size() const; + public: + void clear_preview(); + ::SessionProtos::DataMessage_Preview* mutable_preview(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview >* + mutable_preview(); + private: + const ::SessionProtos::DataMessage_Preview& _internal_preview(int index) const; + ::SessionProtos::DataMessage_Preview* _internal_add_preview(); public: + const ::SessionProtos::DataMessage_Preview& preview(int index) const; + ::SessionProtos::DataMessage_Preview* add_preview(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview >& + preview() const; - // optional string title = 2; - bool has_title() const; + // optional string body = 1; + bool has_body() const; private: - bool _internal_has_title() const; + bool _internal_has_body() const; public: - void clear_title(); - const std::string& title() const; + void clear_body(); + const std::string& body() const; template - void set_title(ArgT0&& arg0, ArgT... args); - std::string* mutable_title(); - PROTOBUF_NODISCARD std::string* release_title(); - void set_allocated_title(std::string* title); + void set_body(ArgT0&& arg0, ArgT... args); + std::string* mutable_body(); + PROTOBUF_NODISCARD std::string* release_body(); + void set_allocated_body(std::string* body); private: - const std::string& _internal_title() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_title(const std::string& value); - std::string* _internal_mutable_title(); + const std::string& _internal_body() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_body(const std::string& value); + std::string* _internal_mutable_body(); public: - // optional .SessionProtos.AttachmentPointer image = 3; - bool has_image() const; + // optional bytes profileKey = 6; + bool has_profilekey() const; private: - bool _internal_has_image() const; + bool _internal_has_profilekey() const; public: - void clear_image(); - const ::SessionProtos::AttachmentPointer& image() const; - PROTOBUF_NODISCARD ::SessionProtos::AttachmentPointer* release_image(); - ::SessionProtos::AttachmentPointer* mutable_image(); - void set_allocated_image(::SessionProtos::AttachmentPointer* image); + void clear_profilekey(); + const std::string& profilekey() const; + template + void set_profilekey(ArgT0&& arg0, ArgT... args); + std::string* mutable_profilekey(); + PROTOBUF_NODISCARD std::string* release_profilekey(); + void set_allocated_profilekey(std::string* profilekey); private: - const ::SessionProtos::AttachmentPointer& _internal_image() const; - ::SessionProtos::AttachmentPointer* _internal_mutable_image(); + const std::string& _internal_profilekey() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilekey(const std::string& value); + std::string* _internal_mutable_profilekey(); public: - void unsafe_arena_set_allocated_image( - ::SessionProtos::AttachmentPointer* image); - ::SessionProtos::AttachmentPointer* unsafe_arena_release_image(); - - // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.Preview) - private: - class _Internal; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr url_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr title_; - ::SessionProtos::AttachmentPointer* image_; - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_SessionProtos_2eproto; -}; -// ------------------------------------------------------------------- + // optional string syncTarget = 105; + bool has_synctarget() const; + private: + bool _internal_has_synctarget() const; + public: + void clear_synctarget(); + const std::string& synctarget() const; + template + void set_synctarget(ArgT0&& arg0, ArgT... args); + std::string* mutable_synctarget(); + PROTOBUF_NODISCARD std::string* release_synctarget(); + void set_allocated_synctarget(std::string* synctarget); + private: + const std::string& _internal_synctarget() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_synctarget(const std::string& value); + std::string* _internal_mutable_synctarget(); + public: -class DataMessage_Reaction final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Reaction) */ { - public: - inline DataMessage_Reaction() : DataMessage_Reaction(nullptr) {} - ~DataMessage_Reaction() override; - explicit PROTOBUF_CONSTEXPR DataMessage_Reaction(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + // optional .SessionProtos.DataMessage.Quote quote = 8; + bool has_quote() const; + private: + bool _internal_has_quote() const; + public: + void clear_quote(); + const ::SessionProtos::DataMessage_Quote& quote() const; + PROTOBUF_NODISCARD ::SessionProtos::DataMessage_Quote* release_quote(); + ::SessionProtos::DataMessage_Quote* mutable_quote(); + void set_allocated_quote(::SessionProtos::DataMessage_Quote* quote); + private: + const ::SessionProtos::DataMessage_Quote& _internal_quote() const; + ::SessionProtos::DataMessage_Quote* _internal_mutable_quote(); + public: + void unsafe_arena_set_allocated_quote( + ::SessionProtos::DataMessage_Quote* quote); + ::SessionProtos::DataMessage_Quote* unsafe_arena_release_quote(); - DataMessage_Reaction(const DataMessage_Reaction& from); - DataMessage_Reaction(DataMessage_Reaction&& from) noexcept - : DataMessage_Reaction() { + // optional .SessionProtos.DataMessage.Reaction reaction = 11; + bool has_reaction() const; + private: + bool _internal_has_reaction() const; + public: + void clear_reaction(); + const ::SessionProtos::DataMessage_Reaction& reaction() const; + PROTOBUF_NODISCARD ::SessionProtos::DataMessage_Reaction* release_reaction(); + ::SessionProtos::DataMessage_Reaction* mutable_reaction(); + void set_allocated_reaction(::SessionProtos::DataMessage_Reaction* reaction); + private: + const ::SessionProtos::DataMessage_Reaction& _internal_reaction() const; + ::SessionProtos::DataMessage_Reaction* _internal_mutable_reaction(); + public: + void unsafe_arena_set_allocated_reaction( + ::SessionProtos::DataMessage_Reaction* reaction); + ::SessionProtos::DataMessage_Reaction* unsafe_arena_release_reaction(); + + // optional .SessionProtos.LokiProfile profile = 101; + bool has_profile() const; + private: + bool _internal_has_profile() const; + public: + void clear_profile(); + const ::SessionProtos::LokiProfile& profile() const; + PROTOBUF_NODISCARD ::SessionProtos::LokiProfile* release_profile(); + ::SessionProtos::LokiProfile* mutable_profile(); + void set_allocated_profile(::SessionProtos::LokiProfile* profile); + private: + const ::SessionProtos::LokiProfile& _internal_profile() const; + ::SessionProtos::LokiProfile* _internal_mutable_profile(); + public: + void unsafe_arena_set_allocated_profile( + ::SessionProtos::LokiProfile* profile); + ::SessionProtos::LokiProfile* unsafe_arena_release_profile(); + + // optional .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + bool has_opengroupinvitation() const; + private: + bool _internal_has_opengroupinvitation() const; + public: + void clear_opengroupinvitation(); + const ::SessionProtos::DataMessage_OpenGroupInvitation& opengroupinvitation() const; + PROTOBUF_NODISCARD ::SessionProtos::DataMessage_OpenGroupInvitation* release_opengroupinvitation(); + ::SessionProtos::DataMessage_OpenGroupInvitation* mutable_opengroupinvitation(); + void set_allocated_opengroupinvitation(::SessionProtos::DataMessage_OpenGroupInvitation* opengroupinvitation); + private: + const ::SessionProtos::DataMessage_OpenGroupInvitation& _internal_opengroupinvitation() const; + ::SessionProtos::DataMessage_OpenGroupInvitation* _internal_mutable_opengroupinvitation(); + public: + void unsafe_arena_set_allocated_opengroupinvitation( + ::SessionProtos::DataMessage_OpenGroupInvitation* opengroupinvitation); + ::SessionProtos::DataMessage_OpenGroupInvitation* unsafe_arena_release_opengroupinvitation(); + + // optional .SessionProtos.GroupUpdateMessage groupUpdateMessage = 120; + bool has_groupupdatemessage() const; + private: + bool _internal_has_groupupdatemessage() const; + public: + void clear_groupupdatemessage(); + const ::SessionProtos::GroupUpdateMessage& groupupdatemessage() const; + PROTOBUF_NODISCARD ::SessionProtos::GroupUpdateMessage* release_groupupdatemessage(); + ::SessionProtos::GroupUpdateMessage* mutable_groupupdatemessage(); + void set_allocated_groupupdatemessage(::SessionProtos::GroupUpdateMessage* groupupdatemessage); + private: + const ::SessionProtos::GroupUpdateMessage& _internal_groupupdatemessage() const; + ::SessionProtos::GroupUpdateMessage* _internal_mutable_groupupdatemessage(); + public: + void unsafe_arena_set_allocated_groupupdatemessage( + ::SessionProtos::GroupUpdateMessage* groupupdatemessage); + ::SessionProtos::GroupUpdateMessage* unsafe_arena_release_groupupdatemessage(); + + // optional uint64 timestamp = 7; + bool has_timestamp() const; + private: + bool _internal_has_timestamp() const; + public: + void clear_timestamp(); + uint64_t timestamp() const; + void set_timestamp(uint64_t value); + private: + uint64_t _internal_timestamp() const; + void _internal_set_timestamp(uint64_t value); + public: + + // optional uint32 flags = 4; + bool has_flags() const; + private: + bool _internal_has_flags() const; + public: + void clear_flags(); + uint32_t flags() const; + void set_flags(uint32_t value); + private: + uint32_t _internal_flags() const; + void _internal_set_flags(uint32_t value); + public: + + // optional bool blocksCommunityMessageRequests = 106; + bool has_blockscommunitymessagerequests() const; + private: + bool _internal_has_blockscommunitymessagerequests() const; + public: + void clear_blockscommunitymessagerequests(); + bool blockscommunitymessagerequests() const; + void set_blockscommunitymessagerequests(bool value); + private: + bool _internal_blockscommunitymessagerequests() const; + void _internal_set_blockscommunitymessagerequests(bool value); + public: + + // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer > attachments_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview > preview_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr body_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilekey_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr synctarget_; + ::SessionProtos::DataMessage_Quote* quote_; + ::SessionProtos::DataMessage_Reaction* reaction_; + ::SessionProtos::LokiProfile* profile_; + ::SessionProtos::DataMessage_OpenGroupInvitation* opengroupinvitation_; + ::SessionProtos::GroupUpdateMessage* groupupdatemessage_; + uint64_t timestamp_; + uint32_t flags_; + bool blockscommunitymessagerequests_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_SessionProtos_2eproto; +}; +// ------------------------------------------------------------------- + +class ReceiptMessage final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.ReceiptMessage) */ { + public: + inline ReceiptMessage() : ReceiptMessage(nullptr) {} + ~ReceiptMessage() override; + explicit PROTOBUF_CONSTEXPR ReceiptMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + ReceiptMessage(const ReceiptMessage& from); + ReceiptMessage(ReceiptMessage&& from) noexcept + : ReceiptMessage() { *this = ::std::move(from); } - inline DataMessage_Reaction& operator=(const DataMessage_Reaction& from) { + inline ReceiptMessage& operator=(const ReceiptMessage& from) { CopyFrom(from); return *this; } - inline DataMessage_Reaction& operator=(DataMessage_Reaction&& from) noexcept { + inline ReceiptMessage& operator=(ReceiptMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -3488,27 +4161,36 @@ class DataMessage_Reaction final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const DataMessage_Reaction& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const ReceiptMessage& default_instance() { return *internal_default_instance(); } - static inline const DataMessage_Reaction* internal_default_instance() { - return reinterpret_cast( - &_DataMessage_Reaction_default_instance_); + static inline const ReceiptMessage* internal_default_instance() { + return reinterpret_cast( + &_ReceiptMessage_default_instance_); } static constexpr int kIndexInFileMessages = 15; - friend void swap(DataMessage_Reaction& a, DataMessage_Reaction& b) { + friend void swap(ReceiptMessage& a, ReceiptMessage& b) { a.Swap(&b); } - inline void Swap(DataMessage_Reaction* other) { + inline void Swap(ReceiptMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -3521,7 +4203,7 @@ class DataMessage_Reaction final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataMessage_Reaction* other) { + void UnsafeArenaSwap(ReceiptMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -3529,12 +4211,18 @@ class DataMessage_Reaction final : // implements Message ---------------------------------------------- - DataMessage_Reaction* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + ReceiptMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const DataMessage_Reaction& from); - void MergeFrom(const DataMessage_Reaction& from); + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ReceiptMessage& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const ReceiptMessage& from) { + ReceiptMessage::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3547,160 +4235,133 @@ class DataMessage_Reaction final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(DataMessage_Reaction* other); + void SetCachedSize(int size) const final; + void InternalSwap(ReceiptMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataMessage.Reaction"; + return "SessionProtos.ReceiptMessage"; } protected: - explicit DataMessage_Reaction(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit ReceiptMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; // nested types ---------------------------------------------------- - typedef DataMessage_Reaction_Action Action; - static constexpr Action REACT = - DataMessage_Reaction_Action_REACT; - static constexpr Action REMOVE = - DataMessage_Reaction_Action_REMOVE; - static inline bool Action_IsValid(int value) { - return DataMessage_Reaction_Action_IsValid(value); + typedef ReceiptMessage_Type Type; + static constexpr Type DELIVERY = + ReceiptMessage_Type_DELIVERY; + static constexpr Type READ = + ReceiptMessage_Type_READ; + static inline bool Type_IsValid(int value) { + return ReceiptMessage_Type_IsValid(value); + } + static constexpr Type Type_MIN = + ReceiptMessage_Type_Type_MIN; + static constexpr Type Type_MAX = + ReceiptMessage_Type_Type_MAX; + static constexpr int Type_ARRAYSIZE = + ReceiptMessage_Type_Type_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + Type_descriptor() { + return ReceiptMessage_Type_descriptor(); } - static constexpr Action Action_MIN = - DataMessage_Reaction_Action_Action_MIN; - static constexpr Action Action_MAX = - DataMessage_Reaction_Action_Action_MAX; - static constexpr int Action_ARRAYSIZE = - DataMessage_Reaction_Action_Action_ARRAYSIZE; template - static inline const std::string& Action_Name(T enum_t_value) { - static_assert(::std::is_same::value || + static inline const std::string& Type_Name(T enum_t_value) { + static_assert(::std::is_same::value || ::std::is_integral::value, - "Incorrect type passed to function Action_Name."); - return DataMessage_Reaction_Action_Name(enum_t_value); + "Incorrect type passed to function Type_Name."); + return ReceiptMessage_Type_Name(enum_t_value); } - static inline bool Action_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Action* value) { - return DataMessage_Reaction_Action_Parse(name, value); + static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Type* value) { + return ReceiptMessage_Type_Parse(name, value); } // accessors ------------------------------------------------------- enum : int { - kAuthorFieldNumber = 2, - kEmojiFieldNumber = 3, - kIdFieldNumber = 1, - kActionFieldNumber = 4, + kTimestampFieldNumber = 2, + kTypeFieldNumber = 1, }; - // required string author = 2; - bool has_author() const; + // repeated uint64 timestamp = 2; + int timestamp_size() const; private: - bool _internal_has_author() const; + int _internal_timestamp_size() const; public: - void clear_author(); - const std::string& author() const; - template - void set_author(ArgT0&& arg0, ArgT... args); - std::string* mutable_author(); - PROTOBUF_NODISCARD std::string* release_author(); - void set_allocated_author(std::string* author); + void clear_timestamp(); private: - const std::string& _internal_author() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_author(const std::string& value); - std::string* _internal_mutable_author(); + uint64_t _internal_timestamp(int index) const; + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& + _internal_timestamp() const; + void _internal_add_timestamp(uint64_t value); + ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* + _internal_mutable_timestamp(); public: + uint64_t timestamp(int index) const; + void set_timestamp(int index, uint64_t value); + void add_timestamp(uint64_t value); + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& + timestamp() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* + mutable_timestamp(); - // optional string emoji = 3; - bool has_emoji() const; + // required .SessionProtos.ReceiptMessage.Type type = 1; + bool has_type() const; private: - bool _internal_has_emoji() const; + bool _internal_has_type() const; public: - void clear_emoji(); - const std::string& emoji() const; - template - void set_emoji(ArgT0&& arg0, ArgT... args); - std::string* mutable_emoji(); - PROTOBUF_NODISCARD std::string* release_emoji(); - void set_allocated_emoji(std::string* emoji); - private: - const std::string& _internal_emoji() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_emoji(const std::string& value); - std::string* _internal_mutable_emoji(); - public: - - // required uint64 id = 1; - bool has_id() const; - private: - bool _internal_has_id() const; - public: - void clear_id(); - uint64_t id() const; - void set_id(uint64_t value); - private: - uint64_t _internal_id() const; - void _internal_set_id(uint64_t value); - public: - - // required .SessionProtos.DataMessage.Reaction.Action action = 4; - bool has_action() const; - private: - bool _internal_has_action() const; - public: - void clear_action(); - ::SessionProtos::DataMessage_Reaction_Action action() const; - void set_action(::SessionProtos::DataMessage_Reaction_Action value); + void clear_type(); + ::SessionProtos::ReceiptMessage_Type type() const; + void set_type(::SessionProtos::ReceiptMessage_Type value); private: - ::SessionProtos::DataMessage_Reaction_Action _internal_action() const; - void _internal_set_action(::SessionProtos::DataMessage_Reaction_Action value); + ::SessionProtos::ReceiptMessage_Type _internal_type() const; + void _internal_set_type(::SessionProtos::ReceiptMessage_Type value); public: - // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.Reaction) + // @@protoc_insertion_point(class_scope:SessionProtos.ReceiptMessage) private: class _Internal; - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr author_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr emoji_; - uint64_t id_; - int action_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t > timestamp_; + int type_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class DataMessage_OpenGroupInvitation final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.OpenGroupInvitation) */ { +class AttachmentPointer final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.AttachmentPointer) */ { public: - inline DataMessage_OpenGroupInvitation() : DataMessage_OpenGroupInvitation(nullptr) {} - ~DataMessage_OpenGroupInvitation() override; - explicit PROTOBUF_CONSTEXPR DataMessage_OpenGroupInvitation(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline AttachmentPointer() : AttachmentPointer(nullptr) {} + ~AttachmentPointer() override; + explicit PROTOBUF_CONSTEXPR AttachmentPointer(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - DataMessage_OpenGroupInvitation(const DataMessage_OpenGroupInvitation& from); - DataMessage_OpenGroupInvitation(DataMessage_OpenGroupInvitation&& from) noexcept - : DataMessage_OpenGroupInvitation() { + AttachmentPointer(const AttachmentPointer& from); + AttachmentPointer(AttachmentPointer&& from) noexcept + : AttachmentPointer() { *this = ::std::move(from); } - inline DataMessage_OpenGroupInvitation& operator=(const DataMessage_OpenGroupInvitation& from) { + inline AttachmentPointer& operator=(const AttachmentPointer& from) { CopyFrom(from); return *this; } - inline DataMessage_OpenGroupInvitation& operator=(DataMessage_OpenGroupInvitation&& from) noexcept { + inline AttachmentPointer& operator=(AttachmentPointer&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -3714,27 +4375,36 @@ class DataMessage_OpenGroupInvitation final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const DataMessage_OpenGroupInvitation& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const AttachmentPointer& default_instance() { return *internal_default_instance(); } - static inline const DataMessage_OpenGroupInvitation* internal_default_instance() { - return reinterpret_cast( - &_DataMessage_OpenGroupInvitation_default_instance_); + static inline const AttachmentPointer* internal_default_instance() { + return reinterpret_cast( + &_AttachmentPointer_default_instance_); } static constexpr int kIndexInFileMessages = 16; - friend void swap(DataMessage_OpenGroupInvitation& a, DataMessage_OpenGroupInvitation& b) { + friend void swap(AttachmentPointer& a, AttachmentPointer& b) { a.Swap(&b); } - inline void Swap(DataMessage_OpenGroupInvitation* other) { + inline void Swap(AttachmentPointer* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -3747,7 +4417,7 @@ class DataMessage_OpenGroupInvitation final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataMessage_OpenGroupInvitation* other) { + void UnsafeArenaSwap(AttachmentPointer* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -3755,12 +4425,18 @@ class DataMessage_OpenGroupInvitation final : // implements Message ---------------------------------------------- - DataMessage_OpenGroupInvitation* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + AttachmentPointer* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const DataMessage_OpenGroupInvitation& from); - void MergeFrom(const DataMessage_OpenGroupInvitation& from); + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const AttachmentPointer& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const AttachmentPointer& from) { + AttachmentPointer::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3773,30 +4449,179 @@ class DataMessage_OpenGroupInvitation final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(DataMessage_OpenGroupInvitation* other); + void SetCachedSize(int size) const final; + void InternalSwap(AttachmentPointer* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataMessage.OpenGroupInvitation"; + return "SessionProtos.AttachmentPointer"; } protected: - explicit DataMessage_OpenGroupInvitation(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit AttachmentPointer(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; // nested types ---------------------------------------------------- + typedef AttachmentPointer_Flags Flags; + static constexpr Flags VOICE_MESSAGE = + AttachmentPointer_Flags_VOICE_MESSAGE; + static inline bool Flags_IsValid(int value) { + return AttachmentPointer_Flags_IsValid(value); + } + static constexpr Flags Flags_MIN = + AttachmentPointer_Flags_Flags_MIN; + static constexpr Flags Flags_MAX = + AttachmentPointer_Flags_Flags_MAX; + static constexpr int Flags_ARRAYSIZE = + AttachmentPointer_Flags_Flags_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + Flags_descriptor() { + return AttachmentPointer_Flags_descriptor(); + } + template + static inline const std::string& Flags_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Flags_Name."); + return AttachmentPointer_Flags_Name(enum_t_value); + } + static inline bool Flags_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Flags* value) { + return AttachmentPointer_Flags_Parse(name, value); + } + // accessors ------------------------------------------------------- enum : int { - kUrlFieldNumber = 1, - kNameFieldNumber = 3, + kContentTypeFieldNumber = 2, + kKeyFieldNumber = 3, + kThumbnailFieldNumber = 5, + kDigestFieldNumber = 6, + kFileNameFieldNumber = 7, + kCaptionFieldNumber = 11, + kUrlFieldNumber = 101, + kIdFieldNumber = 1, + kSizeFieldNumber = 4, + kFlagsFieldNumber = 8, + kWidthFieldNumber = 9, + kHeightFieldNumber = 10, }; - // required string url = 1; + // optional string contentType = 2; + bool has_contenttype() const; + private: + bool _internal_has_contenttype() const; + public: + void clear_contenttype(); + const std::string& contenttype() const; + template + void set_contenttype(ArgT0&& arg0, ArgT... args); + std::string* mutable_contenttype(); + PROTOBUF_NODISCARD std::string* release_contenttype(); + void set_allocated_contenttype(std::string* contenttype); + private: + const std::string& _internal_contenttype() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_contenttype(const std::string& value); + std::string* _internal_mutable_contenttype(); + public: + + // optional bytes key = 3; + bool has_key() const; + private: + bool _internal_has_key() const; + public: + void clear_key(); + const std::string& key() const; + template + void set_key(ArgT0&& arg0, ArgT... args); + std::string* mutable_key(); + PROTOBUF_NODISCARD std::string* release_key(); + void set_allocated_key(std::string* key); + private: + const std::string& _internal_key() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_key(const std::string& value); + std::string* _internal_mutable_key(); + public: + + // optional bytes thumbnail = 5; + bool has_thumbnail() const; + private: + bool _internal_has_thumbnail() const; + public: + void clear_thumbnail(); + const std::string& thumbnail() const; + template + void set_thumbnail(ArgT0&& arg0, ArgT... args); + std::string* mutable_thumbnail(); + PROTOBUF_NODISCARD std::string* release_thumbnail(); + void set_allocated_thumbnail(std::string* thumbnail); + private: + const std::string& _internal_thumbnail() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_thumbnail(const std::string& value); + std::string* _internal_mutable_thumbnail(); + public: + + // optional bytes digest = 6; + bool has_digest() const; + private: + bool _internal_has_digest() const; + public: + void clear_digest(); + const std::string& digest() const; + template + void set_digest(ArgT0&& arg0, ArgT... args); + std::string* mutable_digest(); + PROTOBUF_NODISCARD std::string* release_digest(); + void set_allocated_digest(std::string* digest); + private: + const std::string& _internal_digest() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_digest(const std::string& value); + std::string* _internal_mutable_digest(); + public: + + // optional string fileName = 7; + bool has_filename() const; + private: + bool _internal_has_filename() const; + public: + void clear_filename(); + const std::string& filename() const; + template + void set_filename(ArgT0&& arg0, ArgT... args); + std::string* mutable_filename(); + PROTOBUF_NODISCARD std::string* release_filename(); + void set_allocated_filename(std::string* filename); + private: + const std::string& _internal_filename() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_filename(const std::string& value); + std::string* _internal_mutable_filename(); + public: + + // optional string caption = 11; + bool has_caption() const; + private: + bool _internal_has_caption() const; + public: + void clear_caption(); + const std::string& caption() const; + template + void set_caption(ArgT0&& arg0, ArgT... args); + std::string* mutable_caption(); + PROTOBUF_NODISCARD std::string* release_caption(); + void set_allocated_caption(std::string* caption); + private: + const std::string& _internal_caption() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_caption(const std::string& value); + std::string* _internal_mutable_caption(); + public: + + // optional string url = 101; bool has_url() const; private: bool _internal_has_url() const; @@ -3814,63 +4639,117 @@ class DataMessage_OpenGroupInvitation final : std::string* _internal_mutable_url(); public: - // required string name = 3; - bool has_name() const; + // required fixed64 id = 1; + bool has_id() const; private: - bool _internal_has_name() const; + bool _internal_has_id() const; public: - void clear_name(); - const std::string& name() const; - template - void set_name(ArgT0&& arg0, ArgT... args); - std::string* mutable_name(); - PROTOBUF_NODISCARD std::string* release_name(); - void set_allocated_name(std::string* name); + void clear_id(); + uint64_t id() const; + void set_id(uint64_t value); private: - const std::string& _internal_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); - std::string* _internal_mutable_name(); + uint64_t _internal_id() const; + void _internal_set_id(uint64_t value); public: - // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.OpenGroupInvitation) + // optional uint32 size = 4; + bool has_size() const; + private: + bool _internal_has_size() const; + public: + void clear_size(); + uint32_t size() const; + void set_size(uint32_t value); + private: + uint32_t _internal_size() const; + void _internal_set_size(uint32_t value); + public: + + // optional uint32 flags = 8; + bool has_flags() const; + private: + bool _internal_has_flags() const; + public: + void clear_flags(); + uint32_t flags() const; + void set_flags(uint32_t value); + private: + uint32_t _internal_flags() const; + void _internal_set_flags(uint32_t value); + public: + + // optional uint32 width = 9; + bool has_width() const; + private: + bool _internal_has_width() const; + public: + void clear_width(); + uint32_t width() const; + void set_width(uint32_t value); + private: + uint32_t _internal_width() const; + void _internal_set_width(uint32_t value); + public: + + // optional uint32 height = 10; + bool has_height() const; + private: + bool _internal_has_height() const; + public: + void clear_height(); + uint32_t height() const; + void set_height(uint32_t value); + private: + uint32_t _internal_height() const; + void _internal_set_height(uint32_t value); + public: + + // @@protoc_insertion_point(class_scope:SessionProtos.AttachmentPointer) private: class _Internal; - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr contenttype_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr key_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr thumbnail_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr digest_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr filename_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr caption_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr url_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + uint64_t id_; + uint32_t size_; + uint32_t flags_; + uint32_t width_; + uint32_t height_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class DataMessage_ClosedGroupControlMessage_KeyPairWrapper final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) */ { +class SharedConfigMessage final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.SharedConfigMessage) */ { public: - inline DataMessage_ClosedGroupControlMessage_KeyPairWrapper() : DataMessage_ClosedGroupControlMessage_KeyPairWrapper(nullptr) {} - ~DataMessage_ClosedGroupControlMessage_KeyPairWrapper() override; - explicit PROTOBUF_CONSTEXPR DataMessage_ClosedGroupControlMessage_KeyPairWrapper(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline SharedConfigMessage() : SharedConfigMessage(nullptr) {} + ~SharedConfigMessage() override; + explicit PROTOBUF_CONSTEXPR SharedConfigMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - DataMessage_ClosedGroupControlMessage_KeyPairWrapper(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from); - DataMessage_ClosedGroupControlMessage_KeyPairWrapper(DataMessage_ClosedGroupControlMessage_KeyPairWrapper&& from) noexcept - : DataMessage_ClosedGroupControlMessage_KeyPairWrapper() { + SharedConfigMessage(const SharedConfigMessage& from); + SharedConfigMessage(SharedConfigMessage&& from) noexcept + : SharedConfigMessage() { *this = ::std::move(from); } - inline DataMessage_ClosedGroupControlMessage_KeyPairWrapper& operator=(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from) { + inline SharedConfigMessage& operator=(const SharedConfigMessage& from) { CopyFrom(from); return *this; } - inline DataMessage_ClosedGroupControlMessage_KeyPairWrapper& operator=(DataMessage_ClosedGroupControlMessage_KeyPairWrapper&& from) noexcept { + inline SharedConfigMessage& operator=(SharedConfigMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -3884,27 +4763,36 @@ class DataMessage_ClosedGroupControlMessage_KeyPairWrapper final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const SharedConfigMessage& default_instance() { return *internal_default_instance(); } - static inline const DataMessage_ClosedGroupControlMessage_KeyPairWrapper* internal_default_instance() { - return reinterpret_cast( - &_DataMessage_ClosedGroupControlMessage_KeyPairWrapper_default_instance_); + static inline const SharedConfigMessage* internal_default_instance() { + return reinterpret_cast( + &_SharedConfigMessage_default_instance_); } static constexpr int kIndexInFileMessages = 17; - friend void swap(DataMessage_ClosedGroupControlMessage_KeyPairWrapper& a, DataMessage_ClosedGroupControlMessage_KeyPairWrapper& b) { + friend void swap(SharedConfigMessage& a, SharedConfigMessage& b) { a.Swap(&b); } - inline void Swap(DataMessage_ClosedGroupControlMessage_KeyPairWrapper* other) { + inline void Swap(SharedConfigMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -3917,7 +4805,7 @@ class DataMessage_ClosedGroupControlMessage_KeyPairWrapper final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataMessage_ClosedGroupControlMessage_KeyPairWrapper* other) { + void UnsafeArenaSwap(SharedConfigMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -3925,12 +4813,18 @@ class DataMessage_ClosedGroupControlMessage_KeyPairWrapper final : // implements Message ---------------------------------------------- - DataMessage_ClosedGroupControlMessage_KeyPairWrapper* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + SharedConfigMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const SharedConfigMessage& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const SharedConfigMessage& from) { + SharedConfigMessage::MergeImpl(*this, from); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from); - void MergeFrom(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from); + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3943,66 +4837,112 @@ class DataMessage_ClosedGroupControlMessage_KeyPairWrapper final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(DataMessage_ClosedGroupControlMessage_KeyPairWrapper* other); + void SetCachedSize(int size) const final; + void InternalSwap(SharedConfigMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper"; + return "SessionProtos.SharedConfigMessage"; } protected: - explicit DataMessage_ClosedGroupControlMessage_KeyPairWrapper(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit SharedConfigMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; // nested types ---------------------------------------------------- + typedef SharedConfigMessage_Kind Kind; + static constexpr Kind USER_PROFILE = + SharedConfigMessage_Kind_USER_PROFILE; + static constexpr Kind CONTACTS = + SharedConfigMessage_Kind_CONTACTS; + static constexpr Kind CONVO_INFO_VOLATILE = + SharedConfigMessage_Kind_CONVO_INFO_VOLATILE; + static constexpr Kind USER_GROUPS = + SharedConfigMessage_Kind_USER_GROUPS; + static inline bool Kind_IsValid(int value) { + return SharedConfigMessage_Kind_IsValid(value); + } + static constexpr Kind Kind_MIN = + SharedConfigMessage_Kind_Kind_MIN; + static constexpr Kind Kind_MAX = + SharedConfigMessage_Kind_Kind_MAX; + static constexpr int Kind_ARRAYSIZE = + SharedConfigMessage_Kind_Kind_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + Kind_descriptor() { + return SharedConfigMessage_Kind_descriptor(); + } + template + static inline const std::string& Kind_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Kind_Name."); + return SharedConfigMessage_Kind_Name(enum_t_value); + } + static inline bool Kind_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Kind* value) { + return SharedConfigMessage_Kind_Parse(name, value); + } + // accessors ------------------------------------------------------- enum : int { - kPublicKeyFieldNumber = 1, - kEncryptedKeyPairFieldNumber = 2, + kDataFieldNumber = 3, + kSeqnoFieldNumber = 2, + kKindFieldNumber = 1, }; - // required bytes publicKey = 1; - bool has_publickey() const; + // required bytes data = 3; + bool has_data() const; private: - bool _internal_has_publickey() const; + bool _internal_has_data() const; public: - void clear_publickey(); - const std::string& publickey() const; + void clear_data(); + const std::string& data() const; template - void set_publickey(ArgT0&& arg0, ArgT... args); - std::string* mutable_publickey(); - PROTOBUF_NODISCARD std::string* release_publickey(); - void set_allocated_publickey(std::string* publickey); + void set_data(ArgT0&& arg0, ArgT... args); + std::string* mutable_data(); + PROTOBUF_NODISCARD std::string* release_data(); + void set_allocated_data(std::string* data); private: - const std::string& _internal_publickey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_publickey(const std::string& value); - std::string* _internal_mutable_publickey(); + const std::string& _internal_data() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_data(const std::string& value); + std::string* _internal_mutable_data(); + public: + + // required int64 seqno = 2; + bool has_seqno() const; + private: + bool _internal_has_seqno() const; + public: + void clear_seqno(); + int64_t seqno() const; + void set_seqno(int64_t value); + private: + int64_t _internal_seqno() const; + void _internal_set_seqno(int64_t value); public: - // required bytes encryptedKeyPair = 2; - bool has_encryptedkeypair() const; + // required .SessionProtos.SharedConfigMessage.Kind kind = 1; + bool has_kind() const; private: - bool _internal_has_encryptedkeypair() const; + bool _internal_has_kind() const; public: - void clear_encryptedkeypair(); - const std::string& encryptedkeypair() const; - template - void set_encryptedkeypair(ArgT0&& arg0, ArgT... args); - std::string* mutable_encryptedkeypair(); - PROTOBUF_NODISCARD std::string* release_encryptedkeypair(); - void set_allocated_encryptedkeypair(std::string* encryptedkeypair); + void clear_kind(); + ::SessionProtos::SharedConfigMessage_Kind kind() const; + void set_kind(::SessionProtos::SharedConfigMessage_Kind value); private: - const std::string& _internal_encryptedkeypair() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_encryptedkeypair(const std::string& value); - std::string* _internal_mutable_encryptedkeypair(); + ::SessionProtos::SharedConfigMessage_Kind _internal_kind() const; + void _internal_set_kind(::SessionProtos::SharedConfigMessage_Kind value); public: - // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) + // @@protoc_insertion_point(class_scope:SessionProtos.SharedConfigMessage) private: class _Internal; @@ -4015,32 +4955,33 @@ class DataMessage_ClosedGroupControlMessage_KeyPairWrapper final : struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr publickey_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr encryptedkeypair_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr data_; + int64_t seqno_; + int kind_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class DataMessage_ClosedGroupControlMessage final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.ClosedGroupControlMessage) */ { +class GroupUpdateMessage final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateMessage) */ { public: - inline DataMessage_ClosedGroupControlMessage() : DataMessage_ClosedGroupControlMessage(nullptr) {} - ~DataMessage_ClosedGroupControlMessage() override; - explicit PROTOBUF_CONSTEXPR DataMessage_ClosedGroupControlMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline GroupUpdateMessage() : GroupUpdateMessage(nullptr) {} + ~GroupUpdateMessage() override; + explicit PROTOBUF_CONSTEXPR GroupUpdateMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - DataMessage_ClosedGroupControlMessage(const DataMessage_ClosedGroupControlMessage& from); - DataMessage_ClosedGroupControlMessage(DataMessage_ClosedGroupControlMessage&& from) noexcept - : DataMessage_ClosedGroupControlMessage() { + GroupUpdateMessage(const GroupUpdateMessage& from); + GroupUpdateMessage(GroupUpdateMessage&& from) noexcept + : GroupUpdateMessage() { *this = ::std::move(from); } - inline DataMessage_ClosedGroupControlMessage& operator=(const DataMessage_ClosedGroupControlMessage& from) { + inline GroupUpdateMessage& operator=(const GroupUpdateMessage& from) { CopyFrom(from); return *this; } - inline DataMessage_ClosedGroupControlMessage& operator=(DataMessage_ClosedGroupControlMessage&& from) noexcept { + inline GroupUpdateMessage& operator=(GroupUpdateMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -4054,27 +4995,36 @@ class DataMessage_ClosedGroupControlMessage final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const DataMessage_ClosedGroupControlMessage& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const GroupUpdateMessage& default_instance() { return *internal_default_instance(); } - static inline const DataMessage_ClosedGroupControlMessage* internal_default_instance() { - return reinterpret_cast( - &_DataMessage_ClosedGroupControlMessage_default_instance_); + static inline const GroupUpdateMessage* internal_default_instance() { + return reinterpret_cast( + &_GroupUpdateMessage_default_instance_); } static constexpr int kIndexInFileMessages = 18; - friend void swap(DataMessage_ClosedGroupControlMessage& a, DataMessage_ClosedGroupControlMessage& b) { + friend void swap(GroupUpdateMessage& a, GroupUpdateMessage& b) { a.Swap(&b); } - inline void Swap(DataMessage_ClosedGroupControlMessage* other) { + inline void Swap(GroupUpdateMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -4087,7 +5037,7 @@ class DataMessage_ClosedGroupControlMessage final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataMessage_ClosedGroupControlMessage* other) { + void UnsafeArenaSwap(GroupUpdateMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -4095,12 +5045,18 @@ class DataMessage_ClosedGroupControlMessage final : // implements Message ---------------------------------------------- - DataMessage_ClosedGroupControlMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + GroupUpdateMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const GroupUpdateMessage& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const GroupUpdateMessage& from) { + GroupUpdateMessage::MergeImpl(*this, from); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const DataMessage_ClosedGroupControlMessage& from); - void MergeFrom(const DataMessage_ClosedGroupControlMessage& from); + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -4113,220 +5069,183 @@ class DataMessage_ClosedGroupControlMessage final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(DataMessage_ClosedGroupControlMessage* other); + void SetCachedSize(int size) const final; + void InternalSwap(GroupUpdateMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataMessage.ClosedGroupControlMessage"; + return "SessionProtos.GroupUpdateMessage"; } protected: - explicit DataMessage_ClosedGroupControlMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit GroupUpdateMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - // nested types ---------------------------------------------------- + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - typedef DataMessage_ClosedGroupControlMessage_KeyPairWrapper KeyPairWrapper; - - typedef DataMessage_ClosedGroupControlMessage_Type Type; - static constexpr Type NEW = - DataMessage_ClosedGroupControlMessage_Type_NEW; - static constexpr Type ENCRYPTION_KEY_PAIR = - DataMessage_ClosedGroupControlMessage_Type_ENCRYPTION_KEY_PAIR; - static constexpr Type NAME_CHANGE = - DataMessage_ClosedGroupControlMessage_Type_NAME_CHANGE; - static constexpr Type MEMBERS_ADDED = - DataMessage_ClosedGroupControlMessage_Type_MEMBERS_ADDED; - static constexpr Type MEMBERS_REMOVED = - DataMessage_ClosedGroupControlMessage_Type_MEMBERS_REMOVED; - static constexpr Type MEMBER_LEFT = - DataMessage_ClosedGroupControlMessage_Type_MEMBER_LEFT; - static constexpr Type ENCRYPTION_KEY_PAIR_REQUEST = - DataMessage_ClosedGroupControlMessage_Type_ENCRYPTION_KEY_PAIR_REQUEST; - static inline bool Type_IsValid(int value) { - return DataMessage_ClosedGroupControlMessage_Type_IsValid(value); - } - static constexpr Type Type_MIN = - DataMessage_ClosedGroupControlMessage_Type_Type_MIN; - static constexpr Type Type_MAX = - DataMessage_ClosedGroupControlMessage_Type_Type_MAX; - static constexpr int Type_ARRAYSIZE = - DataMessage_ClosedGroupControlMessage_Type_Type_ARRAYSIZE; - template - static inline const std::string& Type_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function Type_Name."); - return DataMessage_ClosedGroupControlMessage_Type_Name(enum_t_value); - } - static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Type* value) { - return DataMessage_ClosedGroupControlMessage_Type_Parse(name, value); - } + // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { - kMembersFieldNumber = 5, - kAdminsFieldNumber = 6, - kWrappersFieldNumber = 7, - kPublicKeyFieldNumber = 2, - kNameFieldNumber = 3, - kEncryptionKeyPairFieldNumber = 4, - kExpirationTimerFieldNumber = 8, - kTypeFieldNumber = 1, + kInviteMessageFieldNumber = 1, + kInfoChangeMessageFieldNumber = 2, + kMemberChangeMessageFieldNumber = 3, + kPromoteMessageFieldNumber = 4, + kMemberLeftMessageFieldNumber = 5, + kInviteResponseFieldNumber = 6, + kDeleteMemberContentFieldNumber = 7, + kMemberLeftNotificationMessageFieldNumber = 8, }; - // repeated bytes members = 5; - int members_size() const; - private: - int _internal_members_size() const; - public: - void clear_members(); - const std::string& members(int index) const; - std::string* mutable_members(int index); - void set_members(int index, const std::string& value); - void set_members(int index, std::string&& value); - void set_members(int index, const char* value); - void set_members(int index, const void* value, size_t size); - std::string* add_members(); - void add_members(const std::string& value); - void add_members(std::string&& value); - void add_members(const char* value); - void add_members(const void* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& members() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_members(); - private: - const std::string& _internal_members(int index) const; - std::string* _internal_add_members(); - public: - - // repeated bytes admins = 6; - int admins_size() const; - private: - int _internal_admins_size() const; - public: - void clear_admins(); - const std::string& admins(int index) const; - std::string* mutable_admins(int index); - void set_admins(int index, const std::string& value); - void set_admins(int index, std::string&& value); - void set_admins(int index, const char* value); - void set_admins(int index, const void* value, size_t size); - std::string* add_admins(); - void add_admins(const std::string& value); - void add_admins(std::string&& value); - void add_admins(const char* value); - void add_admins(const void* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& admins() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_admins(); - private: - const std::string& _internal_admins(int index) const; - std::string* _internal_add_admins(); - public: - - // repeated .SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper wrappers = 7; - int wrappers_size() const; - private: - int _internal_wrappers_size() const; - public: - void clear_wrappers(); - ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper* mutable_wrappers(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper >* - mutable_wrappers(); - private: - const ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper& _internal_wrappers(int index) const; - ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper* _internal_add_wrappers(); - public: - const ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper& wrappers(int index) const; - ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper* add_wrappers(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper >& - wrappers() const; - - // optional bytes publicKey = 2; - bool has_publickey() const; + // optional .SessionProtos.GroupUpdateInviteMessage inviteMessage = 1; + bool has_invitemessage() const; private: - bool _internal_has_publickey() const; + bool _internal_has_invitemessage() const; public: - void clear_publickey(); - const std::string& publickey() const; - template - void set_publickey(ArgT0&& arg0, ArgT... args); - std::string* mutable_publickey(); - PROTOBUF_NODISCARD std::string* release_publickey(); - void set_allocated_publickey(std::string* publickey); + void clear_invitemessage(); + const ::SessionProtos::GroupUpdateInviteMessage& invitemessage() const; + PROTOBUF_NODISCARD ::SessionProtos::GroupUpdateInviteMessage* release_invitemessage(); + ::SessionProtos::GroupUpdateInviteMessage* mutable_invitemessage(); + void set_allocated_invitemessage(::SessionProtos::GroupUpdateInviteMessage* invitemessage); private: - const std::string& _internal_publickey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_publickey(const std::string& value); - std::string* _internal_mutable_publickey(); + const ::SessionProtos::GroupUpdateInviteMessage& _internal_invitemessage() const; + ::SessionProtos::GroupUpdateInviteMessage* _internal_mutable_invitemessage(); public: + void unsafe_arena_set_allocated_invitemessage( + ::SessionProtos::GroupUpdateInviteMessage* invitemessage); + ::SessionProtos::GroupUpdateInviteMessage* unsafe_arena_release_invitemessage(); - // optional string name = 3; - bool has_name() const; + // optional .SessionProtos.GroupUpdateInfoChangeMessage infoChangeMessage = 2; + bool has_infochangemessage() const; private: - bool _internal_has_name() const; + bool _internal_has_infochangemessage() const; public: - void clear_name(); - const std::string& name() const; - template - void set_name(ArgT0&& arg0, ArgT... args); - std::string* mutable_name(); - PROTOBUF_NODISCARD std::string* release_name(); - void set_allocated_name(std::string* name); + void clear_infochangemessage(); + const ::SessionProtos::GroupUpdateInfoChangeMessage& infochangemessage() const; + PROTOBUF_NODISCARD ::SessionProtos::GroupUpdateInfoChangeMessage* release_infochangemessage(); + ::SessionProtos::GroupUpdateInfoChangeMessage* mutable_infochangemessage(); + void set_allocated_infochangemessage(::SessionProtos::GroupUpdateInfoChangeMessage* infochangemessage); private: - const std::string& _internal_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); - std::string* _internal_mutable_name(); + const ::SessionProtos::GroupUpdateInfoChangeMessage& _internal_infochangemessage() const; + ::SessionProtos::GroupUpdateInfoChangeMessage* _internal_mutable_infochangemessage(); public: + void unsafe_arena_set_allocated_infochangemessage( + ::SessionProtos::GroupUpdateInfoChangeMessage* infochangemessage); + ::SessionProtos::GroupUpdateInfoChangeMessage* unsafe_arena_release_infochangemessage(); - // optional .SessionProtos.KeyPair encryptionKeyPair = 4; - bool has_encryptionkeypair() const; + // optional .SessionProtos.GroupUpdateMemberChangeMessage memberChangeMessage = 3; + bool has_memberchangemessage() const; private: - bool _internal_has_encryptionkeypair() const; + bool _internal_has_memberchangemessage() const; public: - void clear_encryptionkeypair(); - const ::SessionProtos::KeyPair& encryptionkeypair() const; - PROTOBUF_NODISCARD ::SessionProtos::KeyPair* release_encryptionkeypair(); - ::SessionProtos::KeyPair* mutable_encryptionkeypair(); - void set_allocated_encryptionkeypair(::SessionProtos::KeyPair* encryptionkeypair); + void clear_memberchangemessage(); + const ::SessionProtos::GroupUpdateMemberChangeMessage& memberchangemessage() const; + PROTOBUF_NODISCARD ::SessionProtos::GroupUpdateMemberChangeMessage* release_memberchangemessage(); + ::SessionProtos::GroupUpdateMemberChangeMessage* mutable_memberchangemessage(); + void set_allocated_memberchangemessage(::SessionProtos::GroupUpdateMemberChangeMessage* memberchangemessage); private: - const ::SessionProtos::KeyPair& _internal_encryptionkeypair() const; - ::SessionProtos::KeyPair* _internal_mutable_encryptionkeypair(); + const ::SessionProtos::GroupUpdateMemberChangeMessage& _internal_memberchangemessage() const; + ::SessionProtos::GroupUpdateMemberChangeMessage* _internal_mutable_memberchangemessage(); public: - void unsafe_arena_set_allocated_encryptionkeypair( - ::SessionProtos::KeyPair* encryptionkeypair); - ::SessionProtos::KeyPair* unsafe_arena_release_encryptionkeypair(); + void unsafe_arena_set_allocated_memberchangemessage( + ::SessionProtos::GroupUpdateMemberChangeMessage* memberchangemessage); + ::SessionProtos::GroupUpdateMemberChangeMessage* unsafe_arena_release_memberchangemessage(); - // optional uint32 expirationTimer = 8; - bool has_expirationtimer() const; + // optional .SessionProtos.GroupUpdatePromoteMessage promoteMessage = 4; + bool has_promotemessage() const; private: - bool _internal_has_expirationtimer() const; + bool _internal_has_promotemessage() const; public: - void clear_expirationtimer(); - uint32_t expirationtimer() const; - void set_expirationtimer(uint32_t value); + void clear_promotemessage(); + const ::SessionProtos::GroupUpdatePromoteMessage& promotemessage() const; + PROTOBUF_NODISCARD ::SessionProtos::GroupUpdatePromoteMessage* release_promotemessage(); + ::SessionProtos::GroupUpdatePromoteMessage* mutable_promotemessage(); + void set_allocated_promotemessage(::SessionProtos::GroupUpdatePromoteMessage* promotemessage); private: - uint32_t _internal_expirationtimer() const; - void _internal_set_expirationtimer(uint32_t value); + const ::SessionProtos::GroupUpdatePromoteMessage& _internal_promotemessage() const; + ::SessionProtos::GroupUpdatePromoteMessage* _internal_mutable_promotemessage(); public: + void unsafe_arena_set_allocated_promotemessage( + ::SessionProtos::GroupUpdatePromoteMessage* promotemessage); + ::SessionProtos::GroupUpdatePromoteMessage* unsafe_arena_release_promotemessage(); - // required .SessionProtos.DataMessage.ClosedGroupControlMessage.Type type = 1; - bool has_type() const; + // optional .SessionProtos.GroupUpdateMemberLeftMessage memberLeftMessage = 5; + bool has_memberleftmessage() const; private: - bool _internal_has_type() const; + bool _internal_has_memberleftmessage() const; public: - void clear_type(); - ::SessionProtos::DataMessage_ClosedGroupControlMessage_Type type() const; - void set_type(::SessionProtos::DataMessage_ClosedGroupControlMessage_Type value); + void clear_memberleftmessage(); + const ::SessionProtos::GroupUpdateMemberLeftMessage& memberleftmessage() const; + PROTOBUF_NODISCARD ::SessionProtos::GroupUpdateMemberLeftMessage* release_memberleftmessage(); + ::SessionProtos::GroupUpdateMemberLeftMessage* mutable_memberleftmessage(); + void set_allocated_memberleftmessage(::SessionProtos::GroupUpdateMemberLeftMessage* memberleftmessage); + private: + const ::SessionProtos::GroupUpdateMemberLeftMessage& _internal_memberleftmessage() const; + ::SessionProtos::GroupUpdateMemberLeftMessage* _internal_mutable_memberleftmessage(); + public: + void unsafe_arena_set_allocated_memberleftmessage( + ::SessionProtos::GroupUpdateMemberLeftMessage* memberleftmessage); + ::SessionProtos::GroupUpdateMemberLeftMessage* unsafe_arena_release_memberleftmessage(); + + // optional .SessionProtos.GroupUpdateInviteResponseMessage inviteResponse = 6; + bool has_inviteresponse() const; + private: + bool _internal_has_inviteresponse() const; + public: + void clear_inviteresponse(); + const ::SessionProtos::GroupUpdateInviteResponseMessage& inviteresponse() const; + PROTOBUF_NODISCARD ::SessionProtos::GroupUpdateInviteResponseMessage* release_inviteresponse(); + ::SessionProtos::GroupUpdateInviteResponseMessage* mutable_inviteresponse(); + void set_allocated_inviteresponse(::SessionProtos::GroupUpdateInviteResponseMessage* inviteresponse); + private: + const ::SessionProtos::GroupUpdateInviteResponseMessage& _internal_inviteresponse() const; + ::SessionProtos::GroupUpdateInviteResponseMessage* _internal_mutable_inviteresponse(); + public: + void unsafe_arena_set_allocated_inviteresponse( + ::SessionProtos::GroupUpdateInviteResponseMessage* inviteresponse); + ::SessionProtos::GroupUpdateInviteResponseMessage* unsafe_arena_release_inviteresponse(); + + // optional .SessionProtos.GroupUpdateDeleteMemberContentMessage deleteMemberContent = 7; + bool has_deletemembercontent() const; + private: + bool _internal_has_deletemembercontent() const; + public: + void clear_deletemembercontent(); + const ::SessionProtos::GroupUpdateDeleteMemberContentMessage& deletemembercontent() const; + PROTOBUF_NODISCARD ::SessionProtos::GroupUpdateDeleteMemberContentMessage* release_deletemembercontent(); + ::SessionProtos::GroupUpdateDeleteMemberContentMessage* mutable_deletemembercontent(); + void set_allocated_deletemembercontent(::SessionProtos::GroupUpdateDeleteMemberContentMessage* deletemembercontent); + private: + const ::SessionProtos::GroupUpdateDeleteMemberContentMessage& _internal_deletemembercontent() const; + ::SessionProtos::GroupUpdateDeleteMemberContentMessage* _internal_mutable_deletemembercontent(); + public: + void unsafe_arena_set_allocated_deletemembercontent( + ::SessionProtos::GroupUpdateDeleteMemberContentMessage* deletemembercontent); + ::SessionProtos::GroupUpdateDeleteMemberContentMessage* unsafe_arena_release_deletemembercontent(); + + // optional .SessionProtos.GroupUpdateMemberLeftNotificationMessage memberLeftNotificationMessage = 8; + bool has_memberleftnotificationmessage() const; + private: + bool _internal_has_memberleftnotificationmessage() const; + public: + void clear_memberleftnotificationmessage(); + const ::SessionProtos::GroupUpdateMemberLeftNotificationMessage& memberleftnotificationmessage() const; + PROTOBUF_NODISCARD ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* release_memberleftnotificationmessage(); + ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* mutable_memberleftnotificationmessage(); + void set_allocated_memberleftnotificationmessage(::SessionProtos::GroupUpdateMemberLeftNotificationMessage* memberleftnotificationmessage); private: - ::SessionProtos::DataMessage_ClosedGroupControlMessage_Type _internal_type() const; - void _internal_set_type(::SessionProtos::DataMessage_ClosedGroupControlMessage_Type value); + const ::SessionProtos::GroupUpdateMemberLeftNotificationMessage& _internal_memberleftnotificationmessage() const; + ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* _internal_mutable_memberleftnotificationmessage(); public: + void unsafe_arena_set_allocated_memberleftnotificationmessage( + ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* memberleftnotificationmessage); + ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* unsafe_arena_release_memberleftnotificationmessage(); - // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.ClosedGroupControlMessage) + // @@protoc_insertion_point(class_scope:SessionProtos.GroupUpdateMessage) private: class _Internal; @@ -4336,38 +5255,38 @@ class DataMessage_ClosedGroupControlMessage final : struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField members_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField admins_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper > wrappers_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr publickey_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::SessionProtos::KeyPair* encryptionkeypair_; - uint32_t expirationtimer_; - int type_; + ::SessionProtos::GroupUpdateInviteMessage* invitemessage_; + ::SessionProtos::GroupUpdateInfoChangeMessage* infochangemessage_; + ::SessionProtos::GroupUpdateMemberChangeMessage* memberchangemessage_; + ::SessionProtos::GroupUpdatePromoteMessage* promotemessage_; + ::SessionProtos::GroupUpdateMemberLeftMessage* memberleftmessage_; + ::SessionProtos::GroupUpdateInviteResponseMessage* inviteresponse_; + ::SessionProtos::GroupUpdateDeleteMemberContentMessage* deletemembercontent_; + ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* memberleftnotificationmessage_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class DataMessage final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage) */ { +class GroupUpdateInviteMessage final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateInviteMessage) */ { public: - inline DataMessage() : DataMessage(nullptr) {} - ~DataMessage() override; - explicit PROTOBUF_CONSTEXPR DataMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline GroupUpdateInviteMessage() : GroupUpdateInviteMessage(nullptr) {} + ~GroupUpdateInviteMessage() override; + explicit PROTOBUF_CONSTEXPR GroupUpdateInviteMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - DataMessage(const DataMessage& from); - DataMessage(DataMessage&& from) noexcept - : DataMessage() { + GroupUpdateInviteMessage(const GroupUpdateInviteMessage& from); + GroupUpdateInviteMessage(GroupUpdateInviteMessage&& from) noexcept + : GroupUpdateInviteMessage() { *this = ::std::move(from); } - inline DataMessage& operator=(const DataMessage& from) { + inline GroupUpdateInviteMessage& operator=(const GroupUpdateInviteMessage& from) { CopyFrom(from); return *this; } - inline DataMessage& operator=(DataMessage&& from) noexcept { + inline GroupUpdateInviteMessage& operator=(GroupUpdateInviteMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -4381,27 +5300,36 @@ class DataMessage final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const DataMessage& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const GroupUpdateInviteMessage& default_instance() { return *internal_default_instance(); } - static inline const DataMessage* internal_default_instance() { - return reinterpret_cast( - &_DataMessage_default_instance_); + static inline const GroupUpdateInviteMessage* internal_default_instance() { + return reinterpret_cast( + &_GroupUpdateInviteMessage_default_instance_); } static constexpr int kIndexInFileMessages = 19; - friend void swap(DataMessage& a, DataMessage& b) { + friend void swap(GroupUpdateInviteMessage& a, GroupUpdateInviteMessage& b) { a.Swap(&b); } - inline void Swap(DataMessage* other) { + inline void Swap(GroupUpdateInviteMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -4414,7 +5342,7 @@ class DataMessage final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataMessage* other) { + void UnsafeArenaSwap(GroupUpdateInviteMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -4422,12 +5350,18 @@ class DataMessage final : // implements Message ---------------------------------------------- - DataMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + GroupUpdateInviteMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const DataMessage& from); - void MergeFrom(const DataMessage& from); + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const GroupUpdateInviteMessage& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const GroupUpdateInviteMessage& from) { + GroupUpdateInviteMessage::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -4440,351 +5374,147 @@ class DataMessage final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(DataMessage* other); + void SetCachedSize(int size) const final; + void InternalSwap(GroupUpdateInviteMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataMessage"; + return "SessionProtos.GroupUpdateInviteMessage"; } protected: - explicit DataMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit GroupUpdateInviteMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; - - // nested types ---------------------------------------------------- + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - typedef DataMessage_Quote Quote; - typedef DataMessage_Preview Preview; - typedef DataMessage_Reaction Reaction; - typedef DataMessage_OpenGroupInvitation OpenGroupInvitation; - typedef DataMessage_ClosedGroupControlMessage ClosedGroupControlMessage; + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - typedef DataMessage_Flags Flags; - static constexpr Flags EXPIRATION_TIMER_UPDATE = - DataMessage_Flags_EXPIRATION_TIMER_UPDATE; - static inline bool Flags_IsValid(int value) { - return DataMessage_Flags_IsValid(value); - } - static constexpr Flags Flags_MIN = - DataMessage_Flags_Flags_MIN; - static constexpr Flags Flags_MAX = - DataMessage_Flags_Flags_MAX; - static constexpr int Flags_ARRAYSIZE = - DataMessage_Flags_Flags_ARRAYSIZE; - template - static inline const std::string& Flags_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function Flags_Name."); - return DataMessage_Flags_Name(enum_t_value); - } - static inline bool Flags_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Flags* value) { - return DataMessage_Flags_Parse(name, value); - } + // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { - kAttachmentsFieldNumber = 2, - kPreviewFieldNumber = 10, - kBodyFieldNumber = 1, - kProfileKeyFieldNumber = 6, - kSyncTargetFieldNumber = 105, - kQuoteFieldNumber = 8, - kReactionFieldNumber = 11, - kProfileFieldNumber = 101, - kOpenGroupInvitationFieldNumber = 102, - kClosedGroupControlMessageFieldNumber = 104, - kFlagsFieldNumber = 4, - kExpireTimerFieldNumber = 5, - kTimestampFieldNumber = 7, - kBlocksCommunityMessageRequestsFieldNumber = 106, + kGroupSessionIdFieldNumber = 1, + kNameFieldNumber = 2, + kMemberAuthDataFieldNumber = 3, + kAdminSignatureFieldNumber = 4, }; - // repeated .SessionProtos.AttachmentPointer attachments = 2; - int attachments_size() const; - private: - int _internal_attachments_size() const; - public: - void clear_attachments(); - ::SessionProtos::AttachmentPointer* mutable_attachments(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer >* - mutable_attachments(); - private: - const ::SessionProtos::AttachmentPointer& _internal_attachments(int index) const; - ::SessionProtos::AttachmentPointer* _internal_add_attachments(); - public: - const ::SessionProtos::AttachmentPointer& attachments(int index) const; - ::SessionProtos::AttachmentPointer* add_attachments(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer >& - attachments() const; - - // repeated .SessionProtos.DataMessage.Preview preview = 10; - int preview_size() const; + // required string groupSessionId = 1; + bool has_groupsessionid() const; private: - int _internal_preview_size() const; + bool _internal_has_groupsessionid() const; public: - void clear_preview(); - ::SessionProtos::DataMessage_Preview* mutable_preview(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview >* - mutable_preview(); + void clear_groupsessionid(); + const std::string& groupsessionid() const; + template + void set_groupsessionid(ArgT0&& arg0, ArgT... args); + std::string* mutable_groupsessionid(); + PROTOBUF_NODISCARD std::string* release_groupsessionid(); + void set_allocated_groupsessionid(std::string* groupsessionid); private: - const ::SessionProtos::DataMessage_Preview& _internal_preview(int index) const; - ::SessionProtos::DataMessage_Preview* _internal_add_preview(); + const std::string& _internal_groupsessionid() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_groupsessionid(const std::string& value); + std::string* _internal_mutable_groupsessionid(); public: - const ::SessionProtos::DataMessage_Preview& preview(int index) const; - ::SessionProtos::DataMessage_Preview* add_preview(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview >& - preview() const; - // optional string body = 1; - bool has_body() const; + // required string name = 2; + bool has_name() const; private: - bool _internal_has_body() const; + bool _internal_has_name() const; public: - void clear_body(); - const std::string& body() const; + void clear_name(); + const std::string& name() const; template - void set_body(ArgT0&& arg0, ArgT... args); - std::string* mutable_body(); - PROTOBUF_NODISCARD std::string* release_body(); - void set_allocated_body(std::string* body); + void set_name(ArgT0&& arg0, ArgT... args); + std::string* mutable_name(); + PROTOBUF_NODISCARD std::string* release_name(); + void set_allocated_name(std::string* name); private: - const std::string& _internal_body() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_body(const std::string& value); - std::string* _internal_mutable_body(); + const std::string& _internal_name() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + std::string* _internal_mutable_name(); public: - // optional bytes profileKey = 6; - bool has_profilekey() const; + // required bytes memberAuthData = 3; + bool has_memberauthdata() const; private: - bool _internal_has_profilekey() const; + bool _internal_has_memberauthdata() const; public: - void clear_profilekey(); - const std::string& profilekey() const; + void clear_memberauthdata(); + const std::string& memberauthdata() const; template - void set_profilekey(ArgT0&& arg0, ArgT... args); - std::string* mutable_profilekey(); - PROTOBUF_NODISCARD std::string* release_profilekey(); - void set_allocated_profilekey(std::string* profilekey); + void set_memberauthdata(ArgT0&& arg0, ArgT... args); + std::string* mutable_memberauthdata(); + PROTOBUF_NODISCARD std::string* release_memberauthdata(); + void set_allocated_memberauthdata(std::string* memberauthdata); private: - const std::string& _internal_profilekey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilekey(const std::string& value); - std::string* _internal_mutable_profilekey(); + const std::string& _internal_memberauthdata() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_memberauthdata(const std::string& value); + std::string* _internal_mutable_memberauthdata(); public: - // optional string syncTarget = 105; - bool has_synctarget() const; + // required bytes adminSignature = 4; + bool has_adminsignature() const; private: - bool _internal_has_synctarget() const; + bool _internal_has_adminsignature() const; public: - void clear_synctarget(); - const std::string& synctarget() const; + void clear_adminsignature(); + const std::string& adminsignature() const; template - void set_synctarget(ArgT0&& arg0, ArgT... args); - std::string* mutable_synctarget(); - PROTOBUF_NODISCARD std::string* release_synctarget(); - void set_allocated_synctarget(std::string* synctarget); + void set_adminsignature(ArgT0&& arg0, ArgT... args); + std::string* mutable_adminsignature(); + PROTOBUF_NODISCARD std::string* release_adminsignature(); + void set_allocated_adminsignature(std::string* adminsignature); private: - const std::string& _internal_synctarget() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_synctarget(const std::string& value); - std::string* _internal_mutable_synctarget(); + const std::string& _internal_adminsignature() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_adminsignature(const std::string& value); + std::string* _internal_mutable_adminsignature(); public: - // optional .SessionProtos.DataMessage.Quote quote = 8; - bool has_quote() const; - private: - bool _internal_has_quote() const; - public: - void clear_quote(); - const ::SessionProtos::DataMessage_Quote& quote() const; - PROTOBUF_NODISCARD ::SessionProtos::DataMessage_Quote* release_quote(); - ::SessionProtos::DataMessage_Quote* mutable_quote(); - void set_allocated_quote(::SessionProtos::DataMessage_Quote* quote); - private: - const ::SessionProtos::DataMessage_Quote& _internal_quote() const; - ::SessionProtos::DataMessage_Quote* _internal_mutable_quote(); - public: - void unsafe_arena_set_allocated_quote( - ::SessionProtos::DataMessage_Quote* quote); - ::SessionProtos::DataMessage_Quote* unsafe_arena_release_quote(); + // @@protoc_insertion_point(class_scope:SessionProtos.GroupUpdateInviteMessage) + private: + class _Internal; - // optional .SessionProtos.DataMessage.Reaction reaction = 11; - bool has_reaction() const; - private: - bool _internal_has_reaction() const; - public: - void clear_reaction(); - const ::SessionProtos::DataMessage_Reaction& reaction() const; - PROTOBUF_NODISCARD ::SessionProtos::DataMessage_Reaction* release_reaction(); - ::SessionProtos::DataMessage_Reaction* mutable_reaction(); - void set_allocated_reaction(::SessionProtos::DataMessage_Reaction* reaction); - private: - const ::SessionProtos::DataMessage_Reaction& _internal_reaction() const; - ::SessionProtos::DataMessage_Reaction* _internal_mutable_reaction(); - public: - void unsafe_arena_set_allocated_reaction( - ::SessionProtos::DataMessage_Reaction* reaction); - ::SessionProtos::DataMessage_Reaction* unsafe_arena_release_reaction(); + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; - // optional .SessionProtos.LokiProfile profile = 101; - bool has_profile() const; - private: - bool _internal_has_profile() const; - public: - void clear_profile(); - const ::SessionProtos::LokiProfile& profile() const; - PROTOBUF_NODISCARD ::SessionProtos::LokiProfile* release_profile(); - ::SessionProtos::LokiProfile* mutable_profile(); - void set_allocated_profile(::SessionProtos::LokiProfile* profile); - private: - const ::SessionProtos::LokiProfile& _internal_profile() const; - ::SessionProtos::LokiProfile* _internal_mutable_profile(); - public: - void unsafe_arena_set_allocated_profile( - ::SessionProtos::LokiProfile* profile); - ::SessionProtos::LokiProfile* unsafe_arena_release_profile(); + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr groupsessionid_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr memberauthdata_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr adminsignature_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_SessionProtos_2eproto; +}; +// ------------------------------------------------------------------- - // optional .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; - bool has_opengroupinvitation() const; - private: - bool _internal_has_opengroupinvitation() const; - public: - void clear_opengroupinvitation(); - const ::SessionProtos::DataMessage_OpenGroupInvitation& opengroupinvitation() const; - PROTOBUF_NODISCARD ::SessionProtos::DataMessage_OpenGroupInvitation* release_opengroupinvitation(); - ::SessionProtos::DataMessage_OpenGroupInvitation* mutable_opengroupinvitation(); - void set_allocated_opengroupinvitation(::SessionProtos::DataMessage_OpenGroupInvitation* opengroupinvitation); - private: - const ::SessionProtos::DataMessage_OpenGroupInvitation& _internal_opengroupinvitation() const; - ::SessionProtos::DataMessage_OpenGroupInvitation* _internal_mutable_opengroupinvitation(); - public: - void unsafe_arena_set_allocated_opengroupinvitation( - ::SessionProtos::DataMessage_OpenGroupInvitation* opengroupinvitation); - ::SessionProtos::DataMessage_OpenGroupInvitation* unsafe_arena_release_opengroupinvitation(); - - // optional .SessionProtos.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; - bool has_closedgroupcontrolmessage() const; - private: - bool _internal_has_closedgroupcontrolmessage() const; - public: - void clear_closedgroupcontrolmessage(); - const ::SessionProtos::DataMessage_ClosedGroupControlMessage& closedgroupcontrolmessage() const; - PROTOBUF_NODISCARD ::SessionProtos::DataMessage_ClosedGroupControlMessage* release_closedgroupcontrolmessage(); - ::SessionProtos::DataMessage_ClosedGroupControlMessage* mutable_closedgroupcontrolmessage(); - void set_allocated_closedgroupcontrolmessage(::SessionProtos::DataMessage_ClosedGroupControlMessage* closedgroupcontrolmessage); - private: - const ::SessionProtos::DataMessage_ClosedGroupControlMessage& _internal_closedgroupcontrolmessage() const; - ::SessionProtos::DataMessage_ClosedGroupControlMessage* _internal_mutable_closedgroupcontrolmessage(); - public: - void unsafe_arena_set_allocated_closedgroupcontrolmessage( - ::SessionProtos::DataMessage_ClosedGroupControlMessage* closedgroupcontrolmessage); - ::SessionProtos::DataMessage_ClosedGroupControlMessage* unsafe_arena_release_closedgroupcontrolmessage(); - - // optional uint32 flags = 4; - bool has_flags() const; - private: - bool _internal_has_flags() const; - public: - void clear_flags(); - uint32_t flags() const; - void set_flags(uint32_t value); - private: - uint32_t _internal_flags() const; - void _internal_set_flags(uint32_t value); - public: - - // optional uint32 expireTimer = 5; - bool has_expiretimer() const; - private: - bool _internal_has_expiretimer() const; - public: - void clear_expiretimer(); - uint32_t expiretimer() const; - void set_expiretimer(uint32_t value); - private: - uint32_t _internal_expiretimer() const; - void _internal_set_expiretimer(uint32_t value); - public: - - // optional uint64 timestamp = 7; - bool has_timestamp() const; - private: - bool _internal_has_timestamp() const; - public: - void clear_timestamp(); - uint64_t timestamp() const; - void set_timestamp(uint64_t value); - private: - uint64_t _internal_timestamp() const; - void _internal_set_timestamp(uint64_t value); - public: - - // optional bool blocksCommunityMessageRequests = 106; - bool has_blockscommunitymessagerequests() const; - private: - bool _internal_has_blockscommunitymessagerequests() const; - public: - void clear_blockscommunitymessagerequests(); - bool blockscommunitymessagerequests() const; - void set_blockscommunitymessagerequests(bool value); - private: - bool _internal_blockscommunitymessagerequests() const; - void _internal_set_blockscommunitymessagerequests(bool value); - public: - - // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer > attachments_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview > preview_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr body_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilekey_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr synctarget_; - ::SessionProtos::DataMessage_Quote* quote_; - ::SessionProtos::DataMessage_Reaction* reaction_; - ::SessionProtos::LokiProfile* profile_; - ::SessionProtos::DataMessage_OpenGroupInvitation* opengroupinvitation_; - ::SessionProtos::DataMessage_ClosedGroupControlMessage* closedgroupcontrolmessage_; - uint32_t flags_; - uint32_t expiretimer_; - uint64_t timestamp_; - bool blockscommunitymessagerequests_; - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_SessionProtos_2eproto; -}; -// ------------------------------------------------------------------- - -class ConfigurationMessage_ClosedGroup final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ConfigurationMessage.ClosedGroup) */ { +class GroupUpdatePromoteMessage final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdatePromoteMessage) */ { public: - inline ConfigurationMessage_ClosedGroup() : ConfigurationMessage_ClosedGroup(nullptr) {} - ~ConfigurationMessage_ClosedGroup() override; - explicit PROTOBUF_CONSTEXPR ConfigurationMessage_ClosedGroup(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline GroupUpdatePromoteMessage() : GroupUpdatePromoteMessage(nullptr) {} + ~GroupUpdatePromoteMessage() override; + explicit PROTOBUF_CONSTEXPR GroupUpdatePromoteMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ConfigurationMessage_ClosedGroup(const ConfigurationMessage_ClosedGroup& from); - ConfigurationMessage_ClosedGroup(ConfigurationMessage_ClosedGroup&& from) noexcept - : ConfigurationMessage_ClosedGroup() { + GroupUpdatePromoteMessage(const GroupUpdatePromoteMessage& from); + GroupUpdatePromoteMessage(GroupUpdatePromoteMessage&& from) noexcept + : GroupUpdatePromoteMessage() { *this = ::std::move(from); } - inline ConfigurationMessage_ClosedGroup& operator=(const ConfigurationMessage_ClosedGroup& from) { + inline GroupUpdatePromoteMessage& operator=(const GroupUpdatePromoteMessage& from) { CopyFrom(from); return *this; } - inline ConfigurationMessage_ClosedGroup& operator=(ConfigurationMessage_ClosedGroup&& from) noexcept { + inline GroupUpdatePromoteMessage& operator=(GroupUpdatePromoteMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -4798,27 +5528,36 @@ class ConfigurationMessage_ClosedGroup final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const ConfigurationMessage_ClosedGroup& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const GroupUpdatePromoteMessage& default_instance() { return *internal_default_instance(); } - static inline const ConfigurationMessage_ClosedGroup* internal_default_instance() { - return reinterpret_cast( - &_ConfigurationMessage_ClosedGroup_default_instance_); + static inline const GroupUpdatePromoteMessage* internal_default_instance() { + return reinterpret_cast( + &_GroupUpdatePromoteMessage_default_instance_); } static constexpr int kIndexInFileMessages = 20; - friend void swap(ConfigurationMessage_ClosedGroup& a, ConfigurationMessage_ClosedGroup& b) { + friend void swap(GroupUpdatePromoteMessage& a, GroupUpdatePromoteMessage& b) { a.Swap(&b); } - inline void Swap(ConfigurationMessage_ClosedGroup* other) { + inline void Swap(GroupUpdatePromoteMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -4831,7 +5570,7 @@ class ConfigurationMessage_ClosedGroup final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ConfigurationMessage_ClosedGroup* other) { + void UnsafeArenaSwap(GroupUpdatePromoteMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -4839,12 +5578,18 @@ class ConfigurationMessage_ClosedGroup final : // implements Message ---------------------------------------------- - ConfigurationMessage_ClosedGroup* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + GroupUpdatePromoteMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const GroupUpdatePromoteMessage& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const GroupUpdatePromoteMessage& from) { + GroupUpdatePromoteMessage::MergeImpl(*this, from); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const ConfigurationMessage_ClosedGroup& from); - void MergeFrom(const ConfigurationMessage_ClosedGroup& from); + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -4857,100 +5602,51 @@ class ConfigurationMessage_ClosedGroup final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(ConfigurationMessage_ClosedGroup* other); + void SetCachedSize(int size) const final; + void InternalSwap(GroupUpdatePromoteMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.ConfigurationMessage.ClosedGroup"; + return "SessionProtos.GroupUpdatePromoteMessage"; } protected: - explicit ConfigurationMessage_ClosedGroup(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit GroupUpdatePromoteMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { - kMembersFieldNumber = 4, - kAdminsFieldNumber = 5, - kPublicKeyFieldNumber = 1, + kGroupIdentitySeedFieldNumber = 1, kNameFieldNumber = 2, - kEncryptionKeyPairFieldNumber = 3, - kExpirationTimerFieldNumber = 6, }; - // repeated bytes members = 4; - int members_size() const; - private: - int _internal_members_size() const; - public: - void clear_members(); - const std::string& members(int index) const; - std::string* mutable_members(int index); - void set_members(int index, const std::string& value); - void set_members(int index, std::string&& value); - void set_members(int index, const char* value); - void set_members(int index, const void* value, size_t size); - std::string* add_members(); - void add_members(const std::string& value); - void add_members(std::string&& value); - void add_members(const char* value); - void add_members(const void* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& members() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_members(); - private: - const std::string& _internal_members(int index) const; - std::string* _internal_add_members(); - public: - - // repeated bytes admins = 5; - int admins_size() const; - private: - int _internal_admins_size() const; - public: - void clear_admins(); - const std::string& admins(int index) const; - std::string* mutable_admins(int index); - void set_admins(int index, const std::string& value); - void set_admins(int index, std::string&& value); - void set_admins(int index, const char* value); - void set_admins(int index, const void* value, size_t size); - std::string* add_admins(); - void add_admins(const std::string& value); - void add_admins(std::string&& value); - void add_admins(const char* value); - void add_admins(const void* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& admins() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_admins(); - private: - const std::string& _internal_admins(int index) const; - std::string* _internal_add_admins(); - public: - - // optional bytes publicKey = 1; - bool has_publickey() const; + // required bytes groupIdentitySeed = 1; + bool has_groupidentityseed() const; private: - bool _internal_has_publickey() const; + bool _internal_has_groupidentityseed() const; public: - void clear_publickey(); - const std::string& publickey() const; + void clear_groupidentityseed(); + const std::string& groupidentityseed() const; template - void set_publickey(ArgT0&& arg0, ArgT... args); - std::string* mutable_publickey(); - PROTOBUF_NODISCARD std::string* release_publickey(); - void set_allocated_publickey(std::string* publickey); + void set_groupidentityseed(ArgT0&& arg0, ArgT... args); + std::string* mutable_groupidentityseed(); + PROTOBUF_NODISCARD std::string* release_groupidentityseed(); + void set_allocated_groupidentityseed(std::string* groupidentityseed); private: - const std::string& _internal_publickey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_publickey(const std::string& value); - std::string* _internal_mutable_publickey(); + const std::string& _internal_groupidentityseed() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_groupidentityseed(const std::string& value); + std::string* _internal_mutable_groupidentityseed(); public: - // optional string name = 2; + // required string name = 2; bool has_name() const; private: bool _internal_has_name() const; @@ -4968,77 +5664,45 @@ class ConfigurationMessage_ClosedGroup final : std::string* _internal_mutable_name(); public: - // optional .SessionProtos.KeyPair encryptionKeyPair = 3; - bool has_encryptionkeypair() const; - private: - bool _internal_has_encryptionkeypair() const; - public: - void clear_encryptionkeypair(); - const ::SessionProtos::KeyPair& encryptionkeypair() const; - PROTOBUF_NODISCARD ::SessionProtos::KeyPair* release_encryptionkeypair(); - ::SessionProtos::KeyPair* mutable_encryptionkeypair(); - void set_allocated_encryptionkeypair(::SessionProtos::KeyPair* encryptionkeypair); - private: - const ::SessionProtos::KeyPair& _internal_encryptionkeypair() const; - ::SessionProtos::KeyPair* _internal_mutable_encryptionkeypair(); - public: - void unsafe_arena_set_allocated_encryptionkeypair( - ::SessionProtos::KeyPair* encryptionkeypair); - ::SessionProtos::KeyPair* unsafe_arena_release_encryptionkeypair(); - - // optional uint32 expirationTimer = 6; - bool has_expirationtimer() const; - private: - bool _internal_has_expirationtimer() const; - public: - void clear_expirationtimer(); - uint32_t expirationtimer() const; - void set_expirationtimer(uint32_t value); - private: - uint32_t _internal_expirationtimer() const; - void _internal_set_expirationtimer(uint32_t value); - public: - - // @@protoc_insertion_point(class_scope:SessionProtos.ConfigurationMessage.ClosedGroup) + // @@protoc_insertion_point(class_scope:SessionProtos.GroupUpdatePromoteMessage) private: class _Internal; + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField members_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField admins_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr publickey_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr groupidentityseed_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::SessionProtos::KeyPair* encryptionkeypair_; - uint32_t expirationtimer_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class ConfigurationMessage_Contact final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ConfigurationMessage.Contact) */ { +class GroupUpdateInfoChangeMessage final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateInfoChangeMessage) */ { public: - inline ConfigurationMessage_Contact() : ConfigurationMessage_Contact(nullptr) {} - ~ConfigurationMessage_Contact() override; - explicit PROTOBUF_CONSTEXPR ConfigurationMessage_Contact(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline GroupUpdateInfoChangeMessage() : GroupUpdateInfoChangeMessage(nullptr) {} + ~GroupUpdateInfoChangeMessage() override; + explicit PROTOBUF_CONSTEXPR GroupUpdateInfoChangeMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ConfigurationMessage_Contact(const ConfigurationMessage_Contact& from); - ConfigurationMessage_Contact(ConfigurationMessage_Contact&& from) noexcept - : ConfigurationMessage_Contact() { + GroupUpdateInfoChangeMessage(const GroupUpdateInfoChangeMessage& from); + GroupUpdateInfoChangeMessage(GroupUpdateInfoChangeMessage&& from) noexcept + : GroupUpdateInfoChangeMessage() { *this = ::std::move(from); } - inline ConfigurationMessage_Contact& operator=(const ConfigurationMessage_Contact& from) { + inline GroupUpdateInfoChangeMessage& operator=(const GroupUpdateInfoChangeMessage& from) { CopyFrom(from); return *this; } - inline ConfigurationMessage_Contact& operator=(ConfigurationMessage_Contact&& from) noexcept { + inline GroupUpdateInfoChangeMessage& operator=(GroupUpdateInfoChangeMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -5052,27 +5716,36 @@ class ConfigurationMessage_Contact final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const ConfigurationMessage_Contact& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const GroupUpdateInfoChangeMessage& default_instance() { return *internal_default_instance(); } - static inline const ConfigurationMessage_Contact* internal_default_instance() { - return reinterpret_cast( - &_ConfigurationMessage_Contact_default_instance_); + static inline const GroupUpdateInfoChangeMessage* internal_default_instance() { + return reinterpret_cast( + &_GroupUpdateInfoChangeMessage_default_instance_); } static constexpr int kIndexInFileMessages = 21; - friend void swap(ConfigurationMessage_Contact& a, ConfigurationMessage_Contact& b) { + friend void swap(GroupUpdateInfoChangeMessage& a, GroupUpdateInfoChangeMessage& b) { a.Swap(&b); } - inline void Swap(ConfigurationMessage_Contact* other) { + inline void Swap(GroupUpdateInfoChangeMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -5085,7 +5758,7 @@ class ConfigurationMessage_Contact final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ConfigurationMessage_Contact* other) { + void UnsafeArenaSwap(GroupUpdateInfoChangeMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -5093,12 +5766,18 @@ class ConfigurationMessage_Contact final : // implements Message ---------------------------------------------- - ConfigurationMessage_Contact* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + GroupUpdateInfoChangeMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const GroupUpdateInfoChangeMessage& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const GroupUpdateInfoChangeMessage& from) { + GroupUpdateInfoChangeMessage::MergeImpl(*this, from); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const ConfigurationMessage_Contact& from); - void MergeFrom(const ConfigurationMessage_Contact& from); + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -5111,146 +5790,129 @@ class ConfigurationMessage_Contact final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(ConfigurationMessage_Contact* other); + void SetCachedSize(int size) const final; + void InternalSwap(GroupUpdateInfoChangeMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.ConfigurationMessage.Contact"; + return "SessionProtos.GroupUpdateInfoChangeMessage"; } protected: - explicit ConfigurationMessage_Contact(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit GroupUpdateInfoChangeMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; // nested types ---------------------------------------------------- + typedef GroupUpdateInfoChangeMessage_Type Type; + static constexpr Type NAME = + GroupUpdateInfoChangeMessage_Type_NAME; + static constexpr Type AVATAR = + GroupUpdateInfoChangeMessage_Type_AVATAR; + static constexpr Type DISAPPEARING_MESSAGES = + GroupUpdateInfoChangeMessage_Type_DISAPPEARING_MESSAGES; + static inline bool Type_IsValid(int value) { + return GroupUpdateInfoChangeMessage_Type_IsValid(value); + } + static constexpr Type Type_MIN = + GroupUpdateInfoChangeMessage_Type_Type_MIN; + static constexpr Type Type_MAX = + GroupUpdateInfoChangeMessage_Type_Type_MAX; + static constexpr int Type_ARRAYSIZE = + GroupUpdateInfoChangeMessage_Type_Type_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + Type_descriptor() { + return GroupUpdateInfoChangeMessage_Type_descriptor(); + } + template + static inline const std::string& Type_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Type_Name."); + return GroupUpdateInfoChangeMessage_Type_Name(enum_t_value); + } + static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Type* value) { + return GroupUpdateInfoChangeMessage_Type_Parse(name, value); + } + // accessors ------------------------------------------------------- enum : int { - kPublicKeyFieldNumber = 1, - kNameFieldNumber = 2, - kProfilePictureFieldNumber = 3, - kProfileKeyFieldNumber = 4, - kIsApprovedFieldNumber = 5, - kIsBlockedFieldNumber = 6, - kDidApproveMeFieldNumber = 7, + kUpdatedNameFieldNumber = 2, + kAdminSignatureFieldNumber = 4, + kUpdatedExpirationFieldNumber = 3, + kTypeFieldNumber = 1, }; - // required bytes publicKey = 1; - bool has_publickey() const; - private: - bool _internal_has_publickey() const; - public: - void clear_publickey(); - const std::string& publickey() const; - template - void set_publickey(ArgT0&& arg0, ArgT... args); - std::string* mutable_publickey(); - PROTOBUF_NODISCARD std::string* release_publickey(); - void set_allocated_publickey(std::string* publickey); - private: - const std::string& _internal_publickey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_publickey(const std::string& value); - std::string* _internal_mutable_publickey(); - public: - - // required string name = 2; - bool has_name() const; - private: - bool _internal_has_name() const; - public: - void clear_name(); - const std::string& name() const; - template - void set_name(ArgT0&& arg0, ArgT... args); - std::string* mutable_name(); - PROTOBUF_NODISCARD std::string* release_name(); - void set_allocated_name(std::string* name); + // optional string updatedName = 2; + bool has_updatedname() const; private: - const std::string& _internal_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); - std::string* _internal_mutable_name(); - public: - - // optional string profilePicture = 3; - bool has_profilepicture() const; - private: - bool _internal_has_profilepicture() const; + bool _internal_has_updatedname() const; public: - void clear_profilepicture(); - const std::string& profilepicture() const; + void clear_updatedname(); + const std::string& updatedname() const; template - void set_profilepicture(ArgT0&& arg0, ArgT... args); - std::string* mutable_profilepicture(); - PROTOBUF_NODISCARD std::string* release_profilepicture(); - void set_allocated_profilepicture(std::string* profilepicture); + void set_updatedname(ArgT0&& arg0, ArgT... args); + std::string* mutable_updatedname(); + PROTOBUF_NODISCARD std::string* release_updatedname(); + void set_allocated_updatedname(std::string* updatedname); private: - const std::string& _internal_profilepicture() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilepicture(const std::string& value); - std::string* _internal_mutable_profilepicture(); + const std::string& _internal_updatedname() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_updatedname(const std::string& value); + std::string* _internal_mutable_updatedname(); public: - // optional bytes profileKey = 4; - bool has_profilekey() const; + // required bytes adminSignature = 4; + bool has_adminsignature() const; private: - bool _internal_has_profilekey() const; + bool _internal_has_adminsignature() const; public: - void clear_profilekey(); - const std::string& profilekey() const; + void clear_adminsignature(); + const std::string& adminsignature() const; template - void set_profilekey(ArgT0&& arg0, ArgT... args); - std::string* mutable_profilekey(); - PROTOBUF_NODISCARD std::string* release_profilekey(); - void set_allocated_profilekey(std::string* profilekey); - private: - const std::string& _internal_profilekey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilekey(const std::string& value); - std::string* _internal_mutable_profilekey(); - public: - - // optional bool isApproved = 5; - bool has_isapproved() const; + void set_adminsignature(ArgT0&& arg0, ArgT... args); + std::string* mutable_adminsignature(); + PROTOBUF_NODISCARD std::string* release_adminsignature(); + void set_allocated_adminsignature(std::string* adminsignature); private: - bool _internal_has_isapproved() const; - public: - void clear_isapproved(); - bool isapproved() const; - void set_isapproved(bool value); - private: - bool _internal_isapproved() const; - void _internal_set_isapproved(bool value); + const std::string& _internal_adminsignature() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_adminsignature(const std::string& value); + std::string* _internal_mutable_adminsignature(); public: - // optional bool isBlocked = 6; - bool has_isblocked() const; + // optional uint32 updatedExpiration = 3; + bool has_updatedexpiration() const; private: - bool _internal_has_isblocked() const; + bool _internal_has_updatedexpiration() const; public: - void clear_isblocked(); - bool isblocked() const; - void set_isblocked(bool value); + void clear_updatedexpiration(); + uint32_t updatedexpiration() const; + void set_updatedexpiration(uint32_t value); private: - bool _internal_isblocked() const; - void _internal_set_isblocked(bool value); + uint32_t _internal_updatedexpiration() const; + void _internal_set_updatedexpiration(uint32_t value); public: - // optional bool didApproveMe = 7; - bool has_didapproveme() const; + // required .SessionProtos.GroupUpdateInfoChangeMessage.Type type = 1; + bool has_type() const; private: - bool _internal_has_didapproveme() const; + bool _internal_has_type() const; public: - void clear_didapproveme(); - bool didapproveme() const; - void set_didapproveme(bool value); + void clear_type(); + ::SessionProtos::GroupUpdateInfoChangeMessage_Type type() const; + void set_type(::SessionProtos::GroupUpdateInfoChangeMessage_Type value); private: - bool _internal_didapproveme() const; - void _internal_set_didapproveme(bool value); + ::SessionProtos::GroupUpdateInfoChangeMessage_Type _internal_type() const; + void _internal_set_type(::SessionProtos::GroupUpdateInfoChangeMessage_Type value); public: - // @@protoc_insertion_point(class_scope:SessionProtos.ConfigurationMessage.Contact) + // @@protoc_insertion_point(class_scope:SessionProtos.GroupUpdateInfoChangeMessage) private: class _Internal; @@ -5263,37 +5925,34 @@ class ConfigurationMessage_Contact final : struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr publickey_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilepicture_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilekey_; - bool isapproved_; - bool isblocked_; - bool didapproveme_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr updatedname_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr adminsignature_; + uint32_t updatedexpiration_; + int type_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class ConfigurationMessage final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ConfigurationMessage) */ { +class GroupUpdateMemberChangeMessage final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateMemberChangeMessage) */ { public: - inline ConfigurationMessage() : ConfigurationMessage(nullptr) {} - ~ConfigurationMessage() override; - explicit PROTOBUF_CONSTEXPR ConfigurationMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline GroupUpdateMemberChangeMessage() : GroupUpdateMemberChangeMessage(nullptr) {} + ~GroupUpdateMemberChangeMessage() override; + explicit PROTOBUF_CONSTEXPR GroupUpdateMemberChangeMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ConfigurationMessage(const ConfigurationMessage& from); - ConfigurationMessage(ConfigurationMessage&& from) noexcept - : ConfigurationMessage() { + GroupUpdateMemberChangeMessage(const GroupUpdateMemberChangeMessage& from); + GroupUpdateMemberChangeMessage(GroupUpdateMemberChangeMessage&& from) noexcept + : GroupUpdateMemberChangeMessage() { *this = ::std::move(from); } - inline ConfigurationMessage& operator=(const ConfigurationMessage& from) { + inline GroupUpdateMemberChangeMessage& operator=(const GroupUpdateMemberChangeMessage& from) { CopyFrom(from); return *this; } - inline ConfigurationMessage& operator=(ConfigurationMessage&& from) noexcept { + inline GroupUpdateMemberChangeMessage& operator=(GroupUpdateMemberChangeMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -5307,27 +5966,36 @@ class ConfigurationMessage final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const ConfigurationMessage& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const GroupUpdateMemberChangeMessage& default_instance() { return *internal_default_instance(); } - static inline const ConfigurationMessage* internal_default_instance() { - return reinterpret_cast( - &_ConfigurationMessage_default_instance_); + static inline const GroupUpdateMemberChangeMessage* internal_default_instance() { + return reinterpret_cast( + &_GroupUpdateMemberChangeMessage_default_instance_); } static constexpr int kIndexInFileMessages = 22; - friend void swap(ConfigurationMessage& a, ConfigurationMessage& b) { + friend void swap(GroupUpdateMemberChangeMessage& a, GroupUpdateMemberChangeMessage& b) { a.Swap(&b); } - inline void Swap(ConfigurationMessage* other) { + inline void Swap(GroupUpdateMemberChangeMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -5340,7 +6008,7 @@ class ConfigurationMessage final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ConfigurationMessage* other) { + void UnsafeArenaSwap(GroupUpdateMemberChangeMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -5348,12 +6016,18 @@ class ConfigurationMessage final : // implements Message ---------------------------------------------- - ConfigurationMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + GroupUpdateMemberChangeMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const ConfigurationMessage& from); - void MergeFrom(const ConfigurationMessage& from); + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const GroupUpdateMemberChangeMessage& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const GroupUpdateMemberChangeMessage& from) { + GroupUpdateMemberChangeMessage::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -5366,210 +6040,174 @@ class ConfigurationMessage final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(ConfigurationMessage* other); + void SetCachedSize(int size) const final; + void InternalSwap(GroupUpdateMemberChangeMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.ConfigurationMessage"; + return "SessionProtos.GroupUpdateMemberChangeMessage"; } protected: - explicit ConfigurationMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit GroupUpdateMemberChangeMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; // nested types ---------------------------------------------------- - typedef ConfigurationMessage_ClosedGroup ClosedGroup; - typedef ConfigurationMessage_Contact Contact; + typedef GroupUpdateMemberChangeMessage_Type Type; + static constexpr Type ADDED = + GroupUpdateMemberChangeMessage_Type_ADDED; + static constexpr Type REMOVED = + GroupUpdateMemberChangeMessage_Type_REMOVED; + static constexpr Type PROMOTED = + GroupUpdateMemberChangeMessage_Type_PROMOTED; + static inline bool Type_IsValid(int value) { + return GroupUpdateMemberChangeMessage_Type_IsValid(value); + } + static constexpr Type Type_MIN = + GroupUpdateMemberChangeMessage_Type_Type_MIN; + static constexpr Type Type_MAX = + GroupUpdateMemberChangeMessage_Type_Type_MAX; + static constexpr int Type_ARRAYSIZE = + GroupUpdateMemberChangeMessage_Type_Type_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + Type_descriptor() { + return GroupUpdateMemberChangeMessage_Type_descriptor(); + } + template + static inline const std::string& Type_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Type_Name."); + return GroupUpdateMemberChangeMessage_Type_Name(enum_t_value); + } + static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Type* value) { + return GroupUpdateMemberChangeMessage_Type_Parse(name, value); + } // accessors ------------------------------------------------------- enum : int { - kClosedGroupsFieldNumber = 1, - kOpenGroupsFieldNumber = 2, - kContactsFieldNumber = 6, - kDisplayNameFieldNumber = 3, - kProfilePictureFieldNumber = 4, - kProfileKeyFieldNumber = 5, - kProConfigFieldNumber = 7, + kMemberSessionIdsFieldNumber = 2, + kAdminSignatureFieldNumber = 4, + kHistorySharedFieldNumber = 3, + kTypeFieldNumber = 1, }; - // repeated .SessionProtos.ConfigurationMessage.ClosedGroup closedGroups = 1; - int closedgroups_size() const; + // repeated string memberSessionIds = 2; + int membersessionids_size() const; private: - int _internal_closedgroups_size() const; + int _internal_membersessionids_size() const; public: - void clear_closedgroups(); - ::SessionProtos::ConfigurationMessage_ClosedGroup* mutable_closedgroups(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_ClosedGroup >* - mutable_closedgroups(); + void clear_membersessionids(); + const std::string& membersessionids(int index) const; + std::string* mutable_membersessionids(int index); + void set_membersessionids(int index, const std::string& value); + void set_membersessionids(int index, std::string&& value); + void set_membersessionids(int index, const char* value); + void set_membersessionids(int index, const char* value, size_t size); + std::string* add_membersessionids(); + void add_membersessionids(const std::string& value); + void add_membersessionids(std::string&& value); + void add_membersessionids(const char* value); + void add_membersessionids(const char* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& membersessionids() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_membersessionids(); private: - const ::SessionProtos::ConfigurationMessage_ClosedGroup& _internal_closedgroups(int index) const; - ::SessionProtos::ConfigurationMessage_ClosedGroup* _internal_add_closedgroups(); + const std::string& _internal_membersessionids(int index) const; + std::string* _internal_add_membersessionids(); public: - const ::SessionProtos::ConfigurationMessage_ClosedGroup& closedgroups(int index) const; - ::SessionProtos::ConfigurationMessage_ClosedGroup* add_closedgroups(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_ClosedGroup >& - closedgroups() const; - // repeated string openGroups = 2; - int opengroups_size() const; + // required bytes adminSignature = 4; + bool has_adminsignature() const; private: - int _internal_opengroups_size() const; + bool _internal_has_adminsignature() const; public: - void clear_opengroups(); - const std::string& opengroups(int index) const; - std::string* mutable_opengroups(int index); - void set_opengroups(int index, const std::string& value); - void set_opengroups(int index, std::string&& value); - void set_opengroups(int index, const char* value); - void set_opengroups(int index, const char* value, size_t size); - std::string* add_opengroups(); - void add_opengroups(const std::string& value); - void add_opengroups(std::string&& value); - void add_opengroups(const char* value); - void add_opengroups(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& opengroups() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_opengroups(); + void clear_adminsignature(); + const std::string& adminsignature() const; + template + void set_adminsignature(ArgT0&& arg0, ArgT... args); + std::string* mutable_adminsignature(); + PROTOBUF_NODISCARD std::string* release_adminsignature(); + void set_allocated_adminsignature(std::string* adminsignature); private: - const std::string& _internal_opengroups(int index) const; - std::string* _internal_add_opengroups(); + const std::string& _internal_adminsignature() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_adminsignature(const std::string& value); + std::string* _internal_mutable_adminsignature(); public: - // repeated .SessionProtos.ConfigurationMessage.Contact contacts = 6; - int contacts_size() const; + // optional bool historyShared = 3; + bool has_historyshared() const; private: - int _internal_contacts_size() const; + bool _internal_has_historyshared() const; public: - void clear_contacts(); - ::SessionProtos::ConfigurationMessage_Contact* mutable_contacts(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_Contact >* - mutable_contacts(); + void clear_historyshared(); + bool historyshared() const; + void set_historyshared(bool value); private: - const ::SessionProtos::ConfigurationMessage_Contact& _internal_contacts(int index) const; - ::SessionProtos::ConfigurationMessage_Contact* _internal_add_contacts(); + bool _internal_historyshared() const; + void _internal_set_historyshared(bool value); public: - const ::SessionProtos::ConfigurationMessage_Contact& contacts(int index) const; - ::SessionProtos::ConfigurationMessage_Contact* add_contacts(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_Contact >& - contacts() const; - // optional string displayName = 3; - bool has_displayname() const; + // required .SessionProtos.GroupUpdateMemberChangeMessage.Type type = 1; + bool has_type() const; private: - bool _internal_has_displayname() const; + bool _internal_has_type() const; public: - void clear_displayname(); - const std::string& displayname() const; - template - void set_displayname(ArgT0&& arg0, ArgT... args); - std::string* mutable_displayname(); - PROTOBUF_NODISCARD std::string* release_displayname(); - void set_allocated_displayname(std::string* displayname); - private: - const std::string& _internal_displayname() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_displayname(const std::string& value); - std::string* _internal_mutable_displayname(); - public: - - // optional string profilePicture = 4; - bool has_profilepicture() const; - private: - bool _internal_has_profilepicture() const; - public: - void clear_profilepicture(); - const std::string& profilepicture() const; - template - void set_profilepicture(ArgT0&& arg0, ArgT... args); - std::string* mutable_profilepicture(); - PROTOBUF_NODISCARD std::string* release_profilepicture(); - void set_allocated_profilepicture(std::string* profilepicture); - private: - const std::string& _internal_profilepicture() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilepicture(const std::string& value); - std::string* _internal_mutable_profilepicture(); - public: - - // optional bytes profileKey = 5; - bool has_profilekey() const; - private: - bool _internal_has_profilekey() const; - public: - void clear_profilekey(); - const std::string& profilekey() const; - template - void set_profilekey(ArgT0&& arg0, ArgT... args); - std::string* mutable_profilekey(); - PROTOBUF_NODISCARD std::string* release_profilekey(); - void set_allocated_profilekey(std::string* profilekey); - private: - const std::string& _internal_profilekey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilekey(const std::string& value); - std::string* _internal_mutable_profilekey(); - public: - - // optional .SessionProtos.ProConfig proConfig = 7; - bool has_proconfig() const; - private: - bool _internal_has_proconfig() const; - public: - void clear_proconfig(); - const ::SessionProtos::ProConfig& proconfig() const; - PROTOBUF_NODISCARD ::SessionProtos::ProConfig* release_proconfig(); - ::SessionProtos::ProConfig* mutable_proconfig(); - void set_allocated_proconfig(::SessionProtos::ProConfig* proconfig); + void clear_type(); + ::SessionProtos::GroupUpdateMemberChangeMessage_Type type() const; + void set_type(::SessionProtos::GroupUpdateMemberChangeMessage_Type value); private: - const ::SessionProtos::ProConfig& _internal_proconfig() const; - ::SessionProtos::ProConfig* _internal_mutable_proconfig(); + ::SessionProtos::GroupUpdateMemberChangeMessage_Type _internal_type() const; + void _internal_set_type(::SessionProtos::GroupUpdateMemberChangeMessage_Type value); public: - void unsafe_arena_set_allocated_proconfig( - ::SessionProtos::ProConfig* proconfig); - ::SessionProtos::ProConfig* unsafe_arena_release_proconfig(); - // @@protoc_insertion_point(class_scope:SessionProtos.ConfigurationMessage) + // @@protoc_insertion_point(class_scope:SessionProtos.GroupUpdateMemberChangeMessage) private: class _Internal; + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_ClosedGroup > closedgroups_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField opengroups_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_Contact > contacts_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr displayname_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilepicture_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilekey_; - ::SessionProtos::ProConfig* proconfig_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField membersessionids_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr adminsignature_; + bool historyshared_; + int type_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class ReceiptMessage final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ReceiptMessage) */ { +class GroupUpdateMemberLeftMessage final : + public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateMemberLeftMessage) */ { public: - inline ReceiptMessage() : ReceiptMessage(nullptr) {} - ~ReceiptMessage() override; - explicit PROTOBUF_CONSTEXPR ReceiptMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline GroupUpdateMemberLeftMessage() : GroupUpdateMemberLeftMessage(nullptr) {} + explicit PROTOBUF_CONSTEXPR GroupUpdateMemberLeftMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ReceiptMessage(const ReceiptMessage& from); - ReceiptMessage(ReceiptMessage&& from) noexcept - : ReceiptMessage() { + GroupUpdateMemberLeftMessage(const GroupUpdateMemberLeftMessage& from); + GroupUpdateMemberLeftMessage(GroupUpdateMemberLeftMessage&& from) noexcept + : GroupUpdateMemberLeftMessage() { *this = ::std::move(from); } - inline ReceiptMessage& operator=(const ReceiptMessage& from) { + inline GroupUpdateMemberLeftMessage& operator=(const GroupUpdateMemberLeftMessage& from) { CopyFrom(from); return *this; } - inline ReceiptMessage& operator=(ReceiptMessage&& from) noexcept { + inline GroupUpdateMemberLeftMessage& operator=(GroupUpdateMemberLeftMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -5583,27 +6221,36 @@ class ReceiptMessage final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const ReceiptMessage& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const GroupUpdateMemberLeftMessage& default_instance() { return *internal_default_instance(); } - static inline const ReceiptMessage* internal_default_instance() { - return reinterpret_cast( - &_ReceiptMessage_default_instance_); + static inline const GroupUpdateMemberLeftMessage* internal_default_instance() { + return reinterpret_cast( + &_GroupUpdateMemberLeftMessage_default_instance_); } static constexpr int kIndexInFileMessages = 23; - friend void swap(ReceiptMessage& a, ReceiptMessage& b) { + friend void swap(GroupUpdateMemberLeftMessage& a, GroupUpdateMemberLeftMessage& b) { a.Swap(&b); } - inline void Swap(ReceiptMessage* other) { + inline void Swap(GroupUpdateMemberLeftMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -5616,7 +6263,7 @@ class ReceiptMessage final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ReceiptMessage* other) { + void UnsafeArenaSwap(GroupUpdateMemberLeftMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -5624,109 +6271,39 @@ class ReceiptMessage final : // implements Message ---------------------------------------------- - ReceiptMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + GroupUpdateMemberLeftMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const ReceiptMessage& from); - void MergeFrom(const ReceiptMessage& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } - - private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(ReceiptMessage* other); + using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; + inline void CopyFrom(const GroupUpdateMemberLeftMessage& from) { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl(*this, from); + } + using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeFrom; + void MergeFrom(const GroupUpdateMemberLeftMessage& from) { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(*this, from); + } + public: private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.ReceiptMessage"; + return "SessionProtos.GroupUpdateMemberLeftMessage"; } protected: - explicit ReceiptMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit GroupUpdateMemberLeftMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - // nested types ---------------------------------------------------- + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - typedef ReceiptMessage_Type Type; - static constexpr Type DELIVERY = - ReceiptMessage_Type_DELIVERY; - static constexpr Type READ = - ReceiptMessage_Type_READ; - static inline bool Type_IsValid(int value) { - return ReceiptMessage_Type_IsValid(value); - } - static constexpr Type Type_MIN = - ReceiptMessage_Type_Type_MIN; - static constexpr Type Type_MAX = - ReceiptMessage_Type_Type_MAX; - static constexpr int Type_ARRAYSIZE = - ReceiptMessage_Type_Type_ARRAYSIZE; - template - static inline const std::string& Type_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function Type_Name."); - return ReceiptMessage_Type_Name(enum_t_value); - } - static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Type* value) { - return ReceiptMessage_Type_Parse(name, value); - } + // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- - enum : int { - kTimestampFieldNumber = 2, - kTypeFieldNumber = 1, - }; - // repeated uint64 timestamp = 2; - int timestamp_size() const; - private: - int _internal_timestamp_size() const; - public: - void clear_timestamp(); - private: - uint64_t _internal_timestamp(int index) const; - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& - _internal_timestamp() const; - void _internal_add_timestamp(uint64_t value); - ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* - _internal_mutable_timestamp(); - public: - uint64_t timestamp(int index) const; - void set_timestamp(int index, uint64_t value); - void add_timestamp(uint64_t value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& - timestamp() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* - mutable_timestamp(); - - // required .SessionProtos.ReceiptMessage.Type type = 1; - bool has_type() const; - private: - bool _internal_has_type() const; - public: - void clear_type(); - ::SessionProtos::ReceiptMessage_Type type() const; - void set_type(::SessionProtos::ReceiptMessage_Type value); - private: - ::SessionProtos::ReceiptMessage_Type _internal_type() const; - void _internal_set_type(::SessionProtos::ReceiptMessage_Type value); - public: - - // @@protoc_insertion_point(class_scope:SessionProtos.ReceiptMessage) + // @@protoc_insertion_point(class_scope:SessionProtos.GroupUpdateMemberLeftMessage) private: class _Internal; @@ -5734,34 +6311,28 @@ class ReceiptMessage final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t > timestamp_; - int type_; }; - union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class AttachmentPointer final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.AttachmentPointer) */ { +class GroupUpdateMemberLeftNotificationMessage final : + public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateMemberLeftNotificationMessage) */ { public: - inline AttachmentPointer() : AttachmentPointer(nullptr) {} - ~AttachmentPointer() override; - explicit PROTOBUF_CONSTEXPR AttachmentPointer(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline GroupUpdateMemberLeftNotificationMessage() : GroupUpdateMemberLeftNotificationMessage(nullptr) {} + explicit PROTOBUF_CONSTEXPR GroupUpdateMemberLeftNotificationMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - AttachmentPointer(const AttachmentPointer& from); - AttachmentPointer(AttachmentPointer&& from) noexcept - : AttachmentPointer() { + GroupUpdateMemberLeftNotificationMessage(const GroupUpdateMemberLeftNotificationMessage& from); + GroupUpdateMemberLeftNotificationMessage(GroupUpdateMemberLeftNotificationMessage&& from) noexcept + : GroupUpdateMemberLeftNotificationMessage() { *this = ::std::move(from); } - inline AttachmentPointer& operator=(const AttachmentPointer& from) { + inline GroupUpdateMemberLeftNotificationMessage& operator=(const GroupUpdateMemberLeftNotificationMessage& from) { CopyFrom(from); return *this; } - inline AttachmentPointer& operator=(AttachmentPointer&& from) noexcept { + inline GroupUpdateMemberLeftNotificationMessage& operator=(GroupUpdateMemberLeftNotificationMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -5775,27 +6346,36 @@ class AttachmentPointer final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const AttachmentPointer& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const GroupUpdateMemberLeftNotificationMessage& default_instance() { return *internal_default_instance(); } - static inline const AttachmentPointer* internal_default_instance() { - return reinterpret_cast( - &_AttachmentPointer_default_instance_); + static inline const GroupUpdateMemberLeftNotificationMessage* internal_default_instance() { + return reinterpret_cast( + &_GroupUpdateMemberLeftNotificationMessage_default_instance_); } static constexpr int kIndexInFileMessages = 24; - friend void swap(AttachmentPointer& a, AttachmentPointer& b) { + friend void swap(GroupUpdateMemberLeftNotificationMessage& a, GroupUpdateMemberLeftNotificationMessage& b) { a.Swap(&b); } - inline void Swap(AttachmentPointer* other) { + inline void Swap(GroupUpdateMemberLeftNotificationMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -5808,7 +6388,7 @@ class AttachmentPointer final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(AttachmentPointer* other) { + void UnsafeArenaSwap(GroupUpdateMemberLeftNotificationMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -5816,318 +6396,69 @@ class AttachmentPointer final : // implements Message ---------------------------------------------- - AttachmentPointer* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + GroupUpdateMemberLeftNotificationMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const AttachmentPointer& from); - void MergeFrom(const AttachmentPointer& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } - - private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(AttachmentPointer* other); + using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; + inline void CopyFrom(const GroupUpdateMemberLeftNotificationMessage& from) { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl(*this, from); + } + using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeFrom; + void MergeFrom(const GroupUpdateMemberLeftNotificationMessage& from) { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(*this, from); + } + public: private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.AttachmentPointer"; + return "SessionProtos.GroupUpdateMemberLeftNotificationMessage"; } protected: - explicit AttachmentPointer(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit GroupUpdateMemberLeftNotificationMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - // nested types ---------------------------------------------------- + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - typedef AttachmentPointer_Flags Flags; - static constexpr Flags VOICE_MESSAGE = - AttachmentPointer_Flags_VOICE_MESSAGE; - static inline bool Flags_IsValid(int value) { - return AttachmentPointer_Flags_IsValid(value); - } - static constexpr Flags Flags_MIN = - AttachmentPointer_Flags_Flags_MIN; - static constexpr Flags Flags_MAX = - AttachmentPointer_Flags_Flags_MAX; - static constexpr int Flags_ARRAYSIZE = - AttachmentPointer_Flags_Flags_ARRAYSIZE; - template - static inline const std::string& Flags_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function Flags_Name."); - return AttachmentPointer_Flags_Name(enum_t_value); - } - static inline bool Flags_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Flags* value) { - return AttachmentPointer_Flags_Parse(name, value); - } + // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- - enum : int { - kContentTypeFieldNumber = 2, - kKeyFieldNumber = 3, - kThumbnailFieldNumber = 5, - kDigestFieldNumber = 6, - kFileNameFieldNumber = 7, - kCaptionFieldNumber = 11, - kUrlFieldNumber = 101, - kIdFieldNumber = 1, - kSizeFieldNumber = 4, - kFlagsFieldNumber = 8, - kWidthFieldNumber = 9, - kHeightFieldNumber = 10, + // @@protoc_insertion_point(class_scope:SessionProtos.GroupUpdateMemberLeftNotificationMessage) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { }; - // optional string contentType = 2; - bool has_contenttype() const; - private: - bool _internal_has_contenttype() const; - public: - void clear_contenttype(); - const std::string& contenttype() const; - template - void set_contenttype(ArgT0&& arg0, ArgT... args); - std::string* mutable_contenttype(); - PROTOBUF_NODISCARD std::string* release_contenttype(); - void set_allocated_contenttype(std::string* contenttype); - private: - const std::string& _internal_contenttype() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_contenttype(const std::string& value); - std::string* _internal_mutable_contenttype(); - public: - - // optional bytes key = 3; - bool has_key() const; - private: - bool _internal_has_key() const; - public: - void clear_key(); - const std::string& key() const; - template - void set_key(ArgT0&& arg0, ArgT... args); - std::string* mutable_key(); - PROTOBUF_NODISCARD std::string* release_key(); - void set_allocated_key(std::string* key); - private: - const std::string& _internal_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_key(const std::string& value); - std::string* _internal_mutable_key(); - public: - - // optional bytes thumbnail = 5; - bool has_thumbnail() const; - private: - bool _internal_has_thumbnail() const; - public: - void clear_thumbnail(); - const std::string& thumbnail() const; - template - void set_thumbnail(ArgT0&& arg0, ArgT... args); - std::string* mutable_thumbnail(); - PROTOBUF_NODISCARD std::string* release_thumbnail(); - void set_allocated_thumbnail(std::string* thumbnail); - private: - const std::string& _internal_thumbnail() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_thumbnail(const std::string& value); - std::string* _internal_mutable_thumbnail(); - public: - - // optional bytes digest = 6; - bool has_digest() const; - private: - bool _internal_has_digest() const; - public: - void clear_digest(); - const std::string& digest() const; - template - void set_digest(ArgT0&& arg0, ArgT... args); - std::string* mutable_digest(); - PROTOBUF_NODISCARD std::string* release_digest(); - void set_allocated_digest(std::string* digest); - private: - const std::string& _internal_digest() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_digest(const std::string& value); - std::string* _internal_mutable_digest(); - public: - - // optional string fileName = 7; - bool has_filename() const; - private: - bool _internal_has_filename() const; - public: - void clear_filename(); - const std::string& filename() const; - template - void set_filename(ArgT0&& arg0, ArgT... args); - std::string* mutable_filename(); - PROTOBUF_NODISCARD std::string* release_filename(); - void set_allocated_filename(std::string* filename); - private: - const std::string& _internal_filename() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_filename(const std::string& value); - std::string* _internal_mutable_filename(); - public: - - // optional string caption = 11; - bool has_caption() const; - private: - bool _internal_has_caption() const; - public: - void clear_caption(); - const std::string& caption() const; - template - void set_caption(ArgT0&& arg0, ArgT... args); - std::string* mutable_caption(); - PROTOBUF_NODISCARD std::string* release_caption(); - void set_allocated_caption(std::string* caption); - private: - const std::string& _internal_caption() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_caption(const std::string& value); - std::string* _internal_mutable_caption(); - public: - - // optional string url = 101; - bool has_url() const; - private: - bool _internal_has_url() const; - public: - void clear_url(); - const std::string& url() const; - template - void set_url(ArgT0&& arg0, ArgT... args); - std::string* mutable_url(); - PROTOBUF_NODISCARD std::string* release_url(); - void set_allocated_url(std::string* url); - private: - const std::string& _internal_url() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_url(const std::string& value); - std::string* _internal_mutable_url(); - public: - - // required fixed64 id = 1; - bool has_id() const; - private: - bool _internal_has_id() const; - public: - void clear_id(); - uint64_t id() const; - void set_id(uint64_t value); - private: - uint64_t _internal_id() const; - void _internal_set_id(uint64_t value); - public: - - // optional uint32 size = 4; - bool has_size() const; - private: - bool _internal_has_size() const; - public: - void clear_size(); - uint32_t size() const; - void set_size(uint32_t value); - private: - uint32_t _internal_size() const; - void _internal_set_size(uint32_t value); - public: - - // optional uint32 flags = 8; - bool has_flags() const; - private: - bool _internal_has_flags() const; - public: - void clear_flags(); - uint32_t flags() const; - void set_flags(uint32_t value); - private: - uint32_t _internal_flags() const; - void _internal_set_flags(uint32_t value); - public: - - // optional uint32 width = 9; - bool has_width() const; - private: - bool _internal_has_width() const; - public: - void clear_width(); - uint32_t width() const; - void set_width(uint32_t value); - private: - uint32_t _internal_width() const; - void _internal_set_width(uint32_t value); - public: - - // optional uint32 height = 10; - bool has_height() const; - private: - bool _internal_has_height() const; - public: - void clear_height(); - uint32_t height() const; - void set_height(uint32_t value); - private: - uint32_t _internal_height() const; - void _internal_set_height(uint32_t value); - public: - - // @@protoc_insertion_point(class_scope:SessionProtos.AttachmentPointer) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr contenttype_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr key_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr thumbnail_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr digest_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr filename_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr caption_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr url_; - uint64_t id_; - uint32_t size_; - uint32_t flags_; - uint32_t width_; - uint32_t height_; - }; - union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class SharedConfigMessage final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.SharedConfigMessage) */ { +class GroupUpdateInviteResponseMessage final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateInviteResponseMessage) */ { public: - inline SharedConfigMessage() : SharedConfigMessage(nullptr) {} - ~SharedConfigMessage() override; - explicit PROTOBUF_CONSTEXPR SharedConfigMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline GroupUpdateInviteResponseMessage() : GroupUpdateInviteResponseMessage(nullptr) {} + ~GroupUpdateInviteResponseMessage() override; + explicit PROTOBUF_CONSTEXPR GroupUpdateInviteResponseMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - SharedConfigMessage(const SharedConfigMessage& from); - SharedConfigMessage(SharedConfigMessage&& from) noexcept - : SharedConfigMessage() { + GroupUpdateInviteResponseMessage(const GroupUpdateInviteResponseMessage& from); + GroupUpdateInviteResponseMessage(GroupUpdateInviteResponseMessage&& from) noexcept + : GroupUpdateInviteResponseMessage() { *this = ::std::move(from); } - inline SharedConfigMessage& operator=(const SharedConfigMessage& from) { + inline GroupUpdateInviteResponseMessage& operator=(const GroupUpdateInviteResponseMessage& from) { CopyFrom(from); return *this; } - inline SharedConfigMessage& operator=(SharedConfigMessage&& from) noexcept { + inline GroupUpdateInviteResponseMessage& operator=(GroupUpdateInviteResponseMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -6141,27 +6472,36 @@ class SharedConfigMessage final : return *this; } - inline const std::string& unknown_fields() const { - return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - inline std::string* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - static const SharedConfigMessage& default_instance() { + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const GroupUpdateInviteResponseMessage& default_instance() { return *internal_default_instance(); } - static inline const SharedConfigMessage* internal_default_instance() { - return reinterpret_cast( - &_SharedConfigMessage_default_instance_); + static inline const GroupUpdateInviteResponseMessage* internal_default_instance() { + return reinterpret_cast( + &_GroupUpdateInviteResponseMessage_default_instance_); } static constexpr int kIndexInFileMessages = 25; - friend void swap(SharedConfigMessage& a, SharedConfigMessage& b) { + friend void swap(GroupUpdateInviteResponseMessage& a, GroupUpdateInviteResponseMessage& b) { a.Swap(&b); } - inline void Swap(SharedConfigMessage* other) { + inline void Swap(GroupUpdateInviteResponseMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -6174,7 +6514,7 @@ class SharedConfigMessage final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(SharedConfigMessage* other) { + void UnsafeArenaSwap(GroupUpdateInviteResponseMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -6182,12 +6522,18 @@ class SharedConfigMessage final : // implements Message ---------------------------------------------- - SharedConfigMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + GroupUpdateInviteResponseMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } - void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const SharedConfigMessage& from); - void MergeFrom(const SharedConfigMessage& from); + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const GroupUpdateInviteResponseMessage& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const GroupUpdateInviteResponseMessage& from) { + GroupUpdateInviteResponseMessage::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -6200,120 +6546,272 @@ class SharedConfigMessage final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(SharedConfigMessage* other); + void SetCachedSize(int size) const final; + void InternalSwap(GroupUpdateInviteResponseMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.SharedConfigMessage"; + return "SessionProtos.GroupUpdateInviteResponseMessage"; } protected: - explicit SharedConfigMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit GroupUpdateInviteResponseMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - std::string GetTypeName() const final; + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; // nested types ---------------------------------------------------- - typedef SharedConfigMessage_Kind Kind; - static constexpr Kind USER_PROFILE = - SharedConfigMessage_Kind_USER_PROFILE; - static constexpr Kind CONTACTS = - SharedConfigMessage_Kind_CONTACTS; - static constexpr Kind CONVO_INFO_VOLATILE = - SharedConfigMessage_Kind_CONVO_INFO_VOLATILE; - static constexpr Kind USER_GROUPS = - SharedConfigMessage_Kind_USER_GROUPS; - static inline bool Kind_IsValid(int value) { - return SharedConfigMessage_Kind_IsValid(value); - } - static constexpr Kind Kind_MIN = - SharedConfigMessage_Kind_Kind_MIN; - static constexpr Kind Kind_MAX = - SharedConfigMessage_Kind_Kind_MAX; - static constexpr int Kind_ARRAYSIZE = - SharedConfigMessage_Kind_Kind_ARRAYSIZE; - template - static inline const std::string& Kind_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function Kind_Name."); - return SharedConfigMessage_Kind_Name(enum_t_value); - } - static inline bool Kind_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Kind* value) { - return SharedConfigMessage_Kind_Parse(name, value); - } - // accessors ------------------------------------------------------- enum : int { - kDataFieldNumber = 3, - kSeqnoFieldNumber = 2, - kKindFieldNumber = 1, + kIsApprovedFieldNumber = 1, }; - // required bytes data = 3; - bool has_data() const; + // required bool isApproved = 1; + bool has_isapproved() const; private: - bool _internal_has_data() const; + bool _internal_has_isapproved() const; public: - void clear_data(); - const std::string& data() const; - template - void set_data(ArgT0&& arg0, ArgT... args); - std::string* mutable_data(); - PROTOBUF_NODISCARD std::string* release_data(); - void set_allocated_data(std::string* data); + void clear_isapproved(); + bool isapproved() const; + void set_isapproved(bool value); private: - const std::string& _internal_data() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_data(const std::string& value); - std::string* _internal_mutable_data(); + bool _internal_isapproved() const; + void _internal_set_isapproved(bool value); public: - // required int64 seqno = 2; - bool has_seqno() const; + // @@protoc_insertion_point(class_scope:SessionProtos.GroupUpdateInviteResponseMessage) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + bool isapproved_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_SessionProtos_2eproto; +}; +// ------------------------------------------------------------------- + +class GroupUpdateDeleteMemberContentMessage final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateDeleteMemberContentMessage) */ { + public: + inline GroupUpdateDeleteMemberContentMessage() : GroupUpdateDeleteMemberContentMessage(nullptr) {} + ~GroupUpdateDeleteMemberContentMessage() override; + explicit PROTOBUF_CONSTEXPR GroupUpdateDeleteMemberContentMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + GroupUpdateDeleteMemberContentMessage(const GroupUpdateDeleteMemberContentMessage& from); + GroupUpdateDeleteMemberContentMessage(GroupUpdateDeleteMemberContentMessage&& from) noexcept + : GroupUpdateDeleteMemberContentMessage() { + *this = ::std::move(from); + } + + inline GroupUpdateDeleteMemberContentMessage& operator=(const GroupUpdateDeleteMemberContentMessage& from) { + CopyFrom(from); + return *this; + } + inline GroupUpdateDeleteMemberContentMessage& operator=(GroupUpdateDeleteMemberContentMessage&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + } + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const GroupUpdateDeleteMemberContentMessage& default_instance() { + return *internal_default_instance(); + } + static inline const GroupUpdateDeleteMemberContentMessage* internal_default_instance() { + return reinterpret_cast( + &_GroupUpdateDeleteMemberContentMessage_default_instance_); + } + static constexpr int kIndexInFileMessages = + 26; + + friend void swap(GroupUpdateDeleteMemberContentMessage& a, GroupUpdateDeleteMemberContentMessage& b) { + a.Swap(&b); + } + inline void Swap(GroupUpdateDeleteMemberContentMessage* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(GroupUpdateDeleteMemberContentMessage* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + GroupUpdateDeleteMemberContentMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const GroupUpdateDeleteMemberContentMessage& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const GroupUpdateDeleteMemberContentMessage& from) { + GroupUpdateDeleteMemberContentMessage::MergeImpl(*this, from); + } private: - bool _internal_has_seqno() const; + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: - void clear_seqno(); - int64_t seqno() const; - void set_seqno(int64_t value); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + private: - int64_t _internal_seqno() const; - void _internal_set_seqno(int64_t value); - public: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GroupUpdateDeleteMemberContentMessage* other); - // required .SessionProtos.SharedConfigMessage.Kind kind = 1; - bool has_kind() const; private: - bool _internal_has_kind() const; + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "SessionProtos.GroupUpdateDeleteMemberContentMessage"; + } + protected: + explicit GroupUpdateDeleteMemberContentMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); public: - void clear_kind(); - ::SessionProtos::SharedConfigMessage_Kind kind() const; - void set_kind(::SessionProtos::SharedConfigMessage_Kind value); + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kMemberSessionIdsFieldNumber = 1, + kMessageHashesFieldNumber = 2, + kAdminSignatureFieldNumber = 3, + }; + // repeated string memberSessionIds = 1; + int membersessionids_size() const; + private: + int _internal_membersessionids_size() const; + public: + void clear_membersessionids(); + const std::string& membersessionids(int index) const; + std::string* mutable_membersessionids(int index); + void set_membersessionids(int index, const std::string& value); + void set_membersessionids(int index, std::string&& value); + void set_membersessionids(int index, const char* value); + void set_membersessionids(int index, const char* value, size_t size); + std::string* add_membersessionids(); + void add_membersessionids(const std::string& value); + void add_membersessionids(std::string&& value); + void add_membersessionids(const char* value); + void add_membersessionids(const char* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& membersessionids() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_membersessionids(); + private: + const std::string& _internal_membersessionids(int index) const; + std::string* _internal_add_membersessionids(); + public: + + // repeated string messageHashes = 2; + int messagehashes_size() const; + private: + int _internal_messagehashes_size() const; + public: + void clear_messagehashes(); + const std::string& messagehashes(int index) const; + std::string* mutable_messagehashes(int index); + void set_messagehashes(int index, const std::string& value); + void set_messagehashes(int index, std::string&& value); + void set_messagehashes(int index, const char* value); + void set_messagehashes(int index, const char* value, size_t size); + std::string* add_messagehashes(); + void add_messagehashes(const std::string& value); + void add_messagehashes(std::string&& value); + void add_messagehashes(const char* value); + void add_messagehashes(const char* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& messagehashes() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_messagehashes(); + private: + const std::string& _internal_messagehashes(int index) const; + std::string* _internal_add_messagehashes(); + public: + + // optional bytes adminSignature = 3; + bool has_adminsignature() const; + private: + bool _internal_has_adminsignature() const; + public: + void clear_adminsignature(); + const std::string& adminsignature() const; + template + void set_adminsignature(ArgT0&& arg0, ArgT... args); + std::string* mutable_adminsignature(); + PROTOBUF_NODISCARD std::string* release_adminsignature(); + void set_allocated_adminsignature(std::string* adminsignature); private: - ::SessionProtos::SharedConfigMessage_Kind _internal_kind() const; - void _internal_set_kind(::SessionProtos::SharedConfigMessage_Kind value); + const std::string& _internal_adminsignature() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_adminsignature(const std::string& value); + std::string* _internal_mutable_adminsignature(); public: - // @@protoc_insertion_point(class_scope:SessionProtos.SharedConfigMessage) + // @@protoc_insertion_point(class_scope:SessionProtos.GroupUpdateDeleteMemberContentMessage) private: class _Internal; - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr data_; - int64_t seqno_; - int kind_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField membersessionids_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField messagehashes_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr adminsignature_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; @@ -6931,379 +7429,137 @@ inline void MessageRequestResponse::set_allocated_profile(::SessionProtos::LokiP // ------------------------------------------------------------------- -// ProProof - -// required uint32 version = 1; -inline bool ProProof::_internal_has_version() const { - bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; - return value; -} -inline bool ProProof::has_version() const { - return _internal_has_version(); -} -inline void ProProof::clear_version() { - _impl_.version_ = 0u; - _impl_._has_bits_[0] &= ~0x00000010u; -} -inline uint32_t ProProof::_internal_version() const { - return _impl_.version_; -} -inline uint32_t ProProof::version() const { - // @@protoc_insertion_point(field_get:SessionProtos.ProProof.version) - return _internal_version(); -} -inline void ProProof::_internal_set_version(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000010u; - _impl_.version_ = value; -} -inline void ProProof::set_version(uint32_t value) { - _internal_set_version(value); - // @@protoc_insertion_point(field_set:SessionProtos.ProProof.version) -} +// Content -// required bytes genIndexHash = 2; -inline bool ProProof::_internal_has_genindexhash() const { +// optional .SessionProtos.DataMessage dataMessage = 1; +inline bool Content::_internal_has_datamessage() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.datamessage_ != nullptr); return value; } -inline bool ProProof::has_genindexhash() const { - return _internal_has_genindexhash(); +inline bool Content::has_datamessage() const { + return _internal_has_datamessage(); } -inline void ProProof::clear_genindexhash() { - _impl_.genindexhash_.ClearToEmpty(); +inline void Content::clear_datamessage() { + if (_impl_.datamessage_ != nullptr) _impl_.datamessage_->Clear(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& ProProof::genindexhash() const { - // @@protoc_insertion_point(field_get:SessionProtos.ProProof.genIndexHash) - return _internal_genindexhash(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void ProProof::set_genindexhash(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.genindexhash_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ProProof.genIndexHash) -} -inline std::string* ProProof::mutable_genindexhash() { - std::string* _s = _internal_mutable_genindexhash(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ProProof.genIndexHash) - return _s; -} -inline const std::string& ProProof::_internal_genindexhash() const { - return _impl_.genindexhash_.Get(); -} -inline void ProProof::_internal_set_genindexhash(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.genindexhash_.Set(value, GetArenaForAllocation()); +inline const ::SessionProtos::DataMessage& Content::_internal_datamessage() const { + const ::SessionProtos::DataMessage* p = _impl_.datamessage_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_DataMessage_default_instance_); } -inline std::string* ProProof::_internal_mutable_genindexhash() { - _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.genindexhash_.Mutable(GetArenaForAllocation()); +inline const ::SessionProtos::DataMessage& Content::datamessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.Content.dataMessage) + return _internal_datamessage(); } -inline std::string* ProProof::release_genindexhash() { - // @@protoc_insertion_point(field_release:SessionProtos.ProProof.genIndexHash) - if (!_internal_has_genindexhash()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.genindexhash_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.genindexhash_.IsDefault()) { - _impl_.genindexhash_.Set("", GetArenaForAllocation()); +inline void Content::unsafe_arena_set_allocated_datamessage( + ::SessionProtos::DataMessage* datamessage) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.datamessage_); } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void ProProof::set_allocated_genindexhash(std::string* genindexhash) { - if (genindexhash != nullptr) { + _impl_.datamessage_ = datamessage; + if (datamessage) { _impl_._has_bits_[0] |= 0x00000001u; } else { _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.genindexhash_.SetAllocated(genindexhash, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.genindexhash_.IsDefault()) { - _impl_.genindexhash_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProProof.genIndexHash) -} - -// required bytes rotatingPublicKey = 3; -inline bool ProProof::_internal_has_rotatingpublickey() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - return value; -} -inline bool ProProof::has_rotatingpublickey() const { - return _internal_has_rotatingpublickey(); -} -inline void ProProof::clear_rotatingpublickey() { - _impl_.rotatingpublickey_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000002u; + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.dataMessage) } -inline const std::string& ProProof::rotatingpublickey() const { - // @@protoc_insertion_point(field_get:SessionProtos.ProProof.rotatingPublicKey) - return _internal_rotatingpublickey(); +inline ::SessionProtos::DataMessage* Content::release_datamessage() { + _impl_._has_bits_[0] &= ~0x00000001u; + ::SessionProtos::DataMessage* temp = _impl_.datamessage_; + _impl_.datamessage_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; } -template -inline PROTOBUF_ALWAYS_INLINE -void ProProof::set_rotatingpublickey(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.rotatingpublickey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ProProof.rotatingPublicKey) +inline ::SessionProtos::DataMessage* Content::unsafe_arena_release_datamessage() { + // @@protoc_insertion_point(field_release:SessionProtos.Content.dataMessage) + _impl_._has_bits_[0] &= ~0x00000001u; + ::SessionProtos::DataMessage* temp = _impl_.datamessage_; + _impl_.datamessage_ = nullptr; + return temp; } -inline std::string* ProProof::mutable_rotatingpublickey() { - std::string* _s = _internal_mutable_rotatingpublickey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ProProof.rotatingPublicKey) - return _s; +inline ::SessionProtos::DataMessage* Content::_internal_mutable_datamessage() { + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.datamessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::DataMessage>(GetArenaForAllocation()); + _impl_.datamessage_ = p; + } + return _impl_.datamessage_; } -inline const std::string& ProProof::_internal_rotatingpublickey() const { - return _impl_.rotatingpublickey_.Get(); +inline ::SessionProtos::DataMessage* Content::mutable_datamessage() { + ::SessionProtos::DataMessage* _msg = _internal_mutable_datamessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.Content.dataMessage) + return _msg; } -inline void ProProof::_internal_set_rotatingpublickey(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.rotatingpublickey_.Set(value, GetArenaForAllocation()); -} -inline std::string* ProProof::_internal_mutable_rotatingpublickey() { - _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.rotatingpublickey_.Mutable(GetArenaForAllocation()); -} -inline std::string* ProProof::release_rotatingpublickey() { - // @@protoc_insertion_point(field_release:SessionProtos.ProProof.rotatingPublicKey) - if (!_internal_has_rotatingpublickey()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.rotatingpublickey_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.rotatingpublickey_.IsDefault()) { - _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void ProProof::set_allocated_rotatingpublickey(std::string* rotatingpublickey) { - if (rotatingpublickey != nullptr) { - _impl_._has_bits_[0] |= 0x00000002u; - } else { - _impl_._has_bits_[0] &= ~0x00000002u; - } - _impl_.rotatingpublickey_.SetAllocated(rotatingpublickey, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.rotatingpublickey_.IsDefault()) { - _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProProof.rotatingPublicKey) -} - -// required uint64 expiryUnixTs = 4; -inline bool ProProof::_internal_has_expiryunixts() const { - bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; - return value; -} -inline bool ProProof::has_expiryunixts() const { - return _internal_has_expiryunixts(); -} -inline void ProProof::clear_expiryunixts() { - _impl_.expiryunixts_ = uint64_t{0u}; - _impl_._has_bits_[0] &= ~0x00000008u; -} -inline uint64_t ProProof::_internal_expiryunixts() const { - return _impl_.expiryunixts_; -} -inline uint64_t ProProof::expiryunixts() const { - // @@protoc_insertion_point(field_get:SessionProtos.ProProof.expiryUnixTs) - return _internal_expiryunixts(); -} -inline void ProProof::_internal_set_expiryunixts(uint64_t value) { - _impl_._has_bits_[0] |= 0x00000008u; - _impl_.expiryunixts_ = value; -} -inline void ProProof::set_expiryunixts(uint64_t value) { - _internal_set_expiryunixts(value); - // @@protoc_insertion_point(field_set:SessionProtos.ProProof.expiryUnixTs) -} - -// required bytes sig = 5; -inline bool ProProof::_internal_has_sig() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; - return value; -} -inline bool ProProof::has_sig() const { - return _internal_has_sig(); -} -inline void ProProof::clear_sig() { - _impl_.sig_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000004u; -} -inline const std::string& ProProof::sig() const { - // @@protoc_insertion_point(field_get:SessionProtos.ProProof.sig) - return _internal_sig(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void ProProof::set_sig(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.sig_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ProProof.sig) -} -inline std::string* ProProof::mutable_sig() { - std::string* _s = _internal_mutable_sig(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ProProof.sig) - return _s; -} -inline const std::string& ProProof::_internal_sig() const { - return _impl_.sig_.Get(); -} -inline void ProProof::_internal_set_sig(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.sig_.Set(value, GetArenaForAllocation()); -} -inline std::string* ProProof::_internal_mutable_sig() { - _impl_._has_bits_[0] |= 0x00000004u; - return _impl_.sig_.Mutable(GetArenaForAllocation()); -} -inline std::string* ProProof::release_sig() { - // @@protoc_insertion_point(field_release:SessionProtos.ProProof.sig) - if (!_internal_has_sig()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000004u; - auto* p = _impl_.sig_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.sig_.IsDefault()) { - _impl_.sig_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void ProProof::set_allocated_sig(std::string* sig) { - if (sig != nullptr) { - _impl_._has_bits_[0] |= 0x00000004u; - } else { - _impl_._has_bits_[0] &= ~0x00000004u; - } - _impl_.sig_.SetAllocated(sig, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.sig_.IsDefault()) { - _impl_.sig_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProProof.sig) -} - -// ------------------------------------------------------------------- - -// ProConfig - -// required bytes rotatingPrivKey = 1; -inline bool ProConfig::_internal_has_rotatingprivkey() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - return value; -} -inline bool ProConfig::has_rotatingprivkey() const { - return _internal_has_rotatingprivkey(); -} -inline void ProConfig::clear_rotatingprivkey() { - _impl_.rotatingprivkey_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const std::string& ProConfig::rotatingprivkey() const { - // @@protoc_insertion_point(field_get:SessionProtos.ProConfig.rotatingPrivKey) - return _internal_rotatingprivkey(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void ProConfig::set_rotatingprivkey(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.rotatingprivkey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ProConfig.rotatingPrivKey) -} -inline std::string* ProConfig::mutable_rotatingprivkey() { - std::string* _s = _internal_mutable_rotatingprivkey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ProConfig.rotatingPrivKey) - return _s; -} -inline const std::string& ProConfig::_internal_rotatingprivkey() const { - return _impl_.rotatingprivkey_.Get(); -} -inline void ProConfig::_internal_set_rotatingprivkey(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.rotatingprivkey_.Set(value, GetArenaForAllocation()); -} -inline std::string* ProConfig::_internal_mutable_rotatingprivkey() { - _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.rotatingprivkey_.Mutable(GetArenaForAllocation()); -} -inline std::string* ProConfig::release_rotatingprivkey() { - // @@protoc_insertion_point(field_release:SessionProtos.ProConfig.rotatingPrivKey) - if (!_internal_has_rotatingprivkey()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.rotatingprivkey_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.rotatingprivkey_.IsDefault()) { - _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); +inline void Content::set_allocated_datamessage(::SessionProtos::DataMessage* datamessage) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.datamessage_; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void ProConfig::set_allocated_rotatingprivkey(std::string* rotatingprivkey) { - if (rotatingprivkey != nullptr) { + if (datamessage) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(datamessage); + if (message_arena != submessage_arena) { + datamessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, datamessage, submessage_arena); + } _impl_._has_bits_[0] |= 0x00000001u; } else { _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.rotatingprivkey_.SetAllocated(rotatingprivkey, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.rotatingprivkey_.IsDefault()) { - _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProConfig.rotatingPrivKey) + _impl_.datamessage_ = datamessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.dataMessage) } -// required .SessionProtos.ProProof proof = 2; -inline bool ProConfig::_internal_has_proof() const { +// optional .SessionProtos.CallMessage callMessage = 3; +inline bool Content::_internal_has_callmessage() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - PROTOBUF_ASSUME(!value || _impl_.proof_ != nullptr); + PROTOBUF_ASSUME(!value || _impl_.callmessage_ != nullptr); return value; } -inline bool ProConfig::has_proof() const { - return _internal_has_proof(); +inline bool Content::has_callmessage() const { + return _internal_has_callmessage(); } -inline void ProConfig::clear_proof() { - if (_impl_.proof_ != nullptr) _impl_.proof_->Clear(); +inline void Content::clear_callmessage() { + if (_impl_.callmessage_ != nullptr) _impl_.callmessage_->Clear(); _impl_._has_bits_[0] &= ~0x00000002u; } -inline const ::SessionProtos::ProProof& ProConfig::_internal_proof() const { - const ::SessionProtos::ProProof* p = _impl_.proof_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_ProProof_default_instance_); +inline const ::SessionProtos::CallMessage& Content::_internal_callmessage() const { + const ::SessionProtos::CallMessage* p = _impl_.callmessage_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_CallMessage_default_instance_); } -inline const ::SessionProtos::ProProof& ProConfig::proof() const { - // @@protoc_insertion_point(field_get:SessionProtos.ProConfig.proof) - return _internal_proof(); +inline const ::SessionProtos::CallMessage& Content::callmessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.Content.callMessage) + return _internal_callmessage(); } -inline void ProConfig::unsafe_arena_set_allocated_proof( - ::SessionProtos::ProProof* proof) { +inline void Content::unsafe_arena_set_allocated_callmessage( + ::SessionProtos::CallMessage* callmessage) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.proof_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.callmessage_); } - _impl_.proof_ = proof; - if (proof) { + _impl_.callmessage_ = callmessage; + if (callmessage) { _impl_._has_bits_[0] |= 0x00000002u; } else { _impl_._has_bits_[0] &= ~0x00000002u; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.ProConfig.proof) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.callMessage) } -inline ::SessionProtos::ProProof* ProConfig::release_proof() { +inline ::SessionProtos::CallMessage* Content::release_callmessage() { _impl_._has_bits_[0] &= ~0x00000002u; - ::SessionProtos::ProProof* temp = _impl_.proof_; - _impl_.proof_ = nullptr; + ::SessionProtos::CallMessage* temp = _impl_.callmessage_; + _impl_.callmessage_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -7315,89 +7571,85 @@ inline ::SessionProtos::ProProof* ProConfig::release_proof() { #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::SessionProtos::ProProof* ProConfig::unsafe_arena_release_proof() { - // @@protoc_insertion_point(field_release:SessionProtos.ProConfig.proof) +inline ::SessionProtos::CallMessage* Content::unsafe_arena_release_callmessage() { + // @@protoc_insertion_point(field_release:SessionProtos.Content.callMessage) _impl_._has_bits_[0] &= ~0x00000002u; - ::SessionProtos::ProProof* temp = _impl_.proof_; - _impl_.proof_ = nullptr; + ::SessionProtos::CallMessage* temp = _impl_.callmessage_; + _impl_.callmessage_ = nullptr; return temp; } -inline ::SessionProtos::ProProof* ProConfig::_internal_mutable_proof() { +inline ::SessionProtos::CallMessage* Content::_internal_mutable_callmessage() { _impl_._has_bits_[0] |= 0x00000002u; - if (_impl_.proof_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::ProProof>(GetArenaForAllocation()); - _impl_.proof_ = p; + if (_impl_.callmessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::CallMessage>(GetArenaForAllocation()); + _impl_.callmessage_ = p; } - return _impl_.proof_; + return _impl_.callmessage_; } -inline ::SessionProtos::ProProof* ProConfig::mutable_proof() { - ::SessionProtos::ProProof* _msg = _internal_mutable_proof(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ProConfig.proof) +inline ::SessionProtos::CallMessage* Content::mutable_callmessage() { + ::SessionProtos::CallMessage* _msg = _internal_mutable_callmessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.Content.callMessage) return _msg; } -inline void ProConfig::set_allocated_proof(::SessionProtos::ProProof* proof) { +inline void Content::set_allocated_callmessage(::SessionProtos::CallMessage* callmessage) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.proof_; + delete _impl_.callmessage_; } - if (proof) { + if (callmessage) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(proof); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(callmessage); if (message_arena != submessage_arena) { - proof = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, proof, submessage_arena); + callmessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, callmessage, submessage_arena); } _impl_._has_bits_[0] |= 0x00000002u; } else { _impl_._has_bits_[0] &= ~0x00000002u; } - _impl_.proof_ = proof; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProConfig.proof) + _impl_.callmessage_ = callmessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.callMessage) } -// ------------------------------------------------------------------- - -// ProMessageConfig - -// required .SessionProtos.ProProof proof = 1; -inline bool ProMessageConfig::_internal_has_proof() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.proof_ != nullptr); +// optional .SessionProtos.ReceiptMessage receiptMessage = 5; +inline bool Content::_internal_has_receiptmessage() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + PROTOBUF_ASSUME(!value || _impl_.receiptmessage_ != nullptr); return value; } -inline bool ProMessageConfig::has_proof() const { - return _internal_has_proof(); +inline bool Content::has_receiptmessage() const { + return _internal_has_receiptmessage(); } -inline void ProMessageConfig::clear_proof() { - if (_impl_.proof_ != nullptr) _impl_.proof_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; +inline void Content::clear_receiptmessage() { + if (_impl_.receiptmessage_ != nullptr) _impl_.receiptmessage_->Clear(); + _impl_._has_bits_[0] &= ~0x00000004u; } -inline const ::SessionProtos::ProProof& ProMessageConfig::_internal_proof() const { - const ::SessionProtos::ProProof* p = _impl_.proof_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_ProProof_default_instance_); +inline const ::SessionProtos::ReceiptMessage& Content::_internal_receiptmessage() const { + const ::SessionProtos::ReceiptMessage* p = _impl_.receiptmessage_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_ReceiptMessage_default_instance_); } -inline const ::SessionProtos::ProProof& ProMessageConfig::proof() const { - // @@protoc_insertion_point(field_get:SessionProtos.ProMessageConfig.proof) - return _internal_proof(); +inline const ::SessionProtos::ReceiptMessage& Content::receiptmessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.Content.receiptMessage) + return _internal_receiptmessage(); } -inline void ProMessageConfig::unsafe_arena_set_allocated_proof( - ::SessionProtos::ProProof* proof) { +inline void Content::unsafe_arena_set_allocated_receiptmessage( + ::SessionProtos::ReceiptMessage* receiptmessage) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.proof_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.receiptmessage_); } - _impl_.proof_ = proof; - if (proof) { - _impl_._has_bits_[0] |= 0x00000001u; + _impl_.receiptmessage_ = receiptmessage; + if (receiptmessage) { + _impl_._has_bits_[0] |= 0x00000004u; } else { - _impl_._has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000004u; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.ProMessageConfig.proof) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.receiptMessage) } -inline ::SessionProtos::ProProof* ProMessageConfig::release_proof() { - _impl_._has_bits_[0] &= ~0x00000001u; - ::SessionProtos::ProProof* temp = _impl_.proof_; - _impl_.proof_ = nullptr; +inline ::SessionProtos::ReceiptMessage* Content::release_receiptmessage() { + _impl_._has_bits_[0] &= ~0x00000004u; + ::SessionProtos::ReceiptMessage* temp = _impl_.receiptmessage_; + _impl_.receiptmessage_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -7409,117 +7661,85 @@ inline ::SessionProtos::ProProof* ProMessageConfig::release_proof() { #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::SessionProtos::ProProof* ProMessageConfig::unsafe_arena_release_proof() { - // @@protoc_insertion_point(field_release:SessionProtos.ProMessageConfig.proof) - _impl_._has_bits_[0] &= ~0x00000001u; - ::SessionProtos::ProProof* temp = _impl_.proof_; - _impl_.proof_ = nullptr; +inline ::SessionProtos::ReceiptMessage* Content::unsafe_arena_release_receiptmessage() { + // @@protoc_insertion_point(field_release:SessionProtos.Content.receiptMessage) + _impl_._has_bits_[0] &= ~0x00000004u; + ::SessionProtos::ReceiptMessage* temp = _impl_.receiptmessage_; + _impl_.receiptmessage_ = nullptr; return temp; } -inline ::SessionProtos::ProProof* ProMessageConfig::_internal_mutable_proof() { - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.proof_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::ProProof>(GetArenaForAllocation()); - _impl_.proof_ = p; +inline ::SessionProtos::ReceiptMessage* Content::_internal_mutable_receiptmessage() { + _impl_._has_bits_[0] |= 0x00000004u; + if (_impl_.receiptmessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::ReceiptMessage>(GetArenaForAllocation()); + _impl_.receiptmessage_ = p; } - return _impl_.proof_; + return _impl_.receiptmessage_; } -inline ::SessionProtos::ProProof* ProMessageConfig::mutable_proof() { - ::SessionProtos::ProProof* _msg = _internal_mutable_proof(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ProMessageConfig.proof) +inline ::SessionProtos::ReceiptMessage* Content::mutable_receiptmessage() { + ::SessionProtos::ReceiptMessage* _msg = _internal_mutable_receiptmessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.Content.receiptMessage) return _msg; } -inline void ProMessageConfig::set_allocated_proof(::SessionProtos::ProProof* proof) { +inline void Content::set_allocated_receiptmessage(::SessionProtos::ReceiptMessage* receiptmessage) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.proof_; + delete _impl_.receiptmessage_; } - if (proof) { + if (receiptmessage) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(proof); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(receiptmessage); if (message_arena != submessage_arena) { - proof = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, proof, submessage_arena); + receiptmessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, receiptmessage, submessage_arena); } - _impl_._has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000004u; } else { - _impl_._has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000004u; } - _impl_.proof_ = proof; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProMessageConfig.proof) + _impl_.receiptmessage_ = receiptmessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.receiptMessage) } -// required uint32 flags = 2; -inline bool ProMessageConfig::_internal_has_flags() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; +// optional .SessionProtos.TypingMessage typingMessage = 6; +inline bool Content::_internal_has_typingmessage() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + PROTOBUF_ASSUME(!value || _impl_.typingmessage_ != nullptr); return value; } -inline bool ProMessageConfig::has_flags() const { - return _internal_has_flags(); -} -inline void ProMessageConfig::clear_flags() { - _impl_.flags_ = 0u; - _impl_._has_bits_[0] &= ~0x00000002u; +inline bool Content::has_typingmessage() const { + return _internal_has_typingmessage(); } -inline uint32_t ProMessageConfig::_internal_flags() const { - return _impl_.flags_; +inline void Content::clear_typingmessage() { + if (_impl_.typingmessage_ != nullptr) _impl_.typingmessage_->Clear(); + _impl_._has_bits_[0] &= ~0x00000008u; } -inline uint32_t ProMessageConfig::flags() const { - // @@protoc_insertion_point(field_get:SessionProtos.ProMessageConfig.flags) - return _internal_flags(); +inline const ::SessionProtos::TypingMessage& Content::_internal_typingmessage() const { + const ::SessionProtos::TypingMessage* p = _impl_.typingmessage_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_TypingMessage_default_instance_); } -inline void ProMessageConfig::_internal_set_flags(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.flags_ = value; +inline const ::SessionProtos::TypingMessage& Content::typingmessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.Content.typingMessage) + return _internal_typingmessage(); } -inline void ProMessageConfig::set_flags(uint32_t value) { - _internal_set_flags(value); - // @@protoc_insertion_point(field_set:SessionProtos.ProMessageConfig.flags) +inline void Content::unsafe_arena_set_allocated_typingmessage( + ::SessionProtos::TypingMessage* typingmessage) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.typingmessage_); + } + _impl_.typingmessage_ = typingmessage; + if (typingmessage) { + _impl_._has_bits_[0] |= 0x00000008u; + } else { + _impl_._has_bits_[0] &= ~0x00000008u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.typingMessage) } - -// ------------------------------------------------------------------- - -// Content - -// optional .SessionProtos.DataMessage dataMessage = 1; -inline bool Content::_internal_has_datamessage() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.datamessage_ != nullptr); - return value; -} -inline bool Content::has_datamessage() const { - return _internal_has_datamessage(); -} -inline void Content::clear_datamessage() { - if (_impl_.datamessage_ != nullptr) _impl_.datamessage_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::SessionProtos::DataMessage& Content::_internal_datamessage() const { - const ::SessionProtos::DataMessage* p = _impl_.datamessage_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_DataMessage_default_instance_); -} -inline const ::SessionProtos::DataMessage& Content::datamessage() const { - // @@protoc_insertion_point(field_get:SessionProtos.Content.dataMessage) - return _internal_datamessage(); -} -inline void Content::unsafe_arena_set_allocated_datamessage( - ::SessionProtos::DataMessage* datamessage) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.datamessage_); - } - _impl_.datamessage_ = datamessage; - if (datamessage) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.dataMessage) -} -inline ::SessionProtos::DataMessage* Content::release_datamessage() { - _impl_._has_bits_[0] &= ~0x00000001u; - ::SessionProtos::DataMessage* temp = _impl_.datamessage_; - _impl_.datamessage_ = nullptr; +inline ::SessionProtos::TypingMessage* Content::release_typingmessage() { + _impl_._has_bits_[0] &= ~0x00000008u; + ::SessionProtos::TypingMessage* temp = _impl_.typingmessage_; + _impl_.typingmessage_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -7531,85 +7751,85 @@ inline ::SessionProtos::DataMessage* Content::release_datamessage() { #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::SessionProtos::DataMessage* Content::unsafe_arena_release_datamessage() { - // @@protoc_insertion_point(field_release:SessionProtos.Content.dataMessage) - _impl_._has_bits_[0] &= ~0x00000001u; - ::SessionProtos::DataMessage* temp = _impl_.datamessage_; - _impl_.datamessage_ = nullptr; +inline ::SessionProtos::TypingMessage* Content::unsafe_arena_release_typingmessage() { + // @@protoc_insertion_point(field_release:SessionProtos.Content.typingMessage) + _impl_._has_bits_[0] &= ~0x00000008u; + ::SessionProtos::TypingMessage* temp = _impl_.typingmessage_; + _impl_.typingmessage_ = nullptr; return temp; } -inline ::SessionProtos::DataMessage* Content::_internal_mutable_datamessage() { - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.datamessage_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::DataMessage>(GetArenaForAllocation()); - _impl_.datamessage_ = p; +inline ::SessionProtos::TypingMessage* Content::_internal_mutable_typingmessage() { + _impl_._has_bits_[0] |= 0x00000008u; + if (_impl_.typingmessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::TypingMessage>(GetArenaForAllocation()); + _impl_.typingmessage_ = p; } - return _impl_.datamessage_; + return _impl_.typingmessage_; } -inline ::SessionProtos::DataMessage* Content::mutable_datamessage() { - ::SessionProtos::DataMessage* _msg = _internal_mutable_datamessage(); - // @@protoc_insertion_point(field_mutable:SessionProtos.Content.dataMessage) +inline ::SessionProtos::TypingMessage* Content::mutable_typingmessage() { + ::SessionProtos::TypingMessage* _msg = _internal_mutable_typingmessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.Content.typingMessage) return _msg; } -inline void Content::set_allocated_datamessage(::SessionProtos::DataMessage* datamessage) { +inline void Content::set_allocated_typingmessage(::SessionProtos::TypingMessage* typingmessage) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.datamessage_; + delete _impl_.typingmessage_; } - if (datamessage) { + if (typingmessage) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(datamessage); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(typingmessage); if (message_arena != submessage_arena) { - datamessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, datamessage, submessage_arena); + typingmessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, typingmessage, submessage_arena); } - _impl_._has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000008u; } else { - _impl_._has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000008u; } - _impl_.datamessage_ = datamessage; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.dataMessage) + _impl_.typingmessage_ = typingmessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.typingMessage) } -// optional .SessionProtos.CallMessage callMessage = 3; -inline bool Content::_internal_has_callmessage() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - PROTOBUF_ASSUME(!value || _impl_.callmessage_ != nullptr); +// optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; +inline bool Content::_internal_has_dataextractionnotification() const { + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; + PROTOBUF_ASSUME(!value || _impl_.dataextractionnotification_ != nullptr); return value; } -inline bool Content::has_callmessage() const { - return _internal_has_callmessage(); +inline bool Content::has_dataextractionnotification() const { + return _internal_has_dataextractionnotification(); } -inline void Content::clear_callmessage() { - if (_impl_.callmessage_ != nullptr) _impl_.callmessage_->Clear(); - _impl_._has_bits_[0] &= ~0x00000002u; +inline void Content::clear_dataextractionnotification() { + if (_impl_.dataextractionnotification_ != nullptr) _impl_.dataextractionnotification_->Clear(); + _impl_._has_bits_[0] &= ~0x00000010u; } -inline const ::SessionProtos::CallMessage& Content::_internal_callmessage() const { - const ::SessionProtos::CallMessage* p = _impl_.callmessage_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_CallMessage_default_instance_); +inline const ::SessionProtos::DataExtractionNotification& Content::_internal_dataextractionnotification() const { + const ::SessionProtos::DataExtractionNotification* p = _impl_.dataextractionnotification_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_DataExtractionNotification_default_instance_); } -inline const ::SessionProtos::CallMessage& Content::callmessage() const { - // @@protoc_insertion_point(field_get:SessionProtos.Content.callMessage) - return _internal_callmessage(); +inline const ::SessionProtos::DataExtractionNotification& Content::dataextractionnotification() const { + // @@protoc_insertion_point(field_get:SessionProtos.Content.dataExtractionNotification) + return _internal_dataextractionnotification(); } -inline void Content::unsafe_arena_set_allocated_callmessage( - ::SessionProtos::CallMessage* callmessage) { +inline void Content::unsafe_arena_set_allocated_dataextractionnotification( + ::SessionProtos::DataExtractionNotification* dataextractionnotification) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.callmessage_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.dataextractionnotification_); } - _impl_.callmessage_ = callmessage; - if (callmessage) { - _impl_._has_bits_[0] |= 0x00000002u; + _impl_.dataextractionnotification_ = dataextractionnotification; + if (dataextractionnotification) { + _impl_._has_bits_[0] |= 0x00000010u; } else { - _impl_._has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000010u; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.callMessage) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.dataExtractionNotification) } -inline ::SessionProtos::CallMessage* Content::release_callmessage() { - _impl_._has_bits_[0] &= ~0x00000002u; - ::SessionProtos::CallMessage* temp = _impl_.callmessage_; - _impl_.callmessage_ = nullptr; +inline ::SessionProtos::DataExtractionNotification* Content::release_dataextractionnotification() { + _impl_._has_bits_[0] &= ~0x00000010u; + ::SessionProtos::DataExtractionNotification* temp = _impl_.dataextractionnotification_; + _impl_.dataextractionnotification_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -7621,85 +7841,85 @@ inline ::SessionProtos::CallMessage* Content::release_callmessage() { #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::SessionProtos::CallMessage* Content::unsafe_arena_release_callmessage() { - // @@protoc_insertion_point(field_release:SessionProtos.Content.callMessage) - _impl_._has_bits_[0] &= ~0x00000002u; - ::SessionProtos::CallMessage* temp = _impl_.callmessage_; - _impl_.callmessage_ = nullptr; +inline ::SessionProtos::DataExtractionNotification* Content::unsafe_arena_release_dataextractionnotification() { + // @@protoc_insertion_point(field_release:SessionProtos.Content.dataExtractionNotification) + _impl_._has_bits_[0] &= ~0x00000010u; + ::SessionProtos::DataExtractionNotification* temp = _impl_.dataextractionnotification_; + _impl_.dataextractionnotification_ = nullptr; return temp; } -inline ::SessionProtos::CallMessage* Content::_internal_mutable_callmessage() { - _impl_._has_bits_[0] |= 0x00000002u; - if (_impl_.callmessage_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::CallMessage>(GetArenaForAllocation()); - _impl_.callmessage_ = p; +inline ::SessionProtos::DataExtractionNotification* Content::_internal_mutable_dataextractionnotification() { + _impl_._has_bits_[0] |= 0x00000010u; + if (_impl_.dataextractionnotification_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::DataExtractionNotification>(GetArenaForAllocation()); + _impl_.dataextractionnotification_ = p; } - return _impl_.callmessage_; + return _impl_.dataextractionnotification_; } -inline ::SessionProtos::CallMessage* Content::mutable_callmessage() { - ::SessionProtos::CallMessage* _msg = _internal_mutable_callmessage(); - // @@protoc_insertion_point(field_mutable:SessionProtos.Content.callMessage) +inline ::SessionProtos::DataExtractionNotification* Content::mutable_dataextractionnotification() { + ::SessionProtos::DataExtractionNotification* _msg = _internal_mutable_dataextractionnotification(); + // @@protoc_insertion_point(field_mutable:SessionProtos.Content.dataExtractionNotification) return _msg; } -inline void Content::set_allocated_callmessage(::SessionProtos::CallMessage* callmessage) { +inline void Content::set_allocated_dataextractionnotification(::SessionProtos::DataExtractionNotification* dataextractionnotification) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.callmessage_; + delete _impl_.dataextractionnotification_; } - if (callmessage) { + if (dataextractionnotification) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(callmessage); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(dataextractionnotification); if (message_arena != submessage_arena) { - callmessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, callmessage, submessage_arena); + dataextractionnotification = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, dataextractionnotification, submessage_arena); } - _impl_._has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000010u; } else { - _impl_._has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000010u; } - _impl_.callmessage_ = callmessage; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.callMessage) + _impl_.dataextractionnotification_ = dataextractionnotification; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.dataExtractionNotification) } -// optional .SessionProtos.ReceiptMessage receiptMessage = 5; -inline bool Content::_internal_has_receiptmessage() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; - PROTOBUF_ASSUME(!value || _impl_.receiptmessage_ != nullptr); +// optional .SessionProtos.UnsendRequest unsendRequest = 9; +inline bool Content::_internal_has_unsendrequest() const { + bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; + PROTOBUF_ASSUME(!value || _impl_.unsendrequest_ != nullptr); return value; } -inline bool Content::has_receiptmessage() const { - return _internal_has_receiptmessage(); +inline bool Content::has_unsendrequest() const { + return _internal_has_unsendrequest(); } -inline void Content::clear_receiptmessage() { - if (_impl_.receiptmessage_ != nullptr) _impl_.receiptmessage_->Clear(); - _impl_._has_bits_[0] &= ~0x00000004u; +inline void Content::clear_unsendrequest() { + if (_impl_.unsendrequest_ != nullptr) _impl_.unsendrequest_->Clear(); + _impl_._has_bits_[0] &= ~0x00000020u; } -inline const ::SessionProtos::ReceiptMessage& Content::_internal_receiptmessage() const { - const ::SessionProtos::ReceiptMessage* p = _impl_.receiptmessage_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_ReceiptMessage_default_instance_); +inline const ::SessionProtos::UnsendRequest& Content::_internal_unsendrequest() const { + const ::SessionProtos::UnsendRequest* p = _impl_.unsendrequest_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_UnsendRequest_default_instance_); } -inline const ::SessionProtos::ReceiptMessage& Content::receiptmessage() const { - // @@protoc_insertion_point(field_get:SessionProtos.Content.receiptMessage) - return _internal_receiptmessage(); +inline const ::SessionProtos::UnsendRequest& Content::unsendrequest() const { + // @@protoc_insertion_point(field_get:SessionProtos.Content.unsendRequest) + return _internal_unsendrequest(); } -inline void Content::unsafe_arena_set_allocated_receiptmessage( - ::SessionProtos::ReceiptMessage* receiptmessage) { +inline void Content::unsafe_arena_set_allocated_unsendrequest( + ::SessionProtos::UnsendRequest* unsendrequest) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.receiptmessage_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.unsendrequest_); } - _impl_.receiptmessage_ = receiptmessage; - if (receiptmessage) { - _impl_._has_bits_[0] |= 0x00000004u; + _impl_.unsendrequest_ = unsendrequest; + if (unsendrequest) { + _impl_._has_bits_[0] |= 0x00000020u; } else { - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000020u; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.receiptMessage) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.unsendRequest) } -inline ::SessionProtos::ReceiptMessage* Content::release_receiptmessage() { - _impl_._has_bits_[0] &= ~0x00000004u; - ::SessionProtos::ReceiptMessage* temp = _impl_.receiptmessage_; - _impl_.receiptmessage_ = nullptr; +inline ::SessionProtos::UnsendRequest* Content::release_unsendrequest() { + _impl_._has_bits_[0] &= ~0x00000020u; + ::SessionProtos::UnsendRequest* temp = _impl_.unsendrequest_; + _impl_.unsendrequest_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -7711,85 +7931,85 @@ inline ::SessionProtos::ReceiptMessage* Content::release_receiptmessage() { #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::SessionProtos::ReceiptMessage* Content::unsafe_arena_release_receiptmessage() { - // @@protoc_insertion_point(field_release:SessionProtos.Content.receiptMessage) - _impl_._has_bits_[0] &= ~0x00000004u; - ::SessionProtos::ReceiptMessage* temp = _impl_.receiptmessage_; - _impl_.receiptmessage_ = nullptr; +inline ::SessionProtos::UnsendRequest* Content::unsafe_arena_release_unsendrequest() { + // @@protoc_insertion_point(field_release:SessionProtos.Content.unsendRequest) + _impl_._has_bits_[0] &= ~0x00000020u; + ::SessionProtos::UnsendRequest* temp = _impl_.unsendrequest_; + _impl_.unsendrequest_ = nullptr; return temp; } -inline ::SessionProtos::ReceiptMessage* Content::_internal_mutable_receiptmessage() { - _impl_._has_bits_[0] |= 0x00000004u; - if (_impl_.receiptmessage_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::ReceiptMessage>(GetArenaForAllocation()); - _impl_.receiptmessage_ = p; +inline ::SessionProtos::UnsendRequest* Content::_internal_mutable_unsendrequest() { + _impl_._has_bits_[0] |= 0x00000020u; + if (_impl_.unsendrequest_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::UnsendRequest>(GetArenaForAllocation()); + _impl_.unsendrequest_ = p; } - return _impl_.receiptmessage_; + return _impl_.unsendrequest_; } -inline ::SessionProtos::ReceiptMessage* Content::mutable_receiptmessage() { - ::SessionProtos::ReceiptMessage* _msg = _internal_mutable_receiptmessage(); - // @@protoc_insertion_point(field_mutable:SessionProtos.Content.receiptMessage) +inline ::SessionProtos::UnsendRequest* Content::mutable_unsendrequest() { + ::SessionProtos::UnsendRequest* _msg = _internal_mutable_unsendrequest(); + // @@protoc_insertion_point(field_mutable:SessionProtos.Content.unsendRequest) return _msg; } -inline void Content::set_allocated_receiptmessage(::SessionProtos::ReceiptMessage* receiptmessage) { +inline void Content::set_allocated_unsendrequest(::SessionProtos::UnsendRequest* unsendrequest) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.receiptmessage_; + delete _impl_.unsendrequest_; } - if (receiptmessage) { + if (unsendrequest) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(receiptmessage); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(unsendrequest); if (message_arena != submessage_arena) { - receiptmessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, receiptmessage, submessage_arena); + unsendrequest = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, unsendrequest, submessage_arena); } - _impl_._has_bits_[0] |= 0x00000004u; + _impl_._has_bits_[0] |= 0x00000020u; } else { - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000020u; } - _impl_.receiptmessage_ = receiptmessage; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.receiptMessage) + _impl_.unsendrequest_ = unsendrequest; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.unsendRequest) } -// optional .SessionProtos.TypingMessage typingMessage = 6; -inline bool Content::_internal_has_typingmessage() const { - bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; - PROTOBUF_ASSUME(!value || _impl_.typingmessage_ != nullptr); +// optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; +inline bool Content::_internal_has_messagerequestresponse() const { + bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; + PROTOBUF_ASSUME(!value || _impl_.messagerequestresponse_ != nullptr); return value; } -inline bool Content::has_typingmessage() const { - return _internal_has_typingmessage(); +inline bool Content::has_messagerequestresponse() const { + return _internal_has_messagerequestresponse(); } -inline void Content::clear_typingmessage() { - if (_impl_.typingmessage_ != nullptr) _impl_.typingmessage_->Clear(); - _impl_._has_bits_[0] &= ~0x00000008u; +inline void Content::clear_messagerequestresponse() { + if (_impl_.messagerequestresponse_ != nullptr) _impl_.messagerequestresponse_->Clear(); + _impl_._has_bits_[0] &= ~0x00000040u; } -inline const ::SessionProtos::TypingMessage& Content::_internal_typingmessage() const { - const ::SessionProtos::TypingMessage* p = _impl_.typingmessage_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_TypingMessage_default_instance_); +inline const ::SessionProtos::MessageRequestResponse& Content::_internal_messagerequestresponse() const { + const ::SessionProtos::MessageRequestResponse* p = _impl_.messagerequestresponse_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_MessageRequestResponse_default_instance_); } -inline const ::SessionProtos::TypingMessage& Content::typingmessage() const { - // @@protoc_insertion_point(field_get:SessionProtos.Content.typingMessage) - return _internal_typingmessage(); +inline const ::SessionProtos::MessageRequestResponse& Content::messagerequestresponse() const { + // @@protoc_insertion_point(field_get:SessionProtos.Content.messageRequestResponse) + return _internal_messagerequestresponse(); } -inline void Content::unsafe_arena_set_allocated_typingmessage( - ::SessionProtos::TypingMessage* typingmessage) { +inline void Content::unsafe_arena_set_allocated_messagerequestresponse( + ::SessionProtos::MessageRequestResponse* messagerequestresponse) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.typingmessage_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.messagerequestresponse_); } - _impl_.typingmessage_ = typingmessage; - if (typingmessage) { - _impl_._has_bits_[0] |= 0x00000008u; + _impl_.messagerequestresponse_ = messagerequestresponse; + if (messagerequestresponse) { + _impl_._has_bits_[0] |= 0x00000040u; } else { - _impl_._has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000040u; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.typingMessage) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.messageRequestResponse) } -inline ::SessionProtos::TypingMessage* Content::release_typingmessage() { - _impl_._has_bits_[0] &= ~0x00000008u; - ::SessionProtos::TypingMessage* temp = _impl_.typingmessage_; - _impl_.typingmessage_ = nullptr; +inline ::SessionProtos::MessageRequestResponse* Content::release_messagerequestresponse() { + _impl_._has_bits_[0] &= ~0x00000040u; + ::SessionProtos::MessageRequestResponse* temp = _impl_.messagerequestresponse_; + _impl_.messagerequestresponse_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -7801,85 +8021,85 @@ inline ::SessionProtos::TypingMessage* Content::release_typingmessage() { #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::SessionProtos::TypingMessage* Content::unsafe_arena_release_typingmessage() { - // @@protoc_insertion_point(field_release:SessionProtos.Content.typingMessage) - _impl_._has_bits_[0] &= ~0x00000008u; - ::SessionProtos::TypingMessage* temp = _impl_.typingmessage_; - _impl_.typingmessage_ = nullptr; +inline ::SessionProtos::MessageRequestResponse* Content::unsafe_arena_release_messagerequestresponse() { + // @@protoc_insertion_point(field_release:SessionProtos.Content.messageRequestResponse) + _impl_._has_bits_[0] &= ~0x00000040u; + ::SessionProtos::MessageRequestResponse* temp = _impl_.messagerequestresponse_; + _impl_.messagerequestresponse_ = nullptr; return temp; } -inline ::SessionProtos::TypingMessage* Content::_internal_mutable_typingmessage() { - _impl_._has_bits_[0] |= 0x00000008u; - if (_impl_.typingmessage_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::TypingMessage>(GetArenaForAllocation()); - _impl_.typingmessage_ = p; +inline ::SessionProtos::MessageRequestResponse* Content::_internal_mutable_messagerequestresponse() { + _impl_._has_bits_[0] |= 0x00000040u; + if (_impl_.messagerequestresponse_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::MessageRequestResponse>(GetArenaForAllocation()); + _impl_.messagerequestresponse_ = p; } - return _impl_.typingmessage_; + return _impl_.messagerequestresponse_; } -inline ::SessionProtos::TypingMessage* Content::mutable_typingmessage() { - ::SessionProtos::TypingMessage* _msg = _internal_mutable_typingmessage(); - // @@protoc_insertion_point(field_mutable:SessionProtos.Content.typingMessage) +inline ::SessionProtos::MessageRequestResponse* Content::mutable_messagerequestresponse() { + ::SessionProtos::MessageRequestResponse* _msg = _internal_mutable_messagerequestresponse(); + // @@protoc_insertion_point(field_mutable:SessionProtos.Content.messageRequestResponse) return _msg; } -inline void Content::set_allocated_typingmessage(::SessionProtos::TypingMessage* typingmessage) { +inline void Content::set_allocated_messagerequestresponse(::SessionProtos::MessageRequestResponse* messagerequestresponse) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.typingmessage_; + delete _impl_.messagerequestresponse_; } - if (typingmessage) { + if (messagerequestresponse) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(typingmessage); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(messagerequestresponse); if (message_arena != submessage_arena) { - typingmessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, typingmessage, submessage_arena); + messagerequestresponse = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, messagerequestresponse, submessage_arena); } - _impl_._has_bits_[0] |= 0x00000008u; + _impl_._has_bits_[0] |= 0x00000040u; } else { - _impl_._has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000040u; } - _impl_.typingmessage_ = typingmessage; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.typingMessage) + _impl_.messagerequestresponse_ = messagerequestresponse; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.messageRequestResponse) } -// optional .SessionProtos.ConfigurationMessage configurationMessage = 7; -inline bool Content::_internal_has_configurationmessage() const { - bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; - PROTOBUF_ASSUME(!value || _impl_.configurationmessage_ != nullptr); +// optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; +inline bool Content::_internal_has_sharedconfigmessage() const { + bool value = (_impl_._has_bits_[0] & 0x00000080u) != 0; + PROTOBUF_ASSUME(!value || _impl_.sharedconfigmessage_ != nullptr); return value; } -inline bool Content::has_configurationmessage() const { - return _internal_has_configurationmessage(); +inline bool Content::has_sharedconfigmessage() const { + return _internal_has_sharedconfigmessage(); } -inline void Content::clear_configurationmessage() { - if (_impl_.configurationmessage_ != nullptr) _impl_.configurationmessage_->Clear(); - _impl_._has_bits_[0] &= ~0x00000010u; +inline void Content::clear_sharedconfigmessage() { + if (_impl_.sharedconfigmessage_ != nullptr) _impl_.sharedconfigmessage_->Clear(); + _impl_._has_bits_[0] &= ~0x00000080u; } -inline const ::SessionProtos::ConfigurationMessage& Content::_internal_configurationmessage() const { - const ::SessionProtos::ConfigurationMessage* p = _impl_.configurationmessage_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_ConfigurationMessage_default_instance_); +inline const ::SessionProtos::SharedConfigMessage& Content::_internal_sharedconfigmessage() const { + const ::SessionProtos::SharedConfigMessage* p = _impl_.sharedconfigmessage_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_SharedConfigMessage_default_instance_); } -inline const ::SessionProtos::ConfigurationMessage& Content::configurationmessage() const { - // @@protoc_insertion_point(field_get:SessionProtos.Content.configurationMessage) - return _internal_configurationmessage(); +inline const ::SessionProtos::SharedConfigMessage& Content::sharedconfigmessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.Content.sharedConfigMessage) + return _internal_sharedconfigmessage(); } -inline void Content::unsafe_arena_set_allocated_configurationmessage( - ::SessionProtos::ConfigurationMessage* configurationmessage) { +inline void Content::unsafe_arena_set_allocated_sharedconfigmessage( + ::SessionProtos::SharedConfigMessage* sharedconfigmessage) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.configurationmessage_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.sharedconfigmessage_); } - _impl_.configurationmessage_ = configurationmessage; - if (configurationmessage) { - _impl_._has_bits_[0] |= 0x00000010u; + _impl_.sharedconfigmessage_ = sharedconfigmessage; + if (sharedconfigmessage) { + _impl_._has_bits_[0] |= 0x00000080u; } else { - _impl_._has_bits_[0] &= ~0x00000010u; + _impl_._has_bits_[0] &= ~0x00000080u; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.configurationMessage) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.sharedConfigMessage) } -inline ::SessionProtos::ConfigurationMessage* Content::release_configurationmessage() { - _impl_._has_bits_[0] &= ~0x00000010u; - ::SessionProtos::ConfigurationMessage* temp = _impl_.configurationmessage_; - _impl_.configurationmessage_ = nullptr; +inline ::SessionProtos::SharedConfigMessage* Content::release_sharedconfigmessage() { + _impl_._has_bits_[0] &= ~0x00000080u; + ::SessionProtos::SharedConfigMessage* temp = _impl_.sharedconfigmessage_; + _impl_.sharedconfigmessage_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -7891,494 +8111,129 @@ inline ::SessionProtos::ConfigurationMessage* Content::release_configurationmess #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::SessionProtos::ConfigurationMessage* Content::unsafe_arena_release_configurationmessage() { - // @@protoc_insertion_point(field_release:SessionProtos.Content.configurationMessage) - _impl_._has_bits_[0] &= ~0x00000010u; - ::SessionProtos::ConfigurationMessage* temp = _impl_.configurationmessage_; - _impl_.configurationmessage_ = nullptr; +inline ::SessionProtos::SharedConfigMessage* Content::unsafe_arena_release_sharedconfigmessage() { + // @@protoc_insertion_point(field_release:SessionProtos.Content.sharedConfigMessage) + _impl_._has_bits_[0] &= ~0x00000080u; + ::SessionProtos::SharedConfigMessage* temp = _impl_.sharedconfigmessage_; + _impl_.sharedconfigmessage_ = nullptr; return temp; } -inline ::SessionProtos::ConfigurationMessage* Content::_internal_mutable_configurationmessage() { - _impl_._has_bits_[0] |= 0x00000010u; - if (_impl_.configurationmessage_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::ConfigurationMessage>(GetArenaForAllocation()); - _impl_.configurationmessage_ = p; +inline ::SessionProtos::SharedConfigMessage* Content::_internal_mutable_sharedconfigmessage() { + _impl_._has_bits_[0] |= 0x00000080u; + if (_impl_.sharedconfigmessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::SharedConfigMessage>(GetArenaForAllocation()); + _impl_.sharedconfigmessage_ = p; } - return _impl_.configurationmessage_; + return _impl_.sharedconfigmessage_; } -inline ::SessionProtos::ConfigurationMessage* Content::mutable_configurationmessage() { - ::SessionProtos::ConfigurationMessage* _msg = _internal_mutable_configurationmessage(); - // @@protoc_insertion_point(field_mutable:SessionProtos.Content.configurationMessage) +inline ::SessionProtos::SharedConfigMessage* Content::mutable_sharedconfigmessage() { + ::SessionProtos::SharedConfigMessage* _msg = _internal_mutable_sharedconfigmessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.Content.sharedConfigMessage) return _msg; } -inline void Content::set_allocated_configurationmessage(::SessionProtos::ConfigurationMessage* configurationmessage) { +inline void Content::set_allocated_sharedconfigmessage(::SessionProtos::SharedConfigMessage* sharedconfigmessage) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.configurationmessage_; + delete _impl_.sharedconfigmessage_; } - if (configurationmessage) { + if (sharedconfigmessage) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(configurationmessage); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(sharedconfigmessage); if (message_arena != submessage_arena) { - configurationmessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, configurationmessage, submessage_arena); + sharedconfigmessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, sharedconfigmessage, submessage_arena); } - _impl_._has_bits_[0] |= 0x00000010u; + _impl_._has_bits_[0] |= 0x00000080u; } else { - _impl_._has_bits_[0] &= ~0x00000010u; + _impl_._has_bits_[0] &= ~0x00000080u; } - _impl_.configurationmessage_ = configurationmessage; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.configurationMessage) + _impl_.sharedconfigmessage_ = sharedconfigmessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.sharedConfigMessage) } -// optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; -inline bool Content::_internal_has_dataextractionnotification() const { - bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; - PROTOBUF_ASSUME(!value || _impl_.dataextractionnotification_ != nullptr); +// optional .SessionProtos.Content.ExpirationType expirationType = 12; +inline bool Content::_internal_has_expirationtype() const { + bool value = (_impl_._has_bits_[0] & 0x00000100u) != 0; return value; } -inline bool Content::has_dataextractionnotification() const { - return _internal_has_dataextractionnotification(); +inline bool Content::has_expirationtype() const { + return _internal_has_expirationtype(); } -inline void Content::clear_dataextractionnotification() { - if (_impl_.dataextractionnotification_ != nullptr) _impl_.dataextractionnotification_->Clear(); - _impl_._has_bits_[0] &= ~0x00000020u; +inline void Content::clear_expirationtype() { + _impl_.expirationtype_ = 0; + _impl_._has_bits_[0] &= ~0x00000100u; } -inline const ::SessionProtos::DataExtractionNotification& Content::_internal_dataextractionnotification() const { - const ::SessionProtos::DataExtractionNotification* p = _impl_.dataextractionnotification_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_DataExtractionNotification_default_instance_); +inline ::SessionProtos::Content_ExpirationType Content::_internal_expirationtype() const { + return static_cast< ::SessionProtos::Content_ExpirationType >(_impl_.expirationtype_); } -inline const ::SessionProtos::DataExtractionNotification& Content::dataextractionnotification() const { - // @@protoc_insertion_point(field_get:SessionProtos.Content.dataExtractionNotification) - return _internal_dataextractionnotification(); +inline ::SessionProtos::Content_ExpirationType Content::expirationtype() const { + // @@protoc_insertion_point(field_get:SessionProtos.Content.expirationType) + return _internal_expirationtype(); } -inline void Content::unsafe_arena_set_allocated_dataextractionnotification( - ::SessionProtos::DataExtractionNotification* dataextractionnotification) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.dataextractionnotification_); - } - _impl_.dataextractionnotification_ = dataextractionnotification; - if (dataextractionnotification) { - _impl_._has_bits_[0] |= 0x00000020u; - } else { - _impl_._has_bits_[0] &= ~0x00000020u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.dataExtractionNotification) +inline void Content::_internal_set_expirationtype(::SessionProtos::Content_ExpirationType value) { + assert(::SessionProtos::Content_ExpirationType_IsValid(value)); + _impl_._has_bits_[0] |= 0x00000100u; + _impl_.expirationtype_ = value; } -inline ::SessionProtos::DataExtractionNotification* Content::release_dataextractionnotification() { - _impl_._has_bits_[0] &= ~0x00000020u; - ::SessionProtos::DataExtractionNotification* temp = _impl_.dataextractionnotification_; - _impl_.dataextractionnotification_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return temp; -} -inline ::SessionProtos::DataExtractionNotification* Content::unsafe_arena_release_dataextractionnotification() { - // @@protoc_insertion_point(field_release:SessionProtos.Content.dataExtractionNotification) - _impl_._has_bits_[0] &= ~0x00000020u; - ::SessionProtos::DataExtractionNotification* temp = _impl_.dataextractionnotification_; - _impl_.dataextractionnotification_ = nullptr; - return temp; -} -inline ::SessionProtos::DataExtractionNotification* Content::_internal_mutable_dataextractionnotification() { - _impl_._has_bits_[0] |= 0x00000020u; - if (_impl_.dataextractionnotification_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::DataExtractionNotification>(GetArenaForAllocation()); - _impl_.dataextractionnotification_ = p; - } - return _impl_.dataextractionnotification_; -} -inline ::SessionProtos::DataExtractionNotification* Content::mutable_dataextractionnotification() { - ::SessionProtos::DataExtractionNotification* _msg = _internal_mutable_dataextractionnotification(); - // @@protoc_insertion_point(field_mutable:SessionProtos.Content.dataExtractionNotification) - return _msg; -} -inline void Content::set_allocated_dataextractionnotification(::SessionProtos::DataExtractionNotification* dataextractionnotification) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete _impl_.dataextractionnotification_; - } - if (dataextractionnotification) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(dataextractionnotification); - if (message_arena != submessage_arena) { - dataextractionnotification = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, dataextractionnotification, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000020u; - } else { - _impl_._has_bits_[0] &= ~0x00000020u; - } - _impl_.dataextractionnotification_ = dataextractionnotification; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.dataExtractionNotification) -} - -// optional .SessionProtos.UnsendRequest unsendRequest = 9; -inline bool Content::_internal_has_unsendrequest() const { - bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; - PROTOBUF_ASSUME(!value || _impl_.unsendrequest_ != nullptr); - return value; -} -inline bool Content::has_unsendrequest() const { - return _internal_has_unsendrequest(); -} -inline void Content::clear_unsendrequest() { - if (_impl_.unsendrequest_ != nullptr) _impl_.unsendrequest_->Clear(); - _impl_._has_bits_[0] &= ~0x00000040u; -} -inline const ::SessionProtos::UnsendRequest& Content::_internal_unsendrequest() const { - const ::SessionProtos::UnsendRequest* p = _impl_.unsendrequest_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_UnsendRequest_default_instance_); -} -inline const ::SessionProtos::UnsendRequest& Content::unsendrequest() const { - // @@protoc_insertion_point(field_get:SessionProtos.Content.unsendRequest) - return _internal_unsendrequest(); -} -inline void Content::unsafe_arena_set_allocated_unsendrequest( - ::SessionProtos::UnsendRequest* unsendrequest) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.unsendrequest_); - } - _impl_.unsendrequest_ = unsendrequest; - if (unsendrequest) { - _impl_._has_bits_[0] |= 0x00000040u; - } else { - _impl_._has_bits_[0] &= ~0x00000040u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.unsendRequest) -} -inline ::SessionProtos::UnsendRequest* Content::release_unsendrequest() { - _impl_._has_bits_[0] &= ~0x00000040u; - ::SessionProtos::UnsendRequest* temp = _impl_.unsendrequest_; - _impl_.unsendrequest_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return temp; -} -inline ::SessionProtos::UnsendRequest* Content::unsafe_arena_release_unsendrequest() { - // @@protoc_insertion_point(field_release:SessionProtos.Content.unsendRequest) - _impl_._has_bits_[0] &= ~0x00000040u; - ::SessionProtos::UnsendRequest* temp = _impl_.unsendrequest_; - _impl_.unsendrequest_ = nullptr; - return temp; -} -inline ::SessionProtos::UnsendRequest* Content::_internal_mutable_unsendrequest() { - _impl_._has_bits_[0] |= 0x00000040u; - if (_impl_.unsendrequest_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::UnsendRequest>(GetArenaForAllocation()); - _impl_.unsendrequest_ = p; - } - return _impl_.unsendrequest_; -} -inline ::SessionProtos::UnsendRequest* Content::mutable_unsendrequest() { - ::SessionProtos::UnsendRequest* _msg = _internal_mutable_unsendrequest(); - // @@protoc_insertion_point(field_mutable:SessionProtos.Content.unsendRequest) - return _msg; -} -inline void Content::set_allocated_unsendrequest(::SessionProtos::UnsendRequest* unsendrequest) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete _impl_.unsendrequest_; - } - if (unsendrequest) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(unsendrequest); - if (message_arena != submessage_arena) { - unsendrequest = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, unsendrequest, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000040u; - } else { - _impl_._has_bits_[0] &= ~0x00000040u; - } - _impl_.unsendrequest_ = unsendrequest; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.unsendRequest) -} - -// optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; -inline bool Content::_internal_has_messagerequestresponse() const { - bool value = (_impl_._has_bits_[0] & 0x00000080u) != 0; - PROTOBUF_ASSUME(!value || _impl_.messagerequestresponse_ != nullptr); - return value; -} -inline bool Content::has_messagerequestresponse() const { - return _internal_has_messagerequestresponse(); -} -inline void Content::clear_messagerequestresponse() { - if (_impl_.messagerequestresponse_ != nullptr) _impl_.messagerequestresponse_->Clear(); - _impl_._has_bits_[0] &= ~0x00000080u; -} -inline const ::SessionProtos::MessageRequestResponse& Content::_internal_messagerequestresponse() const { - const ::SessionProtos::MessageRequestResponse* p = _impl_.messagerequestresponse_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_MessageRequestResponse_default_instance_); -} -inline const ::SessionProtos::MessageRequestResponse& Content::messagerequestresponse() const { - // @@protoc_insertion_point(field_get:SessionProtos.Content.messageRequestResponse) - return _internal_messagerequestresponse(); -} -inline void Content::unsafe_arena_set_allocated_messagerequestresponse( - ::SessionProtos::MessageRequestResponse* messagerequestresponse) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.messagerequestresponse_); - } - _impl_.messagerequestresponse_ = messagerequestresponse; - if (messagerequestresponse) { - _impl_._has_bits_[0] |= 0x00000080u; - } else { - _impl_._has_bits_[0] &= ~0x00000080u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.messageRequestResponse) -} -inline ::SessionProtos::MessageRequestResponse* Content::release_messagerequestresponse() { - _impl_._has_bits_[0] &= ~0x00000080u; - ::SessionProtos::MessageRequestResponse* temp = _impl_.messagerequestresponse_; - _impl_.messagerequestresponse_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return temp; -} -inline ::SessionProtos::MessageRequestResponse* Content::unsafe_arena_release_messagerequestresponse() { - // @@protoc_insertion_point(field_release:SessionProtos.Content.messageRequestResponse) - _impl_._has_bits_[0] &= ~0x00000080u; - ::SessionProtos::MessageRequestResponse* temp = _impl_.messagerequestresponse_; - _impl_.messagerequestresponse_ = nullptr; - return temp; -} -inline ::SessionProtos::MessageRequestResponse* Content::_internal_mutable_messagerequestresponse() { - _impl_._has_bits_[0] |= 0x00000080u; - if (_impl_.messagerequestresponse_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::MessageRequestResponse>(GetArenaForAllocation()); - _impl_.messagerequestresponse_ = p; - } - return _impl_.messagerequestresponse_; -} -inline ::SessionProtos::MessageRequestResponse* Content::mutable_messagerequestresponse() { - ::SessionProtos::MessageRequestResponse* _msg = _internal_mutable_messagerequestresponse(); - // @@protoc_insertion_point(field_mutable:SessionProtos.Content.messageRequestResponse) - return _msg; -} -inline void Content::set_allocated_messagerequestresponse(::SessionProtos::MessageRequestResponse* messagerequestresponse) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete _impl_.messagerequestresponse_; - } - if (messagerequestresponse) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(messagerequestresponse); - if (message_arena != submessage_arena) { - messagerequestresponse = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, messagerequestresponse, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000080u; - } else { - _impl_._has_bits_[0] &= ~0x00000080u; - } - _impl_.messagerequestresponse_ = messagerequestresponse; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.messageRequestResponse) -} - -// optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; -inline bool Content::_internal_has_sharedconfigmessage() const { - bool value = (_impl_._has_bits_[0] & 0x00000100u) != 0; - PROTOBUF_ASSUME(!value || _impl_.sharedconfigmessage_ != nullptr); - return value; -} -inline bool Content::has_sharedconfigmessage() const { - return _internal_has_sharedconfigmessage(); -} -inline void Content::clear_sharedconfigmessage() { - if (_impl_.sharedconfigmessage_ != nullptr) _impl_.sharedconfigmessage_->Clear(); - _impl_._has_bits_[0] &= ~0x00000100u; -} -inline const ::SessionProtos::SharedConfigMessage& Content::_internal_sharedconfigmessage() const { - const ::SessionProtos::SharedConfigMessage* p = _impl_.sharedconfigmessage_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_SharedConfigMessage_default_instance_); -} -inline const ::SessionProtos::SharedConfigMessage& Content::sharedconfigmessage() const { - // @@protoc_insertion_point(field_get:SessionProtos.Content.sharedConfigMessage) - return _internal_sharedconfigmessage(); -} -inline void Content::unsafe_arena_set_allocated_sharedconfigmessage( - ::SessionProtos::SharedConfigMessage* sharedconfigmessage) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.sharedconfigmessage_); - } - _impl_.sharedconfigmessage_ = sharedconfigmessage; - if (sharedconfigmessage) { - _impl_._has_bits_[0] |= 0x00000100u; - } else { - _impl_._has_bits_[0] &= ~0x00000100u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.sharedConfigMessage) -} -inline ::SessionProtos::SharedConfigMessage* Content::release_sharedconfigmessage() { - _impl_._has_bits_[0] &= ~0x00000100u; - ::SessionProtos::SharedConfigMessage* temp = _impl_.sharedconfigmessage_; - _impl_.sharedconfigmessage_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return temp; -} -inline ::SessionProtos::SharedConfigMessage* Content::unsafe_arena_release_sharedconfigmessage() { - // @@protoc_insertion_point(field_release:SessionProtos.Content.sharedConfigMessage) - _impl_._has_bits_[0] &= ~0x00000100u; - ::SessionProtos::SharedConfigMessage* temp = _impl_.sharedconfigmessage_; - _impl_.sharedconfigmessage_ = nullptr; - return temp; -} -inline ::SessionProtos::SharedConfigMessage* Content::_internal_mutable_sharedconfigmessage() { - _impl_._has_bits_[0] |= 0x00000100u; - if (_impl_.sharedconfigmessage_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::SharedConfigMessage>(GetArenaForAllocation()); - _impl_.sharedconfigmessage_ = p; - } - return _impl_.sharedconfigmessage_; -} -inline ::SessionProtos::SharedConfigMessage* Content::mutable_sharedconfigmessage() { - ::SessionProtos::SharedConfigMessage* _msg = _internal_mutable_sharedconfigmessage(); - // @@protoc_insertion_point(field_mutable:SessionProtos.Content.sharedConfigMessage) - return _msg; -} -inline void Content::set_allocated_sharedconfigmessage(::SessionProtos::SharedConfigMessage* sharedconfigmessage) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete _impl_.sharedconfigmessage_; - } - if (sharedconfigmessage) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(sharedconfigmessage); - if (message_arena != submessage_arena) { - sharedconfigmessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, sharedconfigmessage, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000100u; - } else { - _impl_._has_bits_[0] &= ~0x00000100u; - } - _impl_.sharedconfigmessage_ = sharedconfigmessage; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.sharedConfigMessage) +inline void Content::set_expirationtype(::SessionProtos::Content_ExpirationType value) { + _internal_set_expirationtype(value); + // @@protoc_insertion_point(field_set:SessionProtos.Content.expirationType) } -// optional .SessionProtos.ProMessageConfig proMessageConfig = 12; -inline bool Content::_internal_has_promessageconfig() const { +// optional uint32 expirationTimer = 13; +inline bool Content::_internal_has_expirationtimer() const { bool value = (_impl_._has_bits_[0] & 0x00000200u) != 0; - PROTOBUF_ASSUME(!value || _impl_.promessageconfig_ != nullptr); return value; } -inline bool Content::has_promessageconfig() const { - return _internal_has_promessageconfig(); +inline bool Content::has_expirationtimer() const { + return _internal_has_expirationtimer(); } -inline void Content::clear_promessageconfig() { - if (_impl_.promessageconfig_ != nullptr) _impl_.promessageconfig_->Clear(); +inline void Content::clear_expirationtimer() { + _impl_.expirationtimer_ = 0u; _impl_._has_bits_[0] &= ~0x00000200u; } -inline const ::SessionProtos::ProMessageConfig& Content::_internal_promessageconfig() const { - const ::SessionProtos::ProMessageConfig* p = _impl_.promessageconfig_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_ProMessageConfig_default_instance_); +inline uint32_t Content::_internal_expirationtimer() const { + return _impl_.expirationtimer_; } -inline const ::SessionProtos::ProMessageConfig& Content::promessageconfig() const { - // @@protoc_insertion_point(field_get:SessionProtos.Content.proMessageConfig) - return _internal_promessageconfig(); +inline uint32_t Content::expirationtimer() const { + // @@protoc_insertion_point(field_get:SessionProtos.Content.expirationTimer) + return _internal_expirationtimer(); } -inline void Content::unsafe_arena_set_allocated_promessageconfig( - ::SessionProtos::ProMessageConfig* promessageconfig) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.promessageconfig_); - } - _impl_.promessageconfig_ = promessageconfig; - if (promessageconfig) { - _impl_._has_bits_[0] |= 0x00000200u; - } else { - _impl_._has_bits_[0] &= ~0x00000200u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.proMessageConfig) +inline void Content::_internal_set_expirationtimer(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000200u; + _impl_.expirationtimer_ = value; } -inline ::SessionProtos::ProMessageConfig* Content::release_promessageconfig() { - _impl_._has_bits_[0] &= ~0x00000200u; - ::SessionProtos::ProMessageConfig* temp = _impl_.promessageconfig_; - _impl_.promessageconfig_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return temp; +inline void Content::set_expirationtimer(uint32_t value) { + _internal_set_expirationtimer(value); + // @@protoc_insertion_point(field_set:SessionProtos.Content.expirationTimer) } -inline ::SessionProtos::ProMessageConfig* Content::unsafe_arena_release_promessageconfig() { - // @@protoc_insertion_point(field_release:SessionProtos.Content.proMessageConfig) - _impl_._has_bits_[0] &= ~0x00000200u; - ::SessionProtos::ProMessageConfig* temp = _impl_.promessageconfig_; - _impl_.promessageconfig_ = nullptr; - return temp; + +// optional uint64 sigTimestamp = 15; +inline bool Content::_internal_has_sigtimestamp() const { + bool value = (_impl_._has_bits_[0] & 0x00000400u) != 0; + return value; } -inline ::SessionProtos::ProMessageConfig* Content::_internal_mutable_promessageconfig() { - _impl_._has_bits_[0] |= 0x00000200u; - if (_impl_.promessageconfig_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::ProMessageConfig>(GetArenaForAllocation()); - _impl_.promessageconfig_ = p; - } - return _impl_.promessageconfig_; +inline bool Content::has_sigtimestamp() const { + return _internal_has_sigtimestamp(); } -inline ::SessionProtos::ProMessageConfig* Content::mutable_promessageconfig() { - ::SessionProtos::ProMessageConfig* _msg = _internal_mutable_promessageconfig(); - // @@protoc_insertion_point(field_mutable:SessionProtos.Content.proMessageConfig) - return _msg; +inline void Content::clear_sigtimestamp() { + _impl_.sigtimestamp_ = uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000400u; } -inline void Content::set_allocated_promessageconfig(::SessionProtos::ProMessageConfig* promessageconfig) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete _impl_.promessageconfig_; - } - if (promessageconfig) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(promessageconfig); - if (message_arena != submessage_arena) { - promessageconfig = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, promessageconfig, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000200u; - } else { - _impl_._has_bits_[0] &= ~0x00000200u; - } - _impl_.promessageconfig_ = promessageconfig; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.proMessageConfig) +inline uint64_t Content::_internal_sigtimestamp() const { + return _impl_.sigtimestamp_; +} +inline uint64_t Content::sigtimestamp() const { + // @@protoc_insertion_point(field_get:SessionProtos.Content.sigTimestamp) + return _internal_sigtimestamp(); +} +inline void Content::_internal_set_sigtimestamp(uint64_t value) { + _impl_._has_bits_[0] |= 0x00000400u; + _impl_.sigtimestamp_ = value; +} +inline void Content::set_sigtimestamp(uint64_t value) { + _internal_set_sigtimestamp(value); + // @@protoc_insertion_point(field_set:SessionProtos.Content.sigTimestamp) } // ------------------------------------------------------------------- @@ -9954,387 +9809,78 @@ inline void DataMessage_OpenGroupInvitation::_internal_set_url(const std::string } inline std::string* DataMessage_OpenGroupInvitation::_internal_mutable_url() { _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.url_.Mutable(GetArenaForAllocation()); -} -inline std::string* DataMessage_OpenGroupInvitation::release_url() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.OpenGroupInvitation.url) - if (!_internal_has_url()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.url_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.url_.IsDefault()) { - _impl_.url_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void DataMessage_OpenGroupInvitation::set_allocated_url(std::string* url) { - if (url != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - _impl_.url_.SetAllocated(url, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.url_.IsDefault()) { - _impl_.url_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.OpenGroupInvitation.url) -} - -// required string name = 3; -inline bool DataMessage_OpenGroupInvitation::_internal_has_name() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - return value; -} -inline bool DataMessage_OpenGroupInvitation::has_name() const { - return _internal_has_name(); -} -inline void DataMessage_OpenGroupInvitation::clear_name() { - _impl_.name_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000002u; -} -inline const std::string& DataMessage_OpenGroupInvitation::name() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.OpenGroupInvitation.name) - return _internal_name(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void DataMessage_OpenGroupInvitation::set_name(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.OpenGroupInvitation.name) -} -inline std::string* DataMessage_OpenGroupInvitation::mutable_name() { - std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.OpenGroupInvitation.name) - return _s; -} -inline const std::string& DataMessage_OpenGroupInvitation::_internal_name() const { - return _impl_.name_.Get(); -} -inline void DataMessage_OpenGroupInvitation::_internal_set_name(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.name_.Set(value, GetArenaForAllocation()); -} -inline std::string* DataMessage_OpenGroupInvitation::_internal_mutable_name() { - _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.name_.Mutable(GetArenaForAllocation()); -} -inline std::string* DataMessage_OpenGroupInvitation::release_name() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.OpenGroupInvitation.name) - if (!_internal_has_name()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.name_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.name_.IsDefault()) { - _impl_.name_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void DataMessage_OpenGroupInvitation::set_allocated_name(std::string* name) { - if (name != nullptr) { - _impl_._has_bits_[0] |= 0x00000002u; - } else { - _impl_._has_bits_[0] &= ~0x00000002u; - } - _impl_.name_.SetAllocated(name, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.name_.IsDefault()) { - _impl_.name_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.OpenGroupInvitation.name) -} - -// ------------------------------------------------------------------- - -// DataMessage_ClosedGroupControlMessage_KeyPairWrapper - -// required bytes publicKey = 1; -inline bool DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_internal_has_publickey() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - return value; -} -inline bool DataMessage_ClosedGroupControlMessage_KeyPairWrapper::has_publickey() const { - return _internal_has_publickey(); -} -inline void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::clear_publickey() { - _impl_.publickey_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const std::string& DataMessage_ClosedGroupControlMessage_KeyPairWrapper::publickey() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper.publicKey) - return _internal_publickey(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::set_publickey(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.publickey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper.publicKey) -} -inline std::string* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::mutable_publickey() { - std::string* _s = _internal_mutable_publickey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper.publicKey) - return _s; -} -inline const std::string& DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_internal_publickey() const { - return _impl_.publickey_.Get(); -} -inline void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_internal_set_publickey(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.publickey_.Set(value, GetArenaForAllocation()); -} -inline std::string* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_internal_mutable_publickey() { - _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.publickey_.Mutable(GetArenaForAllocation()); -} -inline std::string* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::release_publickey() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper.publicKey) - if (!_internal_has_publickey()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.publickey_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.publickey_.IsDefault()) { - _impl_.publickey_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::set_allocated_publickey(std::string* publickey) { - if (publickey != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - _impl_.publickey_.SetAllocated(publickey, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.publickey_.IsDefault()) { - _impl_.publickey_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper.publicKey) -} - -// required bytes encryptedKeyPair = 2; -inline bool DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_internal_has_encryptedkeypair() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - return value; -} -inline bool DataMessage_ClosedGroupControlMessage_KeyPairWrapper::has_encryptedkeypair() const { - return _internal_has_encryptedkeypair(); -} -inline void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::clear_encryptedkeypair() { - _impl_.encryptedkeypair_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000002u; -} -inline const std::string& DataMessage_ClosedGroupControlMessage_KeyPairWrapper::encryptedkeypair() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper.encryptedKeyPair) - return _internal_encryptedkeypair(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::set_encryptedkeypair(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.encryptedkeypair_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper.encryptedKeyPair) -} -inline std::string* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::mutable_encryptedkeypair() { - std::string* _s = _internal_mutable_encryptedkeypair(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper.encryptedKeyPair) - return _s; -} -inline const std::string& DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_internal_encryptedkeypair() const { - return _impl_.encryptedkeypair_.Get(); -} -inline void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_internal_set_encryptedkeypair(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.encryptedkeypair_.Set(value, GetArenaForAllocation()); -} -inline std::string* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_internal_mutable_encryptedkeypair() { - _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.encryptedkeypair_.Mutable(GetArenaForAllocation()); -} -inline std::string* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::release_encryptedkeypair() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper.encryptedKeyPair) - if (!_internal_has_encryptedkeypair()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.encryptedkeypair_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.encryptedkeypair_.IsDefault()) { - _impl_.encryptedkeypair_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::set_allocated_encryptedkeypair(std::string* encryptedkeypair) { - if (encryptedkeypair != nullptr) { - _impl_._has_bits_[0] |= 0x00000002u; - } else { - _impl_._has_bits_[0] &= ~0x00000002u; - } - _impl_.encryptedkeypair_.SetAllocated(encryptedkeypair, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.encryptedkeypair_.IsDefault()) { - _impl_.encryptedkeypair_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper.encryptedKeyPair) -} - -// ------------------------------------------------------------------- - -// DataMessage_ClosedGroupControlMessage - -// required .SessionProtos.DataMessage.ClosedGroupControlMessage.Type type = 1; -inline bool DataMessage_ClosedGroupControlMessage::_internal_has_type() const { - bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; - return value; -} -inline bool DataMessage_ClosedGroupControlMessage::has_type() const { - return _internal_has_type(); -} -inline void DataMessage_ClosedGroupControlMessage::clear_type() { - _impl_.type_ = 1; - _impl_._has_bits_[0] &= ~0x00000010u; -} -inline ::SessionProtos::DataMessage_ClosedGroupControlMessage_Type DataMessage_ClosedGroupControlMessage::_internal_type() const { - return static_cast< ::SessionProtos::DataMessage_ClosedGroupControlMessage_Type >(_impl_.type_); -} -inline ::SessionProtos::DataMessage_ClosedGroupControlMessage_Type DataMessage_ClosedGroupControlMessage::type() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.ClosedGroupControlMessage.type) - return _internal_type(); -} -inline void DataMessage_ClosedGroupControlMessage::_internal_set_type(::SessionProtos::DataMessage_ClosedGroupControlMessage_Type value) { - assert(::SessionProtos::DataMessage_ClosedGroupControlMessage_Type_IsValid(value)); - _impl_._has_bits_[0] |= 0x00000010u; - _impl_.type_ = value; -} -inline void DataMessage_ClosedGroupControlMessage::set_type(::SessionProtos::DataMessage_ClosedGroupControlMessage_Type value) { - _internal_set_type(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.ClosedGroupControlMessage.type) -} - -// optional bytes publicKey = 2; -inline bool DataMessage_ClosedGroupControlMessage::_internal_has_publickey() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - return value; -} -inline bool DataMessage_ClosedGroupControlMessage::has_publickey() const { - return _internal_has_publickey(); -} -inline void DataMessage_ClosedGroupControlMessage::clear_publickey() { - _impl_.publickey_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const std::string& DataMessage_ClosedGroupControlMessage::publickey() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.ClosedGroupControlMessage.publicKey) - return _internal_publickey(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void DataMessage_ClosedGroupControlMessage::set_publickey(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.publickey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.ClosedGroupControlMessage.publicKey) -} -inline std::string* DataMessage_ClosedGroupControlMessage::mutable_publickey() { - std::string* _s = _internal_mutable_publickey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.ClosedGroupControlMessage.publicKey) - return _s; -} -inline const std::string& DataMessage_ClosedGroupControlMessage::_internal_publickey() const { - return _impl_.publickey_.Get(); -} -inline void DataMessage_ClosedGroupControlMessage::_internal_set_publickey(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.publickey_.Set(value, GetArenaForAllocation()); -} -inline std::string* DataMessage_ClosedGroupControlMessage::_internal_mutable_publickey() { - _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.publickey_.Mutable(GetArenaForAllocation()); + return _impl_.url_.Mutable(GetArenaForAllocation()); } -inline std::string* DataMessage_ClosedGroupControlMessage::release_publickey() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.ClosedGroupControlMessage.publicKey) - if (!_internal_has_publickey()) { +inline std::string* DataMessage_OpenGroupInvitation::release_url() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.OpenGroupInvitation.url) + if (!_internal_has_url()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.publickey_.Release(); + auto* p = _impl_.url_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.publickey_.IsDefault()) { - _impl_.publickey_.Set("", GetArenaForAllocation()); + if (_impl_.url_.IsDefault()) { + _impl_.url_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void DataMessage_ClosedGroupControlMessage::set_allocated_publickey(std::string* publickey) { - if (publickey != nullptr) { +inline void DataMessage_OpenGroupInvitation::set_allocated_url(std::string* url) { + if (url != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; } else { _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.publickey_.SetAllocated(publickey, GetArenaForAllocation()); + _impl_.url_.SetAllocated(url, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.publickey_.IsDefault()) { - _impl_.publickey_.Set("", GetArenaForAllocation()); + if (_impl_.url_.IsDefault()) { + _impl_.url_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.ClosedGroupControlMessage.publicKey) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.OpenGroupInvitation.url) } -// optional string name = 3; -inline bool DataMessage_ClosedGroupControlMessage::_internal_has_name() const { +// required string name = 3; +inline bool DataMessage_OpenGroupInvitation::_internal_has_name() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } -inline bool DataMessage_ClosedGroupControlMessage::has_name() const { +inline bool DataMessage_OpenGroupInvitation::has_name() const { return _internal_has_name(); } -inline void DataMessage_ClosedGroupControlMessage::clear_name() { +inline void DataMessage_OpenGroupInvitation::clear_name() { _impl_.name_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000002u; } -inline const std::string& DataMessage_ClosedGroupControlMessage::name() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.ClosedGroupControlMessage.name) +inline const std::string& DataMessage_OpenGroupInvitation::name() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.OpenGroupInvitation.name) return _internal_name(); } template inline PROTOBUF_ALWAYS_INLINE -void DataMessage_ClosedGroupControlMessage::set_name(ArgT0&& arg0, ArgT... args) { +void DataMessage_OpenGroupInvitation::set_name(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000002u; _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.ClosedGroupControlMessage.name) + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.OpenGroupInvitation.name) } -inline std::string* DataMessage_ClosedGroupControlMessage::mutable_name() { +inline std::string* DataMessage_OpenGroupInvitation::mutable_name() { std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.ClosedGroupControlMessage.name) + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.OpenGroupInvitation.name) return _s; } -inline const std::string& DataMessage_ClosedGroupControlMessage::_internal_name() const { +inline const std::string& DataMessage_OpenGroupInvitation::_internal_name() const { return _impl_.name_.Get(); } -inline void DataMessage_ClosedGroupControlMessage::_internal_set_name(const std::string& value) { +inline void DataMessage_OpenGroupInvitation::_internal_set_name(const std::string& value) { _impl_._has_bits_[0] |= 0x00000002u; _impl_.name_.Set(value, GetArenaForAllocation()); } -inline std::string* DataMessage_ClosedGroupControlMessage::_internal_mutable_name() { +inline std::string* DataMessage_OpenGroupInvitation::_internal_mutable_name() { _impl_._has_bits_[0] |= 0x00000002u; return _impl_.name_.Mutable(GetArenaForAllocation()); } -inline std::string* DataMessage_ClosedGroupControlMessage::release_name() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.ClosedGroupControlMessage.name) +inline std::string* DataMessage_OpenGroupInvitation::release_name() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.OpenGroupInvitation.name) if (!_internal_has_name()) { return nullptr; } @@ -10347,7 +9893,7 @@ inline std::string* DataMessage_ClosedGroupControlMessage::release_name() { #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void DataMessage_ClosedGroupControlMessage::set_allocated_name(std::string* name) { +inline void DataMessage_OpenGroupInvitation::set_allocated_name(std::string* name) { if (name != nullptr) { _impl_._has_bits_[0] |= 0x00000002u; } else { @@ -10359,315 +9905,7 @@ inline void DataMessage_ClosedGroupControlMessage::set_allocated_name(std::strin _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.ClosedGroupControlMessage.name) -} - -// optional .SessionProtos.KeyPair encryptionKeyPair = 4; -inline bool DataMessage_ClosedGroupControlMessage::_internal_has_encryptionkeypair() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; - PROTOBUF_ASSUME(!value || _impl_.encryptionkeypair_ != nullptr); - return value; -} -inline bool DataMessage_ClosedGroupControlMessage::has_encryptionkeypair() const { - return _internal_has_encryptionkeypair(); -} -inline void DataMessage_ClosedGroupControlMessage::clear_encryptionkeypair() { - if (_impl_.encryptionkeypair_ != nullptr) _impl_.encryptionkeypair_->Clear(); - _impl_._has_bits_[0] &= ~0x00000004u; -} -inline const ::SessionProtos::KeyPair& DataMessage_ClosedGroupControlMessage::_internal_encryptionkeypair() const { - const ::SessionProtos::KeyPair* p = _impl_.encryptionkeypair_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_KeyPair_default_instance_); -} -inline const ::SessionProtos::KeyPair& DataMessage_ClosedGroupControlMessage::encryptionkeypair() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.ClosedGroupControlMessage.encryptionKeyPair) - return _internal_encryptionkeypair(); -} -inline void DataMessage_ClosedGroupControlMessage::unsafe_arena_set_allocated_encryptionkeypair( - ::SessionProtos::KeyPair* encryptionkeypair) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.encryptionkeypair_); - } - _impl_.encryptionkeypair_ = encryptionkeypair; - if (encryptionkeypair) { - _impl_._has_bits_[0] |= 0x00000004u; - } else { - _impl_._has_bits_[0] &= ~0x00000004u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.DataMessage.ClosedGroupControlMessage.encryptionKeyPair) -} -inline ::SessionProtos::KeyPair* DataMessage_ClosedGroupControlMessage::release_encryptionkeypair() { - _impl_._has_bits_[0] &= ~0x00000004u; - ::SessionProtos::KeyPair* temp = _impl_.encryptionkeypair_; - _impl_.encryptionkeypair_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return temp; -} -inline ::SessionProtos::KeyPair* DataMessage_ClosedGroupControlMessage::unsafe_arena_release_encryptionkeypair() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.ClosedGroupControlMessage.encryptionKeyPair) - _impl_._has_bits_[0] &= ~0x00000004u; - ::SessionProtos::KeyPair* temp = _impl_.encryptionkeypair_; - _impl_.encryptionkeypair_ = nullptr; - return temp; -} -inline ::SessionProtos::KeyPair* DataMessage_ClosedGroupControlMessage::_internal_mutable_encryptionkeypair() { - _impl_._has_bits_[0] |= 0x00000004u; - if (_impl_.encryptionkeypair_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::KeyPair>(GetArenaForAllocation()); - _impl_.encryptionkeypair_ = p; - } - return _impl_.encryptionkeypair_; -} -inline ::SessionProtos::KeyPair* DataMessage_ClosedGroupControlMessage::mutable_encryptionkeypair() { - ::SessionProtos::KeyPair* _msg = _internal_mutable_encryptionkeypair(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.ClosedGroupControlMessage.encryptionKeyPair) - return _msg; -} -inline void DataMessage_ClosedGroupControlMessage::set_allocated_encryptionkeypair(::SessionProtos::KeyPair* encryptionkeypair) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete _impl_.encryptionkeypair_; - } - if (encryptionkeypair) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(encryptionkeypair); - if (message_arena != submessage_arena) { - encryptionkeypair = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, encryptionkeypair, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000004u; - } else { - _impl_._has_bits_[0] &= ~0x00000004u; - } - _impl_.encryptionkeypair_ = encryptionkeypair; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.ClosedGroupControlMessage.encryptionKeyPair) -} - -// repeated bytes members = 5; -inline int DataMessage_ClosedGroupControlMessage::_internal_members_size() const { - return _impl_.members_.size(); -} -inline int DataMessage_ClosedGroupControlMessage::members_size() const { - return _internal_members_size(); -} -inline void DataMessage_ClosedGroupControlMessage::clear_members() { - _impl_.members_.Clear(); -} -inline std::string* DataMessage_ClosedGroupControlMessage::add_members() { - std::string* _s = _internal_add_members(); - // @@protoc_insertion_point(field_add_mutable:SessionProtos.DataMessage.ClosedGroupControlMessage.members) - return _s; -} -inline const std::string& DataMessage_ClosedGroupControlMessage::_internal_members(int index) const { - return _impl_.members_.Get(index); -} -inline const std::string& DataMessage_ClosedGroupControlMessage::members(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.ClosedGroupControlMessage.members) - return _internal_members(index); -} -inline std::string* DataMessage_ClosedGroupControlMessage::mutable_members(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.ClosedGroupControlMessage.members) - return _impl_.members_.Mutable(index); -} -inline void DataMessage_ClosedGroupControlMessage::set_members(int index, const std::string& value) { - _impl_.members_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.ClosedGroupControlMessage.members) -} -inline void DataMessage_ClosedGroupControlMessage::set_members(int index, std::string&& value) { - _impl_.members_.Mutable(index)->assign(std::move(value)); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.ClosedGroupControlMessage.members) -} -inline void DataMessage_ClosedGroupControlMessage::set_members(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.members_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:SessionProtos.DataMessage.ClosedGroupControlMessage.members) -} -inline void DataMessage_ClosedGroupControlMessage::set_members(int index, const void* value, size_t size) { - _impl_.members_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:SessionProtos.DataMessage.ClosedGroupControlMessage.members) -} -inline std::string* DataMessage_ClosedGroupControlMessage::_internal_add_members() { - return _impl_.members_.Add(); -} -inline void DataMessage_ClosedGroupControlMessage::add_members(const std::string& value) { - _impl_.members_.Add()->assign(value); - // @@protoc_insertion_point(field_add:SessionProtos.DataMessage.ClosedGroupControlMessage.members) -} -inline void DataMessage_ClosedGroupControlMessage::add_members(std::string&& value) { - _impl_.members_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:SessionProtos.DataMessage.ClosedGroupControlMessage.members) -} -inline void DataMessage_ClosedGroupControlMessage::add_members(const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.members_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:SessionProtos.DataMessage.ClosedGroupControlMessage.members) -} -inline void DataMessage_ClosedGroupControlMessage::add_members(const void* value, size_t size) { - _impl_.members_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:SessionProtos.DataMessage.ClosedGroupControlMessage.members) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -DataMessage_ClosedGroupControlMessage::members() const { - // @@protoc_insertion_point(field_list:SessionProtos.DataMessage.ClosedGroupControlMessage.members) - return _impl_.members_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -DataMessage_ClosedGroupControlMessage::mutable_members() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.DataMessage.ClosedGroupControlMessage.members) - return &_impl_.members_; -} - -// repeated bytes admins = 6; -inline int DataMessage_ClosedGroupControlMessage::_internal_admins_size() const { - return _impl_.admins_.size(); -} -inline int DataMessage_ClosedGroupControlMessage::admins_size() const { - return _internal_admins_size(); -} -inline void DataMessage_ClosedGroupControlMessage::clear_admins() { - _impl_.admins_.Clear(); -} -inline std::string* DataMessage_ClosedGroupControlMessage::add_admins() { - std::string* _s = _internal_add_admins(); - // @@protoc_insertion_point(field_add_mutable:SessionProtos.DataMessage.ClosedGroupControlMessage.admins) - return _s; -} -inline const std::string& DataMessage_ClosedGroupControlMessage::_internal_admins(int index) const { - return _impl_.admins_.Get(index); -} -inline const std::string& DataMessage_ClosedGroupControlMessage::admins(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.ClosedGroupControlMessage.admins) - return _internal_admins(index); -} -inline std::string* DataMessage_ClosedGroupControlMessage::mutable_admins(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.ClosedGroupControlMessage.admins) - return _impl_.admins_.Mutable(index); -} -inline void DataMessage_ClosedGroupControlMessage::set_admins(int index, const std::string& value) { - _impl_.admins_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.ClosedGroupControlMessage.admins) -} -inline void DataMessage_ClosedGroupControlMessage::set_admins(int index, std::string&& value) { - _impl_.admins_.Mutable(index)->assign(std::move(value)); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.ClosedGroupControlMessage.admins) -} -inline void DataMessage_ClosedGroupControlMessage::set_admins(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.admins_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:SessionProtos.DataMessage.ClosedGroupControlMessage.admins) -} -inline void DataMessage_ClosedGroupControlMessage::set_admins(int index, const void* value, size_t size) { - _impl_.admins_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:SessionProtos.DataMessage.ClosedGroupControlMessage.admins) -} -inline std::string* DataMessage_ClosedGroupControlMessage::_internal_add_admins() { - return _impl_.admins_.Add(); -} -inline void DataMessage_ClosedGroupControlMessage::add_admins(const std::string& value) { - _impl_.admins_.Add()->assign(value); - // @@protoc_insertion_point(field_add:SessionProtos.DataMessage.ClosedGroupControlMessage.admins) -} -inline void DataMessage_ClosedGroupControlMessage::add_admins(std::string&& value) { - _impl_.admins_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:SessionProtos.DataMessage.ClosedGroupControlMessage.admins) -} -inline void DataMessage_ClosedGroupControlMessage::add_admins(const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.admins_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:SessionProtos.DataMessage.ClosedGroupControlMessage.admins) -} -inline void DataMessage_ClosedGroupControlMessage::add_admins(const void* value, size_t size) { - _impl_.admins_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:SessionProtos.DataMessage.ClosedGroupControlMessage.admins) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -DataMessage_ClosedGroupControlMessage::admins() const { - // @@protoc_insertion_point(field_list:SessionProtos.DataMessage.ClosedGroupControlMessage.admins) - return _impl_.admins_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -DataMessage_ClosedGroupControlMessage::mutable_admins() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.DataMessage.ClosedGroupControlMessage.admins) - return &_impl_.admins_; -} - -// repeated .SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper wrappers = 7; -inline int DataMessage_ClosedGroupControlMessage::_internal_wrappers_size() const { - return _impl_.wrappers_.size(); -} -inline int DataMessage_ClosedGroupControlMessage::wrappers_size() const { - return _internal_wrappers_size(); -} -inline void DataMessage_ClosedGroupControlMessage::clear_wrappers() { - _impl_.wrappers_.Clear(); -} -inline ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper* DataMessage_ClosedGroupControlMessage::mutable_wrappers(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.ClosedGroupControlMessage.wrappers) - return _impl_.wrappers_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper >* -DataMessage_ClosedGroupControlMessage::mutable_wrappers() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.DataMessage.ClosedGroupControlMessage.wrappers) - return &_impl_.wrappers_; -} -inline const ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper& DataMessage_ClosedGroupControlMessage::_internal_wrappers(int index) const { - return _impl_.wrappers_.Get(index); -} -inline const ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper& DataMessage_ClosedGroupControlMessage::wrappers(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.ClosedGroupControlMessage.wrappers) - return _internal_wrappers(index); -} -inline ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper* DataMessage_ClosedGroupControlMessage::_internal_add_wrappers() { - return _impl_.wrappers_.Add(); -} -inline ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper* DataMessage_ClosedGroupControlMessage::add_wrappers() { - ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper* _add = _internal_add_wrappers(); - // @@protoc_insertion_point(field_add:SessionProtos.DataMessage.ClosedGroupControlMessage.wrappers) - return _add; -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_ClosedGroupControlMessage_KeyPairWrapper >& -DataMessage_ClosedGroupControlMessage::wrappers() const { - // @@protoc_insertion_point(field_list:SessionProtos.DataMessage.ClosedGroupControlMessage.wrappers) - return _impl_.wrappers_; -} - -// optional uint32 expirationTimer = 8; -inline bool DataMessage_ClosedGroupControlMessage::_internal_has_expirationtimer() const { - bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; - return value; -} -inline bool DataMessage_ClosedGroupControlMessage::has_expirationtimer() const { - return _internal_has_expirationtimer(); -} -inline void DataMessage_ClosedGroupControlMessage::clear_expirationtimer() { - _impl_.expirationtimer_ = 0u; - _impl_._has_bits_[0] &= ~0x00000008u; -} -inline uint32_t DataMessage_ClosedGroupControlMessage::_internal_expirationtimer() const { - return _impl_.expirationtimer_; -} -inline uint32_t DataMessage_ClosedGroupControlMessage::expirationtimer() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.ClosedGroupControlMessage.expirationTimer) - return _internal_expirationtimer(); -} -inline void DataMessage_ClosedGroupControlMessage::_internal_set_expirationtimer(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000008u; - _impl_.expirationtimer_ = value; -} -inline void DataMessage_ClosedGroupControlMessage::set_expirationtimer(uint32_t value) { - _internal_set_expirationtimer(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.ClosedGroupControlMessage.expirationTimer) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.OpenGroupInvitation.name) } // ------------------------------------------------------------------- @@ -10784,7 +10022,7 @@ DataMessage::attachments() const { // optional uint32 flags = 4; inline bool DataMessage::_internal_has_flags() const { - bool value = (_impl_._has_bits_[0] & 0x00000100u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000200u) != 0; return value; } inline bool DataMessage::has_flags() const { @@ -10792,7 +10030,7 @@ inline bool DataMessage::has_flags() const { } inline void DataMessage::clear_flags() { _impl_.flags_ = 0u; - _impl_._has_bits_[0] &= ~0x00000100u; + _impl_._has_bits_[0] &= ~0x00000200u; } inline uint32_t DataMessage::_internal_flags() const { return _impl_.flags_; @@ -10802,7 +10040,7 @@ inline uint32_t DataMessage::flags() const { return _internal_flags(); } inline void DataMessage::_internal_set_flags(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000100u; + _impl_._has_bits_[0] |= 0x00000200u; _impl_.flags_ = value; } inline void DataMessage::set_flags(uint32_t value) { @@ -10810,34 +10048,6 @@ inline void DataMessage::set_flags(uint32_t value) { // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.flags) } -// optional uint32 expireTimer = 5; -inline bool DataMessage::_internal_has_expiretimer() const { - bool value = (_impl_._has_bits_[0] & 0x00000200u) != 0; - return value; -} -inline bool DataMessage::has_expiretimer() const { - return _internal_has_expiretimer(); -} -inline void DataMessage::clear_expiretimer() { - _impl_.expiretimer_ = 0u; - _impl_._has_bits_[0] &= ~0x00000200u; -} -inline uint32_t DataMessage::_internal_expiretimer() const { - return _impl_.expiretimer_; -} -inline uint32_t DataMessage::expiretimer() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.expireTimer) - return _internal_expiretimer(); -} -inline void DataMessage::_internal_set_expiretimer(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000200u; - _impl_.expiretimer_ = value; -} -inline void DataMessage::set_expiretimer(uint32_t value) { - _internal_set_expiretimer(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.expireTimer) -} - // optional bytes profileKey = 6; inline bool DataMessage::_internal_has_profilekey() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; @@ -10908,7 +10118,7 @@ inline void DataMessage::set_allocated_profilekey(std::string* profilekey) { // optional uint64 timestamp = 7; inline bool DataMessage::_internal_has_timestamp() const { - bool value = (_impl_._has_bits_[0] & 0x00000400u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000100u) != 0; return value; } inline bool DataMessage::has_timestamp() const { @@ -10916,7 +10126,7 @@ inline bool DataMessage::has_timestamp() const { } inline void DataMessage::clear_timestamp() { _impl_.timestamp_ = uint64_t{0u}; - _impl_._has_bits_[0] &= ~0x00000400u; + _impl_._has_bits_[0] &= ~0x00000100u; } inline uint64_t DataMessage::_internal_timestamp() const { return _impl_.timestamp_; @@ -10926,7 +10136,7 @@ inline uint64_t DataMessage::timestamp() const { return _internal_timestamp(); } inline void DataMessage::_internal_set_timestamp(uint64_t value) { - _impl_._has_bits_[0] |= 0x00000400u; + _impl_._has_bits_[0] |= 0x00000100u; _impl_.timestamp_ = value; } inline void DataMessage::set_timestamp(uint64_t value) { @@ -11294,134 +10504,44 @@ inline ::SessionProtos::DataMessage_OpenGroupInvitation* DataMessage::release_op #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::SessionProtos::DataMessage_OpenGroupInvitation* DataMessage::unsafe_arena_release_opengroupinvitation() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.openGroupInvitation) - _impl_._has_bits_[0] &= ~0x00000040u; - ::SessionProtos::DataMessage_OpenGroupInvitation* temp = _impl_.opengroupinvitation_; - _impl_.opengroupinvitation_ = nullptr; - return temp; -} -inline ::SessionProtos::DataMessage_OpenGroupInvitation* DataMessage::_internal_mutable_opengroupinvitation() { - _impl_._has_bits_[0] |= 0x00000040u; - if (_impl_.opengroupinvitation_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::DataMessage_OpenGroupInvitation>(GetArenaForAllocation()); - _impl_.opengroupinvitation_ = p; - } - return _impl_.opengroupinvitation_; -} -inline ::SessionProtos::DataMessage_OpenGroupInvitation* DataMessage::mutable_opengroupinvitation() { - ::SessionProtos::DataMessage_OpenGroupInvitation* _msg = _internal_mutable_opengroupinvitation(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.openGroupInvitation) - return _msg; -} -inline void DataMessage::set_allocated_opengroupinvitation(::SessionProtos::DataMessage_OpenGroupInvitation* opengroupinvitation) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete _impl_.opengroupinvitation_; - } - if (opengroupinvitation) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(opengroupinvitation); - if (message_arena != submessage_arena) { - opengroupinvitation = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, opengroupinvitation, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000040u; - } else { - _impl_._has_bits_[0] &= ~0x00000040u; - } - _impl_.opengroupinvitation_ = opengroupinvitation; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.openGroupInvitation) -} - -// optional .SessionProtos.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; -inline bool DataMessage::_internal_has_closedgroupcontrolmessage() const { - bool value = (_impl_._has_bits_[0] & 0x00000080u) != 0; - PROTOBUF_ASSUME(!value || _impl_.closedgroupcontrolmessage_ != nullptr); - return value; -} -inline bool DataMessage::has_closedgroupcontrolmessage() const { - return _internal_has_closedgroupcontrolmessage(); -} -inline void DataMessage::clear_closedgroupcontrolmessage() { - if (_impl_.closedgroupcontrolmessage_ != nullptr) _impl_.closedgroupcontrolmessage_->Clear(); - _impl_._has_bits_[0] &= ~0x00000080u; -} -inline const ::SessionProtos::DataMessage_ClosedGroupControlMessage& DataMessage::_internal_closedgroupcontrolmessage() const { - const ::SessionProtos::DataMessage_ClosedGroupControlMessage* p = _impl_.closedgroupcontrolmessage_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_DataMessage_ClosedGroupControlMessage_default_instance_); -} -inline const ::SessionProtos::DataMessage_ClosedGroupControlMessage& DataMessage::closedgroupcontrolmessage() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.closedGroupControlMessage) - return _internal_closedgroupcontrolmessage(); -} -inline void DataMessage::unsafe_arena_set_allocated_closedgroupcontrolmessage( - ::SessionProtos::DataMessage_ClosedGroupControlMessage* closedgroupcontrolmessage) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.closedgroupcontrolmessage_); - } - _impl_.closedgroupcontrolmessage_ = closedgroupcontrolmessage; - if (closedgroupcontrolmessage) { - _impl_._has_bits_[0] |= 0x00000080u; - } else { - _impl_._has_bits_[0] &= ~0x00000080u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.DataMessage.closedGroupControlMessage) -} -inline ::SessionProtos::DataMessage_ClosedGroupControlMessage* DataMessage::release_closedgroupcontrolmessage() { - _impl_._has_bits_[0] &= ~0x00000080u; - ::SessionProtos::DataMessage_ClosedGroupControlMessage* temp = _impl_.closedgroupcontrolmessage_; - _impl_.closedgroupcontrolmessage_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return temp; -} -inline ::SessionProtos::DataMessage_ClosedGroupControlMessage* DataMessage::unsafe_arena_release_closedgroupcontrolmessage() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.closedGroupControlMessage) - _impl_._has_bits_[0] &= ~0x00000080u; - ::SessionProtos::DataMessage_ClosedGroupControlMessage* temp = _impl_.closedgroupcontrolmessage_; - _impl_.closedgroupcontrolmessage_ = nullptr; +inline ::SessionProtos::DataMessage_OpenGroupInvitation* DataMessage::unsafe_arena_release_opengroupinvitation() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.openGroupInvitation) + _impl_._has_bits_[0] &= ~0x00000040u; + ::SessionProtos::DataMessage_OpenGroupInvitation* temp = _impl_.opengroupinvitation_; + _impl_.opengroupinvitation_ = nullptr; return temp; } -inline ::SessionProtos::DataMessage_ClosedGroupControlMessage* DataMessage::_internal_mutable_closedgroupcontrolmessage() { - _impl_._has_bits_[0] |= 0x00000080u; - if (_impl_.closedgroupcontrolmessage_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::DataMessage_ClosedGroupControlMessage>(GetArenaForAllocation()); - _impl_.closedgroupcontrolmessage_ = p; +inline ::SessionProtos::DataMessage_OpenGroupInvitation* DataMessage::_internal_mutable_opengroupinvitation() { + _impl_._has_bits_[0] |= 0x00000040u; + if (_impl_.opengroupinvitation_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::DataMessage_OpenGroupInvitation>(GetArenaForAllocation()); + _impl_.opengroupinvitation_ = p; } - return _impl_.closedgroupcontrolmessage_; + return _impl_.opengroupinvitation_; } -inline ::SessionProtos::DataMessage_ClosedGroupControlMessage* DataMessage::mutable_closedgroupcontrolmessage() { - ::SessionProtos::DataMessage_ClosedGroupControlMessage* _msg = _internal_mutable_closedgroupcontrolmessage(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.closedGroupControlMessage) +inline ::SessionProtos::DataMessage_OpenGroupInvitation* DataMessage::mutable_opengroupinvitation() { + ::SessionProtos::DataMessage_OpenGroupInvitation* _msg = _internal_mutable_opengroupinvitation(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.openGroupInvitation) return _msg; } -inline void DataMessage::set_allocated_closedgroupcontrolmessage(::SessionProtos::DataMessage_ClosedGroupControlMessage* closedgroupcontrolmessage) { +inline void DataMessage::set_allocated_opengroupinvitation(::SessionProtos::DataMessage_OpenGroupInvitation* opengroupinvitation) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.closedgroupcontrolmessage_; + delete _impl_.opengroupinvitation_; } - if (closedgroupcontrolmessage) { + if (opengroupinvitation) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(closedgroupcontrolmessage); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(opengroupinvitation); if (message_arena != submessage_arena) { - closedgroupcontrolmessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, closedgroupcontrolmessage, submessage_arena); + opengroupinvitation = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, opengroupinvitation, submessage_arena); } - _impl_._has_bits_[0] |= 0x00000080u; + _impl_._has_bits_[0] |= 0x00000040u; } else { - _impl_._has_bits_[0] &= ~0x00000080u; + _impl_._has_bits_[0] &= ~0x00000040u; } - _impl_.closedgroupcontrolmessage_ = closedgroupcontrolmessage; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.closedGroupControlMessage) + _impl_.opengroupinvitation_ = opengroupinvitation; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.openGroupInvitation) } // optional string syncTarget = 105; @@ -11494,7 +10614,7 @@ inline void DataMessage::set_allocated_synctarget(std::string* synctarget) { // optional bool blocksCommunityMessageRequests = 106; inline bool DataMessage::_internal_has_blockscommunitymessagerequests() const { - bool value = (_impl_._has_bits_[0] & 0x00000800u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000400u) != 0; return value; } inline bool DataMessage::has_blockscommunitymessagerequests() const { @@ -11502,7 +10622,7 @@ inline bool DataMessage::has_blockscommunitymessagerequests() const { } inline void DataMessage::clear_blockscommunitymessagerequests() { _impl_.blockscommunitymessagerequests_ = false; - _impl_._has_bits_[0] &= ~0x00000800u; + _impl_._has_bits_[0] &= ~0x00000400u; } inline bool DataMessage::_internal_blockscommunitymessagerequests() const { return _impl_.blockscommunitymessagerequests_; @@ -11512,7 +10632,7 @@ inline bool DataMessage::blockscommunitymessagerequests() const { return _internal_blockscommunitymessagerequests(); } inline void DataMessage::_internal_set_blockscommunitymessagerequests(bool value) { - _impl_._has_bits_[0] |= 0x00000800u; + _impl_._has_bits_[0] |= 0x00000400u; _impl_.blockscommunitymessagerequests_ = value; } inline void DataMessage::set_blockscommunitymessagerequests(bool value) { @@ -11520,185 +10640,45 @@ inline void DataMessage::set_blockscommunitymessagerequests(bool value) { // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.blocksCommunityMessageRequests) } -// ------------------------------------------------------------------- - -// ConfigurationMessage_ClosedGroup - -// optional bytes publicKey = 1; -inline bool ConfigurationMessage_ClosedGroup::_internal_has_publickey() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - return value; -} -inline bool ConfigurationMessage_ClosedGroup::has_publickey() const { - return _internal_has_publickey(); -} -inline void ConfigurationMessage_ClosedGroup::clear_publickey() { - _impl_.publickey_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const std::string& ConfigurationMessage_ClosedGroup::publickey() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ClosedGroup.publicKey) - return _internal_publickey(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage_ClosedGroup::set_publickey(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.publickey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.publicKey) -} -inline std::string* ConfigurationMessage_ClosedGroup::mutable_publickey() { - std::string* _s = _internal_mutable_publickey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.publicKey) - return _s; -} -inline const std::string& ConfigurationMessage_ClosedGroup::_internal_publickey() const { - return _impl_.publickey_.Get(); -} -inline void ConfigurationMessage_ClosedGroup::_internal_set_publickey(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.publickey_.Set(value, GetArenaForAllocation()); -} -inline std::string* ConfigurationMessage_ClosedGroup::_internal_mutable_publickey() { - _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.publickey_.Mutable(GetArenaForAllocation()); -} -inline std::string* ConfigurationMessage_ClosedGroup::release_publickey() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.ClosedGroup.publicKey) - if (!_internal_has_publickey()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.publickey_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.publickey_.IsDefault()) { - _impl_.publickey_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void ConfigurationMessage_ClosedGroup::set_allocated_publickey(std::string* publickey) { - if (publickey != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - _impl_.publickey_.SetAllocated(publickey, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.publickey_.IsDefault()) { - _impl_.publickey_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.ClosedGroup.publicKey) -} - -// optional string name = 2; -inline bool ConfigurationMessage_ClosedGroup::_internal_has_name() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - return value; -} -inline bool ConfigurationMessage_ClosedGroup::has_name() const { - return _internal_has_name(); -} -inline void ConfigurationMessage_ClosedGroup::clear_name() { - _impl_.name_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000002u; -} -inline const std::string& ConfigurationMessage_ClosedGroup::name() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ClosedGroup.name) - return _internal_name(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage_ClosedGroup::set_name(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.name) -} -inline std::string* ConfigurationMessage_ClosedGroup::mutable_name() { - std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.name) - return _s; -} -inline const std::string& ConfigurationMessage_ClosedGroup::_internal_name() const { - return _impl_.name_.Get(); -} -inline void ConfigurationMessage_ClosedGroup::_internal_set_name(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.name_.Set(value, GetArenaForAllocation()); -} -inline std::string* ConfigurationMessage_ClosedGroup::_internal_mutable_name() { - _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.name_.Mutable(GetArenaForAllocation()); -} -inline std::string* ConfigurationMessage_ClosedGroup::release_name() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.ClosedGroup.name) - if (!_internal_has_name()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.name_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.name_.IsDefault()) { - _impl_.name_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void ConfigurationMessage_ClosedGroup::set_allocated_name(std::string* name) { - if (name != nullptr) { - _impl_._has_bits_[0] |= 0x00000002u; - } else { - _impl_._has_bits_[0] &= ~0x00000002u; - } - _impl_.name_.SetAllocated(name, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.name_.IsDefault()) { - _impl_.name_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.ClosedGroup.name) -} - -// optional .SessionProtos.KeyPair encryptionKeyPair = 3; -inline bool ConfigurationMessage_ClosedGroup::_internal_has_encryptionkeypair() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; - PROTOBUF_ASSUME(!value || _impl_.encryptionkeypair_ != nullptr); +// optional .SessionProtos.GroupUpdateMessage groupUpdateMessage = 120; +inline bool DataMessage::_internal_has_groupupdatemessage() const { + bool value = (_impl_._has_bits_[0] & 0x00000080u) != 0; + PROTOBUF_ASSUME(!value || _impl_.groupupdatemessage_ != nullptr); return value; } -inline bool ConfigurationMessage_ClosedGroup::has_encryptionkeypair() const { - return _internal_has_encryptionkeypair(); +inline bool DataMessage::has_groupupdatemessage() const { + return _internal_has_groupupdatemessage(); } -inline void ConfigurationMessage_ClosedGroup::clear_encryptionkeypair() { - if (_impl_.encryptionkeypair_ != nullptr) _impl_.encryptionkeypair_->Clear(); - _impl_._has_bits_[0] &= ~0x00000004u; +inline void DataMessage::clear_groupupdatemessage() { + if (_impl_.groupupdatemessage_ != nullptr) _impl_.groupupdatemessage_->Clear(); + _impl_._has_bits_[0] &= ~0x00000080u; } -inline const ::SessionProtos::KeyPair& ConfigurationMessage_ClosedGroup::_internal_encryptionkeypair() const { - const ::SessionProtos::KeyPair* p = _impl_.encryptionkeypair_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_KeyPair_default_instance_); +inline const ::SessionProtos::GroupUpdateMessage& DataMessage::_internal_groupupdatemessage() const { + const ::SessionProtos::GroupUpdateMessage* p = _impl_.groupupdatemessage_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_GroupUpdateMessage_default_instance_); } -inline const ::SessionProtos::KeyPair& ConfigurationMessage_ClosedGroup::encryptionkeypair() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ClosedGroup.encryptionKeyPair) - return _internal_encryptionkeypair(); +inline const ::SessionProtos::GroupUpdateMessage& DataMessage::groupupdatemessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.groupUpdateMessage) + return _internal_groupupdatemessage(); } -inline void ConfigurationMessage_ClosedGroup::unsafe_arena_set_allocated_encryptionkeypair( - ::SessionProtos::KeyPair* encryptionkeypair) { +inline void DataMessage::unsafe_arena_set_allocated_groupupdatemessage( + ::SessionProtos::GroupUpdateMessage* groupupdatemessage) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.encryptionkeypair_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.groupupdatemessage_); } - _impl_.encryptionkeypair_ = encryptionkeypair; - if (encryptionkeypair) { - _impl_._has_bits_[0] |= 0x00000004u; + _impl_.groupupdatemessage_ = groupupdatemessage; + if (groupupdatemessage) { + _impl_._has_bits_[0] |= 0x00000080u; } else { - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000080u; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.ConfigurationMessage.ClosedGroup.encryptionKeyPair) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.DataMessage.groupUpdateMessage) } -inline ::SessionProtos::KeyPair* ConfigurationMessage_ClosedGroup::release_encryptionkeypair() { - _impl_._has_bits_[0] &= ~0x00000004u; - ::SessionProtos::KeyPair* temp = _impl_.encryptionkeypair_; - _impl_.encryptionkeypair_ = nullptr; +inline ::SessionProtos::GroupUpdateMessage* DataMessage::release_groupupdatemessage() { + _impl_._has_bits_[0] &= ~0x00000080u; + ::SessionProtos::GroupUpdateMessage* temp = _impl_.groupupdatemessage_; + _impl_.groupupdatemessage_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -11710,986 +10690,1188 @@ inline ::SessionProtos::KeyPair* ConfigurationMessage_ClosedGroup::release_encry #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::SessionProtos::KeyPair* ConfigurationMessage_ClosedGroup::unsafe_arena_release_encryptionkeypair() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.ClosedGroup.encryptionKeyPair) - _impl_._has_bits_[0] &= ~0x00000004u; - ::SessionProtos::KeyPair* temp = _impl_.encryptionkeypair_; - _impl_.encryptionkeypair_ = nullptr; +inline ::SessionProtos::GroupUpdateMessage* DataMessage::unsafe_arena_release_groupupdatemessage() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.groupUpdateMessage) + _impl_._has_bits_[0] &= ~0x00000080u; + ::SessionProtos::GroupUpdateMessage* temp = _impl_.groupupdatemessage_; + _impl_.groupupdatemessage_ = nullptr; return temp; } -inline ::SessionProtos::KeyPair* ConfigurationMessage_ClosedGroup::_internal_mutable_encryptionkeypair() { - _impl_._has_bits_[0] |= 0x00000004u; - if (_impl_.encryptionkeypair_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::KeyPair>(GetArenaForAllocation()); - _impl_.encryptionkeypair_ = p; +inline ::SessionProtos::GroupUpdateMessage* DataMessage::_internal_mutable_groupupdatemessage() { + _impl_._has_bits_[0] |= 0x00000080u; + if (_impl_.groupupdatemessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::GroupUpdateMessage>(GetArenaForAllocation()); + _impl_.groupupdatemessage_ = p; } - return _impl_.encryptionkeypair_; + return _impl_.groupupdatemessage_; } -inline ::SessionProtos::KeyPair* ConfigurationMessage_ClosedGroup::mutable_encryptionkeypair() { - ::SessionProtos::KeyPair* _msg = _internal_mutable_encryptionkeypair(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.encryptionKeyPair) +inline ::SessionProtos::GroupUpdateMessage* DataMessage::mutable_groupupdatemessage() { + ::SessionProtos::GroupUpdateMessage* _msg = _internal_mutable_groupupdatemessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.groupUpdateMessage) return _msg; } -inline void ConfigurationMessage_ClosedGroup::set_allocated_encryptionkeypair(::SessionProtos::KeyPair* encryptionkeypair) { +inline void DataMessage::set_allocated_groupupdatemessage(::SessionProtos::GroupUpdateMessage* groupupdatemessage) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.encryptionkeypair_; + delete _impl_.groupupdatemessage_; } - if (encryptionkeypair) { + if (groupupdatemessage) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(encryptionkeypair); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(groupupdatemessage); if (message_arena != submessage_arena) { - encryptionkeypair = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, encryptionkeypair, submessage_arena); + groupupdatemessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, groupupdatemessage, submessage_arena); } - _impl_._has_bits_[0] |= 0x00000004u; + _impl_._has_bits_[0] |= 0x00000080u; } else { - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000080u; } - _impl_.encryptionkeypair_ = encryptionkeypair; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.ClosedGroup.encryptionKeyPair) + _impl_.groupupdatemessage_ = groupupdatemessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.groupUpdateMessage) } -// repeated bytes members = 4; -inline int ConfigurationMessage_ClosedGroup::_internal_members_size() const { - return _impl_.members_.size(); -} -inline int ConfigurationMessage_ClosedGroup::members_size() const { - return _internal_members_size(); -} -inline void ConfigurationMessage_ClosedGroup::clear_members() { - _impl_.members_.Clear(); -} -inline std::string* ConfigurationMessage_ClosedGroup::add_members() { - std::string* _s = _internal_add_members(); - // @@protoc_insertion_point(field_add_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.members) - return _s; -} -inline const std::string& ConfigurationMessage_ClosedGroup::_internal_members(int index) const { - return _impl_.members_.Get(index); -} -inline const std::string& ConfigurationMessage_ClosedGroup::members(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ClosedGroup.members) - return _internal_members(index); -} -inline std::string* ConfigurationMessage_ClosedGroup::mutable_members(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.members) - return _impl_.members_.Mutable(index); -} -inline void ConfigurationMessage_ClosedGroup::set_members(int index, const std::string& value) { - _impl_.members_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.members) -} -inline void ConfigurationMessage_ClosedGroup::set_members(int index, std::string&& value) { - _impl_.members_.Mutable(index)->assign(std::move(value)); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.members) -} -inline void ConfigurationMessage_ClosedGroup::set_members(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.members_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:SessionProtos.ConfigurationMessage.ClosedGroup.members) -} -inline void ConfigurationMessage_ClosedGroup::set_members(int index, const void* value, size_t size) { - _impl_.members_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:SessionProtos.ConfigurationMessage.ClosedGroup.members) -} -inline std::string* ConfigurationMessage_ClosedGroup::_internal_add_members() { - return _impl_.members_.Add(); +// ------------------------------------------------------------------- + +// ReceiptMessage + +// required .SessionProtos.ReceiptMessage.Type type = 1; +inline bool ReceiptMessage::_internal_has_type() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; } -inline void ConfigurationMessage_ClosedGroup::add_members(const std::string& value) { - _impl_.members_.Add()->assign(value); - // @@protoc_insertion_point(field_add:SessionProtos.ConfigurationMessage.ClosedGroup.members) +inline bool ReceiptMessage::has_type() const { + return _internal_has_type(); } -inline void ConfigurationMessage_ClosedGroup::add_members(std::string&& value) { - _impl_.members_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:SessionProtos.ConfigurationMessage.ClosedGroup.members) +inline void ReceiptMessage::clear_type() { + _impl_.type_ = 0; + _impl_._has_bits_[0] &= ~0x00000001u; } -inline void ConfigurationMessage_ClosedGroup::add_members(const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.members_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:SessionProtos.ConfigurationMessage.ClosedGroup.members) +inline ::SessionProtos::ReceiptMessage_Type ReceiptMessage::_internal_type() const { + return static_cast< ::SessionProtos::ReceiptMessage_Type >(_impl_.type_); } -inline void ConfigurationMessage_ClosedGroup::add_members(const void* value, size_t size) { - _impl_.members_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:SessionProtos.ConfigurationMessage.ClosedGroup.members) +inline ::SessionProtos::ReceiptMessage_Type ReceiptMessage::type() const { + // @@protoc_insertion_point(field_get:SessionProtos.ReceiptMessage.type) + return _internal_type(); } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -ConfigurationMessage_ClosedGroup::members() const { - // @@protoc_insertion_point(field_list:SessionProtos.ConfigurationMessage.ClosedGroup.members) - return _impl_.members_; +inline void ReceiptMessage::_internal_set_type(::SessionProtos::ReceiptMessage_Type value) { + assert(::SessionProtos::ReceiptMessage_Type_IsValid(value)); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.type_ = value; } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -ConfigurationMessage_ClosedGroup::mutable_members() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.ConfigurationMessage.ClosedGroup.members) - return &_impl_.members_; +inline void ReceiptMessage::set_type(::SessionProtos::ReceiptMessage_Type value) { + _internal_set_type(value); + // @@protoc_insertion_point(field_set:SessionProtos.ReceiptMessage.type) } -// repeated bytes admins = 5; -inline int ConfigurationMessage_ClosedGroup::_internal_admins_size() const { - return _impl_.admins_.size(); -} -inline int ConfigurationMessage_ClosedGroup::admins_size() const { - return _internal_admins_size(); -} -inline void ConfigurationMessage_ClosedGroup::clear_admins() { - _impl_.admins_.Clear(); -} -inline std::string* ConfigurationMessage_ClosedGroup::add_admins() { - std::string* _s = _internal_add_admins(); - // @@protoc_insertion_point(field_add_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.admins) - return _s; -} -inline const std::string& ConfigurationMessage_ClosedGroup::_internal_admins(int index) const { - return _impl_.admins_.Get(index); -} -inline const std::string& ConfigurationMessage_ClosedGroup::admins(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ClosedGroup.admins) - return _internal_admins(index); -} -inline std::string* ConfigurationMessage_ClosedGroup::mutable_admins(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.admins) - return _impl_.admins_.Mutable(index); +// repeated uint64 timestamp = 2; +inline int ReceiptMessage::_internal_timestamp_size() const { + return _impl_.timestamp_.size(); } -inline void ConfigurationMessage_ClosedGroup::set_admins(int index, const std::string& value) { - _impl_.admins_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.admins) +inline int ReceiptMessage::timestamp_size() const { + return _internal_timestamp_size(); } -inline void ConfigurationMessage_ClosedGroup::set_admins(int index, std::string&& value) { - _impl_.admins_.Mutable(index)->assign(std::move(value)); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.admins) +inline void ReceiptMessage::clear_timestamp() { + _impl_.timestamp_.Clear(); } -inline void ConfigurationMessage_ClosedGroup::set_admins(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.admins_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:SessionProtos.ConfigurationMessage.ClosedGroup.admins) +inline uint64_t ReceiptMessage::_internal_timestamp(int index) const { + return _impl_.timestamp_.Get(index); } -inline void ConfigurationMessage_ClosedGroup::set_admins(int index, const void* value, size_t size) { - _impl_.admins_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:SessionProtos.ConfigurationMessage.ClosedGroup.admins) +inline uint64_t ReceiptMessage::timestamp(int index) const { + // @@protoc_insertion_point(field_get:SessionProtos.ReceiptMessage.timestamp) + return _internal_timestamp(index); } -inline std::string* ConfigurationMessage_ClosedGroup::_internal_add_admins() { - return _impl_.admins_.Add(); +inline void ReceiptMessage::set_timestamp(int index, uint64_t value) { + _impl_.timestamp_.Set(index, value); + // @@protoc_insertion_point(field_set:SessionProtos.ReceiptMessage.timestamp) } -inline void ConfigurationMessage_ClosedGroup::add_admins(const std::string& value) { - _impl_.admins_.Add()->assign(value); - // @@protoc_insertion_point(field_add:SessionProtos.ConfigurationMessage.ClosedGroup.admins) +inline void ReceiptMessage::_internal_add_timestamp(uint64_t value) { + _impl_.timestamp_.Add(value); } -inline void ConfigurationMessage_ClosedGroup::add_admins(std::string&& value) { - _impl_.admins_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:SessionProtos.ConfigurationMessage.ClosedGroup.admins) +inline void ReceiptMessage::add_timestamp(uint64_t value) { + _internal_add_timestamp(value); + // @@protoc_insertion_point(field_add:SessionProtos.ReceiptMessage.timestamp) } -inline void ConfigurationMessage_ClosedGroup::add_admins(const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.admins_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:SessionProtos.ConfigurationMessage.ClosedGroup.admins) +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& +ReceiptMessage::_internal_timestamp() const { + return _impl_.timestamp_; } -inline void ConfigurationMessage_ClosedGroup::add_admins(const void* value, size_t size) { - _impl_.admins_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:SessionProtos.ConfigurationMessage.ClosedGroup.admins) +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& +ReceiptMessage::timestamp() const { + // @@protoc_insertion_point(field_list:SessionProtos.ReceiptMessage.timestamp) + return _internal_timestamp(); } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -ConfigurationMessage_ClosedGroup::admins() const { - // @@protoc_insertion_point(field_list:SessionProtos.ConfigurationMessage.ClosedGroup.admins) - return _impl_.admins_; +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* +ReceiptMessage::_internal_mutable_timestamp() { + return &_impl_.timestamp_; } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -ConfigurationMessage_ClosedGroup::mutable_admins() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.ConfigurationMessage.ClosedGroup.admins) - return &_impl_.admins_; +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* +ReceiptMessage::mutable_timestamp() { + // @@protoc_insertion_point(field_mutable_list:SessionProtos.ReceiptMessage.timestamp) + return _internal_mutable_timestamp(); } -// optional uint32 expirationTimer = 6; -inline bool ConfigurationMessage_ClosedGroup::_internal_has_expirationtimer() const { - bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; +// ------------------------------------------------------------------- + +// AttachmentPointer + +// required fixed64 id = 1; +inline bool AttachmentPointer::_internal_has_id() const { + bool value = (_impl_._has_bits_[0] & 0x00000080u) != 0; return value; } -inline bool ConfigurationMessage_ClosedGroup::has_expirationtimer() const { - return _internal_has_expirationtimer(); +inline bool AttachmentPointer::has_id() const { + return _internal_has_id(); } -inline void ConfigurationMessage_ClosedGroup::clear_expirationtimer() { - _impl_.expirationtimer_ = 0u; - _impl_._has_bits_[0] &= ~0x00000008u; +inline void AttachmentPointer::clear_id() { + _impl_.id_ = uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000080u; } -inline uint32_t ConfigurationMessage_ClosedGroup::_internal_expirationtimer() const { - return _impl_.expirationtimer_; +inline uint64_t AttachmentPointer::_internal_id() const { + return _impl_.id_; } -inline uint32_t ConfigurationMessage_ClosedGroup::expirationtimer() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ClosedGroup.expirationTimer) - return _internal_expirationtimer(); +inline uint64_t AttachmentPointer::id() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.id) + return _internal_id(); } -inline void ConfigurationMessage_ClosedGroup::_internal_set_expirationtimer(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000008u; - _impl_.expirationtimer_ = value; +inline void AttachmentPointer::_internal_set_id(uint64_t value) { + _impl_._has_bits_[0] |= 0x00000080u; + _impl_.id_ = value; } -inline void ConfigurationMessage_ClosedGroup::set_expirationtimer(uint32_t value) { - _internal_set_expirationtimer(value); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.expirationTimer) +inline void AttachmentPointer::set_id(uint64_t value) { + _internal_set_id(value); + // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.id) } -// ------------------------------------------------------------------- - -// ConfigurationMessage_Contact - -// required bytes publicKey = 1; -inline bool ConfigurationMessage_Contact::_internal_has_publickey() const { +// optional string contentType = 2; +inline bool AttachmentPointer::_internal_has_contenttype() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool ConfigurationMessage_Contact::has_publickey() const { - return _internal_has_publickey(); +inline bool AttachmentPointer::has_contenttype() const { + return _internal_has_contenttype(); } -inline void ConfigurationMessage_Contact::clear_publickey() { - _impl_.publickey_.ClearToEmpty(); +inline void AttachmentPointer::clear_contenttype() { + _impl_.contenttype_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& ConfigurationMessage_Contact::publickey() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.publicKey) - return _internal_publickey(); +inline const std::string& AttachmentPointer::contenttype() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.contentType) + return _internal_contenttype(); } template inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage_Contact::set_publickey(ArgT0&& arg0, ArgT... args) { +void AttachmentPointer::set_contenttype(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.publickey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.publicKey) + _impl_.contenttype_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.contentType) } -inline std::string* ConfigurationMessage_Contact::mutable_publickey() { - std::string* _s = _internal_mutable_publickey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.Contact.publicKey) +inline std::string* AttachmentPointer::mutable_contenttype() { + std::string* _s = _internal_mutable_contenttype(); + // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.contentType) return _s; } -inline const std::string& ConfigurationMessage_Contact::_internal_publickey() const { - return _impl_.publickey_.Get(); +inline const std::string& AttachmentPointer::_internal_contenttype() const { + return _impl_.contenttype_.Get(); } -inline void ConfigurationMessage_Contact::_internal_set_publickey(const std::string& value) { +inline void AttachmentPointer::_internal_set_contenttype(const std::string& value) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.publickey_.Set(value, GetArenaForAllocation()); + _impl_.contenttype_.Set(value, GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_Contact::_internal_mutable_publickey() { +inline std::string* AttachmentPointer::_internal_mutable_contenttype() { _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.publickey_.Mutable(GetArenaForAllocation()); + return _impl_.contenttype_.Mutable(GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_Contact::release_publickey() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.Contact.publicKey) - if (!_internal_has_publickey()) { +inline std::string* AttachmentPointer::release_contenttype() { + // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.contentType) + if (!_internal_has_contenttype()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.publickey_.Release(); + auto* p = _impl_.contenttype_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.publickey_.IsDefault()) { - _impl_.publickey_.Set("", GetArenaForAllocation()); + if (_impl_.contenttype_.IsDefault()) { + _impl_.contenttype_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void ConfigurationMessage_Contact::set_allocated_publickey(std::string* publickey) { - if (publickey != nullptr) { +inline void AttachmentPointer::set_allocated_contenttype(std::string* contenttype) { + if (contenttype != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; } else { _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.publickey_.SetAllocated(publickey, GetArenaForAllocation()); + _impl_.contenttype_.SetAllocated(contenttype, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.publickey_.IsDefault()) { - _impl_.publickey_.Set("", GetArenaForAllocation()); + if (_impl_.contenttype_.IsDefault()) { + _impl_.contenttype_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.Contact.publicKey) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.contentType) } -// required string name = 2; -inline bool ConfigurationMessage_Contact::_internal_has_name() const { +// optional bytes key = 3; +inline bool AttachmentPointer::_internal_has_key() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } -inline bool ConfigurationMessage_Contact::has_name() const { - return _internal_has_name(); +inline bool AttachmentPointer::has_key() const { + return _internal_has_key(); } -inline void ConfigurationMessage_Contact::clear_name() { - _impl_.name_.ClearToEmpty(); +inline void AttachmentPointer::clear_key() { + _impl_.key_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000002u; } -inline const std::string& ConfigurationMessage_Contact::name() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.name) - return _internal_name(); +inline const std::string& AttachmentPointer::key() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.key) + return _internal_key(); } template inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage_Contact::set_name(ArgT0&& arg0, ArgT... args) { +void AttachmentPointer::set_key(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.name) + _impl_.key_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.key) } -inline std::string* ConfigurationMessage_Contact::mutable_name() { - std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.Contact.name) +inline std::string* AttachmentPointer::mutable_key() { + std::string* _s = _internal_mutable_key(); + // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.key) return _s; } -inline const std::string& ConfigurationMessage_Contact::_internal_name() const { - return _impl_.name_.Get(); +inline const std::string& AttachmentPointer::_internal_key() const { + return _impl_.key_.Get(); } -inline void ConfigurationMessage_Contact::_internal_set_name(const std::string& value) { +inline void AttachmentPointer::_internal_set_key(const std::string& value) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.name_.Set(value, GetArenaForAllocation()); + _impl_.key_.Set(value, GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_Contact::_internal_mutable_name() { +inline std::string* AttachmentPointer::_internal_mutable_key() { _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.name_.Mutable(GetArenaForAllocation()); + return _impl_.key_.Mutable(GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_Contact::release_name() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.Contact.name) - if (!_internal_has_name()) { +inline std::string* AttachmentPointer::release_key() { + // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.key) + if (!_internal_has_key()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.name_.Release(); + auto* p = _impl_.key_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.name_.IsDefault()) { - _impl_.name_.Set("", GetArenaForAllocation()); + if (_impl_.key_.IsDefault()) { + _impl_.key_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void ConfigurationMessage_Contact::set_allocated_name(std::string* name) { - if (name != nullptr) { +inline void AttachmentPointer::set_allocated_key(std::string* key) { + if (key != nullptr) { _impl_._has_bits_[0] |= 0x00000002u; } else { _impl_._has_bits_[0] &= ~0x00000002u; } - _impl_.name_.SetAllocated(name, GetArenaForAllocation()); + _impl_.key_.SetAllocated(key, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.name_.IsDefault()) { - _impl_.name_.Set("", GetArenaForAllocation()); + if (_impl_.key_.IsDefault()) { + _impl_.key_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.Contact.name) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.key) +} + +// optional uint32 size = 4; +inline bool AttachmentPointer::_internal_has_size() const { + bool value = (_impl_._has_bits_[0] & 0x00000100u) != 0; + return value; +} +inline bool AttachmentPointer::has_size() const { + return _internal_has_size(); +} +inline void AttachmentPointer::clear_size() { + _impl_.size_ = 0u; + _impl_._has_bits_[0] &= ~0x00000100u; +} +inline uint32_t AttachmentPointer::_internal_size() const { + return _impl_.size_; +} +inline uint32_t AttachmentPointer::size() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.size) + return _internal_size(); +} +inline void AttachmentPointer::_internal_set_size(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000100u; + _impl_.size_ = value; +} +inline void AttachmentPointer::set_size(uint32_t value) { + _internal_set_size(value); + // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.size) } -// optional string profilePicture = 3; -inline bool ConfigurationMessage_Contact::_internal_has_profilepicture() const { +// optional bytes thumbnail = 5; +inline bool AttachmentPointer::_internal_has_thumbnail() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } -inline bool ConfigurationMessage_Contact::has_profilepicture() const { - return _internal_has_profilepicture(); +inline bool AttachmentPointer::has_thumbnail() const { + return _internal_has_thumbnail(); } -inline void ConfigurationMessage_Contact::clear_profilepicture() { - _impl_.profilepicture_.ClearToEmpty(); +inline void AttachmentPointer::clear_thumbnail() { + _impl_.thumbnail_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000004u; } -inline const std::string& ConfigurationMessage_Contact::profilepicture() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.profilePicture) - return _internal_profilepicture(); +inline const std::string& AttachmentPointer::thumbnail() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.thumbnail) + return _internal_thumbnail(); } template inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage_Contact::set_profilepicture(ArgT0&& arg0, ArgT... args) { +void AttachmentPointer::set_thumbnail(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000004u; - _impl_.profilepicture_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.profilePicture) + _impl_.thumbnail_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.thumbnail) } -inline std::string* ConfigurationMessage_Contact::mutable_profilepicture() { - std::string* _s = _internal_mutable_profilepicture(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.Contact.profilePicture) +inline std::string* AttachmentPointer::mutable_thumbnail() { + std::string* _s = _internal_mutable_thumbnail(); + // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.thumbnail) return _s; } -inline const std::string& ConfigurationMessage_Contact::_internal_profilepicture() const { - return _impl_.profilepicture_.Get(); +inline const std::string& AttachmentPointer::_internal_thumbnail() const { + return _impl_.thumbnail_.Get(); } -inline void ConfigurationMessage_Contact::_internal_set_profilepicture(const std::string& value) { +inline void AttachmentPointer::_internal_set_thumbnail(const std::string& value) { _impl_._has_bits_[0] |= 0x00000004u; - _impl_.profilepicture_.Set(value, GetArenaForAllocation()); + _impl_.thumbnail_.Set(value, GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_Contact::_internal_mutable_profilepicture() { +inline std::string* AttachmentPointer::_internal_mutable_thumbnail() { _impl_._has_bits_[0] |= 0x00000004u; - return _impl_.profilepicture_.Mutable(GetArenaForAllocation()); + return _impl_.thumbnail_.Mutable(GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_Contact::release_profilepicture() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.Contact.profilePicture) - if (!_internal_has_profilepicture()) { +inline std::string* AttachmentPointer::release_thumbnail() { + // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.thumbnail) + if (!_internal_has_thumbnail()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000004u; - auto* p = _impl_.profilepicture_.Release(); + auto* p = _impl_.thumbnail_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilepicture_.IsDefault()) { - _impl_.profilepicture_.Set("", GetArenaForAllocation()); + if (_impl_.thumbnail_.IsDefault()) { + _impl_.thumbnail_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void AttachmentPointer::set_allocated_thumbnail(std::string* thumbnail) { + if (thumbnail != nullptr) { + _impl_._has_bits_[0] |= 0x00000004u; + } else { + _impl_._has_bits_[0] &= ~0x00000004u; + } + _impl_.thumbnail_.SetAllocated(thumbnail, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.thumbnail_.IsDefault()) { + _impl_.thumbnail_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.thumbnail) +} + +// optional bytes digest = 6; +inline bool AttachmentPointer::_internal_has_digest() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + return value; +} +inline bool AttachmentPointer::has_digest() const { + return _internal_has_digest(); +} +inline void AttachmentPointer::clear_digest() { + _impl_.digest_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000008u; +} +inline const std::string& AttachmentPointer::digest() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.digest) + return _internal_digest(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void AttachmentPointer::set_digest(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.digest_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.digest) +} +inline std::string* AttachmentPointer::mutable_digest() { + std::string* _s = _internal_mutable_digest(); + // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.digest) + return _s; +} +inline const std::string& AttachmentPointer::_internal_digest() const { + return _impl_.digest_.Get(); +} +inline void AttachmentPointer::_internal_set_digest(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.digest_.Set(value, GetArenaForAllocation()); +} +inline std::string* AttachmentPointer::_internal_mutable_digest() { + _impl_._has_bits_[0] |= 0x00000008u; + return _impl_.digest_.Mutable(GetArenaForAllocation()); +} +inline std::string* AttachmentPointer::release_digest() { + // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.digest) + if (!_internal_has_digest()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000008u; + auto* p = _impl_.digest_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.digest_.IsDefault()) { + _impl_.digest_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void ConfigurationMessage_Contact::set_allocated_profilepicture(std::string* profilepicture) { - if (profilepicture != nullptr) { - _impl_._has_bits_[0] |= 0x00000004u; +inline void AttachmentPointer::set_allocated_digest(std::string* digest) { + if (digest != nullptr) { + _impl_._has_bits_[0] |= 0x00000008u; } else { - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000008u; } - _impl_.profilepicture_.SetAllocated(profilepicture, GetArenaForAllocation()); + _impl_.digest_.SetAllocated(digest, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilepicture_.IsDefault()) { - _impl_.profilepicture_.Set("", GetArenaForAllocation()); + if (_impl_.digest_.IsDefault()) { + _impl_.digest_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.Contact.profilePicture) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.digest) } -// optional bytes profileKey = 4; -inline bool ConfigurationMessage_Contact::_internal_has_profilekey() const { - bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; +// optional string fileName = 7; +inline bool AttachmentPointer::_internal_has_filename() const { + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; return value; } -inline bool ConfigurationMessage_Contact::has_profilekey() const { - return _internal_has_profilekey(); +inline bool AttachmentPointer::has_filename() const { + return _internal_has_filename(); } -inline void ConfigurationMessage_Contact::clear_profilekey() { - _impl_.profilekey_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000008u; +inline void AttachmentPointer::clear_filename() { + _impl_.filename_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000010u; } -inline const std::string& ConfigurationMessage_Contact::profilekey() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.profileKey) - return _internal_profilekey(); +inline const std::string& AttachmentPointer::filename() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.fileName) + return _internal_filename(); } template inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage_Contact::set_profilekey(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000008u; - _impl_.profilekey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.profileKey) +void AttachmentPointer::set_filename(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.filename_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.fileName) } -inline std::string* ConfigurationMessage_Contact::mutable_profilekey() { - std::string* _s = _internal_mutable_profilekey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.Contact.profileKey) +inline std::string* AttachmentPointer::mutable_filename() { + std::string* _s = _internal_mutable_filename(); + // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.fileName) return _s; } -inline const std::string& ConfigurationMessage_Contact::_internal_profilekey() const { - return _impl_.profilekey_.Get(); +inline const std::string& AttachmentPointer::_internal_filename() const { + return _impl_.filename_.Get(); } -inline void ConfigurationMessage_Contact::_internal_set_profilekey(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000008u; - _impl_.profilekey_.Set(value, GetArenaForAllocation()); +inline void AttachmentPointer::_internal_set_filename(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.filename_.Set(value, GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_Contact::_internal_mutable_profilekey() { - _impl_._has_bits_[0] |= 0x00000008u; - return _impl_.profilekey_.Mutable(GetArenaForAllocation()); +inline std::string* AttachmentPointer::_internal_mutable_filename() { + _impl_._has_bits_[0] |= 0x00000010u; + return _impl_.filename_.Mutable(GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_Contact::release_profilekey() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.Contact.profileKey) - if (!_internal_has_profilekey()) { +inline std::string* AttachmentPointer::release_filename() { + // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.fileName) + if (!_internal_has_filename()) { return nullptr; } - _impl_._has_bits_[0] &= ~0x00000008u; - auto* p = _impl_.profilekey_.Release(); + _impl_._has_bits_[0] &= ~0x00000010u; + auto* p = _impl_.filename_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilekey_.IsDefault()) { - _impl_.profilekey_.Set("", GetArenaForAllocation()); + if (_impl_.filename_.IsDefault()) { + _impl_.filename_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void ConfigurationMessage_Contact::set_allocated_profilekey(std::string* profilekey) { - if (profilekey != nullptr) { - _impl_._has_bits_[0] |= 0x00000008u; +inline void AttachmentPointer::set_allocated_filename(std::string* filename) { + if (filename != nullptr) { + _impl_._has_bits_[0] |= 0x00000010u; } else { - _impl_._has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000010u; } - _impl_.profilekey_.SetAllocated(profilekey, GetArenaForAllocation()); + _impl_.filename_.SetAllocated(filename, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilekey_.IsDefault()) { - _impl_.profilekey_.Set("", GetArenaForAllocation()); + if (_impl_.filename_.IsDefault()) { + _impl_.filename_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.Contact.profileKey) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.fileName) } -// optional bool isApproved = 5; -inline bool ConfigurationMessage_Contact::_internal_has_isapproved() const { - bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; +// optional uint32 flags = 8; +inline bool AttachmentPointer::_internal_has_flags() const { + bool value = (_impl_._has_bits_[0] & 0x00000200u) != 0; return value; } -inline bool ConfigurationMessage_Contact::has_isapproved() const { - return _internal_has_isapproved(); +inline bool AttachmentPointer::has_flags() const { + return _internal_has_flags(); } -inline void ConfigurationMessage_Contact::clear_isapproved() { - _impl_.isapproved_ = false; - _impl_._has_bits_[0] &= ~0x00000010u; +inline void AttachmentPointer::clear_flags() { + _impl_.flags_ = 0u; + _impl_._has_bits_[0] &= ~0x00000200u; } -inline bool ConfigurationMessage_Contact::_internal_isapproved() const { - return _impl_.isapproved_; +inline uint32_t AttachmentPointer::_internal_flags() const { + return _impl_.flags_; } -inline bool ConfigurationMessage_Contact::isapproved() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.isApproved) - return _internal_isapproved(); +inline uint32_t AttachmentPointer::flags() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.flags) + return _internal_flags(); } -inline void ConfigurationMessage_Contact::_internal_set_isapproved(bool value) { - _impl_._has_bits_[0] |= 0x00000010u; - _impl_.isapproved_ = value; +inline void AttachmentPointer::_internal_set_flags(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000200u; + _impl_.flags_ = value; } -inline void ConfigurationMessage_Contact::set_isapproved(bool value) { - _internal_set_isapproved(value); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.isApproved) +inline void AttachmentPointer::set_flags(uint32_t value) { + _internal_set_flags(value); + // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.flags) +} + +// optional uint32 width = 9; +inline bool AttachmentPointer::_internal_has_width() const { + bool value = (_impl_._has_bits_[0] & 0x00000400u) != 0; + return value; +} +inline bool AttachmentPointer::has_width() const { + return _internal_has_width(); +} +inline void AttachmentPointer::clear_width() { + _impl_.width_ = 0u; + _impl_._has_bits_[0] &= ~0x00000400u; +} +inline uint32_t AttachmentPointer::_internal_width() const { + return _impl_.width_; +} +inline uint32_t AttachmentPointer::width() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.width) + return _internal_width(); +} +inline void AttachmentPointer::_internal_set_width(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000400u; + _impl_.width_ = value; +} +inline void AttachmentPointer::set_width(uint32_t value) { + _internal_set_width(value); + // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.width) +} + +// optional uint32 height = 10; +inline bool AttachmentPointer::_internal_has_height() const { + bool value = (_impl_._has_bits_[0] & 0x00000800u) != 0; + return value; +} +inline bool AttachmentPointer::has_height() const { + return _internal_has_height(); +} +inline void AttachmentPointer::clear_height() { + _impl_.height_ = 0u; + _impl_._has_bits_[0] &= ~0x00000800u; +} +inline uint32_t AttachmentPointer::_internal_height() const { + return _impl_.height_; +} +inline uint32_t AttachmentPointer::height() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.height) + return _internal_height(); +} +inline void AttachmentPointer::_internal_set_height(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000800u; + _impl_.height_ = value; +} +inline void AttachmentPointer::set_height(uint32_t value) { + _internal_set_height(value); + // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.height) } -// optional bool isBlocked = 6; -inline bool ConfigurationMessage_Contact::_internal_has_isblocked() const { +// optional string caption = 11; +inline bool AttachmentPointer::_internal_has_caption() const { bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; return value; } -inline bool ConfigurationMessage_Contact::has_isblocked() const { - return _internal_has_isblocked(); +inline bool AttachmentPointer::has_caption() const { + return _internal_has_caption(); } -inline void ConfigurationMessage_Contact::clear_isblocked() { - _impl_.isblocked_ = false; +inline void AttachmentPointer::clear_caption() { + _impl_.caption_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000020u; } -inline bool ConfigurationMessage_Contact::_internal_isblocked() const { - return _impl_.isblocked_; +inline const std::string& AttachmentPointer::caption() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.caption) + return _internal_caption(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void AttachmentPointer::set_caption(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000020u; + _impl_.caption_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.caption) +} +inline std::string* AttachmentPointer::mutable_caption() { + std::string* _s = _internal_mutable_caption(); + // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.caption) + return _s; +} +inline const std::string& AttachmentPointer::_internal_caption() const { + return _impl_.caption_.Get(); } -inline bool ConfigurationMessage_Contact::isblocked() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.isBlocked) - return _internal_isblocked(); +inline void AttachmentPointer::_internal_set_caption(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000020u; + _impl_.caption_.Set(value, GetArenaForAllocation()); } -inline void ConfigurationMessage_Contact::_internal_set_isblocked(bool value) { +inline std::string* AttachmentPointer::_internal_mutable_caption() { _impl_._has_bits_[0] |= 0x00000020u; - _impl_.isblocked_ = value; + return _impl_.caption_.Mutable(GetArenaForAllocation()); +} +inline std::string* AttachmentPointer::release_caption() { + // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.caption) + if (!_internal_has_caption()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000020u; + auto* p = _impl_.caption_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.caption_.IsDefault()) { + _impl_.caption_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; } -inline void ConfigurationMessage_Contact::set_isblocked(bool value) { - _internal_set_isblocked(value); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.isBlocked) +inline void AttachmentPointer::set_allocated_caption(std::string* caption) { + if (caption != nullptr) { + _impl_._has_bits_[0] |= 0x00000020u; + } else { + _impl_._has_bits_[0] &= ~0x00000020u; + } + _impl_.caption_.SetAllocated(caption, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.caption_.IsDefault()) { + _impl_.caption_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.caption) } -// optional bool didApproveMe = 7; -inline bool ConfigurationMessage_Contact::_internal_has_didapproveme() const { +// optional string url = 101; +inline bool AttachmentPointer::_internal_has_url() const { bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; return value; } -inline bool ConfigurationMessage_Contact::has_didapproveme() const { - return _internal_has_didapproveme(); +inline bool AttachmentPointer::has_url() const { + return _internal_has_url(); } -inline void ConfigurationMessage_Contact::clear_didapproveme() { - _impl_.didapproveme_ = false; +inline void AttachmentPointer::clear_url() { + _impl_.url_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000040u; } -inline bool ConfigurationMessage_Contact::_internal_didapproveme() const { - return _impl_.didapproveme_; +inline const std::string& AttachmentPointer::url() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.url) + return _internal_url(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void AttachmentPointer::set_url(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000040u; + _impl_.url_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.url) +} +inline std::string* AttachmentPointer::mutable_url() { + std::string* _s = _internal_mutable_url(); + // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.url) + return _s; +} +inline const std::string& AttachmentPointer::_internal_url() const { + return _impl_.url_.Get(); } -inline bool ConfigurationMessage_Contact::didapproveme() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.didApproveMe) - return _internal_didapproveme(); +inline void AttachmentPointer::_internal_set_url(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000040u; + _impl_.url_.Set(value, GetArenaForAllocation()); } -inline void ConfigurationMessage_Contact::_internal_set_didapproveme(bool value) { +inline std::string* AttachmentPointer::_internal_mutable_url() { _impl_._has_bits_[0] |= 0x00000040u; - _impl_.didapproveme_ = value; + return _impl_.url_.Mutable(GetArenaForAllocation()); +} +inline std::string* AttachmentPointer::release_url() { + // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.url) + if (!_internal_has_url()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000040u; + auto* p = _impl_.url_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.url_.IsDefault()) { + _impl_.url_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; } -inline void ConfigurationMessage_Contact::set_didapproveme(bool value) { - _internal_set_didapproveme(value); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.didApproveMe) +inline void AttachmentPointer::set_allocated_url(std::string* url) { + if (url != nullptr) { + _impl_._has_bits_[0] |= 0x00000040u; + } else { + _impl_._has_bits_[0] &= ~0x00000040u; + } + _impl_.url_.SetAllocated(url, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.url_.IsDefault()) { + _impl_.url_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.url) } // ------------------------------------------------------------------- -// ConfigurationMessage +// SharedConfigMessage -// repeated .SessionProtos.ConfigurationMessage.ClosedGroup closedGroups = 1; -inline int ConfigurationMessage::_internal_closedgroups_size() const { - return _impl_.closedgroups_.size(); -} -inline int ConfigurationMessage::closedgroups_size() const { - return _internal_closedgroups_size(); -} -inline void ConfigurationMessage::clear_closedgroups() { - _impl_.closedgroups_.Clear(); -} -inline ::SessionProtos::ConfigurationMessage_ClosedGroup* ConfigurationMessage::mutable_closedgroups(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.closedGroups) - return _impl_.closedgroups_.Mutable(index); +// required .SessionProtos.SharedConfigMessage.Kind kind = 1; +inline bool SharedConfigMessage::_internal_has_kind() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_ClosedGroup >* -ConfigurationMessage::mutable_closedgroups() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.ConfigurationMessage.closedGroups) - return &_impl_.closedgroups_; +inline bool SharedConfigMessage::has_kind() const { + return _internal_has_kind(); } -inline const ::SessionProtos::ConfigurationMessage_ClosedGroup& ConfigurationMessage::_internal_closedgroups(int index) const { - return _impl_.closedgroups_.Get(index); +inline void SharedConfigMessage::clear_kind() { + _impl_.kind_ = 1; + _impl_._has_bits_[0] &= ~0x00000004u; } -inline const ::SessionProtos::ConfigurationMessage_ClosedGroup& ConfigurationMessage::closedgroups(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.closedGroups) - return _internal_closedgroups(index); +inline ::SessionProtos::SharedConfigMessage_Kind SharedConfigMessage::_internal_kind() const { + return static_cast< ::SessionProtos::SharedConfigMessage_Kind >(_impl_.kind_); } -inline ::SessionProtos::ConfigurationMessage_ClosedGroup* ConfigurationMessage::_internal_add_closedgroups() { - return _impl_.closedgroups_.Add(); +inline ::SessionProtos::SharedConfigMessage_Kind SharedConfigMessage::kind() const { + // @@protoc_insertion_point(field_get:SessionProtos.SharedConfigMessage.kind) + return _internal_kind(); } -inline ::SessionProtos::ConfigurationMessage_ClosedGroup* ConfigurationMessage::add_closedgroups() { - ::SessionProtos::ConfigurationMessage_ClosedGroup* _add = _internal_add_closedgroups(); - // @@protoc_insertion_point(field_add:SessionProtos.ConfigurationMessage.closedGroups) - return _add; +inline void SharedConfigMessage::_internal_set_kind(::SessionProtos::SharedConfigMessage_Kind value) { + assert(::SessionProtos::SharedConfigMessage_Kind_IsValid(value)); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.kind_ = value; } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_ClosedGroup >& -ConfigurationMessage::closedgroups() const { - // @@protoc_insertion_point(field_list:SessionProtos.ConfigurationMessage.closedGroups) - return _impl_.closedgroups_; +inline void SharedConfigMessage::set_kind(::SessionProtos::SharedConfigMessage_Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:SessionProtos.SharedConfigMessage.kind) } -// repeated string openGroups = 2; -inline int ConfigurationMessage::_internal_opengroups_size() const { - return _impl_.opengroups_.size(); -} -inline int ConfigurationMessage::opengroups_size() const { - return _internal_opengroups_size(); -} -inline void ConfigurationMessage::clear_opengroups() { - _impl_.opengroups_.Clear(); -} -inline std::string* ConfigurationMessage::add_opengroups() { - std::string* _s = _internal_add_opengroups(); - // @@protoc_insertion_point(field_add_mutable:SessionProtos.ConfigurationMessage.openGroups) - return _s; -} -inline const std::string& ConfigurationMessage::_internal_opengroups(int index) const { - return _impl_.opengroups_.Get(index); -} -inline const std::string& ConfigurationMessage::opengroups(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.openGroups) - return _internal_opengroups(index); -} -inline std::string* ConfigurationMessage::mutable_opengroups(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.openGroups) - return _impl_.opengroups_.Mutable(index); -} -inline void ConfigurationMessage::set_opengroups(int index, const std::string& value) { - _impl_.opengroups_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.openGroups) -} -inline void ConfigurationMessage::set_opengroups(int index, std::string&& value) { - _impl_.opengroups_.Mutable(index)->assign(std::move(value)); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.openGroups) -} -inline void ConfigurationMessage::set_opengroups(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.opengroups_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:SessionProtos.ConfigurationMessage.openGroups) -} -inline void ConfigurationMessage::set_opengroups(int index, const char* value, size_t size) { - _impl_.opengroups_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:SessionProtos.ConfigurationMessage.openGroups) -} -inline std::string* ConfigurationMessage::_internal_add_opengroups() { - return _impl_.opengroups_.Add(); +// required int64 seqno = 2; +inline bool SharedConfigMessage::_internal_has_seqno() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; } -inline void ConfigurationMessage::add_opengroups(const std::string& value) { - _impl_.opengroups_.Add()->assign(value); - // @@protoc_insertion_point(field_add:SessionProtos.ConfigurationMessage.openGroups) +inline bool SharedConfigMessage::has_seqno() const { + return _internal_has_seqno(); } -inline void ConfigurationMessage::add_opengroups(std::string&& value) { - _impl_.opengroups_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:SessionProtos.ConfigurationMessage.openGroups) +inline void SharedConfigMessage::clear_seqno() { + _impl_.seqno_ = int64_t{0}; + _impl_._has_bits_[0] &= ~0x00000002u; } -inline void ConfigurationMessage::add_opengroups(const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.opengroups_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:SessionProtos.ConfigurationMessage.openGroups) +inline int64_t SharedConfigMessage::_internal_seqno() const { + return _impl_.seqno_; } -inline void ConfigurationMessage::add_opengroups(const char* value, size_t size) { - _impl_.opengroups_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:SessionProtos.ConfigurationMessage.openGroups) +inline int64_t SharedConfigMessage::seqno() const { + // @@protoc_insertion_point(field_get:SessionProtos.SharedConfigMessage.seqno) + return _internal_seqno(); } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -ConfigurationMessage::opengroups() const { - // @@protoc_insertion_point(field_list:SessionProtos.ConfigurationMessage.openGroups) - return _impl_.opengroups_; +inline void SharedConfigMessage::_internal_set_seqno(int64_t value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.seqno_ = value; } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -ConfigurationMessage::mutable_opengroups() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.ConfigurationMessage.openGroups) - return &_impl_.opengroups_; +inline void SharedConfigMessage::set_seqno(int64_t value) { + _internal_set_seqno(value); + // @@protoc_insertion_point(field_set:SessionProtos.SharedConfigMessage.seqno) } -// optional string displayName = 3; -inline bool ConfigurationMessage::_internal_has_displayname() const { +// required bytes data = 3; +inline bool SharedConfigMessage::_internal_has_data() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool ConfigurationMessage::has_displayname() const { - return _internal_has_displayname(); +inline bool SharedConfigMessage::has_data() const { + return _internal_has_data(); } -inline void ConfigurationMessage::clear_displayname() { - _impl_.displayname_.ClearToEmpty(); +inline void SharedConfigMessage::clear_data() { + _impl_.data_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& ConfigurationMessage::displayname() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.displayName) - return _internal_displayname(); +inline const std::string& SharedConfigMessage::data() const { + // @@protoc_insertion_point(field_get:SessionProtos.SharedConfigMessage.data) + return _internal_data(); } template inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage::set_displayname(ArgT0&& arg0, ArgT... args) { +void SharedConfigMessage::set_data(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.displayname_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.displayName) + _impl_.data_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.SharedConfigMessage.data) } -inline std::string* ConfigurationMessage::mutable_displayname() { - std::string* _s = _internal_mutable_displayname(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.displayName) +inline std::string* SharedConfigMessage::mutable_data() { + std::string* _s = _internal_mutable_data(); + // @@protoc_insertion_point(field_mutable:SessionProtos.SharedConfigMessage.data) return _s; } -inline const std::string& ConfigurationMessage::_internal_displayname() const { - return _impl_.displayname_.Get(); +inline const std::string& SharedConfigMessage::_internal_data() const { + return _impl_.data_.Get(); } -inline void ConfigurationMessage::_internal_set_displayname(const std::string& value) { +inline void SharedConfigMessage::_internal_set_data(const std::string& value) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.displayname_.Set(value, GetArenaForAllocation()); + _impl_.data_.Set(value, GetArenaForAllocation()); } -inline std::string* ConfigurationMessage::_internal_mutable_displayname() { +inline std::string* SharedConfigMessage::_internal_mutable_data() { _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.displayname_.Mutable(GetArenaForAllocation()); + return _impl_.data_.Mutable(GetArenaForAllocation()); } -inline std::string* ConfigurationMessage::release_displayname() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.displayName) - if (!_internal_has_displayname()) { +inline std::string* SharedConfigMessage::release_data() { + // @@protoc_insertion_point(field_release:SessionProtos.SharedConfigMessage.data) + if (!_internal_has_data()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.displayname_.Release(); + auto* p = _impl_.data_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.displayname_.IsDefault()) { - _impl_.displayname_.Set("", GetArenaForAllocation()); + if (_impl_.data_.IsDefault()) { + _impl_.data_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void ConfigurationMessage::set_allocated_displayname(std::string* displayname) { - if (displayname != nullptr) { +inline void SharedConfigMessage::set_allocated_data(std::string* data) { + if (data != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; } else { _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.displayname_.SetAllocated(displayname, GetArenaForAllocation()); + _impl_.data_.SetAllocated(data, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.displayname_.IsDefault()) { - _impl_.displayname_.Set("", GetArenaForAllocation()); + if (_impl_.data_.IsDefault()) { + _impl_.data_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.displayName) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.SharedConfigMessage.data) } -// optional string profilePicture = 4; -inline bool ConfigurationMessage::_internal_has_profilepicture() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; +// ------------------------------------------------------------------- + +// GroupUpdateMessage + +// optional .SessionProtos.GroupUpdateInviteMessage inviteMessage = 1; +inline bool GroupUpdateMessage::_internal_has_invitemessage() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.invitemessage_ != nullptr); return value; } -inline bool ConfigurationMessage::has_profilepicture() const { - return _internal_has_profilepicture(); -} -inline void ConfigurationMessage::clear_profilepicture() { - _impl_.profilepicture_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000002u; +inline bool GroupUpdateMessage::has_invitemessage() const { + return _internal_has_invitemessage(); } -inline const std::string& ConfigurationMessage::profilepicture() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.profilePicture) - return _internal_profilepicture(); +inline void GroupUpdateMessage::clear_invitemessage() { + if (_impl_.invitemessage_ != nullptr) _impl_.invitemessage_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; } -template -inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage::set_profilepicture(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.profilepicture_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.profilePicture) +inline const ::SessionProtos::GroupUpdateInviteMessage& GroupUpdateMessage::_internal_invitemessage() const { + const ::SessionProtos::GroupUpdateInviteMessage* p = _impl_.invitemessage_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_GroupUpdateInviteMessage_default_instance_); } -inline std::string* ConfigurationMessage::mutable_profilepicture() { - std::string* _s = _internal_mutable_profilepicture(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.profilePicture) - return _s; +inline const ::SessionProtos::GroupUpdateInviteMessage& GroupUpdateMessage::invitemessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMessage.inviteMessage) + return _internal_invitemessage(); } -inline const std::string& ConfigurationMessage::_internal_profilepicture() const { - return _impl_.profilepicture_.Get(); +inline void GroupUpdateMessage::unsafe_arena_set_allocated_invitemessage( + ::SessionProtos::GroupUpdateInviteMessage* invitemessage) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.invitemessage_); + } + _impl_.invitemessage_ = invitemessage; + if (invitemessage) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.GroupUpdateMessage.inviteMessage) } -inline void ConfigurationMessage::_internal_set_profilepicture(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.profilepicture_.Set(value, GetArenaForAllocation()); +inline ::SessionProtos::GroupUpdateInviteMessage* GroupUpdateMessage::release_invitemessage() { + _impl_._has_bits_[0] &= ~0x00000001u; + ::SessionProtos::GroupUpdateInviteMessage* temp = _impl_.invitemessage_; + _impl_.invitemessage_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; } -inline std::string* ConfigurationMessage::_internal_mutable_profilepicture() { - _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.profilepicture_.Mutable(GetArenaForAllocation()); +inline ::SessionProtos::GroupUpdateInviteMessage* GroupUpdateMessage::unsafe_arena_release_invitemessage() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateMessage.inviteMessage) + _impl_._has_bits_[0] &= ~0x00000001u; + ::SessionProtos::GroupUpdateInviteMessage* temp = _impl_.invitemessage_; + _impl_.invitemessage_ = nullptr; + return temp; } -inline std::string* ConfigurationMessage::release_profilepicture() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.profilePicture) - if (!_internal_has_profilepicture()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.profilepicture_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilepicture_.IsDefault()) { - _impl_.profilepicture_.Set("", GetArenaForAllocation()); +inline ::SessionProtos::GroupUpdateInviteMessage* GroupUpdateMessage::_internal_mutable_invitemessage() { + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.invitemessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::GroupUpdateInviteMessage>(GetArenaForAllocation()); + _impl_.invitemessage_ = p; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; + return _impl_.invitemessage_; } -inline void ConfigurationMessage::set_allocated_profilepicture(std::string* profilepicture) { - if (profilepicture != nullptr) { - _impl_._has_bits_[0] |= 0x00000002u; - } else { - _impl_._has_bits_[0] &= ~0x00000002u; +inline ::SessionProtos::GroupUpdateInviteMessage* GroupUpdateMessage::mutable_invitemessage() { + ::SessionProtos::GroupUpdateInviteMessage* _msg = _internal_mutable_invitemessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateMessage.inviteMessage) + return _msg; +} +inline void GroupUpdateMessage::set_allocated_invitemessage(::SessionProtos::GroupUpdateInviteMessage* invitemessage) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.invitemessage_; } - _impl_.profilepicture_.SetAllocated(profilepicture, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilepicture_.IsDefault()) { - _impl_.profilepicture_.Set("", GetArenaForAllocation()); + if (invitemessage) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(invitemessage); + if (message_arena != submessage_arena) { + invitemessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, invitemessage, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.profilePicture) + _impl_.invitemessage_ = invitemessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateMessage.inviteMessage) } -// optional bytes profileKey = 5; -inline bool ConfigurationMessage::_internal_has_profilekey() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; +// optional .SessionProtos.GroupUpdateInfoChangeMessage infoChangeMessage = 2; +inline bool GroupUpdateMessage::_internal_has_infochangemessage() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + PROTOBUF_ASSUME(!value || _impl_.infochangemessage_ != nullptr); return value; } -inline bool ConfigurationMessage::has_profilekey() const { - return _internal_has_profilekey(); -} -inline void ConfigurationMessage::clear_profilekey() { - _impl_.profilekey_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000004u; +inline bool GroupUpdateMessage::has_infochangemessage() const { + return _internal_has_infochangemessage(); } -inline const std::string& ConfigurationMessage::profilekey() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.profileKey) - return _internal_profilekey(); +inline void GroupUpdateMessage::clear_infochangemessage() { + if (_impl_.infochangemessage_ != nullptr) _impl_.infochangemessage_->Clear(); + _impl_._has_bits_[0] &= ~0x00000002u; } -template -inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage::set_profilekey(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.profilekey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.profileKey) +inline const ::SessionProtos::GroupUpdateInfoChangeMessage& GroupUpdateMessage::_internal_infochangemessage() const { + const ::SessionProtos::GroupUpdateInfoChangeMessage* p = _impl_.infochangemessage_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_GroupUpdateInfoChangeMessage_default_instance_); } -inline std::string* ConfigurationMessage::mutable_profilekey() { - std::string* _s = _internal_mutable_profilekey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.profileKey) - return _s; +inline const ::SessionProtos::GroupUpdateInfoChangeMessage& GroupUpdateMessage::infochangemessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMessage.infoChangeMessage) + return _internal_infochangemessage(); } -inline const std::string& ConfigurationMessage::_internal_profilekey() const { - return _impl_.profilekey_.Get(); +inline void GroupUpdateMessage::unsafe_arena_set_allocated_infochangemessage( + ::SessionProtos::GroupUpdateInfoChangeMessage* infochangemessage) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.infochangemessage_); + } + _impl_.infochangemessage_ = infochangemessage; + if (infochangemessage) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.GroupUpdateMessage.infoChangeMessage) } -inline void ConfigurationMessage::_internal_set_profilekey(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.profilekey_.Set(value, GetArenaForAllocation()); +inline ::SessionProtos::GroupUpdateInfoChangeMessage* GroupUpdateMessage::release_infochangemessage() { + _impl_._has_bits_[0] &= ~0x00000002u; + ::SessionProtos::GroupUpdateInfoChangeMessage* temp = _impl_.infochangemessage_; + _impl_.infochangemessage_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; } -inline std::string* ConfigurationMessage::_internal_mutable_profilekey() { - _impl_._has_bits_[0] |= 0x00000004u; - return _impl_.profilekey_.Mutable(GetArenaForAllocation()); +inline ::SessionProtos::GroupUpdateInfoChangeMessage* GroupUpdateMessage::unsafe_arena_release_infochangemessage() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateMessage.infoChangeMessage) + _impl_._has_bits_[0] &= ~0x00000002u; + ::SessionProtos::GroupUpdateInfoChangeMessage* temp = _impl_.infochangemessage_; + _impl_.infochangemessage_ = nullptr; + return temp; } -inline std::string* ConfigurationMessage::release_profilekey() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.profileKey) - if (!_internal_has_profilekey()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000004u; - auto* p = _impl_.profilekey_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilekey_.IsDefault()) { - _impl_.profilekey_.Set("", GetArenaForAllocation()); +inline ::SessionProtos::GroupUpdateInfoChangeMessage* GroupUpdateMessage::_internal_mutable_infochangemessage() { + _impl_._has_bits_[0] |= 0x00000002u; + if (_impl_.infochangemessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::GroupUpdateInfoChangeMessage>(GetArenaForAllocation()); + _impl_.infochangemessage_ = p; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; + return _impl_.infochangemessage_; +} +inline ::SessionProtos::GroupUpdateInfoChangeMessage* GroupUpdateMessage::mutable_infochangemessage() { + ::SessionProtos::GroupUpdateInfoChangeMessage* _msg = _internal_mutable_infochangemessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateMessage.infoChangeMessage) + return _msg; } -inline void ConfigurationMessage::set_allocated_profilekey(std::string* profilekey) { - if (profilekey != nullptr) { - _impl_._has_bits_[0] |= 0x00000004u; - } else { - _impl_._has_bits_[0] &= ~0x00000004u; +inline void GroupUpdateMessage::set_allocated_infochangemessage(::SessionProtos::GroupUpdateInfoChangeMessage* infochangemessage) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.infochangemessage_; } - _impl_.profilekey_.SetAllocated(profilekey, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilekey_.IsDefault()) { - _impl_.profilekey_.Set("", GetArenaForAllocation()); + if (infochangemessage) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(infochangemessage); + if (message_arena != submessage_arena) { + infochangemessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, infochangemessage, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.profileKey) + _impl_.infochangemessage_ = infochangemessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateMessage.infoChangeMessage) } -// repeated .SessionProtos.ConfigurationMessage.Contact contacts = 6; -inline int ConfigurationMessage::_internal_contacts_size() const { - return _impl_.contacts_.size(); +// optional .SessionProtos.GroupUpdateMemberChangeMessage memberChangeMessage = 3; +inline bool GroupUpdateMessage::_internal_has_memberchangemessage() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + PROTOBUF_ASSUME(!value || _impl_.memberchangemessage_ != nullptr); + return value; +} +inline bool GroupUpdateMessage::has_memberchangemessage() const { + return _internal_has_memberchangemessage(); } -inline int ConfigurationMessage::contacts_size() const { - return _internal_contacts_size(); +inline void GroupUpdateMessage::clear_memberchangemessage() { + if (_impl_.memberchangemessage_ != nullptr) _impl_.memberchangemessage_->Clear(); + _impl_._has_bits_[0] &= ~0x00000004u; } -inline void ConfigurationMessage::clear_contacts() { - _impl_.contacts_.Clear(); +inline const ::SessionProtos::GroupUpdateMemberChangeMessage& GroupUpdateMessage::_internal_memberchangemessage() const { + const ::SessionProtos::GroupUpdateMemberChangeMessage* p = _impl_.memberchangemessage_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_GroupUpdateMemberChangeMessage_default_instance_); } -inline ::SessionProtos::ConfigurationMessage_Contact* ConfigurationMessage::mutable_contacts(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.contacts) - return _impl_.contacts_.Mutable(index); +inline const ::SessionProtos::GroupUpdateMemberChangeMessage& GroupUpdateMessage::memberchangemessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMessage.memberChangeMessage) + return _internal_memberchangemessage(); } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_Contact >* -ConfigurationMessage::mutable_contacts() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.ConfigurationMessage.contacts) - return &_impl_.contacts_; +inline void GroupUpdateMessage::unsafe_arena_set_allocated_memberchangemessage( + ::SessionProtos::GroupUpdateMemberChangeMessage* memberchangemessage) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.memberchangemessage_); + } + _impl_.memberchangemessage_ = memberchangemessage; + if (memberchangemessage) { + _impl_._has_bits_[0] |= 0x00000004u; + } else { + _impl_._has_bits_[0] &= ~0x00000004u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.GroupUpdateMessage.memberChangeMessage) } -inline const ::SessionProtos::ConfigurationMessage_Contact& ConfigurationMessage::_internal_contacts(int index) const { - return _impl_.contacts_.Get(index); +inline ::SessionProtos::GroupUpdateMemberChangeMessage* GroupUpdateMessage::release_memberchangemessage() { + _impl_._has_bits_[0] &= ~0x00000004u; + ::SessionProtos::GroupUpdateMemberChangeMessage* temp = _impl_.memberchangemessage_; + _impl_.memberchangemessage_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; } -inline const ::SessionProtos::ConfigurationMessage_Contact& ConfigurationMessage::contacts(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.contacts) - return _internal_contacts(index); +inline ::SessionProtos::GroupUpdateMemberChangeMessage* GroupUpdateMessage::unsafe_arena_release_memberchangemessage() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateMessage.memberChangeMessage) + _impl_._has_bits_[0] &= ~0x00000004u; + ::SessionProtos::GroupUpdateMemberChangeMessage* temp = _impl_.memberchangemessage_; + _impl_.memberchangemessage_ = nullptr; + return temp; } -inline ::SessionProtos::ConfigurationMessage_Contact* ConfigurationMessage::_internal_add_contacts() { - return _impl_.contacts_.Add(); +inline ::SessionProtos::GroupUpdateMemberChangeMessage* GroupUpdateMessage::_internal_mutable_memberchangemessage() { + _impl_._has_bits_[0] |= 0x00000004u; + if (_impl_.memberchangemessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::GroupUpdateMemberChangeMessage>(GetArenaForAllocation()); + _impl_.memberchangemessage_ = p; + } + return _impl_.memberchangemessage_; } -inline ::SessionProtos::ConfigurationMessage_Contact* ConfigurationMessage::add_contacts() { - ::SessionProtos::ConfigurationMessage_Contact* _add = _internal_add_contacts(); - // @@protoc_insertion_point(field_add:SessionProtos.ConfigurationMessage.contacts) - return _add; +inline ::SessionProtos::GroupUpdateMemberChangeMessage* GroupUpdateMessage::mutable_memberchangemessage() { + ::SessionProtos::GroupUpdateMemberChangeMessage* _msg = _internal_mutable_memberchangemessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateMessage.memberChangeMessage) + return _msg; } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_Contact >& -ConfigurationMessage::contacts() const { - // @@protoc_insertion_point(field_list:SessionProtos.ConfigurationMessage.contacts) - return _impl_.contacts_; +inline void GroupUpdateMessage::set_allocated_memberchangemessage(::SessionProtos::GroupUpdateMemberChangeMessage* memberchangemessage) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.memberchangemessage_; + } + if (memberchangemessage) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(memberchangemessage); + if (message_arena != submessage_arena) { + memberchangemessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, memberchangemessage, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000004u; + } else { + _impl_._has_bits_[0] &= ~0x00000004u; + } + _impl_.memberchangemessage_ = memberchangemessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateMessage.memberChangeMessage) } -// optional .SessionProtos.ProConfig proConfig = 7; -inline bool ConfigurationMessage::_internal_has_proconfig() const { +// optional .SessionProtos.GroupUpdatePromoteMessage promoteMessage = 4; +inline bool GroupUpdateMessage::_internal_has_promotemessage() const { bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; - PROTOBUF_ASSUME(!value || _impl_.proconfig_ != nullptr); + PROTOBUF_ASSUME(!value || _impl_.promotemessage_ != nullptr); return value; } -inline bool ConfigurationMessage::has_proconfig() const { - return _internal_has_proconfig(); +inline bool GroupUpdateMessage::has_promotemessage() const { + return _internal_has_promotemessage(); } -inline void ConfigurationMessage::clear_proconfig() { - if (_impl_.proconfig_ != nullptr) _impl_.proconfig_->Clear(); +inline void GroupUpdateMessage::clear_promotemessage() { + if (_impl_.promotemessage_ != nullptr) _impl_.promotemessage_->Clear(); _impl_._has_bits_[0] &= ~0x00000008u; } -inline const ::SessionProtos::ProConfig& ConfigurationMessage::_internal_proconfig() const { - const ::SessionProtos::ProConfig* p = _impl_.proconfig_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_ProConfig_default_instance_); +inline const ::SessionProtos::GroupUpdatePromoteMessage& GroupUpdateMessage::_internal_promotemessage() const { + const ::SessionProtos::GroupUpdatePromoteMessage* p = _impl_.promotemessage_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_GroupUpdatePromoteMessage_default_instance_); } -inline const ::SessionProtos::ProConfig& ConfigurationMessage::proconfig() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.proConfig) - return _internal_proconfig(); +inline const ::SessionProtos::GroupUpdatePromoteMessage& GroupUpdateMessage::promotemessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMessage.promoteMessage) + return _internal_promotemessage(); } -inline void ConfigurationMessage::unsafe_arena_set_allocated_proconfig( - ::SessionProtos::ProConfig* proconfig) { +inline void GroupUpdateMessage::unsafe_arena_set_allocated_promotemessage( + ::SessionProtos::GroupUpdatePromoteMessage* promotemessage) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.proconfig_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.promotemessage_); } - _impl_.proconfig_ = proconfig; - if (proconfig) { + _impl_.promotemessage_ = promotemessage; + if (promotemessage) { _impl_._has_bits_[0] |= 0x00000008u; } else { _impl_._has_bits_[0] &= ~0x00000008u; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.ConfigurationMessage.proConfig) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.GroupUpdateMessage.promoteMessage) } -inline ::SessionProtos::ProConfig* ConfigurationMessage::release_proconfig() { +inline ::SessionProtos::GroupUpdatePromoteMessage* GroupUpdateMessage::release_promotemessage() { _impl_._has_bits_[0] &= ~0x00000008u; - ::SessionProtos::ProConfig* temp = _impl_.proconfig_; - _impl_.proconfig_ = nullptr; + ::SessionProtos::GroupUpdatePromoteMessage* temp = _impl_.promotemessage_; + _impl_.promotemessage_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -12701,873 +11883,1483 @@ inline ::SessionProtos::ProConfig* ConfigurationMessage::release_proconfig() { #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::SessionProtos::ProConfig* ConfigurationMessage::unsafe_arena_release_proconfig() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.proConfig) +inline ::SessionProtos::GroupUpdatePromoteMessage* GroupUpdateMessage::unsafe_arena_release_promotemessage() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateMessage.promoteMessage) _impl_._has_bits_[0] &= ~0x00000008u; - ::SessionProtos::ProConfig* temp = _impl_.proconfig_; - _impl_.proconfig_ = nullptr; + ::SessionProtos::GroupUpdatePromoteMessage* temp = _impl_.promotemessage_; + _impl_.promotemessage_ = nullptr; return temp; } -inline ::SessionProtos::ProConfig* ConfigurationMessage::_internal_mutable_proconfig() { +inline ::SessionProtos::GroupUpdatePromoteMessage* GroupUpdateMessage::_internal_mutable_promotemessage() { _impl_._has_bits_[0] |= 0x00000008u; - if (_impl_.proconfig_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::ProConfig>(GetArenaForAllocation()); - _impl_.proconfig_ = p; + if (_impl_.promotemessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::GroupUpdatePromoteMessage>(GetArenaForAllocation()); + _impl_.promotemessage_ = p; } - return _impl_.proconfig_; + return _impl_.promotemessage_; } -inline ::SessionProtos::ProConfig* ConfigurationMessage::mutable_proconfig() { - ::SessionProtos::ProConfig* _msg = _internal_mutable_proconfig(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.proConfig) +inline ::SessionProtos::GroupUpdatePromoteMessage* GroupUpdateMessage::mutable_promotemessage() { + ::SessionProtos::GroupUpdatePromoteMessage* _msg = _internal_mutable_promotemessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateMessage.promoteMessage) return _msg; } -inline void ConfigurationMessage::set_allocated_proconfig(::SessionProtos::ProConfig* proconfig) { +inline void GroupUpdateMessage::set_allocated_promotemessage(::SessionProtos::GroupUpdatePromoteMessage* promotemessage) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.proconfig_; + delete _impl_.promotemessage_; } - if (proconfig) { + if (promotemessage) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(proconfig); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(promotemessage); if (message_arena != submessage_arena) { - proconfig = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, proconfig, submessage_arena); + promotemessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, promotemessage, submessage_arena); } _impl_._has_bits_[0] |= 0x00000008u; } else { _impl_._has_bits_[0] &= ~0x00000008u; } - _impl_.proconfig_ = proconfig; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.proConfig) + _impl_.promotemessage_ = promotemessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateMessage.promoteMessage) } -// ------------------------------------------------------------------- - -// ReceiptMessage - -// required .SessionProtos.ReceiptMessage.Type type = 1; -inline bool ReceiptMessage::_internal_has_type() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; +// optional .SessionProtos.GroupUpdateMemberLeftMessage memberLeftMessage = 5; +inline bool GroupUpdateMessage::_internal_has_memberleftmessage() const { + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; + PROTOBUF_ASSUME(!value || _impl_.memberleftmessage_ != nullptr); return value; } -inline bool ReceiptMessage::has_type() const { - return _internal_has_type(); +inline bool GroupUpdateMessage::has_memberleftmessage() const { + return _internal_has_memberleftmessage(); } -inline void ReceiptMessage::clear_type() { - _impl_.type_ = 0; - _impl_._has_bits_[0] &= ~0x00000001u; +inline void GroupUpdateMessage::clear_memberleftmessage() { + if (_impl_.memberleftmessage_ != nullptr) _impl_.memberleftmessage_->Clear(); + _impl_._has_bits_[0] &= ~0x00000010u; } -inline ::SessionProtos::ReceiptMessage_Type ReceiptMessage::_internal_type() const { - return static_cast< ::SessionProtos::ReceiptMessage_Type >(_impl_.type_); +inline const ::SessionProtos::GroupUpdateMemberLeftMessage& GroupUpdateMessage::_internal_memberleftmessage() const { + const ::SessionProtos::GroupUpdateMemberLeftMessage* p = _impl_.memberleftmessage_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_GroupUpdateMemberLeftMessage_default_instance_); } -inline ::SessionProtos::ReceiptMessage_Type ReceiptMessage::type() const { - // @@protoc_insertion_point(field_get:SessionProtos.ReceiptMessage.type) - return _internal_type(); +inline const ::SessionProtos::GroupUpdateMemberLeftMessage& GroupUpdateMessage::memberleftmessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMessage.memberLeftMessage) + return _internal_memberleftmessage(); } -inline void ReceiptMessage::_internal_set_type(::SessionProtos::ReceiptMessage_Type value) { - assert(::SessionProtos::ReceiptMessage_Type_IsValid(value)); - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.type_ = value; +inline void GroupUpdateMessage::unsafe_arena_set_allocated_memberleftmessage( + ::SessionProtos::GroupUpdateMemberLeftMessage* memberleftmessage) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.memberleftmessage_); + } + _impl_.memberleftmessage_ = memberleftmessage; + if (memberleftmessage) { + _impl_._has_bits_[0] |= 0x00000010u; + } else { + _impl_._has_bits_[0] &= ~0x00000010u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.GroupUpdateMessage.memberLeftMessage) } -inline void ReceiptMessage::set_type(::SessionProtos::ReceiptMessage_Type value) { - _internal_set_type(value); - // @@protoc_insertion_point(field_set:SessionProtos.ReceiptMessage.type) +inline ::SessionProtos::GroupUpdateMemberLeftMessage* GroupUpdateMessage::release_memberleftmessage() { + _impl_._has_bits_[0] &= ~0x00000010u; + ::SessionProtos::GroupUpdateMemberLeftMessage* temp = _impl_.memberleftmessage_; + _impl_.memberleftmessage_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; } - -// repeated uint64 timestamp = 2; -inline int ReceiptMessage::_internal_timestamp_size() const { - return _impl_.timestamp_.size(); +inline ::SessionProtos::GroupUpdateMemberLeftMessage* GroupUpdateMessage::unsafe_arena_release_memberleftmessage() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateMessage.memberLeftMessage) + _impl_._has_bits_[0] &= ~0x00000010u; + ::SessionProtos::GroupUpdateMemberLeftMessage* temp = _impl_.memberleftmessage_; + _impl_.memberleftmessage_ = nullptr; + return temp; } -inline int ReceiptMessage::timestamp_size() const { - return _internal_timestamp_size(); +inline ::SessionProtos::GroupUpdateMemberLeftMessage* GroupUpdateMessage::_internal_mutable_memberleftmessage() { + _impl_._has_bits_[0] |= 0x00000010u; + if (_impl_.memberleftmessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::GroupUpdateMemberLeftMessage>(GetArenaForAllocation()); + _impl_.memberleftmessage_ = p; + } + return _impl_.memberleftmessage_; } -inline void ReceiptMessage::clear_timestamp() { - _impl_.timestamp_.Clear(); +inline ::SessionProtos::GroupUpdateMemberLeftMessage* GroupUpdateMessage::mutable_memberleftmessage() { + ::SessionProtos::GroupUpdateMemberLeftMessage* _msg = _internal_mutable_memberleftmessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateMessage.memberLeftMessage) + return _msg; } -inline uint64_t ReceiptMessage::_internal_timestamp(int index) const { - return _impl_.timestamp_.Get(index); +inline void GroupUpdateMessage::set_allocated_memberleftmessage(::SessionProtos::GroupUpdateMemberLeftMessage* memberleftmessage) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.memberleftmessage_; + } + if (memberleftmessage) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(memberleftmessage); + if (message_arena != submessage_arena) { + memberleftmessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, memberleftmessage, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000010u; + } else { + _impl_._has_bits_[0] &= ~0x00000010u; + } + _impl_.memberleftmessage_ = memberleftmessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateMessage.memberLeftMessage) } -inline uint64_t ReceiptMessage::timestamp(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.ReceiptMessage.timestamp) - return _internal_timestamp(index); + +// optional .SessionProtos.GroupUpdateInviteResponseMessage inviteResponse = 6; +inline bool GroupUpdateMessage::_internal_has_inviteresponse() const { + bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; + PROTOBUF_ASSUME(!value || _impl_.inviteresponse_ != nullptr); + return value; } -inline void ReceiptMessage::set_timestamp(int index, uint64_t value) { - _impl_.timestamp_.Set(index, value); - // @@protoc_insertion_point(field_set:SessionProtos.ReceiptMessage.timestamp) +inline bool GroupUpdateMessage::has_inviteresponse() const { + return _internal_has_inviteresponse(); } -inline void ReceiptMessage::_internal_add_timestamp(uint64_t value) { - _impl_.timestamp_.Add(value); +inline void GroupUpdateMessage::clear_inviteresponse() { + if (_impl_.inviteresponse_ != nullptr) _impl_.inviteresponse_->Clear(); + _impl_._has_bits_[0] &= ~0x00000020u; } -inline void ReceiptMessage::add_timestamp(uint64_t value) { - _internal_add_timestamp(value); - // @@protoc_insertion_point(field_add:SessionProtos.ReceiptMessage.timestamp) +inline const ::SessionProtos::GroupUpdateInviteResponseMessage& GroupUpdateMessage::_internal_inviteresponse() const { + const ::SessionProtos::GroupUpdateInviteResponseMessage* p = _impl_.inviteresponse_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_GroupUpdateInviteResponseMessage_default_instance_); } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& -ReceiptMessage::_internal_timestamp() const { - return _impl_.timestamp_; +inline const ::SessionProtos::GroupUpdateInviteResponseMessage& GroupUpdateMessage::inviteresponse() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMessage.inviteResponse) + return _internal_inviteresponse(); } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& -ReceiptMessage::timestamp() const { - // @@protoc_insertion_point(field_list:SessionProtos.ReceiptMessage.timestamp) - return _internal_timestamp(); +inline void GroupUpdateMessage::unsafe_arena_set_allocated_inviteresponse( + ::SessionProtos::GroupUpdateInviteResponseMessage* inviteresponse) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.inviteresponse_); + } + _impl_.inviteresponse_ = inviteresponse; + if (inviteresponse) { + _impl_._has_bits_[0] |= 0x00000020u; + } else { + _impl_._has_bits_[0] &= ~0x00000020u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.GroupUpdateMessage.inviteResponse) } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* -ReceiptMessage::_internal_mutable_timestamp() { - return &_impl_.timestamp_; +inline ::SessionProtos::GroupUpdateInviteResponseMessage* GroupUpdateMessage::release_inviteresponse() { + _impl_._has_bits_[0] &= ~0x00000020u; + ::SessionProtos::GroupUpdateInviteResponseMessage* temp = _impl_.inviteresponse_; + _impl_.inviteresponse_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* -ReceiptMessage::mutable_timestamp() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.ReceiptMessage.timestamp) - return _internal_mutable_timestamp(); +inline ::SessionProtos::GroupUpdateInviteResponseMessage* GroupUpdateMessage::unsafe_arena_release_inviteresponse() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateMessage.inviteResponse) + _impl_._has_bits_[0] &= ~0x00000020u; + ::SessionProtos::GroupUpdateInviteResponseMessage* temp = _impl_.inviteresponse_; + _impl_.inviteresponse_ = nullptr; + return temp; +} +inline ::SessionProtos::GroupUpdateInviteResponseMessage* GroupUpdateMessage::_internal_mutable_inviteresponse() { + _impl_._has_bits_[0] |= 0x00000020u; + if (_impl_.inviteresponse_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::GroupUpdateInviteResponseMessage>(GetArenaForAllocation()); + _impl_.inviteresponse_ = p; + } + return _impl_.inviteresponse_; +} +inline ::SessionProtos::GroupUpdateInviteResponseMessage* GroupUpdateMessage::mutable_inviteresponse() { + ::SessionProtos::GroupUpdateInviteResponseMessage* _msg = _internal_mutable_inviteresponse(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateMessage.inviteResponse) + return _msg; +} +inline void GroupUpdateMessage::set_allocated_inviteresponse(::SessionProtos::GroupUpdateInviteResponseMessage* inviteresponse) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.inviteresponse_; + } + if (inviteresponse) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(inviteresponse); + if (message_arena != submessage_arena) { + inviteresponse = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, inviteresponse, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000020u; + } else { + _impl_._has_bits_[0] &= ~0x00000020u; + } + _impl_.inviteresponse_ = inviteresponse; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateMessage.inviteResponse) } -// ------------------------------------------------------------------- - -// AttachmentPointer +// optional .SessionProtos.GroupUpdateDeleteMemberContentMessage deleteMemberContent = 7; +inline bool GroupUpdateMessage::_internal_has_deletemembercontent() const { + bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; + PROTOBUF_ASSUME(!value || _impl_.deletemembercontent_ != nullptr); + return value; +} +inline bool GroupUpdateMessage::has_deletemembercontent() const { + return _internal_has_deletemembercontent(); +} +inline void GroupUpdateMessage::clear_deletemembercontent() { + if (_impl_.deletemembercontent_ != nullptr) _impl_.deletemembercontent_->Clear(); + _impl_._has_bits_[0] &= ~0x00000040u; +} +inline const ::SessionProtos::GroupUpdateDeleteMemberContentMessage& GroupUpdateMessage::_internal_deletemembercontent() const { + const ::SessionProtos::GroupUpdateDeleteMemberContentMessage* p = _impl_.deletemembercontent_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_GroupUpdateDeleteMemberContentMessage_default_instance_); +} +inline const ::SessionProtos::GroupUpdateDeleteMemberContentMessage& GroupUpdateMessage::deletemembercontent() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMessage.deleteMemberContent) + return _internal_deletemembercontent(); +} +inline void GroupUpdateMessage::unsafe_arena_set_allocated_deletemembercontent( + ::SessionProtos::GroupUpdateDeleteMemberContentMessage* deletemembercontent) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.deletemembercontent_); + } + _impl_.deletemembercontent_ = deletemembercontent; + if (deletemembercontent) { + _impl_._has_bits_[0] |= 0x00000040u; + } else { + _impl_._has_bits_[0] &= ~0x00000040u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.GroupUpdateMessage.deleteMemberContent) +} +inline ::SessionProtos::GroupUpdateDeleteMemberContentMessage* GroupUpdateMessage::release_deletemembercontent() { + _impl_._has_bits_[0] &= ~0x00000040u; + ::SessionProtos::GroupUpdateDeleteMemberContentMessage* temp = _impl_.deletemembercontent_; + _impl_.deletemembercontent_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::SessionProtos::GroupUpdateDeleteMemberContentMessage* GroupUpdateMessage::unsafe_arena_release_deletemembercontent() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateMessage.deleteMemberContent) + _impl_._has_bits_[0] &= ~0x00000040u; + ::SessionProtos::GroupUpdateDeleteMemberContentMessage* temp = _impl_.deletemembercontent_; + _impl_.deletemembercontent_ = nullptr; + return temp; +} +inline ::SessionProtos::GroupUpdateDeleteMemberContentMessage* GroupUpdateMessage::_internal_mutable_deletemembercontent() { + _impl_._has_bits_[0] |= 0x00000040u; + if (_impl_.deletemembercontent_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::GroupUpdateDeleteMemberContentMessage>(GetArenaForAllocation()); + _impl_.deletemembercontent_ = p; + } + return _impl_.deletemembercontent_; +} +inline ::SessionProtos::GroupUpdateDeleteMemberContentMessage* GroupUpdateMessage::mutable_deletemembercontent() { + ::SessionProtos::GroupUpdateDeleteMemberContentMessage* _msg = _internal_mutable_deletemembercontent(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateMessage.deleteMemberContent) + return _msg; +} +inline void GroupUpdateMessage::set_allocated_deletemembercontent(::SessionProtos::GroupUpdateDeleteMemberContentMessage* deletemembercontent) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.deletemembercontent_; + } + if (deletemembercontent) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(deletemembercontent); + if (message_arena != submessage_arena) { + deletemembercontent = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, deletemembercontent, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000040u; + } else { + _impl_._has_bits_[0] &= ~0x00000040u; + } + _impl_.deletemembercontent_ = deletemembercontent; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateMessage.deleteMemberContent) +} -// required fixed64 id = 1; -inline bool AttachmentPointer::_internal_has_id() const { +// optional .SessionProtos.GroupUpdateMemberLeftNotificationMessage memberLeftNotificationMessage = 8; +inline bool GroupUpdateMessage::_internal_has_memberleftnotificationmessage() const { bool value = (_impl_._has_bits_[0] & 0x00000080u) != 0; + PROTOBUF_ASSUME(!value || _impl_.memberleftnotificationmessage_ != nullptr); return value; } -inline bool AttachmentPointer::has_id() const { - return _internal_has_id(); +inline bool GroupUpdateMessage::has_memberleftnotificationmessage() const { + return _internal_has_memberleftnotificationmessage(); +} +inline void GroupUpdateMessage::clear_memberleftnotificationmessage() { + if (_impl_.memberleftnotificationmessage_ != nullptr) _impl_.memberleftnotificationmessage_->Clear(); + _impl_._has_bits_[0] &= ~0x00000080u; +} +inline const ::SessionProtos::GroupUpdateMemberLeftNotificationMessage& GroupUpdateMessage::_internal_memberleftnotificationmessage() const { + const ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* p = _impl_.memberleftnotificationmessage_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_GroupUpdateMemberLeftNotificationMessage_default_instance_); +} +inline const ::SessionProtos::GroupUpdateMemberLeftNotificationMessage& GroupUpdateMessage::memberleftnotificationmessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMessage.memberLeftNotificationMessage) + return _internal_memberleftnotificationmessage(); +} +inline void GroupUpdateMessage::unsafe_arena_set_allocated_memberleftnotificationmessage( + ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* memberleftnotificationmessage) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.memberleftnotificationmessage_); + } + _impl_.memberleftnotificationmessage_ = memberleftnotificationmessage; + if (memberleftnotificationmessage) { + _impl_._has_bits_[0] |= 0x00000080u; + } else { + _impl_._has_bits_[0] &= ~0x00000080u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.GroupUpdateMessage.memberLeftNotificationMessage) +} +inline ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* GroupUpdateMessage::release_memberleftnotificationmessage() { + _impl_._has_bits_[0] &= ~0x00000080u; + ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* temp = _impl_.memberleftnotificationmessage_; + _impl_.memberleftnotificationmessage_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; } -inline void AttachmentPointer::clear_id() { - _impl_.id_ = uint64_t{0u}; +inline ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* GroupUpdateMessage::unsafe_arena_release_memberleftnotificationmessage() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateMessage.memberLeftNotificationMessage) _impl_._has_bits_[0] &= ~0x00000080u; + ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* temp = _impl_.memberleftnotificationmessage_; + _impl_.memberleftnotificationmessage_ = nullptr; + return temp; } -inline uint64_t AttachmentPointer::_internal_id() const { - return _impl_.id_; -} -inline uint64_t AttachmentPointer::id() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.id) - return _internal_id(); -} -inline void AttachmentPointer::_internal_set_id(uint64_t value) { +inline ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* GroupUpdateMessage::_internal_mutable_memberleftnotificationmessage() { _impl_._has_bits_[0] |= 0x00000080u; - _impl_.id_ = value; + if (_impl_.memberleftnotificationmessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::GroupUpdateMemberLeftNotificationMessage>(GetArenaForAllocation()); + _impl_.memberleftnotificationmessage_ = p; + } + return _impl_.memberleftnotificationmessage_; } -inline void AttachmentPointer::set_id(uint64_t value) { - _internal_set_id(value); - // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.id) +inline ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* GroupUpdateMessage::mutable_memberleftnotificationmessage() { + ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* _msg = _internal_mutable_memberleftnotificationmessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateMessage.memberLeftNotificationMessage) + return _msg; +} +inline void GroupUpdateMessage::set_allocated_memberleftnotificationmessage(::SessionProtos::GroupUpdateMemberLeftNotificationMessage* memberleftnotificationmessage) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.memberleftnotificationmessage_; + } + if (memberleftnotificationmessage) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(memberleftnotificationmessage); + if (message_arena != submessage_arena) { + memberleftnotificationmessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, memberleftnotificationmessage, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000080u; + } else { + _impl_._has_bits_[0] &= ~0x00000080u; + } + _impl_.memberleftnotificationmessage_ = memberleftnotificationmessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateMessage.memberLeftNotificationMessage) } -// optional string contentType = 2; -inline bool AttachmentPointer::_internal_has_contenttype() const { +// ------------------------------------------------------------------- + +// GroupUpdateInviteMessage + +// required string groupSessionId = 1; +inline bool GroupUpdateInviteMessage::_internal_has_groupsessionid() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool AttachmentPointer::has_contenttype() const { - return _internal_has_contenttype(); +inline bool GroupUpdateInviteMessage::has_groupsessionid() const { + return _internal_has_groupsessionid(); } -inline void AttachmentPointer::clear_contenttype() { - _impl_.contenttype_.ClearToEmpty(); +inline void GroupUpdateInviteMessage::clear_groupsessionid() { + _impl_.groupsessionid_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& AttachmentPointer::contenttype() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.contentType) - return _internal_contenttype(); +inline const std::string& GroupUpdateInviteMessage::groupsessionid() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateInviteMessage.groupSessionId) + return _internal_groupsessionid(); } template inline PROTOBUF_ALWAYS_INLINE -void AttachmentPointer::set_contenttype(ArgT0&& arg0, ArgT... args) { +void GroupUpdateInviteMessage::set_groupsessionid(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.contenttype_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.contentType) + _impl_.groupsessionid_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateInviteMessage.groupSessionId) } -inline std::string* AttachmentPointer::mutable_contenttype() { - std::string* _s = _internal_mutable_contenttype(); - // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.contentType) +inline std::string* GroupUpdateInviteMessage::mutable_groupsessionid() { + std::string* _s = _internal_mutable_groupsessionid(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateInviteMessage.groupSessionId) return _s; } -inline const std::string& AttachmentPointer::_internal_contenttype() const { - return _impl_.contenttype_.Get(); +inline const std::string& GroupUpdateInviteMessage::_internal_groupsessionid() const { + return _impl_.groupsessionid_.Get(); } -inline void AttachmentPointer::_internal_set_contenttype(const std::string& value) { +inline void GroupUpdateInviteMessage::_internal_set_groupsessionid(const std::string& value) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.contenttype_.Set(value, GetArenaForAllocation()); + _impl_.groupsessionid_.Set(value, GetArenaForAllocation()); } -inline std::string* AttachmentPointer::_internal_mutable_contenttype() { +inline std::string* GroupUpdateInviteMessage::_internal_mutable_groupsessionid() { _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.contenttype_.Mutable(GetArenaForAllocation()); + return _impl_.groupsessionid_.Mutable(GetArenaForAllocation()); } -inline std::string* AttachmentPointer::release_contenttype() { - // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.contentType) - if (!_internal_has_contenttype()) { +inline std::string* GroupUpdateInviteMessage::release_groupsessionid() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateInviteMessage.groupSessionId) + if (!_internal_has_groupsessionid()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.contenttype_.Release(); + auto* p = _impl_.groupsessionid_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.contenttype_.IsDefault()) { - _impl_.contenttype_.Set("", GetArenaForAllocation()); + if (_impl_.groupsessionid_.IsDefault()) { + _impl_.groupsessionid_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void AttachmentPointer::set_allocated_contenttype(std::string* contenttype) { - if (contenttype != nullptr) { +inline void GroupUpdateInviteMessage::set_allocated_groupsessionid(std::string* groupsessionid) { + if (groupsessionid != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; } else { _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.contenttype_.SetAllocated(contenttype, GetArenaForAllocation()); + _impl_.groupsessionid_.SetAllocated(groupsessionid, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.contenttype_.IsDefault()) { - _impl_.contenttype_.Set("", GetArenaForAllocation()); + if (_impl_.groupsessionid_.IsDefault()) { + _impl_.groupsessionid_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.contentType) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateInviteMessage.groupSessionId) } -// optional bytes key = 3; -inline bool AttachmentPointer::_internal_has_key() const { +// required string name = 2; +inline bool GroupUpdateInviteMessage::_internal_has_name() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } -inline bool AttachmentPointer::has_key() const { - return _internal_has_key(); +inline bool GroupUpdateInviteMessage::has_name() const { + return _internal_has_name(); } -inline void AttachmentPointer::clear_key() { - _impl_.key_.ClearToEmpty(); +inline void GroupUpdateInviteMessage::clear_name() { + _impl_.name_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000002u; } -inline const std::string& AttachmentPointer::key() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.key) - return _internal_key(); +inline const std::string& GroupUpdateInviteMessage::name() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateInviteMessage.name) + return _internal_name(); } template inline PROTOBUF_ALWAYS_INLINE -void AttachmentPointer::set_key(ArgT0&& arg0, ArgT... args) { +void GroupUpdateInviteMessage::set_name(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.key_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.key) + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateInviteMessage.name) } -inline std::string* AttachmentPointer::mutable_key() { - std::string* _s = _internal_mutable_key(); - // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.key) +inline std::string* GroupUpdateInviteMessage::mutable_name() { + std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateInviteMessage.name) return _s; } -inline const std::string& AttachmentPointer::_internal_key() const { - return _impl_.key_.Get(); +inline const std::string& GroupUpdateInviteMessage::_internal_name() const { + return _impl_.name_.Get(); } -inline void AttachmentPointer::_internal_set_key(const std::string& value) { +inline void GroupUpdateInviteMessage::_internal_set_name(const std::string& value) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.key_.Set(value, GetArenaForAllocation()); + _impl_.name_.Set(value, GetArenaForAllocation()); } -inline std::string* AttachmentPointer::_internal_mutable_key() { +inline std::string* GroupUpdateInviteMessage::_internal_mutable_name() { _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.key_.Mutable(GetArenaForAllocation()); + return _impl_.name_.Mutable(GetArenaForAllocation()); } -inline std::string* AttachmentPointer::release_key() { - // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.key) - if (!_internal_has_key()) { +inline std::string* GroupUpdateInviteMessage::release_name() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateInviteMessage.name) + if (!_internal_has_name()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.key_.Release(); + auto* p = _impl_.name_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.key_.IsDefault()) { - _impl_.key_.Set("", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void AttachmentPointer::set_allocated_key(std::string* key) { - if (key != nullptr) { +inline void GroupUpdateInviteMessage::set_allocated_name(std::string* name) { + if (name != nullptr) { _impl_._has_bits_[0] |= 0x00000002u; } else { _impl_._has_bits_[0] &= ~0x00000002u; } - _impl_.key_.SetAllocated(key, GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.key_.IsDefault()) { - _impl_.key_.Set("", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.key) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateInviteMessage.name) } -// optional uint32 size = 4; -inline bool AttachmentPointer::_internal_has_size() const { - bool value = (_impl_._has_bits_[0] & 0x00000100u) != 0; +// required bytes memberAuthData = 3; +inline bool GroupUpdateInviteMessage::_internal_has_memberauthdata() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } -inline bool AttachmentPointer::has_size() const { - return _internal_has_size(); +inline bool GroupUpdateInviteMessage::has_memberauthdata() const { + return _internal_has_memberauthdata(); } -inline void AttachmentPointer::clear_size() { - _impl_.size_ = 0u; - _impl_._has_bits_[0] &= ~0x00000100u; +inline void GroupUpdateInviteMessage::clear_memberauthdata() { + _impl_.memberauthdata_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000004u; } -inline uint32_t AttachmentPointer::_internal_size() const { - return _impl_.size_; +inline const std::string& GroupUpdateInviteMessage::memberauthdata() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateInviteMessage.memberAuthData) + return _internal_memberauthdata(); } -inline uint32_t AttachmentPointer::size() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.size) - return _internal_size(); +template +inline PROTOBUF_ALWAYS_INLINE +void GroupUpdateInviteMessage::set_memberauthdata(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.memberauthdata_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateInviteMessage.memberAuthData) } -inline void AttachmentPointer::_internal_set_size(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000100u; - _impl_.size_ = value; +inline std::string* GroupUpdateInviteMessage::mutable_memberauthdata() { + std::string* _s = _internal_mutable_memberauthdata(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateInviteMessage.memberAuthData) + return _s; } -inline void AttachmentPointer::set_size(uint32_t value) { - _internal_set_size(value); - // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.size) +inline const std::string& GroupUpdateInviteMessage::_internal_memberauthdata() const { + return _impl_.memberauthdata_.Get(); +} +inline void GroupUpdateInviteMessage::_internal_set_memberauthdata(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.memberauthdata_.Set(value, GetArenaForAllocation()); +} +inline std::string* GroupUpdateInviteMessage::_internal_mutable_memberauthdata() { + _impl_._has_bits_[0] |= 0x00000004u; + return _impl_.memberauthdata_.Mutable(GetArenaForAllocation()); +} +inline std::string* GroupUpdateInviteMessage::release_memberauthdata() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateInviteMessage.memberAuthData) + if (!_internal_has_memberauthdata()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000004u; + auto* p = _impl_.memberauthdata_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.memberauthdata_.IsDefault()) { + _impl_.memberauthdata_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void GroupUpdateInviteMessage::set_allocated_memberauthdata(std::string* memberauthdata) { + if (memberauthdata != nullptr) { + _impl_._has_bits_[0] |= 0x00000004u; + } else { + _impl_._has_bits_[0] &= ~0x00000004u; + } + _impl_.memberauthdata_.SetAllocated(memberauthdata, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.memberauthdata_.IsDefault()) { + _impl_.memberauthdata_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateInviteMessage.memberAuthData) } -// optional bytes thumbnail = 5; -inline bool AttachmentPointer::_internal_has_thumbnail() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; +// required bytes adminSignature = 4; +inline bool GroupUpdateInviteMessage::_internal_has_adminsignature() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; return value; } -inline bool AttachmentPointer::has_thumbnail() const { - return _internal_has_thumbnail(); +inline bool GroupUpdateInviteMessage::has_adminsignature() const { + return _internal_has_adminsignature(); } -inline void AttachmentPointer::clear_thumbnail() { - _impl_.thumbnail_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000004u; +inline void GroupUpdateInviteMessage::clear_adminsignature() { + _impl_.adminsignature_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000008u; } -inline const std::string& AttachmentPointer::thumbnail() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.thumbnail) - return _internal_thumbnail(); +inline const std::string& GroupUpdateInviteMessage::adminsignature() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateInviteMessage.adminSignature) + return _internal_adminsignature(); } template inline PROTOBUF_ALWAYS_INLINE -void AttachmentPointer::set_thumbnail(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.thumbnail_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.thumbnail) +void GroupUpdateInviteMessage::set_adminsignature(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.adminsignature_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateInviteMessage.adminSignature) +} +inline std::string* GroupUpdateInviteMessage::mutable_adminsignature() { + std::string* _s = _internal_mutable_adminsignature(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateInviteMessage.adminSignature) + return _s; +} +inline const std::string& GroupUpdateInviteMessage::_internal_adminsignature() const { + return _impl_.adminsignature_.Get(); +} +inline void GroupUpdateInviteMessage::_internal_set_adminsignature(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.adminsignature_.Set(value, GetArenaForAllocation()); +} +inline std::string* GroupUpdateInviteMessage::_internal_mutable_adminsignature() { + _impl_._has_bits_[0] |= 0x00000008u; + return _impl_.adminsignature_.Mutable(GetArenaForAllocation()); +} +inline std::string* GroupUpdateInviteMessage::release_adminsignature() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateInviteMessage.adminSignature) + if (!_internal_has_adminsignature()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000008u; + auto* p = _impl_.adminsignature_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.adminsignature_.IsDefault()) { + _impl_.adminsignature_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void GroupUpdateInviteMessage::set_allocated_adminsignature(std::string* adminsignature) { + if (adminsignature != nullptr) { + _impl_._has_bits_[0] |= 0x00000008u; + } else { + _impl_._has_bits_[0] &= ~0x00000008u; + } + _impl_.adminsignature_.SetAllocated(adminsignature, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.adminsignature_.IsDefault()) { + _impl_.adminsignature_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateInviteMessage.adminSignature) +} + +// ------------------------------------------------------------------- + +// GroupUpdatePromoteMessage + +// required bytes groupIdentitySeed = 1; +inline bool GroupUpdatePromoteMessage::_internal_has_groupidentityseed() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool GroupUpdatePromoteMessage::has_groupidentityseed() const { + return _internal_has_groupidentityseed(); +} +inline void GroupUpdatePromoteMessage::clear_groupidentityseed() { + _impl_.groupidentityseed_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& GroupUpdatePromoteMessage::groupidentityseed() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdatePromoteMessage.groupIdentitySeed) + return _internal_groupidentityseed(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void GroupUpdatePromoteMessage::set_groupidentityseed(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.groupidentityseed_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdatePromoteMessage.groupIdentitySeed) +} +inline std::string* GroupUpdatePromoteMessage::mutable_groupidentityseed() { + std::string* _s = _internal_mutable_groupidentityseed(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdatePromoteMessage.groupIdentitySeed) + return _s; +} +inline const std::string& GroupUpdatePromoteMessage::_internal_groupidentityseed() const { + return _impl_.groupidentityseed_.Get(); +} +inline void GroupUpdatePromoteMessage::_internal_set_groupidentityseed(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.groupidentityseed_.Set(value, GetArenaForAllocation()); +} +inline std::string* GroupUpdatePromoteMessage::_internal_mutable_groupidentityseed() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.groupidentityseed_.Mutable(GetArenaForAllocation()); +} +inline std::string* GroupUpdatePromoteMessage::release_groupidentityseed() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdatePromoteMessage.groupIdentitySeed) + if (!_internal_has_groupidentityseed()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.groupidentityseed_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.groupidentityseed_.IsDefault()) { + _impl_.groupidentityseed_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void GroupUpdatePromoteMessage::set_allocated_groupidentityseed(std::string* groupidentityseed) { + if (groupidentityseed != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.groupidentityseed_.SetAllocated(groupidentityseed, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.groupidentityseed_.IsDefault()) { + _impl_.groupidentityseed_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdatePromoteMessage.groupIdentitySeed) +} + +// required string name = 2; +inline bool GroupUpdatePromoteMessage::_internal_has_name() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool GroupUpdatePromoteMessage::has_name() const { + return _internal_has_name(); +} +inline void GroupUpdatePromoteMessage::clear_name() { + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline const std::string& GroupUpdatePromoteMessage::name() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdatePromoteMessage.name) + return _internal_name(); } -inline std::string* AttachmentPointer::mutable_thumbnail() { - std::string* _s = _internal_mutable_thumbnail(); - // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.thumbnail) +template +inline PROTOBUF_ALWAYS_INLINE +void GroupUpdatePromoteMessage::set_name(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdatePromoteMessage.name) +} +inline std::string* GroupUpdatePromoteMessage::mutable_name() { + std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdatePromoteMessage.name) return _s; } -inline const std::string& AttachmentPointer::_internal_thumbnail() const { - return _impl_.thumbnail_.Get(); +inline const std::string& GroupUpdatePromoteMessage::_internal_name() const { + return _impl_.name_.Get(); } -inline void AttachmentPointer::_internal_set_thumbnail(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.thumbnail_.Set(value, GetArenaForAllocation()); +inline void GroupUpdatePromoteMessage::_internal_set_name(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.name_.Set(value, GetArenaForAllocation()); } -inline std::string* AttachmentPointer::_internal_mutable_thumbnail() { - _impl_._has_bits_[0] |= 0x00000004u; - return _impl_.thumbnail_.Mutable(GetArenaForAllocation()); +inline std::string* GroupUpdatePromoteMessage::_internal_mutable_name() { + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.name_.Mutable(GetArenaForAllocation()); } -inline std::string* AttachmentPointer::release_thumbnail() { - // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.thumbnail) - if (!_internal_has_thumbnail()) { +inline std::string* GroupUpdatePromoteMessage::release_name() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdatePromoteMessage.name) + if (!_internal_has_name()) { return nullptr; } - _impl_._has_bits_[0] &= ~0x00000004u; - auto* p = _impl_.thumbnail_.Release(); + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.name_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.thumbnail_.IsDefault()) { - _impl_.thumbnail_.Set("", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void AttachmentPointer::set_allocated_thumbnail(std::string* thumbnail) { - if (thumbnail != nullptr) { - _impl_._has_bits_[0] |= 0x00000004u; +inline void GroupUpdatePromoteMessage::set_allocated_name(std::string* name) { + if (name != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; } else { - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000002u; } - _impl_.thumbnail_.SetAllocated(thumbnail, GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.thumbnail_.IsDefault()) { - _impl_.thumbnail_.Set("", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.thumbnail) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdatePromoteMessage.name) } -// optional bytes digest = 6; -inline bool AttachmentPointer::_internal_has_digest() const { +// ------------------------------------------------------------------- + +// GroupUpdateInfoChangeMessage + +// required .SessionProtos.GroupUpdateInfoChangeMessage.Type type = 1; +inline bool GroupUpdateInfoChangeMessage::_internal_has_type() const { bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; return value; } -inline bool AttachmentPointer::has_digest() const { - return _internal_has_digest(); +inline bool GroupUpdateInfoChangeMessage::has_type() const { + return _internal_has_type(); } -inline void AttachmentPointer::clear_digest() { - _impl_.digest_.ClearToEmpty(); +inline void GroupUpdateInfoChangeMessage::clear_type() { + _impl_.type_ = 1; _impl_._has_bits_[0] &= ~0x00000008u; } -inline const std::string& AttachmentPointer::digest() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.digest) - return _internal_digest(); +inline ::SessionProtos::GroupUpdateInfoChangeMessage_Type GroupUpdateInfoChangeMessage::_internal_type() const { + return static_cast< ::SessionProtos::GroupUpdateInfoChangeMessage_Type >(_impl_.type_); +} +inline ::SessionProtos::GroupUpdateInfoChangeMessage_Type GroupUpdateInfoChangeMessage::type() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateInfoChangeMessage.type) + return _internal_type(); +} +inline void GroupUpdateInfoChangeMessage::_internal_set_type(::SessionProtos::GroupUpdateInfoChangeMessage_Type value) { + assert(::SessionProtos::GroupUpdateInfoChangeMessage_Type_IsValid(value)); + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.type_ = value; +} +inline void GroupUpdateInfoChangeMessage::set_type(::SessionProtos::GroupUpdateInfoChangeMessage_Type value) { + _internal_set_type(value); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateInfoChangeMessage.type) +} + +// optional string updatedName = 2; +inline bool GroupUpdateInfoChangeMessage::_internal_has_updatedname() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool GroupUpdateInfoChangeMessage::has_updatedname() const { + return _internal_has_updatedname(); +} +inline void GroupUpdateInfoChangeMessage::clear_updatedname() { + _impl_.updatedname_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& GroupUpdateInfoChangeMessage::updatedname() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateInfoChangeMessage.updatedName) + return _internal_updatedname(); } template inline PROTOBUF_ALWAYS_INLINE -void AttachmentPointer::set_digest(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000008u; - _impl_.digest_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.digest) +void GroupUpdateInfoChangeMessage::set_updatedname(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.updatedname_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateInfoChangeMessage.updatedName) } -inline std::string* AttachmentPointer::mutable_digest() { - std::string* _s = _internal_mutable_digest(); - // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.digest) +inline std::string* GroupUpdateInfoChangeMessage::mutable_updatedname() { + std::string* _s = _internal_mutable_updatedname(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateInfoChangeMessage.updatedName) return _s; } -inline const std::string& AttachmentPointer::_internal_digest() const { - return _impl_.digest_.Get(); +inline const std::string& GroupUpdateInfoChangeMessage::_internal_updatedname() const { + return _impl_.updatedname_.Get(); } -inline void AttachmentPointer::_internal_set_digest(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000008u; - _impl_.digest_.Set(value, GetArenaForAllocation()); +inline void GroupUpdateInfoChangeMessage::_internal_set_updatedname(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.updatedname_.Set(value, GetArenaForAllocation()); } -inline std::string* AttachmentPointer::_internal_mutable_digest() { - _impl_._has_bits_[0] |= 0x00000008u; - return _impl_.digest_.Mutable(GetArenaForAllocation()); +inline std::string* GroupUpdateInfoChangeMessage::_internal_mutable_updatedname() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.updatedname_.Mutable(GetArenaForAllocation()); } -inline std::string* AttachmentPointer::release_digest() { - // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.digest) - if (!_internal_has_digest()) { +inline std::string* GroupUpdateInfoChangeMessage::release_updatedname() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateInfoChangeMessage.updatedName) + if (!_internal_has_updatedname()) { return nullptr; } - _impl_._has_bits_[0] &= ~0x00000008u; - auto* p = _impl_.digest_.Release(); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.updatedname_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.digest_.IsDefault()) { - _impl_.digest_.Set("", GetArenaForAllocation()); + if (_impl_.updatedname_.IsDefault()) { + _impl_.updatedname_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void AttachmentPointer::set_allocated_digest(std::string* digest) { - if (digest != nullptr) { - _impl_._has_bits_[0] |= 0x00000008u; +inline void GroupUpdateInfoChangeMessage::set_allocated_updatedname(std::string* updatedname) { + if (updatedname != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; } else { - _impl_._has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.digest_.SetAllocated(digest, GetArenaForAllocation()); + _impl_.updatedname_.SetAllocated(updatedname, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.digest_.IsDefault()) { - _impl_.digest_.Set("", GetArenaForAllocation()); + if (_impl_.updatedname_.IsDefault()) { + _impl_.updatedname_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.digest) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateInfoChangeMessage.updatedName) } -// optional string fileName = 7; -inline bool AttachmentPointer::_internal_has_filename() const { - bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; +// optional uint32 updatedExpiration = 3; +inline bool GroupUpdateInfoChangeMessage::_internal_has_updatedexpiration() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } -inline bool AttachmentPointer::has_filename() const { - return _internal_has_filename(); +inline bool GroupUpdateInfoChangeMessage::has_updatedexpiration() const { + return _internal_has_updatedexpiration(); } -inline void AttachmentPointer::clear_filename() { - _impl_.filename_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000010u; +inline void GroupUpdateInfoChangeMessage::clear_updatedexpiration() { + _impl_.updatedexpiration_ = 0u; + _impl_._has_bits_[0] &= ~0x00000004u; } -inline const std::string& AttachmentPointer::filename() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.fileName) - return _internal_filename(); +inline uint32_t GroupUpdateInfoChangeMessage::_internal_updatedexpiration() const { + return _impl_.updatedexpiration_; +} +inline uint32_t GroupUpdateInfoChangeMessage::updatedexpiration() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateInfoChangeMessage.updatedExpiration) + return _internal_updatedexpiration(); +} +inline void GroupUpdateInfoChangeMessage::_internal_set_updatedexpiration(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.updatedexpiration_ = value; +} +inline void GroupUpdateInfoChangeMessage::set_updatedexpiration(uint32_t value) { + _internal_set_updatedexpiration(value); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateInfoChangeMessage.updatedExpiration) +} + +// required bytes adminSignature = 4; +inline bool GroupUpdateInfoChangeMessage::_internal_has_adminsignature() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool GroupUpdateInfoChangeMessage::has_adminsignature() const { + return _internal_has_adminsignature(); +} +inline void GroupUpdateInfoChangeMessage::clear_adminsignature() { + _impl_.adminsignature_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline const std::string& GroupUpdateInfoChangeMessage::adminsignature() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateInfoChangeMessage.adminSignature) + return _internal_adminsignature(); } template inline PROTOBUF_ALWAYS_INLINE -void AttachmentPointer::set_filename(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000010u; - _impl_.filename_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.fileName) +void GroupUpdateInfoChangeMessage::set_adminsignature(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.adminsignature_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateInfoChangeMessage.adminSignature) } -inline std::string* AttachmentPointer::mutable_filename() { - std::string* _s = _internal_mutable_filename(); - // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.fileName) +inline std::string* GroupUpdateInfoChangeMessage::mutable_adminsignature() { + std::string* _s = _internal_mutable_adminsignature(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateInfoChangeMessage.adminSignature) return _s; } -inline const std::string& AttachmentPointer::_internal_filename() const { - return _impl_.filename_.Get(); +inline const std::string& GroupUpdateInfoChangeMessage::_internal_adminsignature() const { + return _impl_.adminsignature_.Get(); } -inline void AttachmentPointer::_internal_set_filename(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000010u; - _impl_.filename_.Set(value, GetArenaForAllocation()); +inline void GroupUpdateInfoChangeMessage::_internal_set_adminsignature(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.adminsignature_.Set(value, GetArenaForAllocation()); } -inline std::string* AttachmentPointer::_internal_mutable_filename() { - _impl_._has_bits_[0] |= 0x00000010u; - return _impl_.filename_.Mutable(GetArenaForAllocation()); +inline std::string* GroupUpdateInfoChangeMessage::_internal_mutable_adminsignature() { + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.adminsignature_.Mutable(GetArenaForAllocation()); } -inline std::string* AttachmentPointer::release_filename() { - // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.fileName) - if (!_internal_has_filename()) { +inline std::string* GroupUpdateInfoChangeMessage::release_adminsignature() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateInfoChangeMessage.adminSignature) + if (!_internal_has_adminsignature()) { return nullptr; } - _impl_._has_bits_[0] &= ~0x00000010u; - auto* p = _impl_.filename_.Release(); + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.adminsignature_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.filename_.IsDefault()) { - _impl_.filename_.Set("", GetArenaForAllocation()); + if (_impl_.adminsignature_.IsDefault()) { + _impl_.adminsignature_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void AttachmentPointer::set_allocated_filename(std::string* filename) { - if (filename != nullptr) { - _impl_._has_bits_[0] |= 0x00000010u; +inline void GroupUpdateInfoChangeMessage::set_allocated_adminsignature(std::string* adminsignature) { + if (adminsignature != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; } else { - _impl_._has_bits_[0] &= ~0x00000010u; + _impl_._has_bits_[0] &= ~0x00000002u; } - _impl_.filename_.SetAllocated(filename, GetArenaForAllocation()); + _impl_.adminsignature_.SetAllocated(adminsignature, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.filename_.IsDefault()) { - _impl_.filename_.Set("", GetArenaForAllocation()); + if (_impl_.adminsignature_.IsDefault()) { + _impl_.adminsignature_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.fileName) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateInfoChangeMessage.adminSignature) } -// optional uint32 flags = 8; -inline bool AttachmentPointer::_internal_has_flags() const { - bool value = (_impl_._has_bits_[0] & 0x00000200u) != 0; +// ------------------------------------------------------------------- + +// GroupUpdateMemberChangeMessage + +// required .SessionProtos.GroupUpdateMemberChangeMessage.Type type = 1; +inline bool GroupUpdateMemberChangeMessage::_internal_has_type() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } -inline bool AttachmentPointer::has_flags() const { - return _internal_has_flags(); +inline bool GroupUpdateMemberChangeMessage::has_type() const { + return _internal_has_type(); } -inline void AttachmentPointer::clear_flags() { - _impl_.flags_ = 0u; - _impl_._has_bits_[0] &= ~0x00000200u; +inline void GroupUpdateMemberChangeMessage::clear_type() { + _impl_.type_ = 1; + _impl_._has_bits_[0] &= ~0x00000004u; } -inline uint32_t AttachmentPointer::_internal_flags() const { - return _impl_.flags_; +inline ::SessionProtos::GroupUpdateMemberChangeMessage_Type GroupUpdateMemberChangeMessage::_internal_type() const { + return static_cast< ::SessionProtos::GroupUpdateMemberChangeMessage_Type >(_impl_.type_); } -inline uint32_t AttachmentPointer::flags() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.flags) - return _internal_flags(); +inline ::SessionProtos::GroupUpdateMemberChangeMessage_Type GroupUpdateMemberChangeMessage::type() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMemberChangeMessage.type) + return _internal_type(); } -inline void AttachmentPointer::_internal_set_flags(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000200u; - _impl_.flags_ = value; +inline void GroupUpdateMemberChangeMessage::_internal_set_type(::SessionProtos::GroupUpdateMemberChangeMessage_Type value) { + assert(::SessionProtos::GroupUpdateMemberChangeMessage_Type_IsValid(value)); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.type_ = value; } -inline void AttachmentPointer::set_flags(uint32_t value) { - _internal_set_flags(value); - // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.flags) +inline void GroupUpdateMemberChangeMessage::set_type(::SessionProtos::GroupUpdateMemberChangeMessage_Type value) { + _internal_set_type(value); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateMemberChangeMessage.type) } -// optional uint32 width = 9; -inline bool AttachmentPointer::_internal_has_width() const { - bool value = (_impl_._has_bits_[0] & 0x00000400u) != 0; - return value; +// repeated string memberSessionIds = 2; +inline int GroupUpdateMemberChangeMessage::_internal_membersessionids_size() const { + return _impl_.membersessionids_.size(); } -inline bool AttachmentPointer::has_width() const { - return _internal_has_width(); +inline int GroupUpdateMemberChangeMessage::membersessionids_size() const { + return _internal_membersessionids_size(); } -inline void AttachmentPointer::clear_width() { - _impl_.width_ = 0u; - _impl_._has_bits_[0] &= ~0x00000400u; +inline void GroupUpdateMemberChangeMessage::clear_membersessionids() { + _impl_.membersessionids_.Clear(); } -inline uint32_t AttachmentPointer::_internal_width() const { - return _impl_.width_; +inline std::string* GroupUpdateMemberChangeMessage::add_membersessionids() { + std::string* _s = _internal_add_membersessionids(); + // @@protoc_insertion_point(field_add_mutable:SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds) + return _s; } -inline uint32_t AttachmentPointer::width() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.width) - return _internal_width(); +inline const std::string& GroupUpdateMemberChangeMessage::_internal_membersessionids(int index) const { + return _impl_.membersessionids_.Get(index); } -inline void AttachmentPointer::_internal_set_width(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000400u; - _impl_.width_ = value; +inline const std::string& GroupUpdateMemberChangeMessage::membersessionids(int index) const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds) + return _internal_membersessionids(index); } -inline void AttachmentPointer::set_width(uint32_t value) { - _internal_set_width(value); - // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.width) +inline std::string* GroupUpdateMemberChangeMessage::mutable_membersessionids(int index) { + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds) + return _impl_.membersessionids_.Mutable(index); +} +inline void GroupUpdateMemberChangeMessage::set_membersessionids(int index, const std::string& value) { + _impl_.membersessionids_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds) +} +inline void GroupUpdateMemberChangeMessage::set_membersessionids(int index, std::string&& value) { + _impl_.membersessionids_.Mutable(index)->assign(std::move(value)); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds) +} +inline void GroupUpdateMemberChangeMessage::set_membersessionids(int index, const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.membersessionids_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds) +} +inline void GroupUpdateMemberChangeMessage::set_membersessionids(int index, const char* value, size_t size) { + _impl_.membersessionids_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds) +} +inline std::string* GroupUpdateMemberChangeMessage::_internal_add_membersessionids() { + return _impl_.membersessionids_.Add(); +} +inline void GroupUpdateMemberChangeMessage::add_membersessionids(const std::string& value) { + _impl_.membersessionids_.Add()->assign(value); + // @@protoc_insertion_point(field_add:SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds) +} +inline void GroupUpdateMemberChangeMessage::add_membersessionids(std::string&& value) { + _impl_.membersessionids_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds) +} +inline void GroupUpdateMemberChangeMessage::add_membersessionids(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.membersessionids_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds) +} +inline void GroupUpdateMemberChangeMessage::add_membersessionids(const char* value, size_t size) { + _impl_.membersessionids_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& +GroupUpdateMemberChangeMessage::membersessionids() const { + // @@protoc_insertion_point(field_list:SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds) + return _impl_.membersessionids_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* +GroupUpdateMemberChangeMessage::mutable_membersessionids() { + // @@protoc_insertion_point(field_mutable_list:SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds) + return &_impl_.membersessionids_; } -// optional uint32 height = 10; -inline bool AttachmentPointer::_internal_has_height() const { - bool value = (_impl_._has_bits_[0] & 0x00000800u) != 0; +// optional bool historyShared = 3; +inline bool GroupUpdateMemberChangeMessage::_internal_has_historyshared() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } -inline bool AttachmentPointer::has_height() const { - return _internal_has_height(); +inline bool GroupUpdateMemberChangeMessage::has_historyshared() const { + return _internal_has_historyshared(); } -inline void AttachmentPointer::clear_height() { - _impl_.height_ = 0u; - _impl_._has_bits_[0] &= ~0x00000800u; +inline void GroupUpdateMemberChangeMessage::clear_historyshared() { + _impl_.historyshared_ = false; + _impl_._has_bits_[0] &= ~0x00000002u; } -inline uint32_t AttachmentPointer::_internal_height() const { - return _impl_.height_; +inline bool GroupUpdateMemberChangeMessage::_internal_historyshared() const { + return _impl_.historyshared_; } -inline uint32_t AttachmentPointer::height() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.height) - return _internal_height(); +inline bool GroupUpdateMemberChangeMessage::historyshared() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMemberChangeMessage.historyShared) + return _internal_historyshared(); } -inline void AttachmentPointer::_internal_set_height(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000800u; - _impl_.height_ = value; +inline void GroupUpdateMemberChangeMessage::_internal_set_historyshared(bool value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.historyshared_ = value; } -inline void AttachmentPointer::set_height(uint32_t value) { - _internal_set_height(value); - // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.height) +inline void GroupUpdateMemberChangeMessage::set_historyshared(bool value) { + _internal_set_historyshared(value); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateMemberChangeMessage.historyShared) } -// optional string caption = 11; -inline bool AttachmentPointer::_internal_has_caption() const { - bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; +// required bytes adminSignature = 4; +inline bool GroupUpdateMemberChangeMessage::_internal_has_adminsignature() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool AttachmentPointer::has_caption() const { - return _internal_has_caption(); +inline bool GroupUpdateMemberChangeMessage::has_adminsignature() const { + return _internal_has_adminsignature(); } -inline void AttachmentPointer::clear_caption() { - _impl_.caption_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000020u; +inline void GroupUpdateMemberChangeMessage::clear_adminsignature() { + _impl_.adminsignature_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& AttachmentPointer::caption() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.caption) - return _internal_caption(); +inline const std::string& GroupUpdateMemberChangeMessage::adminsignature() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMemberChangeMessage.adminSignature) + return _internal_adminsignature(); } template inline PROTOBUF_ALWAYS_INLINE -void AttachmentPointer::set_caption(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000020u; - _impl_.caption_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.caption) +void GroupUpdateMemberChangeMessage::set_adminsignature(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.adminsignature_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateMemberChangeMessage.adminSignature) } -inline std::string* AttachmentPointer::mutable_caption() { - std::string* _s = _internal_mutable_caption(); - // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.caption) +inline std::string* GroupUpdateMemberChangeMessage::mutable_adminsignature() { + std::string* _s = _internal_mutable_adminsignature(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateMemberChangeMessage.adminSignature) return _s; } -inline const std::string& AttachmentPointer::_internal_caption() const { - return _impl_.caption_.Get(); +inline const std::string& GroupUpdateMemberChangeMessage::_internal_adminsignature() const { + return _impl_.adminsignature_.Get(); } -inline void AttachmentPointer::_internal_set_caption(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000020u; - _impl_.caption_.Set(value, GetArenaForAllocation()); +inline void GroupUpdateMemberChangeMessage::_internal_set_adminsignature(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.adminsignature_.Set(value, GetArenaForAllocation()); } -inline std::string* AttachmentPointer::_internal_mutable_caption() { - _impl_._has_bits_[0] |= 0x00000020u; - return _impl_.caption_.Mutable(GetArenaForAllocation()); +inline std::string* GroupUpdateMemberChangeMessage::_internal_mutable_adminsignature() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.adminsignature_.Mutable(GetArenaForAllocation()); } -inline std::string* AttachmentPointer::release_caption() { - // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.caption) - if (!_internal_has_caption()) { +inline std::string* GroupUpdateMemberChangeMessage::release_adminsignature() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateMemberChangeMessage.adminSignature) + if (!_internal_has_adminsignature()) { return nullptr; } - _impl_._has_bits_[0] &= ~0x00000020u; - auto* p = _impl_.caption_.Release(); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.adminsignature_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.caption_.IsDefault()) { - _impl_.caption_.Set("", GetArenaForAllocation()); + if (_impl_.adminsignature_.IsDefault()) { + _impl_.adminsignature_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void AttachmentPointer::set_allocated_caption(std::string* caption) { - if (caption != nullptr) { - _impl_._has_bits_[0] |= 0x00000020u; +inline void GroupUpdateMemberChangeMessage::set_allocated_adminsignature(std::string* adminsignature) { + if (adminsignature != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; } else { - _impl_._has_bits_[0] &= ~0x00000020u; + _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.caption_.SetAllocated(caption, GetArenaForAllocation()); + _impl_.adminsignature_.SetAllocated(adminsignature, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.caption_.IsDefault()) { - _impl_.caption_.Set("", GetArenaForAllocation()); + if (_impl_.adminsignature_.IsDefault()) { + _impl_.adminsignature_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.caption) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateMemberChangeMessage.adminSignature) } -// optional string url = 101; -inline bool AttachmentPointer::_internal_has_url() const { - bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; +// ------------------------------------------------------------------- + +// GroupUpdateMemberLeftMessage + +// ------------------------------------------------------------------- + +// GroupUpdateMemberLeftNotificationMessage + +// ------------------------------------------------------------------- + +// GroupUpdateInviteResponseMessage + +// required bool isApproved = 1; +inline bool GroupUpdateInviteResponseMessage::_internal_has_isapproved() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool AttachmentPointer::has_url() const { - return _internal_has_url(); +inline bool GroupUpdateInviteResponseMessage::has_isapproved() const { + return _internal_has_isapproved(); } -inline void AttachmentPointer::clear_url() { - _impl_.url_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000040u; +inline void GroupUpdateInviteResponseMessage::clear_isapproved() { + _impl_.isapproved_ = false; + _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& AttachmentPointer::url() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.url) - return _internal_url(); +inline bool GroupUpdateInviteResponseMessage::_internal_isapproved() const { + return _impl_.isapproved_; } -template -inline PROTOBUF_ALWAYS_INLINE -void AttachmentPointer::set_url(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000040u; - _impl_.url_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.url) +inline bool GroupUpdateInviteResponseMessage::isapproved() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateInviteResponseMessage.isApproved) + return _internal_isapproved(); } -inline std::string* AttachmentPointer::mutable_url() { - std::string* _s = _internal_mutable_url(); - // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.url) +inline void GroupUpdateInviteResponseMessage::_internal_set_isapproved(bool value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.isapproved_ = value; +} +inline void GroupUpdateInviteResponseMessage::set_isapproved(bool value) { + _internal_set_isapproved(value); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateInviteResponseMessage.isApproved) +} + +// ------------------------------------------------------------------- + +// GroupUpdateDeleteMemberContentMessage + +// repeated string memberSessionIds = 1; +inline int GroupUpdateDeleteMemberContentMessage::_internal_membersessionids_size() const { + return _impl_.membersessionids_.size(); +} +inline int GroupUpdateDeleteMemberContentMessage::membersessionids_size() const { + return _internal_membersessionids_size(); +} +inline void GroupUpdateDeleteMemberContentMessage::clear_membersessionids() { + _impl_.membersessionids_.Clear(); +} +inline std::string* GroupUpdateDeleteMemberContentMessage::add_membersessionids() { + std::string* _s = _internal_add_membersessionids(); + // @@protoc_insertion_point(field_add_mutable:SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds) return _s; } -inline const std::string& AttachmentPointer::_internal_url() const { - return _impl_.url_.Get(); +inline const std::string& GroupUpdateDeleteMemberContentMessage::_internal_membersessionids(int index) const { + return _impl_.membersessionids_.Get(index); } -inline void AttachmentPointer::_internal_set_url(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000040u; - _impl_.url_.Set(value, GetArenaForAllocation()); +inline const std::string& GroupUpdateDeleteMemberContentMessage::membersessionids(int index) const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds) + return _internal_membersessionids(index); } -inline std::string* AttachmentPointer::_internal_mutable_url() { - _impl_._has_bits_[0] |= 0x00000040u; - return _impl_.url_.Mutable(GetArenaForAllocation()); +inline std::string* GroupUpdateDeleteMemberContentMessage::mutable_membersessionids(int index) { + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds) + return _impl_.membersessionids_.Mutable(index); } -inline std::string* AttachmentPointer::release_url() { - // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.url) - if (!_internal_has_url()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000040u; - auto* p = _impl_.url_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.url_.IsDefault()) { - _impl_.url_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; +inline void GroupUpdateDeleteMemberContentMessage::set_membersessionids(int index, const std::string& value) { + _impl_.membersessionids_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds) } -inline void AttachmentPointer::set_allocated_url(std::string* url) { - if (url != nullptr) { - _impl_._has_bits_[0] |= 0x00000040u; - } else { - _impl_._has_bits_[0] &= ~0x00000040u; - } - _impl_.url_.SetAllocated(url, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.url_.IsDefault()) { - _impl_.url_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.url) +inline void GroupUpdateDeleteMemberContentMessage::set_membersessionids(int index, std::string&& value) { + _impl_.membersessionids_.Mutable(index)->assign(std::move(value)); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds) } - -// ------------------------------------------------------------------- - -// SharedConfigMessage - -// required .SessionProtos.SharedConfigMessage.Kind kind = 1; -inline bool SharedConfigMessage::_internal_has_kind() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; - return value; +inline void GroupUpdateDeleteMemberContentMessage::set_membersessionids(int index, const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.membersessionids_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds) } -inline bool SharedConfigMessage::has_kind() const { - return _internal_has_kind(); +inline void GroupUpdateDeleteMemberContentMessage::set_membersessionids(int index, const char* value, size_t size) { + _impl_.membersessionids_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds) } -inline void SharedConfigMessage::clear_kind() { - _impl_.kind_ = 1; - _impl_._has_bits_[0] &= ~0x00000004u; +inline std::string* GroupUpdateDeleteMemberContentMessage::_internal_add_membersessionids() { + return _impl_.membersessionids_.Add(); } -inline ::SessionProtos::SharedConfigMessage_Kind SharedConfigMessage::_internal_kind() const { - return static_cast< ::SessionProtos::SharedConfigMessage_Kind >(_impl_.kind_); +inline void GroupUpdateDeleteMemberContentMessage::add_membersessionids(const std::string& value) { + _impl_.membersessionids_.Add()->assign(value); + // @@protoc_insertion_point(field_add:SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds) } -inline ::SessionProtos::SharedConfigMessage_Kind SharedConfigMessage::kind() const { - // @@protoc_insertion_point(field_get:SessionProtos.SharedConfigMessage.kind) - return _internal_kind(); +inline void GroupUpdateDeleteMemberContentMessage::add_membersessionids(std::string&& value) { + _impl_.membersessionids_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds) } -inline void SharedConfigMessage::_internal_set_kind(::SessionProtos::SharedConfigMessage_Kind value) { - assert(::SessionProtos::SharedConfigMessage_Kind_IsValid(value)); - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.kind_ = value; +inline void GroupUpdateDeleteMemberContentMessage::add_membersessionids(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.membersessionids_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds) } -inline void SharedConfigMessage::set_kind(::SessionProtos::SharedConfigMessage_Kind value) { - _internal_set_kind(value); - // @@protoc_insertion_point(field_set:SessionProtos.SharedConfigMessage.kind) +inline void GroupUpdateDeleteMemberContentMessage::add_membersessionids(const char* value, size_t size) { + _impl_.membersessionids_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& +GroupUpdateDeleteMemberContentMessage::membersessionids() const { + // @@protoc_insertion_point(field_list:SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds) + return _impl_.membersessionids_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* +GroupUpdateDeleteMemberContentMessage::mutable_membersessionids() { + // @@protoc_insertion_point(field_mutable_list:SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds) + return &_impl_.membersessionids_; } -// required int64 seqno = 2; -inline bool SharedConfigMessage::_internal_has_seqno() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - return value; +// repeated string messageHashes = 2; +inline int GroupUpdateDeleteMemberContentMessage::_internal_messagehashes_size() const { + return _impl_.messagehashes_.size(); } -inline bool SharedConfigMessage::has_seqno() const { - return _internal_has_seqno(); +inline int GroupUpdateDeleteMemberContentMessage::messagehashes_size() const { + return _internal_messagehashes_size(); } -inline void SharedConfigMessage::clear_seqno() { - _impl_.seqno_ = int64_t{0}; - _impl_._has_bits_[0] &= ~0x00000002u; +inline void GroupUpdateDeleteMemberContentMessage::clear_messagehashes() { + _impl_.messagehashes_.Clear(); } -inline int64_t SharedConfigMessage::_internal_seqno() const { - return _impl_.seqno_; +inline std::string* GroupUpdateDeleteMemberContentMessage::add_messagehashes() { + std::string* _s = _internal_add_messagehashes(); + // @@protoc_insertion_point(field_add_mutable:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) + return _s; } -inline int64_t SharedConfigMessage::seqno() const { - // @@protoc_insertion_point(field_get:SessionProtos.SharedConfigMessage.seqno) - return _internal_seqno(); +inline const std::string& GroupUpdateDeleteMemberContentMessage::_internal_messagehashes(int index) const { + return _impl_.messagehashes_.Get(index); } -inline void SharedConfigMessage::_internal_set_seqno(int64_t value) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.seqno_ = value; +inline const std::string& GroupUpdateDeleteMemberContentMessage::messagehashes(int index) const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) + return _internal_messagehashes(index); } -inline void SharedConfigMessage::set_seqno(int64_t value) { - _internal_set_seqno(value); - // @@protoc_insertion_point(field_set:SessionProtos.SharedConfigMessage.seqno) +inline std::string* GroupUpdateDeleteMemberContentMessage::mutable_messagehashes(int index) { + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) + return _impl_.messagehashes_.Mutable(index); +} +inline void GroupUpdateDeleteMemberContentMessage::set_messagehashes(int index, const std::string& value) { + _impl_.messagehashes_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +} +inline void GroupUpdateDeleteMemberContentMessage::set_messagehashes(int index, std::string&& value) { + _impl_.messagehashes_.Mutable(index)->assign(std::move(value)); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +} +inline void GroupUpdateDeleteMemberContentMessage::set_messagehashes(int index, const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.messagehashes_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +} +inline void GroupUpdateDeleteMemberContentMessage::set_messagehashes(int index, const char* value, size_t size) { + _impl_.messagehashes_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +} +inline std::string* GroupUpdateDeleteMemberContentMessage::_internal_add_messagehashes() { + return _impl_.messagehashes_.Add(); +} +inline void GroupUpdateDeleteMemberContentMessage::add_messagehashes(const std::string& value) { + _impl_.messagehashes_.Add()->assign(value); + // @@protoc_insertion_point(field_add:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +} +inline void GroupUpdateDeleteMemberContentMessage::add_messagehashes(std::string&& value) { + _impl_.messagehashes_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +} +inline void GroupUpdateDeleteMemberContentMessage::add_messagehashes(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.messagehashes_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +} +inline void GroupUpdateDeleteMemberContentMessage::add_messagehashes(const char* value, size_t size) { + _impl_.messagehashes_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& +GroupUpdateDeleteMemberContentMessage::messagehashes() const { + // @@protoc_insertion_point(field_list:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) + return _impl_.messagehashes_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* +GroupUpdateDeleteMemberContentMessage::mutable_messagehashes() { + // @@protoc_insertion_point(field_mutable_list:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) + return &_impl_.messagehashes_; } -// required bytes data = 3; -inline bool SharedConfigMessage::_internal_has_data() const { +// optional bytes adminSignature = 3; +inline bool GroupUpdateDeleteMemberContentMessage::_internal_has_adminsignature() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool SharedConfigMessage::has_data() const { - return _internal_has_data(); +inline bool GroupUpdateDeleteMemberContentMessage::has_adminsignature() const { + return _internal_has_adminsignature(); } -inline void SharedConfigMessage::clear_data() { - _impl_.data_.ClearToEmpty(); +inline void GroupUpdateDeleteMemberContentMessage::clear_adminsignature() { + _impl_.adminsignature_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& SharedConfigMessage::data() const { - // @@protoc_insertion_point(field_get:SessionProtos.SharedConfigMessage.data) - return _internal_data(); +inline const std::string& GroupUpdateDeleteMemberContentMessage::adminsignature() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateDeleteMemberContentMessage.adminSignature) + return _internal_adminsignature(); } template inline PROTOBUF_ALWAYS_INLINE -void SharedConfigMessage::set_data(ArgT0&& arg0, ArgT... args) { +void GroupUpdateDeleteMemberContentMessage::set_adminsignature(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.data_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.SharedConfigMessage.data) + _impl_.adminsignature_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateDeleteMemberContentMessage.adminSignature) } -inline std::string* SharedConfigMessage::mutable_data() { - std::string* _s = _internal_mutable_data(); - // @@protoc_insertion_point(field_mutable:SessionProtos.SharedConfigMessage.data) +inline std::string* GroupUpdateDeleteMemberContentMessage::mutable_adminsignature() { + std::string* _s = _internal_mutable_adminsignature(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateDeleteMemberContentMessage.adminSignature) return _s; } -inline const std::string& SharedConfigMessage::_internal_data() const { - return _impl_.data_.Get(); +inline const std::string& GroupUpdateDeleteMemberContentMessage::_internal_adminsignature() const { + return _impl_.adminsignature_.Get(); } -inline void SharedConfigMessage::_internal_set_data(const std::string& value) { +inline void GroupUpdateDeleteMemberContentMessage::_internal_set_adminsignature(const std::string& value) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.data_.Set(value, GetArenaForAllocation()); + _impl_.adminsignature_.Set(value, GetArenaForAllocation()); } -inline std::string* SharedConfigMessage::_internal_mutable_data() { +inline std::string* GroupUpdateDeleteMemberContentMessage::_internal_mutable_adminsignature() { _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.data_.Mutable(GetArenaForAllocation()); + return _impl_.adminsignature_.Mutable(GetArenaForAllocation()); } -inline std::string* SharedConfigMessage::release_data() { - // @@protoc_insertion_point(field_release:SessionProtos.SharedConfigMessage.data) - if (!_internal_has_data()) { +inline std::string* GroupUpdateDeleteMemberContentMessage::release_adminsignature() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateDeleteMemberContentMessage.adminSignature) + if (!_internal_has_adminsignature()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.data_.Release(); + auto* p = _impl_.adminsignature_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.data_.IsDefault()) { - _impl_.data_.Set("", GetArenaForAllocation()); + if (_impl_.adminsignature_.IsDefault()) { + _impl_.adminsignature_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void SharedConfigMessage::set_allocated_data(std::string* data) { - if (data != nullptr) { +inline void GroupUpdateDeleteMemberContentMessage::set_allocated_adminsignature(std::string* adminsignature) { + if (adminsignature != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; } else { _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.data_.SetAllocated(data, GetArenaForAllocation()); + _impl_.adminsignature_.SetAllocated(adminsignature, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.data_.IsDefault()) { - _impl_.data_.Set("", GetArenaForAllocation()); + if (_impl_.adminsignature_.IsDefault()) { + _impl_.adminsignature_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.SharedConfigMessage.data) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateDeleteMemberContentMessage.adminSignature) } #ifdef __GNUC__ @@ -13623,6 +13415,8 @@ inline void SharedConfigMessage::set_allocated_data(std::string* data) { // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) @@ -13631,16 +13425,70 @@ inline void SharedConfigMessage::set_allocated_data(std::string* data) { PROTOBUF_NAMESPACE_OPEN template <> struct is_proto_enum< ::SessionProtos::Envelope_Type> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::Envelope_Type>() { + return ::SessionProtos::Envelope_Type_descriptor(); +} template <> struct is_proto_enum< ::SessionProtos::TypingMessage_Action> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::TypingMessage_Action>() { + return ::SessionProtos::TypingMessage_Action_descriptor(); +} +template <> struct is_proto_enum< ::SessionProtos::Content_ExpirationType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::Content_ExpirationType>() { + return ::SessionProtos::Content_ExpirationType_descriptor(); +} template <> struct is_proto_enum< ::SessionProtos::CallMessage_Type> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::CallMessage_Type>() { + return ::SessionProtos::CallMessage_Type_descriptor(); +} template <> struct is_proto_enum< ::SessionProtos::DataExtractionNotification_Type> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::DataExtractionNotification_Type>() { + return ::SessionProtos::DataExtractionNotification_Type_descriptor(); +} template <> struct is_proto_enum< ::SessionProtos::DataMessage_Quote_QuotedAttachment_Flags> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::DataMessage_Quote_QuotedAttachment_Flags>() { + return ::SessionProtos::DataMessage_Quote_QuotedAttachment_Flags_descriptor(); +} template <> struct is_proto_enum< ::SessionProtos::DataMessage_Reaction_Action> : ::std::true_type {}; -template <> struct is_proto_enum< ::SessionProtos::DataMessage_ClosedGroupControlMessage_Type> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::DataMessage_Reaction_Action>() { + return ::SessionProtos::DataMessage_Reaction_Action_descriptor(); +} template <> struct is_proto_enum< ::SessionProtos::DataMessage_Flags> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::DataMessage_Flags>() { + return ::SessionProtos::DataMessage_Flags_descriptor(); +} template <> struct is_proto_enum< ::SessionProtos::ReceiptMessage_Type> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::ReceiptMessage_Type>() { + return ::SessionProtos::ReceiptMessage_Type_descriptor(); +} template <> struct is_proto_enum< ::SessionProtos::AttachmentPointer_Flags> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::AttachmentPointer_Flags>() { + return ::SessionProtos::AttachmentPointer_Flags_descriptor(); +} template <> struct is_proto_enum< ::SessionProtos::SharedConfigMessage_Kind> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::SharedConfigMessage_Kind>() { + return ::SessionProtos::SharedConfigMessage_Kind_descriptor(); +} +template <> struct is_proto_enum< ::SessionProtos::GroupUpdateInfoChangeMessage_Type> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::GroupUpdateInfoChangeMessage_Type>() { + return ::SessionProtos::GroupUpdateInfoChangeMessage_Type_descriptor(); +} +template <> struct is_proto_enum< ::SessionProtos::GroupUpdateMemberChangeMessage_Type> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::GroupUpdateMemberChangeMessage_Type>() { + return ::SessionProtos::GroupUpdateMemberChangeMessage_Type_descriptor(); +} PROTOBUF_NAMESPACE_CLOSE diff --git a/proto/SessionProtos.proto b/proto/SessionProtos.proto index f1ab2da7..07dec5ec 100644 --- a/proto/SessionProtos.proto +++ b/proto/SessionProtos.proto @@ -4,8 +4,6 @@ syntax = "proto2"; // iOS - package name determines class prefix package SessionProtos; -option optimize_for = LITE_RUNTIME; - message Envelope { enum Type { @@ -50,34 +48,28 @@ message MessageRequestResponse { optional LokiProfile profile = 3; } -message ProProof { - required uint32 version = 1; - required bytes genIndexHash = 2; - required bytes rotatingPublicKey = 3; - required uint64 expiryUnixTs = 4; - required bytes sig = 5; -} - -message ProConfig { - required bytes rotatingPrivKey = 1; - required ProProof proof = 2; -} -message ProMessageConfig { - required ProProof proof = 1; - required uint32 flags = 2; -} - message Content { - optional DataMessage dataMessage = 1; - optional CallMessage callMessage = 3; - optional ReceiptMessage receiptMessage = 5; - optional TypingMessage typingMessage = 6; - optional ConfigurationMessage configurationMessage = 7; - optional DataExtractionNotification dataExtractionNotification = 8; - optional UnsendRequest unsendRequest = 9; - optional MessageRequestResponse messageRequestResponse = 10; - optional SharedConfigMessage sharedConfigMessage = 11; - optional ProMessageConfig proMessageConfig = 12; + + enum ExpirationType { + UNKNOWN = 0; + DELETE_AFTER_READ = 1; + DELETE_AFTER_SEND = 2; + } + + // reserved 7, 11, 15; + // reserved "configurationMessage", "sharedConfigMessage", "lastDisappearingMessageChangeTimestamp"; + + optional DataMessage dataMessage = 1; + optional CallMessage callMessage = 3; + optional ReceiptMessage receiptMessage = 5; + optional TypingMessage typingMessage = 6; + optional DataExtractionNotification dataExtractionNotification = 8; + optional UnsendRequest unsendRequest = 9; + optional MessageRequestResponse messageRequestResponse = 10; + optional SharedConfigMessage sharedConfigMessage = 11; + optional ExpirationType expirationType = 12; + optional uint32 expirationTimer = 13; + optional uint64 sigTimestamp = 15; } message CallMessage { @@ -181,42 +173,17 @@ message DataMessage { // @required required string name = 3; } - - message ClosedGroupControlMessage { - - enum Type { - NEW = 1; // publicKey, name, encryptionKeyPair, members, admins, expirationTimer - ENCRYPTION_KEY_PAIR = 3; // publicKey, wrappers - NAME_CHANGE = 4; // name - MEMBERS_ADDED = 5; // members - MEMBERS_REMOVED = 6; // members - MEMBER_LEFT = 7; - ENCRYPTION_KEY_PAIR_REQUEST = 8; - } - - message KeyPairWrapper { - // @required - required bytes publicKey = 1; // The public key of the user the key pair is meant for - // @required - required bytes encryptedKeyPair = 2; // The encrypted key pair - } - - // @required - required Type type = 1; - optional bytes publicKey = 2; - optional string name = 3; - optional KeyPair encryptionKeyPair = 4; - repeated bytes members = 5; - repeated bytes admins = 6; - repeated KeyPairWrapper wrappers = 7; - optional uint32 expirationTimer = 8; - } + + + // reserved 3; + // reserved "group"; + // reserved 104; + // reserved "closedGroupControlMessage"; optional string body = 1; repeated AttachmentPointer attachments = 2; - // optional GroupContext group = 3; // No longer used optional uint32 flags = 4; - optional uint32 expireTimer = 5; + // optional uint32 expireTimer = 5; // No longer used optional bytes profileKey = 6; optional uint64 timestamp = 7; optional Quote quote = 8; @@ -224,41 +191,9 @@ message DataMessage { optional Reaction reaction = 11; optional LokiProfile profile = 101; optional OpenGroupInvitation openGroupInvitation = 102; - optional ClosedGroupControlMessage closedGroupControlMessage = 104; optional string syncTarget = 105; optional bool blocksCommunityMessageRequests = 106; -} - -message ConfigurationMessage { - - message ClosedGroup { - optional bytes publicKey = 1; - optional string name = 2; - optional KeyPair encryptionKeyPair = 3; - repeated bytes members = 4; - repeated bytes admins = 5; - optional uint32 expirationTimer = 6; - } - - message Contact { - // @required - required bytes publicKey = 1; - // @required - required string name = 2; - optional string profilePicture = 3; - optional bytes profileKey = 4; - optional bool isApproved = 5; // added for msg requests - optional bool isBlocked = 6; // added for msg requests - optional bool didApproveMe = 7; // added for msg requests - } - - repeated ClosedGroup closedGroups = 1; - repeated string openGroups = 2; - optional string displayName = 3; - optional string profilePicture = 4; - optional bytes profileKey = 5; - repeated Contact contacts = 6; - optional ProConfig proConfig = 7; + optional GroupUpdateMessage groupUpdateMessage = 120; } message ReceiptMessage { @@ -303,9 +238,89 @@ message SharedConfigMessage { } // @required - required Kind kind = 1; + required Kind kind = 1; // @required - required int64 seqno = 2; + required int64 seqno = 2; // @required - required bytes data = 3; + required bytes data = 3; +} + +// Group Update Messages + +message GroupUpdateMessage { + optional GroupUpdateInviteMessage inviteMessage = 1; + optional GroupUpdateInfoChangeMessage infoChangeMessage = 2; + optional GroupUpdateMemberChangeMessage memberChangeMessage = 3; + optional GroupUpdatePromoteMessage promoteMessage = 4; + optional GroupUpdateMemberLeftMessage memberLeftMessage = 5; + optional GroupUpdateInviteResponseMessage inviteResponse = 6; + optional GroupUpdateDeleteMemberContentMessage deleteMemberContent = 7; + optional GroupUpdateMemberLeftNotificationMessage memberLeftNotificationMessage = 8; +} + +message GroupUpdateInviteMessage { + // @required + required string groupSessionId = 1; // The `groupIdentityPublicKey` with a `03` prefix + // @required + required string name = 2; + // @required + required bytes memberAuthData = 3; + // @required + required bytes adminSignature = 4; +} + +message GroupUpdatePromoteMessage { + // @required + required bytes groupIdentitySeed = 1; + // @required + required string name = 2; +} + +message GroupUpdateInfoChangeMessage { + enum Type { + NAME = 1; + AVATAR = 2; + DISAPPEARING_MESSAGES = 3; + } + + // @required + required Type type = 1; + optional string updatedName = 2; + optional uint32 updatedExpiration = 3; + // @required + required bytes adminSignature = 4; +} + +message GroupUpdateMemberChangeMessage { + enum Type { + ADDED = 1; + REMOVED = 2; + PROMOTED = 3; + } + + // @required + required Type type = 1; + repeated string memberSessionIds = 2; + optional bool historyShared = 3; + // @required + required bytes adminSignature = 4; +} + +message GroupUpdateMemberLeftMessage { + // the pubkey of the member left is included as part of the closed group encryption logic (senderIdentity on desktop) +} + +message GroupUpdateMemberLeftNotificationMessage { + // the pubkey of the member left is included as part of the closed group encryption logic (senderIdentity on desktop) +} + +message GroupUpdateInviteResponseMessage { + // @required + required bool isApproved = 1; // Whether the request was approved +} + +message GroupUpdateDeleteMemberContentMessage { + repeated string memberSessionIds = 1; + repeated string messageHashes = 2; + optional bytes adminSignature = 3; } From 6abed5aa44833e4770a4a27e264943bd0245c872 Mon Sep 17 00:00:00 2001 From: doylet Date: Fri, 8 Aug 2025 11:32:49 +1000 Subject: [PATCH 14/59] Revise the PRO protobuf structures --- proto/SessionProtos.pb.cc | 1630 +++++++++++++++++++++++++---- proto/SessionProtos.pb.h | 2035 +++++++++++++++++++++++++++++++------ proto/SessionProtos.proto | 15 + 3 files changed, 3131 insertions(+), 549 deletions(-) diff --git a/proto/SessionProtos.pb.cc b/proto/SessionProtos.pb.cc index 7d80eabf..a55151c1 100644 --- a/proto/SessionProtos.pb.cc +++ b/proto/SessionProtos.pb.cc @@ -27,6 +27,7 @@ PROTOBUF_CONSTEXPR Envelope::Envelope( , /*decltype(_impl_._cached_size_)*/{} , /*decltype(_impl_.source_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} , /*decltype(_impl_.content_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.prosig_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} , /*decltype(_impl_.timestamp_)*/uint64_t{0u} , /*decltype(_impl_.servertimestamp_)*/uint64_t{0u} , /*decltype(_impl_.sourcedevice_)*/0u @@ -98,6 +99,7 @@ PROTOBUF_CONSTEXPR Content::Content( , /*decltype(_impl_.unsendrequest_)*/nullptr , /*decltype(_impl_.messagerequestresponse_)*/nullptr , /*decltype(_impl_.sharedconfigmessage_)*/nullptr + , /*decltype(_impl_.promessage_)*/nullptr , /*decltype(_impl_.expirationtype_)*/0 , /*decltype(_impl_.expirationtimer_)*/0u , /*decltype(_impl_.sigtimestamp_)*/uint64_t{0u}} {} @@ -476,8 +478,56 @@ struct GroupUpdateDeleteMemberContentMessageDefaultTypeInternal { }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GroupUpdateDeleteMemberContentMessageDefaultTypeInternal _GroupUpdateDeleteMemberContentMessage_default_instance_; +PROTOBUF_CONSTEXPR ProProof::ProProof( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.genindexhash_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.rotatingpublickey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.sig_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.expiryunixts_)*/uint64_t{0u} + , /*decltype(_impl_.version_)*/0u} {} +struct ProProofDefaultTypeInternal { + PROTOBUF_CONSTEXPR ProProofDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ProProofDefaultTypeInternal() {} + union { + ProProof _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProProofDefaultTypeInternal _ProProof_default_instance_; +PROTOBUF_CONSTEXPR ProConfig::ProConfig( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.rotatingprivkey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.proof_)*/nullptr} {} +struct ProConfigDefaultTypeInternal { + PROTOBUF_CONSTEXPR ProConfigDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ProConfigDefaultTypeInternal() {} + union { + ProConfig _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProConfigDefaultTypeInternal _ProConfig_default_instance_; +PROTOBUF_CONSTEXPR ProMessage::ProMessage( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.proof_)*/nullptr + , /*decltype(_impl_.flags_)*/0u} {} +struct ProMessageDefaultTypeInternal { + PROTOBUF_CONSTEXPR ProMessageDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ProMessageDefaultTypeInternal() {} + union { + ProMessage _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProMessageDefaultTypeInternal _ProMessage_default_instance_; } // namespace SessionProtos -static ::_pb::Metadata file_level_metadata_SessionProtos_2eproto[27]; +static ::_pb::Metadata file_level_metadata_SessionProtos_2eproto[30]; static const ::_pb::EnumDescriptor* file_level_enum_descriptors_SessionProtos_2eproto[13]; static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_SessionProtos_2eproto = nullptr; @@ -494,12 +544,14 @@ const uint32_t TableStruct_SessionProtos_2eproto::offsets[] PROTOBUF_SECTION_VAR PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _impl_.timestamp_), PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _impl_.content_), PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _impl_.servertimestamp_), - 5, + PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _impl_.prosig_), + 6, 0, + 5, + 3, + 1, 4, 2, - 1, - 3, PROTOBUF_FIELD_OFFSET(::SessionProtos::TypingMessage, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::SessionProtos::TypingMessage, _internal_metadata_), ~0u, // no _extensions_ @@ -549,6 +601,7 @@ const uint32_t TableStruct_SessionProtos_2eproto::offsets[] PROTOBUF_SECTION_VAR PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.expirationtype_), PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.expirationtimer_), PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.sigtimestamp_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.promessage_), 0, 1, 2, @@ -557,9 +610,10 @@ const uint32_t TableStruct_SessionProtos_2eproto::offsets[] PROTOBUF_SECTION_VAR 5, 6, 7, - 8, 9, 10, + 11, + 8, PROTOBUF_FIELD_OFFSET(::SessionProtos::CallMessage, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::SessionProtos::CallMessage, _internal_metadata_), ~0u, // no _extensions_ @@ -860,35 +914,74 @@ const uint32_t TableStruct_SessionProtos_2eproto::offsets[] PROTOBUF_SECTION_VAR ~0u, ~0u, 0, + PROTOBUF_FIELD_OFFSET(::SessionProtos::ProProof, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::ProProof, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::ProProof, _impl_.version_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::ProProof, _impl_.genindexhash_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::ProProof, _impl_.rotatingpublickey_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::ProProof, _impl_.expiryunixts_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::ProProof, _impl_.sig_), + 4, + 0, + 1, + 3, + 2, + PROTOBUF_FIELD_OFFSET(::SessionProtos::ProConfig, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::ProConfig, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::ProConfig, _impl_.rotatingprivkey_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::ProConfig, _impl_.proof_), + 0, + 1, + PROTOBUF_FIELD_OFFSET(::SessionProtos::ProMessage, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::ProMessage, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::SessionProtos::ProMessage, _impl_.proof_), + PROTOBUF_FIELD_OFFSET(::SessionProtos::ProMessage, _impl_.flags_), + 0, + 1, }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, 12, -1, sizeof(::SessionProtos::Envelope)}, - { 18, 26, -1, sizeof(::SessionProtos::TypingMessage)}, - { 28, 36, -1, sizeof(::SessionProtos::UnsendRequest)}, - { 38, 47, -1, sizeof(::SessionProtos::MessageRequestResponse)}, - { 50, 67, -1, sizeof(::SessionProtos::Content)}, - { 78, 89, -1, sizeof(::SessionProtos::CallMessage)}, - { 94, 102, -1, sizeof(::SessionProtos::KeyPair)}, - { 104, 112, -1, sizeof(::SessionProtos::DataExtractionNotification)}, - { 114, 122, -1, sizeof(::SessionProtos::LokiProfile)}, - { 124, 134, -1, sizeof(::SessionProtos::DataMessage_Quote_QuotedAttachment)}, - { 138, 148, -1, sizeof(::SessionProtos::DataMessage_Quote)}, - { 152, 161, -1, sizeof(::SessionProtos::DataMessage_Preview)}, - { 164, 174, -1, sizeof(::SessionProtos::DataMessage_Reaction)}, - { 178, 186, -1, sizeof(::SessionProtos::DataMessage_OpenGroupInvitation)}, - { 188, 207, -1, sizeof(::SessionProtos::DataMessage)}, - { 220, 228, -1, sizeof(::SessionProtos::ReceiptMessage)}, - { 230, 248, -1, sizeof(::SessionProtos::AttachmentPointer)}, - { 260, 269, -1, sizeof(::SessionProtos::SharedConfigMessage)}, - { 272, 286, -1, sizeof(::SessionProtos::GroupUpdateMessage)}, - { 294, 304, -1, sizeof(::SessionProtos::GroupUpdateInviteMessage)}, - { 308, 316, -1, sizeof(::SessionProtos::GroupUpdatePromoteMessage)}, - { 318, 328, -1, sizeof(::SessionProtos::GroupUpdateInfoChangeMessage)}, - { 332, 342, -1, sizeof(::SessionProtos::GroupUpdateMemberChangeMessage)}, - { 346, -1, -1, sizeof(::SessionProtos::GroupUpdateMemberLeftMessage)}, - { 352, -1, -1, sizeof(::SessionProtos::GroupUpdateMemberLeftNotificationMessage)}, - { 358, 365, -1, sizeof(::SessionProtos::GroupUpdateInviteResponseMessage)}, - { 366, 375, -1, sizeof(::SessionProtos::GroupUpdateDeleteMemberContentMessage)}, + { 0, 13, -1, sizeof(::SessionProtos::Envelope)}, + { 20, 28, -1, sizeof(::SessionProtos::TypingMessage)}, + { 30, 38, -1, sizeof(::SessionProtos::UnsendRequest)}, + { 40, 49, -1, sizeof(::SessionProtos::MessageRequestResponse)}, + { 52, 70, -1, sizeof(::SessionProtos::Content)}, + { 82, 93, -1, sizeof(::SessionProtos::CallMessage)}, + { 98, 106, -1, sizeof(::SessionProtos::KeyPair)}, + { 108, 116, -1, sizeof(::SessionProtos::DataExtractionNotification)}, + { 118, 126, -1, sizeof(::SessionProtos::LokiProfile)}, + { 128, 138, -1, sizeof(::SessionProtos::DataMessage_Quote_QuotedAttachment)}, + { 142, 152, -1, sizeof(::SessionProtos::DataMessage_Quote)}, + { 156, 165, -1, sizeof(::SessionProtos::DataMessage_Preview)}, + { 168, 178, -1, sizeof(::SessionProtos::DataMessage_Reaction)}, + { 182, 190, -1, sizeof(::SessionProtos::DataMessage_OpenGroupInvitation)}, + { 192, 211, -1, sizeof(::SessionProtos::DataMessage)}, + { 224, 232, -1, sizeof(::SessionProtos::ReceiptMessage)}, + { 234, 252, -1, sizeof(::SessionProtos::AttachmentPointer)}, + { 264, 273, -1, sizeof(::SessionProtos::SharedConfigMessage)}, + { 276, 290, -1, sizeof(::SessionProtos::GroupUpdateMessage)}, + { 298, 308, -1, sizeof(::SessionProtos::GroupUpdateInviteMessage)}, + { 312, 320, -1, sizeof(::SessionProtos::GroupUpdatePromoteMessage)}, + { 322, 332, -1, sizeof(::SessionProtos::GroupUpdateInfoChangeMessage)}, + { 336, 346, -1, sizeof(::SessionProtos::GroupUpdateMemberChangeMessage)}, + { 350, -1, -1, sizeof(::SessionProtos::GroupUpdateMemberLeftMessage)}, + { 356, -1, -1, sizeof(::SessionProtos::GroupUpdateMemberLeftNotificationMessage)}, + { 362, 369, -1, sizeof(::SessionProtos::GroupUpdateInviteResponseMessage)}, + { 370, 379, -1, sizeof(::SessionProtos::GroupUpdateDeleteMemberContentMessage)}, + { 382, 393, -1, sizeof(::SessionProtos::ProProof)}, + { 398, 406, -1, sizeof(::SessionProtos::ProConfig)}, + { 408, 416, -1, sizeof(::SessionProtos::ProMessage)}, }; static const ::_pb::Message* const file_default_instances[] = { @@ -919,138 +1012,149 @@ static const ::_pb::Message* const file_default_instances[] = { &::SessionProtos::_GroupUpdateMemberLeftNotificationMessage_default_instance_._instance, &::SessionProtos::_GroupUpdateInviteResponseMessage_default_instance_._instance, &::SessionProtos::_GroupUpdateDeleteMemberContentMessage_default_instance_._instance, + &::SessionProtos::_ProProof_default_instance_._instance, + &::SessionProtos::_ProConfig_default_instance_._instance, + &::SessionProtos::_ProMessage_default_instance_._instance, }; const char descriptor_table_protodef_SessionProtos_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\023SessionProtos.proto\022\rSessionProtos\"\320\001\n" + "\n\023SessionProtos.proto\022\rSessionProtos\"\340\001\n" "\010Envelope\022*\n\004type\030\001 \002(\0162\034.SessionProtos." "Envelope.Type\022\016\n\006source\030\002 \001(\t\022\024\n\014sourceD" "evice\030\007 \001(\r\022\021\n\ttimestamp\030\005 \002(\004\022\017\n\007conten" - "t\030\010 \001(\014\022\027\n\017serverTimestamp\030\n \001(\004\"5\n\004Type" - "\022\023\n\017SESSION_MESSAGE\020\006\022\030\n\024CLOSED_GROUP_ME" - "SSAGE\020\007\"{\n\rTypingMessage\022\021\n\ttimestamp\030\001 " - "\002(\004\0223\n\006action\030\002 \002(\0162#.SessionProtos.Typi" - "ngMessage.Action\"\"\n\006Action\022\013\n\007STARTED\020\000\022" - "\013\n\007STOPPED\020\001\"2\n\rUnsendRequest\022\021\n\ttimesta" - "mp\030\001 \002(\004\022\016\n\006author\030\002 \002(\t\"m\n\026MessageReque" - "stResponse\022\022\n\nisApproved\030\001 \002(\010\022\022\n\nprofil" - "eKey\030\002 \001(\014\022+\n\007profile\030\003 \001(\0132\032.SessionPro" - "tos.LokiProfile\"\236\005\n\007Content\022/\n\013dataMessa" - "ge\030\001 \001(\0132\032.SessionProtos.DataMessage\022/\n\013" - "callMessage\030\003 \001(\0132\032.SessionProtos.CallMe" - "ssage\0225\n\016receiptMessage\030\005 \001(\0132\035.SessionP" - "rotos.ReceiptMessage\0223\n\rtypingMessage\030\006 " - "\001(\0132\034.SessionProtos.TypingMessage\022M\n\032dat" - "aExtractionNotification\030\010 \001(\0132).SessionP" - "rotos.DataExtractionNotification\0223\n\runse" - "ndRequest\030\t \001(\0132\034.SessionProtos.UnsendRe" - "quest\022E\n\026messageRequestResponse\030\n \001(\0132%." - "SessionProtos.MessageRequestResponse\022\?\n\023" - "sharedConfigMessage\030\013 \001(\0132\".SessionProto" - "s.SharedConfigMessage\022=\n\016expirationType\030" - "\014 \001(\0162%.SessionProtos.Content.Expiration" - "Type\022\027\n\017expirationTimer\030\r \001(\r\022\024\n\014sigTime" - "stamp\030\017 \001(\004\"K\n\016ExpirationType\022\013\n\007UNKNOWN" - "\020\000\022\025\n\021DELETE_AFTER_READ\020\001\022\025\n\021DELETE_AFTE" - "R_SEND\020\002\"\352\001\n\013CallMessage\022-\n\004type\030\001 \002(\0162\037" - ".SessionProtos.CallMessage.Type\022\014\n\004sdps\030" - "\002 \003(\t\022\027\n\017sdpMLineIndexes\030\003 \003(\r\022\017\n\007sdpMid" - "s\030\004 \003(\t\022\014\n\004uuid\030\005 \002(\t\"f\n\004Type\022\r\n\tPRE_OFF" - "ER\020\006\022\t\n\005OFFER\020\001\022\n\n\006ANSWER\020\002\022\026\n\022PROVISION" - "AL_ANSWER\020\003\022\022\n\016ICE_CANDIDATES\020\004\022\014\n\010END_C" - "ALL\020\005\"0\n\007KeyPair\022\021\n\tpublicKey\030\001 \002(\014\022\022\n\np" - "rivateKey\030\002 \002(\014\"\226\001\n\032DataExtractionNotifi" - "cation\022<\n\004type\030\001 \002(\0162..SessionProtos.Dat" - "aExtractionNotification.Type\022\021\n\ttimestam" - "p\030\002 \001(\004\"\'\n\004Type\022\016\n\nSCREENSHOT\020\001\022\017\n\013MEDIA" - "_SAVED\020\002\":\n\013LokiProfile\022\023\n\013displayName\030\001" - " \001(\t\022\026\n\016profilePicture\030\002 \001(\t\"\367\010\n\013DataMes" - "sage\022\014\n\004body\030\001 \001(\t\0225\n\013attachments\030\002 \003(\0132" - " .SessionProtos.AttachmentPointer\022\r\n\005fla" - "gs\030\004 \001(\r\022\022\n\nprofileKey\030\006 \001(\014\022\021\n\ttimestam" - "p\030\007 \001(\004\022/\n\005quote\030\010 \001(\0132 .SessionProtos.D" - "ataMessage.Quote\0223\n\007preview\030\n \003(\0132\".Sess" - "ionProtos.DataMessage.Preview\0225\n\010reactio" - "n\030\013 \001(\0132#.SessionProtos.DataMessage.Reac" - "tion\022+\n\007profile\030e \001(\0132\032.SessionProtos.Lo" - "kiProfile\022K\n\023openGroupInvitation\030f \001(\0132." - ".SessionProtos.DataMessage.OpenGroupInvi" - "tation\022\022\n\nsyncTarget\030i \001(\t\022&\n\036blocksComm" - "unityMessageRequests\030j \001(\010\022=\n\022groupUpdat" - "eMessage\030x \001(\0132!.SessionProtos.GroupUpda" - "teMessage\032\225\002\n\005Quote\022\n\n\002id\030\001 \002(\004\022\016\n\006autho" - "r\030\002 \002(\t\022\014\n\004text\030\003 \001(\t\022F\n\013attachments\030\004 \003" - "(\01321.SessionProtos.DataMessage.Quote.Quo" - "tedAttachment\032\231\001\n\020QuotedAttachment\022\023\n\013co" - "ntentType\030\001 \001(\t\022\020\n\010fileName\030\002 \001(\t\0223\n\tthu" - "mbnail\030\003 \001(\0132 .SessionProtos.AttachmentP" - "ointer\022\r\n\005flags\030\004 \001(\r\"\032\n\005Flags\022\021\n\rVOICE_" - "MESSAGE\020\001\032V\n\007Preview\022\013\n\003url\030\001 \002(\t\022\r\n\005tit" - "le\030\002 \001(\t\022/\n\005image\030\003 \001(\0132 .SessionProtos." - "AttachmentPointer\032\222\001\n\010Reaction\022\n\n\002id\030\001 \002" - "(\004\022\016\n\006author\030\002 \002(\t\022\r\n\005emoji\030\003 \001(\t\022:\n\006act" - "ion\030\004 \002(\0162*.SessionProtos.DataMessage.Re" - "action.Action\"\037\n\006Action\022\t\n\005REACT\020\000\022\n\n\006RE" - "MOVE\020\001\0320\n\023OpenGroupInvitation\022\013\n\003url\030\001 \002" - "(\t\022\014\n\004name\030\003 \002(\t\"$\n\005Flags\022\033\n\027EXPIRATION_" - "TIMER_UPDATE\020\002\"u\n\016ReceiptMessage\0220\n\004type" - "\030\001 \002(\0162\".SessionProtos.ReceiptMessage.Ty" - "pe\022\021\n\ttimestamp\030\002 \003(\004\"\036\n\004Type\022\014\n\010DELIVER" - "Y\020\000\022\010\n\004READ\020\001\"\354\001\n\021AttachmentPointer\022\n\n\002i" - "d\030\001 \002(\006\022\023\n\013contentType\030\002 \001(\t\022\013\n\003key\030\003 \001(" - "\014\022\014\n\004size\030\004 \001(\r\022\021\n\tthumbnail\030\005 \001(\014\022\016\n\006di" - "gest\030\006 \001(\014\022\020\n\010fileName\030\007 \001(\t\022\r\n\005flags\030\010 " - "\001(\r\022\r\n\005width\030\t \001(\r\022\016\n\006height\030\n \001(\r\022\017\n\007ca" - "ption\030\013 \001(\t\022\013\n\003url\030e \001(\t\"\032\n\005Flags\022\021\n\rVOI" - "CE_MESSAGE\020\001\"\273\001\n\023SharedConfigMessage\0225\n\004" - "kind\030\001 \002(\0162\'.SessionProtos.SharedConfigM" - "essage.Kind\022\r\n\005seqno\030\002 \002(\003\022\014\n\004data\030\003 \002(\014" - "\"P\n\004Kind\022\020\n\014USER_PROFILE\020\001\022\014\n\010CONTACTS\020\002" - "\022\027\n\023CONVO_INFO_VOLATILE\020\003\022\017\n\013USER_GROUPS" - "\020\004\"\356\004\n\022GroupUpdateMessage\022>\n\rinviteMessa" - "ge\030\001 \001(\0132\'.SessionProtos.GroupUpdateInvi" - "teMessage\022F\n\021infoChangeMessage\030\002 \001(\0132+.S" - "essionProtos.GroupUpdateInfoChangeMessag" - "e\022J\n\023memberChangeMessage\030\003 \001(\0132-.Session" - "Protos.GroupUpdateMemberChangeMessage\022@\n" - "\016promoteMessage\030\004 \001(\0132(.SessionProtos.Gr" - "oupUpdatePromoteMessage\022F\n\021memberLeftMes" - "sage\030\005 \001(\0132+.SessionProtos.GroupUpdateMe" - "mberLeftMessage\022G\n\016inviteResponse\030\006 \001(\0132" - "/.SessionProtos.GroupUpdateInviteRespons" - "eMessage\022Q\n\023deleteMemberContent\030\007 \001(\01324." - "SessionProtos.GroupUpdateDeleteMemberCon" - "tentMessage\022^\n\035memberLeftNotificationMes" - "sage\030\010 \001(\01327.SessionProtos.GroupUpdateMe" - "mberLeftNotificationMessage\"p\n\030GroupUpda" - "teInviteMessage\022\026\n\016groupSessionId\030\001 \002(\t\022" - "\014\n\004name\030\002 \002(\t\022\026\n\016memberAuthData\030\003 \002(\014\022\026\n" - "\016adminSignature\030\004 \002(\014\"D\n\031GroupUpdateProm" - "oteMessage\022\031\n\021groupIdentitySeed\030\001 \002(\014\022\014\n" - "\004name\030\002 \002(\t\"\337\001\n\034GroupUpdateInfoChangeMes" - "sage\022>\n\004type\030\001 \002(\01620.SessionProtos.Group" - "UpdateInfoChangeMessage.Type\022\023\n\013updatedN" - "ame\030\002 \001(\t\022\031\n\021updatedExpiration\030\003 \001(\r\022\026\n\016" - "adminSignature\030\004 \002(\014\"7\n\004Type\022\010\n\004NAME\020\001\022\n" - "\n\006AVATAR\020\002\022\031\n\025DISAPPEARING_MESSAGES\020\003\"\331\001" - "\n\036GroupUpdateMemberChangeMessage\022@\n\004type" - "\030\001 \002(\01622.SessionProtos.GroupUpdateMember" - "ChangeMessage.Type\022\030\n\020memberSessionIds\030\002" - " \003(\t\022\025\n\rhistoryShared\030\003 \001(\010\022\026\n\016adminSign" - "ature\030\004 \002(\014\",\n\004Type\022\t\n\005ADDED\020\001\022\013\n\007REMOVE" - "D\020\002\022\014\n\010PROMOTED\020\003\"\036\n\034GroupUpdateMemberLe" - "ftMessage\"*\n(GroupUpdateMemberLeftNotifi" - "cationMessage\"6\n GroupUpdateInviteRespon" - "seMessage\022\022\n\nisApproved\030\001 \002(\010\"p\n%GroupUp" - "dateDeleteMemberContentMessage\022\030\n\020member" - "SessionIds\030\001 \003(\t\022\025\n\rmessageHashes\030\002 \003(\t\022" - "\026\n\016adminSignature\030\003 \001(\014" + "t\030\010 \001(\014\022\027\n\017serverTimestamp\030\n \001(\004\022\016\n\006proS" + "ig\030\013 \001(\014\"5\n\004Type\022\023\n\017SESSION_MESSAGE\020\006\022\030\n" + "\024CLOSED_GROUP_MESSAGE\020\007\"{\n\rTypingMessage" + "\022\021\n\ttimestamp\030\001 \002(\004\0223\n\006action\030\002 \002(\0162#.Se" + "ssionProtos.TypingMessage.Action\"\"\n\006Acti" + "on\022\013\n\007STARTED\020\000\022\013\n\007STOPPED\020\001\"2\n\rUnsendRe" + "quest\022\021\n\ttimestamp\030\001 \002(\004\022\016\n\006author\030\002 \002(\t" + "\"m\n\026MessageRequestResponse\022\022\n\nisApproved" + "\030\001 \002(\010\022\022\n\nprofileKey\030\002 \001(\014\022+\n\007profile\030\003 " + "\001(\0132\032.SessionProtos.LokiProfile\"\315\005\n\007Cont" + "ent\022/\n\013dataMessage\030\001 \001(\0132\032.SessionProtos" + ".DataMessage\022/\n\013callMessage\030\003 \001(\0132\032.Sess" + "ionProtos.CallMessage\0225\n\016receiptMessage\030" + "\005 \001(\0132\035.SessionProtos.ReceiptMessage\0223\n\r" + "typingMessage\030\006 \001(\0132\034.SessionProtos.Typi" + "ngMessage\022M\n\032dataExtractionNotification\030" + "\010 \001(\0132).SessionProtos.DataExtractionNoti" + "fication\0223\n\runsendRequest\030\t \001(\0132\034.Sessio" + "nProtos.UnsendRequest\022E\n\026messageRequestR" + "esponse\030\n \001(\0132%.SessionProtos.MessageReq" + "uestResponse\022\?\n\023sharedConfigMessage\030\013 \001(" + "\0132\".SessionProtos.SharedConfigMessage\022=\n" + "\016expirationType\030\014 \001(\0162%.SessionProtos.Co" + "ntent.ExpirationType\022\027\n\017expirationTimer\030" + "\r \001(\r\022\024\n\014sigTimestamp\030\017 \001(\004\022-\n\nproMessag" + "e\030\020 \001(\0132\031.SessionProtos.ProMessage\"K\n\016Ex" + "pirationType\022\013\n\007UNKNOWN\020\000\022\025\n\021DELETE_AFTE" + "R_READ\020\001\022\025\n\021DELETE_AFTER_SEND\020\002\"\352\001\n\013Call" + "Message\022-\n\004type\030\001 \002(\0162\037.SessionProtos.Ca" + "llMessage.Type\022\014\n\004sdps\030\002 \003(\t\022\027\n\017sdpMLine" + "Indexes\030\003 \003(\r\022\017\n\007sdpMids\030\004 \003(\t\022\014\n\004uuid\030\005" + " \002(\t\"f\n\004Type\022\r\n\tPRE_OFFER\020\006\022\t\n\005OFFER\020\001\022\n" + "\n\006ANSWER\020\002\022\026\n\022PROVISIONAL_ANSWER\020\003\022\022\n\016IC" + "E_CANDIDATES\020\004\022\014\n\010END_CALL\020\005\"0\n\007KeyPair\022" + "\021\n\tpublicKey\030\001 \002(\014\022\022\n\nprivateKey\030\002 \002(\014\"\226" + "\001\n\032DataExtractionNotification\022<\n\004type\030\001 " + "\002(\0162..SessionProtos.DataExtractionNotifi" + "cation.Type\022\021\n\ttimestamp\030\002 \001(\004\"\'\n\004Type\022\016" + "\n\nSCREENSHOT\020\001\022\017\n\013MEDIA_SAVED\020\002\":\n\013LokiP" + "rofile\022\023\n\013displayName\030\001 \001(\t\022\026\n\016profilePi" + "cture\030\002 \001(\t\"\367\010\n\013DataMessage\022\014\n\004body\030\001 \001(" + "\t\0225\n\013attachments\030\002 \003(\0132 .SessionProtos.A" + "ttachmentPointer\022\r\n\005flags\030\004 \001(\r\022\022\n\nprofi" + "leKey\030\006 \001(\014\022\021\n\ttimestamp\030\007 \001(\004\022/\n\005quote\030" + "\010 \001(\0132 .SessionProtos.DataMessage.Quote\022" + "3\n\007preview\030\n \003(\0132\".SessionProtos.DataMes" + "sage.Preview\0225\n\010reaction\030\013 \001(\0132#.Session" + "Protos.DataMessage.Reaction\022+\n\007profile\030e" + " \001(\0132\032.SessionProtos.LokiProfile\022K\n\023open" + "GroupInvitation\030f \001(\0132..SessionProtos.Da" + "taMessage.OpenGroupInvitation\022\022\n\nsyncTar" + "get\030i \001(\t\022&\n\036blocksCommunityMessageReque" + "sts\030j \001(\010\022=\n\022groupUpdateMessage\030x \001(\0132!." + "SessionProtos.GroupUpdateMessage\032\225\002\n\005Quo" + "te\022\n\n\002id\030\001 \002(\004\022\016\n\006author\030\002 \002(\t\022\014\n\004text\030\003" + " \001(\t\022F\n\013attachments\030\004 \003(\01321.SessionProto" + "s.DataMessage.Quote.QuotedAttachment\032\231\001\n" + "\020QuotedAttachment\022\023\n\013contentType\030\001 \001(\t\022\020" + "\n\010fileName\030\002 \001(\t\0223\n\tthumbnail\030\003 \001(\0132 .Se" + "ssionProtos.AttachmentPointer\022\r\n\005flags\030\004" + " \001(\r\"\032\n\005Flags\022\021\n\rVOICE_MESSAGE\020\001\032V\n\007Prev" + "iew\022\013\n\003url\030\001 \002(\t\022\r\n\005title\030\002 \001(\t\022/\n\005image" + "\030\003 \001(\0132 .SessionProtos.AttachmentPointer" + "\032\222\001\n\010Reaction\022\n\n\002id\030\001 \002(\004\022\016\n\006author\030\002 \002(" + "\t\022\r\n\005emoji\030\003 \001(\t\022:\n\006action\030\004 \002(\0162*.Sessi" + "onProtos.DataMessage.Reaction.Action\"\037\n\006" + "Action\022\t\n\005REACT\020\000\022\n\n\006REMOVE\020\001\0320\n\023OpenGro" + "upInvitation\022\013\n\003url\030\001 \002(\t\022\014\n\004name\030\003 \002(\t\"" + "$\n\005Flags\022\033\n\027EXPIRATION_TIMER_UPDATE\020\002\"u\n" + "\016ReceiptMessage\0220\n\004type\030\001 \002(\0162\".SessionP" + "rotos.ReceiptMessage.Type\022\021\n\ttimestamp\030\002" + " \003(\004\"\036\n\004Type\022\014\n\010DELIVERY\020\000\022\010\n\004READ\020\001\"\354\001\n" + "\021AttachmentPointer\022\n\n\002id\030\001 \002(\006\022\023\n\013conten" + "tType\030\002 \001(\t\022\013\n\003key\030\003 \001(\014\022\014\n\004size\030\004 \001(\r\022\021" + "\n\tthumbnail\030\005 \001(\014\022\016\n\006digest\030\006 \001(\014\022\020\n\010fil" + "eName\030\007 \001(\t\022\r\n\005flags\030\010 \001(\r\022\r\n\005width\030\t \001(" + "\r\022\016\n\006height\030\n \001(\r\022\017\n\007caption\030\013 \001(\t\022\013\n\003ur" + "l\030e \001(\t\"\032\n\005Flags\022\021\n\rVOICE_MESSAGE\020\001\"\273\001\n\023" + "SharedConfigMessage\0225\n\004kind\030\001 \002(\0162\'.Sess" + "ionProtos.SharedConfigMessage.Kind\022\r\n\005se" + "qno\030\002 \002(\003\022\014\n\004data\030\003 \002(\014\"P\n\004Kind\022\020\n\014USER_" + "PROFILE\020\001\022\014\n\010CONTACTS\020\002\022\027\n\023CONVO_INFO_VO" + "LATILE\020\003\022\017\n\013USER_GROUPS\020\004\"\356\004\n\022GroupUpdat" + "eMessage\022>\n\rinviteMessage\030\001 \001(\0132\'.Sessio" + "nProtos.GroupUpdateInviteMessage\022F\n\021info" + "ChangeMessage\030\002 \001(\0132+.SessionProtos.Grou" + "pUpdateInfoChangeMessage\022J\n\023memberChange" + "Message\030\003 \001(\0132-.SessionProtos.GroupUpdat" + "eMemberChangeMessage\022@\n\016promoteMessage\030\004" + " \001(\0132(.SessionProtos.GroupUpdatePromoteM" + "essage\022F\n\021memberLeftMessage\030\005 \001(\0132+.Sess" + "ionProtos.GroupUpdateMemberLeftMessage\022G" + "\n\016inviteResponse\030\006 \001(\0132/.SessionProtos.G" + "roupUpdateInviteResponseMessage\022Q\n\023delet" + "eMemberContent\030\007 \001(\01324.SessionProtos.Gro" + "upUpdateDeleteMemberContentMessage\022^\n\035me" + "mberLeftNotificationMessage\030\010 \001(\01327.Sess" + "ionProtos.GroupUpdateMemberLeftNotificat" + "ionMessage\"p\n\030GroupUpdateInviteMessage\022\026" + "\n\016groupSessionId\030\001 \002(\t\022\014\n\004name\030\002 \002(\t\022\026\n\016" + "memberAuthData\030\003 \002(\014\022\026\n\016adminSignature\030\004" + " \002(\014\"D\n\031GroupUpdatePromoteMessage\022\031\n\021gro" + "upIdentitySeed\030\001 \002(\014\022\014\n\004name\030\002 \002(\t\"\337\001\n\034G" + "roupUpdateInfoChangeMessage\022>\n\004type\030\001 \002(" + "\01620.SessionProtos.GroupUpdateInfoChangeM" + "essage.Type\022\023\n\013updatedName\030\002 \001(\t\022\031\n\021upda" + "tedExpiration\030\003 \001(\r\022\026\n\016adminSignature\030\004 " + "\002(\014\"7\n\004Type\022\010\n\004NAME\020\001\022\n\n\006AVATAR\020\002\022\031\n\025DIS" + "APPEARING_MESSAGES\020\003\"\331\001\n\036GroupUpdateMemb" + "erChangeMessage\022@\n\004type\030\001 \002(\01622.SessionP" + "rotos.GroupUpdateMemberChangeMessage.Typ" + "e\022\030\n\020memberSessionIds\030\002 \003(\t\022\025\n\rhistorySh" + "ared\030\003 \001(\010\022\026\n\016adminSignature\030\004 \002(\014\",\n\004Ty" + "pe\022\t\n\005ADDED\020\001\022\013\n\007REMOVED\020\002\022\014\n\010PROMOTED\020\003" + "\"\036\n\034GroupUpdateMemberLeftMessage\"*\n(Grou" + "pUpdateMemberLeftNotificationMessage\"6\n " + "GroupUpdateInviteResponseMessage\022\022\n\nisAp" + "proved\030\001 \002(\010\"p\n%GroupUpdateDeleteMemberC" + "ontentMessage\022\030\n\020memberSessionIds\030\001 \003(\t\022" + "\025\n\rmessageHashes\030\002 \003(\t\022\026\n\016adminSignature" + "\030\003 \001(\014\"o\n\010ProProof\022\017\n\007version\030\001 \002(\r\022\024\n\014g" + "enIndexHash\030\002 \002(\014\022\031\n\021rotatingPublicKey\030\003" + " \002(\014\022\024\n\014expiryUnixTs\030\004 \002(\004\022\013\n\003sig\030\005 \002(\014\"" + "L\n\tProConfig\022\027\n\017rotatingPrivKey\030\001 \002(\014\022&\n" + "\005proof\030\002 \002(\0132\027.SessionProtos.ProProof\"C\n" + "\nProMessage\022&\n\005proof\030\001 \002(\0132\027.SessionProt" + "os.ProProof\022\r\n\005flags\030\002 \002(\r" ; static ::_pbi::once_flag descriptor_table_SessionProtos_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_SessionProtos_2eproto = { - false, false, 4903, descriptor_table_protodef_SessionProtos_2eproto, + false, false, 5226, descriptor_table_protodef_SessionProtos_2eproto, "SessionProtos.proto", - &descriptor_table_SessionProtos_2eproto_once, nullptr, 0, 27, + &descriptor_table_SessionProtos_2eproto_once, nullptr, 0, 30, schemas, file_default_instances, TableStruct_SessionProtos_2eproto::offsets, file_level_metadata_SessionProtos_2eproto, file_level_enum_descriptors_SessionProtos_2eproto, file_level_service_descriptors_SessionProtos_2eproto, @@ -1354,25 +1458,28 @@ class Envelope::_Internal { public: using HasBits = decltype(std::declval()._impl_._has_bits_); static void set_has_type(HasBits* has_bits) { - (*has_bits)[0] |= 32u; + (*has_bits)[0] |= 64u; } static void set_has_source(HasBits* has_bits) { (*has_bits)[0] |= 1u; } static void set_has_sourcedevice(HasBits* has_bits) { - (*has_bits)[0] |= 16u; + (*has_bits)[0] |= 32u; } static void set_has_timestamp(HasBits* has_bits) { - (*has_bits)[0] |= 4u; + (*has_bits)[0] |= 8u; } static void set_has_content(HasBits* has_bits) { (*has_bits)[0] |= 2u; } static void set_has_servertimestamp(HasBits* has_bits) { - (*has_bits)[0] |= 8u; + (*has_bits)[0] |= 16u; + } + static void set_has_prosig(HasBits* has_bits) { + (*has_bits)[0] |= 4u; } static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000024) ^ 0x00000024) != 0; + return ((has_bits[0] & 0x00000048) ^ 0x00000048) != 0; } }; @@ -1390,6 +1497,7 @@ Envelope::Envelope(const Envelope& from) , /*decltype(_impl_._cached_size_)*/{} , decltype(_impl_.source_){} , decltype(_impl_.content_){} + , decltype(_impl_.prosig_){} , decltype(_impl_.timestamp_){} , decltype(_impl_.servertimestamp_){} , decltype(_impl_.sourcedevice_){} @@ -1412,6 +1520,14 @@ Envelope::Envelope(const Envelope& from) _this->_impl_.content_.Set(from._internal_content(), _this->GetArenaForAllocation()); } + _impl_.prosig_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.prosig_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_prosig()) { + _this->_impl_.prosig_.Set(from._internal_prosig(), + _this->GetArenaForAllocation()); + } ::memcpy(&_impl_.timestamp_, &from._impl_.timestamp_, static_cast(reinterpret_cast(&_impl_.type_) - reinterpret_cast(&_impl_.timestamp_)) + sizeof(_impl_.type_)); @@ -1427,6 +1543,7 @@ inline void Envelope::SharedCtor( , /*decltype(_impl_._cached_size_)*/{} , decltype(_impl_.source_){} , decltype(_impl_.content_){} + , decltype(_impl_.prosig_){} , decltype(_impl_.timestamp_){uint64_t{0u}} , decltype(_impl_.servertimestamp_){uint64_t{0u}} , decltype(_impl_.sourcedevice_){0u} @@ -1440,6 +1557,10 @@ inline void Envelope::SharedCtor( #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.content_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.prosig_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.prosig_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } Envelope::~Envelope() { @@ -1455,6 +1576,7 @@ inline void Envelope::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); _impl_.source_.Destroy(); _impl_.content_.Destroy(); + _impl_.prosig_.Destroy(); } void Envelope::SetCachedSize(int size) const { @@ -1468,15 +1590,18 @@ void Envelope::Clear() { (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x00000001u) { _impl_.source_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { _impl_.content_.ClearNonDefaultToEmpty(); } + if (cached_has_bits & 0x00000004u) { + _impl_.prosig_.ClearNonDefaultToEmpty(); + } } - if (cached_has_bits & 0x0000003cu) { + if (cached_has_bits & 0x00000078u) { ::memset(&_impl_.timestamp_, 0, static_cast( reinterpret_cast(&_impl_.sourcedevice_) - reinterpret_cast(&_impl_.timestamp_)) + sizeof(_impl_.sourcedevice_)); @@ -1554,6 +1679,15 @@ const char* Envelope::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) } else goto handle_unusual; continue; + // optional bytes proSig = 11; + case 11: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 90)) { + auto str = _internal_mutable_prosig(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; default: goto handle_unusual; } // switch @@ -1586,7 +1720,7 @@ uint8_t* Envelope::_InternalSerialize( cached_has_bits = _impl_._has_bits_[0]; // required .SessionProtos.Envelope.Type type = 1; - if (cached_has_bits & 0x00000020u) { + if (cached_has_bits & 0x00000040u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( 1, this->_internal_type(), target); @@ -1603,13 +1737,13 @@ uint8_t* Envelope::_InternalSerialize( } // required uint64 timestamp = 5; - if (cached_has_bits & 0x00000004u) { + if (cached_has_bits & 0x00000008u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt64ToArray(5, this->_internal_timestamp(), target); } // optional uint32 sourceDevice = 7; - if (cached_has_bits & 0x00000010u) { + if (cached_has_bits & 0x00000020u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray(7, this->_internal_sourcedevice(), target); } @@ -1621,11 +1755,17 @@ uint8_t* Envelope::_InternalSerialize( } // optional uint64 serverTimestamp = 10; - if (cached_has_bits & 0x00000008u) { + if (cached_has_bits & 0x00000010u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt64ToArray(10, this->_internal_servertimestamp(), target); } + // optional bytes proSig = 11; + if (cached_has_bits & 0x00000004u) { + target = stream->WriteBytesMaybeAliased( + 11, this->_internal_prosig(), target); + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); @@ -1655,7 +1795,7 @@ size_t Envelope::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:SessionProtos.Envelope) size_t total_size = 0; - if (((_impl_._has_bits_[0] & 0x00000024) ^ 0x00000024) == 0) { // All required fields are present. + if (((_impl_._has_bits_[0] & 0x00000048) ^ 0x00000048) == 0) { // All required fields are present. // required uint64 timestamp = 5; total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_timestamp()); @@ -1671,7 +1811,7 @@ size_t Envelope::ByteSizeLong() const { (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000007u) { // optional string source = 2; if (cached_has_bits & 0x00000001u) { total_size += 1 + @@ -1686,15 +1826,22 @@ size_t Envelope::ByteSizeLong() const { this->_internal_content()); } + // optional bytes proSig = 11; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_prosig()); + } + } - if (cached_has_bits & 0x00000018u) { + if (cached_has_bits & 0x00000030u) { // optional uint64 serverTimestamp = 10; - if (cached_has_bits & 0x00000008u) { + if (cached_has_bits & 0x00000010u) { total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_servertimestamp()); } // optional uint32 sourceDevice = 7; - if (cached_has_bits & 0x00000010u) { + if (cached_has_bits & 0x00000020u) { total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_sourcedevice()); } @@ -1718,7 +1865,7 @@ void Envelope::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTO (void) cached_has_bits; cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x0000003fu) { + if (cached_has_bits & 0x0000007fu) { if (cached_has_bits & 0x00000001u) { _this->_internal_set_source(from._internal_source()); } @@ -1726,15 +1873,18 @@ void Envelope::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTO _this->_internal_set_content(from._internal_content()); } if (cached_has_bits & 0x00000004u) { - _this->_impl_.timestamp_ = from._impl_.timestamp_; + _this->_internal_set_prosig(from._internal_prosig()); } if (cached_has_bits & 0x00000008u) { - _this->_impl_.servertimestamp_ = from._impl_.servertimestamp_; + _this->_impl_.timestamp_ = from._impl_.timestamp_; } if (cached_has_bits & 0x00000010u) { - _this->_impl_.sourcedevice_ = from._impl_.sourcedevice_; + _this->_impl_.servertimestamp_ = from._impl_.servertimestamp_; } if (cached_has_bits & 0x00000020u) { + _this->_impl_.sourcedevice_ = from._impl_.sourcedevice_; + } + if (cached_has_bits & 0x00000040u) { _this->_impl_.type_ = from._impl_.type_; } _this->_impl_._has_bits_[0] |= cached_has_bits; @@ -1768,6 +1918,10 @@ void Envelope::InternalSwap(Envelope* other) { &_impl_.content_, lhs_arena, &other->_impl_.content_, rhs_arena ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.prosig_, lhs_arena, + &other->_impl_.prosig_, rhs_arena + ); ::PROTOBUF_NAMESPACE_ID::internal::memswap< PROTOBUF_FIELD_OFFSET(Envelope, _impl_.sourcedevice_) + sizeof(Envelope::_impl_.sourcedevice_) @@ -2662,13 +2816,17 @@ class Content::_Internal { (*has_bits)[0] |= 128u; } static void set_has_expirationtype(HasBits* has_bits) { - (*has_bits)[0] |= 256u; + (*has_bits)[0] |= 512u; } static void set_has_expirationtimer(HasBits* has_bits) { - (*has_bits)[0] |= 512u; + (*has_bits)[0] |= 1024u; } static void set_has_sigtimestamp(HasBits* has_bits) { - (*has_bits)[0] |= 1024u; + (*has_bits)[0] |= 2048u; + } + static const ::SessionProtos::ProMessage& promessage(const Content* msg); + static void set_has_promessage(HasBits* has_bits) { + (*has_bits)[0] |= 256u; } }; @@ -2704,6 +2862,10 @@ const ::SessionProtos::SharedConfigMessage& Content::_Internal::sharedconfigmessage(const Content* msg) { return *msg->_impl_.sharedconfigmessage_; } +const ::SessionProtos::ProMessage& +Content::_Internal::promessage(const Content* msg) { + return *msg->_impl_.promessage_; +} Content::Content(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { @@ -2724,6 +2886,7 @@ Content::Content(const Content& from) , decltype(_impl_.unsendrequest_){nullptr} , decltype(_impl_.messagerequestresponse_){nullptr} , decltype(_impl_.sharedconfigmessage_){nullptr} + , decltype(_impl_.promessage_){nullptr} , decltype(_impl_.expirationtype_){} , decltype(_impl_.expirationtimer_){} , decltype(_impl_.sigtimestamp_){}}; @@ -2753,6 +2916,9 @@ Content::Content(const Content& from) if (from._internal_has_sharedconfigmessage()) { _this->_impl_.sharedconfigmessage_ = new ::SessionProtos::SharedConfigMessage(*from._impl_.sharedconfigmessage_); } + if (from._internal_has_promessage()) { + _this->_impl_.promessage_ = new ::SessionProtos::ProMessage(*from._impl_.promessage_); + } ::memcpy(&_impl_.expirationtype_, &from._impl_.expirationtype_, static_cast(reinterpret_cast(&_impl_.sigtimestamp_) - reinterpret_cast(&_impl_.expirationtype_)) + sizeof(_impl_.sigtimestamp_)); @@ -2774,6 +2940,7 @@ inline void Content::SharedCtor( , decltype(_impl_.unsendrequest_){nullptr} , decltype(_impl_.messagerequestresponse_){nullptr} , decltype(_impl_.sharedconfigmessage_){nullptr} + , decltype(_impl_.promessage_){nullptr} , decltype(_impl_.expirationtype_){0} , decltype(_impl_.expirationtimer_){0u} , decltype(_impl_.sigtimestamp_){uint64_t{0u}} @@ -2799,6 +2966,7 @@ inline void Content::SharedDtor() { if (this != internal_default_instance()) delete _impl_.unsendrequest_; if (this != internal_default_instance()) delete _impl_.messagerequestresponse_; if (this != internal_default_instance()) delete _impl_.sharedconfigmessage_; + if (this != internal_default_instance()) delete _impl_.promessage_; } void Content::SetCachedSize(int size) const { @@ -2846,7 +3014,11 @@ void Content::Clear() { _impl_.sharedconfigmessage_->Clear(); } } - if (cached_has_bits & 0x00000700u) { + if (cached_has_bits & 0x00000100u) { + GOOGLE_DCHECK(_impl_.promessage_ != nullptr); + _impl_.promessage_->Clear(); + } + if (cached_has_bits & 0x00000e00u) { ::memset(&_impl_.expirationtype_, 0, static_cast( reinterpret_cast(&_impl_.sigtimestamp_) - reinterpret_cast(&_impl_.expirationtype_)) + sizeof(_impl_.sigtimestamp_)); @@ -2957,6 +3129,14 @@ const char* Content::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) } else goto handle_unusual; continue; + // optional .SessionProtos.ProMessage proMessage = 16; + case 16: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 130)) { + ptr = ctx->ParseMessage(_internal_mutable_promessage(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; default: goto handle_unusual; } // switch @@ -3045,24 +3225,31 @@ uint8_t* Content::_InternalSerialize( } // optional .SessionProtos.Content.ExpirationType expirationType = 12; - if (cached_has_bits & 0x00000100u) { + if (cached_has_bits & 0x00000200u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( 12, this->_internal_expirationtype(), target); } // optional uint32 expirationTimer = 13; - if (cached_has_bits & 0x00000200u) { + if (cached_has_bits & 0x00000400u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray(13, this->_internal_expirationtimer(), target); } // optional uint64 sigTimestamp = 15; - if (cached_has_bits & 0x00000400u) { + if (cached_has_bits & 0x00000800u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt64ToArray(15, this->_internal_sigtimestamp(), target); } + // optional .SessionProtos.ProMessage proMessage = 16; + if (cached_has_bits & 0x00000100u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(16, _Internal::promessage(this), + _Internal::promessage(this).GetCachedSize(), target, stream); + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); @@ -3138,20 +3325,27 @@ size_t Content::ByteSizeLong() const { } } - if (cached_has_bits & 0x00000700u) { - // optional .SessionProtos.Content.ExpirationType expirationType = 12; + if (cached_has_bits & 0x00000f00u) { + // optional .SessionProtos.ProMessage proMessage = 16; if (cached_has_bits & 0x00000100u) { + total_size += 2 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.promessage_); + } + + // optional .SessionProtos.Content.ExpirationType expirationType = 12; + if (cached_has_bits & 0x00000200u) { total_size += 1 + ::_pbi::WireFormatLite::EnumSize(this->_internal_expirationtype()); } // optional uint32 expirationTimer = 13; - if (cached_has_bits & 0x00000200u) { + if (cached_has_bits & 0x00000400u) { total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_expirationtimer()); } // optional uint64 sigTimestamp = 15; - if (cached_has_bits & 0x00000400u) { + if (cached_has_bits & 0x00000800u) { total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_sigtimestamp()); } @@ -3209,14 +3403,18 @@ void Content::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOB from._internal_sharedconfigmessage()); } } - if (cached_has_bits & 0x00000700u) { + if (cached_has_bits & 0x00000f00u) { if (cached_has_bits & 0x00000100u) { - _this->_impl_.expirationtype_ = from._impl_.expirationtype_; + _this->_internal_mutable_promessage()->::SessionProtos::ProMessage::MergeFrom( + from._internal_promessage()); } if (cached_has_bits & 0x00000200u) { - _this->_impl_.expirationtimer_ = from._impl_.expirationtimer_; + _this->_impl_.expirationtype_ = from._impl_.expirationtype_; } if (cached_has_bits & 0x00000400u) { + _this->_impl_.expirationtimer_ = from._impl_.expirationtimer_; + } + if (cached_has_bits & 0x00000800u) { _this->_impl_.sigtimestamp_ = from._impl_.sigtimestamp_; } _this->_impl_._has_bits_[0] |= cached_has_bits; @@ -3256,6 +3454,9 @@ bool Content::IsInitialized() const { if (_internal_has_sharedconfigmessage()) { if (!_impl_.sharedconfigmessage_->IsInitialized()) return false; } + if (_internal_has_promessage()) { + if (!_impl_.promessage_->IsInitialized()) return false; + } return true; } @@ -10806,42 +11007,1023 @@ ::PROTOBUF_NAMESPACE_ID::Metadata GroupUpdateDeleteMemberContentMessage::GetMeta file_level_metadata_SessionProtos_2eproto[26]); } -// @@protoc_insertion_point(namespace_scope) -} // namespace SessionProtos -PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::SessionProtos::Envelope* -Arena::CreateMaybeMessage< ::SessionProtos::Envelope >(Arena* arena) { - return Arena::CreateMessageInternal< ::SessionProtos::Envelope >(arena); -} -template<> PROTOBUF_NOINLINE ::SessionProtos::TypingMessage* -Arena::CreateMaybeMessage< ::SessionProtos::TypingMessage >(Arena* arena) { - return Arena::CreateMessageInternal< ::SessionProtos::TypingMessage >(arena); -} -template<> PROTOBUF_NOINLINE ::SessionProtos::UnsendRequest* -Arena::CreateMaybeMessage< ::SessionProtos::UnsendRequest >(Arena* arena) { - return Arena::CreateMessageInternal< ::SessionProtos::UnsendRequest >(arena); +// =================================================================== + +class ProProof::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_version(HasBits* has_bits) { + (*has_bits)[0] |= 16u; + } + static void set_has_genindexhash(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_rotatingpublickey(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_expiryunixts(HasBits* has_bits) { + (*has_bits)[0] |= 8u; + } + static void set_has_sig(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x0000001f) ^ 0x0000001f) != 0; + } +}; + +ProProof::ProProof(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:SessionProtos.ProProof) } -template<> PROTOBUF_NOINLINE ::SessionProtos::MessageRequestResponse* -Arena::CreateMaybeMessage< ::SessionProtos::MessageRequestResponse >(Arena* arena) { - return Arena::CreateMessageInternal< ::SessionProtos::MessageRequestResponse >(arena); +ProProof::ProProof(const ProProof& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + ProProof* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.genindexhash_){} + , decltype(_impl_.rotatingpublickey_){} + , decltype(_impl_.sig_){} + , decltype(_impl_.expiryunixts_){} + , decltype(_impl_.version_){}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.genindexhash_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.genindexhash_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_genindexhash()) { + _this->_impl_.genindexhash_.Set(from._internal_genindexhash(), + _this->GetArenaForAllocation()); + } + _impl_.rotatingpublickey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_rotatingpublickey()) { + _this->_impl_.rotatingpublickey_.Set(from._internal_rotatingpublickey(), + _this->GetArenaForAllocation()); + } + _impl_.sig_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.sig_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_sig()) { + _this->_impl_.sig_.Set(from._internal_sig(), + _this->GetArenaForAllocation()); + } + ::memcpy(&_impl_.expiryunixts_, &from._impl_.expiryunixts_, + static_cast(reinterpret_cast(&_impl_.version_) - + reinterpret_cast(&_impl_.expiryunixts_)) + sizeof(_impl_.version_)); + // @@protoc_insertion_point(copy_constructor:SessionProtos.ProProof) } -template<> PROTOBUF_NOINLINE ::SessionProtos::Content* -Arena::CreateMaybeMessage< ::SessionProtos::Content >(Arena* arena) { - return Arena::CreateMessageInternal< ::SessionProtos::Content >(arena); + +inline void ProProof::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.genindexhash_){} + , decltype(_impl_.rotatingpublickey_){} + , decltype(_impl_.sig_){} + , decltype(_impl_.expiryunixts_){uint64_t{0u}} + , decltype(_impl_.version_){0u} + }; + _impl_.genindexhash_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.genindexhash_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.rotatingpublickey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.sig_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.sig_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -template<> PROTOBUF_NOINLINE ::SessionProtos::CallMessage* -Arena::CreateMaybeMessage< ::SessionProtos::CallMessage >(Arena* arena) { - return Arena::CreateMessageInternal< ::SessionProtos::CallMessage >(arena); + +ProProof::~ProProof() { + // @@protoc_insertion_point(destructor:SessionProtos.ProProof) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); } -template<> PROTOBUF_NOINLINE ::SessionProtos::KeyPair* -Arena::CreateMaybeMessage< ::SessionProtos::KeyPair >(Arena* arena) { - return Arena::CreateMessageInternal< ::SessionProtos::KeyPair >(arena); + +inline void ProProof::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.genindexhash_.Destroy(); + _impl_.rotatingpublickey_.Destroy(); + _impl_.sig_.Destroy(); } -template<> PROTOBUF_NOINLINE ::SessionProtos::DataExtractionNotification* -Arena::CreateMaybeMessage< ::SessionProtos::DataExtractionNotification >(Arena* arena) { - return Arena::CreateMessageInternal< ::SessionProtos::DataExtractionNotification >(arena); + +void ProProof::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); } -template<> PROTOBUF_NOINLINE ::SessionProtos::LokiProfile* + +void ProProof::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.ProProof) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000001u) { + _impl_.genindexhash_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000002u) { + _impl_.rotatingpublickey_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000004u) { + _impl_.sig_.ClearNonDefaultToEmpty(); + } + } + if (cached_has_bits & 0x00000018u) { + ::memset(&_impl_.expiryunixts_, 0, static_cast( + reinterpret_cast(&_impl_.version_) - + reinterpret_cast(&_impl_.expiryunixts_)) + sizeof(_impl_.version_)); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* ProProof::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // required uint32 version = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _Internal::set_has_version(&has_bits); + _impl_.version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // required bytes genIndexHash = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_genindexhash(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // required bytes rotatingPublicKey = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + auto str = _internal_mutable_rotatingpublickey(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // required uint64 expiryUnixTs = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + _Internal::set_has_expiryunixts(&has_bits); + _impl_.expiryunixts_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // required bytes sig = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + auto str = _internal_mutable_sig(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* ProProof::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ProProof) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + // required uint32 version = 1; + if (cached_has_bits & 0x00000010u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_version(), target); + } + + // required bytes genIndexHash = 2; + if (cached_has_bits & 0x00000001u) { + target = stream->WriteBytesMaybeAliased( + 2, this->_internal_genindexhash(), target); + } + + // required bytes rotatingPublicKey = 3; + if (cached_has_bits & 0x00000002u) { + target = stream->WriteBytesMaybeAliased( + 3, this->_internal_rotatingpublickey(), target); + } + + // required uint64 expiryUnixTs = 4; + if (cached_has_bits & 0x00000008u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_expiryunixts(), target); + } + + // required bytes sig = 5; + if (cached_has_bits & 0x00000004u) { + target = stream->WriteBytesMaybeAliased( + 5, this->_internal_sig(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ProProof) + return target; +} + +size_t ProProof::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.ProProof) + size_t total_size = 0; + + if (_internal_has_genindexhash()) { + // required bytes genIndexHash = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_genindexhash()); + } + + if (_internal_has_rotatingpublickey()) { + // required bytes rotatingPublicKey = 3; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_rotatingpublickey()); + } + + if (_internal_has_sig()) { + // required bytes sig = 5; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_sig()); + } + + if (_internal_has_expiryunixts()) { + // required uint64 expiryUnixTs = 4; + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_expiryunixts()); + } + + if (_internal_has_version()) { + // required uint32 version = 1; + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_version()); + } + + return total_size; +} +size_t ProProof::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ProProof) + size_t total_size = 0; + + if (((_impl_._has_bits_[0] & 0x0000001f) ^ 0x0000001f) == 0) { // All required fields are present. + // required bytes genIndexHash = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_genindexhash()); + + // required bytes rotatingPublicKey = 3; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_rotatingpublickey()); + + // required bytes sig = 5; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_sig()); + + // required uint64 expiryUnixTs = 4; + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_expiryunixts()); + + // required uint32 version = 1; + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_version()); + + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ProProof::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + ProProof::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ProProof::GetClassData() const { return &_class_data_; } + + +void ProProof::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ProProof) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x0000001fu) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_genindexhash(from._internal_genindexhash()); + } + if (cached_has_bits & 0x00000002u) { + _this->_internal_set_rotatingpublickey(from._internal_rotatingpublickey()); + } + if (cached_has_bits & 0x00000004u) { + _this->_internal_set_sig(from._internal_sig()); + } + if (cached_has_bits & 0x00000008u) { + _this->_impl_.expiryunixts_ = from._impl_.expiryunixts_; + } + if (cached_has_bits & 0x00000010u) { + _this->_impl_.version_ = from._impl_.version_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void ProProof::CopyFrom(const ProProof& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ProProof) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ProProof::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; + return true; +} + +void ProProof::InternalSwap(ProProof* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.genindexhash_, lhs_arena, + &other->_impl_.genindexhash_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.rotatingpublickey_, lhs_arena, + &other->_impl_.rotatingpublickey_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.sig_, lhs_arena, + &other->_impl_.sig_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(ProProof, _impl_.version_) + + sizeof(ProProof::_impl_.version_) + - PROTOBUF_FIELD_OFFSET(ProProof, _impl_.expiryunixts_)>( + reinterpret_cast(&_impl_.expiryunixts_), + reinterpret_cast(&other->_impl_.expiryunixts_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata ProProof::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[27]); +} + +// =================================================================== + +class ProConfig::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_rotatingprivkey(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static const ::SessionProtos::ProProof& proof(const ProConfig* msg); + static void set_has_proof(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; + } +}; + +const ::SessionProtos::ProProof& +ProConfig::_Internal::proof(const ProConfig* msg) { + return *msg->_impl_.proof_; +} +ProConfig::ProConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:SessionProtos.ProConfig) +} +ProConfig::ProConfig(const ProConfig& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + ProConfig* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.rotatingprivkey_){} + , decltype(_impl_.proof_){nullptr}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.rotatingprivkey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_rotatingprivkey()) { + _this->_impl_.rotatingprivkey_.Set(from._internal_rotatingprivkey(), + _this->GetArenaForAllocation()); + } + if (from._internal_has_proof()) { + _this->_impl_.proof_ = new ::SessionProtos::ProProof(*from._impl_.proof_); + } + // @@protoc_insertion_point(copy_constructor:SessionProtos.ProConfig) +} + +inline void ProConfig::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.rotatingprivkey_){} + , decltype(_impl_.proof_){nullptr} + }; + _impl_.rotatingprivkey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +ProConfig::~ProConfig() { + // @@protoc_insertion_point(destructor:SessionProtos.ProConfig) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void ProConfig::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.rotatingprivkey_.Destroy(); + if (this != internal_default_instance()) delete _impl_.proof_; +} + +void ProConfig::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void ProConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.ProConfig) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _impl_.rotatingprivkey_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(_impl_.proof_ != nullptr); + _impl_.proof_->Clear(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* ProConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // required bytes rotatingPrivKey = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_rotatingprivkey(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // required .SessionProtos.ProProof proof = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_proof(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* ProConfig::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ProConfig) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + // required bytes rotatingPrivKey = 1; + if (cached_has_bits & 0x00000001u) { + target = stream->WriteBytesMaybeAliased( + 1, this->_internal_rotatingprivkey(), target); + } + + // required .SessionProtos.ProProof proof = 2; + if (cached_has_bits & 0x00000002u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::proof(this), + _Internal::proof(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ProConfig) + return target; +} + +size_t ProConfig::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.ProConfig) + size_t total_size = 0; + + if (_internal_has_rotatingprivkey()) { + // required bytes rotatingPrivKey = 1; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_rotatingprivkey()); + } + + if (_internal_has_proof()) { + // required .SessionProtos.ProProof proof = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.proof_); + } + + return total_size; +} +size_t ProConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ProConfig) + size_t total_size = 0; + + if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. + // required bytes rotatingPrivKey = 1; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_rotatingprivkey()); + + // required .SessionProtos.ProProof proof = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.proof_); + + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ProConfig::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + ProConfig::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ProConfig::GetClassData() const { return &_class_data_; } + + +void ProConfig::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ProConfig) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_rotatingprivkey(from._internal_rotatingprivkey()); + } + if (cached_has_bits & 0x00000002u) { + _this->_internal_mutable_proof()->::SessionProtos::ProProof::MergeFrom( + from._internal_proof()); + } + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void ProConfig::CopyFrom(const ProConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ProConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ProConfig::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; + if (_internal_has_proof()) { + if (!_impl_.proof_->IsInitialized()) return false; + } + return true; +} + +void ProConfig::InternalSwap(ProConfig* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.rotatingprivkey_, lhs_arena, + &other->_impl_.rotatingprivkey_, rhs_arena + ); + swap(_impl_.proof_, other->_impl_.proof_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata ProConfig::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[28]); +} + +// =================================================================== + +class ProMessage::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static const ::SessionProtos::ProProof& proof(const ProMessage* msg); + static void set_has_proof(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_flags(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; + } +}; + +const ::SessionProtos::ProProof& +ProMessage::_Internal::proof(const ProMessage* msg) { + return *msg->_impl_.proof_; +} +ProMessage::ProMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:SessionProtos.ProMessage) +} +ProMessage::ProMessage(const ProMessage& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + ProMessage* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.proof_){nullptr} + , decltype(_impl_.flags_){}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_proof()) { + _this->_impl_.proof_ = new ::SessionProtos::ProProof(*from._impl_.proof_); + } + _this->_impl_.flags_ = from._impl_.flags_; + // @@protoc_insertion_point(copy_constructor:SessionProtos.ProMessage) +} + +inline void ProMessage::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.proof_){nullptr} + , decltype(_impl_.flags_){0u} + }; +} + +ProMessage::~ProMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.ProMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void ProMessage::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + if (this != internal_default_instance()) delete _impl_.proof_; +} + +void ProMessage::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void ProMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.ProMessage) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(_impl_.proof_ != nullptr); + _impl_.proof_->Clear(); + } + _impl_.flags_ = 0u; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* ProMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // required .SessionProtos.ProProof proof = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_proof(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // required uint32 flags = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _Internal::set_has_flags(&has_bits); + _impl_.flags_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* ProMessage::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ProMessage) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + // required .SessionProtos.ProProof proof = 1; + if (cached_has_bits & 0x00000001u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::proof(this), + _Internal::proof(this).GetCachedSize(), target, stream); + } + + // required uint32 flags = 2; + if (cached_has_bits & 0x00000002u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_flags(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ProMessage) + return target; +} + +size_t ProMessage::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.ProMessage) + size_t total_size = 0; + + if (_internal_has_proof()) { + // required .SessionProtos.ProProof proof = 1; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.proof_); + } + + if (_internal_has_flags()) { + // required uint32 flags = 2; + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); + } + + return total_size; +} +size_t ProMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ProMessage) + size_t total_size = 0; + + if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. + // required .SessionProtos.ProProof proof = 1; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.proof_); + + // required uint32 flags = 2; + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); + + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ProMessage::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + ProMessage::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ProMessage::GetClassData() const { return &_class_data_; } + + +void ProMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ProMessage) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_mutable_proof()->::SessionProtos::ProProof::MergeFrom( + from._internal_proof()); + } + if (cached_has_bits & 0x00000002u) { + _this->_impl_.flags_ = from._impl_.flags_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void ProMessage::CopyFrom(const ProMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ProMessage) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ProMessage::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; + if (_internal_has_proof()) { + if (!_impl_.proof_->IsInitialized()) return false; + } + return true; +} + +void ProMessage::InternalSwap(ProMessage* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(ProMessage, _impl_.flags_) + + sizeof(ProMessage::_impl_.flags_) + - PROTOBUF_FIELD_OFFSET(ProMessage, _impl_.proof_)>( + reinterpret_cast(&_impl_.proof_), + reinterpret_cast(&other->_impl_.proof_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata ProMessage::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, + file_level_metadata_SessionProtos_2eproto[29]); +} + +// @@protoc_insertion_point(namespace_scope) +} // namespace SessionProtos +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::SessionProtos::Envelope* +Arena::CreateMaybeMessage< ::SessionProtos::Envelope >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::Envelope >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::TypingMessage* +Arena::CreateMaybeMessage< ::SessionProtos::TypingMessage >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::TypingMessage >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::UnsendRequest* +Arena::CreateMaybeMessage< ::SessionProtos::UnsendRequest >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::UnsendRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::MessageRequestResponse* +Arena::CreateMaybeMessage< ::SessionProtos::MessageRequestResponse >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::MessageRequestResponse >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::Content* +Arena::CreateMaybeMessage< ::SessionProtos::Content >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::Content >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::CallMessage* +Arena::CreateMaybeMessage< ::SessionProtos::CallMessage >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::CallMessage >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::KeyPair* +Arena::CreateMaybeMessage< ::SessionProtos::KeyPair >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::KeyPair >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::DataExtractionNotification* +Arena::CreateMaybeMessage< ::SessionProtos::DataExtractionNotification >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::DataExtractionNotification >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::LokiProfile* Arena::CreateMaybeMessage< ::SessionProtos::LokiProfile >(Arena* arena) { return Arena::CreateMessageInternal< ::SessionProtos::LokiProfile >(arena); } @@ -10917,6 +12099,18 @@ template<> PROTOBUF_NOINLINE ::SessionProtos::GroupUpdateDeleteMemberContentMess Arena::CreateMaybeMessage< ::SessionProtos::GroupUpdateDeleteMemberContentMessage >(Arena* arena) { return Arena::CreateMessageInternal< ::SessionProtos::GroupUpdateDeleteMemberContentMessage >(arena); } +template<> PROTOBUF_NOINLINE ::SessionProtos::ProProof* +Arena::CreateMaybeMessage< ::SessionProtos::ProProof >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::ProProof >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::ProConfig* +Arena::CreateMaybeMessage< ::SessionProtos::ProConfig >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::ProConfig >(arena); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::ProMessage* +Arena::CreateMaybeMessage< ::SessionProtos::ProMessage >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::ProMessage >(arena); +} PROTOBUF_NAMESPACE_CLOSE // @@protoc_insertion_point(global_scope) diff --git a/proto/SessionProtos.pb.h b/proto/SessionProtos.pb.h index faea8749..c73bb3d0 100644 --- a/proto/SessionProtos.pb.h +++ b/proto/SessionProtos.pb.h @@ -116,6 +116,15 @@ extern LokiProfileDefaultTypeInternal _LokiProfile_default_instance_; class MessageRequestResponse; struct MessageRequestResponseDefaultTypeInternal; extern MessageRequestResponseDefaultTypeInternal _MessageRequestResponse_default_instance_; +class ProConfig; +struct ProConfigDefaultTypeInternal; +extern ProConfigDefaultTypeInternal _ProConfig_default_instance_; +class ProMessage; +struct ProMessageDefaultTypeInternal; +extern ProMessageDefaultTypeInternal _ProMessage_default_instance_; +class ProProof; +struct ProProofDefaultTypeInternal; +extern ProProofDefaultTypeInternal _ProProof_default_instance_; class ReceiptMessage; struct ReceiptMessageDefaultTypeInternal; extern ReceiptMessageDefaultTypeInternal _ReceiptMessage_default_instance_; @@ -153,6 +162,9 @@ template<> ::SessionProtos::GroupUpdatePromoteMessage* Arena::CreateMaybeMessage template<> ::SessionProtos::KeyPair* Arena::CreateMaybeMessage<::SessionProtos::KeyPair>(Arena*); template<> ::SessionProtos::LokiProfile* Arena::CreateMaybeMessage<::SessionProtos::LokiProfile>(Arena*); template<> ::SessionProtos::MessageRequestResponse* Arena::CreateMaybeMessage<::SessionProtos::MessageRequestResponse>(Arena*); +template<> ::SessionProtos::ProConfig* Arena::CreateMaybeMessage<::SessionProtos::ProConfig>(Arena*); +template<> ::SessionProtos::ProMessage* Arena::CreateMaybeMessage<::SessionProtos::ProMessage>(Arena*); +template<> ::SessionProtos::ProProof* Arena::CreateMaybeMessage<::SessionProtos::ProProof>(Arena*); template<> ::SessionProtos::ReceiptMessage* Arena::CreateMaybeMessage<::SessionProtos::ReceiptMessage>(Arena*); template<> ::SessionProtos::SharedConfigMessage* Arena::CreateMaybeMessage<::SessionProtos::SharedConfigMessage>(Arena*); template<> ::SessionProtos::TypingMessage* Arena::CreateMaybeMessage<::SessionProtos::TypingMessage>(Arena*); @@ -627,6 +639,7 @@ class Envelope final : enum : int { kSourceFieldNumber = 2, kContentFieldNumber = 8, + kProSigFieldNumber = 11, kTimestampFieldNumber = 5, kServerTimestampFieldNumber = 10, kSourceDeviceFieldNumber = 7, @@ -668,6 +681,24 @@ class Envelope final : std::string* _internal_mutable_content(); public: + // optional bytes proSig = 11; + bool has_prosig() const; + private: + bool _internal_has_prosig() const; + public: + void clear_prosig(); + const std::string& prosig() const; + template + void set_prosig(ArgT0&& arg0, ArgT... args); + std::string* mutable_prosig(); + PROTOBUF_NODISCARD std::string* release_prosig(); + void set_allocated_prosig(std::string* prosig); + private: + const std::string& _internal_prosig() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_prosig(const std::string& value); + std::string* _internal_mutable_prosig(); + public: + // required uint64 timestamp = 5; bool has_timestamp() const; private: @@ -735,6 +766,7 @@ class Envelope final : mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr source_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr content_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr prosig_; uint64_t timestamp_; uint64_t servertimestamp_; uint32_t sourcedevice_; @@ -1504,6 +1536,7 @@ class Content final : kUnsendRequestFieldNumber = 9, kMessageRequestResponseFieldNumber = 10, kSharedConfigMessageFieldNumber = 11, + kProMessageFieldNumber = 16, kExpirationTypeFieldNumber = 12, kExpirationTimerFieldNumber = 13, kSigTimestampFieldNumber = 15, @@ -1652,6 +1685,24 @@ class Content final : ::SessionProtos::SharedConfigMessage* sharedconfigmessage); ::SessionProtos::SharedConfigMessage* unsafe_arena_release_sharedconfigmessage(); + // optional .SessionProtos.ProMessage proMessage = 16; + bool has_promessage() const; + private: + bool _internal_has_promessage() const; + public: + void clear_promessage(); + const ::SessionProtos::ProMessage& promessage() const; + PROTOBUF_NODISCARD ::SessionProtos::ProMessage* release_promessage(); + ::SessionProtos::ProMessage* mutable_promessage(); + void set_allocated_promessage(::SessionProtos::ProMessage* promessage); + private: + const ::SessionProtos::ProMessage& _internal_promessage() const; + ::SessionProtos::ProMessage* _internal_mutable_promessage(); + public: + void unsafe_arena_set_allocated_promessage( + ::SessionProtos::ProMessage* promessage); + ::SessionProtos::ProMessage* unsafe_arena_release_promessage(); + // optional .SessionProtos.Content.ExpirationType expirationType = 12; bool has_expirationtype() const; private: @@ -1709,6 +1760,7 @@ class Content final : ::SessionProtos::UnsendRequest* unsendrequest_; ::SessionProtos::MessageRequestResponse* messagerequestresponse_; ::SessionProtos::SharedConfigMessage* sharedconfigmessage_; + ::SessionProtos::ProMessage* promessage_; int expirationtype_; uint32_t expirationtimer_; uint64_t sigtimestamp_; @@ -6816,233 +6868,842 @@ class GroupUpdateDeleteMemberContentMessage final : union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; -// =================================================================== - - -// =================================================================== +// ------------------------------------------------------------------- -#ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -// Envelope +class ProProof final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.ProProof) */ { + public: + inline ProProof() : ProProof(nullptr) {} + ~ProProof() override; + explicit PROTOBUF_CONSTEXPR ProProof(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); -// required .SessionProtos.Envelope.Type type = 1; -inline bool Envelope::_internal_has_type() const { - bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; - return value; -} -inline bool Envelope::has_type() const { - return _internal_has_type(); -} -inline void Envelope::clear_type() { - _impl_.type_ = 6; - _impl_._has_bits_[0] &= ~0x00000020u; -} -inline ::SessionProtos::Envelope_Type Envelope::_internal_type() const { - return static_cast< ::SessionProtos::Envelope_Type >(_impl_.type_); -} -inline ::SessionProtos::Envelope_Type Envelope::type() const { - // @@protoc_insertion_point(field_get:SessionProtos.Envelope.type) - return _internal_type(); -} -inline void Envelope::_internal_set_type(::SessionProtos::Envelope_Type value) { - assert(::SessionProtos::Envelope_Type_IsValid(value)); - _impl_._has_bits_[0] |= 0x00000020u; - _impl_.type_ = value; -} -inline void Envelope::set_type(::SessionProtos::Envelope_Type value) { - _internal_set_type(value); - // @@protoc_insertion_point(field_set:SessionProtos.Envelope.type) -} + ProProof(const ProProof& from); + ProProof(ProProof&& from) noexcept + : ProProof() { + *this = ::std::move(from); + } -// optional string source = 2; -inline bool Envelope::_internal_has_source() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - return value; -} -inline bool Envelope::has_source() const { - return _internal_has_source(); -} -inline void Envelope::clear_source() { - _impl_.source_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const std::string& Envelope::source() const { - // @@protoc_insertion_point(field_get:SessionProtos.Envelope.source) - return _internal_source(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void Envelope::set_source(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.source_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.Envelope.source) -} -inline std::string* Envelope::mutable_source() { - std::string* _s = _internal_mutable_source(); - // @@protoc_insertion_point(field_mutable:SessionProtos.Envelope.source) - return _s; -} -inline const std::string& Envelope::_internal_source() const { - return _impl_.source_.Get(); -} -inline void Envelope::_internal_set_source(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.source_.Set(value, GetArenaForAllocation()); -} -inline std::string* Envelope::_internal_mutable_source() { - _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.source_.Mutable(GetArenaForAllocation()); -} -inline std::string* Envelope::release_source() { - // @@protoc_insertion_point(field_release:SessionProtos.Envelope.source) - if (!_internal_has_source()) { - return nullptr; + inline ProProof& operator=(const ProProof& from) { + CopyFrom(from); + return *this; } - _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.source_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.source_.IsDefault()) { - _impl_.source_.Set("", GetArenaForAllocation()); + inline ProProof& operator=(ProProof&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void Envelope::set_allocated_source(std::string* source) { - if (source != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; + + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); } - _impl_.source_.SetAllocated(source, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.source_.IsDefault()) { - _impl_.source_.Set("", GetArenaForAllocation()); + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.Envelope.source) -} - -// optional uint32 sourceDevice = 7; -inline bool Envelope::_internal_has_sourcedevice() const { - bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; - return value; -} -inline bool Envelope::has_sourcedevice() const { - return _internal_has_sourcedevice(); -} -inline void Envelope::clear_sourcedevice() { - _impl_.sourcedevice_ = 0u; - _impl_._has_bits_[0] &= ~0x00000010u; -} -inline uint32_t Envelope::_internal_sourcedevice() const { - return _impl_.sourcedevice_; -} -inline uint32_t Envelope::sourcedevice() const { - // @@protoc_insertion_point(field_get:SessionProtos.Envelope.sourceDevice) - return _internal_sourcedevice(); -} -inline void Envelope::_internal_set_sourcedevice(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000010u; - _impl_.sourcedevice_ = value; -} -inline void Envelope::set_sourcedevice(uint32_t value) { - _internal_set_sourcedevice(value); - // @@protoc_insertion_point(field_set:SessionProtos.Envelope.sourceDevice) -} - -// required uint64 timestamp = 5; -inline bool Envelope::_internal_has_timestamp() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; - return value; -} -inline bool Envelope::has_timestamp() const { - return _internal_has_timestamp(); -} -inline void Envelope::clear_timestamp() { - _impl_.timestamp_ = uint64_t{0u}; - _impl_._has_bits_[0] &= ~0x00000004u; -} -inline uint64_t Envelope::_internal_timestamp() const { - return _impl_.timestamp_; -} -inline uint64_t Envelope::timestamp() const { - // @@protoc_insertion_point(field_get:SessionProtos.Envelope.timestamp) - return _internal_timestamp(); -} -inline void Envelope::_internal_set_timestamp(uint64_t value) { - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.timestamp_ = value; -} -inline void Envelope::set_timestamp(uint64_t value) { - _internal_set_timestamp(value); - // @@protoc_insertion_point(field_set:SessionProtos.Envelope.timestamp) -} -// optional bytes content = 8; -inline bool Envelope::_internal_has_content() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - return value; -} -inline bool Envelope::has_content() const { - return _internal_has_content(); -} -inline void Envelope::clear_content() { - _impl_.content_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000002u; -} -inline const std::string& Envelope::content() const { - // @@protoc_insertion_point(field_get:SessionProtos.Envelope.content) - return _internal_content(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void Envelope::set_content(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.content_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.Envelope.content) -} -inline std::string* Envelope::mutable_content() { - std::string* _s = _internal_mutable_content(); - // @@protoc_insertion_point(field_mutable:SessionProtos.Envelope.content) - return _s; -} -inline const std::string& Envelope::_internal_content() const { - return _impl_.content_.Get(); -} -inline void Envelope::_internal_set_content(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.content_.Set(value, GetArenaForAllocation()); -} -inline std::string* Envelope::_internal_mutable_content() { - _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.content_.Mutable(GetArenaForAllocation()); -} -inline std::string* Envelope::release_content() { - // @@protoc_insertion_point(field_release:SessionProtos.Envelope.content) - if (!_internal_has_content()) { - return nullptr; + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); } - _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.content_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.content_.IsDefault()) { - _impl_.content_.Set("", GetArenaForAllocation()); + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void Envelope::set_allocated_content(std::string* content) { - if (content != nullptr) { - _impl_._has_bits_[0] |= 0x00000002u; - } else { - _impl_._has_bits_[0] &= ~0x00000002u; + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; } - _impl_.content_.SetAllocated(content, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.content_.IsDefault()) { - _impl_.content_.Set("", GetArenaForAllocation()); + static const ProProof& default_instance() { + return *internal_default_instance(); + } + static inline const ProProof* internal_default_instance() { + return reinterpret_cast( + &_ProProof_default_instance_); + } + static constexpr int kIndexInFileMessages = + 27; + + friend void swap(ProProof& a, ProProof& b) { + a.Swap(&b); + } + inline void Swap(ProProof* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ProProof* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + ProProof* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ProProof& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const ProProof& from) { + ProProof::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ProProof* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "SessionProtos.ProProof"; + } + protected: + explicit ProProof(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kGenIndexHashFieldNumber = 2, + kRotatingPublicKeyFieldNumber = 3, + kSigFieldNumber = 5, + kExpiryUnixTsFieldNumber = 4, + kVersionFieldNumber = 1, + }; + // required bytes genIndexHash = 2; + bool has_genindexhash() const; + private: + bool _internal_has_genindexhash() const; + public: + void clear_genindexhash(); + const std::string& genindexhash() const; + template + void set_genindexhash(ArgT0&& arg0, ArgT... args); + std::string* mutable_genindexhash(); + PROTOBUF_NODISCARD std::string* release_genindexhash(); + void set_allocated_genindexhash(std::string* genindexhash); + private: + const std::string& _internal_genindexhash() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_genindexhash(const std::string& value); + std::string* _internal_mutable_genindexhash(); + public: + + // required bytes rotatingPublicKey = 3; + bool has_rotatingpublickey() const; + private: + bool _internal_has_rotatingpublickey() const; + public: + void clear_rotatingpublickey(); + const std::string& rotatingpublickey() const; + template + void set_rotatingpublickey(ArgT0&& arg0, ArgT... args); + std::string* mutable_rotatingpublickey(); + PROTOBUF_NODISCARD std::string* release_rotatingpublickey(); + void set_allocated_rotatingpublickey(std::string* rotatingpublickey); + private: + const std::string& _internal_rotatingpublickey() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_rotatingpublickey(const std::string& value); + std::string* _internal_mutable_rotatingpublickey(); + public: + + // required bytes sig = 5; + bool has_sig() const; + private: + bool _internal_has_sig() const; + public: + void clear_sig(); + const std::string& sig() const; + template + void set_sig(ArgT0&& arg0, ArgT... args); + std::string* mutable_sig(); + PROTOBUF_NODISCARD std::string* release_sig(); + void set_allocated_sig(std::string* sig); + private: + const std::string& _internal_sig() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_sig(const std::string& value); + std::string* _internal_mutable_sig(); + public: + + // required uint64 expiryUnixTs = 4; + bool has_expiryunixts() const; + private: + bool _internal_has_expiryunixts() const; + public: + void clear_expiryunixts(); + uint64_t expiryunixts() const; + void set_expiryunixts(uint64_t value); + private: + uint64_t _internal_expiryunixts() const; + void _internal_set_expiryunixts(uint64_t value); + public: + + // required uint32 version = 1; + bool has_version() const; + private: + bool _internal_has_version() const; + public: + void clear_version(); + uint32_t version() const; + void set_version(uint32_t value); + private: + uint32_t _internal_version() const; + void _internal_set_version(uint32_t value); + public: + + // @@protoc_insertion_point(class_scope:SessionProtos.ProProof) + private: + class _Internal; + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr genindexhash_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr rotatingpublickey_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr sig_; + uint64_t expiryunixts_; + uint32_t version_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_SessionProtos_2eproto; +}; +// ------------------------------------------------------------------- + +class ProConfig final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.ProConfig) */ { + public: + inline ProConfig() : ProConfig(nullptr) {} + ~ProConfig() override; + explicit PROTOBUF_CONSTEXPR ProConfig(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + ProConfig(const ProConfig& from); + ProConfig(ProConfig&& from) noexcept + : ProConfig() { + *this = ::std::move(from); + } + + inline ProConfig& operator=(const ProConfig& from) { + CopyFrom(from); + return *this; + } + inline ProConfig& operator=(ProConfig&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + } + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const ProConfig& default_instance() { + return *internal_default_instance(); + } + static inline const ProConfig* internal_default_instance() { + return reinterpret_cast( + &_ProConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 28; + + friend void swap(ProConfig& a, ProConfig& b) { + a.Swap(&b); + } + inline void Swap(ProConfig* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ProConfig* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + ProConfig* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ProConfig& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const ProConfig& from) { + ProConfig::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ProConfig* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "SessionProtos.ProConfig"; + } + protected: + explicit ProConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kRotatingPrivKeyFieldNumber = 1, + kProofFieldNumber = 2, + }; + // required bytes rotatingPrivKey = 1; + bool has_rotatingprivkey() const; + private: + bool _internal_has_rotatingprivkey() const; + public: + void clear_rotatingprivkey(); + const std::string& rotatingprivkey() const; + template + void set_rotatingprivkey(ArgT0&& arg0, ArgT... args); + std::string* mutable_rotatingprivkey(); + PROTOBUF_NODISCARD std::string* release_rotatingprivkey(); + void set_allocated_rotatingprivkey(std::string* rotatingprivkey); + private: + const std::string& _internal_rotatingprivkey() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_rotatingprivkey(const std::string& value); + std::string* _internal_mutable_rotatingprivkey(); + public: + + // required .SessionProtos.ProProof proof = 2; + bool has_proof() const; + private: + bool _internal_has_proof() const; + public: + void clear_proof(); + const ::SessionProtos::ProProof& proof() const; + PROTOBUF_NODISCARD ::SessionProtos::ProProof* release_proof(); + ::SessionProtos::ProProof* mutable_proof(); + void set_allocated_proof(::SessionProtos::ProProof* proof); + private: + const ::SessionProtos::ProProof& _internal_proof() const; + ::SessionProtos::ProProof* _internal_mutable_proof(); + public: + void unsafe_arena_set_allocated_proof( + ::SessionProtos::ProProof* proof); + ::SessionProtos::ProProof* unsafe_arena_release_proof(); + + // @@protoc_insertion_point(class_scope:SessionProtos.ProConfig) + private: + class _Internal; + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr rotatingprivkey_; + ::SessionProtos::ProProof* proof_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_SessionProtos_2eproto; +}; +// ------------------------------------------------------------------- + +class ProMessage final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.ProMessage) */ { + public: + inline ProMessage() : ProMessage(nullptr) {} + ~ProMessage() override; + explicit PROTOBUF_CONSTEXPR ProMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + ProMessage(const ProMessage& from); + ProMessage(ProMessage&& from) noexcept + : ProMessage() { + *this = ::std::move(from); + } + + inline ProMessage& operator=(const ProMessage& from) { + CopyFrom(from); + return *this; + } + inline ProMessage& operator=(ProMessage&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + } + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const ProMessage& default_instance() { + return *internal_default_instance(); + } + static inline const ProMessage* internal_default_instance() { + return reinterpret_cast( + &_ProMessage_default_instance_); + } + static constexpr int kIndexInFileMessages = + 29; + + friend void swap(ProMessage& a, ProMessage& b) { + a.Swap(&b); + } + inline void Swap(ProMessage* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ProMessage* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + ProMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ProMessage& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const ProMessage& from) { + ProMessage::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ProMessage* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "SessionProtos.ProMessage"; + } + protected: + explicit ProMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kProofFieldNumber = 1, + kFlagsFieldNumber = 2, + }; + // required .SessionProtos.ProProof proof = 1; + bool has_proof() const; + private: + bool _internal_has_proof() const; + public: + void clear_proof(); + const ::SessionProtos::ProProof& proof() const; + PROTOBUF_NODISCARD ::SessionProtos::ProProof* release_proof(); + ::SessionProtos::ProProof* mutable_proof(); + void set_allocated_proof(::SessionProtos::ProProof* proof); + private: + const ::SessionProtos::ProProof& _internal_proof() const; + ::SessionProtos::ProProof* _internal_mutable_proof(); + public: + void unsafe_arena_set_allocated_proof( + ::SessionProtos::ProProof* proof); + ::SessionProtos::ProProof* unsafe_arena_release_proof(); + + // required uint32 flags = 2; + bool has_flags() const; + private: + bool _internal_has_flags() const; + public: + void clear_flags(); + uint32_t flags() const; + void set_flags(uint32_t value); + private: + uint32_t _internal_flags() const; + void _internal_set_flags(uint32_t value); + public: + + // @@protoc_insertion_point(class_scope:SessionProtos.ProMessage) + private: + class _Internal; + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::SessionProtos::ProProof* proof_; + uint32_t flags_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_SessionProtos_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Envelope + +// required .SessionProtos.Envelope.Type type = 1; +inline bool Envelope::_internal_has_type() const { + bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; + return value; +} +inline bool Envelope::has_type() const { + return _internal_has_type(); +} +inline void Envelope::clear_type() { + _impl_.type_ = 6; + _impl_._has_bits_[0] &= ~0x00000040u; +} +inline ::SessionProtos::Envelope_Type Envelope::_internal_type() const { + return static_cast< ::SessionProtos::Envelope_Type >(_impl_.type_); +} +inline ::SessionProtos::Envelope_Type Envelope::type() const { + // @@protoc_insertion_point(field_get:SessionProtos.Envelope.type) + return _internal_type(); +} +inline void Envelope::_internal_set_type(::SessionProtos::Envelope_Type value) { + assert(::SessionProtos::Envelope_Type_IsValid(value)); + _impl_._has_bits_[0] |= 0x00000040u; + _impl_.type_ = value; +} +inline void Envelope::set_type(::SessionProtos::Envelope_Type value) { + _internal_set_type(value); + // @@protoc_insertion_point(field_set:SessionProtos.Envelope.type) +} + +// optional string source = 2; +inline bool Envelope::_internal_has_source() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool Envelope::has_source() const { + return _internal_has_source(); +} +inline void Envelope::clear_source() { + _impl_.source_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& Envelope::source() const { + // @@protoc_insertion_point(field_get:SessionProtos.Envelope.source) + return _internal_source(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Envelope::set_source(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.source_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.Envelope.source) +} +inline std::string* Envelope::mutable_source() { + std::string* _s = _internal_mutable_source(); + // @@protoc_insertion_point(field_mutable:SessionProtos.Envelope.source) + return _s; +} +inline const std::string& Envelope::_internal_source() const { + return _impl_.source_.Get(); +} +inline void Envelope::_internal_set_source(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.source_.Set(value, GetArenaForAllocation()); +} +inline std::string* Envelope::_internal_mutable_source() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.source_.Mutable(GetArenaForAllocation()); +} +inline std::string* Envelope::release_source() { + // @@protoc_insertion_point(field_release:SessionProtos.Envelope.source) + if (!_internal_has_source()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.source_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.source_.IsDefault()) { + _impl_.source_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void Envelope::set_allocated_source(std::string* source) { + if (source != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.source_.SetAllocated(source, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.source_.IsDefault()) { + _impl_.source_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.Envelope.source) +} + +// optional uint32 sourceDevice = 7; +inline bool Envelope::_internal_has_sourcedevice() const { + bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; + return value; +} +inline bool Envelope::has_sourcedevice() const { + return _internal_has_sourcedevice(); +} +inline void Envelope::clear_sourcedevice() { + _impl_.sourcedevice_ = 0u; + _impl_._has_bits_[0] &= ~0x00000020u; +} +inline uint32_t Envelope::_internal_sourcedevice() const { + return _impl_.sourcedevice_; +} +inline uint32_t Envelope::sourcedevice() const { + // @@protoc_insertion_point(field_get:SessionProtos.Envelope.sourceDevice) + return _internal_sourcedevice(); +} +inline void Envelope::_internal_set_sourcedevice(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000020u; + _impl_.sourcedevice_ = value; +} +inline void Envelope::set_sourcedevice(uint32_t value) { + _internal_set_sourcedevice(value); + // @@protoc_insertion_point(field_set:SessionProtos.Envelope.sourceDevice) +} + +// required uint64 timestamp = 5; +inline bool Envelope::_internal_has_timestamp() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + return value; +} +inline bool Envelope::has_timestamp() const { + return _internal_has_timestamp(); +} +inline void Envelope::clear_timestamp() { + _impl_.timestamp_ = uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000008u; +} +inline uint64_t Envelope::_internal_timestamp() const { + return _impl_.timestamp_; +} +inline uint64_t Envelope::timestamp() const { + // @@protoc_insertion_point(field_get:SessionProtos.Envelope.timestamp) + return _internal_timestamp(); +} +inline void Envelope::_internal_set_timestamp(uint64_t value) { + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.timestamp_ = value; +} +inline void Envelope::set_timestamp(uint64_t value) { + _internal_set_timestamp(value); + // @@protoc_insertion_point(field_set:SessionProtos.Envelope.timestamp) +} + +// optional bytes content = 8; +inline bool Envelope::_internal_has_content() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool Envelope::has_content() const { + return _internal_has_content(); +} +inline void Envelope::clear_content() { + _impl_.content_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline const std::string& Envelope::content() const { + // @@protoc_insertion_point(field_get:SessionProtos.Envelope.content) + return _internal_content(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Envelope::set_content(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.content_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.Envelope.content) +} +inline std::string* Envelope::mutable_content() { + std::string* _s = _internal_mutable_content(); + // @@protoc_insertion_point(field_mutable:SessionProtos.Envelope.content) + return _s; +} +inline const std::string& Envelope::_internal_content() const { + return _impl_.content_.Get(); +} +inline void Envelope::_internal_set_content(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.content_.Set(value, GetArenaForAllocation()); +} +inline std::string* Envelope::_internal_mutable_content() { + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.content_.Mutable(GetArenaForAllocation()); +} +inline std::string* Envelope::release_content() { + // @@protoc_insertion_point(field_release:SessionProtos.Envelope.content) + if (!_internal_has_content()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.content_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.content_.IsDefault()) { + _impl_.content_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void Envelope::set_allocated_content(std::string* content) { + if (content != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + _impl_.content_.SetAllocated(content, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.content_.IsDefault()) { + _impl_.content_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:SessionProtos.Envelope.content) @@ -7050,7 +7711,7 @@ inline void Envelope::set_allocated_content(std::string* content) { // optional uint64 serverTimestamp = 10; inline bool Envelope::_internal_has_servertimestamp() const { - bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; return value; } inline bool Envelope::has_servertimestamp() const { @@ -7058,7 +7719,7 @@ inline bool Envelope::has_servertimestamp() const { } inline void Envelope::clear_servertimestamp() { _impl_.servertimestamp_ = uint64_t{0u}; - _impl_._has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000010u; } inline uint64_t Envelope::_internal_servertimestamp() const { return _impl_.servertimestamp_; @@ -7068,7 +7729,7 @@ inline uint64_t Envelope::servertimestamp() const { return _internal_servertimestamp(); } inline void Envelope::_internal_set_servertimestamp(uint64_t value) { - _impl_._has_bits_[0] |= 0x00000008u; + _impl_._has_bits_[0] |= 0x00000010u; _impl_.servertimestamp_ = value; } inline void Envelope::set_servertimestamp(uint64_t value) { @@ -7076,6 +7737,74 @@ inline void Envelope::set_servertimestamp(uint64_t value) { // @@protoc_insertion_point(field_set:SessionProtos.Envelope.serverTimestamp) } +// optional bytes proSig = 11; +inline bool Envelope::_internal_has_prosig() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; +} +inline bool Envelope::has_prosig() const { + return _internal_has_prosig(); +} +inline void Envelope::clear_prosig() { + _impl_.prosig_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000004u; +} +inline const std::string& Envelope::prosig() const { + // @@protoc_insertion_point(field_get:SessionProtos.Envelope.proSig) + return _internal_prosig(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Envelope::set_prosig(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.prosig_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.Envelope.proSig) +} +inline std::string* Envelope::mutable_prosig() { + std::string* _s = _internal_mutable_prosig(); + // @@protoc_insertion_point(field_mutable:SessionProtos.Envelope.proSig) + return _s; +} +inline const std::string& Envelope::_internal_prosig() const { + return _impl_.prosig_.Get(); +} +inline void Envelope::_internal_set_prosig(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.prosig_.Set(value, GetArenaForAllocation()); +} +inline std::string* Envelope::_internal_mutable_prosig() { + _impl_._has_bits_[0] |= 0x00000004u; + return _impl_.prosig_.Mutable(GetArenaForAllocation()); +} +inline std::string* Envelope::release_prosig() { + // @@protoc_insertion_point(field_release:SessionProtos.Envelope.proSig) + if (!_internal_has_prosig()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000004u; + auto* p = _impl_.prosig_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.prosig_.IsDefault()) { + _impl_.prosig_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void Envelope::set_allocated_prosig(std::string* prosig) { + if (prosig != nullptr) { + _impl_._has_bits_[0] |= 0x00000004u; + } else { + _impl_._has_bits_[0] &= ~0x00000004u; + } + _impl_.prosig_.SetAllocated(prosig, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.prosig_.IsDefault()) { + _impl_.prosig_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.Envelope.proSig) +} + // ------------------------------------------------------------------- // TypingMessage @@ -8153,7 +8882,7 @@ inline void Content::set_allocated_sharedconfigmessage(::SessionProtos::SharedCo // optional .SessionProtos.Content.ExpirationType expirationType = 12; inline bool Content::_internal_has_expirationtype() const { - bool value = (_impl_._has_bits_[0] & 0x00000100u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000200u) != 0; return value; } inline bool Content::has_expirationtype() const { @@ -8161,7 +8890,7 @@ inline bool Content::has_expirationtype() const { } inline void Content::clear_expirationtype() { _impl_.expirationtype_ = 0; - _impl_._has_bits_[0] &= ~0x00000100u; + _impl_._has_bits_[0] &= ~0x00000200u; } inline ::SessionProtos::Content_ExpirationType Content::_internal_expirationtype() const { return static_cast< ::SessionProtos::Content_ExpirationType >(_impl_.expirationtype_); @@ -8172,7 +8901,7 @@ inline ::SessionProtos::Content_ExpirationType Content::expirationtype() const { } inline void Content::_internal_set_expirationtype(::SessionProtos::Content_ExpirationType value) { assert(::SessionProtos::Content_ExpirationType_IsValid(value)); - _impl_._has_bits_[0] |= 0x00000100u; + _impl_._has_bits_[0] |= 0x00000200u; _impl_.expirationtype_ = value; } inline void Content::set_expirationtype(::SessionProtos::Content_ExpirationType value) { @@ -8182,7 +8911,7 @@ inline void Content::set_expirationtype(::SessionProtos::Content_ExpirationType // optional uint32 expirationTimer = 13; inline bool Content::_internal_has_expirationtimer() const { - bool value = (_impl_._has_bits_[0] & 0x00000200u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000400u) != 0; return value; } inline bool Content::has_expirationtimer() const { @@ -8190,7 +8919,7 @@ inline bool Content::has_expirationtimer() const { } inline void Content::clear_expirationtimer() { _impl_.expirationtimer_ = 0u; - _impl_._has_bits_[0] &= ~0x00000200u; + _impl_._has_bits_[0] &= ~0x00000400u; } inline uint32_t Content::_internal_expirationtimer() const { return _impl_.expirationtimer_; @@ -8200,7 +8929,7 @@ inline uint32_t Content::expirationtimer() const { return _internal_expirationtimer(); } inline void Content::_internal_set_expirationtimer(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000200u; + _impl_._has_bits_[0] |= 0x00000400u; _impl_.expirationtimer_ = value; } inline void Content::set_expirationtimer(uint32_t value) { @@ -8210,7 +8939,7 @@ inline void Content::set_expirationtimer(uint32_t value) { // optional uint64 sigTimestamp = 15; inline bool Content::_internal_has_sigtimestamp() const { - bool value = (_impl_._has_bits_[0] & 0x00000400u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000800u) != 0; return value; } inline bool Content::has_sigtimestamp() const { @@ -8218,22 +8947,112 @@ inline bool Content::has_sigtimestamp() const { } inline void Content::clear_sigtimestamp() { _impl_.sigtimestamp_ = uint64_t{0u}; - _impl_._has_bits_[0] &= ~0x00000400u; + _impl_._has_bits_[0] &= ~0x00000800u; +} +inline uint64_t Content::_internal_sigtimestamp() const { + return _impl_.sigtimestamp_; +} +inline uint64_t Content::sigtimestamp() const { + // @@protoc_insertion_point(field_get:SessionProtos.Content.sigTimestamp) + return _internal_sigtimestamp(); +} +inline void Content::_internal_set_sigtimestamp(uint64_t value) { + _impl_._has_bits_[0] |= 0x00000800u; + _impl_.sigtimestamp_ = value; +} +inline void Content::set_sigtimestamp(uint64_t value) { + _internal_set_sigtimestamp(value); + // @@protoc_insertion_point(field_set:SessionProtos.Content.sigTimestamp) +} + +// optional .SessionProtos.ProMessage proMessage = 16; +inline bool Content::_internal_has_promessage() const { + bool value = (_impl_._has_bits_[0] & 0x00000100u) != 0; + PROTOBUF_ASSUME(!value || _impl_.promessage_ != nullptr); + return value; +} +inline bool Content::has_promessage() const { + return _internal_has_promessage(); +} +inline void Content::clear_promessage() { + if (_impl_.promessage_ != nullptr) _impl_.promessage_->Clear(); + _impl_._has_bits_[0] &= ~0x00000100u; +} +inline const ::SessionProtos::ProMessage& Content::_internal_promessage() const { + const ::SessionProtos::ProMessage* p = _impl_.promessage_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_ProMessage_default_instance_); +} +inline const ::SessionProtos::ProMessage& Content::promessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.Content.proMessage) + return _internal_promessage(); +} +inline void Content::unsafe_arena_set_allocated_promessage( + ::SessionProtos::ProMessage* promessage) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.promessage_); + } + _impl_.promessage_ = promessage; + if (promessage) { + _impl_._has_bits_[0] |= 0x00000100u; + } else { + _impl_._has_bits_[0] &= ~0x00000100u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.proMessage) +} +inline ::SessionProtos::ProMessage* Content::release_promessage() { + _impl_._has_bits_[0] &= ~0x00000100u; + ::SessionProtos::ProMessage* temp = _impl_.promessage_; + _impl_.promessage_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; } -inline uint64_t Content::_internal_sigtimestamp() const { - return _impl_.sigtimestamp_; +inline ::SessionProtos::ProMessage* Content::unsafe_arena_release_promessage() { + // @@protoc_insertion_point(field_release:SessionProtos.Content.proMessage) + _impl_._has_bits_[0] &= ~0x00000100u; + ::SessionProtos::ProMessage* temp = _impl_.promessage_; + _impl_.promessage_ = nullptr; + return temp; } -inline uint64_t Content::sigtimestamp() const { - // @@protoc_insertion_point(field_get:SessionProtos.Content.sigTimestamp) - return _internal_sigtimestamp(); +inline ::SessionProtos::ProMessage* Content::_internal_mutable_promessage() { + _impl_._has_bits_[0] |= 0x00000100u; + if (_impl_.promessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::ProMessage>(GetArenaForAllocation()); + _impl_.promessage_ = p; + } + return _impl_.promessage_; } -inline void Content::_internal_set_sigtimestamp(uint64_t value) { - _impl_._has_bits_[0] |= 0x00000400u; - _impl_.sigtimestamp_ = value; +inline ::SessionProtos::ProMessage* Content::mutable_promessage() { + ::SessionProtos::ProMessage* _msg = _internal_mutable_promessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.Content.proMessage) + return _msg; } -inline void Content::set_sigtimestamp(uint64_t value) { - _internal_set_sigtimestamp(value); - // @@protoc_insertion_point(field_set:SessionProtos.Content.sigTimestamp) +inline void Content::set_allocated_promessage(::SessionProtos::ProMessage* promessage) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.promessage_; + } + if (promessage) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(promessage); + if (message_arena != submessage_arena) { + promessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, promessage, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000100u; + } else { + _impl_._has_bits_[0] &= ~0x00000100u; + } + _impl_.promessage_ = promessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.proMessage) } // ------------------------------------------------------------------- @@ -13213,153 +14032,701 @@ GroupUpdateDeleteMemberContentMessage::membersessionids() const { // @@protoc_insertion_point(field_list:SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds) return _impl_.membersessionids_; } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -GroupUpdateDeleteMemberContentMessage::mutable_membersessionids() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds) - return &_impl_.membersessionids_; +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* +GroupUpdateDeleteMemberContentMessage::mutable_membersessionids() { + // @@protoc_insertion_point(field_mutable_list:SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds) + return &_impl_.membersessionids_; +} + +// repeated string messageHashes = 2; +inline int GroupUpdateDeleteMemberContentMessage::_internal_messagehashes_size() const { + return _impl_.messagehashes_.size(); +} +inline int GroupUpdateDeleteMemberContentMessage::messagehashes_size() const { + return _internal_messagehashes_size(); +} +inline void GroupUpdateDeleteMemberContentMessage::clear_messagehashes() { + _impl_.messagehashes_.Clear(); +} +inline std::string* GroupUpdateDeleteMemberContentMessage::add_messagehashes() { + std::string* _s = _internal_add_messagehashes(); + // @@protoc_insertion_point(field_add_mutable:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) + return _s; +} +inline const std::string& GroupUpdateDeleteMemberContentMessage::_internal_messagehashes(int index) const { + return _impl_.messagehashes_.Get(index); +} +inline const std::string& GroupUpdateDeleteMemberContentMessage::messagehashes(int index) const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) + return _internal_messagehashes(index); +} +inline std::string* GroupUpdateDeleteMemberContentMessage::mutable_messagehashes(int index) { + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) + return _impl_.messagehashes_.Mutable(index); +} +inline void GroupUpdateDeleteMemberContentMessage::set_messagehashes(int index, const std::string& value) { + _impl_.messagehashes_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +} +inline void GroupUpdateDeleteMemberContentMessage::set_messagehashes(int index, std::string&& value) { + _impl_.messagehashes_.Mutable(index)->assign(std::move(value)); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +} +inline void GroupUpdateDeleteMemberContentMessage::set_messagehashes(int index, const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.messagehashes_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +} +inline void GroupUpdateDeleteMemberContentMessage::set_messagehashes(int index, const char* value, size_t size) { + _impl_.messagehashes_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +} +inline std::string* GroupUpdateDeleteMemberContentMessage::_internal_add_messagehashes() { + return _impl_.messagehashes_.Add(); +} +inline void GroupUpdateDeleteMemberContentMessage::add_messagehashes(const std::string& value) { + _impl_.messagehashes_.Add()->assign(value); + // @@protoc_insertion_point(field_add:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +} +inline void GroupUpdateDeleteMemberContentMessage::add_messagehashes(std::string&& value) { + _impl_.messagehashes_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +} +inline void GroupUpdateDeleteMemberContentMessage::add_messagehashes(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.messagehashes_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +} +inline void GroupUpdateDeleteMemberContentMessage::add_messagehashes(const char* value, size_t size) { + _impl_.messagehashes_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& +GroupUpdateDeleteMemberContentMessage::messagehashes() const { + // @@protoc_insertion_point(field_list:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) + return _impl_.messagehashes_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* +GroupUpdateDeleteMemberContentMessage::mutable_messagehashes() { + // @@protoc_insertion_point(field_mutable_list:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) + return &_impl_.messagehashes_; +} + +// optional bytes adminSignature = 3; +inline bool GroupUpdateDeleteMemberContentMessage::_internal_has_adminsignature() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool GroupUpdateDeleteMemberContentMessage::has_adminsignature() const { + return _internal_has_adminsignature(); +} +inline void GroupUpdateDeleteMemberContentMessage::clear_adminsignature() { + _impl_.adminsignature_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& GroupUpdateDeleteMemberContentMessage::adminsignature() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateDeleteMemberContentMessage.adminSignature) + return _internal_adminsignature(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void GroupUpdateDeleteMemberContentMessage::set_adminsignature(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.adminsignature_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateDeleteMemberContentMessage.adminSignature) +} +inline std::string* GroupUpdateDeleteMemberContentMessage::mutable_adminsignature() { + std::string* _s = _internal_mutable_adminsignature(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateDeleteMemberContentMessage.adminSignature) + return _s; +} +inline const std::string& GroupUpdateDeleteMemberContentMessage::_internal_adminsignature() const { + return _impl_.adminsignature_.Get(); +} +inline void GroupUpdateDeleteMemberContentMessage::_internal_set_adminsignature(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.adminsignature_.Set(value, GetArenaForAllocation()); +} +inline std::string* GroupUpdateDeleteMemberContentMessage::_internal_mutable_adminsignature() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.adminsignature_.Mutable(GetArenaForAllocation()); +} +inline std::string* GroupUpdateDeleteMemberContentMessage::release_adminsignature() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateDeleteMemberContentMessage.adminSignature) + if (!_internal_has_adminsignature()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.adminsignature_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.adminsignature_.IsDefault()) { + _impl_.adminsignature_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void GroupUpdateDeleteMemberContentMessage::set_allocated_adminsignature(std::string* adminsignature) { + if (adminsignature != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.adminsignature_.SetAllocated(adminsignature, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.adminsignature_.IsDefault()) { + _impl_.adminsignature_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateDeleteMemberContentMessage.adminSignature) +} + +// ------------------------------------------------------------------- + +// ProProof + +// required uint32 version = 1; +inline bool ProProof::_internal_has_version() const { + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; + return value; +} +inline bool ProProof::has_version() const { + return _internal_has_version(); +} +inline void ProProof::clear_version() { + _impl_.version_ = 0u; + _impl_._has_bits_[0] &= ~0x00000010u; +} +inline uint32_t ProProof::_internal_version() const { + return _impl_.version_; +} +inline uint32_t ProProof::version() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProProof.version) + return _internal_version(); +} +inline void ProProof::_internal_set_version(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.version_ = value; +} +inline void ProProof::set_version(uint32_t value) { + _internal_set_version(value); + // @@protoc_insertion_point(field_set:SessionProtos.ProProof.version) +} + +// required bytes genIndexHash = 2; +inline bool ProProof::_internal_has_genindexhash() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool ProProof::has_genindexhash() const { + return _internal_has_genindexhash(); +} +inline void ProProof::clear_genindexhash() { + _impl_.genindexhash_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& ProProof::genindexhash() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProProof.genIndexHash) + return _internal_genindexhash(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void ProProof::set_genindexhash(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.genindexhash_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.ProProof.genIndexHash) +} +inline std::string* ProProof::mutable_genindexhash() { + std::string* _s = _internal_mutable_genindexhash(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ProProof.genIndexHash) + return _s; +} +inline const std::string& ProProof::_internal_genindexhash() const { + return _impl_.genindexhash_.Get(); +} +inline void ProProof::_internal_set_genindexhash(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.genindexhash_.Set(value, GetArenaForAllocation()); +} +inline std::string* ProProof::_internal_mutable_genindexhash() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.genindexhash_.Mutable(GetArenaForAllocation()); +} +inline std::string* ProProof::release_genindexhash() { + // @@protoc_insertion_point(field_release:SessionProtos.ProProof.genIndexHash) + if (!_internal_has_genindexhash()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.genindexhash_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.genindexhash_.IsDefault()) { + _impl_.genindexhash_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void ProProof::set_allocated_genindexhash(std::string* genindexhash) { + if (genindexhash != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.genindexhash_.SetAllocated(genindexhash, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.genindexhash_.IsDefault()) { + _impl_.genindexhash_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProProof.genIndexHash) +} + +// required bytes rotatingPublicKey = 3; +inline bool ProProof::_internal_has_rotatingpublickey() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool ProProof::has_rotatingpublickey() const { + return _internal_has_rotatingpublickey(); +} +inline void ProProof::clear_rotatingpublickey() { + _impl_.rotatingpublickey_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline const std::string& ProProof::rotatingpublickey() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProProof.rotatingPublicKey) + return _internal_rotatingpublickey(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void ProProof::set_rotatingpublickey(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.rotatingpublickey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.ProProof.rotatingPublicKey) +} +inline std::string* ProProof::mutable_rotatingpublickey() { + std::string* _s = _internal_mutable_rotatingpublickey(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ProProof.rotatingPublicKey) + return _s; +} +inline const std::string& ProProof::_internal_rotatingpublickey() const { + return _impl_.rotatingpublickey_.Get(); +} +inline void ProProof::_internal_set_rotatingpublickey(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.rotatingpublickey_.Set(value, GetArenaForAllocation()); +} +inline std::string* ProProof::_internal_mutable_rotatingpublickey() { + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.rotatingpublickey_.Mutable(GetArenaForAllocation()); +} +inline std::string* ProProof::release_rotatingpublickey() { + // @@protoc_insertion_point(field_release:SessionProtos.ProProof.rotatingPublicKey) + if (!_internal_has_rotatingpublickey()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.rotatingpublickey_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.rotatingpublickey_.IsDefault()) { + _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void ProProof::set_allocated_rotatingpublickey(std::string* rotatingpublickey) { + if (rotatingpublickey != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + _impl_.rotatingpublickey_.SetAllocated(rotatingpublickey, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.rotatingpublickey_.IsDefault()) { + _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProProof.rotatingPublicKey) } -// repeated string messageHashes = 2; -inline int GroupUpdateDeleteMemberContentMessage::_internal_messagehashes_size() const { - return _impl_.messagehashes_.size(); +// required uint64 expiryUnixTs = 4; +inline bool ProProof::_internal_has_expiryunixts() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + return value; } -inline int GroupUpdateDeleteMemberContentMessage::messagehashes_size() const { - return _internal_messagehashes_size(); +inline bool ProProof::has_expiryunixts() const { + return _internal_has_expiryunixts(); } -inline void GroupUpdateDeleteMemberContentMessage::clear_messagehashes() { - _impl_.messagehashes_.Clear(); +inline void ProProof::clear_expiryunixts() { + _impl_.expiryunixts_ = uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000008u; } -inline std::string* GroupUpdateDeleteMemberContentMessage::add_messagehashes() { - std::string* _s = _internal_add_messagehashes(); - // @@protoc_insertion_point(field_add_mutable:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) - return _s; +inline uint64_t ProProof::_internal_expiryunixts() const { + return _impl_.expiryunixts_; } -inline const std::string& GroupUpdateDeleteMemberContentMessage::_internal_messagehashes(int index) const { - return _impl_.messagehashes_.Get(index); +inline uint64_t ProProof::expiryunixts() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProProof.expiryUnixTs) + return _internal_expiryunixts(); } -inline const std::string& GroupUpdateDeleteMemberContentMessage::messagehashes(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) - return _internal_messagehashes(index); +inline void ProProof::_internal_set_expiryunixts(uint64_t value) { + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.expiryunixts_ = value; } -inline std::string* GroupUpdateDeleteMemberContentMessage::mutable_messagehashes(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) - return _impl_.messagehashes_.Mutable(index); +inline void ProProof::set_expiryunixts(uint64_t value) { + _internal_set_expiryunixts(value); + // @@protoc_insertion_point(field_set:SessionProtos.ProProof.expiryUnixTs) } -inline void GroupUpdateDeleteMemberContentMessage::set_messagehashes(int index, const std::string& value) { - _impl_.messagehashes_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) + +// required bytes sig = 5; +inline bool ProProof::_internal_has_sig() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; } -inline void GroupUpdateDeleteMemberContentMessage::set_messagehashes(int index, std::string&& value) { - _impl_.messagehashes_.Mutable(index)->assign(std::move(value)); - // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +inline bool ProProof::has_sig() const { + return _internal_has_sig(); } -inline void GroupUpdateDeleteMemberContentMessage::set_messagehashes(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.messagehashes_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +inline void ProProof::clear_sig() { + _impl_.sig_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000004u; } -inline void GroupUpdateDeleteMemberContentMessage::set_messagehashes(int index, const char* value, size_t size) { - _impl_.messagehashes_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +inline const std::string& ProProof::sig() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProProof.sig) + return _internal_sig(); } -inline std::string* GroupUpdateDeleteMemberContentMessage::_internal_add_messagehashes() { - return _impl_.messagehashes_.Add(); +template +inline PROTOBUF_ALWAYS_INLINE +void ProProof::set_sig(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.sig_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.ProProof.sig) } -inline void GroupUpdateDeleteMemberContentMessage::add_messagehashes(const std::string& value) { - _impl_.messagehashes_.Add()->assign(value); - // @@protoc_insertion_point(field_add:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +inline std::string* ProProof::mutable_sig() { + std::string* _s = _internal_mutable_sig(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ProProof.sig) + return _s; } -inline void GroupUpdateDeleteMemberContentMessage::add_messagehashes(std::string&& value) { - _impl_.messagehashes_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +inline const std::string& ProProof::_internal_sig() const { + return _impl_.sig_.Get(); } -inline void GroupUpdateDeleteMemberContentMessage::add_messagehashes(const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.messagehashes_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +inline void ProProof::_internal_set_sig(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.sig_.Set(value, GetArenaForAllocation()); } -inline void GroupUpdateDeleteMemberContentMessage::add_messagehashes(const char* value, size_t size) { - _impl_.messagehashes_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) +inline std::string* ProProof::_internal_mutable_sig() { + _impl_._has_bits_[0] |= 0x00000004u; + return _impl_.sig_.Mutable(GetArenaForAllocation()); } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -GroupUpdateDeleteMemberContentMessage::messagehashes() const { - // @@protoc_insertion_point(field_list:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) - return _impl_.messagehashes_; +inline std::string* ProProof::release_sig() { + // @@protoc_insertion_point(field_release:SessionProtos.ProProof.sig) + if (!_internal_has_sig()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000004u; + auto* p = _impl_.sig_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.sig_.IsDefault()) { + _impl_.sig_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -GroupUpdateDeleteMemberContentMessage::mutable_messagehashes() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) - return &_impl_.messagehashes_; +inline void ProProof::set_allocated_sig(std::string* sig) { + if (sig != nullptr) { + _impl_._has_bits_[0] |= 0x00000004u; + } else { + _impl_._has_bits_[0] &= ~0x00000004u; + } + _impl_.sig_.SetAllocated(sig, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.sig_.IsDefault()) { + _impl_.sig_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProProof.sig) } -// optional bytes adminSignature = 3; -inline bool GroupUpdateDeleteMemberContentMessage::_internal_has_adminsignature() const { +// ------------------------------------------------------------------- + +// ProConfig + +// required bytes rotatingPrivKey = 1; +inline bool ProConfig::_internal_has_rotatingprivkey() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool GroupUpdateDeleteMemberContentMessage::has_adminsignature() const { - return _internal_has_adminsignature(); +inline bool ProConfig::has_rotatingprivkey() const { + return _internal_has_rotatingprivkey(); } -inline void GroupUpdateDeleteMemberContentMessage::clear_adminsignature() { - _impl_.adminsignature_.ClearToEmpty(); +inline void ProConfig::clear_rotatingprivkey() { + _impl_.rotatingprivkey_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& GroupUpdateDeleteMemberContentMessage::adminsignature() const { - // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateDeleteMemberContentMessage.adminSignature) - return _internal_adminsignature(); +inline const std::string& ProConfig::rotatingprivkey() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProConfig.rotatingPrivKey) + return _internal_rotatingprivkey(); } template inline PROTOBUF_ALWAYS_INLINE -void GroupUpdateDeleteMemberContentMessage::set_adminsignature(ArgT0&& arg0, ArgT... args) { +void ProConfig::set_rotatingprivkey(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.adminsignature_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateDeleteMemberContentMessage.adminSignature) + _impl_.rotatingprivkey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.ProConfig.rotatingPrivKey) } -inline std::string* GroupUpdateDeleteMemberContentMessage::mutable_adminsignature() { - std::string* _s = _internal_mutable_adminsignature(); - // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateDeleteMemberContentMessage.adminSignature) +inline std::string* ProConfig::mutable_rotatingprivkey() { + std::string* _s = _internal_mutable_rotatingprivkey(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ProConfig.rotatingPrivKey) return _s; } -inline const std::string& GroupUpdateDeleteMemberContentMessage::_internal_adminsignature() const { - return _impl_.adminsignature_.Get(); +inline const std::string& ProConfig::_internal_rotatingprivkey() const { + return _impl_.rotatingprivkey_.Get(); } -inline void GroupUpdateDeleteMemberContentMessage::_internal_set_adminsignature(const std::string& value) { +inline void ProConfig::_internal_set_rotatingprivkey(const std::string& value) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.adminsignature_.Set(value, GetArenaForAllocation()); + _impl_.rotatingprivkey_.Set(value, GetArenaForAllocation()); } -inline std::string* GroupUpdateDeleteMemberContentMessage::_internal_mutable_adminsignature() { +inline std::string* ProConfig::_internal_mutable_rotatingprivkey() { _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.adminsignature_.Mutable(GetArenaForAllocation()); + return _impl_.rotatingprivkey_.Mutable(GetArenaForAllocation()); } -inline std::string* GroupUpdateDeleteMemberContentMessage::release_adminsignature() { - // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateDeleteMemberContentMessage.adminSignature) - if (!_internal_has_adminsignature()) { +inline std::string* ProConfig::release_rotatingprivkey() { + // @@protoc_insertion_point(field_release:SessionProtos.ProConfig.rotatingPrivKey) + if (!_internal_has_rotatingprivkey()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.adminsignature_.Release(); + auto* p = _impl_.rotatingprivkey_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.adminsignature_.IsDefault()) { - _impl_.adminsignature_.Set("", GetArenaForAllocation()); + if (_impl_.rotatingprivkey_.IsDefault()) { + _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void GroupUpdateDeleteMemberContentMessage::set_allocated_adminsignature(std::string* adminsignature) { - if (adminsignature != nullptr) { +inline void ProConfig::set_allocated_rotatingprivkey(std::string* rotatingprivkey) { + if (rotatingprivkey != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; } else { _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.adminsignature_.SetAllocated(adminsignature, GetArenaForAllocation()); + _impl_.rotatingprivkey_.SetAllocated(rotatingprivkey, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.adminsignature_.IsDefault()) { - _impl_.adminsignature_.Set("", GetArenaForAllocation()); + if (_impl_.rotatingprivkey_.IsDefault()) { + _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateDeleteMemberContentMessage.adminSignature) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProConfig.rotatingPrivKey) +} + +// required .SessionProtos.ProProof proof = 2; +inline bool ProConfig::_internal_has_proof() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + PROTOBUF_ASSUME(!value || _impl_.proof_ != nullptr); + return value; +} +inline bool ProConfig::has_proof() const { + return _internal_has_proof(); +} +inline void ProConfig::clear_proof() { + if (_impl_.proof_ != nullptr) _impl_.proof_->Clear(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline const ::SessionProtos::ProProof& ProConfig::_internal_proof() const { + const ::SessionProtos::ProProof* p = _impl_.proof_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_ProProof_default_instance_); +} +inline const ::SessionProtos::ProProof& ProConfig::proof() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProConfig.proof) + return _internal_proof(); +} +inline void ProConfig::unsafe_arena_set_allocated_proof( + ::SessionProtos::ProProof* proof) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.proof_); + } + _impl_.proof_ = proof; + if (proof) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.ProConfig.proof) +} +inline ::SessionProtos::ProProof* ProConfig::release_proof() { + _impl_._has_bits_[0] &= ~0x00000002u; + ::SessionProtos::ProProof* temp = _impl_.proof_; + _impl_.proof_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::SessionProtos::ProProof* ProConfig::unsafe_arena_release_proof() { + // @@protoc_insertion_point(field_release:SessionProtos.ProConfig.proof) + _impl_._has_bits_[0] &= ~0x00000002u; + ::SessionProtos::ProProof* temp = _impl_.proof_; + _impl_.proof_ = nullptr; + return temp; +} +inline ::SessionProtos::ProProof* ProConfig::_internal_mutable_proof() { + _impl_._has_bits_[0] |= 0x00000002u; + if (_impl_.proof_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::ProProof>(GetArenaForAllocation()); + _impl_.proof_ = p; + } + return _impl_.proof_; +} +inline ::SessionProtos::ProProof* ProConfig::mutable_proof() { + ::SessionProtos::ProProof* _msg = _internal_mutable_proof(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ProConfig.proof) + return _msg; +} +inline void ProConfig::set_allocated_proof(::SessionProtos::ProProof* proof) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.proof_; + } + if (proof) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(proof); + if (message_arena != submessage_arena) { + proof = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, proof, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + _impl_.proof_ = proof; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProConfig.proof) +} + +// ------------------------------------------------------------------- + +// ProMessage + +// required .SessionProtos.ProProof proof = 1; +inline bool ProMessage::_internal_has_proof() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.proof_ != nullptr); + return value; +} +inline bool ProMessage::has_proof() const { + return _internal_has_proof(); +} +inline void ProMessage::clear_proof() { + if (_impl_.proof_ != nullptr) _impl_.proof_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const ::SessionProtos::ProProof& ProMessage::_internal_proof() const { + const ::SessionProtos::ProProof* p = _impl_.proof_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_ProProof_default_instance_); +} +inline const ::SessionProtos::ProProof& ProMessage::proof() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProMessage.proof) + return _internal_proof(); +} +inline void ProMessage::unsafe_arena_set_allocated_proof( + ::SessionProtos::ProProof* proof) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.proof_); + } + _impl_.proof_ = proof; + if (proof) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.ProMessage.proof) +} +inline ::SessionProtos::ProProof* ProMessage::release_proof() { + _impl_._has_bits_[0] &= ~0x00000001u; + ::SessionProtos::ProProof* temp = _impl_.proof_; + _impl_.proof_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::SessionProtos::ProProof* ProMessage::unsafe_arena_release_proof() { + // @@protoc_insertion_point(field_release:SessionProtos.ProMessage.proof) + _impl_._has_bits_[0] &= ~0x00000001u; + ::SessionProtos::ProProof* temp = _impl_.proof_; + _impl_.proof_ = nullptr; + return temp; +} +inline ::SessionProtos::ProProof* ProMessage::_internal_mutable_proof() { + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.proof_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::ProProof>(GetArenaForAllocation()); + _impl_.proof_ = p; + } + return _impl_.proof_; +} +inline ::SessionProtos::ProProof* ProMessage::mutable_proof() { + ::SessionProtos::ProProof* _msg = _internal_mutable_proof(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ProMessage.proof) + return _msg; +} +inline void ProMessage::set_allocated_proof(::SessionProtos::ProProof* proof) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.proof_; + } + if (proof) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(proof); + if (message_arena != submessage_arena) { + proof = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, proof, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.proof_ = proof; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProMessage.proof) +} + +// required uint32 flags = 2; +inline bool ProMessage::_internal_has_flags() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool ProMessage::has_flags() const { + return _internal_has_flags(); +} +inline void ProMessage::clear_flags() { + _impl_.flags_ = 0u; + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline uint32_t ProMessage::_internal_flags() const { + return _impl_.flags_; +} +inline uint32_t ProMessage::flags() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProMessage.flags) + return _internal_flags(); +} +inline void ProMessage::_internal_set_flags(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.flags_ = value; +} +inline void ProMessage::set_flags(uint32_t value) { + _internal_set_flags(value); + // @@protoc_insertion_point(field_set:SessionProtos.ProMessage.flags) } #ifdef __GNUC__ @@ -13417,6 +14784,12 @@ inline void GroupUpdateDeleteMemberContentMessage::set_allocated_adminsignature( // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) diff --git a/proto/SessionProtos.proto b/proto/SessionProtos.proto index 07dec5ec..98dcf025 100644 --- a/proto/SessionProtos.proto +++ b/proto/SessionProtos.proto @@ -19,6 +19,7 @@ message Envelope { required uint64 timestamp = 5; optional bytes content = 8; optional uint64 serverTimestamp = 10; + optional bytes proSig = 11; } message TypingMessage { @@ -70,6 +71,7 @@ message Content { optional ExpirationType expirationType = 12; optional uint32 expirationTimer = 13; optional uint64 sigTimestamp = 15; + optional ProMessage proMessage = 16; } message CallMessage { @@ -324,3 +326,16 @@ message GroupUpdateDeleteMemberContentMessage { repeated string messageHashes = 2; optional bytes adminSignature = 3; } + +message ProProof { + required uint32 version = 1; + required bytes genIndexHash = 2; + required bytes rotatingPublicKey = 3; + required uint64 expiryUnixTs = 4; + required bytes sig = 5; +} + +message ProMessage { + required ProProof proof = 1; + required uint32 flags = 2; +} From fc953757cda1695bfb7d362ed6970dfe76fa5c57 Mon Sep 17 00:00:00 2001 From: doylet Date: Fri, 8 Aug 2025 16:29:31 +1000 Subject: [PATCH 15/59] Port encrypt for namespace into libsession --- include/session/config/namespaces.hpp | 6 + include/session/config/pro.h | 11 +- include/session/config/user_profile.h | 43 + include/session/config/user_profile.hpp | 4 +- include/session/pro.hpp | 72 - include/session/pro_backend.hpp | 52 + include/session/session_protocol.h | 33 + include/session/session_protocol.hpp | 93 + include/session/types.hpp | 10 + proto/SessionProtos.pb.cc | 3330 ++++++++++------------- proto/SessionProtos.pb.h | 1906 +++---------- proto/SessionProtos.proto | 2 + src/CMakeLists.txt | 3 +- src/config/internal.hpp | 9 - src/config/pro.cpp | 6 +- src/config/user_profile.cpp | 45 +- src/{pro.cpp => pro_backend.cpp} | 73 +- src/session_encrypt.cpp | 2 +- src/session_protocol.cpp | 305 +++ 19 files changed, 2528 insertions(+), 3477 deletions(-) delete mode 100644 include/session/pro.hpp create mode 100644 include/session/pro_backend.hpp create mode 100644 include/session/session_protocol.h create mode 100644 include/session/session_protocol.hpp rename src/{pro.cpp => pro_backend.cpp} (55%) create mode 100644 src/session_protocol.cpp diff --git a/include/session/config/namespaces.hpp b/include/session/config/namespaces.hpp index 690f6cba..1383ebac 100644 --- a/include/session/config/namespaces.hpp +++ b/include/session/config/namespaces.hpp @@ -5,6 +5,12 @@ namespace session::config { enum class Namespace : std::int16_t { + // Messages sent to an updated closed group which should be able to be retrieved by revoked + // members are stored in this namespace + RevokedRetrievableGroupMessages = -11, + + // Messages sent to one-to-one conversations are stored in this namespace + Default = 0, UserProfile = 2, Contacts = 3, ConvoInfoVolatile = 4, diff --git a/include/session/config/pro.h b/include/session/config/pro.h index 06d2f3c7..cd5c8bc7 100644 --- a/include/session/config/pro.h +++ b/include/session/config/pro.h @@ -4,6 +4,7 @@ extern "C" { #endif +#include #include #include @@ -17,14 +18,18 @@ struct pro_proof { uint8_t sig[64]; }; -struct pro_pro { +struct pro_pro_config { uint8_t rotating_privkey[64]; pro_proof proof; }; -LIBSESSION_EXPORT bool proof_verify(pro_proof const *proof, uint8_t const *verify_pubkey); +LIBSESSION_EXPORT pro_proof pro_proof_init(char const *dump, size_t dump_len); -LIBSESSION_EXPORT bool pro_verify(pro_pro const *pro, uint8_t const *verify_pubkey); +LIBSESSION_EXPORT pro_pro_config pro_pro_init(char const *dump, size_t dump_len); + +LIBSESSION_EXPORT bool pro_proof_verify(pro_proof const *proof, uint8_t const *verify_pubkey); + +LIBSESSION_EXPORT bool pro_pro_verify(pro_pro_config const *pro, uint8_t const *verify_pubkey); #ifdef __cplusplus } // extern "C" diff --git a/include/session/config/user_profile.h b/include/session/config/user_profile.h index 94d3531c..61df3434 100644 --- a/include/session/config/user_profile.h +++ b/include/session/config/user_profile.h @@ -6,6 +6,7 @@ extern "C" { #include "base.h" #include "profile_pic.h" +#include "pro.h" /// API: user_profile/user_profile_init /// @@ -279,6 +280,48 @@ LIBSESSION_EXPORT void user_profile_set_blinded_msgreqs(config_object* conf, int /// information. Will be `0` if it's never been updated. LIBSESSION_EXPORT int64_t user_profile_get_profile_updated(config_object* conf); +/// API: user_profile/user_profile_get_pro_config +/// +/// Get the Pro data for the user profile if it exists which includes the users rotating private key +/// and their last authorised proof. +/// +/// Declaration: +/// ```cpp +/// BOOL user_profile_get_pro_config( +/// [in] const config_object* conf +/// [out] pro_pro* pro +/// ); +/// ``` +/// +/// Inputs: +/// - `conf` -- [in] Pointer to the config object +/// - `pro` -- [out] Pointer to the pro object where the retrieved details are written +/// +/// Outputs: +/// - `bool` -- True if the user profile had Pro data associated with it. Otherwise false and the +/// pro structure will remain untouched. +LIBSESSION_EXPORT bool user_profile_get_pro_config(const config_object* conf, pro_pro_config *pro); + +/// API: user_profile/user_profile_set_pro_config +/// +/// Update the pro data associated with the user profile. +/// +/// Declaration: +/// ```cpp +/// VOID user_profile_set_pro_config( +/// [in] config_object* conf, +/// [in] pro_pro* pro +/// ); +/// ``` +/// +/// Inputs: +/// - `conf` -- [in] Pointer to the config object +/// - `pro` -- [in] Pointer to the Pro data to write to the user profile +/// +/// Outputs: +/// - `void` -- Returns nothing +LIBSESSION_EXPORT void user_profile_set_pro_config(config_object* conf, const pro_pro_config *pro); + #ifdef __cplusplus } // extern "C" #endif diff --git a/include/session/config/user_profile.hpp b/include/session/config/user_profile.hpp index d7c9cb71..8314ea91 100644 --- a/include/session/config/user_profile.hpp +++ b/include/session/config/user_profile.hpp @@ -250,7 +250,7 @@ class UserProfile : public ConfigBase { /// user does not have any entitlement to Session Pro data. /// /// Inputs: None - std::optional get_pro_data() const; + std::optional get_pro_config() const; /// API: user_profile/UserProfile::set_pro_data /// @@ -261,7 +261,7 @@ class UserProfile : public ConfigBase { /// Inputs: /// - `pro` -- The Session Pro components to assign to the current user profile. This will /// overwrite any existing Session Pro data if it exists. No verification of `pro` is done. - void set_pro_data(const ProConfig& pro); + void set_pro_config(const ProConfig& pro); }; } // namespace session::config diff --git a/include/session/pro.hpp b/include/session/pro.hpp deleted file mode 100644 index 92d1b2e1..00000000 --- a/include/session/pro.hpp +++ /dev/null @@ -1,72 +0,0 @@ -#pragma once - -#include -#include - -namespace session::pro { - -struct add_payment_request { - std::uint8_t version; - array_uc32 master_pkey; - array_uc32 rotating_pkey; - array_uc32 payment_token; - array_uc32 master_sig; - array_uc32 rotating_sig; - std::string to_json() const; -}; - -struct get_proof_request { - std::uint8_t version; - array_uc32 master_pkey; - array_uc32 rotating_pkey; - std::chrono::seconds unix_ts_s; - array_uc32 master_sig; - array_uc32 rotating_sig; - std::string to_json() const; -}; - -struct master_rotating_sigs { - array_uc64 master_sig; - array_uc64 rotating_sig; -}; - -struct revocation_item { - array_uc32 gen_index_hash; - std::chrono::seconds expiry_unix_ts; -}; - -enum class Status { - Nil, // Pro proof was not set - Invalid, // Pro proof was set; signature validation failed - Valid, // Pro proof was set, is verified; has not expired - Expired, // Pro proof was set, is verified; has expired -}; - -typedef std::uint32_t FeatureFlag; -enum FeatureFlag_ { - FeatureFlag_HigherCharacterLimit = 0 << 1, - FeatureFlag_ProBadge = 1 << 1, - FeatureFlag_AnimatedAvatar = 2 << 1, - FeatureFlag_All = - FeatureFlag_HigherCharacterLimit | FeatureFlag_ProBadge | FeatureFlag_AnimatedAvatar, -}; - -struct DecryptIncomingWithPro -{ - std::vector plaintext; - std::vector ed25519_pubkey; - config::ProProof pro_proof; - Status pro_status; - FeatureFlag pro_flags; -}; - -master_rotating_sigs build_get_proof_sigs(const array_uc64& master_privkey, const array_uc64& rotating_privkey, std::chrono::seconds unix_ts); -master_rotating_sigs build_add_payment_sigs(const array_uc64& master_privkey, const array_uc64& rotating_privkey, const array_uc32& payment_token_hash, std::chrono::seconds unix_ts); - -constexpr array_uc32 BACKEND_PUBKEY = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - - -} // namespace session::pro diff --git a/include/session/pro_backend.hpp b/include/session/pro_backend.hpp new file mode 100644 index 00000000..0504f664 --- /dev/null +++ b/include/session/pro_backend.hpp @@ -0,0 +1,52 @@ +#pragma once + +#include +#include + +namespace session::pro_backend { + +constexpr array_uc32 PUBKEY = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + +struct add_payment_request { + std::uint8_t version; + array_uc32 master_pkey; + array_uc32 rotating_pkey; + array_uc32 payment_token; + array_uc32 master_sig; + array_uc32 rotating_sig; + std::string to_json() const; +}; + +struct get_proof_request { + std::uint8_t version; + array_uc32 master_pkey; + array_uc32 rotating_pkey; + std::chrono::seconds unix_ts_s; + array_uc32 master_sig; + array_uc32 rotating_sig; + std::string to_json() const; +}; + +struct master_rotating_sigs { + array_uc64 master_sig; + array_uc64 rotating_sig; +}; + +struct revocation_item { + array_uc32 gen_index_hash; + std::chrono::seconds expiry_unix_ts; +}; + +master_rotating_sigs build_get_proof_sigs( + const array_uc64& master_privkey, + const array_uc64& rotating_privkey, + std::chrono::seconds unix_ts); +master_rotating_sigs build_add_payment_sigs( + const array_uc64& master_privkey, + const array_uc64& rotating_privkey, + const array_uc32& payment_token_hash, + std::chrono::seconds unix_ts); + +} // namespace session::pro diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h new file mode 100644 index 00000000..f8872ef8 --- /dev/null +++ b/include/session/session_protocol.h @@ -0,0 +1,33 @@ +#include + +#include "export.h" + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + SESSION_PRO_10k_CHARACTER_LIMIT = 10'000, +}; + +typedef uint64_t session_pro_extra_features; +enum session_pro_extra_features_ { + session_pro_extra_nil = 0, + session_pro_extra_features_pro_badge = 0 << 1, + session_pro_extra_features_animated_avatar = 1 << 1, +}; + +typedef uint64_t session_pro_features; +enum session_pro_features_ { + session_pro_features_nil = 0, + session_pro_features_10k_character_limit = 1 << 0, + session_pro_features_pro_badge = 1 << 1, + session_pro_features_animated_avatar = 1 << 2, + session_pro_features_all = session_pro_features_10k_character_limit | + session_pro_features_pro_badge | + session_pro_features_animated_avatar, +}; + +#ifdef __cplusplus +} +#endif diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp new file mode 100644 index 00000000..5296a80f --- /dev/null +++ b/include/session/session_protocol.hpp @@ -0,0 +1,93 @@ +#pragma once + +#include +#include +#include +#include + +/// A complimentary file to session encrypt which has the low level encryption function for Session +/// protocol types. This file contains high-level helper functions for decoding payloads on the +/// Session protocol. Prefer functions here before resorting to the lower-level cryptography. +namespace session { + +namespace config::groups { + class Keys; +} + +enum class ProStatus { + Nil, // Pro proof was not set + Invalid, // Pro proof was set; signature validation failed + Valid, // Pro proof was set, is verified; has not expired + Expired, // Pro proof was set, is verified; has expired +}; + + +enum class DestinationType { + Contact, + SyncMessage, + ClosedGroup, + OpenGroup, + OpenGroupInbox, +}; + +struct Destination { + DestinationType type; + + // Signature over the plaintext with the user's Session Pro rotating public key if they have + // Session Pro and opt into sending a message with pro features. + std::optional pro_sig; + + // Set to the recipient of the message if it requires one. Ignored otherwise (for example + // ignored in OpenGroup) + array_uc32 recipient_pubkey; + + // The timestamp to assign to the message envelope if the message requires one. Ignored otherwise + std::chrono::milliseconds sent_timestamp_ms; + + // When type => OpenGroupInbox: set this pubkey to the server's key + array_uc32 open_group_inbox_server_pubkey; + + // When type => ClosedGroup: set the following 'closed_group' prefixed fields + array_uc33 closed_group_pubkey; + const session::config::groups::Keys *closed_group_keys; + + // Set to the closed group's swarm public key (needed for Android) for a non 0x03 prefixed + // `closed_group_pubkey`. Ignored otherwise. This will be set as the envelope source. See: + // https://github.com/session-foundation/session-ios/blob/82deef869d0f7389b799295817f42ad14f8a1316/SessionMessagingKit/Sending%20%26%20Receiving/MessageSender.swift#L469 + std::optional closed_group_swarm_public_key; +}; + +using ProFeatures = session_pro_features; +using ProExtraFeatures = session_pro_extra_features; + +struct DecryptIncomingWithPro +{ + std::vector plaintext; + std::vector ed25519_pubkey; + config::ProProof pro_proof; + ProStatus pro_status; + session_pro_features pro_flags; + array_uc64 pro_sig; +}; + +struct PrepareMsgForPro { + ProFeatures flags; + array_uc64 sig; +}; + +ProFeatures get_pro_features_for_msg(std::span msg, ProExtraFeatures flags); + +array_uc64 sign_msg_for_pro( + std::span msg, const array_uc64& rotating_priv_key); + +std::vector encrypt_for_namespaced_destination( + std::span plaintext, + std::span ed25519_privkey, + const Destination& dest, + config::Namespace space); + +DecryptIncomingWithPro decrypt_incoming_with_pro_metadata( + std::span ed25519_privkey, + std::span ciphertext, + std::chrono::sys_seconds unix_ts); +} // namespace session diff --git a/include/session/types.hpp b/include/session/types.hpp index a33aaaf8..4cd9022f 100644 --- a/include/session/types.hpp +++ b/include/session/types.hpp @@ -5,8 +5,18 @@ namespace session { using array_uc32 = std::array; +using array_uc33 = std::array; using array_uc64 = std::array; +enum class SessionIDPrefix { + standard = 0, + group = 0x3, + community_blinded_legacy = 0x5, + community_blinded = 0x15, + version_blinded = 0x25, + unblinded = 0x7, +}; + namespace config { using seqno_t = std::int64_t; } diff --git a/proto/SessionProtos.pb.cc b/proto/SessionProtos.pb.cc index a55151c1..b5029232 100644 --- a/proto/SessionProtos.pb.cc +++ b/proto/SessionProtos.pb.cc @@ -8,10 +8,7 @@ #include #include #include -#include -#include -#include -#include +#include // @@protoc_insertion_point(includes) #include @@ -427,7 +424,8 @@ struct GroupUpdateMemberChangeMessageDefaultTypeInternal { }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GroupUpdateMemberChangeMessageDefaultTypeInternal _GroupUpdateMemberChangeMessage_default_instance_; PROTOBUF_CONSTEXPR GroupUpdateMemberLeftMessage::GroupUpdateMemberLeftMessage( - ::_pbi::ConstantInitialized) {} + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._cached_size_)*/{}} {} struct GroupUpdateMemberLeftMessageDefaultTypeInternal { PROTOBUF_CONSTEXPR GroupUpdateMemberLeftMessageDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -438,7 +436,8 @@ struct GroupUpdateMemberLeftMessageDefaultTypeInternal { }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GroupUpdateMemberLeftMessageDefaultTypeInternal _GroupUpdateMemberLeftMessage_default_instance_; PROTOBUF_CONSTEXPR GroupUpdateMemberLeftNotificationMessage::GroupUpdateMemberLeftNotificationMessage( - ::_pbi::ConstantInitialized) {} + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._cached_size_)*/{}} {} struct GroupUpdateMemberLeftNotificationMessageDefaultTypeInternal { PROTOBUF_CONSTEXPR GroupUpdateMemberLeftNotificationMessageDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -496,21 +495,6 @@ struct ProProofDefaultTypeInternal { }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProProofDefaultTypeInternal _ProProof_default_instance_; -PROTOBUF_CONSTEXPR ProConfig::ProConfig( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_._has_bits_)*/{} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_.rotatingprivkey_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.proof_)*/nullptr} {} -struct ProConfigDefaultTypeInternal { - PROTOBUF_CONSTEXPR ProConfigDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~ProConfigDefaultTypeInternal() {} - union { - ProConfig _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProConfigDefaultTypeInternal _ProConfig_default_instance_; PROTOBUF_CONSTEXPR ProMessage::ProMessage( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_._has_bits_)*/{} @@ -527,649 +511,7 @@ struct ProMessageDefaultTypeInternal { }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProMessageDefaultTypeInternal _ProMessage_default_instance_; } // namespace SessionProtos -static ::_pb::Metadata file_level_metadata_SessionProtos_2eproto[30]; -static const ::_pb::EnumDescriptor* file_level_enum_descriptors_SessionProtos_2eproto[13]; -static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_SessionProtos_2eproto = nullptr; - -const uint32_t TableStruct_SessionProtos_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _impl_.type_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _impl_.source_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _impl_.sourcedevice_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _impl_.timestamp_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _impl_.content_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _impl_.servertimestamp_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::Envelope, _impl_.prosig_), - 6, - 0, - 5, - 3, - 1, - 4, - 2, - PROTOBUF_FIELD_OFFSET(::SessionProtos::TypingMessage, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::TypingMessage, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::TypingMessage, _impl_.timestamp_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::TypingMessage, _impl_.action_), - 0, - 1, - PROTOBUF_FIELD_OFFSET(::SessionProtos::UnsendRequest, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::UnsendRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::UnsendRequest, _impl_.timestamp_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::UnsendRequest, _impl_.author_), - 1, - 0, - PROTOBUF_FIELD_OFFSET(::SessionProtos::MessageRequestResponse, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::MessageRequestResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::MessageRequestResponse, _impl_.isapproved_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::MessageRequestResponse, _impl_.profilekey_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::MessageRequestResponse, _impl_.profile_), - 2, - 0, - 1, - PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.datamessage_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.callmessage_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.receiptmessage_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.typingmessage_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.dataextractionnotification_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.unsendrequest_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.messagerequestresponse_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.sharedconfigmessage_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.expirationtype_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.expirationtimer_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.sigtimestamp_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::Content, _impl_.promessage_), - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 9, - 10, - 11, - 8, - PROTOBUF_FIELD_OFFSET(::SessionProtos::CallMessage, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::CallMessage, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::CallMessage, _impl_.type_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::CallMessage, _impl_.sdps_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::CallMessage, _impl_.sdpmlineindexes_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::CallMessage, _impl_.sdpmids_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::CallMessage, _impl_.uuid_), - 1, - ~0u, - ~0u, - ~0u, - 0, - PROTOBUF_FIELD_OFFSET(::SessionProtos::KeyPair, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::KeyPair, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::KeyPair, _impl_.publickey_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::KeyPair, _impl_.privatekey_), - 0, - 1, - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataExtractionNotification, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataExtractionNotification, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataExtractionNotification, _impl_.type_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataExtractionNotification, _impl_.timestamp_), - 1, - 0, - PROTOBUF_FIELD_OFFSET(::SessionProtos::LokiProfile, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::LokiProfile, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::LokiProfile, _impl_.displayname_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::LokiProfile, _impl_.profilepicture_), - 0, - 1, - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote_QuotedAttachment, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote_QuotedAttachment, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote_QuotedAttachment, _impl_.contenttype_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote_QuotedAttachment, _impl_.filename_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote_QuotedAttachment, _impl_.thumbnail_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote_QuotedAttachment, _impl_.flags_), - 0, - 1, - 2, - 3, - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote, _impl_.id_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote, _impl_.author_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote, _impl_.text_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Quote, _impl_.attachments_), - 2, - 0, - 1, - ~0u, - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Preview, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Preview, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Preview, _impl_.url_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Preview, _impl_.title_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Preview, _impl_.image_), - 0, - 1, - 2, - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Reaction, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Reaction, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Reaction, _impl_.id_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Reaction, _impl_.author_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Reaction, _impl_.emoji_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_Reaction, _impl_.action_), - 2, - 0, - 1, - 3, - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_OpenGroupInvitation, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_OpenGroupInvitation, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_OpenGroupInvitation, _impl_.url_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage_OpenGroupInvitation, _impl_.name_), - 0, - 1, - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.body_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.attachments_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.flags_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.profilekey_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.timestamp_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.quote_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.preview_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.reaction_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.profile_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.opengroupinvitation_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.synctarget_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.blockscommunitymessagerequests_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::DataMessage, _impl_.groupupdatemessage_), - 0, - ~0u, - 9, - 1, - 8, - 3, - ~0u, - 4, - 5, - 6, - 2, - 10, - 7, - PROTOBUF_FIELD_OFFSET(::SessionProtos::ReceiptMessage, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::ReceiptMessage, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::ReceiptMessage, _impl_.type_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::ReceiptMessage, _impl_.timestamp_), - 0, - ~0u, - PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.id_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.contenttype_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.key_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.size_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.thumbnail_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.digest_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.filename_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.flags_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.width_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.height_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.caption_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::AttachmentPointer, _impl_.url_), - 7, - 0, - 1, - 8, - 2, - 3, - 4, - 9, - 10, - 11, - 5, - 6, - PROTOBUF_FIELD_OFFSET(::SessionProtos::SharedConfigMessage, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::SharedConfigMessage, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::SharedConfigMessage, _impl_.kind_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::SharedConfigMessage, _impl_.seqno_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::SharedConfigMessage, _impl_.data_), - 2, - 1, - 0, - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _impl_.invitemessage_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _impl_.infochangemessage_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _impl_.memberchangemessage_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _impl_.promotemessage_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _impl_.memberleftmessage_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _impl_.inviteresponse_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _impl_.deletemembercontent_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMessage, _impl_.memberleftnotificationmessage_), - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInviteMessage, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInviteMessage, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInviteMessage, _impl_.groupsessionid_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInviteMessage, _impl_.name_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInviteMessage, _impl_.memberauthdata_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInviteMessage, _impl_.adminsignature_), - 0, - 1, - 2, - 3, - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdatePromoteMessage, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdatePromoteMessage, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdatePromoteMessage, _impl_.groupidentityseed_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdatePromoteMessage, _impl_.name_), - 0, - 1, - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInfoChangeMessage, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInfoChangeMessage, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInfoChangeMessage, _impl_.type_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInfoChangeMessage, _impl_.updatedname_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInfoChangeMessage, _impl_.updatedexpiration_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInfoChangeMessage, _impl_.adminsignature_), - 3, - 0, - 2, - 1, - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMemberChangeMessage, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMemberChangeMessage, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMemberChangeMessage, _impl_.type_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMemberChangeMessage, _impl_.membersessionids_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMemberChangeMessage, _impl_.historyshared_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMemberChangeMessage, _impl_.adminsignature_), - 2, - ~0u, - 1, - 0, - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMemberLeftMessage, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateMemberLeftNotificationMessage, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInviteResponseMessage, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInviteResponseMessage, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateInviteResponseMessage, _impl_.isapproved_), - 0, - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateDeleteMemberContentMessage, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateDeleteMemberContentMessage, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateDeleteMemberContentMessage, _impl_.membersessionids_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateDeleteMemberContentMessage, _impl_.messagehashes_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::GroupUpdateDeleteMemberContentMessage, _impl_.adminsignature_), - ~0u, - ~0u, - 0, - PROTOBUF_FIELD_OFFSET(::SessionProtos::ProProof, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::ProProof, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::ProProof, _impl_.version_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::ProProof, _impl_.genindexhash_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::ProProof, _impl_.rotatingpublickey_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::ProProof, _impl_.expiryunixts_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::ProProof, _impl_.sig_), - 4, - 0, - 1, - 3, - 2, - PROTOBUF_FIELD_OFFSET(::SessionProtos::ProConfig, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::ProConfig, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::ProConfig, _impl_.rotatingprivkey_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::ProConfig, _impl_.proof_), - 0, - 1, - PROTOBUF_FIELD_OFFSET(::SessionProtos::ProMessage, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::ProMessage, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::SessionProtos::ProMessage, _impl_.proof_), - PROTOBUF_FIELD_OFFSET(::SessionProtos::ProMessage, _impl_.flags_), - 0, - 1, -}; -static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, 13, -1, sizeof(::SessionProtos::Envelope)}, - { 20, 28, -1, sizeof(::SessionProtos::TypingMessage)}, - { 30, 38, -1, sizeof(::SessionProtos::UnsendRequest)}, - { 40, 49, -1, sizeof(::SessionProtos::MessageRequestResponse)}, - { 52, 70, -1, sizeof(::SessionProtos::Content)}, - { 82, 93, -1, sizeof(::SessionProtos::CallMessage)}, - { 98, 106, -1, sizeof(::SessionProtos::KeyPair)}, - { 108, 116, -1, sizeof(::SessionProtos::DataExtractionNotification)}, - { 118, 126, -1, sizeof(::SessionProtos::LokiProfile)}, - { 128, 138, -1, sizeof(::SessionProtos::DataMessage_Quote_QuotedAttachment)}, - { 142, 152, -1, sizeof(::SessionProtos::DataMessage_Quote)}, - { 156, 165, -1, sizeof(::SessionProtos::DataMessage_Preview)}, - { 168, 178, -1, sizeof(::SessionProtos::DataMessage_Reaction)}, - { 182, 190, -1, sizeof(::SessionProtos::DataMessage_OpenGroupInvitation)}, - { 192, 211, -1, sizeof(::SessionProtos::DataMessage)}, - { 224, 232, -1, sizeof(::SessionProtos::ReceiptMessage)}, - { 234, 252, -1, sizeof(::SessionProtos::AttachmentPointer)}, - { 264, 273, -1, sizeof(::SessionProtos::SharedConfigMessage)}, - { 276, 290, -1, sizeof(::SessionProtos::GroupUpdateMessage)}, - { 298, 308, -1, sizeof(::SessionProtos::GroupUpdateInviteMessage)}, - { 312, 320, -1, sizeof(::SessionProtos::GroupUpdatePromoteMessage)}, - { 322, 332, -1, sizeof(::SessionProtos::GroupUpdateInfoChangeMessage)}, - { 336, 346, -1, sizeof(::SessionProtos::GroupUpdateMemberChangeMessage)}, - { 350, -1, -1, sizeof(::SessionProtos::GroupUpdateMemberLeftMessage)}, - { 356, -1, -1, sizeof(::SessionProtos::GroupUpdateMemberLeftNotificationMessage)}, - { 362, 369, -1, sizeof(::SessionProtos::GroupUpdateInviteResponseMessage)}, - { 370, 379, -1, sizeof(::SessionProtos::GroupUpdateDeleteMemberContentMessage)}, - { 382, 393, -1, sizeof(::SessionProtos::ProProof)}, - { 398, 406, -1, sizeof(::SessionProtos::ProConfig)}, - { 408, 416, -1, sizeof(::SessionProtos::ProMessage)}, -}; - -static const ::_pb::Message* const file_default_instances[] = { - &::SessionProtos::_Envelope_default_instance_._instance, - &::SessionProtos::_TypingMessage_default_instance_._instance, - &::SessionProtos::_UnsendRequest_default_instance_._instance, - &::SessionProtos::_MessageRequestResponse_default_instance_._instance, - &::SessionProtos::_Content_default_instance_._instance, - &::SessionProtos::_CallMessage_default_instance_._instance, - &::SessionProtos::_KeyPair_default_instance_._instance, - &::SessionProtos::_DataExtractionNotification_default_instance_._instance, - &::SessionProtos::_LokiProfile_default_instance_._instance, - &::SessionProtos::_DataMessage_Quote_QuotedAttachment_default_instance_._instance, - &::SessionProtos::_DataMessage_Quote_default_instance_._instance, - &::SessionProtos::_DataMessage_Preview_default_instance_._instance, - &::SessionProtos::_DataMessage_Reaction_default_instance_._instance, - &::SessionProtos::_DataMessage_OpenGroupInvitation_default_instance_._instance, - &::SessionProtos::_DataMessage_default_instance_._instance, - &::SessionProtos::_ReceiptMessage_default_instance_._instance, - &::SessionProtos::_AttachmentPointer_default_instance_._instance, - &::SessionProtos::_SharedConfigMessage_default_instance_._instance, - &::SessionProtos::_GroupUpdateMessage_default_instance_._instance, - &::SessionProtos::_GroupUpdateInviteMessage_default_instance_._instance, - &::SessionProtos::_GroupUpdatePromoteMessage_default_instance_._instance, - &::SessionProtos::_GroupUpdateInfoChangeMessage_default_instance_._instance, - &::SessionProtos::_GroupUpdateMemberChangeMessage_default_instance_._instance, - &::SessionProtos::_GroupUpdateMemberLeftMessage_default_instance_._instance, - &::SessionProtos::_GroupUpdateMemberLeftNotificationMessage_default_instance_._instance, - &::SessionProtos::_GroupUpdateInviteResponseMessage_default_instance_._instance, - &::SessionProtos::_GroupUpdateDeleteMemberContentMessage_default_instance_._instance, - &::SessionProtos::_ProProof_default_instance_._instance, - &::SessionProtos::_ProConfig_default_instance_._instance, - &::SessionProtos::_ProMessage_default_instance_._instance, -}; - -const char descriptor_table_protodef_SessionProtos_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\023SessionProtos.proto\022\rSessionProtos\"\340\001\n" - "\010Envelope\022*\n\004type\030\001 \002(\0162\034.SessionProtos." - "Envelope.Type\022\016\n\006source\030\002 \001(\t\022\024\n\014sourceD" - "evice\030\007 \001(\r\022\021\n\ttimestamp\030\005 \002(\004\022\017\n\007conten" - "t\030\010 \001(\014\022\027\n\017serverTimestamp\030\n \001(\004\022\016\n\006proS" - "ig\030\013 \001(\014\"5\n\004Type\022\023\n\017SESSION_MESSAGE\020\006\022\030\n" - "\024CLOSED_GROUP_MESSAGE\020\007\"{\n\rTypingMessage" - "\022\021\n\ttimestamp\030\001 \002(\004\0223\n\006action\030\002 \002(\0162#.Se" - "ssionProtos.TypingMessage.Action\"\"\n\006Acti" - "on\022\013\n\007STARTED\020\000\022\013\n\007STOPPED\020\001\"2\n\rUnsendRe" - "quest\022\021\n\ttimestamp\030\001 \002(\004\022\016\n\006author\030\002 \002(\t" - "\"m\n\026MessageRequestResponse\022\022\n\nisApproved" - "\030\001 \002(\010\022\022\n\nprofileKey\030\002 \001(\014\022+\n\007profile\030\003 " - "\001(\0132\032.SessionProtos.LokiProfile\"\315\005\n\007Cont" - "ent\022/\n\013dataMessage\030\001 \001(\0132\032.SessionProtos" - ".DataMessage\022/\n\013callMessage\030\003 \001(\0132\032.Sess" - "ionProtos.CallMessage\0225\n\016receiptMessage\030" - "\005 \001(\0132\035.SessionProtos.ReceiptMessage\0223\n\r" - "typingMessage\030\006 \001(\0132\034.SessionProtos.Typi" - "ngMessage\022M\n\032dataExtractionNotification\030" - "\010 \001(\0132).SessionProtos.DataExtractionNoti" - "fication\0223\n\runsendRequest\030\t \001(\0132\034.Sessio" - "nProtos.UnsendRequest\022E\n\026messageRequestR" - "esponse\030\n \001(\0132%.SessionProtos.MessageReq" - "uestResponse\022\?\n\023sharedConfigMessage\030\013 \001(" - "\0132\".SessionProtos.SharedConfigMessage\022=\n" - "\016expirationType\030\014 \001(\0162%.SessionProtos.Co" - "ntent.ExpirationType\022\027\n\017expirationTimer\030" - "\r \001(\r\022\024\n\014sigTimestamp\030\017 \001(\004\022-\n\nproMessag" - "e\030\020 \001(\0132\031.SessionProtos.ProMessage\"K\n\016Ex" - "pirationType\022\013\n\007UNKNOWN\020\000\022\025\n\021DELETE_AFTE" - "R_READ\020\001\022\025\n\021DELETE_AFTER_SEND\020\002\"\352\001\n\013Call" - "Message\022-\n\004type\030\001 \002(\0162\037.SessionProtos.Ca" - "llMessage.Type\022\014\n\004sdps\030\002 \003(\t\022\027\n\017sdpMLine" - "Indexes\030\003 \003(\r\022\017\n\007sdpMids\030\004 \003(\t\022\014\n\004uuid\030\005" - " \002(\t\"f\n\004Type\022\r\n\tPRE_OFFER\020\006\022\t\n\005OFFER\020\001\022\n" - "\n\006ANSWER\020\002\022\026\n\022PROVISIONAL_ANSWER\020\003\022\022\n\016IC" - "E_CANDIDATES\020\004\022\014\n\010END_CALL\020\005\"0\n\007KeyPair\022" - "\021\n\tpublicKey\030\001 \002(\014\022\022\n\nprivateKey\030\002 \002(\014\"\226" - "\001\n\032DataExtractionNotification\022<\n\004type\030\001 " - "\002(\0162..SessionProtos.DataExtractionNotifi" - "cation.Type\022\021\n\ttimestamp\030\002 \001(\004\"\'\n\004Type\022\016" - "\n\nSCREENSHOT\020\001\022\017\n\013MEDIA_SAVED\020\002\":\n\013LokiP" - "rofile\022\023\n\013displayName\030\001 \001(\t\022\026\n\016profilePi" - "cture\030\002 \001(\t\"\367\010\n\013DataMessage\022\014\n\004body\030\001 \001(" - "\t\0225\n\013attachments\030\002 \003(\0132 .SessionProtos.A" - "ttachmentPointer\022\r\n\005flags\030\004 \001(\r\022\022\n\nprofi" - "leKey\030\006 \001(\014\022\021\n\ttimestamp\030\007 \001(\004\022/\n\005quote\030" - "\010 \001(\0132 .SessionProtos.DataMessage.Quote\022" - "3\n\007preview\030\n \003(\0132\".SessionProtos.DataMes" - "sage.Preview\0225\n\010reaction\030\013 \001(\0132#.Session" - "Protos.DataMessage.Reaction\022+\n\007profile\030e" - " \001(\0132\032.SessionProtos.LokiProfile\022K\n\023open" - "GroupInvitation\030f \001(\0132..SessionProtos.Da" - "taMessage.OpenGroupInvitation\022\022\n\nsyncTar" - "get\030i \001(\t\022&\n\036blocksCommunityMessageReque" - "sts\030j \001(\010\022=\n\022groupUpdateMessage\030x \001(\0132!." - "SessionProtos.GroupUpdateMessage\032\225\002\n\005Quo" - "te\022\n\n\002id\030\001 \002(\004\022\016\n\006author\030\002 \002(\t\022\014\n\004text\030\003" - " \001(\t\022F\n\013attachments\030\004 \003(\01321.SessionProto" - "s.DataMessage.Quote.QuotedAttachment\032\231\001\n" - "\020QuotedAttachment\022\023\n\013contentType\030\001 \001(\t\022\020" - "\n\010fileName\030\002 \001(\t\0223\n\tthumbnail\030\003 \001(\0132 .Se" - "ssionProtos.AttachmentPointer\022\r\n\005flags\030\004" - " \001(\r\"\032\n\005Flags\022\021\n\rVOICE_MESSAGE\020\001\032V\n\007Prev" - "iew\022\013\n\003url\030\001 \002(\t\022\r\n\005title\030\002 \001(\t\022/\n\005image" - "\030\003 \001(\0132 .SessionProtos.AttachmentPointer" - "\032\222\001\n\010Reaction\022\n\n\002id\030\001 \002(\004\022\016\n\006author\030\002 \002(" - "\t\022\r\n\005emoji\030\003 \001(\t\022:\n\006action\030\004 \002(\0162*.Sessi" - "onProtos.DataMessage.Reaction.Action\"\037\n\006" - "Action\022\t\n\005REACT\020\000\022\n\n\006REMOVE\020\001\0320\n\023OpenGro" - "upInvitation\022\013\n\003url\030\001 \002(\t\022\014\n\004name\030\003 \002(\t\"" - "$\n\005Flags\022\033\n\027EXPIRATION_TIMER_UPDATE\020\002\"u\n" - "\016ReceiptMessage\0220\n\004type\030\001 \002(\0162\".SessionP" - "rotos.ReceiptMessage.Type\022\021\n\ttimestamp\030\002" - " \003(\004\"\036\n\004Type\022\014\n\010DELIVERY\020\000\022\010\n\004READ\020\001\"\354\001\n" - "\021AttachmentPointer\022\n\n\002id\030\001 \002(\006\022\023\n\013conten" - "tType\030\002 \001(\t\022\013\n\003key\030\003 \001(\014\022\014\n\004size\030\004 \001(\r\022\021" - "\n\tthumbnail\030\005 \001(\014\022\016\n\006digest\030\006 \001(\014\022\020\n\010fil" - "eName\030\007 \001(\t\022\r\n\005flags\030\010 \001(\r\022\r\n\005width\030\t \001(" - "\r\022\016\n\006height\030\n \001(\r\022\017\n\007caption\030\013 \001(\t\022\013\n\003ur" - "l\030e \001(\t\"\032\n\005Flags\022\021\n\rVOICE_MESSAGE\020\001\"\273\001\n\023" - "SharedConfigMessage\0225\n\004kind\030\001 \002(\0162\'.Sess" - "ionProtos.SharedConfigMessage.Kind\022\r\n\005se" - "qno\030\002 \002(\003\022\014\n\004data\030\003 \002(\014\"P\n\004Kind\022\020\n\014USER_" - "PROFILE\020\001\022\014\n\010CONTACTS\020\002\022\027\n\023CONVO_INFO_VO" - "LATILE\020\003\022\017\n\013USER_GROUPS\020\004\"\356\004\n\022GroupUpdat" - "eMessage\022>\n\rinviteMessage\030\001 \001(\0132\'.Sessio" - "nProtos.GroupUpdateInviteMessage\022F\n\021info" - "ChangeMessage\030\002 \001(\0132+.SessionProtos.Grou" - "pUpdateInfoChangeMessage\022J\n\023memberChange" - "Message\030\003 \001(\0132-.SessionProtos.GroupUpdat" - "eMemberChangeMessage\022@\n\016promoteMessage\030\004" - " \001(\0132(.SessionProtos.GroupUpdatePromoteM" - "essage\022F\n\021memberLeftMessage\030\005 \001(\0132+.Sess" - "ionProtos.GroupUpdateMemberLeftMessage\022G" - "\n\016inviteResponse\030\006 \001(\0132/.SessionProtos.G" - "roupUpdateInviteResponseMessage\022Q\n\023delet" - "eMemberContent\030\007 \001(\01324.SessionProtos.Gro" - "upUpdateDeleteMemberContentMessage\022^\n\035me" - "mberLeftNotificationMessage\030\010 \001(\01327.Sess" - "ionProtos.GroupUpdateMemberLeftNotificat" - "ionMessage\"p\n\030GroupUpdateInviteMessage\022\026" - "\n\016groupSessionId\030\001 \002(\t\022\014\n\004name\030\002 \002(\t\022\026\n\016" - "memberAuthData\030\003 \002(\014\022\026\n\016adminSignature\030\004" - " \002(\014\"D\n\031GroupUpdatePromoteMessage\022\031\n\021gro" - "upIdentitySeed\030\001 \002(\014\022\014\n\004name\030\002 \002(\t\"\337\001\n\034G" - "roupUpdateInfoChangeMessage\022>\n\004type\030\001 \002(" - "\01620.SessionProtos.GroupUpdateInfoChangeM" - "essage.Type\022\023\n\013updatedName\030\002 \001(\t\022\031\n\021upda" - "tedExpiration\030\003 \001(\r\022\026\n\016adminSignature\030\004 " - "\002(\014\"7\n\004Type\022\010\n\004NAME\020\001\022\n\n\006AVATAR\020\002\022\031\n\025DIS" - "APPEARING_MESSAGES\020\003\"\331\001\n\036GroupUpdateMemb" - "erChangeMessage\022@\n\004type\030\001 \002(\01622.SessionP" - "rotos.GroupUpdateMemberChangeMessage.Typ" - "e\022\030\n\020memberSessionIds\030\002 \003(\t\022\025\n\rhistorySh" - "ared\030\003 \001(\010\022\026\n\016adminSignature\030\004 \002(\014\",\n\004Ty" - "pe\022\t\n\005ADDED\020\001\022\013\n\007REMOVED\020\002\022\014\n\010PROMOTED\020\003" - "\"\036\n\034GroupUpdateMemberLeftMessage\"*\n(Grou" - "pUpdateMemberLeftNotificationMessage\"6\n " - "GroupUpdateInviteResponseMessage\022\022\n\nisAp" - "proved\030\001 \002(\010\"p\n%GroupUpdateDeleteMemberC" - "ontentMessage\022\030\n\020memberSessionIds\030\001 \003(\t\022" - "\025\n\rmessageHashes\030\002 \003(\t\022\026\n\016adminSignature" - "\030\003 \001(\014\"o\n\010ProProof\022\017\n\007version\030\001 \002(\r\022\024\n\014g" - "enIndexHash\030\002 \002(\014\022\031\n\021rotatingPublicKey\030\003" - " \002(\014\022\024\n\014expiryUnixTs\030\004 \002(\004\022\013\n\003sig\030\005 \002(\014\"" - "L\n\tProConfig\022\027\n\017rotatingPrivKey\030\001 \002(\014\022&\n" - "\005proof\030\002 \002(\0132\027.SessionProtos.ProProof\"C\n" - "\nProMessage\022&\n\005proof\030\001 \002(\0132\027.SessionProt" - "os.ProProof\022\r\n\005flags\030\002 \002(\r" - ; -static ::_pbi::once_flag descriptor_table_SessionProtos_2eproto_once; -const ::_pbi::DescriptorTable descriptor_table_SessionProtos_2eproto = { - false, false, 5226, descriptor_table_protodef_SessionProtos_2eproto, - "SessionProtos.proto", - &descriptor_table_SessionProtos_2eproto_once, nullptr, 0, 30, - schemas, file_default_instances, TableStruct_SessionProtos_2eproto::offsets, - file_level_metadata_SessionProtos_2eproto, file_level_enum_descriptors_SessionProtos_2eproto, - file_level_service_descriptors_SessionProtos_2eproto, -}; -PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_SessionProtos_2eproto_getter() { - return &descriptor_table_SessionProtos_2eproto; -} - -// Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_SessionProtos_2eproto(&descriptor_table_SessionProtos_2eproto); namespace SessionProtos { -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Envelope_Type_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); - return file_level_enum_descriptors_SessionProtos_2eproto[0]; -} bool Envelope_Type_IsValid(int value) { switch (value) { case 6: @@ -1180,6 +522,47 @@ bool Envelope_Type_IsValid(int value) { } } +static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed Envelope_Type_strings[2] = {}; + +static const char Envelope_Type_names[] = + "CLOSED_GROUP_MESSAGE" + "SESSION_MESSAGE"; + +static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry Envelope_Type_entries[] = { + { {Envelope_Type_names + 0, 20}, 7 }, + { {Envelope_Type_names + 20, 15}, 6 }, +}; + +static const int Envelope_Type_entries_by_number[] = { + 1, // 6 -> SESSION_MESSAGE + 0, // 7 -> CLOSED_GROUP_MESSAGE +}; + +const std::string& Envelope_Type_Name( + Envelope_Type value) { + static const bool dummy = + ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( + Envelope_Type_entries, + Envelope_Type_entries_by_number, + 2, Envelope_Type_strings); + (void) dummy; + int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( + Envelope_Type_entries, + Envelope_Type_entries_by_number, + 2, value); + return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : + Envelope_Type_strings[idx].get(); +} +bool Envelope_Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Envelope_Type* value) { + int int_value; + bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( + Envelope_Type_entries, 2, name, &int_value); + if (success) { + *value = static_cast(int_value); + } + return success; +} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr Envelope_Type Envelope::SESSION_MESSAGE; constexpr Envelope_Type Envelope::CLOSED_GROUP_MESSAGE; @@ -1187,10 +570,6 @@ constexpr Envelope_Type Envelope::Type_MIN; constexpr Envelope_Type Envelope::Type_MAX; constexpr int Envelope::Type_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* TypingMessage_Action_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); - return file_level_enum_descriptors_SessionProtos_2eproto[1]; -} bool TypingMessage_Action_IsValid(int value) { switch (value) { case 0: @@ -1201,6 +580,47 @@ bool TypingMessage_Action_IsValid(int value) { } } +static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed TypingMessage_Action_strings[2] = {}; + +static const char TypingMessage_Action_names[] = + "STARTED" + "STOPPED"; + +static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry TypingMessage_Action_entries[] = { + { {TypingMessage_Action_names + 0, 7}, 0 }, + { {TypingMessage_Action_names + 7, 7}, 1 }, +}; + +static const int TypingMessage_Action_entries_by_number[] = { + 0, // 0 -> STARTED + 1, // 1 -> STOPPED +}; + +const std::string& TypingMessage_Action_Name( + TypingMessage_Action value) { + static const bool dummy = + ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( + TypingMessage_Action_entries, + TypingMessage_Action_entries_by_number, + 2, TypingMessage_Action_strings); + (void) dummy; + int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( + TypingMessage_Action_entries, + TypingMessage_Action_entries_by_number, + 2, value); + return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : + TypingMessage_Action_strings[idx].get(); +} +bool TypingMessage_Action_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, TypingMessage_Action* value) { + int int_value; + bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( + TypingMessage_Action_entries, 2, name, &int_value); + if (success) { + *value = static_cast(int_value); + } + return success; +} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr TypingMessage_Action TypingMessage::STARTED; constexpr TypingMessage_Action TypingMessage::STOPPED; @@ -1208,10 +628,6 @@ constexpr TypingMessage_Action TypingMessage::Action_MIN; constexpr TypingMessage_Action TypingMessage::Action_MAX; constexpr int TypingMessage::Action_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Content_ExpirationType_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); - return file_level_enum_descriptors_SessionProtos_2eproto[2]; -} bool Content_ExpirationType_IsValid(int value) { switch (value) { case 0: @@ -1223,6 +639,50 @@ bool Content_ExpirationType_IsValid(int value) { } } +static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed Content_ExpirationType_strings[3] = {}; + +static const char Content_ExpirationType_names[] = + "DELETE_AFTER_READ" + "DELETE_AFTER_SEND" + "UNKNOWN"; + +static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry Content_ExpirationType_entries[] = { + { {Content_ExpirationType_names + 0, 17}, 1 }, + { {Content_ExpirationType_names + 17, 17}, 2 }, + { {Content_ExpirationType_names + 34, 7}, 0 }, +}; + +static const int Content_ExpirationType_entries_by_number[] = { + 2, // 0 -> UNKNOWN + 0, // 1 -> DELETE_AFTER_READ + 1, // 2 -> DELETE_AFTER_SEND +}; + +const std::string& Content_ExpirationType_Name( + Content_ExpirationType value) { + static const bool dummy = + ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( + Content_ExpirationType_entries, + Content_ExpirationType_entries_by_number, + 3, Content_ExpirationType_strings); + (void) dummy; + int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( + Content_ExpirationType_entries, + Content_ExpirationType_entries_by_number, + 3, value); + return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : + Content_ExpirationType_strings[idx].get(); +} +bool Content_ExpirationType_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Content_ExpirationType* value) { + int int_value; + bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( + Content_ExpirationType_entries, 3, name, &int_value); + if (success) { + *value = static_cast(int_value); + } + return success; +} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr Content_ExpirationType Content::UNKNOWN; constexpr Content_ExpirationType Content::DELETE_AFTER_READ; @@ -1231,10 +691,6 @@ constexpr Content_ExpirationType Content::ExpirationType_MIN; constexpr Content_ExpirationType Content::ExpirationType_MAX; constexpr int Content::ExpirationType_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* CallMessage_Type_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); - return file_level_enum_descriptors_SessionProtos_2eproto[3]; -} bool CallMessage_Type_IsValid(int value) { switch (value) { case 1: @@ -1249,6 +705,59 @@ bool CallMessage_Type_IsValid(int value) { } } +static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed CallMessage_Type_strings[6] = {}; + +static const char CallMessage_Type_names[] = + "ANSWER" + "END_CALL" + "ICE_CANDIDATES" + "OFFER" + "PRE_OFFER" + "PROVISIONAL_ANSWER"; + +static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry CallMessage_Type_entries[] = { + { {CallMessage_Type_names + 0, 6}, 2 }, + { {CallMessage_Type_names + 6, 8}, 5 }, + { {CallMessage_Type_names + 14, 14}, 4 }, + { {CallMessage_Type_names + 28, 5}, 1 }, + { {CallMessage_Type_names + 33, 9}, 6 }, + { {CallMessage_Type_names + 42, 18}, 3 }, +}; + +static const int CallMessage_Type_entries_by_number[] = { + 3, // 1 -> OFFER + 0, // 2 -> ANSWER + 5, // 3 -> PROVISIONAL_ANSWER + 2, // 4 -> ICE_CANDIDATES + 1, // 5 -> END_CALL + 4, // 6 -> PRE_OFFER +}; + +const std::string& CallMessage_Type_Name( + CallMessage_Type value) { + static const bool dummy = + ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( + CallMessage_Type_entries, + CallMessage_Type_entries_by_number, + 6, CallMessage_Type_strings); + (void) dummy; + int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( + CallMessage_Type_entries, + CallMessage_Type_entries_by_number, + 6, value); + return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : + CallMessage_Type_strings[idx].get(); +} +bool CallMessage_Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, CallMessage_Type* value) { + int int_value; + bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( + CallMessage_Type_entries, 6, name, &int_value); + if (success) { + *value = static_cast(int_value); + } + return success; +} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr CallMessage_Type CallMessage::PRE_OFFER; constexpr CallMessage_Type CallMessage::OFFER; @@ -1260,10 +769,6 @@ constexpr CallMessage_Type CallMessage::Type_MIN; constexpr CallMessage_Type CallMessage::Type_MAX; constexpr int CallMessage::Type_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataExtractionNotification_Type_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); - return file_level_enum_descriptors_SessionProtos_2eproto[4]; -} bool DataExtractionNotification_Type_IsValid(int value) { switch (value) { case 1: @@ -1274,6 +779,47 @@ bool DataExtractionNotification_Type_IsValid(int value) { } } +static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed DataExtractionNotification_Type_strings[2] = {}; + +static const char DataExtractionNotification_Type_names[] = + "MEDIA_SAVED" + "SCREENSHOT"; + +static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry DataExtractionNotification_Type_entries[] = { + { {DataExtractionNotification_Type_names + 0, 11}, 2 }, + { {DataExtractionNotification_Type_names + 11, 10}, 1 }, +}; + +static const int DataExtractionNotification_Type_entries_by_number[] = { + 1, // 1 -> SCREENSHOT + 0, // 2 -> MEDIA_SAVED +}; + +const std::string& DataExtractionNotification_Type_Name( + DataExtractionNotification_Type value) { + static const bool dummy = + ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( + DataExtractionNotification_Type_entries, + DataExtractionNotification_Type_entries_by_number, + 2, DataExtractionNotification_Type_strings); + (void) dummy; + int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( + DataExtractionNotification_Type_entries, + DataExtractionNotification_Type_entries_by_number, + 2, value); + return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : + DataExtractionNotification_Type_strings[idx].get(); +} +bool DataExtractionNotification_Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataExtractionNotification_Type* value) { + int int_value; + bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( + DataExtractionNotification_Type_entries, 2, name, &int_value); + if (success) { + *value = static_cast(int_value); + } + return success; +} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr DataExtractionNotification_Type DataExtractionNotification::SCREENSHOT; constexpr DataExtractionNotification_Type DataExtractionNotification::MEDIA_SAVED; @@ -1281,10 +827,6 @@ constexpr DataExtractionNotification_Type DataExtractionNotification::Type_MIN; constexpr DataExtractionNotification_Type DataExtractionNotification::Type_MAX; constexpr int DataExtractionNotification::Type_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataMessage_Quote_QuotedAttachment_Flags_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); - return file_level_enum_descriptors_SessionProtos_2eproto[5]; -} bool DataMessage_Quote_QuotedAttachment_Flags_IsValid(int value) { switch (value) { case 1: @@ -1294,16 +836,50 @@ bool DataMessage_Quote_QuotedAttachment_Flags_IsValid(int value) { } } +static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed DataMessage_Quote_QuotedAttachment_Flags_strings[1] = {}; + +static const char DataMessage_Quote_QuotedAttachment_Flags_names[] = + "VOICE_MESSAGE"; + +static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry DataMessage_Quote_QuotedAttachment_Flags_entries[] = { + { {DataMessage_Quote_QuotedAttachment_Flags_names + 0, 13}, 1 }, +}; + +static const int DataMessage_Quote_QuotedAttachment_Flags_entries_by_number[] = { + 0, // 1 -> VOICE_MESSAGE +}; + +const std::string& DataMessage_Quote_QuotedAttachment_Flags_Name( + DataMessage_Quote_QuotedAttachment_Flags value) { + static const bool dummy = + ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( + DataMessage_Quote_QuotedAttachment_Flags_entries, + DataMessage_Quote_QuotedAttachment_Flags_entries_by_number, + 1, DataMessage_Quote_QuotedAttachment_Flags_strings); + (void) dummy; + int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( + DataMessage_Quote_QuotedAttachment_Flags_entries, + DataMessage_Quote_QuotedAttachment_Flags_entries_by_number, + 1, value); + return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : + DataMessage_Quote_QuotedAttachment_Flags_strings[idx].get(); +} +bool DataMessage_Quote_QuotedAttachment_Flags_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_Quote_QuotedAttachment_Flags* value) { + int int_value; + bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( + DataMessage_Quote_QuotedAttachment_Flags_entries, 1, name, &int_value); + if (success) { + *value = static_cast(int_value); + } + return success; +} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr DataMessage_Quote_QuotedAttachment_Flags DataMessage_Quote_QuotedAttachment::VOICE_MESSAGE; constexpr DataMessage_Quote_QuotedAttachment_Flags DataMessage_Quote_QuotedAttachment::Flags_MIN; constexpr DataMessage_Quote_QuotedAttachment_Flags DataMessage_Quote_QuotedAttachment::Flags_MAX; constexpr int DataMessage_Quote_QuotedAttachment::Flags_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataMessage_Reaction_Action_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); - return file_level_enum_descriptors_SessionProtos_2eproto[6]; -} bool DataMessage_Reaction_Action_IsValid(int value) { switch (value) { case 0: @@ -1314,6 +890,47 @@ bool DataMessage_Reaction_Action_IsValid(int value) { } } +static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed DataMessage_Reaction_Action_strings[2] = {}; + +static const char DataMessage_Reaction_Action_names[] = + "REACT" + "REMOVE"; + +static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry DataMessage_Reaction_Action_entries[] = { + { {DataMessage_Reaction_Action_names + 0, 5}, 0 }, + { {DataMessage_Reaction_Action_names + 5, 6}, 1 }, +}; + +static const int DataMessage_Reaction_Action_entries_by_number[] = { + 0, // 0 -> REACT + 1, // 1 -> REMOVE +}; + +const std::string& DataMessage_Reaction_Action_Name( + DataMessage_Reaction_Action value) { + static const bool dummy = + ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( + DataMessage_Reaction_Action_entries, + DataMessage_Reaction_Action_entries_by_number, + 2, DataMessage_Reaction_Action_strings); + (void) dummy; + int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( + DataMessage_Reaction_Action_entries, + DataMessage_Reaction_Action_entries_by_number, + 2, value); + return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : + DataMessage_Reaction_Action_strings[idx].get(); +} +bool DataMessage_Reaction_Action_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_Reaction_Action* value) { + int int_value; + bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( + DataMessage_Reaction_Action_entries, 2, name, &int_value); + if (success) { + *value = static_cast(int_value); + } + return success; +} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr DataMessage_Reaction_Action DataMessage_Reaction::REACT; constexpr DataMessage_Reaction_Action DataMessage_Reaction::REMOVE; @@ -1321,10 +938,6 @@ constexpr DataMessage_Reaction_Action DataMessage_Reaction::Action_MIN; constexpr DataMessage_Reaction_Action DataMessage_Reaction::Action_MAX; constexpr int DataMessage_Reaction::Action_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataMessage_Flags_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); - return file_level_enum_descriptors_SessionProtos_2eproto[7]; -} bool DataMessage_Flags_IsValid(int value) { switch (value) { case 2: @@ -1334,16 +947,50 @@ bool DataMessage_Flags_IsValid(int value) { } } +static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed DataMessage_Flags_strings[1] = {}; + +static const char DataMessage_Flags_names[] = + "EXPIRATION_TIMER_UPDATE"; + +static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry DataMessage_Flags_entries[] = { + { {DataMessage_Flags_names + 0, 23}, 2 }, +}; + +static const int DataMessage_Flags_entries_by_number[] = { + 0, // 2 -> EXPIRATION_TIMER_UPDATE +}; + +const std::string& DataMessage_Flags_Name( + DataMessage_Flags value) { + static const bool dummy = + ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( + DataMessage_Flags_entries, + DataMessage_Flags_entries_by_number, + 1, DataMessage_Flags_strings); + (void) dummy; + int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( + DataMessage_Flags_entries, + DataMessage_Flags_entries_by_number, + 1, value); + return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : + DataMessage_Flags_strings[idx].get(); +} +bool DataMessage_Flags_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_Flags* value) { + int int_value; + bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( + DataMessage_Flags_entries, 1, name, &int_value); + if (success) { + *value = static_cast(int_value); + } + return success; +} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr DataMessage_Flags DataMessage::EXPIRATION_TIMER_UPDATE; constexpr DataMessage_Flags DataMessage::Flags_MIN; constexpr DataMessage_Flags DataMessage::Flags_MAX; constexpr int DataMessage::Flags_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ReceiptMessage_Type_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); - return file_level_enum_descriptors_SessionProtos_2eproto[8]; -} bool ReceiptMessage_Type_IsValid(int value) { switch (value) { case 0: @@ -1354,6 +1001,47 @@ bool ReceiptMessage_Type_IsValid(int value) { } } +static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed ReceiptMessage_Type_strings[2] = {}; + +static const char ReceiptMessage_Type_names[] = + "DELIVERY" + "READ"; + +static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry ReceiptMessage_Type_entries[] = { + { {ReceiptMessage_Type_names + 0, 8}, 0 }, + { {ReceiptMessage_Type_names + 8, 4}, 1 }, +}; + +static const int ReceiptMessage_Type_entries_by_number[] = { + 0, // 0 -> DELIVERY + 1, // 1 -> READ +}; + +const std::string& ReceiptMessage_Type_Name( + ReceiptMessage_Type value) { + static const bool dummy = + ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( + ReceiptMessage_Type_entries, + ReceiptMessage_Type_entries_by_number, + 2, ReceiptMessage_Type_strings); + (void) dummy; + int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( + ReceiptMessage_Type_entries, + ReceiptMessage_Type_entries_by_number, + 2, value); + return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : + ReceiptMessage_Type_strings[idx].get(); +} +bool ReceiptMessage_Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ReceiptMessage_Type* value) { + int int_value; + bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( + ReceiptMessage_Type_entries, 2, name, &int_value); + if (success) { + *value = static_cast(int_value); + } + return success; +} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr ReceiptMessage_Type ReceiptMessage::DELIVERY; constexpr ReceiptMessage_Type ReceiptMessage::READ; @@ -1361,10 +1049,6 @@ constexpr ReceiptMessage_Type ReceiptMessage::Type_MIN; constexpr ReceiptMessage_Type ReceiptMessage::Type_MAX; constexpr int ReceiptMessage::Type_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* AttachmentPointer_Flags_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); - return file_level_enum_descriptors_SessionProtos_2eproto[9]; -} bool AttachmentPointer_Flags_IsValid(int value) { switch (value) { case 1: @@ -1374,16 +1058,50 @@ bool AttachmentPointer_Flags_IsValid(int value) { } } +static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed AttachmentPointer_Flags_strings[1] = {}; + +static const char AttachmentPointer_Flags_names[] = + "VOICE_MESSAGE"; + +static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry AttachmentPointer_Flags_entries[] = { + { {AttachmentPointer_Flags_names + 0, 13}, 1 }, +}; + +static const int AttachmentPointer_Flags_entries_by_number[] = { + 0, // 1 -> VOICE_MESSAGE +}; + +const std::string& AttachmentPointer_Flags_Name( + AttachmentPointer_Flags value) { + static const bool dummy = + ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( + AttachmentPointer_Flags_entries, + AttachmentPointer_Flags_entries_by_number, + 1, AttachmentPointer_Flags_strings); + (void) dummy; + int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( + AttachmentPointer_Flags_entries, + AttachmentPointer_Flags_entries_by_number, + 1, value); + return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : + AttachmentPointer_Flags_strings[idx].get(); +} +bool AttachmentPointer_Flags_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, AttachmentPointer_Flags* value) { + int int_value; + bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( + AttachmentPointer_Flags_entries, 1, name, &int_value); + if (success) { + *value = static_cast(int_value); + } + return success; +} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr AttachmentPointer_Flags AttachmentPointer::VOICE_MESSAGE; constexpr AttachmentPointer_Flags AttachmentPointer::Flags_MIN; constexpr AttachmentPointer_Flags AttachmentPointer::Flags_MAX; constexpr int AttachmentPointer::Flags_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SharedConfigMessage_Kind_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); - return file_level_enum_descriptors_SessionProtos_2eproto[10]; -} bool SharedConfigMessage_Kind_IsValid(int value) { switch (value) { case 1: @@ -1396,6 +1114,53 @@ bool SharedConfigMessage_Kind_IsValid(int value) { } } +static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed SharedConfigMessage_Kind_strings[4] = {}; + +static const char SharedConfigMessage_Kind_names[] = + "CONTACTS" + "CONVO_INFO_VOLATILE" + "USER_GROUPS" + "USER_PROFILE"; + +static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry SharedConfigMessage_Kind_entries[] = { + { {SharedConfigMessage_Kind_names + 0, 8}, 2 }, + { {SharedConfigMessage_Kind_names + 8, 19}, 3 }, + { {SharedConfigMessage_Kind_names + 27, 11}, 4 }, + { {SharedConfigMessage_Kind_names + 38, 12}, 1 }, +}; + +static const int SharedConfigMessage_Kind_entries_by_number[] = { + 3, // 1 -> USER_PROFILE + 0, // 2 -> CONTACTS + 1, // 3 -> CONVO_INFO_VOLATILE + 2, // 4 -> USER_GROUPS +}; + +const std::string& SharedConfigMessage_Kind_Name( + SharedConfigMessage_Kind value) { + static const bool dummy = + ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( + SharedConfigMessage_Kind_entries, + SharedConfigMessage_Kind_entries_by_number, + 4, SharedConfigMessage_Kind_strings); + (void) dummy; + int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( + SharedConfigMessage_Kind_entries, + SharedConfigMessage_Kind_entries_by_number, + 4, value); + return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : + SharedConfigMessage_Kind_strings[idx].get(); +} +bool SharedConfigMessage_Kind_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, SharedConfigMessage_Kind* value) { + int int_value; + bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( + SharedConfigMessage_Kind_entries, 4, name, &int_value); + if (success) { + *value = static_cast(int_value); + } + return success; +} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr SharedConfigMessage_Kind SharedConfigMessage::USER_PROFILE; constexpr SharedConfigMessage_Kind SharedConfigMessage::CONTACTS; @@ -1405,10 +1170,6 @@ constexpr SharedConfigMessage_Kind SharedConfigMessage::Kind_MIN; constexpr SharedConfigMessage_Kind SharedConfigMessage::Kind_MAX; constexpr int SharedConfigMessage::Kind_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GroupUpdateInfoChangeMessage_Type_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); - return file_level_enum_descriptors_SessionProtos_2eproto[11]; -} bool GroupUpdateInfoChangeMessage_Type_IsValid(int value) { switch (value) { case 1: @@ -1420,6 +1181,50 @@ bool GroupUpdateInfoChangeMessage_Type_IsValid(int value) { } } +static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed GroupUpdateInfoChangeMessage_Type_strings[3] = {}; + +static const char GroupUpdateInfoChangeMessage_Type_names[] = + "AVATAR" + "DISAPPEARING_MESSAGES" + "NAME"; + +static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry GroupUpdateInfoChangeMessage_Type_entries[] = { + { {GroupUpdateInfoChangeMessage_Type_names + 0, 6}, 2 }, + { {GroupUpdateInfoChangeMessage_Type_names + 6, 21}, 3 }, + { {GroupUpdateInfoChangeMessage_Type_names + 27, 4}, 1 }, +}; + +static const int GroupUpdateInfoChangeMessage_Type_entries_by_number[] = { + 2, // 1 -> NAME + 0, // 2 -> AVATAR + 1, // 3 -> DISAPPEARING_MESSAGES +}; + +const std::string& GroupUpdateInfoChangeMessage_Type_Name( + GroupUpdateInfoChangeMessage_Type value) { + static const bool dummy = + ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( + GroupUpdateInfoChangeMessage_Type_entries, + GroupUpdateInfoChangeMessage_Type_entries_by_number, + 3, GroupUpdateInfoChangeMessage_Type_strings); + (void) dummy; + int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( + GroupUpdateInfoChangeMessage_Type_entries, + GroupUpdateInfoChangeMessage_Type_entries_by_number, + 3, value); + return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : + GroupUpdateInfoChangeMessage_Type_strings[idx].get(); +} +bool GroupUpdateInfoChangeMessage_Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, GroupUpdateInfoChangeMessage_Type* value) { + int int_value; + bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( + GroupUpdateInfoChangeMessage_Type_entries, 3, name, &int_value); + if (success) { + *value = static_cast(int_value); + } + return success; +} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr GroupUpdateInfoChangeMessage_Type GroupUpdateInfoChangeMessage::NAME; constexpr GroupUpdateInfoChangeMessage_Type GroupUpdateInfoChangeMessage::AVATAR; @@ -1428,10 +1233,6 @@ constexpr GroupUpdateInfoChangeMessage_Type GroupUpdateInfoChangeMessage::Type_M constexpr GroupUpdateInfoChangeMessage_Type GroupUpdateInfoChangeMessage::Type_MAX; constexpr int GroupUpdateInfoChangeMessage::Type_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GroupUpdateMemberChangeMessage_Type_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_SessionProtos_2eproto); - return file_level_enum_descriptors_SessionProtos_2eproto[12]; -} bool GroupUpdateMemberChangeMessage_Type_IsValid(int value) { switch (value) { case 1: @@ -1443,6 +1244,50 @@ bool GroupUpdateMemberChangeMessage_Type_IsValid(int value) { } } +static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed GroupUpdateMemberChangeMessage_Type_strings[3] = {}; + +static const char GroupUpdateMemberChangeMessage_Type_names[] = + "ADDED" + "PROMOTED" + "REMOVED"; + +static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry GroupUpdateMemberChangeMessage_Type_entries[] = { + { {GroupUpdateMemberChangeMessage_Type_names + 0, 5}, 1 }, + { {GroupUpdateMemberChangeMessage_Type_names + 5, 8}, 3 }, + { {GroupUpdateMemberChangeMessage_Type_names + 13, 7}, 2 }, +}; + +static const int GroupUpdateMemberChangeMessage_Type_entries_by_number[] = { + 0, // 1 -> ADDED + 2, // 2 -> REMOVED + 1, // 3 -> PROMOTED +}; + +const std::string& GroupUpdateMemberChangeMessage_Type_Name( + GroupUpdateMemberChangeMessage_Type value) { + static const bool dummy = + ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings( + GroupUpdateMemberChangeMessage_Type_entries, + GroupUpdateMemberChangeMessage_Type_entries_by_number, + 3, GroupUpdateMemberChangeMessage_Type_strings); + (void) dummy; + int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName( + GroupUpdateMemberChangeMessage_Type_entries, + GroupUpdateMemberChangeMessage_Type_entries_by_number, + 3, value); + return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() : + GroupUpdateMemberChangeMessage_Type_strings[idx].get(); +} +bool GroupUpdateMemberChangeMessage_Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, GroupUpdateMemberChangeMessage_Type* value) { + int int_value; + bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue( + GroupUpdateMemberChangeMessage_Type_entries, 3, name, &int_value); + if (success) { + *value = static_cast(int_value); + } + return success; +} #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr GroupUpdateMemberChangeMessage_Type GroupUpdateMemberChangeMessage::ADDED; constexpr GroupUpdateMemberChangeMessage_Type GroupUpdateMemberChangeMessage::REMOVED; @@ -1485,12 +1330,12 @@ class Envelope::_Internal { Envelope::Envelope(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.Envelope) } Envelope::Envelope(const Envelope& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { Envelope* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -1503,7 +1348,7 @@ Envelope::Envelope(const Envelope& from) , decltype(_impl_.sourcedevice_){} , decltype(_impl_.type_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.source_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.source_.Set("", GetArenaForAllocation()); @@ -1565,7 +1410,7 @@ inline void Envelope::SharedCtor( Envelope::~Envelope() { // @@protoc_insertion_point(destructor:SessionProtos.Envelope) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -1608,7 +1453,7 @@ void Envelope::Clear() { _impl_.type_ = 6; } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* Envelope::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -1637,9 +1482,6 @@ const char* Envelope::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) auto str = _internal_mutable_source(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.Envelope.source"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -1699,7 +1541,7 @@ const char* Envelope::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -1728,10 +1570,6 @@ uint8_t* Envelope::_InternalSerialize( // optional string source = 2; if (cached_has_bits & 0x00000001u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_source().data(), static_cast(this->_internal_source().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.Envelope.source"); target = stream->WriteStringMaybeAliased( 2, this->_internal_source(), target); } @@ -1767,8 +1605,8 @@ uint8_t* Envelope::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.Envelope) return target; @@ -1846,19 +1684,22 @@ size_t Envelope::ByteSizeLong() const { } } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Envelope::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - Envelope::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Envelope::GetClassData() const { return &_class_data_; } - +void Envelope::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void Envelope::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void Envelope::MergeFrom(const Envelope& from) { + Envelope* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.Envelope) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -1889,7 +1730,7 @@ void Envelope::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTO } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void Envelope::CopyFrom(const Envelope& from) { @@ -1931,12 +1772,11 @@ void Envelope::InternalSwap(Envelope* other) { swap(_impl_.type_, other->_impl_.type_); } -::PROTOBUF_NAMESPACE_ID::Metadata Envelope::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[0]); +std::string Envelope::GetTypeName() const { + return "SessionProtos.Envelope"; } + // =================================================================== class TypingMessage::_Internal { @@ -1955,12 +1795,12 @@ class TypingMessage::_Internal { TypingMessage::TypingMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.TypingMessage) } TypingMessage::TypingMessage(const TypingMessage& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { TypingMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -1968,7 +1808,7 @@ TypingMessage::TypingMessage(const TypingMessage& from) , decltype(_impl_.timestamp_){} , decltype(_impl_.action_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); ::memcpy(&_impl_.timestamp_, &from._impl_.timestamp_, static_cast(reinterpret_cast(&_impl_.action_) - reinterpret_cast(&_impl_.timestamp_)) + sizeof(_impl_.action_)); @@ -1989,7 +1829,7 @@ inline void TypingMessage::SharedCtor( TypingMessage::~TypingMessage() { // @@protoc_insertion_point(destructor:SessionProtos.TypingMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -2017,7 +1857,7 @@ void TypingMessage::Clear() { reinterpret_cast(&_impl_.timestamp_)) + sizeof(_impl_.action_)); } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* TypingMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -2060,7 +1900,7 @@ const char* TypingMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -2094,8 +1934,8 @@ uint8_t* TypingMessage::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.TypingMessage) return target; @@ -2137,19 +1977,22 @@ size_t TypingMessage::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TypingMessage::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - TypingMessage::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TypingMessage::GetClassData() const { return &_class_data_; } - +void TypingMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void TypingMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void TypingMessage::MergeFrom(const TypingMessage& from) { + TypingMessage* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.TypingMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -2165,7 +2008,7 @@ void TypingMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const :: } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void TypingMessage::CopyFrom(const TypingMessage& from) { @@ -2192,12 +2035,11 @@ void TypingMessage::InternalSwap(TypingMessage* other) { reinterpret_cast(&other->_impl_.timestamp_)); } -::PROTOBUF_NAMESPACE_ID::Metadata TypingMessage::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[1]); +std::string TypingMessage::GetTypeName() const { + return "SessionProtos.TypingMessage"; } + // =================================================================== class UnsendRequest::_Internal { @@ -2216,12 +2058,12 @@ class UnsendRequest::_Internal { UnsendRequest::UnsendRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.UnsendRequest) } UnsendRequest::UnsendRequest(const UnsendRequest& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { UnsendRequest* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -2229,7 +2071,7 @@ UnsendRequest::UnsendRequest(const UnsendRequest& from) , decltype(_impl_.author_){} , decltype(_impl_.timestamp_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.author_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.author_.Set("", GetArenaForAllocation()); @@ -2260,7 +2102,7 @@ inline void UnsendRequest::SharedCtor( UnsendRequest::~UnsendRequest() { // @@protoc_insertion_point(destructor:SessionProtos.UnsendRequest) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -2288,7 +2130,7 @@ void UnsendRequest::Clear() { } _impl_.timestamp_ = uint64_t{0u}; _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* UnsendRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -2313,9 +2155,6 @@ const char* UnsendRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* auto str = _internal_mutable_author(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.UnsendRequest.author"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -2330,7 +2169,7 @@ const char* UnsendRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -2358,17 +2197,13 @@ uint8_t* UnsendRequest::_InternalSerialize( // required string author = 2; if (cached_has_bits & 0x00000001u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_author().data(), static_cast(this->_internal_author().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.UnsendRequest.author"); target = stream->WriteStringMaybeAliased( 2, this->_internal_author(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.UnsendRequest) return target; @@ -2412,19 +2247,22 @@ size_t UnsendRequest::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData UnsendRequest::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - UnsendRequest::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*UnsendRequest::GetClassData() const { return &_class_data_; } - +void UnsendRequest::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void UnsendRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void UnsendRequest::MergeFrom(const UnsendRequest& from) { + UnsendRequest* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.UnsendRequest) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -2440,7 +2278,7 @@ void UnsendRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const :: } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void UnsendRequest::CopyFrom(const UnsendRequest& from) { @@ -2468,12 +2306,11 @@ void UnsendRequest::InternalSwap(UnsendRequest* other) { swap(_impl_.timestamp_, other->_impl_.timestamp_); } -::PROTOBUF_NAMESPACE_ID::Metadata UnsendRequest::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[2]); +std::string UnsendRequest::GetTypeName() const { + return "SessionProtos.UnsendRequest"; } + // =================================================================== class MessageRequestResponse::_Internal { @@ -2500,12 +2337,12 @@ MessageRequestResponse::_Internal::profile(const MessageRequestResponse* msg) { } MessageRequestResponse::MessageRequestResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.MessageRequestResponse) } MessageRequestResponse::MessageRequestResponse(const MessageRequestResponse& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { MessageRequestResponse* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -2514,7 +2351,7 @@ MessageRequestResponse::MessageRequestResponse(const MessageRequestResponse& fro , decltype(_impl_.profile_){nullptr} , decltype(_impl_.isapproved_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.profilekey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.profilekey_.Set("", GetArenaForAllocation()); @@ -2549,7 +2386,7 @@ inline void MessageRequestResponse::SharedCtor( MessageRequestResponse::~MessageRequestResponse() { // @@protoc_insertion_point(destructor:SessionProtos.MessageRequestResponse) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -2584,7 +2421,7 @@ void MessageRequestResponse::Clear() { } _impl_.isapproved_ = false; _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* MessageRequestResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -2631,7 +2468,7 @@ const char* MessageRequestResponse::_InternalParse(const char* ptr, ::_pbi::Pars } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -2671,8 +2508,8 @@ uint8_t* MessageRequestResponse::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.MessageRequestResponse) return target; @@ -2707,19 +2544,22 @@ size_t MessageRequestResponse::ByteSizeLong() const { } } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MessageRequestResponse::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - MessageRequestResponse::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*MessageRequestResponse::GetClassData() const { return &_class_data_; } - +void MessageRequestResponse::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void MessageRequestResponse::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void MessageRequestResponse::MergeFrom(const MessageRequestResponse& from) { + MessageRequestResponse* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.MessageRequestResponse) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -2739,7 +2579,7 @@ void MessageRequestResponse::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void MessageRequestResponse::CopyFrom(const MessageRequestResponse& from) { @@ -2772,12 +2612,11 @@ void MessageRequestResponse::InternalSwap(MessageRequestResponse* other) { reinterpret_cast(&other->_impl_.profile_)); } -::PROTOBUF_NAMESPACE_ID::Metadata MessageRequestResponse::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[3]); +std::string MessageRequestResponse::GetTypeName() const { + return "SessionProtos.MessageRequestResponse"; } + // =================================================================== class Content::_Internal { @@ -2868,12 +2707,12 @@ Content::_Internal::promessage(const Content* msg) { } Content::Content(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.Content) } Content::Content(const Content& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { Content* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -2891,7 +2730,7 @@ Content::Content(const Content& from) , decltype(_impl_.expirationtimer_){} , decltype(_impl_.sigtimestamp_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); if (from._internal_has_datamessage()) { _this->_impl_.datamessage_ = new ::SessionProtos::DataMessage(*from._impl_.datamessage_); } @@ -2949,7 +2788,7 @@ inline void Content::SharedCtor( Content::~Content() { // @@protoc_insertion_point(destructor:SessionProtos.Content) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -3024,7 +2863,7 @@ void Content::Clear() { reinterpret_cast(&_impl_.expirationtype_)) + sizeof(_impl_.sigtimestamp_)); } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* Content::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -3148,7 +2987,7 @@ const char* Content::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -3251,8 +3090,8 @@ uint8_t* Content::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.Content) return target; @@ -3350,19 +3189,22 @@ size_t Content::ByteSizeLong() const { } } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Content::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - Content::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Content::GetClassData() const { return &_class_data_; } - +void Content::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void Content::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void Content::MergeFrom(const Content& from) { + Content* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.Content) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -3419,7 +3261,7 @@ void Content::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOB } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void Content::CopyFrom(const Content& from) { @@ -3472,12 +3314,11 @@ void Content::InternalSwap(Content* other) { reinterpret_cast(&other->_impl_.datamessage_)); } -::PROTOBUF_NAMESPACE_ID::Metadata Content::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[4]); +std::string Content::GetTypeName() const { + return "SessionProtos.Content"; } + // =================================================================== class CallMessage::_Internal { @@ -3496,12 +3337,12 @@ class CallMessage::_Internal { CallMessage::CallMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.CallMessage) } CallMessage::CallMessage(const CallMessage& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { CallMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -3512,7 +3353,7 @@ CallMessage::CallMessage(const CallMessage& from) , decltype(_impl_.uuid_){} , decltype(_impl_.type_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.uuid_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.uuid_.Set("", GetArenaForAllocation()); @@ -3546,7 +3387,7 @@ inline void CallMessage::SharedCtor( CallMessage::~CallMessage() { // @@protoc_insertion_point(destructor:SessionProtos.CallMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -3582,7 +3423,7 @@ void CallMessage::Clear() { _impl_.type_ = 6; } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* CallMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -3614,9 +3455,6 @@ const char* CallMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* c auto str = _internal_add_sdps(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.CallMessage.sdps"); - #endif // !NDEBUG if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); } else @@ -3647,9 +3485,6 @@ const char* CallMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* c auto str = _internal_add_sdpmids(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.CallMessage.sdpMids"); - #endif // !NDEBUG if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); } else @@ -3661,9 +3496,6 @@ const char* CallMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* c auto str = _internal_mutable_uuid(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.CallMessage.uuid"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -3678,7 +3510,7 @@ const char* CallMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* c } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -3708,10 +3540,6 @@ uint8_t* CallMessage::_InternalSerialize( // repeated string sdps = 2; for (int i = 0, n = this->_internal_sdps_size(); i < n; i++) { const auto& s = this->_internal_sdps(i); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - s.data(), static_cast(s.length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.CallMessage.sdps"); target = stream->WriteString(2, s, target); } @@ -3724,26 +3552,18 @@ uint8_t* CallMessage::_InternalSerialize( // repeated string sdpMids = 4; for (int i = 0, n = this->_internal_sdpmids_size(); i < n; i++) { const auto& s = this->_internal_sdpmids(i); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - s.data(), static_cast(s.length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.CallMessage.sdpMids"); target = stream->WriteString(4, s, target); } // required string uuid = 5; if (cached_has_bits & 0x00000001u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_uuid().data(), static_cast(this->_internal_uuid().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.CallMessage.uuid"); target = stream->WriteStringMaybeAliased( 5, this->_internal_uuid(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.CallMessage) return target; @@ -3814,19 +3634,22 @@ size_t CallMessage::ByteSizeLong() const { _impl_.sdpmids_.Get(i)); } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData CallMessage::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - CallMessage::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CallMessage::GetClassData() const { return &_class_data_; } - +void CallMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void CallMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void CallMessage::MergeFrom(const CallMessage& from) { + CallMessage* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.CallMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -3845,7 +3668,7 @@ void CallMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PR } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void CallMessage::CopyFrom(const CallMessage& from) { @@ -3876,12 +3699,11 @@ void CallMessage::InternalSwap(CallMessage* other) { swap(_impl_.type_, other->_impl_.type_); } -::PROTOBUF_NAMESPACE_ID::Metadata CallMessage::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[5]); +std::string CallMessage::GetTypeName() const { + return "SessionProtos.CallMessage"; } + // =================================================================== class KeyPair::_Internal { @@ -3900,12 +3722,12 @@ class KeyPair::_Internal { KeyPair::KeyPair(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.KeyPair) } KeyPair::KeyPair(const KeyPair& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { KeyPair* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -3913,7 +3735,7 @@ KeyPair::KeyPair(const KeyPair& from) , decltype(_impl_.publickey_){} , decltype(_impl_.privatekey_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.publickey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.publickey_.Set("", GetArenaForAllocation()); @@ -3955,7 +3777,7 @@ inline void KeyPair::SharedCtor( KeyPair::~KeyPair() { // @@protoc_insertion_point(destructor:SessionProtos.KeyPair) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -3988,7 +3810,7 @@ void KeyPair::Clear() { } } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* KeyPair::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -4027,7 +3849,7 @@ const char* KeyPair::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -4060,8 +3882,8 @@ uint8_t* KeyPair::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.KeyPair) return target; @@ -4109,19 +3931,22 @@ size_t KeyPair::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData KeyPair::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - KeyPair::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*KeyPair::GetClassData() const { return &_class_data_; } - +void KeyPair::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void KeyPair::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void KeyPair::MergeFrom(const KeyPair& from) { + KeyPair* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.KeyPair) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -4136,7 +3961,7 @@ void KeyPair::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOB _this->_internal_set_privatekey(from._internal_privatekey()); } } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void KeyPair::CopyFrom(const KeyPair& from) { @@ -4167,12 +3992,11 @@ void KeyPair::InternalSwap(KeyPair* other) { ); } -::PROTOBUF_NAMESPACE_ID::Metadata KeyPair::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[6]); +std::string KeyPair::GetTypeName() const { + return "SessionProtos.KeyPair"; } + // =================================================================== class DataExtractionNotification::_Internal { @@ -4191,12 +4015,12 @@ class DataExtractionNotification::_Internal { DataExtractionNotification::DataExtractionNotification(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.DataExtractionNotification) } DataExtractionNotification::DataExtractionNotification(const DataExtractionNotification& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { DataExtractionNotification* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -4204,7 +4028,7 @@ DataExtractionNotification::DataExtractionNotification(const DataExtractionNotif , decltype(_impl_.timestamp_){} , decltype(_impl_.type_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); ::memcpy(&_impl_.timestamp_, &from._impl_.timestamp_, static_cast(reinterpret_cast(&_impl_.type_) - reinterpret_cast(&_impl_.timestamp_)) + sizeof(_impl_.type_)); @@ -4225,7 +4049,7 @@ inline void DataExtractionNotification::SharedCtor( DataExtractionNotification::~DataExtractionNotification() { // @@protoc_insertion_point(destructor:SessionProtos.DataExtractionNotification) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -4252,7 +4076,7 @@ void DataExtractionNotification::Clear() { _impl_.type_ = 1; } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* DataExtractionNotification::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -4295,7 +4119,7 @@ const char* DataExtractionNotification::_InternalParse(const char* ptr, ::_pbi:: } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -4329,8 +4153,8 @@ uint8_t* DataExtractionNotification::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataExtractionNotification) return target; @@ -4355,19 +4179,22 @@ size_t DataExtractionNotification::ByteSizeLong() const { total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_timestamp()); } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DataExtractionNotification::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - DataExtractionNotification::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DataExtractionNotification::GetClassData() const { return &_class_data_; } - +void DataExtractionNotification::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void DataExtractionNotification::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void DataExtractionNotification::MergeFrom(const DataExtractionNotification& from) { + DataExtractionNotification* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataExtractionNotification) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -4383,7 +4210,7 @@ void DataExtractionNotification::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_ } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void DataExtractionNotification::CopyFrom(const DataExtractionNotification& from) { @@ -4406,12 +4233,11 @@ void DataExtractionNotification::InternalSwap(DataExtractionNotification* other) swap(_impl_.type_, other->_impl_.type_); } -::PROTOBUF_NAMESPACE_ID::Metadata DataExtractionNotification::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[7]); +std::string DataExtractionNotification::GetTypeName() const { + return "SessionProtos.DataExtractionNotification"; } + // =================================================================== class LokiProfile::_Internal { @@ -4427,12 +4253,12 @@ class LokiProfile::_Internal { LokiProfile::LokiProfile(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.LokiProfile) } LokiProfile::LokiProfile(const LokiProfile& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { LokiProfile* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -4440,7 +4266,7 @@ LokiProfile::LokiProfile(const LokiProfile& from) , decltype(_impl_.displayname_){} , decltype(_impl_.profilepicture_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.displayname_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.displayname_.Set("", GetArenaForAllocation()); @@ -4482,7 +4308,7 @@ inline void LokiProfile::SharedCtor( LokiProfile::~LokiProfile() { // @@protoc_insertion_point(destructor:SessionProtos.LokiProfile) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -4515,7 +4341,7 @@ void LokiProfile::Clear() { } } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* LokiProfile::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -4531,9 +4357,6 @@ const char* LokiProfile::_InternalParse(const char* ptr, ::_pbi::ParseContext* c auto str = _internal_mutable_displayname(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.LokiProfile.displayName"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -4543,9 +4366,6 @@ const char* LokiProfile::_InternalParse(const char* ptr, ::_pbi::ParseContext* c auto str = _internal_mutable_profilepicture(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.LokiProfile.profilePicture"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -4560,7 +4380,7 @@ const char* LokiProfile::_InternalParse(const char* ptr, ::_pbi::ParseContext* c } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -4582,27 +4402,19 @@ uint8_t* LokiProfile::_InternalSerialize( cached_has_bits = _impl_._has_bits_[0]; // optional string displayName = 1; if (cached_has_bits & 0x00000001u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_displayname().data(), static_cast(this->_internal_displayname().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.LokiProfile.displayName"); target = stream->WriteStringMaybeAliased( 1, this->_internal_displayname(), target); } // optional string profilePicture = 2; if (cached_has_bits & 0x00000002u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_profilepicture().data(), static_cast(this->_internal_profilepicture().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.LokiProfile.profilePicture"); target = stream->WriteStringMaybeAliased( 2, this->_internal_profilepicture(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.LokiProfile) return target; @@ -4633,19 +4445,22 @@ size_t LokiProfile::ByteSizeLong() const { } } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData LokiProfile::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - LokiProfile::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*LokiProfile::GetClassData() const { return &_class_data_; } - +void LokiProfile::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void LokiProfile::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void LokiProfile::MergeFrom(const LokiProfile& from) { + LokiProfile* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.LokiProfile) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -4660,7 +4475,7 @@ void LokiProfile::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PR _this->_internal_set_profilepicture(from._internal_profilepicture()); } } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void LokiProfile::CopyFrom(const LokiProfile& from) { @@ -4690,12 +4505,11 @@ void LokiProfile::InternalSwap(LokiProfile* other) { ); } -::PROTOBUF_NAMESPACE_ID::Metadata LokiProfile::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[8]); +std::string LokiProfile::GetTypeName() const { + return "SessionProtos.LokiProfile"; } + // =================================================================== class DataMessage_Quote_QuotedAttachment::_Internal { @@ -4722,12 +4536,12 @@ DataMessage_Quote_QuotedAttachment::_Internal::thumbnail(const DataMessage_Quote } DataMessage_Quote_QuotedAttachment::DataMessage_Quote_QuotedAttachment(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Quote.QuotedAttachment) } DataMessage_Quote_QuotedAttachment::DataMessage_Quote_QuotedAttachment(const DataMessage_Quote_QuotedAttachment& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { DataMessage_Quote_QuotedAttachment* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -4737,7 +4551,7 @@ DataMessage_Quote_QuotedAttachment::DataMessage_Quote_QuotedAttachment(const Dat , decltype(_impl_.thumbnail_){nullptr} , decltype(_impl_.flags_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.contenttype_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.contenttype_.Set("", GetArenaForAllocation()); @@ -4785,7 +4599,7 @@ inline void DataMessage_Quote_QuotedAttachment::SharedCtor( DataMessage_Quote_QuotedAttachment::~DataMessage_Quote_QuotedAttachment() { // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Quote.QuotedAttachment) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -4824,7 +4638,7 @@ void DataMessage_Quote_QuotedAttachment::Clear() { } _impl_.flags_ = 0u; _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* DataMessage_Quote_QuotedAttachment::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -4840,9 +4654,6 @@ const char* DataMessage_Quote_QuotedAttachment::_InternalParse(const char* ptr, auto str = _internal_mutable_contenttype(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.Quote.QuotedAttachment.contentType"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -4852,9 +4663,6 @@ const char* DataMessage_Quote_QuotedAttachment::_InternalParse(const char* ptr, auto str = _internal_mutable_filename(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.Quote.QuotedAttachment.fileName"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -4886,7 +4694,7 @@ const char* DataMessage_Quote_QuotedAttachment::_InternalParse(const char* ptr, } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -4908,20 +4716,12 @@ uint8_t* DataMessage_Quote_QuotedAttachment::_InternalSerialize( cached_has_bits = _impl_._has_bits_[0]; // optional string contentType = 1; if (cached_has_bits & 0x00000001u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_contenttype().data(), static_cast(this->_internal_contenttype().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.DataMessage.Quote.QuotedAttachment.contentType"); target = stream->WriteStringMaybeAliased( 1, this->_internal_contenttype(), target); } // optional string fileName = 2; if (cached_has_bits & 0x00000002u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_filename().data(), static_cast(this->_internal_filename().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.DataMessage.Quote.QuotedAttachment.fileName"); target = stream->WriteStringMaybeAliased( 2, this->_internal_filename(), target); } @@ -4940,8 +4740,8 @@ uint8_t* DataMessage_Quote_QuotedAttachment::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Quote.QuotedAttachment) return target; @@ -4984,19 +4784,22 @@ size_t DataMessage_Quote_QuotedAttachment::ByteSizeLong() const { } } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DataMessage_Quote_QuotedAttachment::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - DataMessage_Quote_QuotedAttachment::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DataMessage_Quote_QuotedAttachment::GetClassData() const { return &_class_data_; } - +void DataMessage_Quote_QuotedAttachment::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void DataMessage_Quote_QuotedAttachment::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void DataMessage_Quote_QuotedAttachment::MergeFrom(const DataMessage_Quote_QuotedAttachment& from) { + DataMessage_Quote_QuotedAttachment* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Quote.QuotedAttachment) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -5019,7 +4822,7 @@ void DataMessage_Quote_QuotedAttachment::MergeImpl(::PROTOBUF_NAMESPACE_ID::Mess } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void DataMessage_Quote_QuotedAttachment::CopyFrom(const DataMessage_Quote_QuotedAttachment& from) { @@ -5058,12 +4861,11 @@ void DataMessage_Quote_QuotedAttachment::InternalSwap(DataMessage_Quote_QuotedAt reinterpret_cast(&other->_impl_.thumbnail_)); } -::PROTOBUF_NAMESPACE_ID::Metadata DataMessage_Quote_QuotedAttachment::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[9]); +std::string DataMessage_Quote_QuotedAttachment::GetTypeName() const { + return "SessionProtos.DataMessage.Quote.QuotedAttachment"; } + // =================================================================== class DataMessage_Quote::_Internal { @@ -5085,12 +4887,12 @@ class DataMessage_Quote::_Internal { DataMessage_Quote::DataMessage_Quote(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Quote) } DataMessage_Quote::DataMessage_Quote(const DataMessage_Quote& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { DataMessage_Quote* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -5100,7 +4902,7 @@ DataMessage_Quote::DataMessage_Quote(const DataMessage_Quote& from) , decltype(_impl_.text_){} , decltype(_impl_.id_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.author_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.author_.Set("", GetArenaForAllocation()); @@ -5145,7 +4947,7 @@ inline void DataMessage_Quote::SharedCtor( DataMessage_Quote::~DataMessage_Quote() { // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Quote) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -5181,7 +4983,7 @@ void DataMessage_Quote::Clear() { } _impl_.id_ = uint64_t{0u}; _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* DataMessage_Quote::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -5206,9 +5008,6 @@ const char* DataMessage_Quote::_InternalParse(const char* ptr, ::_pbi::ParseCont auto str = _internal_mutable_author(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.Quote.author"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -5218,9 +5017,6 @@ const char* DataMessage_Quote::_InternalParse(const char* ptr, ::_pbi::ParseCont auto str = _internal_mutable_text(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.Quote.text"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -5248,7 +5044,7 @@ const char* DataMessage_Quote::_InternalParse(const char* ptr, ::_pbi::ParseCont } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -5276,20 +5072,12 @@ uint8_t* DataMessage_Quote::_InternalSerialize( // required string author = 2; if (cached_has_bits & 0x00000001u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_author().data(), static_cast(this->_internal_author().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.DataMessage.Quote.author"); target = stream->WriteStringMaybeAliased( 2, this->_internal_author(), target); } // optional string text = 3; if (cached_has_bits & 0x00000002u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_text().data(), static_cast(this->_internal_text().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.DataMessage.Quote.text"); target = stream->WriteStringMaybeAliased( 3, this->_internal_text(), target); } @@ -5303,8 +5091,8 @@ uint8_t* DataMessage_Quote::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Quote) return target; @@ -5363,19 +5151,22 @@ size_t DataMessage_Quote::ByteSizeLong() const { this->_internal_text()); } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DataMessage_Quote::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - DataMessage_Quote::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DataMessage_Quote::GetClassData() const { return &_class_data_; } - +void DataMessage_Quote::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void DataMessage_Quote::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void DataMessage_Quote::MergeFrom(const DataMessage_Quote& from) { + DataMessage_Quote* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Quote) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -5395,7 +5186,7 @@ void DataMessage_Quote::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, cons } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void DataMessage_Quote::CopyFrom(const DataMessage_Quote& from) { @@ -5430,12 +5221,11 @@ void DataMessage_Quote::InternalSwap(DataMessage_Quote* other) { swap(_impl_.id_, other->_impl_.id_); } -::PROTOBUF_NAMESPACE_ID::Metadata DataMessage_Quote::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[10]); +std::string DataMessage_Quote::GetTypeName() const { + return "SessionProtos.DataMessage.Quote"; } + // =================================================================== class DataMessage_Preview::_Internal { @@ -5462,12 +5252,12 @@ DataMessage_Preview::_Internal::image(const DataMessage_Preview* msg) { } DataMessage_Preview::DataMessage_Preview(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Preview) } DataMessage_Preview::DataMessage_Preview(const DataMessage_Preview& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { DataMessage_Preview* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -5476,7 +5266,7 @@ DataMessage_Preview::DataMessage_Preview(const DataMessage_Preview& from) , decltype(_impl_.title_){} , decltype(_impl_.image_){nullptr}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.url_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.url_.Set("", GetArenaForAllocation()); @@ -5522,7 +5312,7 @@ inline void DataMessage_Preview::SharedCtor( DataMessage_Preview::~DataMessage_Preview() { // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Preview) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -5560,7 +5350,7 @@ void DataMessage_Preview::Clear() { } } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* DataMessage_Preview::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -5576,9 +5366,6 @@ const char* DataMessage_Preview::_InternalParse(const char* ptr, ::_pbi::ParseCo auto str = _internal_mutable_url(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.Preview.url"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -5588,9 +5375,6 @@ const char* DataMessage_Preview::_InternalParse(const char* ptr, ::_pbi::ParseCo auto str = _internal_mutable_title(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.Preview.title"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -5613,7 +5397,7 @@ const char* DataMessage_Preview::_InternalParse(const char* ptr, ::_pbi::ParseCo } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -5635,20 +5419,12 @@ uint8_t* DataMessage_Preview::_InternalSerialize( cached_has_bits = _impl_._has_bits_[0]; // required string url = 1; if (cached_has_bits & 0x00000001u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_url().data(), static_cast(this->_internal_url().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.DataMessage.Preview.url"); target = stream->WriteStringMaybeAliased( 1, this->_internal_url(), target); } // optional string title = 2; if (cached_has_bits & 0x00000002u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_title().data(), static_cast(this->_internal_title().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.DataMessage.Preview.title"); target = stream->WriteStringMaybeAliased( 2, this->_internal_title(), target); } @@ -5661,8 +5437,8 @@ uint8_t* DataMessage_Preview::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Preview) return target; @@ -5699,19 +5475,22 @@ size_t DataMessage_Preview::ByteSizeLong() const { } } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DataMessage_Preview::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - DataMessage_Preview::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DataMessage_Preview::GetClassData() const { return &_class_data_; } - +void DataMessage_Preview::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void DataMessage_Preview::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void DataMessage_Preview::MergeFrom(const DataMessage_Preview& from) { + DataMessage_Preview* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Preview) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -5730,7 +5509,7 @@ void DataMessage_Preview::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, co from._internal_image()); } } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void DataMessage_Preview::CopyFrom(const DataMessage_Preview& from) { @@ -5765,12 +5544,11 @@ void DataMessage_Preview::InternalSwap(DataMessage_Preview* other) { swap(_impl_.image_, other->_impl_.image_); } -::PROTOBUF_NAMESPACE_ID::Metadata DataMessage_Preview::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[11]); +std::string DataMessage_Preview::GetTypeName() const { + return "SessionProtos.DataMessage.Preview"; } + // =================================================================== class DataMessage_Reaction::_Internal { @@ -5795,12 +5573,12 @@ class DataMessage_Reaction::_Internal { DataMessage_Reaction::DataMessage_Reaction(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.Reaction) } DataMessage_Reaction::DataMessage_Reaction(const DataMessage_Reaction& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { DataMessage_Reaction* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -5810,7 +5588,7 @@ DataMessage_Reaction::DataMessage_Reaction(const DataMessage_Reaction& from) , decltype(_impl_.id_){} , decltype(_impl_.action_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.author_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.author_.Set("", GetArenaForAllocation()); @@ -5857,7 +5635,7 @@ inline void DataMessage_Reaction::SharedCtor( DataMessage_Reaction::~DataMessage_Reaction() { // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.Reaction) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -5895,7 +5673,7 @@ void DataMessage_Reaction::Clear() { reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.action_)); } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* DataMessage_Reaction::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -5920,9 +5698,6 @@ const char* DataMessage_Reaction::_InternalParse(const char* ptr, ::_pbi::ParseC auto str = _internal_mutable_author(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.Reaction.author"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -5932,9 +5707,6 @@ const char* DataMessage_Reaction::_InternalParse(const char* ptr, ::_pbi::ParseC auto str = _internal_mutable_emoji(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.Reaction.emoji"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -5962,7 +5734,7 @@ const char* DataMessage_Reaction::_InternalParse(const char* ptr, ::_pbi::ParseC } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -5990,20 +5762,12 @@ uint8_t* DataMessage_Reaction::_InternalSerialize( // required string author = 2; if (cached_has_bits & 0x00000001u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_author().data(), static_cast(this->_internal_author().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.DataMessage.Reaction.author"); target = stream->WriteStringMaybeAliased( 2, this->_internal_author(), target); } // optional string emoji = 3; if (cached_has_bits & 0x00000002u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_emoji().data(), static_cast(this->_internal_emoji().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.DataMessage.Reaction.emoji"); target = stream->WriteStringMaybeAliased( 3, this->_internal_emoji(), target); } @@ -6016,8 +5780,8 @@ uint8_t* DataMessage_Reaction::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.Reaction) return target; @@ -6079,19 +5843,22 @@ size_t DataMessage_Reaction::ByteSizeLong() const { this->_internal_emoji()); } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DataMessage_Reaction::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - DataMessage_Reaction::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DataMessage_Reaction::GetClassData() const { return &_class_data_; } - +void DataMessage_Reaction::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void DataMessage_Reaction::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void DataMessage_Reaction::MergeFrom(const DataMessage_Reaction& from) { + DataMessage_Reaction* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.Reaction) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -6113,7 +5880,7 @@ void DataMessage_Reaction::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, c } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void DataMessage_Reaction::CopyFrom(const DataMessage_Reaction& from) { @@ -6150,12 +5917,11 @@ void DataMessage_Reaction::InternalSwap(DataMessage_Reaction* other) { reinterpret_cast(&other->_impl_.id_)); } -::PROTOBUF_NAMESPACE_ID::Metadata DataMessage_Reaction::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[12]); +std::string DataMessage_Reaction::GetTypeName() const { + return "SessionProtos.DataMessage.Reaction"; } + // =================================================================== class DataMessage_OpenGroupInvitation::_Internal { @@ -6174,12 +5940,12 @@ class DataMessage_OpenGroupInvitation::_Internal { DataMessage_OpenGroupInvitation::DataMessage_OpenGroupInvitation(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage.OpenGroupInvitation) } DataMessage_OpenGroupInvitation::DataMessage_OpenGroupInvitation(const DataMessage_OpenGroupInvitation& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { DataMessage_OpenGroupInvitation* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -6187,7 +5953,7 @@ DataMessage_OpenGroupInvitation::DataMessage_OpenGroupInvitation(const DataMessa , decltype(_impl_.url_){} , decltype(_impl_.name_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.url_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.url_.Set("", GetArenaForAllocation()); @@ -6229,7 +5995,7 @@ inline void DataMessage_OpenGroupInvitation::SharedCtor( DataMessage_OpenGroupInvitation::~DataMessage_OpenGroupInvitation() { // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.OpenGroupInvitation) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -6262,7 +6028,7 @@ void DataMessage_OpenGroupInvitation::Clear() { } } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* DataMessage_OpenGroupInvitation::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -6278,9 +6044,6 @@ const char* DataMessage_OpenGroupInvitation::_InternalParse(const char* ptr, ::_ auto str = _internal_mutable_url(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.OpenGroupInvitation.url"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -6290,9 +6053,6 @@ const char* DataMessage_OpenGroupInvitation::_InternalParse(const char* ptr, ::_ auto str = _internal_mutable_name(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.OpenGroupInvitation.name"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -6307,7 +6067,7 @@ const char* DataMessage_OpenGroupInvitation::_InternalParse(const char* ptr, ::_ } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -6329,27 +6089,19 @@ uint8_t* DataMessage_OpenGroupInvitation::_InternalSerialize( cached_has_bits = _impl_._has_bits_[0]; // required string url = 1; if (cached_has_bits & 0x00000001u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_url().data(), static_cast(this->_internal_url().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.DataMessage.OpenGroupInvitation.url"); target = stream->WriteStringMaybeAliased( 1, this->_internal_url(), target); } // required string name = 3; if (cached_has_bits & 0x00000002u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_name().data(), static_cast(this->_internal_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.DataMessage.OpenGroupInvitation.name"); target = stream->WriteStringMaybeAliased( 3, this->_internal_name(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.OpenGroupInvitation) return target; @@ -6397,19 +6149,22 @@ size_t DataMessage_OpenGroupInvitation::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DataMessage_OpenGroupInvitation::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - DataMessage_OpenGroupInvitation::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DataMessage_OpenGroupInvitation::GetClassData() const { return &_class_data_; } - +void DataMessage_OpenGroupInvitation::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void DataMessage_OpenGroupInvitation::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void DataMessage_OpenGroupInvitation::MergeFrom(const DataMessage_OpenGroupInvitation& from) { + DataMessage_OpenGroupInvitation* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage.OpenGroupInvitation) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -6424,7 +6179,7 @@ void DataMessage_OpenGroupInvitation::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message _this->_internal_set_name(from._internal_name()); } } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void DataMessage_OpenGroupInvitation::CopyFrom(const DataMessage_OpenGroupInvitation& from) { @@ -6455,12 +6210,11 @@ void DataMessage_OpenGroupInvitation::InternalSwap(DataMessage_OpenGroupInvitati ); } -::PROTOBUF_NAMESPACE_ID::Metadata DataMessage_OpenGroupInvitation::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[13]); +std::string DataMessage_OpenGroupInvitation::GetTypeName() const { + return "SessionProtos.DataMessage.OpenGroupInvitation"; } + // =================================================================== class DataMessage::_Internal { @@ -6528,12 +6282,12 @@ DataMessage::_Internal::groupupdatemessage(const DataMessage* msg) { } DataMessage::DataMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.DataMessage) } DataMessage::DataMessage(const DataMessage& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { DataMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -6552,7 +6306,7 @@ DataMessage::DataMessage(const DataMessage& from) , decltype(_impl_.flags_){} , decltype(_impl_.blockscommunitymessagerequests_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.body_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.body_.Set("", GetArenaForAllocation()); @@ -6635,7 +6389,7 @@ inline void DataMessage::SharedCtor( DataMessage::~DataMessage() { // @@protoc_insertion_point(destructor:SessionProtos.DataMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -6706,7 +6460,7 @@ void DataMessage::Clear() { reinterpret_cast(&_impl_.timestamp_)) + sizeof(_impl_.blockscommunitymessagerequests_)); } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* DataMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -6722,9 +6476,6 @@ const char* DataMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* c auto str = _internal_mutable_body(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.body"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -6819,9 +6570,6 @@ const char* DataMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* c auto str = _internal_mutable_synctarget(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.DataMessage.syncTarget"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -6853,7 +6601,7 @@ const char* DataMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* c } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -6875,10 +6623,6 @@ uint8_t* DataMessage::_InternalSerialize( cached_has_bits = _impl_._has_bits_[0]; // optional string body = 1; if (cached_has_bits & 0x00000001u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_body().data(), static_cast(this->_internal_body().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.DataMessage.body"); target = stream->WriteStringMaybeAliased( 1, this->_internal_body(), target); } @@ -6947,10 +6691,6 @@ uint8_t* DataMessage::_InternalSerialize( // optional string syncTarget = 105; if (cached_has_bits & 0x00000004u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_synctarget().data(), static_cast(this->_internal_synctarget().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.DataMessage.syncTarget"); target = stream->WriteStringMaybeAliased( 105, this->_internal_synctarget(), target); } @@ -6969,8 +6709,8 @@ uint8_t* DataMessage::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage) return target; @@ -7074,19 +6814,22 @@ size_t DataMessage::ByteSizeLong() const { } } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DataMessage::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - DataMessage::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DataMessage::GetClassData() const { return &_class_data_; } - +void DataMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void DataMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void DataMessage::MergeFrom(const DataMessage& from) { + DataMessage* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.DataMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -7138,7 +6881,7 @@ void DataMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PR } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void DataMessage::CopyFrom(const DataMessage& from) { @@ -7196,12 +6939,11 @@ void DataMessage::InternalSwap(DataMessage* other) { reinterpret_cast(&other->_impl_.quote_)); } -::PROTOBUF_NAMESPACE_ID::Metadata DataMessage::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[14]); +std::string DataMessage::GetTypeName() const { + return "SessionProtos.DataMessage"; } + // =================================================================== class ReceiptMessage::_Internal { @@ -7217,12 +6959,12 @@ class ReceiptMessage::_Internal { ReceiptMessage::ReceiptMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.ReceiptMessage) } ReceiptMessage::ReceiptMessage(const ReceiptMessage& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { ReceiptMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -7230,7 +6972,7 @@ ReceiptMessage::ReceiptMessage(const ReceiptMessage& from) , decltype(_impl_.timestamp_){from._impl_.timestamp_} , decltype(_impl_.type_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _this->_impl_.type_ = from._impl_.type_; // @@protoc_insertion_point(copy_constructor:SessionProtos.ReceiptMessage) } @@ -7249,7 +6991,7 @@ inline void ReceiptMessage::SharedCtor( ReceiptMessage::~ReceiptMessage() { // @@protoc_insertion_point(destructor:SessionProtos.ReceiptMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -7274,7 +7016,7 @@ void ReceiptMessage::Clear() { _impl_.timestamp_.Clear(); _impl_.type_ = 0; _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* ReceiptMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -7324,7 +7066,7 @@ const char* ReceiptMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -7358,8 +7100,8 @@ uint8_t* ReceiptMessage::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ReceiptMessage) return target; @@ -7387,19 +7129,22 @@ size_t ReceiptMessage::ByteSizeLong() const { total_size += data_size; } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ReceiptMessage::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - ReceiptMessage::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ReceiptMessage::GetClassData() const { return &_class_data_; } - +void ReceiptMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void ReceiptMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void ReceiptMessage::MergeFrom(const ReceiptMessage& from) { + ReceiptMessage* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ReceiptMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -7409,7 +7154,7 @@ void ReceiptMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const : if (from._internal_has_type()) { _this->_internal_set_type(from._internal_type()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void ReceiptMessage::CopyFrom(const ReceiptMessage& from) { @@ -7432,12 +7177,11 @@ void ReceiptMessage::InternalSwap(ReceiptMessage* other) { swap(_impl_.type_, other->_impl_.type_); } -::PROTOBUF_NAMESPACE_ID::Metadata ReceiptMessage::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[15]); +std::string ReceiptMessage::GetTypeName() const { + return "SessionProtos.ReceiptMessage"; } + // =================================================================== class AttachmentPointer::_Internal { @@ -7486,12 +7230,12 @@ class AttachmentPointer::_Internal { AttachmentPointer::AttachmentPointer(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.AttachmentPointer) } AttachmentPointer::AttachmentPointer(const AttachmentPointer& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { AttachmentPointer* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -7509,7 +7253,7 @@ AttachmentPointer::AttachmentPointer(const AttachmentPointer& from) , decltype(_impl_.width_){} , decltype(_impl_.height_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.contenttype_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.contenttype_.Set("", GetArenaForAllocation()); @@ -7624,7 +7368,7 @@ inline void AttachmentPointer::SharedCtor( AttachmentPointer::~AttachmentPointer() { // @@protoc_insertion_point(destructor:SessionProtos.AttachmentPointer) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -7683,7 +7427,7 @@ void AttachmentPointer::Clear() { reinterpret_cast(&_impl_.size_)) + sizeof(_impl_.height_)); } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* AttachmentPointer::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -7708,9 +7452,6 @@ const char* AttachmentPointer::_InternalParse(const char* ptr, ::_pbi::ParseCont auto str = _internal_mutable_contenttype(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.AttachmentPointer.contentType"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -7756,9 +7497,6 @@ const char* AttachmentPointer::_InternalParse(const char* ptr, ::_pbi::ParseCont auto str = _internal_mutable_filename(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.AttachmentPointer.fileName"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -7795,9 +7533,6 @@ const char* AttachmentPointer::_InternalParse(const char* ptr, ::_pbi::ParseCont auto str = _internal_mutable_caption(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.AttachmentPointer.caption"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -7807,9 +7542,6 @@ const char* AttachmentPointer::_InternalParse(const char* ptr, ::_pbi::ParseCont auto str = _internal_mutable_url(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.AttachmentPointer.url"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -7824,7 +7556,7 @@ const char* AttachmentPointer::_InternalParse(const char* ptr, ::_pbi::ParseCont } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -7852,10 +7584,6 @@ uint8_t* AttachmentPointer::_InternalSerialize( // optional string contentType = 2; if (cached_has_bits & 0x00000001u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_contenttype().data(), static_cast(this->_internal_contenttype().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.AttachmentPointer.contentType"); target = stream->WriteStringMaybeAliased( 2, this->_internal_contenttype(), target); } @@ -7886,10 +7614,6 @@ uint8_t* AttachmentPointer::_InternalSerialize( // optional string fileName = 7; if (cached_has_bits & 0x00000010u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_filename().data(), static_cast(this->_internal_filename().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.AttachmentPointer.fileName"); target = stream->WriteStringMaybeAliased( 7, this->_internal_filename(), target); } @@ -7914,27 +7638,19 @@ uint8_t* AttachmentPointer::_InternalSerialize( // optional string caption = 11; if (cached_has_bits & 0x00000020u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_caption().data(), static_cast(this->_internal_caption().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.AttachmentPointer.caption"); target = stream->WriteStringMaybeAliased( 11, this->_internal_caption(), target); } // optional string url = 101; if (cached_has_bits & 0x00000040u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_url().data(), static_cast(this->_internal_url().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.AttachmentPointer.url"); target = stream->WriteStringMaybeAliased( 101, this->_internal_url(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.AttachmentPointer) return target; @@ -8026,19 +7742,22 @@ size_t AttachmentPointer::ByteSizeLong() const { } } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData AttachmentPointer::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - AttachmentPointer::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*AttachmentPointer::GetClassData() const { return &_class_data_; } - +void AttachmentPointer::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void AttachmentPointer::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void AttachmentPointer::MergeFrom(const AttachmentPointer& from) { + AttachmentPointer* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.AttachmentPointer) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -8087,7 +7806,7 @@ void AttachmentPointer::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, cons } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void AttachmentPointer::CopyFrom(const AttachmentPointer& from) { @@ -8144,12 +7863,11 @@ void AttachmentPointer::InternalSwap(AttachmentPointer* other) { reinterpret_cast(&other->_impl_.id_)); } -::PROTOBUF_NAMESPACE_ID::Metadata AttachmentPointer::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[16]); +std::string AttachmentPointer::GetTypeName() const { + return "SessionProtos.AttachmentPointer"; } + // =================================================================== class SharedConfigMessage::_Internal { @@ -8171,12 +7889,12 @@ class SharedConfigMessage::_Internal { SharedConfigMessage::SharedConfigMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.SharedConfigMessage) } SharedConfigMessage::SharedConfigMessage(const SharedConfigMessage& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { SharedConfigMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -8185,7 +7903,7 @@ SharedConfigMessage::SharedConfigMessage(const SharedConfigMessage& from) , decltype(_impl_.seqno_){} , decltype(_impl_.kind_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.data_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.data_.Set("", GetArenaForAllocation()); @@ -8219,7 +7937,7 @@ inline void SharedConfigMessage::SharedCtor( SharedConfigMessage::~SharedConfigMessage() { // @@protoc_insertion_point(destructor:SessionProtos.SharedConfigMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -8250,7 +7968,7 @@ void SharedConfigMessage::Clear() { _impl_.kind_ = 1; } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* SharedConfigMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -8302,7 +8020,7 @@ const char* SharedConfigMessage::_InternalParse(const char* ptr, ::_pbi::ParseCo } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -8342,8 +8060,8 @@ uint8_t* SharedConfigMessage::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.SharedConfigMessage) return target; @@ -8397,19 +8115,22 @@ size_t SharedConfigMessage::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SharedConfigMessage::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - SharedConfigMessage::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SharedConfigMessage::GetClassData() const { return &_class_data_; } - +void SharedConfigMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void SharedConfigMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void SharedConfigMessage::MergeFrom(const SharedConfigMessage& from) { + SharedConfigMessage* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.SharedConfigMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -8428,7 +8149,7 @@ void SharedConfigMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, co } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void SharedConfigMessage::CopyFrom(const SharedConfigMessage& from) { @@ -8457,12 +8178,11 @@ void SharedConfigMessage::InternalSwap(SharedConfigMessage* other) { swap(_impl_.kind_, other->_impl_.kind_); } -::PROTOBUF_NAMESPACE_ID::Metadata SharedConfigMessage::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[17]); +std::string SharedConfigMessage::GetTypeName() const { + return "SessionProtos.SharedConfigMessage"; } + // =================================================================== class GroupUpdateMessage::_Internal { @@ -8536,12 +8256,12 @@ GroupUpdateMessage::_Internal::memberleftnotificationmessage(const GroupUpdateMe } GroupUpdateMessage::GroupUpdateMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdateMessage) } GroupUpdateMessage::GroupUpdateMessage(const GroupUpdateMessage& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { GroupUpdateMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -8555,7 +8275,7 @@ GroupUpdateMessage::GroupUpdateMessage(const GroupUpdateMessage& from) , decltype(_impl_.deletemembercontent_){nullptr} , decltype(_impl_.memberleftnotificationmessage_){nullptr}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); if (from._internal_has_invitemessage()) { _this->_impl_.invitemessage_ = new ::SessionProtos::GroupUpdateInviteMessage(*from._impl_.invitemessage_); } @@ -8603,7 +8323,7 @@ inline void GroupUpdateMessage::SharedCtor( GroupUpdateMessage::~GroupUpdateMessage() { // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -8668,7 +8388,7 @@ void GroupUpdateMessage::Clear() { } } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* GroupUpdateMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -8753,7 +8473,7 @@ const char* GroupUpdateMessage::_InternalParse(const char* ptr, ::_pbi::ParseCon } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -8830,8 +8550,8 @@ uint8_t* GroupUpdateMessage::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateMessage) return target; @@ -8904,19 +8624,22 @@ size_t GroupUpdateMessage::ByteSizeLong() const { } } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GroupUpdateMessage::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - GroupUpdateMessage::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GroupUpdateMessage::GetClassData() const { return &_class_data_; } - +void GroupUpdateMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void GroupUpdateMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void GroupUpdateMessage::MergeFrom(const GroupUpdateMessage& from) { + GroupUpdateMessage* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.GroupUpdateMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -8957,7 +8680,7 @@ void GroupUpdateMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, con from._internal_memberleftnotificationmessage()); } } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void GroupUpdateMessage::CopyFrom(const GroupUpdateMessage& from) { @@ -8998,12 +8721,11 @@ void GroupUpdateMessage::InternalSwap(GroupUpdateMessage* other) { reinterpret_cast(&other->_impl_.invitemessage_)); } -::PROTOBUF_NAMESPACE_ID::Metadata GroupUpdateMessage::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[18]); +std::string GroupUpdateMessage::GetTypeName() const { + return "SessionProtos.GroupUpdateMessage"; } + // =================================================================== class GroupUpdateInviteMessage::_Internal { @@ -9028,12 +8750,12 @@ class GroupUpdateInviteMessage::_Internal { GroupUpdateInviteMessage::GroupUpdateInviteMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdateInviteMessage) } GroupUpdateInviteMessage::GroupUpdateInviteMessage(const GroupUpdateInviteMessage& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { GroupUpdateInviteMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -9043,7 +8765,7 @@ GroupUpdateInviteMessage::GroupUpdateInviteMessage(const GroupUpdateInviteMessag , decltype(_impl_.memberauthdata_){} , decltype(_impl_.adminsignature_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.groupsessionid_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.groupsessionid_.Set("", GetArenaForAllocation()); @@ -9111,7 +8833,7 @@ inline void GroupUpdateInviteMessage::SharedCtor( GroupUpdateInviteMessage::~GroupUpdateInviteMessage() { // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateInviteMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -9152,7 +8874,7 @@ void GroupUpdateInviteMessage::Clear() { } } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* GroupUpdateInviteMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -9168,9 +8890,6 @@ const char* GroupUpdateInviteMessage::_InternalParse(const char* ptr, ::_pbi::Pa auto str = _internal_mutable_groupsessionid(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.GroupUpdateInviteMessage.groupSessionId"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -9180,9 +8899,6 @@ const char* GroupUpdateInviteMessage::_InternalParse(const char* ptr, ::_pbi::Pa auto str = _internal_mutable_name(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.GroupUpdateInviteMessage.name"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -9215,7 +8931,7 @@ const char* GroupUpdateInviteMessage::_InternalParse(const char* ptr, ::_pbi::Pa } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -9237,20 +8953,12 @@ uint8_t* GroupUpdateInviteMessage::_InternalSerialize( cached_has_bits = _impl_._has_bits_[0]; // required string groupSessionId = 1; if (cached_has_bits & 0x00000001u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_groupsessionid().data(), static_cast(this->_internal_groupsessionid().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.GroupUpdateInviteMessage.groupSessionId"); target = stream->WriteStringMaybeAliased( 1, this->_internal_groupsessionid(), target); } // required string name = 2; if (cached_has_bits & 0x00000002u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_name().data(), static_cast(this->_internal_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.GroupUpdateInviteMessage.name"); target = stream->WriteStringMaybeAliased( 2, this->_internal_name(), target); } @@ -9268,8 +8976,8 @@ uint8_t* GroupUpdateInviteMessage::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateInviteMessage) return target; @@ -9341,19 +9049,22 @@ size_t GroupUpdateInviteMessage::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GroupUpdateInviteMessage::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - GroupUpdateInviteMessage::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GroupUpdateInviteMessage::GetClassData() const { return &_class_data_; } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} +void GroupUpdateInviteMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void GroupUpdateInviteMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void GroupUpdateInviteMessage::MergeFrom(const GroupUpdateInviteMessage& from) { + GroupUpdateInviteMessage* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.GroupUpdateInviteMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -9374,7 +9085,7 @@ void GroupUpdateInviteMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_ms _this->_internal_set_adminsignature(from._internal_adminsignature()); } } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void GroupUpdateInviteMessage::CopyFrom(const GroupUpdateInviteMessage& from) { @@ -9413,12 +9124,11 @@ void GroupUpdateInviteMessage::InternalSwap(GroupUpdateInviteMessage* other) { ); } -::PROTOBUF_NAMESPACE_ID::Metadata GroupUpdateInviteMessage::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[19]); +std::string GroupUpdateInviteMessage::GetTypeName() const { + return "SessionProtos.GroupUpdateInviteMessage"; } + // =================================================================== class GroupUpdatePromoteMessage::_Internal { @@ -9437,12 +9147,12 @@ class GroupUpdatePromoteMessage::_Internal { GroupUpdatePromoteMessage::GroupUpdatePromoteMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdatePromoteMessage) } GroupUpdatePromoteMessage::GroupUpdatePromoteMessage(const GroupUpdatePromoteMessage& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { GroupUpdatePromoteMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -9450,7 +9160,7 @@ GroupUpdatePromoteMessage::GroupUpdatePromoteMessage(const GroupUpdatePromoteMes , decltype(_impl_.groupidentityseed_){} , decltype(_impl_.name_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.groupidentityseed_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.groupidentityseed_.Set("", GetArenaForAllocation()); @@ -9492,7 +9202,7 @@ inline void GroupUpdatePromoteMessage::SharedCtor( GroupUpdatePromoteMessage::~GroupUpdatePromoteMessage() { // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdatePromoteMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -9525,7 +9235,7 @@ void GroupUpdatePromoteMessage::Clear() { } } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* GroupUpdatePromoteMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -9550,9 +9260,6 @@ const char* GroupUpdatePromoteMessage::_InternalParse(const char* ptr, ::_pbi::P auto str = _internal_mutable_name(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.GroupUpdatePromoteMessage.name"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -9567,7 +9274,7 @@ const char* GroupUpdatePromoteMessage::_InternalParse(const char* ptr, ::_pbi::P } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -9595,17 +9302,13 @@ uint8_t* GroupUpdatePromoteMessage::_InternalSerialize( // required string name = 2; if (cached_has_bits & 0x00000002u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_name().data(), static_cast(this->_internal_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.GroupUpdatePromoteMessage.name"); target = stream->WriteStringMaybeAliased( 2, this->_internal_name(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdatePromoteMessage) return target; @@ -9653,19 +9356,22 @@ size_t GroupUpdatePromoteMessage::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GroupUpdatePromoteMessage::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - GroupUpdatePromoteMessage::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GroupUpdatePromoteMessage::GetClassData() const { return &_class_data_; } - +void GroupUpdatePromoteMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void GroupUpdatePromoteMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void GroupUpdatePromoteMessage::MergeFrom(const GroupUpdatePromoteMessage& from) { + GroupUpdatePromoteMessage* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.GroupUpdatePromoteMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -9680,7 +9386,7 @@ void GroupUpdatePromoteMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_m _this->_internal_set_name(from._internal_name()); } } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void GroupUpdatePromoteMessage::CopyFrom(const GroupUpdatePromoteMessage& from) { @@ -9711,12 +9417,11 @@ void GroupUpdatePromoteMessage::InternalSwap(GroupUpdatePromoteMessage* other) { ); } -::PROTOBUF_NAMESPACE_ID::Metadata GroupUpdatePromoteMessage::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[20]); +std::string GroupUpdatePromoteMessage::GetTypeName() const { + return "SessionProtos.GroupUpdatePromoteMessage"; } + // =================================================================== class GroupUpdateInfoChangeMessage::_Internal { @@ -9741,12 +9446,12 @@ class GroupUpdateInfoChangeMessage::_Internal { GroupUpdateInfoChangeMessage::GroupUpdateInfoChangeMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdateInfoChangeMessage) } GroupUpdateInfoChangeMessage::GroupUpdateInfoChangeMessage(const GroupUpdateInfoChangeMessage& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { GroupUpdateInfoChangeMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -9756,7 +9461,7 @@ GroupUpdateInfoChangeMessage::GroupUpdateInfoChangeMessage(const GroupUpdateInfo , decltype(_impl_.updatedexpiration_){} , decltype(_impl_.type_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.updatedname_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.updatedname_.Set("", GetArenaForAllocation()); @@ -9803,7 +9508,7 @@ inline void GroupUpdateInfoChangeMessage::SharedCtor( GroupUpdateInfoChangeMessage::~GroupUpdateInfoChangeMessage() { // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateInfoChangeMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -9840,7 +9545,7 @@ void GroupUpdateInfoChangeMessage::Clear() { _impl_.type_ = 1; } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* GroupUpdateInfoChangeMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -9869,9 +9574,6 @@ const char* GroupUpdateInfoChangeMessage::_InternalParse(const char* ptr, ::_pbi auto str = _internal_mutable_updatedname(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.GroupUpdateInfoChangeMessage.updatedName"); - #endif // !NDEBUG } else goto handle_unusual; continue; @@ -9904,7 +9606,7 @@ const char* GroupUpdateInfoChangeMessage::_InternalParse(const char* ptr, ::_pbi } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -9933,10 +9635,6 @@ uint8_t* GroupUpdateInfoChangeMessage::_InternalSerialize( // optional string updatedName = 2; if (cached_has_bits & 0x00000001u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_updatedname().data(), static_cast(this->_internal_updatedname().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.GroupUpdateInfoChangeMessage.updatedName"); target = stream->WriteStringMaybeAliased( 2, this->_internal_updatedname(), target); } @@ -9954,8 +9652,8 @@ uint8_t* GroupUpdateInfoChangeMessage::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateInfoChangeMessage) return target; @@ -10014,19 +9712,22 @@ size_t GroupUpdateInfoChangeMessage::ByteSizeLong() const { total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_updatedexpiration()); } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GroupUpdateInfoChangeMessage::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - GroupUpdateInfoChangeMessage::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GroupUpdateInfoChangeMessage::GetClassData() const { return &_class_data_; } - +void GroupUpdateInfoChangeMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void GroupUpdateInfoChangeMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void GroupUpdateInfoChangeMessage::MergeFrom(const GroupUpdateInfoChangeMessage& from) { + GroupUpdateInfoChangeMessage* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.GroupUpdateInfoChangeMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -10048,7 +9749,7 @@ void GroupUpdateInfoChangeMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& t } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void GroupUpdateInfoChangeMessage::CopyFrom(const GroupUpdateInfoChangeMessage& from) { @@ -10081,12 +9782,11 @@ void GroupUpdateInfoChangeMessage::InternalSwap(GroupUpdateInfoChangeMessage* ot swap(_impl_.type_, other->_impl_.type_); } -::PROTOBUF_NAMESPACE_ID::Metadata GroupUpdateInfoChangeMessage::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[21]); +std::string GroupUpdateInfoChangeMessage::GetTypeName() const { + return "SessionProtos.GroupUpdateInfoChangeMessage"; } + // =================================================================== class GroupUpdateMemberChangeMessage::_Internal { @@ -10108,12 +9808,12 @@ class GroupUpdateMemberChangeMessage::_Internal { GroupUpdateMemberChangeMessage::GroupUpdateMemberChangeMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdateMemberChangeMessage) } GroupUpdateMemberChangeMessage::GroupUpdateMemberChangeMessage(const GroupUpdateMemberChangeMessage& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { GroupUpdateMemberChangeMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -10123,7 +9823,7 @@ GroupUpdateMemberChangeMessage::GroupUpdateMemberChangeMessage(const GroupUpdate , decltype(_impl_.historyshared_){} , decltype(_impl_.type_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.adminsignature_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.adminsignature_.Set("", GetArenaForAllocation()); @@ -10158,7 +9858,7 @@ inline void GroupUpdateMemberChangeMessage::SharedCtor( GroupUpdateMemberChangeMessage::~GroupUpdateMemberChangeMessage() { // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateMemberChangeMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -10191,7 +9891,7 @@ void GroupUpdateMemberChangeMessage::Clear() { _impl_.type_ = 1; } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* GroupUpdateMemberChangeMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -10223,9 +9923,6 @@ const char* GroupUpdateMemberChangeMessage::_InternalParse(const char* ptr, ::_p auto str = _internal_add_membersessionids(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds"); - #endif // !NDEBUG if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); } else @@ -10260,7 +9957,7 @@ const char* GroupUpdateMemberChangeMessage::_InternalParse(const char* ptr, ::_p } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -10290,10 +9987,6 @@ uint8_t* GroupUpdateMemberChangeMessage::_InternalSerialize( // repeated string memberSessionIds = 2; for (int i = 0, n = this->_internal_membersessionids_size(); i < n; i++) { const auto& s = this->_internal_membersessionids(i); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - s.data(), static_cast(s.length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds"); target = stream->WriteString(2, s, target); } @@ -10310,8 +10003,8 @@ uint8_t* GroupUpdateMemberChangeMessage::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateMemberChangeMessage) return target; @@ -10371,19 +10064,22 @@ size_t GroupUpdateMemberChangeMessage::ByteSizeLong() const { total_size += 1 + 1; } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GroupUpdateMemberChangeMessage::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - GroupUpdateMemberChangeMessage::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GroupUpdateMemberChangeMessage::GetClassData() const { return &_class_data_; } - +void GroupUpdateMemberChangeMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void GroupUpdateMemberChangeMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void GroupUpdateMemberChangeMessage::MergeFrom(const GroupUpdateMemberChangeMessage& from) { + GroupUpdateMemberChangeMessage* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.GroupUpdateMemberChangeMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -10403,7 +10099,7 @@ void GroupUpdateMemberChangeMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void GroupUpdateMemberChangeMessage::CopyFrom(const GroupUpdateMemberChangeMessage& from) { @@ -10433,12 +10129,11 @@ void GroupUpdateMemberChangeMessage::InternalSwap(GroupUpdateMemberChangeMessage swap(_impl_.type_, other->_impl_.type_); } -::PROTOBUF_NAMESPACE_ID::Metadata GroupUpdateMemberChangeMessage::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[22]); +std::string GroupUpdateMemberChangeMessage::GetTypeName() const { + return "SessionProtos.GroupUpdateMemberChangeMessage"; } + // =================================================================== class GroupUpdateMemberLeftMessage::_Internal { @@ -10447,38 +10142,146 @@ class GroupUpdateMemberLeftMessage::_Internal { GroupUpdateMemberLeftMessage::GroupUpdateMemberLeftMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdateMemberLeftMessage) } GroupUpdateMemberLeftMessage::GroupUpdateMemberLeftMessage(const GroupUpdateMemberLeftMessage& from) - : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { GroupUpdateMemberLeftMessage* const _this = this; (void)_this; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + new (&_impl_) Impl_{ + /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom(from._internal_metadata_); // @@protoc_insertion_point(copy_constructor:SessionProtos.GroupUpdateMemberLeftMessage) } +inline void GroupUpdateMemberLeftMessage::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + /*decltype(_impl_._cached_size_)*/{} + }; +} + +GroupUpdateMemberLeftMessage::~GroupUpdateMemberLeftMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateMemberLeftMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void GroupUpdateMemberLeftMessage::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} +void GroupUpdateMemberLeftMessage::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} +void GroupUpdateMemberLeftMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.GroupUpdateMemberLeftMessage) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + _internal_metadata_.Clear(); +} -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GroupUpdateMemberLeftMessage::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl, - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl, -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GroupUpdateMemberLeftMessage::GetClassData() const { return &_class_data_; } +const char* GroupUpdateMemberLeftMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} +uint8_t* GroupUpdateMemberLeftMessage::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.GroupUpdateMemberLeftMessage) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateMemberLeftMessage) + return target; +} + +size_t GroupUpdateMemberLeftMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.GroupUpdateMemberLeftMessage) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GroupUpdateMemberLeftMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} +void GroupUpdateMemberLeftMessage::MergeFrom(const GroupUpdateMemberLeftMessage& from) { + GroupUpdateMemberLeftMessage* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.GroupUpdateMemberLeftMessage) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); +} +void GroupUpdateMemberLeftMessage::CopyFrom(const GroupUpdateMemberLeftMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.GroupUpdateMemberLeftMessage) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GroupUpdateMemberLeftMessage::IsInitialized() const { + return true; +} +void GroupUpdateMemberLeftMessage::InternalSwap(GroupUpdateMemberLeftMessage* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); +} -::PROTOBUF_NAMESPACE_ID::Metadata GroupUpdateMemberLeftMessage::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[23]); +std::string GroupUpdateMemberLeftMessage::GetTypeName() const { + return "SessionProtos.GroupUpdateMemberLeftMessage"; } + // =================================================================== class GroupUpdateMemberLeftNotificationMessage::_Internal { @@ -10487,38 +10290,146 @@ class GroupUpdateMemberLeftNotificationMessage::_Internal { GroupUpdateMemberLeftNotificationMessage::GroupUpdateMemberLeftNotificationMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdateMemberLeftNotificationMessage) } GroupUpdateMemberLeftNotificationMessage::GroupUpdateMemberLeftNotificationMessage(const GroupUpdateMemberLeftNotificationMessage& from) - : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { GroupUpdateMemberLeftNotificationMessage* const _this = this; (void)_this; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + new (&_impl_) Impl_{ + /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom(from._internal_metadata_); // @@protoc_insertion_point(copy_constructor:SessionProtos.GroupUpdateMemberLeftNotificationMessage) } +inline void GroupUpdateMemberLeftNotificationMessage::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + /*decltype(_impl_._cached_size_)*/{} + }; +} +GroupUpdateMemberLeftNotificationMessage::~GroupUpdateMemberLeftNotificationMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateMemberLeftNotificationMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { + (void)arena; + return; + } + SharedDtor(); +} +inline void GroupUpdateMemberLeftNotificationMessage::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} +void GroupUpdateMemberLeftNotificationMessage::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GroupUpdateMemberLeftNotificationMessage::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl, - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl, -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GroupUpdateMemberLeftNotificationMessage::GetClassData() const { return &_class_data_; } +void GroupUpdateMemberLeftNotificationMessage::Clear() { +// @@protoc_insertion_point(message_clear_start:SessionProtos.GroupUpdateMemberLeftNotificationMessage) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _internal_metadata_.Clear(); +} + +const char* GroupUpdateMemberLeftNotificationMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* GroupUpdateMemberLeftNotificationMessage::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.GroupUpdateMemberLeftNotificationMessage) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateMemberLeftNotificationMessage) + return target; +} +size_t GroupUpdateMemberLeftNotificationMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.GroupUpdateMemberLeftNotificationMessage) + size_t total_size = 0; + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} +void GroupUpdateMemberLeftNotificationMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} +void GroupUpdateMemberLeftNotificationMessage::MergeFrom(const GroupUpdateMemberLeftNotificationMessage& from) { + GroupUpdateMemberLeftNotificationMessage* const _this = this; + // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.GroupUpdateMemberLeftNotificationMessage) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); +} -::PROTOBUF_NAMESPACE_ID::Metadata GroupUpdateMemberLeftNotificationMessage::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[24]); +void GroupUpdateMemberLeftNotificationMessage::CopyFrom(const GroupUpdateMemberLeftNotificationMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.GroupUpdateMemberLeftNotificationMessage) + if (&from == this) return; + Clear(); + MergeFrom(from); } +bool GroupUpdateMemberLeftNotificationMessage::IsInitialized() const { + return true; +} + +void GroupUpdateMemberLeftNotificationMessage::InternalSwap(GroupUpdateMemberLeftNotificationMessage* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); +} + +std::string GroupUpdateMemberLeftNotificationMessage::GetTypeName() const { + return "SessionProtos.GroupUpdateMemberLeftNotificationMessage"; +} + + // =================================================================== class GroupUpdateInviteResponseMessage::_Internal { @@ -10534,19 +10445,19 @@ class GroupUpdateInviteResponseMessage::_Internal { GroupUpdateInviteResponseMessage::GroupUpdateInviteResponseMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdateInviteResponseMessage) } GroupUpdateInviteResponseMessage::GroupUpdateInviteResponseMessage(const GroupUpdateInviteResponseMessage& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { GroupUpdateInviteResponseMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} , decltype(_impl_.isapproved_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _this->_impl_.isapproved_ = from._impl_.isapproved_; // @@protoc_insertion_point(copy_constructor:SessionProtos.GroupUpdateInviteResponseMessage) } @@ -10564,7 +10475,7 @@ inline void GroupUpdateInviteResponseMessage::SharedCtor( GroupUpdateInviteResponseMessage::~GroupUpdateInviteResponseMessage() { // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateInviteResponseMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -10587,7 +10498,7 @@ void GroupUpdateInviteResponseMessage::Clear() { _impl_.isapproved_ = false; _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* GroupUpdateInviteResponseMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -10617,7 +10528,7 @@ const char* GroupUpdateInviteResponseMessage::_InternalParse(const char* ptr, :: } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -10644,8 +10555,8 @@ uint8_t* GroupUpdateInviteResponseMessage::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateInviteResponseMessage) return target; @@ -10663,19 +10574,22 @@ size_t GroupUpdateInviteResponseMessage::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GroupUpdateInviteResponseMessage::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - GroupUpdateInviteResponseMessage::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GroupUpdateInviteResponseMessage::GetClassData() const { return &_class_data_; } - +void GroupUpdateInviteResponseMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void GroupUpdateInviteResponseMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void GroupUpdateInviteResponseMessage::MergeFrom(const GroupUpdateInviteResponseMessage& from) { + GroupUpdateInviteResponseMessage* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.GroupUpdateInviteResponseMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -10684,7 +10598,7 @@ void GroupUpdateInviteResponseMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Messag if (from._internal_has_isapproved()) { _this->_internal_set_isapproved(from._internal_isapproved()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void GroupUpdateInviteResponseMessage::CopyFrom(const GroupUpdateInviteResponseMessage& from) { @@ -10706,12 +10620,11 @@ void GroupUpdateInviteResponseMessage::InternalSwap(GroupUpdateInviteResponseMes swap(_impl_.isapproved_, other->_impl_.isapproved_); } -::PROTOBUF_NAMESPACE_ID::Metadata GroupUpdateInviteResponseMessage::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[25]); +std::string GroupUpdateInviteResponseMessage::GetTypeName() const { + return "SessionProtos.GroupUpdateInviteResponseMessage"; } + // =================================================================== class GroupUpdateDeleteMemberContentMessage::_Internal { @@ -10724,12 +10637,12 @@ class GroupUpdateDeleteMemberContentMessage::_Internal { GroupUpdateDeleteMemberContentMessage::GroupUpdateDeleteMemberContentMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdateDeleteMemberContentMessage) } GroupUpdateDeleteMemberContentMessage::GroupUpdateDeleteMemberContentMessage(const GroupUpdateDeleteMemberContentMessage& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { GroupUpdateDeleteMemberContentMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -10738,7 +10651,7 @@ GroupUpdateDeleteMemberContentMessage::GroupUpdateDeleteMemberContentMessage(con , decltype(_impl_.messagehashes_){from._impl_.messagehashes_} , decltype(_impl_.adminsignature_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.adminsignature_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.adminsignature_.Set("", GetArenaForAllocation()); @@ -10769,7 +10682,7 @@ inline void GroupUpdateDeleteMemberContentMessage::SharedCtor( GroupUpdateDeleteMemberContentMessage::~GroupUpdateDeleteMemberContentMessage() { // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateDeleteMemberContentMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -10800,7 +10713,7 @@ void GroupUpdateDeleteMemberContentMessage::Clear() { _impl_.adminsignature_.ClearNonDefaultToEmpty(); } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* GroupUpdateDeleteMemberContentMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -10819,9 +10732,6 @@ const char* GroupUpdateDeleteMemberContentMessage::_InternalParse(const char* pt auto str = _internal_add_membersessionids(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds"); - #endif // !NDEBUG if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); } else @@ -10836,9 +10746,6 @@ const char* GroupUpdateDeleteMemberContentMessage::_InternalParse(const char* pt auto str = _internal_add_messagehashes(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); - #ifndef NDEBUG - ::_pbi::VerifyUTF8(str, "SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes"); - #endif // !NDEBUG if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); } else @@ -10864,7 +10771,7 @@ const char* GroupUpdateDeleteMemberContentMessage::_InternalParse(const char* pt } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -10886,20 +10793,12 @@ uint8_t* GroupUpdateDeleteMemberContentMessage::_InternalSerialize( // repeated string memberSessionIds = 1; for (int i = 0, n = this->_internal_membersessionids_size(); i < n; i++) { const auto& s = this->_internal_membersessionids(i); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - s.data(), static_cast(s.length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds"); target = stream->WriteString(1, s, target); } // repeated string messageHashes = 2; for (int i = 0, n = this->_internal_messagehashes_size(); i < n; i++) { const auto& s = this->_internal_messagehashes(i); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - s.data(), static_cast(s.length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes"); target = stream->WriteString(2, s, target); } @@ -10911,8 +10810,8 @@ uint8_t* GroupUpdateDeleteMemberContentMessage::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateDeleteMemberContentMessage) return target; @@ -10950,19 +10849,22 @@ size_t GroupUpdateDeleteMemberContentMessage::ByteSizeLong() const { this->_internal_adminsignature()); } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GroupUpdateDeleteMemberContentMessage::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - GroupUpdateDeleteMemberContentMessage::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GroupUpdateDeleteMemberContentMessage::GetClassData() const { return &_class_data_; } - +void GroupUpdateDeleteMemberContentMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void GroupUpdateDeleteMemberContentMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void GroupUpdateDeleteMemberContentMessage::MergeFrom(const GroupUpdateDeleteMemberContentMessage& from) { + GroupUpdateDeleteMemberContentMessage* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.GroupUpdateDeleteMemberContentMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -10973,7 +10875,7 @@ void GroupUpdateDeleteMemberContentMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::M if (from._internal_has_adminsignature()) { _this->_internal_set_adminsignature(from._internal_adminsignature()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void GroupUpdateDeleteMemberContentMessage::CopyFrom(const GroupUpdateDeleteMemberContentMessage& from) { @@ -11001,12 +10903,11 @@ void GroupUpdateDeleteMemberContentMessage::InternalSwap(GroupUpdateDeleteMember ); } -::PROTOBUF_NAMESPACE_ID::Metadata GroupUpdateDeleteMemberContentMessage::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[26]); +std::string GroupUpdateDeleteMemberContentMessage::GetTypeName() const { + return "SessionProtos.GroupUpdateDeleteMemberContentMessage"; } + // =================================================================== class ProProof::_Internal { @@ -11034,12 +10935,12 @@ class ProProof::_Internal { ProProof::ProProof(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.ProProof) } ProProof::ProProof(const ProProof& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { ProProof* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -11050,7 +10951,7 @@ ProProof::ProProof(const ProProof& from) , decltype(_impl_.expiryunixts_){} , decltype(_impl_.version_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.genindexhash_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.genindexhash_.Set("", GetArenaForAllocation()); @@ -11110,7 +11011,7 @@ inline void ProProof::SharedCtor( ProProof::~ProProof() { // @@protoc_insertion_point(destructor:SessionProtos.ProProof) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -11152,7 +11053,7 @@ void ProProof::Clear() { reinterpret_cast(&_impl_.expiryunixts_)) + sizeof(_impl_.version_)); } _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* ProProof::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -11218,7 +11119,7 @@ const char* ProProof::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -11269,8 +11170,8 @@ uint8_t* ProProof::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ProProof) return target; @@ -11346,19 +11247,22 @@ size_t ProProof::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ProProof::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - ProProof::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ProProof::GetClassData() const { return &_class_data_; } - +void ProProof::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void ProProof::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void ProProof::MergeFrom(const ProProof& from) { + ProProof* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ProProof) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -11383,7 +11287,7 @@ void ProProof::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTO } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void ProProof::CopyFrom(const ProProof& from) { @@ -11424,300 +11328,10 @@ void ProProof::InternalSwap(ProProof* other) { reinterpret_cast(&other->_impl_.expiryunixts_)); } -::PROTOBUF_NAMESPACE_ID::Metadata ProProof::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[27]); -} - -// =================================================================== - -class ProConfig::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_rotatingprivkey(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } - static const ::SessionProtos::ProProof& proof(const ProConfig* msg); - static void set_has_proof(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } - static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; - } -}; - -const ::SessionProtos::ProProof& -ProConfig::_Internal::proof(const ProConfig* msg) { - return *msg->_impl_.proof_; -} -ProConfig::ProConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.ProConfig) -} -ProConfig::ProConfig(const ProConfig& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - ProConfig* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_._has_bits_){from._impl_._has_bits_} - , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.rotatingprivkey_){} - , decltype(_impl_.proof_){nullptr}}; - - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - _impl_.rotatingprivkey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_rotatingprivkey()) { - _this->_impl_.rotatingprivkey_.Set(from._internal_rotatingprivkey(), - _this->GetArenaForAllocation()); - } - if (from._internal_has_proof()) { - _this->_impl_.proof_ = new ::SessionProtos::ProProof(*from._impl_.proof_); - } - // @@protoc_insertion_point(copy_constructor:SessionProtos.ProConfig) -} - -inline void ProConfig::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_._has_bits_){} - , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.rotatingprivkey_){} - , decltype(_impl_.proof_){nullptr} - }; - _impl_.rotatingprivkey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -} - -ProConfig::~ProConfig() { - // @@protoc_insertion_point(destructor:SessionProtos.ProConfig) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } - SharedDtor(); -} - -inline void ProConfig::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.rotatingprivkey_.Destroy(); - if (this != internal_default_instance()) delete _impl_.proof_; -} - -void ProConfig::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} - -void ProConfig::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.ProConfig) - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - if (cached_has_bits & 0x00000001u) { - _impl_.rotatingprivkey_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(_impl_.proof_ != nullptr); - _impl_.proof_->Clear(); - } - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* ProConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - _Internal::HasBits has_bits{}; - while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); - switch (tag >> 3) { - // required bytes rotatingPrivKey = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_rotatingprivkey(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // required .SessionProtos.ProProof proof = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - ptr = ctx->ParseMessage(_internal_mutable_proof(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - default: - goto handle_unusual; - } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - } // while -message_done: - _impl_._has_bits_.Or(has_bits); - return ptr; -failure: - ptr = nullptr; - goto message_done; -#undef CHK_ -} - -uint8_t* ProConfig::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ProConfig) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // required bytes rotatingPrivKey = 1; - if (cached_has_bits & 0x00000001u) { - target = stream->WriteBytesMaybeAliased( - 1, this->_internal_rotatingprivkey(), target); - } - - // required .SessionProtos.ProProof proof = 2; - if (cached_has_bits & 0x00000002u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::proof(this), - _Internal::proof(this).GetCachedSize(), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ProConfig) - return target; -} - -size_t ProConfig::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.ProConfig) - size_t total_size = 0; - - if (_internal_has_rotatingprivkey()) { - // required bytes rotatingPrivKey = 1; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_rotatingprivkey()); - } - - if (_internal_has_proof()) { - // required .SessionProtos.ProProof proof = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.proof_); - } - - return total_size; -} -size_t ProConfig::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ProConfig) - size_t total_size = 0; - - if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. - // required bytes rotatingPrivKey = 1; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_rotatingprivkey()); - - // required .SessionProtos.ProProof proof = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.proof_); - - } else { - total_size += RequiredFieldsByteSizeFallback(); - } - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +std::string ProProof::GetTypeName() const { + return "SessionProtos.ProProof"; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ProConfig::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - ProConfig::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ProConfig::GetClassData() const { return &_class_data_; } - - -void ProConfig::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ProConfig) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - if (cached_has_bits & 0x00000001u) { - _this->_internal_set_rotatingprivkey(from._internal_rotatingprivkey()); - } - if (cached_has_bits & 0x00000002u) { - _this->_internal_mutable_proof()->::SessionProtos::ProProof::MergeFrom( - from._internal_proof()); - } - } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void ProConfig::CopyFrom(const ProConfig& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ProConfig) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool ProConfig::IsInitialized() const { - if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; - if (_internal_has_proof()) { - if (!_impl_.proof_->IsInitialized()) return false; - } - return true; -} - -void ProConfig::InternalSwap(ProConfig* other) { - using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.rotatingprivkey_, lhs_arena, - &other->_impl_.rotatingprivkey_, rhs_arena - ); - swap(_impl_.proof_, other->_impl_.proof_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata ProConfig::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[28]); -} // =================================================================== @@ -11742,12 +11356,12 @@ ProMessage::_Internal::proof(const ProMessage* msg) { } ProMessage::ProMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:SessionProtos.ProMessage) } ProMessage::ProMessage(const ProMessage& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { ProMessage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} @@ -11755,7 +11369,7 @@ ProMessage::ProMessage(const ProMessage& from) , decltype(_impl_.proof_){nullptr} , decltype(_impl_.flags_){}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _internal_metadata_.MergeFrom(from._internal_metadata_); if (from._internal_has_proof()) { _this->_impl_.proof_ = new ::SessionProtos::ProProof(*from._impl_.proof_); } @@ -11777,7 +11391,7 @@ inline void ProMessage::SharedCtor( ProMessage::~ProMessage() { // @@protoc_insertion_point(destructor:SessionProtos.ProMessage) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } @@ -11806,7 +11420,7 @@ void ProMessage::Clear() { } _impl_.flags_ = 0u; _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + _internal_metadata_.Clear(); } const char* ProMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { @@ -11844,7 +11458,7 @@ const char* ProMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ct } ptr = UnknownFieldParse( tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + _internal_metadata_.mutable_unknown_fields(), ptr, ctx); CHK_(ptr != nullptr); } // while @@ -11878,8 +11492,8 @@ uint8_t* ProMessage::_InternalSerialize( } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), + static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ProMessage) return target; @@ -11923,19 +11537,22 @@ size_t ProMessage::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); + } + int cached_size = ::_pbi::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ProMessage::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - ProMessage::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ProMessage::GetClassData() const { return &_class_data_; } - +void ProMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} -void ProMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); +void ProMessage::MergeFrom(const ProMessage& from) { + ProMessage* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ProMessage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; @@ -11952,7 +11569,7 @@ void ProMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PRO } _this->_impl_._has_bits_[0] |= cached_has_bits; } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void ProMessage::CopyFrom(const ProMessage& from) { @@ -11982,12 +11599,11 @@ void ProMessage::InternalSwap(ProMessage* other) { reinterpret_cast(&other->_impl_.proof_)); } -::PROTOBUF_NAMESPACE_ID::Metadata ProMessage::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_SessionProtos_2eproto_getter, &descriptor_table_SessionProtos_2eproto_once, - file_level_metadata_SessionProtos_2eproto[29]); +std::string ProMessage::GetTypeName() const { + return "SessionProtos.ProMessage"; } + // @@protoc_insertion_point(namespace_scope) } // namespace SessionProtos PROTOBUF_NAMESPACE_OPEN @@ -12103,10 +11719,6 @@ template<> PROTOBUF_NOINLINE ::SessionProtos::ProProof* Arena::CreateMaybeMessage< ::SessionProtos::ProProof >(Arena* arena) { return Arena::CreateMessageInternal< ::SessionProtos::ProProof >(arena); } -template<> PROTOBUF_NOINLINE ::SessionProtos::ProConfig* -Arena::CreateMaybeMessage< ::SessionProtos::ProConfig >(Arena* arena) { - return Arena::CreateMessageInternal< ::SessionProtos::ProConfig >(arena); -} template<> PROTOBUF_NOINLINE ::SessionProtos::ProMessage* Arena::CreateMaybeMessage< ::SessionProtos::ProMessage >(Arena* arena) { return Arena::CreateMessageInternal< ::SessionProtos::ProMessage >(arena); diff --git a/proto/SessionProtos.pb.h b/proto/SessionProtos.pb.h index c73bb3d0..10c96518 100644 --- a/proto/SessionProtos.pb.h +++ b/proto/SessionProtos.pb.h @@ -23,15 +23,12 @@ #include #include #include -#include #include #include -#include -#include +#include #include // IWYU pragma: export #include // IWYU pragma: export -#include -#include +#include // @@protoc_insertion_point(includes) #include #define PROTOBUF_INTERNAL_EXPORT_SessionProtos_2eproto @@ -45,7 +42,6 @@ PROTOBUF_NAMESPACE_CLOSE struct TableStruct_SessionProtos_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_SessionProtos_2eproto; namespace SessionProtos { class AttachmentPointer; struct AttachmentPointerDefaultTypeInternal; @@ -116,9 +112,6 @@ extern LokiProfileDefaultTypeInternal _LokiProfile_default_instance_; class MessageRequestResponse; struct MessageRequestResponseDefaultTypeInternal; extern MessageRequestResponseDefaultTypeInternal _MessageRequestResponse_default_instance_; -class ProConfig; -struct ProConfigDefaultTypeInternal; -extern ProConfigDefaultTypeInternal _ProConfig_default_instance_; class ProMessage; struct ProMessageDefaultTypeInternal; extern ProMessageDefaultTypeInternal _ProMessage_default_instance_; @@ -162,7 +155,6 @@ template<> ::SessionProtos::GroupUpdatePromoteMessage* Arena::CreateMaybeMessage template<> ::SessionProtos::KeyPair* Arena::CreateMaybeMessage<::SessionProtos::KeyPair>(Arena*); template<> ::SessionProtos::LokiProfile* Arena::CreateMaybeMessage<::SessionProtos::LokiProfile>(Arena*); template<> ::SessionProtos::MessageRequestResponse* Arena::CreateMaybeMessage<::SessionProtos::MessageRequestResponse>(Arena*); -template<> ::SessionProtos::ProConfig* Arena::CreateMaybeMessage<::SessionProtos::ProConfig>(Arena*); template<> ::SessionProtos::ProMessage* Arena::CreateMaybeMessage<::SessionProtos::ProMessage>(Arena*); template<> ::SessionProtos::ProProof* Arena::CreateMaybeMessage<::SessionProtos::ProProof>(Arena*); template<> ::SessionProtos::ReceiptMessage* Arena::CreateMaybeMessage<::SessionProtos::ReceiptMessage>(Arena*); @@ -181,20 +173,16 @@ constexpr Envelope_Type Envelope_Type_Type_MIN = Envelope_Type_SESSION_MESSAGE; constexpr Envelope_Type Envelope_Type_Type_MAX = Envelope_Type_CLOSED_GROUP_MESSAGE; constexpr int Envelope_Type_Type_ARRAYSIZE = Envelope_Type_Type_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Envelope_Type_descriptor(); +const std::string& Envelope_Type_Name(Envelope_Type value); template inline const std::string& Envelope_Type_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function Envelope_Type_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - Envelope_Type_descriptor(), enum_t_value); -} -inline bool Envelope_Type_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Envelope_Type* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - Envelope_Type_descriptor(), name, value); + return Envelope_Type_Name(static_cast(enum_t_value)); } +bool Envelope_Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Envelope_Type* value); enum TypingMessage_Action : int { TypingMessage_Action_STARTED = 0, TypingMessage_Action_STOPPED = 1 @@ -204,20 +192,16 @@ constexpr TypingMessage_Action TypingMessage_Action_Action_MIN = TypingMessage_A constexpr TypingMessage_Action TypingMessage_Action_Action_MAX = TypingMessage_Action_STOPPED; constexpr int TypingMessage_Action_Action_ARRAYSIZE = TypingMessage_Action_Action_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* TypingMessage_Action_descriptor(); +const std::string& TypingMessage_Action_Name(TypingMessage_Action value); template inline const std::string& TypingMessage_Action_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function TypingMessage_Action_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - TypingMessage_Action_descriptor(), enum_t_value); -} -inline bool TypingMessage_Action_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, TypingMessage_Action* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - TypingMessage_Action_descriptor(), name, value); + return TypingMessage_Action_Name(static_cast(enum_t_value)); } +bool TypingMessage_Action_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, TypingMessage_Action* value); enum Content_ExpirationType : int { Content_ExpirationType_UNKNOWN = 0, Content_ExpirationType_DELETE_AFTER_READ = 1, @@ -228,20 +212,16 @@ constexpr Content_ExpirationType Content_ExpirationType_ExpirationType_MIN = Con constexpr Content_ExpirationType Content_ExpirationType_ExpirationType_MAX = Content_ExpirationType_DELETE_AFTER_SEND; constexpr int Content_ExpirationType_ExpirationType_ARRAYSIZE = Content_ExpirationType_ExpirationType_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Content_ExpirationType_descriptor(); +const std::string& Content_ExpirationType_Name(Content_ExpirationType value); template inline const std::string& Content_ExpirationType_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function Content_ExpirationType_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - Content_ExpirationType_descriptor(), enum_t_value); -} -inline bool Content_ExpirationType_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Content_ExpirationType* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - Content_ExpirationType_descriptor(), name, value); + return Content_ExpirationType_Name(static_cast(enum_t_value)); } +bool Content_ExpirationType_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Content_ExpirationType* value); enum CallMessage_Type : int { CallMessage_Type_PRE_OFFER = 6, CallMessage_Type_OFFER = 1, @@ -255,20 +235,16 @@ constexpr CallMessage_Type CallMessage_Type_Type_MIN = CallMessage_Type_OFFER; constexpr CallMessage_Type CallMessage_Type_Type_MAX = CallMessage_Type_PRE_OFFER; constexpr int CallMessage_Type_Type_ARRAYSIZE = CallMessage_Type_Type_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* CallMessage_Type_descriptor(); +const std::string& CallMessage_Type_Name(CallMessage_Type value); template inline const std::string& CallMessage_Type_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function CallMessage_Type_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - CallMessage_Type_descriptor(), enum_t_value); -} -inline bool CallMessage_Type_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, CallMessage_Type* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - CallMessage_Type_descriptor(), name, value); + return CallMessage_Type_Name(static_cast(enum_t_value)); } +bool CallMessage_Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, CallMessage_Type* value); enum DataExtractionNotification_Type : int { DataExtractionNotification_Type_SCREENSHOT = 1, DataExtractionNotification_Type_MEDIA_SAVED = 2 @@ -278,20 +254,16 @@ constexpr DataExtractionNotification_Type DataExtractionNotification_Type_Type_M constexpr DataExtractionNotification_Type DataExtractionNotification_Type_Type_MAX = DataExtractionNotification_Type_MEDIA_SAVED; constexpr int DataExtractionNotification_Type_Type_ARRAYSIZE = DataExtractionNotification_Type_Type_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataExtractionNotification_Type_descriptor(); +const std::string& DataExtractionNotification_Type_Name(DataExtractionNotification_Type value); template inline const std::string& DataExtractionNotification_Type_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function DataExtractionNotification_Type_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - DataExtractionNotification_Type_descriptor(), enum_t_value); -} -inline bool DataExtractionNotification_Type_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataExtractionNotification_Type* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - DataExtractionNotification_Type_descriptor(), name, value); + return DataExtractionNotification_Type_Name(static_cast(enum_t_value)); } +bool DataExtractionNotification_Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataExtractionNotification_Type* value); enum DataMessage_Quote_QuotedAttachment_Flags : int { DataMessage_Quote_QuotedAttachment_Flags_VOICE_MESSAGE = 1 }; @@ -300,20 +272,16 @@ constexpr DataMessage_Quote_QuotedAttachment_Flags DataMessage_Quote_QuotedAttac constexpr DataMessage_Quote_QuotedAttachment_Flags DataMessage_Quote_QuotedAttachment_Flags_Flags_MAX = DataMessage_Quote_QuotedAttachment_Flags_VOICE_MESSAGE; constexpr int DataMessage_Quote_QuotedAttachment_Flags_Flags_ARRAYSIZE = DataMessage_Quote_QuotedAttachment_Flags_Flags_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataMessage_Quote_QuotedAttachment_Flags_descriptor(); +const std::string& DataMessage_Quote_QuotedAttachment_Flags_Name(DataMessage_Quote_QuotedAttachment_Flags value); template inline const std::string& DataMessage_Quote_QuotedAttachment_Flags_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function DataMessage_Quote_QuotedAttachment_Flags_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - DataMessage_Quote_QuotedAttachment_Flags_descriptor(), enum_t_value); -} -inline bool DataMessage_Quote_QuotedAttachment_Flags_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_Quote_QuotedAttachment_Flags* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - DataMessage_Quote_QuotedAttachment_Flags_descriptor(), name, value); + return DataMessage_Quote_QuotedAttachment_Flags_Name(static_cast(enum_t_value)); } +bool DataMessage_Quote_QuotedAttachment_Flags_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_Quote_QuotedAttachment_Flags* value); enum DataMessage_Reaction_Action : int { DataMessage_Reaction_Action_REACT = 0, DataMessage_Reaction_Action_REMOVE = 1 @@ -323,20 +291,16 @@ constexpr DataMessage_Reaction_Action DataMessage_Reaction_Action_Action_MIN = D constexpr DataMessage_Reaction_Action DataMessage_Reaction_Action_Action_MAX = DataMessage_Reaction_Action_REMOVE; constexpr int DataMessage_Reaction_Action_Action_ARRAYSIZE = DataMessage_Reaction_Action_Action_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataMessage_Reaction_Action_descriptor(); +const std::string& DataMessage_Reaction_Action_Name(DataMessage_Reaction_Action value); template inline const std::string& DataMessage_Reaction_Action_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function DataMessage_Reaction_Action_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - DataMessage_Reaction_Action_descriptor(), enum_t_value); -} -inline bool DataMessage_Reaction_Action_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_Reaction_Action* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - DataMessage_Reaction_Action_descriptor(), name, value); + return DataMessage_Reaction_Action_Name(static_cast(enum_t_value)); } +bool DataMessage_Reaction_Action_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_Reaction_Action* value); enum DataMessage_Flags : int { DataMessage_Flags_EXPIRATION_TIMER_UPDATE = 2 }; @@ -345,20 +309,16 @@ constexpr DataMessage_Flags DataMessage_Flags_Flags_MIN = DataMessage_Flags_EXPI constexpr DataMessage_Flags DataMessage_Flags_Flags_MAX = DataMessage_Flags_EXPIRATION_TIMER_UPDATE; constexpr int DataMessage_Flags_Flags_ARRAYSIZE = DataMessage_Flags_Flags_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataMessage_Flags_descriptor(); +const std::string& DataMessage_Flags_Name(DataMessage_Flags value); template inline const std::string& DataMessage_Flags_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function DataMessage_Flags_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - DataMessage_Flags_descriptor(), enum_t_value); -} -inline bool DataMessage_Flags_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_Flags* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - DataMessage_Flags_descriptor(), name, value); + return DataMessage_Flags_Name(static_cast(enum_t_value)); } +bool DataMessage_Flags_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_Flags* value); enum ReceiptMessage_Type : int { ReceiptMessage_Type_DELIVERY = 0, ReceiptMessage_Type_READ = 1 @@ -368,20 +328,16 @@ constexpr ReceiptMessage_Type ReceiptMessage_Type_Type_MIN = ReceiptMessage_Type constexpr ReceiptMessage_Type ReceiptMessage_Type_Type_MAX = ReceiptMessage_Type_READ; constexpr int ReceiptMessage_Type_Type_ARRAYSIZE = ReceiptMessage_Type_Type_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ReceiptMessage_Type_descriptor(); +const std::string& ReceiptMessage_Type_Name(ReceiptMessage_Type value); template inline const std::string& ReceiptMessage_Type_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function ReceiptMessage_Type_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - ReceiptMessage_Type_descriptor(), enum_t_value); -} -inline bool ReceiptMessage_Type_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ReceiptMessage_Type* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - ReceiptMessage_Type_descriptor(), name, value); + return ReceiptMessage_Type_Name(static_cast(enum_t_value)); } +bool ReceiptMessage_Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ReceiptMessage_Type* value); enum AttachmentPointer_Flags : int { AttachmentPointer_Flags_VOICE_MESSAGE = 1 }; @@ -390,20 +346,16 @@ constexpr AttachmentPointer_Flags AttachmentPointer_Flags_Flags_MIN = Attachment constexpr AttachmentPointer_Flags AttachmentPointer_Flags_Flags_MAX = AttachmentPointer_Flags_VOICE_MESSAGE; constexpr int AttachmentPointer_Flags_Flags_ARRAYSIZE = AttachmentPointer_Flags_Flags_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* AttachmentPointer_Flags_descriptor(); +const std::string& AttachmentPointer_Flags_Name(AttachmentPointer_Flags value); template inline const std::string& AttachmentPointer_Flags_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function AttachmentPointer_Flags_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - AttachmentPointer_Flags_descriptor(), enum_t_value); -} -inline bool AttachmentPointer_Flags_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, AttachmentPointer_Flags* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - AttachmentPointer_Flags_descriptor(), name, value); + return AttachmentPointer_Flags_Name(static_cast(enum_t_value)); } +bool AttachmentPointer_Flags_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, AttachmentPointer_Flags* value); enum SharedConfigMessage_Kind : int { SharedConfigMessage_Kind_USER_PROFILE = 1, SharedConfigMessage_Kind_CONTACTS = 2, @@ -415,20 +367,16 @@ constexpr SharedConfigMessage_Kind SharedConfigMessage_Kind_Kind_MIN = SharedCon constexpr SharedConfigMessage_Kind SharedConfigMessage_Kind_Kind_MAX = SharedConfigMessage_Kind_USER_GROUPS; constexpr int SharedConfigMessage_Kind_Kind_ARRAYSIZE = SharedConfigMessage_Kind_Kind_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SharedConfigMessage_Kind_descriptor(); +const std::string& SharedConfigMessage_Kind_Name(SharedConfigMessage_Kind value); template inline const std::string& SharedConfigMessage_Kind_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function SharedConfigMessage_Kind_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - SharedConfigMessage_Kind_descriptor(), enum_t_value); -} -inline bool SharedConfigMessage_Kind_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, SharedConfigMessage_Kind* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - SharedConfigMessage_Kind_descriptor(), name, value); + return SharedConfigMessage_Kind_Name(static_cast(enum_t_value)); } +bool SharedConfigMessage_Kind_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, SharedConfigMessage_Kind* value); enum GroupUpdateInfoChangeMessage_Type : int { GroupUpdateInfoChangeMessage_Type_NAME = 1, GroupUpdateInfoChangeMessage_Type_AVATAR = 2, @@ -439,20 +387,16 @@ constexpr GroupUpdateInfoChangeMessage_Type GroupUpdateInfoChangeMessage_Type_Ty constexpr GroupUpdateInfoChangeMessage_Type GroupUpdateInfoChangeMessage_Type_Type_MAX = GroupUpdateInfoChangeMessage_Type_DISAPPEARING_MESSAGES; constexpr int GroupUpdateInfoChangeMessage_Type_Type_ARRAYSIZE = GroupUpdateInfoChangeMessage_Type_Type_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GroupUpdateInfoChangeMessage_Type_descriptor(); +const std::string& GroupUpdateInfoChangeMessage_Type_Name(GroupUpdateInfoChangeMessage_Type value); template inline const std::string& GroupUpdateInfoChangeMessage_Type_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function GroupUpdateInfoChangeMessage_Type_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - GroupUpdateInfoChangeMessage_Type_descriptor(), enum_t_value); -} -inline bool GroupUpdateInfoChangeMessage_Type_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, GroupUpdateInfoChangeMessage_Type* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - GroupUpdateInfoChangeMessage_Type_descriptor(), name, value); + return GroupUpdateInfoChangeMessage_Type_Name(static_cast(enum_t_value)); } +bool GroupUpdateInfoChangeMessage_Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, GroupUpdateInfoChangeMessage_Type* value); enum GroupUpdateMemberChangeMessage_Type : int { GroupUpdateMemberChangeMessage_Type_ADDED = 1, GroupUpdateMemberChangeMessage_Type_REMOVED = 2, @@ -463,24 +407,20 @@ constexpr GroupUpdateMemberChangeMessage_Type GroupUpdateMemberChangeMessage_Typ constexpr GroupUpdateMemberChangeMessage_Type GroupUpdateMemberChangeMessage_Type_Type_MAX = GroupUpdateMemberChangeMessage_Type_PROMOTED; constexpr int GroupUpdateMemberChangeMessage_Type_Type_ARRAYSIZE = GroupUpdateMemberChangeMessage_Type_Type_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GroupUpdateMemberChangeMessage_Type_descriptor(); +const std::string& GroupUpdateMemberChangeMessage_Type_Name(GroupUpdateMemberChangeMessage_Type value); template inline const std::string& GroupUpdateMemberChangeMessage_Type_Name(T enum_t_value) { static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function GroupUpdateMemberChangeMessage_Type_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - GroupUpdateMemberChangeMessage_Type_descriptor(), enum_t_value); -} -inline bool GroupUpdateMemberChangeMessage_Type_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, GroupUpdateMemberChangeMessage_Type* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - GroupUpdateMemberChangeMessage_Type_descriptor(), name, value); + return GroupUpdateMemberChangeMessage_Type_Name(static_cast(enum_t_value)); } +bool GroupUpdateMemberChangeMessage_Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, GroupUpdateMemberChangeMessage_Type* value); // =================================================================== class Envelope final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.Envelope) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.Envelope) */ { public: inline Envelope() : Envelope(nullptr) {} ~Envelope() override; @@ -510,22 +450,13 @@ class Envelope final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const Envelope& default_instance() { return *internal_default_instance(); } @@ -563,15 +494,9 @@ class Envelope final : Envelope* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const Envelope& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const Envelope& from) { - Envelope::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const Envelope& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -584,7 +509,7 @@ class Envelope final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(Envelope* other); private: @@ -597,10 +522,7 @@ class Envelope final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -618,10 +540,6 @@ class Envelope final : Envelope_Type_Type_MAX; static constexpr int Type_ARRAYSIZE = Envelope_Type_Type_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - Type_descriptor() { - return Envelope_Type_descriptor(); - } template static inline const std::string& Type_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -778,7 +696,7 @@ class Envelope final : // ------------------------------------------------------------------- class TypingMessage final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.TypingMessage) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.TypingMessage) */ { public: inline TypingMessage() : TypingMessage(nullptr) {} ~TypingMessage() override; @@ -808,22 +726,13 @@ class TypingMessage final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const TypingMessage& default_instance() { return *internal_default_instance(); } @@ -861,15 +770,9 @@ class TypingMessage final : TypingMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const TypingMessage& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const TypingMessage& from) { - TypingMessage::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const TypingMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -882,7 +785,7 @@ class TypingMessage final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(TypingMessage* other); private: @@ -895,10 +798,7 @@ class TypingMessage final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -916,10 +816,6 @@ class TypingMessage final : TypingMessage_Action_Action_MAX; static constexpr int Action_ARRAYSIZE = TypingMessage_Action_Action_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - Action_descriptor() { - return TypingMessage_Action_descriptor(); - } template static inline const std::string& Action_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -986,7 +882,7 @@ class TypingMessage final : // ------------------------------------------------------------------- class UnsendRequest final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.UnsendRequest) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.UnsendRequest) */ { public: inline UnsendRequest() : UnsendRequest(nullptr) {} ~UnsendRequest() override; @@ -1016,22 +912,13 @@ class UnsendRequest final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const UnsendRequest& default_instance() { return *internal_default_instance(); } @@ -1069,15 +956,9 @@ class UnsendRequest final : UnsendRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const UnsendRequest& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const UnsendRequest& from) { - UnsendRequest::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const UnsendRequest& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1090,7 +971,7 @@ class UnsendRequest final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(UnsendRequest* other); private: @@ -1103,10 +984,7 @@ class UnsendRequest final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -1169,7 +1047,7 @@ class UnsendRequest final : // ------------------------------------------------------------------- class MessageRequestResponse final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.MessageRequestResponse) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.MessageRequestResponse) */ { public: inline MessageRequestResponse() : MessageRequestResponse(nullptr) {} ~MessageRequestResponse() override; @@ -1199,22 +1077,13 @@ class MessageRequestResponse final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const MessageRequestResponse& default_instance() { return *internal_default_instance(); } @@ -1252,15 +1121,9 @@ class MessageRequestResponse final : MessageRequestResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const MessageRequestResponse& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const MessageRequestResponse& from) { - MessageRequestResponse::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const MessageRequestResponse& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1273,7 +1136,7 @@ class MessageRequestResponse final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(MessageRequestResponse* other); private: @@ -1286,10 +1149,7 @@ class MessageRequestResponse final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -1369,7 +1229,7 @@ class MessageRequestResponse final : // ------------------------------------------------------------------- class Content final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.Content) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.Content) */ { public: inline Content() : Content(nullptr) {} ~Content() override; @@ -1399,22 +1259,13 @@ class Content final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const Content& default_instance() { return *internal_default_instance(); } @@ -1452,15 +1303,9 @@ class Content final : Content* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const Content& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const Content& from) { - Content::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const Content& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1473,7 +1318,7 @@ class Content final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(Content* other); private: @@ -1486,10 +1331,7 @@ class Content final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -1509,10 +1351,6 @@ class Content final : Content_ExpirationType_ExpirationType_MAX; static constexpr int ExpirationType_ARRAYSIZE = Content_ExpirationType_ExpirationType_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - ExpirationType_descriptor() { - return Content_ExpirationType_descriptor(); - } template static inline const std::string& ExpirationType_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -1771,7 +1609,7 @@ class Content final : // ------------------------------------------------------------------- class CallMessage final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.CallMessage) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.CallMessage) */ { public: inline CallMessage() : CallMessage(nullptr) {} ~CallMessage() override; @@ -1801,22 +1639,13 @@ class CallMessage final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const CallMessage& default_instance() { return *internal_default_instance(); } @@ -1854,15 +1683,9 @@ class CallMessage final : CallMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const CallMessage& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const CallMessage& from) { - CallMessage::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const CallMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1875,7 +1698,7 @@ class CallMessage final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(CallMessage* other); private: @@ -1888,10 +1711,7 @@ class CallMessage final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -1917,10 +1737,6 @@ class CallMessage final : CallMessage_Type_Type_MAX; static constexpr int Type_ARRAYSIZE = CallMessage_Type_Type_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - Type_descriptor() { - return CallMessage_Type_descriptor(); - } template static inline const std::string& Type_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -2068,7 +1884,7 @@ class CallMessage final : // ------------------------------------------------------------------- class KeyPair final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.KeyPair) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.KeyPair) */ { public: inline KeyPair() : KeyPair(nullptr) {} ~KeyPair() override; @@ -2098,22 +1914,13 @@ class KeyPair final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const KeyPair& default_instance() { return *internal_default_instance(); } @@ -2151,15 +1958,9 @@ class KeyPair final : KeyPair* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const KeyPair& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const KeyPair& from) { - KeyPair::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const KeyPair& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -2172,7 +1973,7 @@ class KeyPair final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(KeyPair* other); private: @@ -2185,10 +1986,7 @@ class KeyPair final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -2256,7 +2054,7 @@ class KeyPair final : // ------------------------------------------------------------------- class DataExtractionNotification final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.DataExtractionNotification) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataExtractionNotification) */ { public: inline DataExtractionNotification() : DataExtractionNotification(nullptr) {} ~DataExtractionNotification() override; @@ -2286,22 +2084,13 @@ class DataExtractionNotification final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const DataExtractionNotification& default_instance() { return *internal_default_instance(); } @@ -2339,15 +2128,9 @@ class DataExtractionNotification final : DataExtractionNotification* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const DataExtractionNotification& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const DataExtractionNotification& from) { - DataExtractionNotification::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const DataExtractionNotification& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -2360,7 +2143,7 @@ class DataExtractionNotification final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(DataExtractionNotification* other); private: @@ -2373,10 +2156,7 @@ class DataExtractionNotification final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -2394,10 +2174,6 @@ class DataExtractionNotification final : DataExtractionNotification_Type_Type_MAX; static constexpr int Type_ARRAYSIZE = DataExtractionNotification_Type_Type_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - Type_descriptor() { - return DataExtractionNotification_Type_descriptor(); - } template static inline const std::string& Type_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -2461,7 +2237,7 @@ class DataExtractionNotification final : // ------------------------------------------------------------------- class LokiProfile final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.LokiProfile) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.LokiProfile) */ { public: inline LokiProfile() : LokiProfile(nullptr) {} ~LokiProfile() override; @@ -2491,22 +2267,13 @@ class LokiProfile final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const LokiProfile& default_instance() { return *internal_default_instance(); } @@ -2544,15 +2311,9 @@ class LokiProfile final : LokiProfile* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const LokiProfile& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const LokiProfile& from) { - LokiProfile::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const LokiProfile& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -2565,7 +2326,7 @@ class LokiProfile final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(LokiProfile* other); private: @@ -2578,10 +2339,7 @@ class LokiProfile final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -2646,7 +2404,7 @@ class LokiProfile final : // ------------------------------------------------------------------- class DataMessage_Quote_QuotedAttachment final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Quote.QuotedAttachment) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Quote.QuotedAttachment) */ { public: inline DataMessage_Quote_QuotedAttachment() : DataMessage_Quote_QuotedAttachment(nullptr) {} ~DataMessage_Quote_QuotedAttachment() override; @@ -2676,22 +2434,13 @@ class DataMessage_Quote_QuotedAttachment final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const DataMessage_Quote_QuotedAttachment& default_instance() { return *internal_default_instance(); } @@ -2729,15 +2478,9 @@ class DataMessage_Quote_QuotedAttachment final : DataMessage_Quote_QuotedAttachment* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const DataMessage_Quote_QuotedAttachment& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const DataMessage_Quote_QuotedAttachment& from) { - DataMessage_Quote_QuotedAttachment::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const DataMessage_Quote_QuotedAttachment& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -2750,7 +2493,7 @@ class DataMessage_Quote_QuotedAttachment final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(DataMessage_Quote_QuotedAttachment* other); private: @@ -2763,10 +2506,7 @@ class DataMessage_Quote_QuotedAttachment final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -2782,10 +2522,6 @@ class DataMessage_Quote_QuotedAttachment final : DataMessage_Quote_QuotedAttachment_Flags_Flags_MAX; static constexpr int Flags_ARRAYSIZE = DataMessage_Quote_QuotedAttachment_Flags_Flags_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - Flags_descriptor() { - return DataMessage_Quote_QuotedAttachment_Flags_descriptor(); - } template static inline const std::string& Flags_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -2894,7 +2630,7 @@ class DataMessage_Quote_QuotedAttachment final : // ------------------------------------------------------------------- class DataMessage_Quote final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Quote) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Quote) */ { public: inline DataMessage_Quote() : DataMessage_Quote(nullptr) {} ~DataMessage_Quote() override; @@ -2924,22 +2660,13 @@ class DataMessage_Quote final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const DataMessage_Quote& default_instance() { return *internal_default_instance(); } @@ -2977,15 +2704,9 @@ class DataMessage_Quote final : DataMessage_Quote* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const DataMessage_Quote& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const DataMessage_Quote& from) { - DataMessage_Quote::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const DataMessage_Quote& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -2998,7 +2719,7 @@ class DataMessage_Quote final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(DataMessage_Quote* other); private: @@ -3011,10 +2732,7 @@ class DataMessage_Quote final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -3119,7 +2837,7 @@ class DataMessage_Quote final : // ------------------------------------------------------------------- class DataMessage_Preview final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Preview) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Preview) */ { public: inline DataMessage_Preview() : DataMessage_Preview(nullptr) {} ~DataMessage_Preview() override; @@ -3149,22 +2867,13 @@ class DataMessage_Preview final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const DataMessage_Preview& default_instance() { return *internal_default_instance(); } @@ -3202,15 +2911,9 @@ class DataMessage_Preview final : DataMessage_Preview* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const DataMessage_Preview& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const DataMessage_Preview& from) { - DataMessage_Preview::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const DataMessage_Preview& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3223,7 +2926,7 @@ class DataMessage_Preview final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(DataMessage_Preview* other); private: @@ -3236,10 +2939,7 @@ class DataMessage_Preview final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -3324,7 +3024,7 @@ class DataMessage_Preview final : // ------------------------------------------------------------------- class DataMessage_Reaction final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Reaction) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.Reaction) */ { public: inline DataMessage_Reaction() : DataMessage_Reaction(nullptr) {} ~DataMessage_Reaction() override; @@ -3354,22 +3054,13 @@ class DataMessage_Reaction final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const DataMessage_Reaction& default_instance() { return *internal_default_instance(); } @@ -3407,15 +3098,9 @@ class DataMessage_Reaction final : DataMessage_Reaction* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const DataMessage_Reaction& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const DataMessage_Reaction& from) { - DataMessage_Reaction::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const DataMessage_Reaction& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3428,7 +3113,7 @@ class DataMessage_Reaction final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(DataMessage_Reaction* other); private: @@ -3441,10 +3126,7 @@ class DataMessage_Reaction final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -3462,10 +3144,6 @@ class DataMessage_Reaction final : DataMessage_Reaction_Action_Action_MAX; static constexpr int Action_ARRAYSIZE = DataMessage_Reaction_Action_Action_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - Action_descriptor() { - return DataMessage_Reaction_Action_descriptor(); - } template static inline const std::string& Action_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -3572,7 +3250,7 @@ class DataMessage_Reaction final : // ------------------------------------------------------------------- class DataMessage_OpenGroupInvitation final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.OpenGroupInvitation) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.OpenGroupInvitation) */ { public: inline DataMessage_OpenGroupInvitation() : DataMessage_OpenGroupInvitation(nullptr) {} ~DataMessage_OpenGroupInvitation() override; @@ -3602,22 +3280,13 @@ class DataMessage_OpenGroupInvitation final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const DataMessage_OpenGroupInvitation& default_instance() { return *internal_default_instance(); } @@ -3655,15 +3324,9 @@ class DataMessage_OpenGroupInvitation final : DataMessage_OpenGroupInvitation* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const DataMessage_OpenGroupInvitation& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const DataMessage_OpenGroupInvitation& from) { - DataMessage_OpenGroupInvitation::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const DataMessage_OpenGroupInvitation& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3676,7 +3339,7 @@ class DataMessage_OpenGroupInvitation final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(DataMessage_OpenGroupInvitation* other); private: @@ -3689,10 +3352,7 @@ class DataMessage_OpenGroupInvitation final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -3760,7 +3420,7 @@ class DataMessage_OpenGroupInvitation final : // ------------------------------------------------------------------- class DataMessage final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage) */ { public: inline DataMessage() : DataMessage(nullptr) {} ~DataMessage() override; @@ -3790,22 +3450,13 @@ class DataMessage final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const DataMessage& default_instance() { return *internal_default_instance(); } @@ -3843,15 +3494,9 @@ class DataMessage final : DataMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const DataMessage& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const DataMessage& from) { - DataMessage::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const DataMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3864,7 +3509,7 @@ class DataMessage final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(DataMessage* other); private: @@ -3877,10 +3522,7 @@ class DataMessage final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -3901,10 +3543,6 @@ class DataMessage final : DataMessage_Flags_Flags_MAX; static constexpr int Flags_ARRAYSIZE = DataMessage_Flags_Flags_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - Flags_descriptor() { - return DataMessage_Flags_descriptor(); - } template static inline const std::string& Flags_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -4183,7 +3821,7 @@ class DataMessage final : // ------------------------------------------------------------------- class ReceiptMessage final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.ReceiptMessage) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ReceiptMessage) */ { public: inline ReceiptMessage() : ReceiptMessage(nullptr) {} ~ReceiptMessage() override; @@ -4213,22 +3851,13 @@ class ReceiptMessage final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const ReceiptMessage& default_instance() { return *internal_default_instance(); } @@ -4266,15 +3895,9 @@ class ReceiptMessage final : ReceiptMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const ReceiptMessage& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const ReceiptMessage& from) { - ReceiptMessage::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const ReceiptMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -4287,7 +3910,7 @@ class ReceiptMessage final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(ReceiptMessage* other); private: @@ -4300,10 +3923,7 @@ class ReceiptMessage final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -4321,10 +3941,6 @@ class ReceiptMessage final : ReceiptMessage_Type_Type_MAX; static constexpr int Type_ARRAYSIZE = ReceiptMessage_Type_Type_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - Type_descriptor() { - return ReceiptMessage_Type_descriptor(); - } template static inline const std::string& Type_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -4397,7 +4013,7 @@ class ReceiptMessage final : // ------------------------------------------------------------------- class AttachmentPointer final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.AttachmentPointer) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.AttachmentPointer) */ { public: inline AttachmentPointer() : AttachmentPointer(nullptr) {} ~AttachmentPointer() override; @@ -4427,22 +4043,13 @@ class AttachmentPointer final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const AttachmentPointer& default_instance() { return *internal_default_instance(); } @@ -4480,15 +4087,9 @@ class AttachmentPointer final : AttachmentPointer* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const AttachmentPointer& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const AttachmentPointer& from) { - AttachmentPointer::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const AttachmentPointer& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -4501,7 +4102,7 @@ class AttachmentPointer final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(AttachmentPointer* other); private: @@ -4514,10 +4115,7 @@ class AttachmentPointer final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -4533,10 +4131,6 @@ class AttachmentPointer final : AttachmentPointer_Flags_Flags_MAX; static constexpr int Flags_ARRAYSIZE = AttachmentPointer_Flags_Flags_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - Flags_descriptor() { - return AttachmentPointer_Flags_descriptor(); - } template static inline const std::string& Flags_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -4785,7 +4379,7 @@ class AttachmentPointer final : // ------------------------------------------------------------------- class SharedConfigMessage final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.SharedConfigMessage) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.SharedConfigMessage) */ { public: inline SharedConfigMessage() : SharedConfigMessage(nullptr) {} ~SharedConfigMessage() override; @@ -4815,22 +4409,13 @@ class SharedConfigMessage final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const SharedConfigMessage& default_instance() { return *internal_default_instance(); } @@ -4868,15 +4453,9 @@ class SharedConfigMessage final : SharedConfigMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const SharedConfigMessage& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const SharedConfigMessage& from) { - SharedConfigMessage::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const SharedConfigMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -4889,7 +4468,7 @@ class SharedConfigMessage final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(SharedConfigMessage* other); private: @@ -4902,10 +4481,7 @@ class SharedConfigMessage final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -4927,10 +4503,6 @@ class SharedConfigMessage final : SharedConfigMessage_Kind_Kind_MAX; static constexpr int Kind_ARRAYSIZE = SharedConfigMessage_Kind_Kind_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - Kind_descriptor() { - return SharedConfigMessage_Kind_descriptor(); - } template static inline const std::string& Kind_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -5017,7 +4589,7 @@ class SharedConfigMessage final : // ------------------------------------------------------------------- class GroupUpdateMessage final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateMessage) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateMessage) */ { public: inline GroupUpdateMessage() : GroupUpdateMessage(nullptr) {} ~GroupUpdateMessage() override; @@ -5047,22 +4619,13 @@ class GroupUpdateMessage final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const GroupUpdateMessage& default_instance() { return *internal_default_instance(); } @@ -5100,15 +4663,9 @@ class GroupUpdateMessage final : GroupUpdateMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const GroupUpdateMessage& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const GroupUpdateMessage& from) { - GroupUpdateMessage::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const GroupUpdateMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -5121,7 +4678,7 @@ class GroupUpdateMessage final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(GroupUpdateMessage* other); private: @@ -5134,10 +4691,7 @@ class GroupUpdateMessage final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -5322,7 +4876,7 @@ class GroupUpdateMessage final : // ------------------------------------------------------------------- class GroupUpdateInviteMessage final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateInviteMessage) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateInviteMessage) */ { public: inline GroupUpdateInviteMessage() : GroupUpdateInviteMessage(nullptr) {} ~GroupUpdateInviteMessage() override; @@ -5352,22 +4906,13 @@ class GroupUpdateInviteMessage final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const GroupUpdateInviteMessage& default_instance() { return *internal_default_instance(); } @@ -5405,15 +4950,9 @@ class GroupUpdateInviteMessage final : GroupUpdateInviteMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const GroupUpdateInviteMessage& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const GroupUpdateInviteMessage& from) { - GroupUpdateInviteMessage::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const GroupUpdateInviteMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -5426,7 +4965,7 @@ class GroupUpdateInviteMessage final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(GroupUpdateInviteMessage* other); private: @@ -5439,10 +4978,7 @@ class GroupUpdateInviteMessage final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -5550,7 +5086,7 @@ class GroupUpdateInviteMessage final : // ------------------------------------------------------------------- class GroupUpdatePromoteMessage final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdatePromoteMessage) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdatePromoteMessage) */ { public: inline GroupUpdatePromoteMessage() : GroupUpdatePromoteMessage(nullptr) {} ~GroupUpdatePromoteMessage() override; @@ -5580,22 +5116,13 @@ class GroupUpdatePromoteMessage final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const GroupUpdatePromoteMessage& default_instance() { return *internal_default_instance(); } @@ -5633,15 +5160,9 @@ class GroupUpdatePromoteMessage final : GroupUpdatePromoteMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const GroupUpdatePromoteMessage& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const GroupUpdatePromoteMessage& from) { - GroupUpdatePromoteMessage::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const GroupUpdatePromoteMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -5654,7 +5175,7 @@ class GroupUpdatePromoteMessage final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(GroupUpdatePromoteMessage* other); private: @@ -5667,10 +5188,7 @@ class GroupUpdatePromoteMessage final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -5738,7 +5256,7 @@ class GroupUpdatePromoteMessage final : // ------------------------------------------------------------------- class GroupUpdateInfoChangeMessage final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateInfoChangeMessage) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateInfoChangeMessage) */ { public: inline GroupUpdateInfoChangeMessage() : GroupUpdateInfoChangeMessage(nullptr) {} ~GroupUpdateInfoChangeMessage() override; @@ -5768,22 +5286,13 @@ class GroupUpdateInfoChangeMessage final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const GroupUpdateInfoChangeMessage& default_instance() { return *internal_default_instance(); } @@ -5821,15 +5330,9 @@ class GroupUpdateInfoChangeMessage final : GroupUpdateInfoChangeMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const GroupUpdateInfoChangeMessage& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const GroupUpdateInfoChangeMessage& from) { - GroupUpdateInfoChangeMessage::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const GroupUpdateInfoChangeMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -5842,7 +5345,7 @@ class GroupUpdateInfoChangeMessage final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(GroupUpdateInfoChangeMessage* other); private: @@ -5855,10 +5358,7 @@ class GroupUpdateInfoChangeMessage final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -5878,10 +5378,6 @@ class GroupUpdateInfoChangeMessage final : GroupUpdateInfoChangeMessage_Type_Type_MAX; static constexpr int Type_ARRAYSIZE = GroupUpdateInfoChangeMessage_Type_Type_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - Type_descriptor() { - return GroupUpdateInfoChangeMessage_Type_descriptor(); - } template static inline const std::string& Type_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -5988,7 +5484,7 @@ class GroupUpdateInfoChangeMessage final : // ------------------------------------------------------------------- class GroupUpdateMemberChangeMessage final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateMemberChangeMessage) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateMemberChangeMessage) */ { public: inline GroupUpdateMemberChangeMessage() : GroupUpdateMemberChangeMessage(nullptr) {} ~GroupUpdateMemberChangeMessage() override; @@ -6018,22 +5514,13 @@ class GroupUpdateMemberChangeMessage final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const GroupUpdateMemberChangeMessage& default_instance() { return *internal_default_instance(); } @@ -6071,15 +5558,9 @@ class GroupUpdateMemberChangeMessage final : GroupUpdateMemberChangeMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const GroupUpdateMemberChangeMessage& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const GroupUpdateMemberChangeMessage& from) { - GroupUpdateMemberChangeMessage::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const GroupUpdateMemberChangeMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -6092,7 +5573,7 @@ class GroupUpdateMemberChangeMessage final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(GroupUpdateMemberChangeMessage* other); private: @@ -6105,10 +5586,7 @@ class GroupUpdateMemberChangeMessage final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -6128,10 +5606,6 @@ class GroupUpdateMemberChangeMessage final : GroupUpdateMemberChangeMessage_Type_Type_MAX; static constexpr int Type_ARRAYSIZE = GroupUpdateMemberChangeMessage_Type_Type_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - Type_descriptor() { - return GroupUpdateMemberChangeMessage_Type_descriptor(); - } template static inline const std::string& Type_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -6244,9 +5718,10 @@ class GroupUpdateMemberChangeMessage final : // ------------------------------------------------------------------- class GroupUpdateMemberLeftMessage final : - public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateMemberLeftMessage) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateMemberLeftMessage) */ { public: inline GroupUpdateMemberLeftMessage() : GroupUpdateMemberLeftMessage(nullptr) {} + ~GroupUpdateMemberLeftMessage() override; explicit PROTOBUF_CONSTEXPR GroupUpdateMemberLeftMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); GroupUpdateMemberLeftMessage(const GroupUpdateMemberLeftMessage& from); @@ -6273,22 +5748,13 @@ class GroupUpdateMemberLeftMessage final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const GroupUpdateMemberLeftMessage& default_instance() { return *internal_default_instance(); } @@ -6326,15 +5792,23 @@ class GroupUpdateMemberLeftMessage final : GroupUpdateMemberLeftMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; - inline void CopyFrom(const GroupUpdateMemberLeftMessage& from) { - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl(*this, from); - } - using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeFrom; - void MergeFrom(const GroupUpdateMemberLeftMessage& from) { - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(*this, from); - } - public: + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; + void CopyFrom(const GroupUpdateMemberLeftMessage& from); + void MergeFrom(const GroupUpdateMemberLeftMessage& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(GroupUpdateMemberLeftMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; @@ -6346,10 +5820,7 @@ class GroupUpdateMemberLeftMessage final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -6363,15 +5834,18 @@ class GroupUpdateMemberLeftMessage final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; + union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- class GroupUpdateMemberLeftNotificationMessage final : - public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateMemberLeftNotificationMessage) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateMemberLeftNotificationMessage) */ { public: inline GroupUpdateMemberLeftNotificationMessage() : GroupUpdateMemberLeftNotificationMessage(nullptr) {} + ~GroupUpdateMemberLeftNotificationMessage() override; explicit PROTOBUF_CONSTEXPR GroupUpdateMemberLeftNotificationMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); GroupUpdateMemberLeftNotificationMessage(const GroupUpdateMemberLeftNotificationMessage& from); @@ -6398,22 +5872,13 @@ class GroupUpdateMemberLeftNotificationMessage final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const GroupUpdateMemberLeftNotificationMessage& default_instance() { return *internal_default_instance(); } @@ -6451,15 +5916,23 @@ class GroupUpdateMemberLeftNotificationMessage final : GroupUpdateMemberLeftNotificationMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; - inline void CopyFrom(const GroupUpdateMemberLeftNotificationMessage& from) { - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl(*this, from); - } - using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeFrom; - void MergeFrom(const GroupUpdateMemberLeftNotificationMessage& from) { - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(*this, from); - } - public: + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; + void CopyFrom(const GroupUpdateMemberLeftNotificationMessage& from); + void MergeFrom(const GroupUpdateMemberLeftNotificationMessage& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(GroupUpdateMemberLeftNotificationMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; @@ -6471,10 +5944,7 @@ class GroupUpdateMemberLeftNotificationMessage final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -6488,13 +5958,15 @@ class GroupUpdateMemberLeftNotificationMessage final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; + union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- class GroupUpdateInviteResponseMessage final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateInviteResponseMessage) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateInviteResponseMessage) */ { public: inline GroupUpdateInviteResponseMessage() : GroupUpdateInviteResponseMessage(nullptr) {} ~GroupUpdateInviteResponseMessage() override; @@ -6524,22 +5996,13 @@ class GroupUpdateInviteResponseMessage final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const GroupUpdateInviteResponseMessage& default_instance() { return *internal_default_instance(); } @@ -6577,15 +6040,9 @@ class GroupUpdateInviteResponseMessage final : GroupUpdateInviteResponseMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const GroupUpdateInviteResponseMessage& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const GroupUpdateInviteResponseMessage& from) { - GroupUpdateInviteResponseMessage::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const GroupUpdateInviteResponseMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -6598,7 +6055,7 @@ class GroupUpdateInviteResponseMessage final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(GroupUpdateInviteResponseMessage* other); private: @@ -6611,10 +6068,7 @@ class GroupUpdateInviteResponseMessage final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -6654,7 +6108,7 @@ class GroupUpdateInviteResponseMessage final : // ------------------------------------------------------------------- class GroupUpdateDeleteMemberContentMessage final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateDeleteMemberContentMessage) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateDeleteMemberContentMessage) */ { public: inline GroupUpdateDeleteMemberContentMessage() : GroupUpdateDeleteMemberContentMessage(nullptr) {} ~GroupUpdateDeleteMemberContentMessage() override; @@ -6684,22 +6138,13 @@ class GroupUpdateDeleteMemberContentMessage final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const GroupUpdateDeleteMemberContentMessage& default_instance() { return *internal_default_instance(); } @@ -6737,15 +6182,9 @@ class GroupUpdateDeleteMemberContentMessage final : GroupUpdateDeleteMemberContentMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const GroupUpdateDeleteMemberContentMessage& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const GroupUpdateDeleteMemberContentMessage& from) { - GroupUpdateDeleteMemberContentMessage::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const GroupUpdateDeleteMemberContentMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -6758,7 +6197,7 @@ class GroupUpdateDeleteMemberContentMessage final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(GroupUpdateDeleteMemberContentMessage* other); private: @@ -6771,10 +6210,7 @@ class GroupUpdateDeleteMemberContentMessage final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -6871,261 +6307,23 @@ class GroupUpdateDeleteMemberContentMessage final : // ------------------------------------------------------------------- class ProProof final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.ProProof) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ProProof) */ { public: inline ProProof() : ProProof(nullptr) {} - ~ProProof() override; - explicit PROTOBUF_CONSTEXPR ProProof(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - ProProof(const ProProof& from); - ProProof(ProProof&& from) noexcept - : ProProof() { - *this = ::std::move(from); - } - - inline ProProof& operator=(const ProProof& from) { - CopyFrom(from); - return *this; - } - inline ProProof& operator=(ProProof&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); - } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const ProProof& default_instance() { - return *internal_default_instance(); - } - static inline const ProProof* internal_default_instance() { - return reinterpret_cast( - &_ProProof_default_instance_); - } - static constexpr int kIndexInFileMessages = - 27; - - friend void swap(ProProof& a, ProProof& b) { - a.Swap(&b); - } - inline void Swap(ProProof* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(ProProof* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - ProProof* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const ProProof& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const ProProof& from) { - ProProof::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } - - private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(ProProof* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.ProProof"; - } - protected: - explicit ProProof(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); - public: - - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kGenIndexHashFieldNumber = 2, - kRotatingPublicKeyFieldNumber = 3, - kSigFieldNumber = 5, - kExpiryUnixTsFieldNumber = 4, - kVersionFieldNumber = 1, - }; - // required bytes genIndexHash = 2; - bool has_genindexhash() const; - private: - bool _internal_has_genindexhash() const; - public: - void clear_genindexhash(); - const std::string& genindexhash() const; - template - void set_genindexhash(ArgT0&& arg0, ArgT... args); - std::string* mutable_genindexhash(); - PROTOBUF_NODISCARD std::string* release_genindexhash(); - void set_allocated_genindexhash(std::string* genindexhash); - private: - const std::string& _internal_genindexhash() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_genindexhash(const std::string& value); - std::string* _internal_mutable_genindexhash(); - public: - - // required bytes rotatingPublicKey = 3; - bool has_rotatingpublickey() const; - private: - bool _internal_has_rotatingpublickey() const; - public: - void clear_rotatingpublickey(); - const std::string& rotatingpublickey() const; - template - void set_rotatingpublickey(ArgT0&& arg0, ArgT... args); - std::string* mutable_rotatingpublickey(); - PROTOBUF_NODISCARD std::string* release_rotatingpublickey(); - void set_allocated_rotatingpublickey(std::string* rotatingpublickey); - private: - const std::string& _internal_rotatingpublickey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_rotatingpublickey(const std::string& value); - std::string* _internal_mutable_rotatingpublickey(); - public: - - // required bytes sig = 5; - bool has_sig() const; - private: - bool _internal_has_sig() const; - public: - void clear_sig(); - const std::string& sig() const; - template - void set_sig(ArgT0&& arg0, ArgT... args); - std::string* mutable_sig(); - PROTOBUF_NODISCARD std::string* release_sig(); - void set_allocated_sig(std::string* sig); - private: - const std::string& _internal_sig() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_sig(const std::string& value); - std::string* _internal_mutable_sig(); - public: - - // required uint64 expiryUnixTs = 4; - bool has_expiryunixts() const; - private: - bool _internal_has_expiryunixts() const; - public: - void clear_expiryunixts(); - uint64_t expiryunixts() const; - void set_expiryunixts(uint64_t value); - private: - uint64_t _internal_expiryunixts() const; - void _internal_set_expiryunixts(uint64_t value); - public: - - // required uint32 version = 1; - bool has_version() const; - private: - bool _internal_has_version() const; - public: - void clear_version(); - uint32_t version() const; - void set_version(uint32_t value); - private: - uint32_t _internal_version() const; - void _internal_set_version(uint32_t value); - public: - - // @@protoc_insertion_point(class_scope:SessionProtos.ProProof) - private: - class _Internal; - - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr genindexhash_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr rotatingpublickey_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr sig_; - uint64_t expiryunixts_; - uint32_t version_; - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_SessionProtos_2eproto; -}; -// ------------------------------------------------------------------- - -class ProConfig final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.ProConfig) */ { - public: - inline ProConfig() : ProConfig(nullptr) {} - ~ProConfig() override; - explicit PROTOBUF_CONSTEXPR ProConfig(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + ~ProProof() override; + explicit PROTOBUF_CONSTEXPR ProProof(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ProConfig(const ProConfig& from); - ProConfig(ProConfig&& from) noexcept - : ProConfig() { + ProProof(const ProProof& from); + ProProof(ProProof&& from) noexcept + : ProProof() { *this = ::std::move(from); } - inline ProConfig& operator=(const ProConfig& from) { + inline ProProof& operator=(const ProProof& from) { CopyFrom(from); return *this; } - inline ProConfig& operator=(ProConfig&& from) noexcept { + inline ProProof& operator=(ProProof&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -7139,36 +6337,27 @@ class ProConfig final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const ProConfig& default_instance() { + static const ProProof& default_instance() { return *internal_default_instance(); } - static inline const ProConfig* internal_default_instance() { - return reinterpret_cast( - &_ProConfig_default_instance_); + static inline const ProProof* internal_default_instance() { + return reinterpret_cast( + &_ProProof_default_instance_); } static constexpr int kIndexInFileMessages = - 28; + 27; - friend void swap(ProConfig& a, ProConfig& b) { + friend void swap(ProProof& a, ProProof& b) { a.Swap(&b); } - inline void Swap(ProConfig* other) { + inline void Swap(ProProof* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -7181,7 +6370,7 @@ class ProConfig final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ProConfig* other) { + void UnsafeArenaSwap(ProProof* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -7189,18 +6378,12 @@ class ProConfig final : // implements Message ---------------------------------------------- - ProConfig* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const ProConfig& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const ProConfig& from) { - ProConfig::MergeImpl(*this, from); + ProProof* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; + void CopyFrom(const ProProof& from); + void MergeFrom(const ProProof& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -7213,69 +6396,113 @@ class ProConfig final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(ProConfig* other); + void SetCachedSize(int size) const; + void InternalSwap(ProProof* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.ProConfig"; + return "SessionProtos.ProProof"; } protected: - explicit ProConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit ProProof(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { - kRotatingPrivKeyFieldNumber = 1, - kProofFieldNumber = 2, + kGenIndexHashFieldNumber = 2, + kRotatingPublicKeyFieldNumber = 3, + kSigFieldNumber = 5, + kExpiryUnixTsFieldNumber = 4, + kVersionFieldNumber = 1, }; - // required bytes rotatingPrivKey = 1; - bool has_rotatingprivkey() const; + // required bytes genIndexHash = 2; + bool has_genindexhash() const; private: - bool _internal_has_rotatingprivkey() const; + bool _internal_has_genindexhash() const; public: - void clear_rotatingprivkey(); - const std::string& rotatingprivkey() const; + void clear_genindexhash(); + const std::string& genindexhash() const; template - void set_rotatingprivkey(ArgT0&& arg0, ArgT... args); - std::string* mutable_rotatingprivkey(); - PROTOBUF_NODISCARD std::string* release_rotatingprivkey(); - void set_allocated_rotatingprivkey(std::string* rotatingprivkey); + void set_genindexhash(ArgT0&& arg0, ArgT... args); + std::string* mutable_genindexhash(); + PROTOBUF_NODISCARD std::string* release_genindexhash(); + void set_allocated_genindexhash(std::string* genindexhash); private: - const std::string& _internal_rotatingprivkey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_rotatingprivkey(const std::string& value); - std::string* _internal_mutable_rotatingprivkey(); + const std::string& _internal_genindexhash() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_genindexhash(const std::string& value); + std::string* _internal_mutable_genindexhash(); public: - // required .SessionProtos.ProProof proof = 2; - bool has_proof() const; + // required bytes rotatingPublicKey = 3; + bool has_rotatingpublickey() const; private: - bool _internal_has_proof() const; + bool _internal_has_rotatingpublickey() const; public: - void clear_proof(); - const ::SessionProtos::ProProof& proof() const; - PROTOBUF_NODISCARD ::SessionProtos::ProProof* release_proof(); - ::SessionProtos::ProProof* mutable_proof(); - void set_allocated_proof(::SessionProtos::ProProof* proof); + void clear_rotatingpublickey(); + const std::string& rotatingpublickey() const; + template + void set_rotatingpublickey(ArgT0&& arg0, ArgT... args); + std::string* mutable_rotatingpublickey(); + PROTOBUF_NODISCARD std::string* release_rotatingpublickey(); + void set_allocated_rotatingpublickey(std::string* rotatingpublickey); private: - const ::SessionProtos::ProProof& _internal_proof() const; - ::SessionProtos::ProProof* _internal_mutable_proof(); + const std::string& _internal_rotatingpublickey() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_rotatingpublickey(const std::string& value); + std::string* _internal_mutable_rotatingpublickey(); + public: + + // required bytes sig = 5; + bool has_sig() const; + private: + bool _internal_has_sig() const; + public: + void clear_sig(); + const std::string& sig() const; + template + void set_sig(ArgT0&& arg0, ArgT... args); + std::string* mutable_sig(); + PROTOBUF_NODISCARD std::string* release_sig(); + void set_allocated_sig(std::string* sig); + private: + const std::string& _internal_sig() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_sig(const std::string& value); + std::string* _internal_mutable_sig(); + public: + + // required uint64 expiryUnixTs = 4; + bool has_expiryunixts() const; + private: + bool _internal_has_expiryunixts() const; + public: + void clear_expiryunixts(); + uint64_t expiryunixts() const; + void set_expiryunixts(uint64_t value); + private: + uint64_t _internal_expiryunixts() const; + void _internal_set_expiryunixts(uint64_t value); + public: + + // required uint32 version = 1; + bool has_version() const; + private: + bool _internal_has_version() const; + public: + void clear_version(); + uint32_t version() const; + void set_version(uint32_t value); + private: + uint32_t _internal_version() const; + void _internal_set_version(uint32_t value); public: - void unsafe_arena_set_allocated_proof( - ::SessionProtos::ProProof* proof); - ::SessionProtos::ProProof* unsafe_arena_release_proof(); - // @@protoc_insertion_point(class_scope:SessionProtos.ProConfig) + // @@protoc_insertion_point(class_scope:SessionProtos.ProProof) private: class _Internal; @@ -7288,8 +6515,11 @@ class ProConfig final : struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr rotatingprivkey_; - ::SessionProtos::ProProof* proof_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr genindexhash_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr rotatingpublickey_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr sig_; + uint64_t expiryunixts_; + uint32_t version_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; @@ -7297,7 +6527,7 @@ class ProConfig final : // ------------------------------------------------------------------- class ProMessage final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:SessionProtos.ProMessage) */ { + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ProMessage) */ { public: inline ProMessage() : ProMessage(nullptr) {} ~ProMessage() override; @@ -7327,22 +6557,13 @@ class ProMessage final : return *this; } - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); + inline const std::string& unknown_fields() const { + return _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString); } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); + inline std::string* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } static const ProMessage& default_instance() { return *internal_default_instance(); } @@ -7351,7 +6572,7 @@ class ProMessage final : &_ProMessage_default_instance_); } static constexpr int kIndexInFileMessages = - 29; + 28; friend void swap(ProMessage& a, ProMessage& b) { a.Swap(&b); @@ -7380,15 +6601,9 @@ class ProMessage final : ProMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const ProMessage& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const ProMessage& from) { - ProMessage::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const ProMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -7401,7 +6616,7 @@ class ProMessage final : private: void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); - void SetCachedSize(int size) const final; + void SetCachedSize(int size) const; void InternalSwap(ProMessage* other); private: @@ -7414,10 +6629,7 @@ class ProMessage final : bool is_message_owned = false); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + std::string GetTypeName() const final; // nested types ---------------------------------------------------- @@ -14447,168 +13659,6 @@ inline void ProProof::set_allocated_sig(std::string* sig) { // ------------------------------------------------------------------- -// ProConfig - -// required bytes rotatingPrivKey = 1; -inline bool ProConfig::_internal_has_rotatingprivkey() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - return value; -} -inline bool ProConfig::has_rotatingprivkey() const { - return _internal_has_rotatingprivkey(); -} -inline void ProConfig::clear_rotatingprivkey() { - _impl_.rotatingprivkey_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const std::string& ProConfig::rotatingprivkey() const { - // @@protoc_insertion_point(field_get:SessionProtos.ProConfig.rotatingPrivKey) - return _internal_rotatingprivkey(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void ProConfig::set_rotatingprivkey(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.rotatingprivkey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.ProConfig.rotatingPrivKey) -} -inline std::string* ProConfig::mutable_rotatingprivkey() { - std::string* _s = _internal_mutable_rotatingprivkey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ProConfig.rotatingPrivKey) - return _s; -} -inline const std::string& ProConfig::_internal_rotatingprivkey() const { - return _impl_.rotatingprivkey_.Get(); -} -inline void ProConfig::_internal_set_rotatingprivkey(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.rotatingprivkey_.Set(value, GetArenaForAllocation()); -} -inline std::string* ProConfig::_internal_mutable_rotatingprivkey() { - _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.rotatingprivkey_.Mutable(GetArenaForAllocation()); -} -inline std::string* ProConfig::release_rotatingprivkey() { - // @@protoc_insertion_point(field_release:SessionProtos.ProConfig.rotatingPrivKey) - if (!_internal_has_rotatingprivkey()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.rotatingprivkey_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.rotatingprivkey_.IsDefault()) { - _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void ProConfig::set_allocated_rotatingprivkey(std::string* rotatingprivkey) { - if (rotatingprivkey != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - _impl_.rotatingprivkey_.SetAllocated(rotatingprivkey, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.rotatingprivkey_.IsDefault()) { - _impl_.rotatingprivkey_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProConfig.rotatingPrivKey) -} - -// required .SessionProtos.ProProof proof = 2; -inline bool ProConfig::_internal_has_proof() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - PROTOBUF_ASSUME(!value || _impl_.proof_ != nullptr); - return value; -} -inline bool ProConfig::has_proof() const { - return _internal_has_proof(); -} -inline void ProConfig::clear_proof() { - if (_impl_.proof_ != nullptr) _impl_.proof_->Clear(); - _impl_._has_bits_[0] &= ~0x00000002u; -} -inline const ::SessionProtos::ProProof& ProConfig::_internal_proof() const { - const ::SessionProtos::ProProof* p = _impl_.proof_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_ProProof_default_instance_); -} -inline const ::SessionProtos::ProProof& ProConfig::proof() const { - // @@protoc_insertion_point(field_get:SessionProtos.ProConfig.proof) - return _internal_proof(); -} -inline void ProConfig::unsafe_arena_set_allocated_proof( - ::SessionProtos::ProProof* proof) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.proof_); - } - _impl_.proof_ = proof; - if (proof) { - _impl_._has_bits_[0] |= 0x00000002u; - } else { - _impl_._has_bits_[0] &= ~0x00000002u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.ProConfig.proof) -} -inline ::SessionProtos::ProProof* ProConfig::release_proof() { - _impl_._has_bits_[0] &= ~0x00000002u; - ::SessionProtos::ProProof* temp = _impl_.proof_; - _impl_.proof_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return temp; -} -inline ::SessionProtos::ProProof* ProConfig::unsafe_arena_release_proof() { - // @@protoc_insertion_point(field_release:SessionProtos.ProConfig.proof) - _impl_._has_bits_[0] &= ~0x00000002u; - ::SessionProtos::ProProof* temp = _impl_.proof_; - _impl_.proof_ = nullptr; - return temp; -} -inline ::SessionProtos::ProProof* ProConfig::_internal_mutable_proof() { - _impl_._has_bits_[0] |= 0x00000002u; - if (_impl_.proof_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::ProProof>(GetArenaForAllocation()); - _impl_.proof_ = p; - } - return _impl_.proof_; -} -inline ::SessionProtos::ProProof* ProConfig::mutable_proof() { - ::SessionProtos::ProProof* _msg = _internal_mutable_proof(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ProConfig.proof) - return _msg; -} -inline void ProConfig::set_allocated_proof(::SessionProtos::ProProof* proof) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete _impl_.proof_; - } - if (proof) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(proof); - if (message_arena != submessage_arena) { - proof = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, proof, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000002u; - } else { - _impl_._has_bits_[0] &= ~0x00000002u; - } - _impl_.proof_ = proof; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProConfig.proof) -} - -// ------------------------------------------------------------------- - // ProMessage // required .SessionProtos.ProProof proof = 1; @@ -14788,8 +13838,6 @@ inline void ProMessage::set_flags(uint32_t value) { // ------------------------------------------------------------------- -// ------------------------------------------------------------------- - // @@protoc_insertion_point(namespace_scope) @@ -14798,70 +13846,18 @@ inline void ProMessage::set_flags(uint32_t value) { PROTOBUF_NAMESPACE_OPEN template <> struct is_proto_enum< ::SessionProtos::Envelope_Type> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::Envelope_Type>() { - return ::SessionProtos::Envelope_Type_descriptor(); -} template <> struct is_proto_enum< ::SessionProtos::TypingMessage_Action> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::TypingMessage_Action>() { - return ::SessionProtos::TypingMessage_Action_descriptor(); -} template <> struct is_proto_enum< ::SessionProtos::Content_ExpirationType> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::Content_ExpirationType>() { - return ::SessionProtos::Content_ExpirationType_descriptor(); -} template <> struct is_proto_enum< ::SessionProtos::CallMessage_Type> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::CallMessage_Type>() { - return ::SessionProtos::CallMessage_Type_descriptor(); -} template <> struct is_proto_enum< ::SessionProtos::DataExtractionNotification_Type> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::DataExtractionNotification_Type>() { - return ::SessionProtos::DataExtractionNotification_Type_descriptor(); -} template <> struct is_proto_enum< ::SessionProtos::DataMessage_Quote_QuotedAttachment_Flags> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::DataMessage_Quote_QuotedAttachment_Flags>() { - return ::SessionProtos::DataMessage_Quote_QuotedAttachment_Flags_descriptor(); -} template <> struct is_proto_enum< ::SessionProtos::DataMessage_Reaction_Action> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::DataMessage_Reaction_Action>() { - return ::SessionProtos::DataMessage_Reaction_Action_descriptor(); -} template <> struct is_proto_enum< ::SessionProtos::DataMessage_Flags> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::DataMessage_Flags>() { - return ::SessionProtos::DataMessage_Flags_descriptor(); -} template <> struct is_proto_enum< ::SessionProtos::ReceiptMessage_Type> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::ReceiptMessage_Type>() { - return ::SessionProtos::ReceiptMessage_Type_descriptor(); -} template <> struct is_proto_enum< ::SessionProtos::AttachmentPointer_Flags> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::AttachmentPointer_Flags>() { - return ::SessionProtos::AttachmentPointer_Flags_descriptor(); -} template <> struct is_proto_enum< ::SessionProtos::SharedConfigMessage_Kind> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::SharedConfigMessage_Kind>() { - return ::SessionProtos::SharedConfigMessage_Kind_descriptor(); -} template <> struct is_proto_enum< ::SessionProtos::GroupUpdateInfoChangeMessage_Type> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::GroupUpdateInfoChangeMessage_Type>() { - return ::SessionProtos::GroupUpdateInfoChangeMessage_Type_descriptor(); -} template <> struct is_proto_enum< ::SessionProtos::GroupUpdateMemberChangeMessage_Type> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::SessionProtos::GroupUpdateMemberChangeMessage_Type>() { - return ::SessionProtos::GroupUpdateMemberChangeMessage_Type_descriptor(); -} PROTOBUF_NAMESPACE_CLOSE diff --git a/proto/SessionProtos.proto b/proto/SessionProtos.proto index 98dcf025..4eb51e88 100644 --- a/proto/SessionProtos.proto +++ b/proto/SessionProtos.proto @@ -4,6 +4,8 @@ syntax = "proto2"; // iOS - package name determines class prefix package SessionProtos; +option optimize_for = LITE_RUNTIME; + message Envelope { enum Type { diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 72f3db32..a0eff5fc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -50,9 +50,10 @@ add_libsession_util_library(crypto multi_encrypt.cpp random.cpp session_encrypt.cpp + session_protocol.cpp sodium_array.cpp xed25519.cpp - pro.cpp + pro_backend.cpp ) add_libsession_util_library(config diff --git a/src/config/internal.hpp b/src/config/internal.hpp index 3466a37a..2b843856 100644 --- a/src/config/internal.hpp +++ b/src/config/internal.hpp @@ -15,15 +15,6 @@ namespace session { -enum class SessionIDPrefix { - standard, - group, - community_blinded_legacy, - community_blinded, - version_blinded, - unblinded, -}; - inline constexpr std::string_view to_string(session::SessionIDPrefix prefix) { switch (prefix) { case session::SessionIDPrefix::unblinded: return "00"sv; diff --git a/src/config/pro.cpp b/src/config/pro.cpp index 72a064ec..c67ac9df 100644 --- a/src/config/pro.cpp +++ b/src/config/pro.cpp @@ -149,12 +149,12 @@ bool ProConfig::load(const dict& root) { }; // namespace session::config // Ensure these are byte buffers and we can just use sizeof to build std::spans to interop with C++ -static_assert((sizeof((pro_pro*)0)->rotating_privkey) == crypto_sign_ed25519_SECRETKEYBYTES); +static_assert((sizeof((pro_pro_config*)0)->rotating_privkey) == crypto_sign_ed25519_SECRETKEYBYTES); static_assert((sizeof((pro_proof*)0)->gen_index_hash) == 32); static_assert((sizeof((pro_proof*)0)->rotating_pubkey) == crypto_sign_ed25519_PUBLICKEYBYTES); static_assert((sizeof((pro_proof*)0)->sig) == crypto_sign_ed25519_BYTES); -LIBSESSION_C_API bool proof_verify(pro_proof const* proof, uint8_t const* verify_pubkey) { +LIBSESSION_C_API bool pro_proof_verify(pro_proof const* proof, uint8_t const* verify_pubkey) { auto verify_pubkey_span = std::span(verify_pubkey, crypto_sign_ed25519_PUBLICKEYBYTES); auto gen_index_hash = @@ -169,7 +169,7 @@ LIBSESSION_C_API bool proof_verify(pro_proof const* proof, uint8_t const* verify return result; } -LIBSESSION_C_API bool pro_verify(pro_pro const* pro, uint8_t const* verify_pubkey) { +LIBSESSION_C_API bool pro_pro_verify(pro_pro_config const* pro, uint8_t const* verify_pubkey) { auto verify_pubkey_span = std::span(verify_pubkey, crypto_sign_ed25519_PUBLICKEYBYTES); auto rotating_privkey = diff --git a/src/config/user_profile.cpp b/src/config/user_profile.cpp index 34709d93..85d87054 100644 --- a/src/config/user_profile.cpp +++ b/src/config/user_profile.cpp @@ -5,6 +5,8 @@ #include "internal.hpp" #include "session/config/contacts.hpp" #include "session/config/error.h" +#include "session/config/pro.h" +#include "session/config/pro.hpp" #include "session/config/user_profile.hpp" #include "session/export.h" #include "session/types.hpp" @@ -119,7 +121,7 @@ std::chrono::sys_seconds UserProfile::get_profile_updated() const { return std::chrono::sys_seconds{}; } -std::optional UserProfile::get_pro_data() const { +std::optional UserProfile::get_pro_config() const { std::optional result = {}; if (const config::dict* s = data["s"].dict(); s) { ProConfig pro = {}; @@ -129,7 +131,7 @@ std::optional UserProfile::get_pro_data() const { return result; } -void UserProfile::set_pro_data(ProConfig const &pro) { +void UserProfile::set_pro_config(ProConfig const &pro) { auto root = data["s"]; root["r"] = pro.rotating_privkey; @@ -248,4 +250,43 @@ LIBSESSION_C_API int64_t user_profile_get_profile_updated(config_object* conf) { return unbox(conf)->get_profile_updated().time_since_epoch().count(); } +LIBSESSION_C_API bool user_profile_get_pro_data(const config_object* conf, pro_pro_config *pro) { + if (auto val = unbox(conf)->get_pro_config(); val) { + static_assert(sizeof pro->proof.gen_index_hash == sizeof(val->proof.gen_index_hash)); + static_assert(sizeof pro->proof.rotating_pubkey == sizeof(val->proof.rotating_pubkey)); + static_assert(sizeof pro->proof.sig == sizeof(val->proof.sig)); + pro->proof.version = val->proof.version; + std::memcpy( + pro->proof.gen_index_hash, + val->proof.gen_index_hash.data(), + val->proof.gen_index_hash.size()); + std::memcpy( + pro->proof.rotating_pubkey, + val->proof.rotating_pubkey.data(), + val->proof.rotating_pubkey.size()); + pro->proof.expiry_unix_ts = val->proof.expiry_unix_ts.time_since_epoch().count(); + std::memcpy(pro->proof.sig, val->proof.sig.data(), val->proof.sig.size()); + return true; + } + return false; +} + +LIBSESSION_C_API void user_profile_set_pro_data(config_object* conf, const pro_pro_config *pro) { + ProConfig val = {}; + val.proof.version = pro->proof.version; + std::memcpy( + val.proof.gen_index_hash.data(), + pro->proof.gen_index_hash, + val.proof.gen_index_hash.size()); + std::memcpy( + val.proof.rotating_pubkey.data(), + pro->proof.rotating_pubkey, + val.proof.rotating_pubkey.size()); + val.proof.expiry_unix_ts = + std::chrono::sys_seconds(std::chrono::seconds(pro->proof.expiry_unix_ts)); + std::memcpy(val.proof.sig.data(), pro->proof.sig, val.proof.sig.size()); + unbox(conf)->set_pro_config(val); +} + + } // extern "C" diff --git a/src/pro.cpp b/src/pro_backend.cpp similarity index 55% rename from src/pro.cpp rename to src/pro_backend.cpp index f629dc21..97e1cd06 100644 --- a/src/pro.cpp +++ b/src/pro_backend.cpp @@ -4,14 +4,12 @@ #include #include -#include +#include #include -#include -#include "SessionProtos.pb.h" -namespace session::pro { +namespace session::pro_backend { -static_assert(BACKEND_PUBKEY.size() == crypto_sign_ed25519_PUBLICKEYBYTES); +static_assert(PUBKEY.size() == crypto_sign_ed25519_PUBLICKEYBYTES); master_rotating_sigs build_get_proof_sigs( const array_uc64& master_privkey, const array_uc64& rotating_privkey, std::chrono::seconds unix_ts) { // Derive the public keys @@ -107,69 +105,4 @@ std::string add_payment_request::to_json() const { oxenc::to_hex(rotating_sig)); return result; } - -DecryptIncomingWithPro decrypt_incoming_with_pro_metadata( - std::span ed25519_privkey, - std::span ciphertext, - std::chrono::sys_seconds unix_ts) { - DecryptIncomingWithPro result = {}; - std::tie(result.plaintext, result.ed25519_pubkey) = session::decrypt_incoming(ed25519_privkey, ciphertext); - - SessionProtos::Content content = {}; - if (!content.ParseFromArray(result.plaintext.data(), result.plaintext.size())) - throw std::runtime_error{"Parse decrypted message for pro metadata failed"}; - - if (content.has_promessageconfig()) { - const SessionProtos::ProMessageConfig& config = content.promessageconfig(); - if (!config.has_proof()) - throw std::runtime_error("Parse decrypted message failed, pro config missing proof"); - if (!config.has_flags()) - throw std::runtime_error("Parse decrypted message failed, pro config missing flags"); - - const SessionProtos::ProProof& proto_proof = config.proof(); - std::uint32_t proto_flags = config.flags(); - - if ((proto_flags & ~session::pro::FeatureFlag_All) > 0) - throw std::runtime_error("Parse decrypted message failed, pro config specified invalid flags"); - - // Parse the proof from protobufs - session::config::ProProof& proof = result.pro_proof; - // clang-format off - size_t proof_errors = 0; - proof_errors += !proto_proof.has_version() || proto_proof.version() != static_cast(session::config::ProProofVersion_v0); - proof_errors += !proto_proof.has_genindexhash() || proto_proof.genindexhash().size() != proof.gen_index_hash.max_size(); - proof_errors += !proto_proof.has_rotatingpublickey() || proto_proof.rotatingpublickey().size() != proof.rotating_pubkey.max_size(); - proof_errors += !proto_proof.has_expiryunixts(); - proof_errors += !proto_proof.has_sig() || proto_proof.sig().size() != proof.sig.max_size(); - // clang-format on - - if (proof_errors == 0) - throw std::runtime_error("Parse decrypted message failed, pro metadata was malformed"); - - // Fill out result, we have parsed successfully - result.pro_flags = proto_flags; - - std::memcpy( - proof.gen_index_hash.data(), - proto_proof.genindexhash().data(), - proto_proof.genindexhash().size()); - std::memcpy( - proof.rotating_pubkey.data(), - proto_proof.rotatingpublickey().data(), - proto_proof.rotatingpublickey().size()); - proof.expiry_unix_ts = - std::chrono::sys_seconds(std::chrono::seconds(proto_proof.expiryunixts())); - std::memcpy(proof.sig.data(), proto_proof.sig().data(), proto_proof.sig().size()); - - if (proof.verify(session::pro::BACKEND_PUBKEY)) - result.pro_status = Status::Valid; - - if (result.pro_status == Status::Valid) { - if (unix_ts >= result.pro_proof.expiry_unix_ts) - result.pro_status = Status::Expired; - } - } - return result; -} - } // namespace session::pro diff --git a/src/session_encrypt.cpp b/src/session_encrypt.cpp index b1003d66..36246618 100644 --- a/src/session_encrypt.cpp +++ b/src/session_encrypt.cpp @@ -1033,4 +1033,4 @@ LIBSESSION_C_API bool session_decrypt_xchacha20( } } -} // extern "C" \ No newline at end of file +} // extern "C" diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp new file mode 100644 index 00000000..f350a76e --- /dev/null +++ b/src/session_protocol.cpp @@ -0,0 +1,305 @@ +#include + +#include +#include +#include +#include +#include +#include + +#include "SessionProtos.pb.h" +#include "WebSocketResources.pb.h" + +namespace session { + +ProFeatures get_pro_features_for_msg(std::span msg, ProExtraFeatures extra) { + ProFeatures result = session_pro_features_nil; + if (msg.size() >= SESSION_PRO_10k_CHARACTER_LIMIT) + result |= session_pro_features_10k_character_limit; + if (extra & session_pro_extra_features_animated_avatar) + result |= session_pro_features_animated_avatar; + if (extra & session_pro_extra_features_pro_badge) + result |= session_pro_features_pro_badge; + return result; +} + +array_uc64 sign_msg_for_pro(std::span msg, const array_uc64& rotating_priv_key) { + // Sign the msg with the rotating public pro key and the pro proof if given + array_uc64 result = {}; + static_assert(result.max_size() == crypto_sign_ed25519_BYTES); + crypto_sign_ed25519_detached(result.data(), nullptr, msg.data(), msg.size(), rotating_priv_key.data()); + return result; +} + +std::vector encrypt_for_namespaced_destination( + std::span plaintext, + std::span ed25519_privkey, + const Destination& dest, + config::Namespace space) { + + enum class Mode { + Envelope, + Plaintext, + EncryptForBlindedRecipient, + }; + + enum class AfterEnvelope { + Nil, + EnvelopeIsCipherText, + WrapInWSMessage, + KeysEncryptMessage, + }; + + struct EncodeContext { + Mode mode; + + // Parameters for BuildMode => Envelope + bool before_envelope_encrypt_for_recipient_deterministic; + std::vector before_envelope_ciphertext; + std::optional> envelope_src; + std::optional envelope_type; + AfterEnvelope after_envelope; + }; + + // Figure out how to encrypt the message based on the destination and setup the encoding context + EncodeContext enc = {}; + switch (dest.type) { + case DestinationType::ClosedGroup: { + bool has_03_prefix = + dest.closed_group_pubkey[0] == static_cast(SessionIDPrefix::group); + if (has_03_prefix) { + if (space == config::Namespace::GroupMessages) { + if (!dest.closed_group_keys) + throw std::runtime_error( + "API misuse: Sending to a closed group into the group messages " + "namespace requires the closed group keys to be set"); + enc.mode = Mode::Envelope; + enc.after_envelope = AfterEnvelope::KeysEncryptMessage; + enc.envelope_type = + SessionProtos::Envelope_Type::Envelope_Type_CLOSED_GROUP_MESSAGE; + } else if (space == config::Namespace::RevokedRetrievableGroupMessages) { + enc.mode = Mode::Plaintext; + } else { + // Config messages should be sent directly rather than via this method (just + // return plaintext and no-op). See: + // https://github.com/session-foundation/session-ios/blob/82deef869d0f7389b799295817f42ad14f8a1316/SessionMessagingKit/Sending%20%26%20Receiving/MessageSender.swift#L494 + enc.mode = Mode::Plaintext; + } + } else { + enc.mode = Mode::Envelope; + enc.before_envelope_encrypt_for_recipient_deterministic = true; + enc.envelope_type = + SessionProtos::Envelope_Type::Envelope_Type_CLOSED_GROUP_MESSAGE; + enc.after_envelope = AfterEnvelope::WrapInWSMessage; + + if (!dest.closed_group_swarm_public_key) + throw std::runtime_error( + "API misuse: Closed group swarm public key must be set on non 0x03 " + "prefixed group keys"); + enc.envelope_src = *dest.closed_group_swarm_public_key; + } + } break; + + case DestinationType::Contact: { + if (space == config::Namespace::Default) { + enc.mode = Mode::Envelope; + enc.before_envelope_encrypt_for_recipient_deterministic = true; + enc.envelope_type = SessionProtos::Envelope_Type::Envelope_Type_SESSION_MESSAGE; + enc.after_envelope = AfterEnvelope::EnvelopeIsCipherText; + } else { + // Config messages should be sent directly rather than via this method (return just + // the plaintext and no-op) See: + // https://github.com/session-foundation/session-ios/blob/82deef869d0f7389b799295817f42ad14f8a1316/SessionMessagingKit/Sending%20%26%20Receiving/MessageSender.swift#L498 + enc.mode = Mode::Plaintext; + } + } break; + + case DestinationType::SyncMessage: { + enc.mode = Mode::Envelope; + enc.before_envelope_encrypt_for_recipient_deterministic = true; + enc.envelope_type = SessionProtos::Envelope_Type::Envelope_Type_SESSION_MESSAGE; + enc.after_envelope = AfterEnvelope::EnvelopeIsCipherText; + } break; + + case DestinationType::OpenGroup: { + enc.mode = Mode::Plaintext; + } break; + + case DestinationType::OpenGroupInbox: { + enc.mode = Mode::EncryptForBlindedRecipient; + } break; + } + + // Do the encryption work + std::vector result; + switch (enc.mode) { + case Mode::Envelope: { + assert(enc.envelope_type.has_value()); + std::span src_text = plaintext; + if (enc.before_envelope_encrypt_for_recipient_deterministic) { + enc.before_envelope_ciphertext = session::encrypt_for_recipient_deterministic( + ed25519_privkey, dest.recipient_pubkey, plaintext); + src_text = enc.before_envelope_ciphertext; + } + + // Create envelope + // Set sourcedevice to 1 as per: + // https://github.com/session-foundation/session-ios/blob/82deef869d0f7389b799295817f42ad14f8a1316/SessionMessagingKit/Utilities/MessageWrapper.swift#L57 + SessionProtos::Envelope envelope = {}; + envelope.set_type(*enc.envelope_type); + envelope.set_sourcedevice(1); + envelope.set_timestamp(dest.sent_timestamp_ms.count()); + envelope.set_content(src_text.data(), src_text.size()); + if (enc.envelope_src) + envelope.set_source(reinterpret_cast(enc.envelope_src->data()), enc.envelope_src->size()); + if (dest.pro_sig) + envelope.set_prosig(reinterpret_cast(dest.pro_sig->data()), dest.pro_sig->size()); + + switch (enc.after_envelope) { + case AfterEnvelope::Nil: + assert(false && "Dev error, after envelope action was not set"); + break; + + case AfterEnvelope::WrapInWSMessage: { + // Make request + WebSocketProtos::WebSocketRequestMessage req_msg = {}; + req_msg.set_body(envelope.SerializeAsString()); + + // Put into message + WebSocketProtos::WebSocketMessage msg = {}; + msg.set_type( + WebSocketProtos::WebSocketMessage_Type::WebSocketMessage_Type_REQUEST); + msg.set_allocated_request(&req_msg); + + // Write message as ciphertext + result.resize(msg.ByteSizeLong()); + msg.SerializeToArray(result.data(), result.size()); + } break; + + case AfterEnvelope::KeysEncryptMessage: { + assert(dest.closed_group_keys && + "Dev error, API miuse was not detected. We should throw an exception " + "when this happens"); + + std::string bytes = envelope.SerializeAsString(); + result = dest.closed_group_keys->encrypt_message( + std::span( + reinterpret_cast(bytes.data()), bytes.size())); + } break; + + case AfterEnvelope::EnvelopeIsCipherText: { + result.resize(envelope.ByteSizeLong()); + envelope.SerializeToArray(result.data(), result.size()); + } break; + } + } break; + + case Mode::Plaintext: { + result = std::vector(plaintext.begin(), plaintext.end()); + } break; + + case Mode::EncryptForBlindedRecipient: { + result = encrypt_for_blinded_recipient( + ed25519_privkey, + dest.open_group_inbox_server_pubkey, + dest.recipient_pubkey, // recipient blinded pubkey + plaintext); + } break; + } + + return result; +} + +DecryptIncomingWithPro decrypt_incoming_with_pro_metadata( + std::span ed25519_privkey, + std::span ciphertext, + std::chrono::sys_seconds unix_ts) { + DecryptIncomingWithPro result = {}; + + SessionProtos::Envelope envelope = {}; + if (!envelope.ParseFromArray(ciphertext.data(), ciphertext.size())) + throw std::runtime_error{"Parse envelope from ciphertext failed"}; + + if (!envelope.has_content()) + throw std::runtime_error{"Parse decrypted message failed, missing content"}; + + const std::string& content_str = envelope.content(); + auto content_span = std::span( + reinterpret_cast(content_str.data()), content_str.size()); + std::tie(result.plaintext, result.ed25519_pubkey) = + session::decrypt_incoming(ed25519_privkey, content_span); + + SessionProtos::Content content = {}; + if (!envelope.ParseFromArray(result.plaintext.data(), result.plaintext.size())) + throw std::runtime_error{"Parse content from envelope failed"}; + + if (content.has_promessage()) { + // Parse the signature from the envelope if the content had a pro component to it + if (!envelope.has_prosig()) + throw std::runtime_error("Parse envelope failed, pro message is missing signature"); + + const std::string& pro_sig = envelope.prosig(); + if (pro_sig.size() != crypto_sign_ed25519_BYTES) + throw std::runtime_error("Parse envelope failed, pro signature has wrong size"); + + SessionProtos::ProMessage pro_msg = content.promessage(); + if (!pro_msg.has_proof()) + throw std::runtime_error("Parse decrypted message failed, pro config missing proof"); + if (!pro_msg.has_flags()) + throw std::runtime_error("Parse decrypted message failed, pro config missing flags"); + + const SessionProtos::ProProof& proto_proof = pro_msg.proof(); + std::uint32_t proto_flags = pro_msg.flags(); + + // Parse the proof from protobufs + session::config::ProProof& proof = result.pro_proof; + // clang-format off + size_t proof_errors = 0; + proof_errors += !proto_proof.has_version() || proto_proof.version() != static_cast(session::config::ProProofVersion_v0); + proof_errors += !proto_proof.has_genindexhash() || proto_proof.genindexhash().size() != proof.gen_index_hash.max_size(); + proof_errors += !proto_proof.has_rotatingpublickey() || proto_proof.rotatingpublickey().size() != proof.rotating_pubkey.max_size(); + proof_errors += !proto_proof.has_expiryunixts(); + proof_errors += !proto_proof.has_sig() || proto_proof.sig().size() != proof.sig.max_size(); + // clang-format on + if (proof_errors) + throw std::runtime_error("Parse decrypted message failed, pro metadata was malformed"); + + // Verify the sig since we have extracted the rotating public key from the embedded proof + int verify_result = crypto_sign_ed25519_verify_detached( + reinterpret_cast(pro_sig.data()), + reinterpret_cast(content_str.data()), + content_str.size(), + reinterpret_cast(proto_proof.rotatingpublickey().data())); + if (verify_result != 0) + throw std::runtime_error("Parse decrypted message failed, pro signature is invalid"); + + // Fill out the resulting proof structure, we have parsed successfully + result.pro_flags = proto_flags; + std::memcpy(result.pro_sig.data(), pro_sig.data(), pro_sig.size()); + + std::memcpy( + proof.gen_index_hash.data(), + proto_proof.genindexhash().data(), + proto_proof.genindexhash().size()); + std::memcpy( + proof.rotating_pubkey.data(), + proto_proof.rotatingpublickey().data(), + proto_proof.rotatingpublickey().size()); + proof.expiry_unix_ts = + std::chrono::sys_seconds(std::chrono::seconds(proto_proof.expiryunixts())); + std::memcpy(proof.sig.data(), proto_proof.sig().data(), proto_proof.sig().size()); + + // Verify the at the proof is verified by the Session Pro Backend key (e.g.: It has been + // authorised by the backend as having a valid backing payment). + if (proof.verify(session::pro_backend::PUBKEY)) + result.pro_status = ProStatus::Valid; + + // Check if the proof has expired + if (result.pro_status == ProStatus::Valid) { + if (unix_ts >= result.pro_proof.expiry_unix_ts) + result.pro_status = ProStatus::Expired; + } + } + return result; +} +} // namespace session From af5279837e0b13296f90be70d3cccdce3bfddfac Mon Sep 17 00:00:00 2001 From: doylet Date: Fri, 8 Aug 2025 17:02:59 +1000 Subject: [PATCH 16/59] Update decrypt function to return the envelope and the metadata --- include/session/session_protocol.hpp | 47 ++++++++++++++++------ src/session_protocol.cpp | 59 ++++++++++++++++++++++++---- 2 files changed, 88 insertions(+), 18 deletions(-) diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index 5296a80f..9a60be7c 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -60,19 +60,44 @@ struct Destination { using ProFeatures = session_pro_features; using ProExtraFeatures = session_pro_extra_features; -struct DecryptIncomingWithPro +enum class EnvelopeType { - std::vector plaintext; - std::vector ed25519_pubkey; - config::ProProof pro_proof; - ProStatus pro_status; - session_pro_features pro_flags; + SessionMessage, + ClosedGroupMessage, +}; + +typedef uint32_t EnvelopeFlags; +enum EnvelopeFlags_ +{ + EnvelopeFlags_Source = 1 << 0, + EnvelopeFlags_SourceDevice = 1 << 1, + EnvelopeFlags_ServerTimestamp = 1 << 2, + EnvelopeFlags_ProSig = 1 << 3, +}; + +struct Envelope +{ + EnvelopeFlags flags; + EnvelopeType type; + uint64_t timestamp; + + // Optional fields + array_uc33 source; + uint32_t source_device; + uint64_t server_timestamp; array_uc64 pro_sig; }; -struct PrepareMsgForPro { - ProFeatures flags; - array_uc64 sig; +struct DecryptedEnvelope +{ + Envelope envelope; + std::vector content_plaintext; + std::vector sender_ed25519_pubkey; + + config::ProProof pro_proof; + ProStatus pro_status; + ProFeatures pro_flags; + array_uc64 pro_sig; }; ProFeatures get_pro_features_for_msg(std::span msg, ProExtraFeatures flags); @@ -86,8 +111,8 @@ std::vector encrypt_for_namespaced_destination( const Destination& dest, config::Namespace space); -DecryptIncomingWithPro decrypt_incoming_with_pro_metadata( +DecryptedEnvelope decrypt_envelope( std::span ed25519_privkey, - std::span ciphertext, + std::span envelope_plaintext, std::chrono::sys_seconds unix_ts); } // namespace session diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index f350a76e..2f465fc1 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -210,27 +211,67 @@ std::vector encrypt_for_namespaced_destination( return result; } -DecryptIncomingWithPro decrypt_incoming_with_pro_metadata( +DecryptedEnvelope decrypt_envelope( std::span ed25519_privkey, - std::span ciphertext, + std::span envelope_plaintext, std::chrono::sys_seconds unix_ts) { - DecryptIncomingWithPro result = {}; - + DecryptedEnvelope result = {}; SessionProtos::Envelope envelope = {}; - if (!envelope.ParseFromArray(ciphertext.data(), ciphertext.size())) + if (!envelope.ParseFromArray(envelope_plaintext.data(), envelope_plaintext.size())) throw std::runtime_error{"Parse envelope from ciphertext failed"}; + // Parse type (unconditionallty) + if (!envelope.has_type()) + throw std::runtime_error("Parse envelope failed, missing type"); + + switch (envelope.type()) { + case SessionProtos::Envelope_Type_SESSION_MESSAGE: + result.envelope.type = EnvelopeType::SessionMessage; + break; + + case SessionProtos::Envelope_Type_CLOSED_GROUP_MESSAGE: + result.envelope.type = EnvelopeType::ClosedGroupMessage; + break; + } + + // Parse source (optional) + if (envelope.has_source()) { + // Libsession is now responsible for creating the envelope. The only data that we send in + // the source is a Session public key (see: encrypt_for_namespaced_destination) + const std::string& source = envelope.source(); + if (source.size() != result.envelope.source.max_size()) + throw std::runtime_error( + fmt::format( + "Parse envelope failed, source had unexpected size ({} bytes)", + source.size())); + std::memcpy(result.envelope.source.data(), source.data(), source.size()); + result.envelope.flags |= EnvelopeFlags_Source; + } + + // Parse source device (optional) + if (envelope.has_sourcedevice()) { + result.envelope.source_device = envelope.sourcedevice(); + result.envelope.flags |= EnvelopeFlags_SourceDevice; + } + + // Parse server timestamp (optional) + if (envelope.has_servertimestamp()) { + result.envelope.server_timestamp = envelope.servertimestamp(); + result.envelope.flags |= EnvelopeFlags_ServerTimestamp; + } + + // Parse content (unconditionallty) if (!envelope.has_content()) throw std::runtime_error{"Parse decrypted message failed, missing content"}; const std::string& content_str = envelope.content(); auto content_span = std::span( reinterpret_cast(content_str.data()), content_str.size()); - std::tie(result.plaintext, result.ed25519_pubkey) = + std::tie(result.content_plaintext, result.sender_ed25519_pubkey) = session::decrypt_incoming(ed25519_privkey, content_span); SessionProtos::Content content = {}; - if (!envelope.ParseFromArray(result.plaintext.data(), result.plaintext.size())) + if (!envelope.ParseFromArray(result.content_plaintext.data(), result.content_plaintext.size())) throw std::runtime_error{"Parse content from envelope failed"}; if (content.has_promessage()) { @@ -242,6 +283,10 @@ DecryptIncomingWithPro decrypt_incoming_with_pro_metadata( if (pro_sig.size() != crypto_sign_ed25519_BYTES) throw std::runtime_error("Parse envelope failed, pro signature has wrong size"); + static_assert(sizeof(result.envelope.pro_sig) == crypto_sign_ed25519_BYTES); + std::memcpy(result.envelope.pro_sig.data(), pro_sig.data(), pro_sig.size()); + result.envelope.flags |= EnvelopeFlags_ProSig; + SessionProtos::ProMessage pro_msg = content.promessage(); if (!pro_msg.has_proof()) throw std::runtime_error("Parse decrypted message failed, pro config missing proof"); From ffe0b5b0be580496081f4f9f005a60a48296f58e Mon Sep 17 00:00:00 2001 From: doylet Date: Fri, 8 Aug 2025 17:52:27 +1000 Subject: [PATCH 17/59] Add documentation for new session protocol functions --- include/session/session_protocol.hpp | 151 ++++++++++++++++++++++----- src/session_protocol.cpp | 54 +++++----- 2 files changed, 149 insertions(+), 56 deletions(-) diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index 9a60be7c..82a63353 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -1,7 +1,8 @@ #pragma once -#include #include + +#include #include #include @@ -21,7 +22,6 @@ enum class ProStatus { Expired, // Pro proof was set, is verified; has expired }; - enum class DestinationType { Contact, SyncMessage, @@ -34,14 +34,17 @@ struct Destination { DestinationType type; // Signature over the plaintext with the user's Session Pro rotating public key if they have - // Session Pro and opt into sending a message with pro features. + // Session Pro and opt into sending a message with pro features. If this is specified, the pro + // message component in `Content` must have been set with the corresponding proof for this + // signature. std::optional pro_sig; // Set to the recipient of the message if it requires one. Ignored otherwise (for example // ignored in OpenGroup) array_uc32 recipient_pubkey; - // The timestamp to assign to the message envelope if the message requires one. Ignored otherwise + // The timestamp to assign to the message envelope if the message requires one. Ignored + // otherwise std::chrono::milliseconds sent_timestamp_ms; // When type => OpenGroupInbox: set this pubkey to the server's key @@ -49,7 +52,7 @@ struct Destination { // When type => ClosedGroup: set the following 'closed_group' prefixed fields array_uc33 closed_group_pubkey; - const session::config::groups::Keys *closed_group_keys; + const session::config::groups::Keys* closed_group_keys; // Set to the closed group's swarm public key (needed for Android) for a non 0x03 prefixed // `closed_group_pubkey`. Ignored otherwise. This will be set as the envelope source. See: @@ -57,62 +60,156 @@ struct Destination { std::optional closed_group_swarm_public_key; }; -using ProFeatures = session_pro_features; -using ProExtraFeatures = session_pro_extra_features; - -enum class EnvelopeType -{ - SessionMessage, - ClosedGroupMessage, +enum class EnvelopeType { + SessionMessage, + ClosedGroupMessage, }; typedef uint32_t EnvelopeFlags; -enum EnvelopeFlags_ -{ +enum EnvelopeFlags_ { EnvelopeFlags_Source = 1 << 0, EnvelopeFlags_SourceDevice = 1 << 1, EnvelopeFlags_ServerTimestamp = 1 << 2, EnvelopeFlags_ProSig = 1 << 3, }; -struct Envelope -{ +struct Envelope { EnvelopeFlags flags; EnvelopeType type; uint64_t timestamp; - // Optional fields + /// Optional fields. These fields are set if the appropriate flag has been set in `flags` + /// otherwise the corresponding values are to be ignored and those fields will be + /// zero-initialised. array_uc33 source; uint32_t source_device; uint64_t server_timestamp; array_uc64 pro_sig; }; -struct DecryptedEnvelope -{ +using ProFeatures = session_pro_features; +using ProExtraFeatures = session_pro_extra_features; + +struct DecryptedEnvelope { + // The envelope parsed from the plaintext Envelope envelope; + + // Decrypted envelope content into plaintext std::vector content_plaintext; + + // Sender public key extracted from the encrypted content payload std::vector sender_ed25519_pubkey; - config::ProProof pro_proof; + // Status flag for validity of the Session Pro proof embedded in the envelope if it has one. + // The status is set to `Nil` if there is no Session Pro proof in the message. Otherwise it's + // set to one of the other values to which the remaining pro fields will be populated with data + // parsed from the envelope. ProStatus pro_status; - ProFeatures pro_flags; - array_uc64 pro_sig; + + // The embedded Session Pro proof, only set if the status was not `Nil`. + config::ProProof pro_proof; + + // Session Pro features that were used in the embedded message, only set if the status was not + // `Nil`. + ProFeatures pro_features; }; -ProFeatures get_pro_features_for_msg(std::span msg, ProExtraFeatures flags); +struct EncryptedForNamespaceDest +{ + // Indicates if the ciphertext was encrypted or not. This can be false if the message sent to + // the destination and namespace does not require encryption. In this case `ciphertext` is not + // set and the user should proceed with the original plaintext. + bool encrypted; + + // The plaintext encrypted in a manner suitable for the desired destination and namespace. This + // is not set if `encrypted` is false. + std::vector ciphertext; +}; -array_uc64 sign_msg_for_pro( - std::span msg, const array_uc64& rotating_priv_key); +/// API: session_protocol/get_pro_features_for_msg +/// +/// Determine the Pro features that are used in a given conversation message. +/// +/// Inputs: +/// - `msg` -- the conversation message to determine if the message is requires access to the 10k +/// character limit available in Session Pro +/// - `flags` -- extra pro features that are known by clients that they wish to be activated on +/// this message +/// +/// Outputs: +/// - Session Pro feature flags suitable for writing directly into the protobuf `ProMessage` in +/// `Content` +ProFeatures get_pro_features_for_msg(std::span msg, ProExtraFeatures flags); -std::vector encrypt_for_namespaced_destination( +/// API: session_protocol/encrypt_for_namespaced_destination +/// +/// Given an unencrypted plaintext representation of the content (i.e.: protobuf encoded stream of +/// `Content`), encrypt and/or wrap the plaintext in the necessary structures for transmission on +/// the Session Protocol. +/// +/// This function supports all combinatoric combinations of the destination type and namespace +/// including returning plaintext if the message is not meant to be encrypted and or wrapping in the +/// additional websocket wrapper or encrypting the envelope with the closed group keys if necessary +/// e.t.c. +/// +/// Calling this function requires filling out the options in the `Destination` struct with the +/// appropriate values for the desired combination of destination type and namespace. Check the +/// annotation on `Destination` for more information. +/// +/// This function throws if the API is misused (i.e.: A field was not set, but was required to be +/// set for the given destination and namespace. For example the closed group keys not being set +/// when sending to a group prefixed [0x3] key in a closed group into the group message namespace) +/// but otherwise always returns a struct with values. +/// +/// Inputs: +/// - `plaintext` -- the protobuf serialised payload containing the protobuf encoded stream, +/// `Content`. It must not be already be encrypted. +/// - `ed25519_privkey` -- the libsodium-style secret key of the sender, 64 bytes. Can also be +/// passed as a 32-byte seed. Used to encrypt the plaintext. +/// - `dest` -- the extra metadata indicating the destination of the message and the necessary data +/// to encrypt a message for that destination. +/// - `space` -- the namespace to encrypt the message for +/// +/// Outputs: +/// - The encryption result for the plaintext. If the destination and namespace combination did not +/// require encryption, no payload is returned in the ciphertext and the user should proceed with +/// the plaintext. This should be validated by checking the `encrypted` flag on the result. +EncryptedForNamespaceDest encrypt_for_namespaced_destination( std::span plaintext, std::span ed25519_privkey, const Destination& dest, config::Namespace space); +/// API: session_protocol/decrypt_envelope +/// +/// Given an unencrypted plaintext representation of an envelope (i.e.: protobuf encoded stream of +/// `Envelope`) parse the envelope and return the envelope content decrypted to plaintext with the +/// passed in key. +/// +/// If the message does not use Session Pro features, the pro status will be set to nil and all +/// other pro fields are to be ignored. If the pro status is non-nil then the pro fields will be +/// populated with data about the Session Pro proof embedded in the envelope including the features +/// used and if the proof was valid/expired e.t.c. +/// +/// This function will throw if parsing failed such as a required field is missing, the field is +/// smaller or larger than expected, decryption failed, or an invariant failed. Notably this +/// function does not throw if the Session Pro proof failed to verify. Always check the pro status +/// field to verify if the Session Pro was present and/or valid or invalid. +/// +/// Inputs: +/// - `ed25519_privkey` -- the libsodium-style secret key of the sender, 64 bytes. Can also be +/// passed as a 32-byte seed. Used to decrypt the encrypted content. +/// - `envelope_plaintext` -- the protobuf serialised payload containing the message envelope. The +/// envelope must already be decrypted if it was originally encrypted (i.e.: closed group +/// envelopes). +/// - `unix_ts` -- pass in the current system time which is used to determine, if present in the +/// envelope, whether or not the Session Pro proof has expired or not. +/// +/// Outputs: +/// - The decrypted envelope. It contains the fields of the envelope and the Session Pro metadata +/// within the envelope if there were any. DecryptedEnvelope decrypt_envelope( std::span ed25519_privkey, std::span envelope_plaintext, std::chrono::sys_seconds unix_ts); -} // namespace session +} // namespace session diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index 2f465fc1..dd24cfea 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -24,20 +24,13 @@ ProFeatures get_pro_features_for_msg(std::span msg, ProExtr return result; } -array_uc64 sign_msg_for_pro(std::span msg, const array_uc64& rotating_priv_key) { - // Sign the msg with the rotating public pro key and the pro proof if given - array_uc64 result = {}; - static_assert(result.max_size() == crypto_sign_ed25519_BYTES); - crypto_sign_ed25519_detached(result.data(), nullptr, msg.data(), msg.size(), rotating_priv_key.data()); - return result; -} - -std::vector encrypt_for_namespaced_destination( +EncryptedForNamespaceDest encrypt_for_namespaced_destination( std::span plaintext, std::span ed25519_privkey, const Destination& dest, config::Namespace space) { + EncryptedForNamespaceDest result = {}; enum class Mode { Envelope, Plaintext, @@ -132,7 +125,6 @@ std::vector encrypt_for_namespaced_destination( } // Do the encryption work - std::vector result; switch (enc.mode) { case Mode::Envelope: { assert(enc.envelope_type.has_value()); @@ -156,6 +148,7 @@ std::vector encrypt_for_namespaced_destination( if (dest.pro_sig) envelope.set_prosig(reinterpret_cast(dest.pro_sig->data()), dest.pro_sig->size()); + result.encrypted = true; switch (enc.after_envelope) { case AfterEnvelope::Nil: assert(false && "Dev error, after envelope action was not set"); @@ -173,8 +166,8 @@ std::vector encrypt_for_namespaced_destination( msg.set_allocated_request(&req_msg); // Write message as ciphertext - result.resize(msg.ByteSizeLong()); - msg.SerializeToArray(result.data(), result.size()); + result.ciphertext.resize(msg.ByteSizeLong()); + msg.SerializeToArray(result.ciphertext.data(), result.ciphertext.size()); } break; case AfterEnvelope::KeysEncryptMessage: { @@ -183,24 +176,26 @@ std::vector encrypt_for_namespaced_destination( "when this happens"); std::string bytes = envelope.SerializeAsString(); - result = dest.closed_group_keys->encrypt_message( + result.ciphertext = dest.closed_group_keys->encrypt_message( std::span( reinterpret_cast(bytes.data()), bytes.size())); } break; case AfterEnvelope::EnvelopeIsCipherText: { - result.resize(envelope.ByteSizeLong()); - envelope.SerializeToArray(result.data(), result.size()); + result.ciphertext.resize(envelope.ByteSizeLong()); + envelope.SerializeToArray(result.ciphertext.data(), result.ciphertext.size()); } break; } + } break; case Mode::Plaintext: { - result = std::vector(plaintext.begin(), plaintext.end()); + // No-op. We do not populate the ciphertext because there was no encryption. } break; case Mode::EncryptForBlindedRecipient: { - result = encrypt_for_blinded_recipient( + result.encrypted = true; + result.ciphertext = encrypt_for_blinded_recipient( ed25519_privkey, dest.open_group_inbox_server_pubkey, dest.recipient_pubkey, // recipient blinded pubkey @@ -315,12 +310,11 @@ DecryptedEnvelope decrypt_envelope( reinterpret_cast(content_str.data()), content_str.size(), reinterpret_cast(proto_proof.rotatingpublickey().data())); - if (verify_result != 0) - throw std::runtime_error("Parse decrypted message failed, pro signature is invalid"); + result.pro_status = verify_result == 0 ? ProStatus::Valid : ProStatus::Invalid; // Fill out the resulting proof structure, we have parsed successfully - result.pro_flags = proto_flags; - std::memcpy(result.pro_sig.data(), pro_sig.data(), pro_sig.size()); + result.pro_features = proto_flags; + std::memcpy(result.envelope.pro_sig.data(), pro_sig.data(), pro_sig.size()); std::memcpy( proof.gen_index_hash.data(), @@ -334,15 +328,17 @@ DecryptedEnvelope decrypt_envelope( std::chrono::sys_seconds(std::chrono::seconds(proto_proof.expiryunixts())); std::memcpy(proof.sig.data(), proto_proof.sig().data(), proto_proof.sig().size()); - // Verify the at the proof is verified by the Session Pro Backend key (e.g.: It has been - // authorised by the backend as having a valid backing payment). - if (proof.verify(session::pro_backend::PUBKEY)) - result.pro_status = ProStatus::Valid; - - // Check if the proof has expired if (result.pro_status == ProStatus::Valid) { - if (unix_ts >= result.pro_proof.expiry_unix_ts) - result.pro_status = ProStatus::Expired; + // Verify the at the proof is verified by the Session Pro Backend key (e.g.: It has been + // authorised by the backend as having a valid backing payment). + if (proof.verify(session::pro_backend::PUBKEY)) + result.pro_status = ProStatus::Valid; + + // Check if the proof has expired + if (result.pro_status == ProStatus::Valid) { + if (unix_ts >= result.pro_proof.expiry_unix_ts) + result.pro_status = ProStatus::Expired; + } } } return result; From 654b6b67d2b0c60acb4bced5dfe13b16732e327d Mon Sep 17 00:00:00 2001 From: doylet Date: Mon, 11 Aug 2025 17:20:47 +1000 Subject: [PATCH 18/59] Add c bindings for new encryption functions --- include/session/config/namespaces.h | 35 +++ include/session/config/namespaces.hpp | 25 +-- include/session/session_protocol.h | 161 +++++++++++-- include/session/session_protocol.hpp | 33 +-- include/session/types.h | 21 ++ src/CMakeLists.txt | 1 + src/session_protocol.cpp | 310 ++++++++++++++++++++++---- src/types.cpp | 21 ++ 8 files changed, 513 insertions(+), 94 deletions(-) create mode 100644 include/session/config/namespaces.h create mode 100644 include/session/types.h create mode 100644 src/types.cpp diff --git a/include/session/config/namespaces.h b/include/session/config/namespaces.h new file mode 100644 index 00000000..a2a7aee7 --- /dev/null +++ b/include/session/config/namespaces.h @@ -0,0 +1,35 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum NAMESPACE { + // Messages sent to an updated closed group which should be able to be retrieved by revoked + // members are stored in this namespace + NAMESPACE_REVOKED_RETRIEVABLE_GROUP_MESSAGES = -11, + + // Messages sent to one-to-one conversations are stored in this namespace + NAMESPACE_DEFAULT = 0, + NAMESPACE_USER_PROFILE = 2, + NAMESPACE_CONTACTS = 3, + NAMESPACE_CONVO_INFO_VOLATILE = 4, + NAMESPACE_USER_GROUPS = 5, + + // Messages sent to a closed group: + NAMESPACE_GROUP_MESSAGES = 11, + // Groups config namespaces (i.e. for shared config of the group itself, not one user's group + // settings) + NAMESPACE_GROUP_KEYS = 12, + NAMESPACE_GROUP_INFO = 13, + NAMESPACE_GROUP_MEMBERS = 14, + + // The local config should never be pushed but this gives us a nice identifier for each config + // type + NAMESPACE_LOCAL = 9999, +} NAMESPACE; + + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/include/session/config/namespaces.hpp b/include/session/config/namespaces.hpp index 1383ebac..8ac4abd6 100644 --- a/include/session/config/namespaces.hpp +++ b/include/session/config/namespaces.hpp @@ -1,32 +1,31 @@ #pragma once #include +#include "namespaces.h" namespace session::config { enum class Namespace : std::int16_t { - // Messages sent to an updated closed group which should be able to be retrieved by revoked - // members are stored in this namespace - RevokedRetrievableGroupMessages = -11, + RevokedRetrievableGroupMessages = NAMESPACE_REVOKED_RETRIEVABLE_GROUP_MESSAGES, // Messages sent to one-to-one conversations are stored in this namespace - Default = 0, - UserProfile = 2, - Contacts = 3, - ConvoInfoVolatile = 4, - UserGroups = 5, + Default = NAMESPACE_DEFAULT, + UserProfile = NAMESPACE_USER_PROFILE, + Contacts = NAMESPACE_CONTACTS, + ConvoInfoVolatile = NAMESPACE_CONVO_INFO_VOLATILE, + UserGroups = NAMESPACE_USER_GROUPS, // Messages sent to a closed group: - GroupMessages = 11, + GroupMessages = NAMESPACE_GROUP_MESSAGES, // Groups config namespaces (i.e. for shared config of the group itself, not one user's group // settings) - GroupKeys = 12, - GroupInfo = 13, - GroupMembers = 14, + GroupKeys = NAMESPACE_GROUP_KEYS, + GroupInfo = NAMESPACE_GROUP_INFO, + GroupMembers = NAMESPACE_GROUP_MEMBERS, // The local config should never be pushed but this gives us a nice identifier for each config // type - Local = 9999, + Local = NAMESPACE_LOCAL, }; } // namespace session::config diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index f8872ef8..3ae234d7 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -1,33 +1,164 @@ #include +#include "config/namespaces.h" +#include "config/pro.h" #include "export.h" +#include "types.h" + +struct config_group_keys; #ifdef __cplusplus extern "C" { #endif enum { - SESSION_PRO_10k_CHARACTER_LIMIT = 10'000, + PRO_10K_CHARACTER_LIMIT = 10'000, +}; + +typedef uint64_t PRO_EXTRA_FEATURES; +enum PRO_EXTRA_FEATURES_ { + PRO_EXTRA_FEATURES_NIL = 0, + PRO_EXTRA_FEATURES_PRO_BADGE = 0 << 1, + PRO_EXTRA_FEATURES_ANIMATED_AVATAR = 1 << 1, +}; + +typedef uint64_t PRO_FEATURES; +enum PRO_FEATURES_ { + PRO_FEATURES_NIL = 0, + PRO_FEATURES_10K_CHARACTER_LIMIT = 1 << 0, + PRO_FEATURES_PRO_BADGE = 1 << 1, + PRO_FEATURES_ANIMATED_AVATAR = 1 << 2, + PRO_FEATURES_ALL = + PRO_FEATURES_10K_CHARACTER_LIMIT | PRO_FEATURES_PRO_BADGE | PRO_FEATURES_ANIMATED_AVATAR +}; + +enum PRO_STATUS { + PRO_STATUS_NIL, // Pro proof was not set + PRO_STATUS_INVALID, // Pro proof was set; signature validation failed + PRO_STATUS_VALID, // Pro proof was set, is verified; has not expired + PRO_STATUS_EXPIRED, // Pro proof was set, is verified; has expired +}; + +enum DESTINATION_TYPE { + DESTINATION_TYPE_CONTACT, + DESTINATION_TYPE_SYNC_MESSAGE, + DESTINATION_TYPE_CLOSED_GROUP, + DESTINATION_TYPE_OPEN_GROUP, + DESTINATION_TYPE_OPEN_GROUP_INBOX, }; -typedef uint64_t session_pro_extra_features; -enum session_pro_extra_features_ { - session_pro_extra_nil = 0, - session_pro_extra_features_pro_badge = 0 << 1, - session_pro_extra_features_animated_avatar = 1 << 1, +struct session_protocol_destination { + DESTINATION_TYPE type; + + // Signature over the plaintext with the user's Session Pro rotating public key if they have + // Session Pro and opt into sending a message with pro features. If this is specified, the pro + // message component in `Content` must have been set with the corresponding proof for this + // signature. + uint8_t pro_sig[64]; + bool has_pro_sig; + + // Set to the recipient of the message if it requires one. Ignored otherwise (for example + // ignored in OpenGroup) + uint8_t recipient_pubkey[32]; + + // The timestamp to assign to the message envelope if the message requires one. Ignored + // otherwise + uint64_t sent_timestamp_ms; + + // When type => OpenGroupInbox: set this pubkey to the server's key + uint8_t open_group_inbox_server_pubkey[32]; + + // When type => ClosedGroup: set the following 'closed_group' prefixed fields + uint8_t closed_group_pubkey[33]; + const config_group_keys* closed_group_keys; + + // Set to the closed group's swarm public key (needed for Android) for a non 0x03 prefixed + // `closed_group_pubkey`. Ignored otherwise. This will be set as the envelope source. See: + // https://github.com/session-foundation/session-ios/blob/82deef869d0f7389b799295817f42ad14f8a1316/SessionMessagingKit/Sending%20%26%20Receiving/MessageSender.swift#L469 + uint8_t closed_group_swarm_public_key[33]; + bool has_closed_group_swarm_public_key; +}; + +enum ENVELOPE_TYPE { + ENVELOPE_TYPE_SESSION_MESSAGE, + ENVELOPE_TYPE_CLOSED_GROUP_MESSGE, }; -typedef uint64_t session_pro_features; -enum session_pro_features_ { - session_pro_features_nil = 0, - session_pro_features_10k_character_limit = 1 << 0, - session_pro_features_pro_badge = 1 << 1, - session_pro_features_animated_avatar = 1 << 2, - session_pro_features_all = session_pro_features_10k_character_limit | - session_pro_features_pro_badge | - session_pro_features_animated_avatar, +typedef uint32_t ENVELOPE_FLAGS; +enum ENVELOPE_FLAGS_ { + ENVELOPE_FLAGS_SOURCE = 1 << 0, + ENVELOPE_FLAGS_SOURCE_DEVICE = 1 << 1, + ENVELOPE_FLAGS_SERVER_TIMESTAMP = 1 << 2, + ENVELOPE_FLAGS_PRO_SIG = 1 << 3, }; +struct session_protocol_envelope { + ENVELOPE_FLAGS flags; + ENVELOPE_TYPE type; + uint64_t timestamp; + + /// Optional fields. These fields are set if the appropriate flag has been set in `flags` + /// otherwise the corresponding values are to be ignored and those fields will be + /// zero-initialised. + uint8_t source[33]; + uint32_t source_device; + uint64_t server_timestamp; + uint8_t pro_sig[64]; +}; + +struct session_protocol_decrypted_envelope { + bool success; + + // The envelope parsed from the plaintext + session_protocol_envelope envelope; + + // Decrypted envelope content into plaintext + span_u8 content_plaintext; + + // Sender public key extracted from the encrypted content payload + uint8_t sender_ed25519_pubkey[32]; + + // Status flag for validity of the Session Pro proof embedded in the envelope if it has one. + // The status is set to `Nil` if there is no Session Pro proof in the message. Otherwise it's + // set to one of the other values to which the remaining pro fields will be populated with data + // parsed from the envelope. + PRO_STATUS pro_status; + + // The embedded Session Pro proof, only set if the status was not `Nil`. + pro_proof pro_proof; + + // Session Pro features that were used in the embedded message, only set if the status was not + // `Nil`. + PRO_FEATURES pro_features; +}; + +struct session_protocol_encrypted_for_destination { + bool success; + + // Indicates if the ciphertext was encrypted or not. This can be false if the message sent to + // the destination and namespace does not require encryption. In this case `ciphertext` is not + // set and the user should proceed with the original plaintext. + bool encrypted; + + // The plaintext encrypted in a manner suitable for the desired destination and namespace. This + // is not set if `encrypted` is false. + span_u8 ciphertext; +}; + +LIBSESSION_EXPORT +PRO_FEATURES session_protocol_get_pro_features_for_msg(const span_u8 msg, PRO_FEATURES flags); + +LIBSESSION_EXPORT +session_protocol_encrypted_for_destination session_protocol_encrypt_for_destination( + const span_u8 plaintext, + const span_u8 ed25519_privkey, + const session_protocol_destination* dest, + NAMESPACE space); + +LIBSESSION_EXPORT +session_protocol_decrypted_envelope session_protocol_decrypt_envelope( + const span_u8 ed25519_privkey, const span_u8 envelope_plaintext, uint64_t unix_ts); + #ifdef __cplusplus } #endif diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index 82a63353..bdb814b8 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -61,20 +61,12 @@ struct Destination { }; enum class EnvelopeType { - SessionMessage, - ClosedGroupMessage, -}; - -typedef uint32_t EnvelopeFlags; -enum EnvelopeFlags_ { - EnvelopeFlags_Source = 1 << 0, - EnvelopeFlags_SourceDevice = 1 << 1, - EnvelopeFlags_ServerTimestamp = 1 << 2, - EnvelopeFlags_ProSig = 1 << 3, + SessionMessage = ENVELOPE_TYPE_SESSION_MESSAGE, + ClosedGroupMessage = ENVELOPE_TYPE_CLOSED_GROUP_MESSGE, }; struct Envelope { - EnvelopeFlags flags; + ENVELOPE_FLAGS flags; EnvelopeType type; uint64_t timestamp; @@ -87,9 +79,6 @@ struct Envelope { array_uc64 pro_sig; }; -using ProFeatures = session_pro_features; -using ProExtraFeatures = session_pro_extra_features; - struct DecryptedEnvelope { // The envelope parsed from the plaintext Envelope envelope; @@ -98,7 +87,7 @@ struct DecryptedEnvelope { std::vector content_plaintext; // Sender public key extracted from the encrypted content payload - std::vector sender_ed25519_pubkey; + array_uc32 sender_ed25519_pubkey; // Status flag for validity of the Session Pro proof embedded in the envelope if it has one. // The status is set to `Nil` if there is no Session Pro proof in the message. Otherwise it's @@ -109,12 +98,12 @@ struct DecryptedEnvelope { // The embedded Session Pro proof, only set if the status was not `Nil`. config::ProProof pro_proof; - // Session Pro features that were used in the embedded message, only set if the status was not - // `Nil`. - ProFeatures pro_features; + // Session Pro bit flag features that were used in the embedded message, only set if the status + // was not `Nil`. + PRO_FEATURES pro_features; }; -struct EncryptedForNamespaceDest +struct EncryptedForDestination { // Indicates if the ciphertext was encrypted or not. This can be false if the message sent to // the destination and namespace does not require encryption. In this case `ciphertext` is not @@ -139,9 +128,9 @@ struct EncryptedForNamespaceDest /// Outputs: /// - Session Pro feature flags suitable for writing directly into the protobuf `ProMessage` in /// `Content` -ProFeatures get_pro_features_for_msg(std::span msg, ProExtraFeatures flags); +PRO_FEATURES get_pro_features_for_msg(std::span msg, PRO_FEATURES flags); -/// API: session_protocol/encrypt_for_namespaced_destination +/// API: session_protocol/encrypt_for_destination /// /// Given an unencrypted plaintext representation of the content (i.e.: protobuf encoded stream of /// `Content`), encrypt and/or wrap the plaintext in the necessary structures for transmission on @@ -174,7 +163,7 @@ ProFeatures get_pro_features_for_msg(std::span msg, ProExtr /// - The encryption result for the plaintext. If the destination and namespace combination did not /// require encryption, no payload is returned in the ciphertext and the user should proceed with /// the plaintext. This should be validated by checking the `encrypted` flag on the result. -EncryptedForNamespaceDest encrypt_for_namespaced_destination( +EncryptedForDestination encrypt_for_destination( std::span plaintext, std::span ed25519_privkey, const Destination& dest, diff --git a/include/session/types.h b/include/session/types.h new file mode 100644 index 00000000..b7e542cf --- /dev/null +++ b/include/session/types.h @@ -0,0 +1,21 @@ +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct span_u8 +{ + uint8_t *data; + size_t size; +}; + +span_u8 span_u8_alloc_or_throw(size_t size); +span_u8 span_u8_copy_or_throw(const void *data, size_t size); + +#ifdef __cplusplus +} +#endif diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a0eff5fc..469b96c8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -54,6 +54,7 @@ add_libsession_util_library(crypto sodium_array.cpp xed25519.cpp pro_backend.cpp + types.cpp ) add_libsession_util_library(config diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index dd24cfea..a57c7a87 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -1,6 +1,7 @@ -#include #include +#include +#include #include #include #include @@ -10,27 +11,51 @@ #include "SessionProtos.pb.h" #include "WebSocketResources.pb.h" +#include "session/export.h" namespace session { -ProFeatures get_pro_features_for_msg(std::span msg, ProExtraFeatures extra) { - ProFeatures result = session_pro_features_nil; - if (msg.size() >= SESSION_PRO_10k_CHARACTER_LIMIT) - result |= session_pro_features_10k_character_limit; - if (extra & session_pro_extra_features_animated_avatar) - result |= session_pro_features_animated_avatar; - if (extra & session_pro_extra_features_pro_badge) - result |= session_pro_features_pro_badge; +PRO_FEATURES get_pro_features_for_msg(std::span msg, PRO_EXTRA_FEATURES extra) { + PRO_FEATURES result = PRO_FEATURES_NIL; + + if (msg.size() >= PRO_10K_CHARACTER_LIMIT) + result |= PRO_FEATURES_10K_CHARACTER_LIMIT; + + if (extra & PRO_EXTRA_FEATURES_ANIMATED_AVATAR) + result |= PRO_FEATURES_ANIMATED_AVATAR; + + if (extra & PRO_EXTRA_FEATURES_PRO_BADGE) + result |= PRO_FEATURES_PRO_BADGE; + + assert((result & ~PRO_FEATURES_ALL) == 0); return result; } -EncryptedForNamespaceDest encrypt_for_namespaced_destination( - std::span plaintext, - std::span ed25519_privkey, - const Destination& dest, - config::Namespace space) { - - EncryptedForNamespaceDest result = {}; +struct EncryptedForDestinationInternal +{ + bool encrypted; + std::vector ciphertext_cpp; + span_u8 ciphertext_c; +}; + +enum class UseMalloc { No, Yes }; +static EncryptedForDestinationInternal encrypt_for_destination_internal( + const std::span plaintext, + const std::span ed25519_privkey, + DestinationType dest_type, + const uint8_t* dest_pro_sig, + const uint8_t* dest_recipient_pubkey, + std::chrono::milliseconds dest_sent_timestamp_ms, + const uint8_t* dest_open_group_inbox_server_pubkey, + const uint8_t* dest_closed_group_pubkey, + const config::groups::Keys* dest_closed_group_keys, + const uint8_t* dest_closed_group_swarm_public_key, + config::Namespace space, + UseMalloc use_malloc) { + + // All incoming arguments are passed in from typed, fixed-sized arrays so we do not check + // the pointer lengths of those arguments. + EncryptedForDestinationInternal result = {}; enum class Mode { Envelope, Plaintext, @@ -57,13 +82,13 @@ EncryptedForNamespaceDest encrypt_for_namespaced_destination( // Figure out how to encrypt the message based on the destination and setup the encoding context EncodeContext enc = {}; - switch (dest.type) { + switch (dest_type) { case DestinationType::ClosedGroup: { bool has_03_prefix = - dest.closed_group_pubkey[0] == static_cast(SessionIDPrefix::group); + dest_closed_group_pubkey[0] == static_cast(SessionIDPrefix::group); if (has_03_prefix) { if (space == config::Namespace::GroupMessages) { - if (!dest.closed_group_keys) + if (!dest_closed_group_keys) throw std::runtime_error( "API misuse: Sending to a closed group into the group messages " "namespace requires the closed group keys to be set"); @@ -86,11 +111,11 @@ EncryptedForNamespaceDest encrypt_for_namespaced_destination( SessionProtos::Envelope_Type::Envelope_Type_CLOSED_GROUP_MESSAGE; enc.after_envelope = AfterEnvelope::WrapInWSMessage; - if (!dest.closed_group_swarm_public_key) + if (!dest_closed_group_swarm_public_key) throw std::runtime_error( "API misuse: Closed group swarm public key must be set on non 0x03 " "prefixed group keys"); - enc.envelope_src = *dest.closed_group_swarm_public_key; + enc.envelope_src = {dest_closed_group_swarm_public_key, sizeof(array_uc33)}; } } break; @@ -131,7 +156,7 @@ EncryptedForNamespaceDest encrypt_for_namespaced_destination( std::span src_text = plaintext; if (enc.before_envelope_encrypt_for_recipient_deterministic) { enc.before_envelope_ciphertext = session::encrypt_for_recipient_deterministic( - ed25519_privkey, dest.recipient_pubkey, plaintext); + ed25519_privkey, {dest_recipient_pubkey, sizeof(array_uc32)}, src_text); src_text = enc.before_envelope_ciphertext; } @@ -141,12 +166,12 @@ EncryptedForNamespaceDest encrypt_for_namespaced_destination( SessionProtos::Envelope envelope = {}; envelope.set_type(*enc.envelope_type); envelope.set_sourcedevice(1); - envelope.set_timestamp(dest.sent_timestamp_ms.count()); + envelope.set_timestamp(dest_sent_timestamp_ms.count()); envelope.set_content(src_text.data(), src_text.size()); if (enc.envelope_src) envelope.set_source(reinterpret_cast(enc.envelope_src->data()), enc.envelope_src->size()); - if (dest.pro_sig) - envelope.set_prosig(reinterpret_cast(dest.pro_sig->data()), dest.pro_sig->size()); + if (dest_pro_sig) + envelope.set_prosig(reinterpret_cast(dest_pro_sig), sizeof(array_uc64)); result.encrypted = true; switch (enc.after_envelope) { @@ -166,24 +191,43 @@ EncryptedForNamespaceDest encrypt_for_namespaced_destination( msg.set_allocated_request(&req_msg); // Write message as ciphertext - result.ciphertext.resize(msg.ByteSizeLong()); - msg.SerializeToArray(result.ciphertext.data(), result.ciphertext.size()); + void *dest = nullptr; + if (use_malloc == UseMalloc::Yes) { + result.ciphertext_c = span_u8_alloc_or_throw(envelope.ByteSizeLong()); + msg.SerializeToArray(result.ciphertext_c.data, result.ciphertext_c.size); + } else { + result.ciphertext_cpp.resize(msg.ByteSizeLong()); + msg.SerializeToArray( + result.ciphertext_cpp.data(), result.ciphertext_cpp.size()); + } } break; case AfterEnvelope::KeysEncryptMessage: { - assert(dest.closed_group_keys && + assert(dest_closed_group_keys && "Dev error, API miuse was not detected. We should throw an exception " - "when this happens"); + "when this happens earlier"); std::string bytes = envelope.SerializeAsString(); - result.ciphertext = dest.closed_group_keys->encrypt_message( - std::span( - reinterpret_cast(bytes.data()), bytes.size())); + std::vector ciphertext = dest_closed_group_keys->encrypt_message( + {reinterpret_cast(bytes.data()), bytes.size()}); + if (use_malloc == UseMalloc::Yes) { + result.ciphertext_c = + span_u8_copy_or_throw(ciphertext.data(), ciphertext.size()); + } else { + result.ciphertext_cpp = std::move(ciphertext); + } } break; case AfterEnvelope::EnvelopeIsCipherText: { - result.ciphertext.resize(envelope.ByteSizeLong()); - envelope.SerializeToArray(result.ciphertext.data(), result.ciphertext.size()); + if (use_malloc == UseMalloc::Yes) { + result.ciphertext_c = span_u8_alloc_or_throw(envelope.ByteSizeLong()); + envelope.SerializeToArray( + result.ciphertext_c.data, result.ciphertext_c.size); + } else { + result.ciphertext_cpp.resize(envelope.ByteSizeLong()); + envelope.SerializeToArray( + result.ciphertext_cpp.data(), result.ciphertext_cpp.size()); + } } break; } @@ -195,17 +239,61 @@ EncryptedForNamespaceDest encrypt_for_namespaced_destination( case Mode::EncryptForBlindedRecipient: { result.encrypted = true; - result.ciphertext = encrypt_for_blinded_recipient( + std::vector ciphertext = encrypt_for_blinded_recipient( ed25519_privkey, - dest.open_group_inbox_server_pubkey, - dest.recipient_pubkey, // recipient blinded pubkey + {dest_open_group_inbox_server_pubkey, sizeof(array_uc32)}, + {dest_recipient_pubkey, sizeof(array_uc32)}, // recipient blinded pubkey plaintext); + + if (use_malloc == UseMalloc::Yes) { + result.ciphertext_c = span_u8_copy_or_throw(ciphertext.data(), ciphertext.size()); + } else { + result.ciphertext_cpp = std::move(ciphertext); + } } break; } return result; } +EncryptedForDestination encrypt_for_destination( + std::span plaintext, + std::span ed25519_privkey, + const Destination& dest, + config::Namespace space) { + + EncryptedForDestinationInternal result_internal = encrypt_for_destination_internal( + /*plaintext=*/plaintext, + /*ed25519_privkey=*/ed25519_privkey, + /*dest_type=*/dest.type, + /*dest_pro_sig=*/dest.pro_sig ? dest.pro_sig->data() : nullptr, + /*dest_recipient_pubkey=*/dest.recipient_pubkey.data(), + /*dest_sent_timestamp_ms=*/dest.sent_timestamp_ms, + /*dest_open_group_inbox_server_pubkey=*/dest.open_group_inbox_server_pubkey.data(), + /*dest_closed_group_pubkey=*/dest.closed_group_pubkey.data(), + /*dest_closed_group_keys=*/dest.closed_group_keys, + /*dest_closed_group_swarm_public_key=*/dest.closed_group_swarm_public_key + ? dest.closed_group_swarm_public_key->data() + : nullptr, + /*space=*/space, + /*use_malloc=*/UseMalloc::No); + + EncryptedForDestination result = { + .encrypted = result_internal.encrypted, + .ciphertext = std::move(result_internal.ciphertext_cpp), + }; + return result; +} + +struct DecryptedEnvelopeInternal { + Envelope envelope; + std::vector content_plaintext; + std::vector sender_ed25519_pubkey; + ProStatus pro_status; + config::ProProof pro_proof; + PRO_FEATURES pro_features; +}; + DecryptedEnvelope decrypt_envelope( std::span ed25519_privkey, std::span envelope_plaintext, @@ -240,31 +328,44 @@ DecryptedEnvelope decrypt_envelope( "Parse envelope failed, source had unexpected size ({} bytes)", source.size())); std::memcpy(result.envelope.source.data(), source.data(), source.size()); - result.envelope.flags |= EnvelopeFlags_Source; + result.envelope.flags |= ENVELOPE_FLAGS_SOURCE; } // Parse source device (optional) if (envelope.has_sourcedevice()) { result.envelope.source_device = envelope.sourcedevice(); - result.envelope.flags |= EnvelopeFlags_SourceDevice; + result.envelope.flags |= ENVELOPE_FLAGS_SOURCE_DEVICE; } // Parse server timestamp (optional) if (envelope.has_servertimestamp()) { result.envelope.server_timestamp = envelope.servertimestamp(); - result.envelope.flags |= EnvelopeFlags_ServerTimestamp; + result.envelope.flags |= ENVELOPE_FLAGS_SERVER_TIMESTAMP; } - // Parse content (unconditionallty) + // Parse content if (!envelope.has_content()) throw std::runtime_error{"Parse decrypted message failed, missing content"}; + // Decrypt content const std::string& content_str = envelope.content(); auto content_span = std::span( reinterpret_cast(content_str.data()), content_str.size()); - std::tie(result.content_plaintext, result.sender_ed25519_pubkey) = + auto [content_plaintext, sender_ed25519_pubkey] = session::decrypt_incoming(ed25519_privkey, content_span); - + assert(result.sender_ed25519_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); + + result.content_plaintext = std::move(content_plaintext); + std::memcpy( + result.sender_ed25519_pubkey.data(), + sender_ed25519_pubkey.data(), + result.sender_ed25519_pubkey.size()); + + // TODO: We parse the content in libsession to extract pro metadata but we return the unparsed + // blob back to the caller. This is temporary, eventually we will return a proxy structure for + // the protobuf Content type to the user. We avoid returning the direct protobuf type to keep + // the interface simple and avoid leaking protobuf implementation detail into the libsession + // interface. SessionProtos::Content content = {}; if (!envelope.ParseFromArray(result.content_plaintext.data(), result.content_plaintext.size())) throw std::runtime_error{"Parse content from envelope failed"}; @@ -280,7 +381,7 @@ DecryptedEnvelope decrypt_envelope( static_assert(sizeof(result.envelope.pro_sig) == crypto_sign_ed25519_BYTES); std::memcpy(result.envelope.pro_sig.data(), pro_sig.data(), pro_sig.size()); - result.envelope.flags |= EnvelopeFlags_ProSig; + result.envelope.flags |= ENVELOPE_FLAGS_PRO_SIG; SessionProtos::ProMessage pro_msg = content.promessage(); if (!pro_msg.has_proof()) @@ -344,3 +445,124 @@ DecryptedEnvelope decrypt_envelope( return result; } } // namespace session + +using namespace session; + +LIBSESSION_EXPORT +PRO_FEATURES session_protocol_get_pro_features_for_msg(const span_u8 msg, PRO_FEATURES flags) +{ + PRO_FEATURES result = get_pro_features_for_msg({msg.data, msg.size}, flags); + return result; +} + +LIBSESSION_EXPORT session_protocol_encrypted_for_destination +session_protocol_encrypt_for_destination( + const span_u8 plaintext, + const span_u8 ed25519_privkey, + const session_protocol_destination* dest, + NAMESPACE space) +{ + session_protocol_encrypted_for_destination result = {}; + try { + EncryptedForDestinationInternal result_internal = encrypt_for_destination_internal( + /*plaintext=*/{plaintext.data, plaintext.size}, + /*ed25519_privkey=*/{ed25519_privkey.data, ed25519_privkey.size}, + /*dest_type=*/static_cast(dest->type), + /*dest_pro_sig=*/dest->has_pro_sig ? dest->pro_sig : nullptr, + /*dest_recipient_pubkey=*/dest->recipient_pubkey, + /*dest_sent_timestamp_ms=*/std::chrono::milliseconds(dest->sent_timestamp_ms), + /*dest_open_group_inbox_server_pubkey=*/dest->open_group_inbox_server_pubkey, + /*dest_closed_group_pubkey=*/dest->closed_group_pubkey, + /*dest_closed_group_keys=*/ + static_cast(dest->closed_group_keys->internals), + /*dest_closed_group_swarm_public_key=*/dest->has_closed_group_swarm_public_key + ? dest->closed_group_swarm_public_key + : nullptr, + /*space=*/static_cast(space), + /*use_malloc=*/UseMalloc::Yes); + + result = { + .success = true, + .encrypted = result_internal.encrypted, + .ciphertext = result_internal.ciphertext_c, + }; + } catch (...) { + } + + return result; +} + +LIBSESSION_EXPORT +session_protocol_decrypted_envelope session_protocol_decrypt_envelope( + const span_u8 ed25519_privkey, const span_u8 envelope_plaintext, uint64_t unix_ts) +{ + session_protocol_decrypted_envelope result = {}; + try { + DecryptedEnvelope result_cpp = decrypt_envelope( + {ed25519_privkey.data, ed25519_privkey.size}, + {envelope_plaintext.data, envelope_plaintext.size}, + std::chrono::sys_seconds(std::chrono::seconds(unix_ts))); + + // Marshall into c type + result = { + .success = false, + .envelope = + { + .flags = result_cpp.envelope.flags, + .type = static_cast(result_cpp.envelope.type), + .timestamp = result_cpp.envelope.timestamp, + .source = {}, + .source_device = result_cpp.envelope.source_device, + .server_timestamp = result_cpp.envelope.server_timestamp, + .pro_sig = {}, + }, + .content_plaintext = {}, + .sender_ed25519_pubkey = {}, + .pro_status = static_cast(result_cpp.pro_status), + .pro_proof = + { + .version = result_cpp.pro_proof.version, + .gen_index_hash = {}, + .rotating_pubkey = {}, + .expiry_unix_ts = static_cast( + result_cpp.pro_proof.expiry_unix_ts.time_since_epoch() + .count()), + .sig = {}, + }, + .pro_features = result_cpp.pro_features}; + + std::memcpy( + result.envelope.source, + result_cpp.envelope.source.data(), + sizeof(result.envelope.source)); + std::memcpy( + result.envelope.pro_sig, + result_cpp.envelope.pro_sig.data(), + sizeof(result.envelope.pro_sig)); + + result.content_plaintext = span_u8_copy_or_throw( + result_cpp.content_plaintext.data(), result_cpp.content_plaintext.size()); + std::memcpy( + result.sender_ed25519_pubkey, + result_cpp.sender_ed25519_pubkey.data(), + sizeof(result.sender_ed25519_pubkey)); + + std::memcpy( + result.pro_proof.gen_index_hash, + result_cpp.pro_proof.gen_index_hash.data(), + sizeof(result.pro_proof.gen_index_hash)); + std::memcpy( + result.pro_proof.rotating_pubkey, + result_cpp.pro_proof.rotating_pubkey.data(), + sizeof(result.pro_proof.rotating_pubkey)); + std::memcpy( + result.pro_proof.sig, + result_cpp.pro_proof.sig.data(), + sizeof(result.pro_proof.sig)); + + result.success = true; + } catch (...) { + } + + return result; +} diff --git a/src/types.cpp b/src/types.cpp new file mode 100644 index 00000000..a2c53461 --- /dev/null +++ b/src/types.cpp @@ -0,0 +1,21 @@ +#include + +#include + +span_u8 span_u8_alloc_or_throw(size_t size) +{ + span_u8 result = {}; + result.size = size; + result.data = static_cast(malloc(size)); + if (!result.data) + throw std::runtime_error( + fmt::format("Failed to allocate {} bytes for span, out of memory", size)); + return result; +} + +span_u8 span_u8_copy_or_throw(const void *data, size_t size) +{ + span_u8 result = span_u8_alloc_or_throw(size); + std::memcpy(result.data, data, result.size); + return result; +} From afb7ad2bbbe9fd445da8a653e4221a449435b878 Mon Sep 17 00:00:00 2001 From: doylet Date: Mon, 11 Aug 2025 17:41:38 +1000 Subject: [PATCH 19/59] Revise docs for session protocol c header --- include/session/session_protocol.h | 127 +++++++++++++++++------------ 1 file changed, 77 insertions(+), 50 deletions(-) diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index 3ae234d7..72d10759 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -5,6 +5,9 @@ #include "export.h" #include "types.h" +/// The C header for session_protocol. See the CPP header for more indepth comments. Only the +/// differences between the C and CPP headers are documented to avoid duplication. + struct config_group_keys; #ifdef __cplusplus @@ -33,10 +36,10 @@ enum PRO_FEATURES_ { }; enum PRO_STATUS { - PRO_STATUS_NIL, // Pro proof was not set - PRO_STATUS_INVALID, // Pro proof was set; signature validation failed - PRO_STATUS_VALID, // Pro proof was set, is verified; has not expired - PRO_STATUS_EXPIRED, // Pro proof was set, is verified; has expired + PRO_STATUS_NIL, + PRO_STATUS_INVALID, + PRO_STATUS_VALID, + PRO_STATUS_EXPIRED, }; enum DESTINATION_TYPE { @@ -50,33 +53,20 @@ enum DESTINATION_TYPE { struct session_protocol_destination { DESTINATION_TYPE type; - // Signature over the plaintext with the user's Session Pro rotating public key if they have - // Session Pro and opt into sending a message with pro features. If this is specified, the pro - // message component in `Content` must have been set with the corresponding proof for this - // signature. - uint8_t pro_sig[64]; + // The pro signature is optional, set this flag to true to make the encryption function take + // into account the signature or otherwise the signature is ignored. bool has_pro_sig; - - // Set to the recipient of the message if it requires one. Ignored otherwise (for example - // ignored in OpenGroup) + uint8_t pro_sig[64]; uint8_t recipient_pubkey[32]; - - // The timestamp to assign to the message envelope if the message requires one. Ignored - // otherwise uint64_t sent_timestamp_ms; - - // When type => OpenGroupInbox: set this pubkey to the server's key uint8_t open_group_inbox_server_pubkey[32]; - - // When type => ClosedGroup: set the following 'closed_group' prefixed fields uint8_t closed_group_pubkey[33]; const config_group_keys* closed_group_keys; - // Set to the closed group's swarm public key (needed for Android) for a non 0x03 prefixed - // `closed_group_pubkey`. Ignored otherwise. This will be set as the envelope source. See: - // https://github.com/session-foundation/session-ios/blob/82deef869d0f7389b799295817f42ad14f8a1316/SessionMessagingKit/Sending%20%26%20Receiving/MessageSender.swift#L469 - uint8_t closed_group_swarm_public_key[33]; + // The closed group swarm public key is optional but should be set for a non 0x03 prefix + // `closed_group_pubkey`. Otherwise the public key is ignored when encrypting for a destination. bool has_closed_group_swarm_public_key; + uint8_t closed_group_swarm_public_key[33]; }; enum ENVELOPE_TYPE { @@ -96,10 +86,6 @@ struct session_protocol_envelope { ENVELOPE_FLAGS flags; ENVELOPE_TYPE type; uint64_t timestamp; - - /// Optional fields. These fields are set if the appropriate flag has been set in `flags` - /// otherwise the corresponding values are to be ignored and those fields will be - /// zero-initialised. uint8_t source[33]; uint32_t source_device; uint64_t server_timestamp; @@ -107,47 +93,65 @@ struct session_protocol_envelope { }; struct session_protocol_decrypted_envelope { + // Indicates if the decryption was successful. If the decryption step failed and threw an + // exception, this is false. bool success; - - // The envelope parsed from the plaintext session_protocol_envelope envelope; - - // Decrypted envelope content into plaintext span_u8 content_plaintext; - - // Sender public key extracted from the encrypted content payload uint8_t sender_ed25519_pubkey[32]; - - // Status flag for validity of the Session Pro proof embedded in the envelope if it has one. - // The status is set to `Nil` if there is no Session Pro proof in the message. Otherwise it's - // set to one of the other values to which the remaining pro fields will be populated with data - // parsed from the envelope. PRO_STATUS pro_status; - - // The embedded Session Pro proof, only set if the status was not `Nil`. pro_proof pro_proof; - - // Session Pro features that were used in the embedded message, only set if the status was not - // `Nil`. PRO_FEATURES pro_features; }; struct session_protocol_encrypted_for_destination { + // Indicates if the decryption was successful. If the decryption step failed and threw an + // exception, this is false. bool success; - - // Indicates if the ciphertext was encrypted or not. This can be false if the message sent to - // the destination and namespace does not require encryption. In this case `ciphertext` is not - // set and the user should proceed with the original plaintext. bool encrypted; - - // The plaintext encrypted in a manner suitable for the desired destination and namespace. This - // is not set if `encrypted` is false. span_u8 ciphertext; }; +/// API: session_protocol/session_protocol_get_pro_features_for_msg +/// +/// Determine the Pro features that are used in a given conversation message. +/// +/// Inputs: +/// - `msg` -- the conversation message to determine if the message is requires access to the 10k +/// character limit available in Session Pro +/// - `flags` -- extra pro features that are known by clients that they wish to be activated on +/// this message +/// +/// Outputs: +/// - Session Pro feature flags suitable for writing directly into the protobuf `ProMessage` in +/// `Content` LIBSESSION_EXPORT PRO_FEATURES session_protocol_get_pro_features_for_msg(const span_u8 msg, PRO_FEATURES flags); +/// API: session_protocol/session_protocol_encrypt_for_destination +/// +/// Given an unencrypted plaintext representation of the content (i.e.: protobuf encoded stream of +/// `Content`), encrypt and/or wrap the plaintext in the necessary structures for transmission on +/// the Session Protocol. +/// +/// See: session_protocol/encrypt_for_destination for more information +/// +/// Inputs: +/// - `plaintext` -- the protobuf serialised payload containing the protobuf encoded stream, +/// `Content`. It must not be already be encrypted. +/// - `ed25519_privkey` -- the libsodium-style secret key of the sender, 64 bytes. Can also be +/// passed as a 32-byte seed. Used to encrypt the plaintext. +/// - `dest` -- the extra metadata indicating the destination of the message and the necessary data +/// to encrypt a message for that destination. +/// - `space` -- the namespace to encrypt the message for +/// +/// Outputs: +/// - The encryption result for the plaintext. If the destination and namespace combination did not +/// require encryption, no payload is returned in the ciphertext and the user should proceed with +/// the plaintext. This should be validated by checking the `encrypted` flag on the result. +/// +/// The success flag is set if encryption was successful, if the underlying implementation threw +/// an exception then this is set to false. LIBSESSION_EXPORT session_protocol_encrypted_for_destination session_protocol_encrypt_for_destination( const span_u8 plaintext, @@ -155,6 +159,29 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_for_destinat const session_protocol_destination* dest, NAMESPACE space); +/// API: session_protocol/session_protocol_decrypt_envelope +/// +/// Given an unencrypted plaintext representation of an envelope (i.e.: protobuf encoded stream of +/// `Envelope`) parse the envelope and return the envelope content decrypted to plaintext with the +/// passed in key. +/// +/// See: session_protocol/decrypt_envelope for more information +/// +/// Inputs: +/// - `ed25519_privkey` -- the libsodium-style secret key of the sender, 64 bytes. Can also be +/// passed as a 32-byte seed. Used to decrypt the encrypted content. +/// - `envelope_plaintext` -- the protobuf serialised payload containing the message envelope. The +/// envelope must already be decrypted if it was originally encrypted (i.e.: closed group +/// envelopes). +/// - `unix_ts` -- pass in the current system time which is used to determine, if present in the +/// envelope, whether or not the Session Pro proof has expired or not. +/// +/// Outputs: +/// - The decrypted envelope. It contains the fields of the envelope and the Session Pro metadata +/// within the envelope if there were any. +/// +/// The success flag is set if encryption was successful, if the underlying implementation threw +/// an exception then this is set to false. LIBSESSION_EXPORT session_protocol_decrypted_envelope session_protocol_decrypt_envelope( const span_u8 ed25519_privkey, const span_u8 envelope_plaintext, uint64_t unix_ts); From a1d90a56088b48fc646e30480e880a571dde6728 Mon Sep 17 00:00:00 2001 From: doylet Date: Tue, 12 Aug 2025 11:48:01 +1000 Subject: [PATCH 20/59] Fix incorrect detection of higher char limits and non-optional pro sigs --- include/session/session_protocol.h | 7 ++- include/session/session_protocol.hpp | 26 ++++++++- include/session/types.h | 13 ++++- src/session_protocol.cpp | 83 ++++++++++++++++++---------- 4 files changed, 94 insertions(+), 35 deletions(-) diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index 72d10759..84f56c6b 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -15,7 +15,10 @@ extern "C" { #endif enum { - PRO_10K_CHARACTER_LIMIT = 10'000, + /// Number of characters that a standard message can use. If the message exceeds this then the + /// message must activate the higher character limit feature provided by Session Pro which + /// allows messages up to 10k characters. + PRO_STANDARD_CHARACTER_LIMIT = 2'000, }; typedef uint64_t PRO_EXTRA_FEATURES; @@ -85,7 +88,7 @@ enum ENVELOPE_FLAGS_ { struct session_protocol_envelope { ENVELOPE_FLAGS flags; ENVELOPE_TYPE type; - uint64_t timestamp; + uint64_t timestamp_ms; uint8_t source[33]; uint32_t source_device; uint64_t server_timestamp; diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index bdb814b8..8c31621f 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -9,6 +9,28 @@ /// A complimentary file to session encrypt which has the low level encryption function for Session /// protocol types. This file contains high-level helper functions for decoding payloads on the /// Session protocol. Prefer functions here before resorting to the lower-level cryptography. + +// NOTE: CPP doesn't support named bitfields without casting or operator overloads but C-style +// enums support it very well. The only issue is that using a native C-style enum enforces some type +// restrictions that compilers dislike when attempting to manipulate bit fields. For example: +// +// enum Feature {x = 1 << 0, y = 1 << 1} +// Feature f = x | y +// +// Causes the compiler to complain about trying to do bit ops/assign an unsigned integer to an enum +// `Feature`. We use a common C pattern/trick by suffixing an underscore to the the original enum, +// then type define the non-suffixed enum to an unsigned integer: +// +// enum Feature_ {x = 1 << 0, y = 1 << 1} +// typedef U64 Feature +// Feature f = x | y +// +// Does not trigger errors as the underlying type of `f` is actually an unsigned integer. The type +// define is merely a hint to the user to what flags are to be used when manipulating the variable. +// +// Hence in the CPP file we use C-style enums for bitfields and CPP-style enums for non-bitfield +// enums where we can to benefit from the type-safety of strong enums. + namespace session { namespace config::groups { @@ -68,7 +90,7 @@ enum class EnvelopeType { struct Envelope { ENVELOPE_FLAGS flags; EnvelopeType type; - uint64_t timestamp; + std::chrono::milliseconds timestamp; /// Optional fields. These fields are set if the appropriate flag has been set in `flags` /// otherwise the corresponding values are to be ignored and those fields will be @@ -76,6 +98,8 @@ struct Envelope { array_uc33 source; uint32_t source_device; uint64_t server_timestamp; + + /// Signature by the sending client's rotating key array_uc64 pro_sig; }; diff --git a/include/session/types.h b/include/session/types.h index b7e542cf..529a5354 100644 --- a/include/session/types.h +++ b/include/session/types.h @@ -7,13 +7,20 @@ extern "C" { #endif -struct span_u8 -{ - uint8_t *data; +/// C friendly buffer structure that is a pointer and lenght to a span of bytes. +struct span_u8 { + uint8_t* data; size_t size; }; +/// Create a span of bytes that owns the `size` bytes of memory requested. If allocation fails, this +/// function throws a runtime exception. The `data` pointer is span must be freed once the span +/// is no longer needed. span_u8 span_u8_alloc_or_throw(size_t size); + +/// Create a span of bytes that copies the payload at `data` for `size` bytes. If allocation fails +/// this function throws a runtime exception. The `data` pointer is span must be freed once the span +/// is no longer needed. span_u8 span_u8_copy_or_throw(const void *data, size_t size); #ifdef __cplusplus diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index a57c7a87..c24bcf34 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -1,7 +1,8 @@ #include +#include #include +#include -#include #include #include #include @@ -18,7 +19,7 @@ namespace session { PRO_FEATURES get_pro_features_for_msg(std::span msg, PRO_EXTRA_FEATURES extra) { PRO_FEATURES result = PRO_FEATURES_NIL; - if (msg.size() >= PRO_10K_CHARACTER_LIMIT) + if (msg.size() >= PRO_STANDARD_CHARACTER_LIMIT) result |= PRO_FEATURES_10K_CHARACTER_LIMIT; if (extra & PRO_EXTRA_FEATURES_ANIMATED_AVATAR) @@ -31,8 +32,10 @@ PRO_FEATURES get_pro_features_for_msg(std::span msg, PRO_EXTRA_FE return result; } -struct EncryptedForDestinationInternal -{ +// Interop between the C and CPP API. The C api will request malloc which writes to `ciphertext_c`. +// This pointer is taken verbatim and avoids requiring a copy from the CPP vector. The CPP api will +// steal the contents from `ciphertext_cpp`. +struct EncryptedForDestinationInternal { bool encrypted; std::vector ciphertext_cpp; span_u8 ciphertext_c; @@ -62,20 +65,27 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( EncryptForBlindedRecipient, }; + // The step to partake after enveloping the content payload enum class AfterEnvelope { Nil, - EnvelopeIsCipherText, - WrapInWSMessage, - KeysEncryptMessage, + EnvelopeIsCipherText, // No extra bit-mangling required after enveloping + WrapInWSMessage, // Wrap in the protobuf websocket message after enveloping + KeysEncryptMessage, // Encrypt with the closed group keys after ennveloping }; struct EncodeContext { Mode mode; - // Parameters for BuildMode => Envelope bool before_envelope_encrypt_for_recipient_deterministic; + + // Ciphertext storing the result of encrypt for recipient deterministic, if it was necessary + // to encrypt before enveloping. std::vector before_envelope_ciphertext; + + // Payload to set the envelope source if necessary. std::optional> envelope_src; + + // Type of message to mark the enevelope as std::optional envelope_type; AfterEnvelope after_envelope; }; @@ -169,9 +179,20 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( envelope.set_timestamp(dest_sent_timestamp_ms.count()); envelope.set_content(src_text.data(), src_text.size()); if (enc.envelope_src) - envelope.set_source(reinterpret_cast(enc.envelope_src->data()), enc.envelope_src->size()); - if (dest_pro_sig) - envelope.set_prosig(reinterpret_cast(dest_pro_sig), sizeof(array_uc64)); + envelope.set_source( + reinterpret_cast(enc.envelope_src->data()), + enc.envelope_src->size()); + + if (dest_pro_sig) { + envelope.set_prosig( + reinterpret_cast(dest_pro_sig), sizeof(array_uc64)); + } else { + // If there's no pro signature specified, we still fill out the pro signature with a + // dummy 64 byte stream. This is to make pro and non-pro messages indistinguishable. + std::string *pro_sig = envelope.mutable_prosig(); + pro_sig->resize(sizeof(array_uc64)); + randombytes_buf(pro_sig->data(), pro_sig->size()); + } result.encrypted = true; switch (enc.after_envelope) { @@ -191,7 +212,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( msg.set_allocated_request(&req_msg); // Write message as ciphertext - void *dest = nullptr; + void* dest = nullptr; if (use_malloc == UseMalloc::Yes) { result.ciphertext_c = span_u8_alloc_or_throw(envelope.ByteSizeLong()); msg.SerializeToArray(result.ciphertext_c.data, result.ciphertext_c.size); @@ -320,7 +341,7 @@ DecryptedEnvelope decrypt_envelope( // Parse source (optional) if (envelope.has_source()) { // Libsession is now responsible for creating the envelope. The only data that we send in - // the source is a Session public key (see: encrypt_for_namespaced_destination) + // the source is a Session public key (see: encrypt_for_destination) const std::string& source = envelope.source(); if (source.size() != result.envelope.source.max_size()) throw std::runtime_error( @@ -370,19 +391,25 @@ DecryptedEnvelope decrypt_envelope( if (!envelope.ParseFromArray(result.content_plaintext.data(), result.content_plaintext.size())) throw std::runtime_error{"Parse content from envelope failed"}; - if (content.has_promessage()) { - // Parse the signature from the envelope if the content had a pro component to it - if (!envelope.has_prosig()) - throw std::runtime_error("Parse envelope failed, pro message is missing signature"); + // A signature must always be present on the envelope. This is to make a pro and non-pro + // envelope indistinguishable. If the message does not have pro then this signature must still + // be set but will be ignored. So in all instances a signature must be attached (real or + // dummy). + if (!envelope.has_prosig()) + throw std::runtime_error("Parse envelope failed, pro message is missing signature"); - const std::string& pro_sig = envelope.prosig(); - if (pro_sig.size() != crypto_sign_ed25519_BYTES) - throw std::runtime_error("Parse envelope failed, pro signature has wrong size"); + const std::string& pro_sig = envelope.prosig(); + if (pro_sig.size() != crypto_sign_ed25519_BYTES) + throw std::runtime_error("Parse envelope failed, pro signature has wrong size"); + static_assert(sizeof(result.envelope.pro_sig) == crypto_sign_ed25519_BYTES); - static_assert(sizeof(result.envelope.pro_sig) == crypto_sign_ed25519_BYTES); - std::memcpy(result.envelope.pro_sig.data(), pro_sig.data(), pro_sig.size()); + std::memcpy(result.envelope.pro_sig.data(), pro_sig.data(), pro_sig.size()); + + if (content.has_promessage()) { + // Mark the envelope as having a pro signature that the caller can use. result.envelope.flags |= ENVELOPE_FLAGS_PRO_SIG; + // Extract the pro message SessionProtos::ProMessage pro_msg = content.promessage(); if (!pro_msg.has_proof()) throw std::runtime_error("Parse decrypted message failed, pro config missing proof"); @@ -449,8 +476,7 @@ DecryptedEnvelope decrypt_envelope( using namespace session; LIBSESSION_EXPORT -PRO_FEATURES session_protocol_get_pro_features_for_msg(const span_u8 msg, PRO_FEATURES flags) -{ +PRO_FEATURES session_protocol_get_pro_features_for_msg(const span_u8 msg, PRO_FEATURES flags) { PRO_FEATURES result = get_pro_features_for_msg({msg.data, msg.size}, flags); return result; } @@ -460,8 +486,7 @@ session_protocol_encrypt_for_destination( const span_u8 plaintext, const span_u8 ed25519_privkey, const session_protocol_destination* dest, - NAMESPACE space) -{ + NAMESPACE space) { session_protocol_encrypted_for_destination result = {}; try { EncryptedForDestinationInternal result_internal = encrypt_for_destination_internal( @@ -494,8 +519,7 @@ session_protocol_encrypt_for_destination( LIBSESSION_EXPORT session_protocol_decrypted_envelope session_protocol_decrypt_envelope( - const span_u8 ed25519_privkey, const span_u8 envelope_plaintext, uint64_t unix_ts) -{ + const span_u8 ed25519_privkey, const span_u8 envelope_plaintext, uint64_t unix_ts) { session_protocol_decrypted_envelope result = {}; try { DecryptedEnvelope result_cpp = decrypt_envelope( @@ -510,7 +534,8 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( { .flags = result_cpp.envelope.flags, .type = static_cast(result_cpp.envelope.type), - .timestamp = result_cpp.envelope.timestamp, + .timestamp_ms = static_cast( + result_cpp.envelope.timestamp.count()), .source = {}, .source_device = result_cpp.envelope.source_device, .server_timestamp = result_cpp.envelope.server_timestamp, From c384713e7298984821ff92eb36e57c7c2c0c56c2 Mon Sep 17 00:00:00 2001 From: doylet Date: Tue, 12 Aug 2025 12:23:53 +1000 Subject: [PATCH 21/59] Note that closed groups handles both legacy/non-legacy keys --- include/session/session_protocol.h | 4 ++-- include/session/session_protocol.hpp | 15 ++++++++++++--- src/session_protocol.cpp | 19 ++++++++++--------- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index 84f56c6b..9b09b622 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -68,8 +68,8 @@ struct session_protocol_destination { // The closed group swarm public key is optional but should be set for a non 0x03 prefix // `closed_group_pubkey`. Otherwise the public key is ignored when encrypting for a destination. - bool has_closed_group_swarm_public_key; - uint8_t closed_group_swarm_public_key[33]; + bool has_closed_group_public_key; + uint8_t closed_group_public_key[33]; }; enum ENVELOPE_TYPE { diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index 8c31621f..213d8e85 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -47,7 +47,12 @@ enum class ProStatus { enum class DestinationType { Contact, SyncMessage, + + /// Both legacy and non-legacy closed groups are to be identified as `ClosedGroup`. A non-legacy + /// group is detected by the (0x03) prefix byte on the given `dest_closed_group_pubkey` + /// specified in Destination. ClosedGroup, + OpenGroup, OpenGroupInbox, }; @@ -74,12 +79,16 @@ struct Destination { // When type => ClosedGroup: set the following 'closed_group' prefixed fields array_uc33 closed_group_pubkey; + + // Must be set to the group keys for a 0x03 prefix (e.g. groups v2) `closed_group_pubkey` to + // encrypt the message. const session::config::groups::Keys* closed_group_keys; - // Set to the closed group's swarm public key (needed for Android) for a non 0x03 prefixed - // `closed_group_pubkey`. Ignored otherwise. This will be set as the envelope source. See: + // Must be set to the closed group's public key (needed for Android) for a non 0x03 prefixed + // `closed_group_pubkey` (e.g. legacy closed groups). Ignored otherwise. This will be set as the + // envelope source. See: // https://github.com/session-foundation/session-ios/blob/82deef869d0f7389b799295817f42ad14f8a1316/SessionMessagingKit/Sending%20%26%20Receiving/MessageSender.swift#L469 - std::optional closed_group_swarm_public_key; + std::optional closed_group_public_key; }; enum class EnvelopeType { diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index c24bcf34..d693d6e4 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -52,7 +52,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( const uint8_t* dest_open_group_inbox_server_pubkey, const uint8_t* dest_closed_group_pubkey, const config::groups::Keys* dest_closed_group_keys, - const uint8_t* dest_closed_group_swarm_public_key, + const uint8_t* dest_closed_group_public_key, config::Namespace space, UseMalloc use_malloc) { @@ -115,17 +115,18 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( enc.mode = Mode::Plaintext; } } else { + // Legacy closed groups which have a 05 prefixed key enc.mode = Mode::Envelope; enc.before_envelope_encrypt_for_recipient_deterministic = true; enc.envelope_type = SessionProtos::Envelope_Type::Envelope_Type_CLOSED_GROUP_MESSAGE; enc.after_envelope = AfterEnvelope::WrapInWSMessage; - if (!dest_closed_group_swarm_public_key) + if (!dest_closed_group_public_key) throw std::runtime_error( - "API misuse: Closed group swarm public key must be set on non 0x03 " - "prefixed group keys"); - enc.envelope_src = {dest_closed_group_swarm_public_key, sizeof(array_uc33)}; + "API misuse: Closed group public key must be set on non 0x03 prefixed " + "group keys"); + enc.envelope_src = {dest_closed_group_public_key, sizeof(array_uc33)}; } } break; @@ -293,8 +294,8 @@ EncryptedForDestination encrypt_for_destination( /*dest_open_group_inbox_server_pubkey=*/dest.open_group_inbox_server_pubkey.data(), /*dest_closed_group_pubkey=*/dest.closed_group_pubkey.data(), /*dest_closed_group_keys=*/dest.closed_group_keys, - /*dest_closed_group_swarm_public_key=*/dest.closed_group_swarm_public_key - ? dest.closed_group_swarm_public_key->data() + /*dest_closed_group_swarm_public_key=*/dest.closed_group_public_key + ? dest.closed_group_public_key->data() : nullptr, /*space=*/space, /*use_malloc=*/UseMalloc::No); @@ -500,8 +501,8 @@ session_protocol_encrypt_for_destination( /*dest_closed_group_pubkey=*/dest->closed_group_pubkey, /*dest_closed_group_keys=*/ static_cast(dest->closed_group_keys->internals), - /*dest_closed_group_swarm_public_key=*/dest->has_closed_group_swarm_public_key - ? dest->closed_group_swarm_public_key + /*dest_closed_group_swarm_public_key=*/dest->has_closed_group_public_key + ? dest->closed_group_public_key : nullptr, /*space=*/static_cast(space), /*use_malloc=*/UseMalloc::Yes); From 9841a4ef83ae45c132a70bd8d695c0e44cb2e21f Mon Sep 17 00:00:00 2001 From: doylet Date: Wed, 13 Aug 2025 18:03:22 +1000 Subject: [PATCH 22/59] Avoid required files in pro messages, handle non-encrypted contents in envelope --- include/session/session_protocol.h | 29 +- include/session/session_protocol.hpp | 45 ++-- include/session/types.h | 18 +- proto/SessionProtos.proto | 14 +- src/config/pro.cpp | 2 + src/session_protocol.cpp | 198 ++++++++------ tests/CMakeLists.txt | 1 + tests/test_session_protocol.cpp | 386 +++++++++++++++++++++++++++ tests/utils.hpp | 71 ++++- 9 files changed, 642 insertions(+), 122 deletions(-) create mode 100644 tests/test_session_protocol.cpp diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index 9b09b622..1f58fd04 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -24,7 +24,7 @@ enum { typedef uint64_t PRO_EXTRA_FEATURES; enum PRO_EXTRA_FEATURES_ { PRO_EXTRA_FEATURES_NIL = 0, - PRO_EXTRA_FEATURES_PRO_BADGE = 0 << 1, + PRO_EXTRA_FEATURES_PRO_BADGE = 1 << 0, PRO_EXTRA_FEATURES_ANIMATED_AVATAR = 1 << 1, }; @@ -40,7 +40,8 @@ enum PRO_FEATURES_ { enum PRO_STATUS { PRO_STATUS_NIL, - PRO_STATUS_INVALID, + PRO_STATUS_INVALID_PRO_BACKEND_SIG, + PRO_STATUS_INVALID_USER_SIG, PRO_STATUS_VALID, PRO_STATUS_EXPIRED, }; @@ -60,16 +61,11 @@ struct session_protocol_destination { // into account the signature or otherwise the signature is ignored. bool has_pro_sig; uint8_t pro_sig[64]; - uint8_t recipient_pubkey[32]; + uint8_t recipient_pubkey[33]; uint64_t sent_timestamp_ms; uint8_t open_group_inbox_server_pubkey[32]; uint8_t closed_group_pubkey[33]; const config_group_keys* closed_group_keys; - - // The closed group swarm public key is optional but should be set for a non 0x03 prefix - // `closed_group_pubkey`. Otherwise the public key is ignored when encrypting for a destination. - bool has_closed_group_public_key; - uint8_t closed_group_public_key[33]; }; enum ENVELOPE_TYPE { @@ -129,7 +125,7 @@ struct session_protocol_encrypted_for_destination { /// - Session Pro feature flags suitable for writing directly into the protobuf `ProMessage` in /// `Content` LIBSESSION_EXPORT -PRO_FEATURES session_protocol_get_pro_features_for_msg(const span_u8 msg, PRO_FEATURES flags); +PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_FEATURES flags); /// API: session_protocol/session_protocol_encrypt_for_destination /// @@ -153,6 +149,9 @@ PRO_FEATURES session_protocol_get_pro_features_for_msg(const span_u8 msg, PRO_FE /// require encryption, no payload is returned in the ciphertext and the user should proceed with /// the plaintext. This should be validated by checking the `encrypted` flag on the result. /// +/// The retured payload is suitable for sending on the wire (i.e: it has been protobuf +/// encoded/wrapped if necessary). +/// /// The success flag is set if encryption was successful, if the underlying implementation threw /// an exception then this is set to false. LIBSESSION_EXPORT @@ -176,8 +175,11 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_for_destinat /// - `envelope_plaintext` -- the protobuf serialised payload containing the message envelope. The /// envelope must already be decrypted if it was originally encrypted (i.e.: closed group /// envelopes). -/// - `unix_ts` -- pass in the current system time which is used to determine, if present in the -/// envelope, whether or not the Session Pro proof has expired or not. +/// - `unix_ts` -- pass in the current system time which is used to determine, whether or not the +/// Session Pro proof has expired or not if it is in the payload. Ignored otherwise +/// - `pro_backend_pubkey` -- the Session Pro backend public key to verify the signature embedded in +/// the proof, validating whether or not the attached proof was indeed issued by an authorised +/// issuer /// /// Outputs: /// - The decrypted envelope. It contains the fields of the envelope and the Session Pro metadata @@ -187,7 +189,10 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_for_destinat /// an exception then this is set to false. LIBSESSION_EXPORT session_protocol_decrypted_envelope session_protocol_decrypt_envelope( - const span_u8 ed25519_privkey, const span_u8 envelope_plaintext, uint64_t unix_ts); + const span_u8 ed25519_privkey, + const span_u8 envelope_plaintext, + uint64_t unix_ts, + const span_u8 pro_backend_pubkey); #ifdef __cplusplus } diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index 213d8e85..8955e078 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -38,10 +38,11 @@ namespace config::groups { } enum class ProStatus { - Nil, // Pro proof was not set - Invalid, // Pro proof was set; signature validation failed - Valid, // Pro proof was set, is verified; has not expired - Expired, // Pro proof was set, is verified; has expired + Nil, // Pro proof was not set + InvalidProBackendSig, // Pro proof was set; proof sig was not produced by the Pro backend key + InvalidUserSig, // Pro proof was set; envelope sig was not produced by the Rotating key + Valid, // Pro proof was set, is verified; has not expired + Expired, // Pro proof was set, is verified; has expired }; enum class DestinationType { @@ -60,18 +61,17 @@ enum class DestinationType { struct Destination { DestinationType type; - // Signature over the plaintext with the user's Session Pro rotating public key if they have - // Session Pro and opt into sending a message with pro features. If this is specified, the pro - // message component in `Content` must have been set with the corresponding proof for this - // signature. + // Signature over the unencrypted plaintext with the user's Session Pro rotating public key if + // they have Session Pro and opt into sending a message with pro features. If this is specified, + // the pro message component in `Content` must have been set with the corresponding proof for + // this signature. std::optional pro_sig; // Set to the recipient of the message if it requires one. Ignored otherwise (for example // ignored in OpenGroup) - array_uc32 recipient_pubkey; + array_uc33 recipient_pubkey; - // The timestamp to assign to the message envelope if the message requires one. Ignored - // otherwise + // The timestamp to assign to the message envelope std::chrono::milliseconds sent_timestamp_ms; // When type => OpenGroupInbox: set this pubkey to the server's key @@ -83,12 +83,6 @@ struct Destination { // Must be set to the group keys for a 0x03 prefix (e.g. groups v2) `closed_group_pubkey` to // encrypt the message. const session::config::groups::Keys* closed_group_keys; - - // Must be set to the closed group's public key (needed for Android) for a non 0x03 prefixed - // `closed_group_pubkey` (e.g. legacy closed groups). Ignored otherwise. This will be set as the - // envelope source. See: - // https://github.com/session-foundation/session-ios/blob/82deef869d0f7389b799295817f42ad14f8a1316/SessionMessagingKit/Sending%20%26%20Receiving/MessageSender.swift#L469 - std::optional closed_group_public_key; }; enum class EnvelopeType { @@ -161,7 +155,7 @@ struct EncryptedForDestination /// Outputs: /// - Session Pro feature flags suitable for writing directly into the protobuf `ProMessage` in /// `Content` -PRO_FEATURES get_pro_features_for_msg(std::span msg, PRO_FEATURES flags); +PRO_FEATURES get_pro_features_for_msg(size_t msg_size, PRO_FEATURES flags); /// API: session_protocol/encrypt_for_destination /// @@ -196,6 +190,9 @@ PRO_FEATURES get_pro_features_for_msg(std::span msg, PRO_FEATURES /// - The encryption result for the plaintext. If the destination and namespace combination did not /// require encryption, no payload is returned in the ciphertext and the user should proceed with /// the plaintext. This should be validated by checking the `encrypted` flag on the result. +/// +/// The retured payload is suitable for sending on the wire (i.e: it has been protobuf +/// encoded/wrapped if necessary). EncryptedForDestination encrypt_for_destination( std::span plaintext, std::span ed25519_privkey, @@ -219,13 +216,16 @@ EncryptedForDestination encrypt_for_destination( /// field to verify if the Session Pro was present and/or valid or invalid. /// /// Inputs: -/// - `ed25519_privkey` -- the libsodium-style secret key of the sender, 64 bytes. Can also be +/// - `ed25519_privkey` -- the libsodium-style secret key of the receiver, 64 bytes. Can also be /// passed as a 32-byte seed. Used to decrypt the encrypted content. /// - `envelope_plaintext` -- the protobuf serialised payload containing the message envelope. The /// envelope must already be decrypted if it was originally encrypted (i.e.: closed group /// envelopes). -/// - `unix_ts` -- pass in the current system time which is used to determine, if present in the -/// envelope, whether or not the Session Pro proof has expired or not. +/// - `unix_ts` -- pass in the current system time which is used to determine, whether or not the +/// Session Pro proof has expired or not if it is in the payload. Ignored otherwise +/// - `pro_backend_pubkey` -- the Session Pro backend public key to verify the signature embedded in +/// the proof, validating whether or not the attached proof was indeed issued by an authorised +/// issuer /// /// Outputs: /// - The decrypted envelope. It contains the fields of the envelope and the Session Pro metadata @@ -233,5 +233,6 @@ EncryptedForDestination encrypt_for_destination( DecryptedEnvelope decrypt_envelope( std::span ed25519_privkey, std::span envelope_plaintext, - std::chrono::sys_seconds unix_ts); + std::chrono::sys_seconds unix_ts, + const array_uc32& pro_backend_pubkey); } // namespace session diff --git a/include/session/types.h b/include/session/types.h index 529a5354..adca1f36 100644 --- a/include/session/types.h +++ b/include/session/types.h @@ -3,14 +3,30 @@ #include #include +#if defined(__cplusplus) +#include +#endif + #ifdef __cplusplus extern "C" { #endif -/// C friendly buffer structure that is a pointer and lenght to a span of bytes. +/// C friendly buffer structure that is a pointer and length to a span of bytes. struct span_u8 { uint8_t* data; size_t size; + +#if defined(__cplusplus) + std::span cpp_span() const { return {data, size}; } +#endif +}; + +struct bytes32 { + uint8_t data[32]; +}; + +struct bytes64 { + uint8_t data[64]; }; /// Create a span of bytes that owns the `size` bytes of memory requested. If allocation fails, this diff --git a/proto/SessionProtos.proto b/proto/SessionProtos.proto index 4eb51e88..309dbca1 100644 --- a/proto/SessionProtos.proto +++ b/proto/SessionProtos.proto @@ -330,14 +330,14 @@ message GroupUpdateDeleteMemberContentMessage { } message ProProof { - required uint32 version = 1; - required bytes genIndexHash = 2; - required bytes rotatingPublicKey = 3; - required uint64 expiryUnixTs = 4; - required bytes sig = 5; + optional uint32 version = 1; + optional bytes genIndexHash = 2; + optional bytes rotatingPublicKey = 3; + optional uint64 expiryUnixTs = 4; + optional bytes sig = 5; } message ProMessage { - required ProProof proof = 1; - required uint32 flags = 2; + optional ProProof proof = 1; + optional uint32 flags = 2; } diff --git a/src/config/pro.cpp b/src/config/pro.cpp index c67ac9df..a997fdd5 100644 --- a/src/config/pro.cpp +++ b/src/config/pro.cpp @@ -12,6 +12,8 @@ session::array_uc32 proof_hash_internal( std::span gen_index_hash, std::span rotating_pubkey, std::uint64_t expiry_unix_ts) { + // This must match the hashing routine at + // https://github.com/Doy-lee/session-pro-backend/blob/9417e00adbff3bf608b7ae831f87045bdab06232/backend.py#L545-L558 session::array_uc32 result = {}; crypto_generichash_blake2b_state state; crypto_generichash_blake2b_init(&state, /*key*/ nullptr, 0, result.max_size()); diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index d693d6e4..0167a972 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include "SessionProtos.pb.h" #include "WebSocketResources.pb.h" @@ -16,10 +17,10 @@ namespace session { -PRO_FEATURES get_pro_features_for_msg(std::span msg, PRO_EXTRA_FEATURES extra) { +PRO_FEATURES get_pro_features_for_msg(size_t msg_size, PRO_EXTRA_FEATURES extra) { PRO_FEATURES result = PRO_FEATURES_NIL; - if (msg.size() >= PRO_STANDARD_CHARACTER_LIMIT) + if (msg_size > PRO_STANDARD_CHARACTER_LIMIT) result |= PRO_FEATURES_10K_CHARACTER_LIMIT; if (extra & PRO_EXTRA_FEATURES_ANIMATED_AVATAR) @@ -43,21 +44,26 @@ struct EncryptedForDestinationInternal { enum class UseMalloc { No, Yes }; static EncryptedForDestinationInternal encrypt_for_destination_internal( - const std::span plaintext, - const std::span ed25519_privkey, + std::span plaintext, + std::span ed25519_privkey, DestinationType dest_type, - const uint8_t* dest_pro_sig, - const uint8_t* dest_recipient_pubkey, + std::span dest_pro_sig, + std::span dest_recipient_pubkey, std::chrono::milliseconds dest_sent_timestamp_ms, - const uint8_t* dest_open_group_inbox_server_pubkey, - const uint8_t* dest_closed_group_pubkey, + std::span dest_open_group_inbox_server_pubkey, + std::span dest_closed_group_pubkey, const config::groups::Keys* dest_closed_group_keys, - const uint8_t* dest_closed_group_public_key, config::Namespace space, UseMalloc use_malloc) { - // All incoming arguments are passed in from typed, fixed-sized arrays so we do not check - // the pointer lengths of those arguments. + assert(dest_pro_sig.empty() || dest_pro_sig.size() == crypto_sign_ed25519_BYTES); + assert(dest_recipient_pubkey.size() == 1 + crypto_sign_ed25519_PUBLICKEYBYTES); + assert(dest_open_group_inbox_server_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); + assert(dest_closed_group_pubkey.size() == 1 + crypto_sign_ed25519_PUBLICKEYBYTES); + + // All incoming arguments are passed in from typed, fixed-sized arrays so we do not need to + // throw if these sizes are wrong. It being wrong would be a development error. + EncryptedForDestinationInternal result = {}; enum class Mode { Envelope, @@ -103,6 +109,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( "API misuse: Sending to a closed group into the group messages " "namespace requires the closed group keys to be set"); enc.mode = Mode::Envelope; + enc.before_envelope_encrypt_for_recipient_deterministic = false; enc.after_envelope = AfterEnvelope::KeysEncryptMessage; enc.envelope_type = SessionProtos::Envelope_Type::Envelope_Type_CLOSED_GROUP_MESSAGE; @@ -121,12 +128,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( enc.envelope_type = SessionProtos::Envelope_Type::Envelope_Type_CLOSED_GROUP_MESSAGE; enc.after_envelope = AfterEnvelope::WrapInWSMessage; - - if (!dest_closed_group_public_key) - throw std::runtime_error( - "API misuse: Closed group public key must be set on non 0x03 prefixed " - "group keys"); - enc.envelope_src = {dest_closed_group_public_key, sizeof(array_uc33)}; + enc.envelope_src = dest_closed_group_pubkey; } } break; @@ -164,11 +166,11 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( switch (enc.mode) { case Mode::Envelope: { assert(enc.envelope_type.has_value()); - std::span src_text = plaintext; + std::span content = plaintext; if (enc.before_envelope_encrypt_for_recipient_deterministic) { enc.before_envelope_ciphertext = session::encrypt_for_recipient_deterministic( - ed25519_privkey, {dest_recipient_pubkey, sizeof(array_uc32)}, src_text); - src_text = enc.before_envelope_ciphertext; + ed25519_privkey, dest_recipient_pubkey, content); + content = enc.before_envelope_ciphertext; } // Create envelope @@ -178,21 +180,20 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( envelope.set_type(*enc.envelope_type); envelope.set_sourcedevice(1); envelope.set_timestamp(dest_sent_timestamp_ms.count()); - envelope.set_content(src_text.data(), src_text.size()); + envelope.set_content(content.data(), content.size()); if (enc.envelope_src) envelope.set_source( reinterpret_cast(enc.envelope_src->data()), enc.envelope_src->size()); - if (dest_pro_sig) { - envelope.set_prosig( - reinterpret_cast(dest_pro_sig), sizeof(array_uc64)); - } else { + if (dest_pro_sig.empty()) { // If there's no pro signature specified, we still fill out the pro signature with a // dummy 64 byte stream. This is to make pro and non-pro messages indistinguishable. std::string *pro_sig = envelope.mutable_prosig(); pro_sig->resize(sizeof(array_uc64)); randombytes_buf(pro_sig->data(), pro_sig->size()); + } else { + envelope.set_prosig(dest_pro_sig.data(), dest_pro_sig.size()); } result.encrypted = true; @@ -202,18 +203,16 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( break; case AfterEnvelope::WrapInWSMessage: { - // Make request - WebSocketProtos::WebSocketRequestMessage req_msg = {}; - req_msg.set_body(envelope.SerializeAsString()); - - // Put into message + // Setup message WebSocketProtos::WebSocketMessage msg = {}; msg.set_type( WebSocketProtos::WebSocketMessage_Type::WebSocketMessage_Type_REQUEST); - msg.set_allocated_request(&req_msg); + + // Make request + WebSocketProtos::WebSocketRequestMessage *req_msg = msg.mutable_request(); + req_msg->set_body(envelope.SerializeAsString()); // Write message as ciphertext - void* dest = nullptr; if (use_malloc == UseMalloc::Yes) { result.ciphertext_c = span_u8_alloc_or_throw(envelope.ByteSizeLong()); msg.SerializeToArray(result.ciphertext_c.data, result.ciphertext_c.size); @@ -230,8 +229,8 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( "when this happens earlier"); std::string bytes = envelope.SerializeAsString(); - std::vector ciphertext = dest_closed_group_keys->encrypt_message( - {reinterpret_cast(bytes.data()), bytes.size()}); + std::vector ciphertext = + dest_closed_group_keys->encrypt_message(to_span(bytes)); if (use_malloc == UseMalloc::Yes) { result.ciphertext_c = span_u8_copy_or_throw(ciphertext.data(), ciphertext.size()); @@ -263,8 +262,8 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( result.encrypted = true; std::vector ciphertext = encrypt_for_blinded_recipient( ed25519_privkey, - {dest_open_group_inbox_server_pubkey, sizeof(array_uc32)}, - {dest_recipient_pubkey, sizeof(array_uc32)}, // recipient blinded pubkey + dest_open_group_inbox_server_pubkey, + dest_recipient_pubkey, // recipient blinded pubkey plaintext); if (use_malloc == UseMalloc::Yes) { @@ -288,15 +287,12 @@ EncryptedForDestination encrypt_for_destination( /*plaintext=*/plaintext, /*ed25519_privkey=*/ed25519_privkey, /*dest_type=*/dest.type, - /*dest_pro_sig=*/dest.pro_sig ? dest.pro_sig->data() : nullptr, - /*dest_recipient_pubkey=*/dest.recipient_pubkey.data(), + /*dest_pro_sig=*/dest.pro_sig ? *dest.pro_sig : std::span(), + /*dest_recipient_pubkey=*/dest.recipient_pubkey, /*dest_sent_timestamp_ms=*/dest.sent_timestamp_ms, - /*dest_open_group_inbox_server_pubkey=*/dest.open_group_inbox_server_pubkey.data(), - /*dest_closed_group_pubkey=*/dest.closed_group_pubkey.data(), + /*dest_open_group_inbox_server_pubkey=*/dest.open_group_inbox_server_pubkey, + /*dest_closed_group_pubkey=*/dest.closed_group_pubkey, /*dest_closed_group_keys=*/dest.closed_group_keys, - /*dest_closed_group_swarm_public_key=*/dest.closed_group_public_key - ? dest.closed_group_public_key->data() - : nullptr, /*space=*/space, /*use_malloc=*/UseMalloc::No); @@ -317,13 +313,14 @@ struct DecryptedEnvelopeInternal { }; DecryptedEnvelope decrypt_envelope( - std::span ed25519_privkey, - std::span envelope_plaintext, - std::chrono::sys_seconds unix_ts) { + std::span ed25519_privkey, + std::span envelope_plaintext, + std::chrono::sys_seconds unix_ts, + const array_uc32& pro_backend_pubkey) { DecryptedEnvelope result = {}; SessionProtos::Envelope envelope = {}; if (!envelope.ParseFromArray(envelope_plaintext.data(), envelope_plaintext.size())) - throw std::runtime_error{"Parse envelope from ciphertext failed"}; + throw std::runtime_error{"Parse envelope from plaintext failed"}; // Parse type (unconditionallty) if (!envelope.has_type()) @@ -370,18 +367,64 @@ DecryptedEnvelope decrypt_envelope( throw std::runtime_error{"Parse decrypted message failed, missing content"}; // Decrypt content - const std::string& content_str = envelope.content(); - auto content_span = std::span( - reinterpret_cast(content_str.data()), content_str.size()); - auto [content_plaintext, sender_ed25519_pubkey] = - session::decrypt_incoming(ed25519_privkey, content_span); - assert(result.sender_ed25519_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); - - result.content_plaintext = std::move(content_plaintext); - std::memcpy( - result.sender_ed25519_pubkey.data(), - sender_ed25519_pubkey.data(), - result.sender_ed25519_pubkey.size()); + // The envelope is encrypted in GroupsV2, contents unencrypted. In 1o1 and legacy groups, the + // envelope is encrypted, contents is encrypted. + // + // On Android and Desktop, the envelope source is always set for legacy and v2 groups. This + // means we can use the envelope source to determine if the contents needs decryption. + // + // On iOS legacy groups have the source set. V2 groups on iOS do _not_ have the sender set. + // Reminder: + // + // v2 => envelope encrypted, contents unencrypted + // legacy => envelope unencrypted, contents encrypted + // + // Since all platforms always set the envelope source for a legacy groups message we can use the + // presence of the envelope source and check the prefix to determine if the contents is + // encrypted, i.e. do the following checks: + // + // 1. Is a closed group message + // 2. The source (pubkey) is set (all platforms set this field on legacy groups messages) + // 3. The pubkey has a legacy prefix (0x05) + // + // Refs: + // clang-format off + // Android: + // Legacy https://github.com/session-foundation/session-android/blob/e4c16ae8aa8cae2f75aba565b890082563b07bd2/app/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSender.kt#L189 + // v2 https://github.com/session-foundation/session-android/blob/e4c16ae8aa8cae2f75aba565b890082563b07bd2/app/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSender.kt#L176 + // Desktop: + // Legacy https://github.com/session-foundation/session-desktop/blob/4c5cd88fa707a01845f86c0de8920faf160653ea/ts/session/sending/MessageWrapper.ts#L140 + // v2 https://github.com/session-foundation/session-desktop/blob/4c5cd88fa707a01845f86c0de8920faf160653ea/ts/session/sending/MessageWrapper.ts#L49 + // iOS: + // Legacy https://github.com/session-foundation/session-ios/blob/932145ab255b2327ca20fc992ac73758b94b07cd/SessionMessagingKit/Sending%20%26%20Receiving/MessageSender.swift#L469 + // v2 https://github.com/session-foundation/session-ios/blob/932145ab255b2327ca20fc992ac73758b94b07cd/SessionMessagingKit/Sending%20%26%20Receiving/MessageSender.swift#L426 + // clang-format on + bool has_encrypted_content = envelope.type() == SessionProtos::Envelope_Type_SESSION_MESSAGE; + if (envelope.type() == SessionProtos::Envelope_Type_CLOSED_GROUP_MESSAGE && envelope.has_source()) { + const std::string& source_pubkey = envelope.source(); + if (source_pubkey.size() != sizeof(array_uc33)) + throw std::runtime_error{ + "Parse closed group message failed, source was not 33 byte public key"}; + + if (source_pubkey[0] != static_cast(SessionIDPrefix::group)) + has_encrypted_content = true; + } + + if (has_encrypted_content) { + std::span content_str = session::to_span(envelope.content()); + auto [content_plaintext, sender_ed25519_pubkey] = + session::decrypt_incoming(ed25519_privkey, content_str); + assert(result.sender_ed25519_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); + + result.content_plaintext = std::move(content_plaintext); + std::memcpy( + result.sender_ed25519_pubkey.data(), + sender_ed25519_pubkey.data(), + result.sender_ed25519_pubkey.size()); + } else { + result.content_plaintext.resize(envelope.content().size()); + std::memcpy(result.content_plaintext.data(), envelope.content().data(), envelope.content().size()); + } // TODO: We parse the content in libsession to extract pro metadata but we return the unparsed // blob back to the caller. This is temporary, eventually we will return a proxy structure for @@ -389,8 +432,8 @@ DecryptedEnvelope decrypt_envelope( // the interface simple and avoid leaking protobuf implementation detail into the libsession // interface. SessionProtos::Content content = {}; - if (!envelope.ParseFromArray(result.content_plaintext.data(), result.content_plaintext.size())) - throw std::runtime_error{"Parse content from envelope failed"}; + if (!content.ParseFromArray(result.content_plaintext.data(), result.content_plaintext.size())) + throw std::runtime_error{fmt::format("Parse content from envelope failed: {}", result.content_plaintext.size())}; // A signature must always be present on the envelope. This is to make a pro and non-pro // envelope indistinguishable. If the message does not have pro then this signature must still @@ -436,10 +479,10 @@ DecryptedEnvelope decrypt_envelope( // Verify the sig since we have extracted the rotating public key from the embedded proof int verify_result = crypto_sign_ed25519_verify_detached( reinterpret_cast(pro_sig.data()), - reinterpret_cast(content_str.data()), - content_str.size(), + result.content_plaintext.data(), + result.content_plaintext.size(), reinterpret_cast(proto_proof.rotatingpublickey().data())); - result.pro_status = verify_result == 0 ? ProStatus::Valid : ProStatus::Invalid; + result.pro_status = verify_result == 0 ? ProStatus::Valid : ProStatus::InvalidUserSig; // Fill out the resulting proof structure, we have parsed successfully result.pro_features = proto_flags; @@ -460,12 +503,14 @@ DecryptedEnvelope decrypt_envelope( if (result.pro_status == ProStatus::Valid) { // Verify the at the proof is verified by the Session Pro Backend key (e.g.: It has been // authorised by the backend as having a valid backing payment). - if (proof.verify(session::pro_backend::PUBKEY)) + if (proof.verify(pro_backend_pubkey)) result.pro_status = ProStatus::Valid; + else + result.pro_status = ProStatus::InvalidProBackendSig; // Check if the proof has expired if (result.pro_status == ProStatus::Valid) { - if (unix_ts >= result.pro_proof.expiry_unix_ts) + if (unix_ts > result.pro_proof.expiry_unix_ts) result.pro_status = ProStatus::Expired; } } @@ -477,8 +522,8 @@ DecryptedEnvelope decrypt_envelope( using namespace session; LIBSESSION_EXPORT -PRO_FEATURES session_protocol_get_pro_features_for_msg(const span_u8 msg, PRO_FEATURES flags) { - PRO_FEATURES result = get_pro_features_for_msg({msg.data, msg.size}, flags); +PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_FEATURES flags) { + PRO_FEATURES result = get_pro_features_for_msg(msg_size, flags); return result; } @@ -494,16 +539,13 @@ session_protocol_encrypt_for_destination( /*plaintext=*/{plaintext.data, plaintext.size}, /*ed25519_privkey=*/{ed25519_privkey.data, ed25519_privkey.size}, /*dest_type=*/static_cast(dest->type), - /*dest_pro_sig=*/dest->has_pro_sig ? dest->pro_sig : nullptr, + /*dest_pro_sig=*/dest->has_pro_sig ? dest->pro_sig : std::span(), /*dest_recipient_pubkey=*/dest->recipient_pubkey, /*dest_sent_timestamp_ms=*/std::chrono::milliseconds(dest->sent_timestamp_ms), /*dest_open_group_inbox_server_pubkey=*/dest->open_group_inbox_server_pubkey, /*dest_closed_group_pubkey=*/dest->closed_group_pubkey, /*dest_closed_group_keys=*/ static_cast(dest->closed_group_keys->internals), - /*dest_closed_group_swarm_public_key=*/dest->has_closed_group_public_key - ? dest->closed_group_public_key - : nullptr, /*space=*/static_cast(space), /*use_malloc=*/UseMalloc::Yes); @@ -520,13 +562,17 @@ session_protocol_encrypt_for_destination( LIBSESSION_EXPORT session_protocol_decrypted_envelope session_protocol_decrypt_envelope( - const span_u8 ed25519_privkey, const span_u8 envelope_plaintext, uint64_t unix_ts) { + const span_u8 ed25519_privkey, + const span_u8 envelope_plaintext, + uint64_t unix_ts, + const span_u8 pro_backend_pubkey) { session_protocol_decrypted_envelope result = {}; try { DecryptedEnvelope result_cpp = decrypt_envelope( - {ed25519_privkey.data, ed25519_privkey.size}, - {envelope_plaintext.data, envelope_plaintext.size}, - std::chrono::sys_seconds(std::chrono::seconds(unix_ts))); + ed25519_privkey.cpp_span(), + envelope_plaintext.cpp_span(), + std::chrono::sys_seconds(std::chrono::seconds(unix_ts)), + {}); // Marshall into c type result = { diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bbd36af3..9243fe11 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -28,6 +28,7 @@ set(LIB_SESSION_UTESTS_SOURCES test_proto.cpp test_random.cpp test_session_encrypt.cpp + test_session_protocol.cpp test_xed25519.cpp case_logger.cpp diff --git a/tests/test_session_protocol.cpp b/tests/test_session_protocol.cpp new file mode 100644 index 00000000..86820102 --- /dev/null +++ b/tests/test_session_protocol.cpp @@ -0,0 +1,386 @@ +#include + +#include +#include +#include +#include +#include +#include +#include "SessionProtos.pb.h" + +#include "utils.hpp" + +using namespace session; + +TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { + + using namespace session; + TestKeys keys = get_deterministic_test_keys(); + + // Tuesday, 12 August 2025 03:58:21 UTC + const std::chrono::milliseconds timestamp_ms = std::chrono::seconds(1754971101); + const std::string_view data_body = "hello"; + + SECTION("Encrypt with and w/o pro sig produce same payload size") { + // Same payload size because the encrypt function should put in a dummy signature if one + // wasn't specific to make pro and non-pro envelopes indistinguishable. + + session::Destination dest = {}; + dest.type = DestinationType::Contact; + dest.sent_timestamp_ms = timestamp_ms; + dest.recipient_pubkey = keys.session_pk1; + + // Withhold the pro signature + dest.pro_sig = std::nullopt; + EncryptedForDestination encrypt_without_pro_sig = encrypt_for_destination( + to_span(data_body), keys.ed_sk0, dest, config::Namespace::Default); + + // Set the pro signature + dest.pro_sig.emplace(); + EncryptedForDestination encrypt_with_pro_sig = encrypt_for_destination( + to_span(data_body), keys.ed_sk0, dest, config::Namespace::Default); + + REQUIRE(encrypt_without_pro_sig.encrypted); + REQUIRE(encrypt_with_pro_sig.encrypted); + + // Should have the same payload size + REQUIRE(encrypt_without_pro_sig.ciphertext.size() == encrypt_with_pro_sig.ciphertext.size()); + } + + SECTION("Encrypt/decrypt for contact in default namespace") { + // Build content + std::string plaintext; + { + SessionProtos::Content content = {}; + SessionProtos::DataMessage* data = content.mutable_datamessage(); + data->set_body(std::string(data_body)); + plaintext = content.SerializeAsString(); + REQUIRE(plaintext.size() > data_body.size()); + } + + // Encrypt + EncryptedForDestination encrypt_result = {}; + { + session::Destination dest = {}; + dest.type = DestinationType::Contact; + dest.sent_timestamp_ms = timestamp_ms; + REQUIRE(dest.recipient_pubkey.size() == keys.session_pk1.size()); + std::memcpy(dest.recipient_pubkey.data(), keys.session_pk1.data(), keys.session_pk1.size()); + + encrypt_result = session::encrypt_for_destination( + to_span(plaintext), keys.ed_sk0, dest, config::Namespace::Default); + REQUIRE(encrypt_result.encrypted); + } + + // Decrypt envelope + DecryptedEnvelope decrypt_result = session::decrypt_envelope( + keys.ed_sk1, + encrypt_result.ciphertext, + std::chrono::sys_seconds( + std::chrono::duration_cast(timestamp_ms)), pro_backend::PUBKEY); + + // Verify pro + config::ProProof nil_proof = {}; + REQUIRE(decrypt_result.pro_status == ProStatus::Nil); // Pro was not attached + REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); + REQUIRE(decrypt_result.pro_proof.hash() == nil_proof.hash()); + + // Verify it is decryptable + SessionProtos::Content decrypt_content = {}; + REQUIRE(decrypt_content.ParseFromArray( + decrypt_result.content_plaintext.data(), decrypt_result.content_plaintext.size())); + REQUIRE(decrypt_content.has_datamessage()); + const SessionProtos::DataMessage& data = decrypt_content.datamessage(); + REQUIRE(data.body() == data_body); + } + + SECTION("Ensure get pro fetaures detects large message") { + // Try a message below the size threshold + PRO_FEATURES features = get_pro_features_for_msg( + PRO_STANDARD_CHARACTER_LIMIT, + PRO_EXTRA_FEATURES_PRO_BADGE | PRO_EXTRA_FEATURES_ANIMATED_AVATAR); + REQUIRE(features == (PRO_FEATURES_PRO_BADGE | PRO_FEATURES_ANIMATED_AVATAR)); + + // Try a message exceeding the size threshold + features = get_pro_features_for_msg( + PRO_STANDARD_CHARACTER_LIMIT + 1, + PRO_EXTRA_FEATURES_PRO_BADGE | PRO_EXTRA_FEATURES_ANIMATED_AVATAR); + REQUIRE(features == (PRO_FEATURES_10K_CHARACTER_LIMIT | PRO_FEATURES_PRO_BADGE | + PRO_FEATURES_ANIMATED_AVATAR)); + + // Try asking for just one extra feature + features = get_pro_features_for_msg(100, PRO_EXTRA_FEATURES_PRO_BADGE); + REQUIRE(features == PRO_FEATURES_PRO_BADGE); + } + + // Prepare a Session Pro proof + // We reuse test key 1 as the "Session Pro" backend key that signs the proofs as it + // doesn't matter what key really, just that we have one for signing. + const array_uc64& pro_backend_ed_sk = keys.ed_sk1; + const array_uc32& pro_backend_ed_pk = keys.ed_pk1; + + // Generate the user's Session Pro rotating key for testing encrypted payloads with Session + // Pro metadata + const auto user_pro_seed = + "0123456789abcdef0123456789abcdeff00baa00000000000000000000000000"_hexbytes; + array_uc32 user_pro_ed_pk; + array_uc64 user_pro_ed_sk; + crypto_sign_ed25519_seed_keypair( + user_pro_ed_pk.data(), user_pro_ed_sk.data(), user_pro_seed.data()); + + // Build protobuf `Content` message, serialise to `plaintext` and get it signed by the user's + // "Session Pro" key into `sig_over_plaintext_with_user_pro_key` + std::string plaintext; + array_uc64 sig_over_plaintext_with_user_pro_key = {}; + array_uc32 pro_proof_hash = {}; + { + SessionProtos::Content content = {}; + + // Create protobuf `Content.dataMessage` + SessionProtos::DataMessage* data = content.mutable_datamessage(); + data->set_body(std::string(data_body)); + + // Generate a dummy proof + config::ProProof proof = {}; + proof.rotating_pubkey = user_pro_ed_pk; + proof.expiry_unix_ts = std::chrono::sys_seconds( + std::chrono::duration_cast(timestamp_ms)); + + // Sign the proof by the dummy "Session Pro Backend" key + pro_proof_hash = proof.hash(); + crypto_sign_ed25519_detached( + proof.sig.data(), + nullptr, + pro_proof_hash.data(), + pro_proof_hash.size(), + pro_backend_ed_sk.data()); + + // Create protobuf `Content.proMessage` + SessionProtos::ProMessage *pro = content.mutable_promessage(); + pro->set_flags(PRO_FEATURES_NIL); + + // Create protobuf `Content.proMessage.proof` + SessionProtos::ProProof *proto_proof = pro->mutable_proof(); + proto_proof->set_version(proof.version); + proto_proof->set_genindexhash(proof.gen_index_hash.data(), proof.gen_index_hash.size()); + proto_proof->set_rotatingpublickey(proof.rotating_pubkey.data(), proof.rotating_pubkey.size()); + proto_proof->set_expiryunixts(proof.expiry_unix_ts.time_since_epoch().count()); + proto_proof->set_sig(proof.sig.data(), proof.sig.size()); + + // Generate the plaintext + plaintext = content.SerializeAsString(); + REQUIRE(plaintext.size() > data_body.size()); + + // Sign the plaintext with the user's pro key + crypto_sign_ed25519_detached( + sig_over_plaintext_with_user_pro_key.data(), + nullptr, + reinterpret_cast(plaintext.data()), + plaintext.size(), + user_pro_ed_sk.data()); + } + + SECTION("Encrypt/decrypt for contact in default namespace with Pro") { + // Build content + std::string plaintext; + array_uc64 sig_over_plaintext_with_user_pro_key = {}; + array_uc32 pro_proof_hash = {}; + { + SessionProtos::Content content = {}; + + // Create protobuf `Content.dataMessage` + SessionProtos::DataMessage* data = content.mutable_datamessage(); + data->set_body(std::string(data_body)); + + // Generate a dummy proof + config::ProProof proof = {}; + proof.rotating_pubkey = user_pro_ed_pk; + proof.expiry_unix_ts = std::chrono::sys_seconds( + std::chrono::duration_cast(timestamp_ms)); + + // Sign the proof by the dummy "Session Pro Backend" key + pro_proof_hash = proof.hash(); + crypto_sign_ed25519_detached( + proof.sig.data(), + nullptr, + pro_proof_hash.data(), + pro_proof_hash.size(), + pro_backend_ed_sk.data()); + + // Create protobuf `Content.proMessage` + SessionProtos::ProMessage *pro = content.mutable_promessage(); + pro->set_flags(PRO_FEATURES_NIL); + + // Create protobuf `Content.proMessage.proof` + SessionProtos::ProProof *proto_proof = pro->mutable_proof(); + proto_proof->set_version(proof.version); + proto_proof->set_genindexhash(proof.gen_index_hash.data(), proof.gen_index_hash.size()); + proto_proof->set_rotatingpublickey(proof.rotating_pubkey.data(), proof.rotating_pubkey.size()); + proto_proof->set_expiryunixts(proof.expiry_unix_ts.time_since_epoch().count()); + proto_proof->set_sig(proof.sig.data(), proof.sig.size()); + + // Generate the plaintext + plaintext = content.SerializeAsString(); + REQUIRE(plaintext.size() > data_body.size()); + + // Sign the plaintext with the user's pro key + crypto_sign_ed25519_detached( + sig_over_plaintext_with_user_pro_key.data(), + nullptr, + reinterpret_cast(plaintext.data()), + plaintext.size(), + user_pro_ed_sk.data()); + } + + // Encrypt + EncryptedForDestination encrypt_result = {}; + { + session::Destination dest = {}; + dest.type = DestinationType::Contact; + dest.sent_timestamp_ms = timestamp_ms; + dest.pro_sig = sig_over_plaintext_with_user_pro_key; + REQUIRE(dest.recipient_pubkey.size() == keys.session_pk1.size()); + std::memcpy(dest.recipient_pubkey.data(), keys.session_pk1.data(), keys.session_pk1.size()); + + encrypt_result = session::encrypt_for_destination( + to_span(plaintext), keys.ed_sk0, dest, config::Namespace::Default); + REQUIRE(encrypt_result.encrypted); + } + + // Decrypt envelope + DecryptedEnvelope decrypt_result = session::decrypt_envelope( + keys.ed_sk1, + encrypt_result.ciphertext, + std::chrono::sys_seconds( + std::chrono::duration_cast(timestamp_ms)), + pro_backend_ed_pk); + + // Verify pro + REQUIRE(decrypt_result.pro_status == ProStatus::Valid); // Pro was attached + REQUIRE(decrypt_result.pro_proof.hash() == pro_proof_hash); + REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); // No features requested + + // Verify it is decryptable + SessionProtos::Content decrypt_content = {}; + REQUIRE(decrypt_content.ParseFromArray( + decrypt_result.content_plaintext.data(), decrypt_result.content_plaintext.size())); + REQUIRE(decrypt_content.has_datamessage()); + const SessionProtos::DataMessage& data = decrypt_content.datamessage(); + REQUIRE(data.body() == data_body); + } + + SECTION("Check non-encryptable messages produce plaintext") { + auto dest_list = { + DestinationType::OpenGroup, + DestinationType::OpenGroupInbox, + DestinationType::Contact}; + + for (auto dest_type : dest_list) { + if (dest_type == DestinationType::OpenGroup) + INFO("Trying open groups"); + else if (dest_type == DestinationType::OpenGroupInbox) + INFO("Trying open group inbox"); + else + INFO("Trying contacts to non-default namespace"); + + session::Destination dest = {}; + dest.type = dest_type; + dest.sent_timestamp_ms = timestamp_ms; + dest.pro_sig = sig_over_plaintext_with_user_pro_key; + REQUIRE(dest.recipient_pubkey.size() == keys.session_pk1.size()); + std::memcpy( + dest.recipient_pubkey.data(), keys.session_pk1.data(), keys.session_pk1.size()); + + config::Namespace space = config::Namespace::Default; + if (dest_type == DestinationType::Contact) { + space = config::Namespace::Contacts; + dest.recipient_pubkey[0] = 0x15; + } + + EncryptedForDestination encrypt_result = + session::encrypt_for_destination(to_span(plaintext), keys.ed_sk0, dest, space); + REQUIRE_FALSE(encrypt_result.encrypted); + REQUIRE(encrypt_result.ciphertext.empty()); + } + } + + + SECTION("Encrypt/decrypt for legacy closed group (w/ encrypted envelope, plaintext content) " + "with Pro") { + + // Encrypt + EncryptedForDestination encrypt_result = {}; + { + session::Destination dest = {}; + dest.type = DestinationType::ClosedGroup; + dest.sent_timestamp_ms = timestamp_ms; + dest.pro_sig = sig_over_plaintext_with_user_pro_key; + REQUIRE(dest.recipient_pubkey.size() == keys.session_pk1.size()); + std::memcpy(dest.recipient_pubkey.data(), keys.session_pk1.data(), keys.session_pk1.size()); + + encrypt_result = session::encrypt_for_destination( + to_span(plaintext), keys.ed_sk0, dest, config::Namespace::Default); + REQUIRE(encrypt_result.encrypted); + } + + // Decrypt envelope + DecryptedEnvelope decrypt_result = session::decrypt_envelope( + keys.ed_sk1, + encrypt_result.ciphertext, + std::chrono::sys_seconds( + std::chrono::duration_cast(timestamp_ms)), + pro_backend_ed_pk); + + // Verify pro + REQUIRE(decrypt_result.pro_status == ProStatus::Valid); // Pro was attached + REQUIRE(decrypt_result.pro_proof.hash() == pro_proof_hash); + REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); // No features requested + + // Verify it is decryptable + SessionProtos::Content decrypt_content = {}; + REQUIRE(decrypt_content.ParseFromArray( + decrypt_result.content_plaintext.data(), decrypt_result.content_plaintext.size())); + REQUIRE(decrypt_content.has_datamessage()); + const SessionProtos::DataMessage& data = decrypt_content.datamessage(); + REQUIRE(data.body() == data_body); + } + + SECTION("Encrypt/decrypt for sync messages with Pro") { + + // Encrypt + EncryptedForDestination encrypt_result = {}; + { + session::Destination dest = {}; + dest.type = DestinationType::SyncMessage; + dest.sent_timestamp_ms = timestamp_ms; + dest.pro_sig = sig_over_plaintext_with_user_pro_key; + REQUIRE(dest.recipient_pubkey.size() == keys.session_pk1.size()); + std::memcpy(dest.recipient_pubkey.data(), keys.session_pk1.data(), keys.session_pk1.size()); + + encrypt_result = session::encrypt_for_destination( + to_span(plaintext), keys.ed_sk0, dest, config::Namespace::Default); + REQUIRE(encrypt_result.encrypted); + } + + // Decrypt envelope + DecryptedEnvelope decrypt_result = session::decrypt_envelope( + keys.ed_sk1, + encrypt_result.ciphertext, + std::chrono::sys_seconds( + std::chrono::duration_cast(timestamp_ms)), + pro_backend_ed_pk); + + // Verify pro + REQUIRE(decrypt_result.pro_status == ProStatus::Valid); // Pro was attached + REQUIRE(decrypt_result.pro_proof.hash() == pro_proof_hash); + REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); // No features requested + + // Verify it is decryptable + SessionProtos::Content decrypt_content = {}; + REQUIRE(decrypt_content.ParseFromArray( + decrypt_result.content_plaintext.data(), decrypt_result.content_plaintext.size())); + REQUIRE(decrypt_content.has_datamessage()); + const SessionProtos::DataMessage& data = decrypt_content.datamessage(); + REQUIRE(data.body() == data_body); + } +} diff --git a/tests/utils.hpp b/tests/utils.hpp index cf4d70cd..4b4474ce 100644 --- a/tests/utils.hpp +++ b/tests/utils.hpp @@ -3,7 +3,6 @@ #include #include -#include #include #include #include @@ -11,12 +10,11 @@ #include #include #include -#include #include -#include "session/config/base.h" -#include "session/types.hpp" #include "session/util.hpp" +#include "session/types.hpp" +#include using namespace std::literals; using namespace oxenc::literals; @@ -125,3 +123,68 @@ template std::set> make_set(T&&... args) { return {std::forward(args)...}; } + +struct TestKeys { + session::array_uc32 seed0; + session::array_uc64 ed_sk0; + session::array_uc32 ed_pk0; + session::array_uc32 curve_pk0; + session::array_uc33 session_pk0; + + session::array_uc32 seed1; + session::array_uc64 ed_sk1; + session::array_uc32 ed_pk1; + session::array_uc32 curve_pk1; + session::array_uc33 session_pk1; +}; + +static inline TestKeys get_deterministic_test_keys() { + TestKeys result = {}; + + // clang-format off + // Key 0 + { + // Seed + auto seed0 = "0123456789abcdef0123456789abcdef00000000000000000000000000000000"_hexbytes; + std::memcpy(result.seed0.data(), seed0.data(), seed0.size()); + + // Ed25519 + crypto_sign_ed25519_seed_keypair(result.ed_pk0.data(), result.ed_sk0.data(), result.seed0.data()); + + // X25519 + assert(0 == crypto_sign_ed25519_pk_to_curve25519(result.curve_pk0.data(), result.ed_pk0.data())); + + // Session PK + result.session_pk0[0] = 0x05; + std::memcpy(result.session_pk0.data() + 1, result.curve_pk0.data(), result.curve_pk0.size()); + } + + // Key 1 + { + // Seed + auto seed1 = "00112233445566778899aabbccddeeff00000000000000000000000000000000"_hexbytes; + std::memcpy(result.seed1.data(), seed1.data(), seed1.size()); + + // Ed25519 + crypto_sign_ed25519_seed_keypair(result.ed_pk1.data(), result.ed_sk1.data(), result.seed1.data()); + + // X25519 + assert(0 == crypto_sign_ed25519_pk_to_curve25519(result.curve_pk1.data(), result.ed_pk1.data())); + + // Session PK + result.session_pk1[0] = 0x05; + std::memcpy(result.session_pk1.data() + 1, result.curve_pk1.data(), result.curve_pk1.size()); + } + + assert(oxenc::to_hex(result.ed_sk0.begin(), result.ed_sk0.data() + crypto_sign_ed25519_SEEDBYTES) == oxenc::to_hex(result.seed0)); + assert(oxenc::to_hex(result.ed_pk0) == "4cb76fdc6d32278e3f83dbf608360ecc6b65727934b85d2fb86862ff98c46ab7"); + assert(oxenc::to_hex(result.curve_pk0) == "d2ad010eeb72d72e561d9de7bd7b6989af77dcabffa03a5111a6c859ae5c3a72"); + assert(oxenc::to_hex(result.session_pk0) == "05d2ad010eeb72d72e561d9de7bd7b6989af77dcabffa03a5111a6c859ae5c3a72"); + + assert(oxenc::to_hex(result.ed_sk1.begin(), result.ed_sk1.data() + crypto_sign_ed25519_SEEDBYTES) == oxenc::to_hex(result.seed1)); + assert(oxenc::to_hex(result.ed_pk1) == "5ea34e72bb044654a6a23675690ef5ffaaf1656b02f93fb76655f9cbdbe89876"); + assert(oxenc::to_hex(result.curve_pk1) == "aa654f00fc39fc69fd0db829410ca38177d7732a8d2f0934ab3872ac56d5aa74"); + assert(oxenc::to_hex(result.session_pk1) == "05aa654f00fc39fc69fd0db829410ca38177d7732a8d2f0934ab3872ac56d5aa74"); + // clang-format on + return result; +} From 539f77e3cecf9d34dab599a5ed21fe07cc99d153 Mon Sep 17 00:00:00 2001 From: doylet Date: Wed, 13 Aug 2025 18:03:50 +1000 Subject: [PATCH 23/59] Regen the protobufs w/ non required fields for pro structures --- proto/SessionProtos.pb.cc | 179 +++++++++++++------------------------- proto/SessionProtos.pb.h | 34 +++----- 2 files changed, 75 insertions(+), 138 deletions(-) diff --git a/proto/SessionProtos.pb.cc b/proto/SessionProtos.pb.cc index b5029232..35074b0c 100644 --- a/proto/SessionProtos.pb.cc +++ b/proto/SessionProtos.pb.cc @@ -3296,9 +3296,6 @@ bool Content::IsInitialized() const { if (_internal_has_sharedconfigmessage()) { if (!_impl_.sharedconfigmessage_->IsInitialized()) return false; } - if (_internal_has_promessage()) { - if (!_impl_.promessage_->IsInitialized()) return false; - } return true; } @@ -10928,9 +10925,6 @@ class ProProof::_Internal { static void set_has_sig(HasBits* has_bits) { (*has_bits)[0] |= 4u; } - static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x0000001f) ^ 0x0000001f) != 0; - } }; ProProof::ProProof(::PROTOBUF_NAMESPACE_ID::Arena* arena, @@ -11063,7 +11057,7 @@ const char* ProProof::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required uint32 version = 1; + // optional uint32 version = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { _Internal::set_has_version(&has_bits); @@ -11072,7 +11066,7 @@ const char* ProProof::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) } else goto handle_unusual; continue; - // required bytes genIndexHash = 2; + // optional bytes genIndexHash = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_genindexhash(); @@ -11081,7 +11075,7 @@ const char* ProProof::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) } else goto handle_unusual; continue; - // required bytes rotatingPublicKey = 3; + // optional bytes rotatingPublicKey = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { auto str = _internal_mutable_rotatingpublickey(); @@ -11090,7 +11084,7 @@ const char* ProProof::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) } else goto handle_unusual; continue; - // required uint64 expiryUnixTs = 4; + // optional uint64 expiryUnixTs = 4; case 4: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { _Internal::set_has_expiryunixts(&has_bits); @@ -11099,7 +11093,7 @@ const char* ProProof::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) } else goto handle_unusual; continue; - // required bytes sig = 5; + // optional bytes sig = 5; case 5: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { auto str = _internal_mutable_sig(); @@ -11139,31 +11133,31 @@ uint8_t* ProProof::_InternalSerialize( (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required uint32 version = 1; + // optional uint32 version = 1; if (cached_has_bits & 0x00000010u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_version(), target); } - // required bytes genIndexHash = 2; + // optional bytes genIndexHash = 2; if (cached_has_bits & 0x00000001u) { target = stream->WriteBytesMaybeAliased( 2, this->_internal_genindexhash(), target); } - // required bytes rotatingPublicKey = 3; + // optional bytes rotatingPublicKey = 3; if (cached_has_bits & 0x00000002u) { target = stream->WriteBytesMaybeAliased( 3, this->_internal_rotatingpublickey(), target); } - // required uint64 expiryUnixTs = 4; + // optional uint64 expiryUnixTs = 4; if (cached_has_bits & 0x00000008u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_expiryunixts(), target); } - // required bytes sig = 5; + // optional bytes sig = 5; if (cached_has_bits & 0x00000004u) { target = stream->WriteBytesMaybeAliased( 5, this->_internal_sig(), target); @@ -11177,76 +11171,48 @@ uint8_t* ProProof::_InternalSerialize( return target; } -size_t ProProof::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.ProProof) - size_t total_size = 0; - - if (_internal_has_genindexhash()) { - // required bytes genIndexHash = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_genindexhash()); - } - - if (_internal_has_rotatingpublickey()) { - // required bytes rotatingPublicKey = 3; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_rotatingpublickey()); - } - - if (_internal_has_sig()) { - // required bytes sig = 5; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_sig()); - } - - if (_internal_has_expiryunixts()) { - // required uint64 expiryUnixTs = 4; - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_expiryunixts()); - } - - if (_internal_has_version()) { - // required uint32 version = 1; - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_version()); - } - - return total_size; -} size_t ProProof::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:SessionProtos.ProProof) size_t total_size = 0; - if (((_impl_._has_bits_[0] & 0x0000001f) ^ 0x0000001f) == 0) { // All required fields are present. - // required bytes genIndexHash = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_genindexhash()); + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; - // required bytes rotatingPublicKey = 3; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_rotatingpublickey()); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x0000001fu) { + // optional bytes genIndexHash = 2; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_genindexhash()); + } - // required bytes sig = 5; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_sig()); + // optional bytes rotatingPublicKey = 3; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_rotatingpublickey()); + } - // required uint64 expiryUnixTs = 4; - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_expiryunixts()); + // optional bytes sig = 5; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_sig()); + } - // required uint32 version = 1; - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_version()); + // optional uint64 expiryUnixTs = 4; + if (cached_has_bits & 0x00000008u) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_expiryunixts()); + } - } else { - total_size += RequiredFieldsByteSizeFallback(); - } - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; + // optional uint32 version = 1; + if (cached_has_bits & 0x00000010u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_version()); + } + } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } @@ -11298,7 +11264,6 @@ void ProProof::CopyFrom(const ProProof& from) { } bool ProProof::IsInitialized() const { - if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; return true; } @@ -11345,9 +11310,6 @@ class ProMessage::_Internal { static void set_has_flags(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; - } }; const ::SessionProtos::ProProof& @@ -11430,7 +11392,7 @@ const char* ProMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ct uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // required .SessionProtos.ProProof proof = 1; + // optional .SessionProtos.ProProof proof = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_proof(), ptr); @@ -11438,7 +11400,7 @@ const char* ProMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ct } else goto handle_unusual; continue; - // required uint32 flags = 2; + // optional uint32 flags = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { _Internal::set_has_flags(&has_bits); @@ -11478,14 +11440,14 @@ uint8_t* ProMessage::_InternalSerialize( (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // required .SessionProtos.ProProof proof = 1; + // optional .SessionProtos.ProProof proof = 1; if (cached_has_bits & 0x00000001u) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: InternalWriteMessage(1, _Internal::proof(this), _Internal::proof(this).GetCachedSize(), target, stream); } - // required uint32 flags = 2; + // optional uint32 flags = 2; if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_flags(), target); @@ -11499,44 +11461,29 @@ uint8_t* ProMessage::_InternalSerialize( return target; } -size_t ProMessage::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.ProMessage) - size_t total_size = 0; - - if (_internal_has_proof()) { - // required .SessionProtos.ProProof proof = 1; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.proof_); - } - - if (_internal_has_flags()) { - // required uint32 flags = 2; - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); - } - - return total_size; -} size_t ProMessage::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:SessionProtos.ProMessage) size_t total_size = 0; - if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. - // required .SessionProtos.ProProof proof = 1; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.proof_); - - // required uint32 flags = 2; - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); - - } else { - total_size += RequiredFieldsByteSizeFallback(); - } uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + // optional .SessionProtos.ProProof proof = 1; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.proof_); + } + + // optional uint32 flags = 2; + if (cached_has_bits & 0x00000002u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); + } + + } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } @@ -11580,10 +11527,6 @@ void ProMessage::CopyFrom(const ProMessage& from) { } bool ProMessage::IsInitialized() const { - if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; - if (_internal_has_proof()) { - if (!_impl_.proof_->IsInitialized()) return false; - } return true; } diff --git a/proto/SessionProtos.pb.h b/proto/SessionProtos.pb.h index 10c96518..7b37ecf0 100644 --- a/proto/SessionProtos.pb.h +++ b/proto/SessionProtos.pb.h @@ -6422,7 +6422,7 @@ class ProProof final : kExpiryUnixTsFieldNumber = 4, kVersionFieldNumber = 1, }; - // required bytes genIndexHash = 2; + // optional bytes genIndexHash = 2; bool has_genindexhash() const; private: bool _internal_has_genindexhash() const; @@ -6440,7 +6440,7 @@ class ProProof final : std::string* _internal_mutable_genindexhash(); public: - // required bytes rotatingPublicKey = 3; + // optional bytes rotatingPublicKey = 3; bool has_rotatingpublickey() const; private: bool _internal_has_rotatingpublickey() const; @@ -6458,7 +6458,7 @@ class ProProof final : std::string* _internal_mutable_rotatingpublickey(); public: - // required bytes sig = 5; + // optional bytes sig = 5; bool has_sig() const; private: bool _internal_has_sig() const; @@ -6476,7 +6476,7 @@ class ProProof final : std::string* _internal_mutable_sig(); public: - // required uint64 expiryUnixTs = 4; + // optional uint64 expiryUnixTs = 4; bool has_expiryunixts() const; private: bool _internal_has_expiryunixts() const; @@ -6489,7 +6489,7 @@ class ProProof final : void _internal_set_expiryunixts(uint64_t value); public: - // required uint32 version = 1; + // optional uint32 version = 1; bool has_version() const; private: bool _internal_has_version() const; @@ -6506,9 +6506,6 @@ class ProProof final : private: class _Internal; - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -6639,7 +6636,7 @@ class ProMessage final : kProofFieldNumber = 1, kFlagsFieldNumber = 2, }; - // required .SessionProtos.ProProof proof = 1; + // optional .SessionProtos.ProProof proof = 1; bool has_proof() const; private: bool _internal_has_proof() const; @@ -6657,7 +6654,7 @@ class ProMessage final : ::SessionProtos::ProProof* proof); ::SessionProtos::ProProof* unsafe_arena_release_proof(); - // required uint32 flags = 2; + // optional uint32 flags = 2; bool has_flags() const; private: bool _internal_has_flags() const; @@ -6674,9 +6671,6 @@ class ProMessage final : private: class _Internal; - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -13397,7 +13391,7 @@ inline void GroupUpdateDeleteMemberContentMessage::set_allocated_adminsignature( // ProProof -// required uint32 version = 1; +// optional uint32 version = 1; inline bool ProProof::_internal_has_version() const { bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; return value; @@ -13425,7 +13419,7 @@ inline void ProProof::set_version(uint32_t value) { // @@protoc_insertion_point(field_set:SessionProtos.ProProof.version) } -// required bytes genIndexHash = 2; +// optional bytes genIndexHash = 2; inline bool ProProof::_internal_has_genindexhash() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; @@ -13493,7 +13487,7 @@ inline void ProProof::set_allocated_genindexhash(std::string* genindexhash) { // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProProof.genIndexHash) } -// required bytes rotatingPublicKey = 3; +// optional bytes rotatingPublicKey = 3; inline bool ProProof::_internal_has_rotatingpublickey() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; @@ -13561,7 +13555,7 @@ inline void ProProof::set_allocated_rotatingpublickey(std::string* rotatingpubli // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProProof.rotatingPublicKey) } -// required uint64 expiryUnixTs = 4; +// optional uint64 expiryUnixTs = 4; inline bool ProProof::_internal_has_expiryunixts() const { bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; return value; @@ -13589,7 +13583,7 @@ inline void ProProof::set_expiryunixts(uint64_t value) { // @@protoc_insertion_point(field_set:SessionProtos.ProProof.expiryUnixTs) } -// required bytes sig = 5; +// optional bytes sig = 5; inline bool ProProof::_internal_has_sig() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; @@ -13661,7 +13655,7 @@ inline void ProProof::set_allocated_sig(std::string* sig) { // ProMessage -// required .SessionProtos.ProProof proof = 1; +// optional .SessionProtos.ProProof proof = 1; inline bool ProMessage::_internal_has_proof() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; PROTOBUF_ASSUME(!value || _impl_.proof_ != nullptr); @@ -13751,7 +13745,7 @@ inline void ProMessage::set_allocated_proof(::SessionProtos::ProProof* proof) { // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProMessage.proof) } -// required uint32 flags = 2; +// optional uint32 flags = 2; inline bool ProMessage::_internal_has_flags() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; From d58e65ab62aa7fbcfc2fb3cae6ad704f58d485ce Mon Sep 17 00:00:00 2001 From: doylet Date: Thu, 14 Aug 2025 16:09:36 +1000 Subject: [PATCH 24/59] Allow envelope decrypt to handle encrypted v2 group envelopes --- include/session/session_protocol.h | 55 ++- include/session/session_protocol.hpp | 76 ++-- proto/SessionProtos.pb.cc | 32 +- proto/SessionProtos.pb.h | 52 +-- proto/SessionProtos.proto | 4 +- src/session_protocol.cpp | 114 +++--- tests/test_session_protocol.cpp | 571 +++++++++++++++++---------- 7 files changed, 554 insertions(+), 350 deletions(-) diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index 1f58fd04..fba14177 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -91,6 +91,23 @@ struct session_protocol_envelope { uint8_t pro_sig[64]; }; +struct session_protocol_decrypt_envelope_keys { + // Indicate to the envelope decrypting function that it should use the group keys to decrypt the + // envelope (e.g.: for groups v2 envelopes where the envelope is encrypted and the body + // unencrypted). The `group_keys` must be set if this flag is true. The recipient ed25519 + // private key field is ignored if this flag is set. + bool use_group_keys; + + // Keys to use to decrypt the envelope. + const config_group_keys* group_keys; + + // The libsodium-style secret key of the sender, 64 bytes. Can also be passed as a 32-byte seed. + // Used to decrypt the encrypted content. This field is used if `use_group_keys` is false in + // which case the group keys are ignored. This is for envelopes where the envelope itself is + // unencrypted and the contents is encrypted for this secret key. + std::span recipient_ed25519_privkey; +}; + struct session_protocol_decrypted_envelope { // Indicates if the decryption was successful. If the decryption step failed and threw an // exception, this is false. @@ -153,7 +170,7 @@ PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_FEAT /// encoded/wrapped if necessary). /// /// The success flag is set if encryption was successful, if the underlying implementation threw -/// an exception then this is set to false. +/// an exception then this is caught internally and success is set to false. LIBSESSION_EXPORT session_protocol_encrypted_for_destination session_protocol_encrypt_for_destination( const span_u8 plaintext, @@ -163,20 +180,30 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_for_destinat /// API: session_protocol/session_protocol_decrypt_envelope /// -/// Given an unencrypted plaintext representation of an envelope (i.e.: protobuf encoded stream of -/// `Envelope`) parse the envelope and return the envelope content decrypted to plaintext with the -/// passed in key. +/// Given an envelope payload (i.e.: protobuf encoded stream of `Envelope` or encrypted `Envelope` +/// using a Groups v2 key) parse (or decrypt) the envelope and return the envelope content decrypted +/// if necessary. +/// +/// A groups v2 envelope will get decrypted with the group keys. A non-groups v2 envelope will get +/// decrypted with the specified Ed25519 private key in the `keys` object. Only one of these keys +/// need to be set depending on the type of envelope payload passed into the function. /// /// See: session_protocol/decrypt_envelope for more information /// /// Inputs: -/// - `ed25519_privkey` -- the libsodium-style secret key of the sender, 64 bytes. Can also be -/// passed as a 32-byte seed. Used to decrypt the encrypted content. -/// - `envelope_plaintext` -- the protobuf serialised payload containing the message envelope. The -/// envelope must already be decrypted if it was originally encrypted (i.e.: closed group -/// envelopes). -/// - `unix_ts` -- pass in the current system time which is used to determine, whether or not the -/// Session Pro proof has expired or not if it is in the payload. Ignored otherwise +/// - `keys` -- the keys to decrypt either the envelope or the envelope contents. Groups v2 +/// envelopes where the envelope is encrypted must set the group key. Envelopes with an encrypted +/// content must set the the libsodium-style secret key of the receiver, 64 bytes. Can also be +/// passed as a 32-byte seed. +/// +/// If a group decryption key is specified, the recipient key is ignored and vice versa. Only one +/// of the keys should be set depending on the type of envelope. +/// +/// - `envelope_payload` -- the envelope payload either encrypted (groups v2 style) or unencrypted +/// (1o1 or legacy groups). +/// - `unix_ts` -- pass in the current system time in seconds which is used to determine, whether or +/// not the Session Pro proof has expired or not if it is in the payload. Ignored if there's no +/// proof in the message. /// - `pro_backend_pubkey` -- the Session Pro backend public key to verify the signature embedded in /// the proof, validating whether or not the attached proof was indeed issued by an authorised /// issuer @@ -186,11 +213,11 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_for_destinat /// within the envelope if there were any. /// /// The success flag is set if encryption was successful, if the underlying implementation threw -/// an exception then this is set to false. +/// an exception then this is caught internally and success is set to false. LIBSESSION_EXPORT session_protocol_decrypted_envelope session_protocol_decrypt_envelope( - const span_u8 ed25519_privkey, - const span_u8 envelope_plaintext, + const session_protocol_decrypt_envelope_keys* keys, + const span_u8 envelope_payload, uint64_t unix_ts, const span_u8 pro_backend_pubkey); diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index 8955e078..6b710b18 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -10,7 +10,10 @@ /// protocol types. This file contains high-level helper functions for decoding payloads on the /// Session protocol. Prefer functions here before resorting to the lower-level cryptography. -// NOTE: CPP doesn't support named bitfields without casting or operator overloads but C-style +// NOTE: In the CPP file we use C-style enums for bitfields and CPP-style enums for non-bitfield +// enums where we can to benefit from the type-safety of strong enums. +// +// CPP doesn't support named bitfields without casting or operator overloads but C-style // enums support it very well. The only issue is that using a native C-style enum enforces some type // restrictions that compilers dislike when attempting to manipulate bit fields. For example: // @@ -27,9 +30,6 @@ // // Does not trigger errors as the underlying type of `f` is actually an unsigned integer. The type // define is merely a hint to the user to what flags are to be used when manipulating the variable. -// -// Hence in the CPP file we use C-style enums for bitfields and CPP-style enums for non-bitfield -// enums where we can to benefit from the type-safety of strong enums. namespace session { @@ -38,11 +38,11 @@ namespace config::groups { } enum class ProStatus { - Nil, // Pro proof was not set - InvalidProBackendSig, // Pro proof was set; proof sig was not produced by the Pro backend key - InvalidUserSig, // Pro proof was set; envelope sig was not produced by the Rotating key - Valid, // Pro proof was set, is verified; has not expired - Expired, // Pro proof was set, is verified; has expired + Nil, // Proof not set + InvalidProBackendSig, // Proof set; pro proof sig was not produced by the Pro backend key + InvalidUserSig, // Proof set; envelope pro sig was not produced by the Rotating key + Valid, // Proof set, is verified; has not expired + Expired, // Proof set, is verified; has expired }; enum class DestinationType { @@ -113,9 +113,13 @@ struct DecryptedEnvelope { // Decrypted envelope content into plaintext std::vector content_plaintext; - // Sender public key extracted from the encrypted content payload + // Sender public key extracted from the encrypted content payload. This is not set if the + // envelope was a groups v2 envelope where the envelope was encrypted and only the x25519 pubkey + // was available. array_uc32 sender_ed25519_pubkey; + array_uc32 sender_x25519_pubkey; + // Status flag for validity of the Session Pro proof embedded in the envelope if it has one. // The status is set to `Nil` if there is no Session Pro proof in the message. Otherwise it's // set to one of the other values to which the remaining pro fields will be populated with data @@ -130,6 +134,24 @@ struct DecryptedEnvelope { PRO_FEATURES pro_features; }; +struct DecryptEnvelopeKey +{ + // Indicate to the envelope decrypting function that it should use the group keys to decrypt the + // envelope (e.g.: for groups v2 envelopes where the envelope is encrypted and the body + // unencrypted). The `group_keys` must be set if this flag is true. The recipient ed25519 + // private key field is ignored if this flag is set. + bool use_group_keys; + + // Keys to use to decrypt the envelope. + const config::groups::Keys* group_keys; + + // The libsodium-style secret key of the sender, 64 bytes. Can also be passed as a 32-byte seed. + // Used to decrypt the encrypted content. This field is used if `use_group_keys` is false in + // which case the group keys are ignored. This is for envelopes where the envelope itself is + // unencrypted and the contents is encrypted for this secret key. + std::span recipient_ed25519_privkey; +}; + struct EncryptedForDestination { // Indicates if the ciphertext was encrypted or not. This can be false if the message sent to @@ -201,9 +223,13 @@ EncryptedForDestination encrypt_for_destination( /// API: session_protocol/decrypt_envelope /// -/// Given an unencrypted plaintext representation of an envelope (i.e.: protobuf encoded stream of -/// `Envelope`) parse the envelope and return the envelope content decrypted to plaintext with the -/// passed in key. +/// Given an envelope payload (i.e.: protobuf encoded stream of `Envelope` or encrypted `Envelope` +/// using a Groups v2 key) parse (or decrypt) the envelope and return the envelope content decrypted +/// if necessary. +/// +/// A groups v2 envelope will get decrypted with the group keys. A non-groups v2 envelope will get +/// decrypted with the specified Ed25519 private key in the `keys` object. Only one of these keys +/// need to be set depending on the type of envelope payload passed into the function. /// /// If the message does not use Session Pro features, the pro status will be set to nil and all /// other pro fields are to be ignored. If the pro status is non-nil then the pro fields will be @@ -216,13 +242,19 @@ EncryptedForDestination encrypt_for_destination( /// field to verify if the Session Pro was present and/or valid or invalid. /// /// Inputs: -/// - `ed25519_privkey` -- the libsodium-style secret key of the receiver, 64 bytes. Can also be -/// passed as a 32-byte seed. Used to decrypt the encrypted content. -/// - `envelope_plaintext` -- the protobuf serialised payload containing the message envelope. The -/// envelope must already be decrypted if it was originally encrypted (i.e.: closed group -/// envelopes). -/// - `unix_ts` -- pass in the current system time which is used to determine, whether or not the -/// Session Pro proof has expired or not if it is in the payload. Ignored otherwise +/// - `keys` -- the keys to decrypt either the envelope or the envelope contents. Groups v2 +/// envelopes where the envelope is encrypted must set the group key. Envelopes with an encrypted +/// content must set the the libsodium-style secret key of the receiver, 64 bytes. Can also be +/// passed as a 32-byte seed. +/// +/// If a group decryption key is specified, the recipient key is ignored and vice versa. Only one +/// of the keys should be set depending on the type of envelope. +/// +/// - `envelope_payload` -- the envelope payload either encrypted (groups v2 style) or unencrypted +/// (1o1 or legacy groups). +/// - `unix_ts` -- pass in the current system time in seconds which is used to determine, whether or +/// not the Session Pro proof has expired or not if it is in the payload. Ignored if there's no +/// proof in the message. /// - `pro_backend_pubkey` -- the Session Pro backend public key to verify the signature embedded in /// the proof, validating whether or not the attached proof was indeed issued by an authorised /// issuer @@ -231,8 +263,8 @@ EncryptedForDestination encrypt_for_destination( /// - The decrypted envelope. It contains the fields of the envelope and the Session Pro metadata /// within the envelope if there were any. DecryptedEnvelope decrypt_envelope( - std::span ed25519_privkey, - std::span envelope_plaintext, + const DecryptEnvelopeKey& keys, + std::span envelope_payload, std::chrono::sys_seconds unix_ts, const array_uc32& pro_backend_pubkey); } // namespace session diff --git a/proto/SessionProtos.pb.cc b/proto/SessionProtos.pb.cc index 35074b0c..7b56cc16 100644 --- a/proto/SessionProtos.pb.cc +++ b/proto/SessionProtos.pb.cc @@ -500,7 +500,7 @@ PROTOBUF_CONSTEXPR ProMessage::ProMessage( /*decltype(_impl_._has_bits_)*/{} , /*decltype(_impl_._cached_size_)*/{} , /*decltype(_impl_.proof_)*/nullptr - , /*decltype(_impl_.flags_)*/0u} {} + , /*decltype(_impl_.features_)*/uint64_t{0u}} {} struct ProMessageDefaultTypeInternal { PROTOBUF_CONSTEXPR ProMessageDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -11307,7 +11307,7 @@ class ProMessage::_Internal { static void set_has_proof(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_flags(HasBits* has_bits) { + static void set_has_features(HasBits* has_bits) { (*has_bits)[0] |= 2u; } }; @@ -11329,13 +11329,13 @@ ProMessage::ProMessage(const ProMessage& from) decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} , decltype(_impl_.proof_){nullptr} - , decltype(_impl_.flags_){}}; + , decltype(_impl_.features_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); if (from._internal_has_proof()) { _this->_impl_.proof_ = new ::SessionProtos::ProProof(*from._impl_.proof_); } - _this->_impl_.flags_ = from._impl_.flags_; + _this->_impl_.features_ = from._impl_.features_; // @@protoc_insertion_point(copy_constructor:SessionProtos.ProMessage) } @@ -11347,7 +11347,7 @@ inline void ProMessage::SharedCtor( decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} , decltype(_impl_.proof_){nullptr} - , decltype(_impl_.flags_){0u} + , decltype(_impl_.features_){uint64_t{0u}} }; } @@ -11380,7 +11380,7 @@ void ProMessage::Clear() { GOOGLE_DCHECK(_impl_.proof_ != nullptr); _impl_.proof_->Clear(); } - _impl_.flags_ = 0u; + _impl_.features_ = uint64_t{0u}; _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } @@ -11400,11 +11400,11 @@ const char* ProMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ct } else goto handle_unusual; continue; - // optional uint32 flags = 2; + // optional uint64 features = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { - _Internal::set_has_flags(&has_bits); - _impl_.flags_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + _Internal::set_has_features(&has_bits); + _impl_.features_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else goto handle_unusual; @@ -11447,10 +11447,10 @@ uint8_t* ProMessage::_InternalSerialize( _Internal::proof(this).GetCachedSize(), target, stream); } - // optional uint32 flags = 2; + // optional uint64 features = 2; if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_flags(), target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_features(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -11478,9 +11478,9 @@ size_t ProMessage::ByteSizeLong() const { *_impl_.proof_); } - // optional uint32 flags = 2; + // optional uint64 features = 2; if (cached_has_bits & 0x00000002u) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_features()); } } @@ -11512,7 +11512,7 @@ void ProMessage::MergeFrom(const ProMessage& from) { from._internal_proof()); } if (cached_has_bits & 0x00000002u) { - _this->_impl_.flags_ = from._impl_.flags_; + _this->_impl_.features_ = from._impl_.features_; } _this->_impl_._has_bits_[0] |= cached_has_bits; } @@ -11535,8 +11535,8 @@ void ProMessage::InternalSwap(ProMessage* other) { _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(ProMessage, _impl_.flags_) - + sizeof(ProMessage::_impl_.flags_) + PROTOBUF_FIELD_OFFSET(ProMessage, _impl_.features_) + + sizeof(ProMessage::_impl_.features_) - PROTOBUF_FIELD_OFFSET(ProMessage, _impl_.proof_)>( reinterpret_cast(&_impl_.proof_), reinterpret_cast(&other->_impl_.proof_)); diff --git a/proto/SessionProtos.pb.h b/proto/SessionProtos.pb.h index 7b37ecf0..43259bae 100644 --- a/proto/SessionProtos.pb.h +++ b/proto/SessionProtos.pb.h @@ -6634,7 +6634,7 @@ class ProMessage final : enum : int { kProofFieldNumber = 1, - kFlagsFieldNumber = 2, + kFeaturesFieldNumber = 2, }; // optional .SessionProtos.ProProof proof = 1; bool has_proof() const; @@ -6654,17 +6654,17 @@ class ProMessage final : ::SessionProtos::ProProof* proof); ::SessionProtos::ProProof* unsafe_arena_release_proof(); - // optional uint32 flags = 2; - bool has_flags() const; + // optional uint64 features = 2; + bool has_features() const; private: - bool _internal_has_flags() const; + bool _internal_has_features() const; public: - void clear_flags(); - uint32_t flags() const; - void set_flags(uint32_t value); + void clear_features(); + uint64_t features() const; + void set_features(uint64_t value); private: - uint32_t _internal_flags() const; - void _internal_set_flags(uint32_t value); + uint64_t _internal_features() const; + void _internal_set_features(uint64_t value); public: // @@protoc_insertion_point(class_scope:SessionProtos.ProMessage) @@ -6678,7 +6678,7 @@ class ProMessage final : ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::SessionProtos::ProProof* proof_; - uint32_t flags_; + uint64_t features_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; @@ -13745,32 +13745,32 @@ inline void ProMessage::set_allocated_proof(::SessionProtos::ProProof* proof) { // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProMessage.proof) } -// optional uint32 flags = 2; -inline bool ProMessage::_internal_has_flags() const { +// optional uint64 features = 2; +inline bool ProMessage::_internal_has_features() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } -inline bool ProMessage::has_flags() const { - return _internal_has_flags(); +inline bool ProMessage::has_features() const { + return _internal_has_features(); } -inline void ProMessage::clear_flags() { - _impl_.flags_ = 0u; +inline void ProMessage::clear_features() { + _impl_.features_ = uint64_t{0u}; _impl_._has_bits_[0] &= ~0x00000002u; } -inline uint32_t ProMessage::_internal_flags() const { - return _impl_.flags_; +inline uint64_t ProMessage::_internal_features() const { + return _impl_.features_; } -inline uint32_t ProMessage::flags() const { - // @@protoc_insertion_point(field_get:SessionProtos.ProMessage.flags) - return _internal_flags(); +inline uint64_t ProMessage::features() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProMessage.features) + return _internal_features(); } -inline void ProMessage::_internal_set_flags(uint32_t value) { +inline void ProMessage::_internal_set_features(uint64_t value) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.flags_ = value; + _impl_.features_ = value; } -inline void ProMessage::set_flags(uint32_t value) { - _internal_set_flags(value); - // @@protoc_insertion_point(field_set:SessionProtos.ProMessage.flags) +inline void ProMessage::set_features(uint64_t value) { + _internal_set_features(value); + // @@protoc_insertion_point(field_set:SessionProtos.ProMessage.features) } #ifdef __GNUC__ diff --git a/proto/SessionProtos.proto b/proto/SessionProtos.proto index 309dbca1..58083a39 100644 --- a/proto/SessionProtos.proto +++ b/proto/SessionProtos.proto @@ -338,6 +338,6 @@ message ProProof { } message ProMessage { - optional ProProof proof = 1; - optional uint32 flags = 2; + optional ProProof proof = 1; + optional uint64 features = 2; } diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index 0167a972..06967c6b 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -313,12 +313,43 @@ struct DecryptedEnvelopeInternal { }; DecryptedEnvelope decrypt_envelope( - std::span ed25519_privkey, - std::span envelope_plaintext, + const DecryptEnvelopeKey& keys, + std::span envelope_payload, std::chrono::sys_seconds unix_ts, const array_uc32& pro_backend_pubkey) { DecryptedEnvelope result = {}; SessionProtos::Envelope envelope = {}; + std::span envelope_plaintext = envelope_payload; + + // The caller is indicating that the envelope_payload is encrypted, if the group keys are + // provided. We will decrypt the payload to get the plaintext. In all other cases, the envelope + // is assumed to be unencrypted and can be used verbatim. + std::vector envelope_plaintext_from_group_keys; + if (keys.use_group_keys) { + if (!keys.group_keys) + throw std::runtime_error( + "API misuse: Envelope decryption with group keys was requested but no key was " + "set"); + + // Decrypt + std::string sender_x25519_pubkey; + std::tie(sender_x25519_pubkey, envelope_plaintext_from_group_keys) = + keys.group_keys->decrypt_message(envelope_plaintext); + if (sender_x25519_pubkey.size() != crypto_sign_ed25519_PUBLICKEYBYTES) + throw std::runtime_error{fmt::format( + "Parse encrypted envelope failed, extracted x25519 pubkey was wrong size: {}", + sender_x25519_pubkey.size())}; + + // Update the plaintext to use the decrypted envelope + envelope_plaintext = envelope_plaintext_from_group_keys; // Update the plaintext + + // Copy keys out + std::memcpy( + result.sender_x25519_pubkey.data(), + sender_x25519_pubkey.data(), + sender_x25519_pubkey.size()); + } + if (!envelope.ParseFromArray(envelope_plaintext.data(), envelope_plaintext.size())) throw std::runtime_error{"Parse envelope from plaintext failed"}; @@ -369,51 +400,11 @@ DecryptedEnvelope decrypt_envelope( // Decrypt content // The envelope is encrypted in GroupsV2, contents unencrypted. In 1o1 and legacy groups, the // envelope is encrypted, contents is encrypted. - // - // On Android and Desktop, the envelope source is always set for legacy and v2 groups. This - // means we can use the envelope source to determine if the contents needs decryption. - // - // On iOS legacy groups have the source set. V2 groups on iOS do _not_ have the sender set. - // Reminder: - // - // v2 => envelope encrypted, contents unencrypted - // legacy => envelope unencrypted, contents encrypted - // - // Since all platforms always set the envelope source for a legacy groups message we can use the - // presence of the envelope source and check the prefix to determine if the contents is - // encrypted, i.e. do the following checks: - // - // 1. Is a closed group message - // 2. The source (pubkey) is set (all platforms set this field on legacy groups messages) - // 3. The pubkey has a legacy prefix (0x05) - // - // Refs: - // clang-format off - // Android: - // Legacy https://github.com/session-foundation/session-android/blob/e4c16ae8aa8cae2f75aba565b890082563b07bd2/app/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSender.kt#L189 - // v2 https://github.com/session-foundation/session-android/blob/e4c16ae8aa8cae2f75aba565b890082563b07bd2/app/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSender.kt#L176 - // Desktop: - // Legacy https://github.com/session-foundation/session-desktop/blob/4c5cd88fa707a01845f86c0de8920faf160653ea/ts/session/sending/MessageWrapper.ts#L140 - // v2 https://github.com/session-foundation/session-desktop/blob/4c5cd88fa707a01845f86c0de8920faf160653ea/ts/session/sending/MessageWrapper.ts#L49 - // iOS: - // Legacy https://github.com/session-foundation/session-ios/blob/932145ab255b2327ca20fc992ac73758b94b07cd/SessionMessagingKit/Sending%20%26%20Receiving/MessageSender.swift#L469 - // v2 https://github.com/session-foundation/session-ios/blob/932145ab255b2327ca20fc992ac73758b94b07cd/SessionMessagingKit/Sending%20%26%20Receiving/MessageSender.swift#L426 - // clang-format on - bool has_encrypted_content = envelope.type() == SessionProtos::Envelope_Type_SESSION_MESSAGE; - if (envelope.type() == SessionProtos::Envelope_Type_CLOSED_GROUP_MESSAGE && envelope.has_source()) { - const std::string& source_pubkey = envelope.source(); - if (source_pubkey.size() != sizeof(array_uc33)) - throw std::runtime_error{ - "Parse closed group message failed, source was not 33 byte public key"}; - - if (source_pubkey[0] != static_cast(SessionIDPrefix::group)) - has_encrypted_content = true; - } - + bool has_encrypted_content = !keys.use_group_keys; if (has_encrypted_content) { std::span content_str = session::to_span(envelope.content()); auto [content_plaintext, sender_ed25519_pubkey] = - session::decrypt_incoming(ed25519_privkey, content_str); + session::decrypt_incoming(keys.recipient_ed25519_privkey, content_str); assert(result.sender_ed25519_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); result.content_plaintext = std::move(content_plaintext); @@ -421,6 +412,12 @@ DecryptedEnvelope decrypt_envelope( result.sender_ed25519_pubkey.data(), sender_ed25519_pubkey.data(), result.sender_ed25519_pubkey.size()); + + if (crypto_sign_ed25519_pk_to_curve25519( + result.sender_x25519_pubkey.data(), result.sender_ed25519_pubkey.data()) != 0) + throw std::runtime_error( + "Parse content failed, ed25519 public key could not be converted to x25519 " + "key."); } else { result.content_plaintext.resize(envelope.content().size()); std::memcpy(result.content_plaintext.data(), envelope.content().data(), envelope.content().size()); @@ -442,11 +439,11 @@ DecryptedEnvelope decrypt_envelope( if (!envelope.has_prosig()) throw std::runtime_error("Parse envelope failed, pro message is missing signature"); + // Copy (maybe dummy) pro signature into our result struct const std::string& pro_sig = envelope.prosig(); if (pro_sig.size() != crypto_sign_ed25519_BYTES) throw std::runtime_error("Parse envelope failed, pro signature has wrong size"); static_assert(sizeof(result.envelope.pro_sig) == crypto_sign_ed25519_BYTES); - std::memcpy(result.envelope.pro_sig.data(), pro_sig.data(), pro_sig.size()); if (content.has_promessage()) { @@ -454,21 +451,19 @@ DecryptedEnvelope decrypt_envelope( result.envelope.flags |= ENVELOPE_FLAGS_PRO_SIG; // Extract the pro message - SessionProtos::ProMessage pro_msg = content.promessage(); + const SessionProtos::ProMessage& pro_msg = content.promessage(); if (!pro_msg.has_proof()) throw std::runtime_error("Parse decrypted message failed, pro config missing proof"); - if (!pro_msg.has_flags()) - throw std::runtime_error("Parse decrypted message failed, pro config missing flags"); - - const SessionProtos::ProProof& proto_proof = pro_msg.proof(); - std::uint32_t proto_flags = pro_msg.flags(); + if (!pro_msg.has_features()) + throw std::runtime_error("Parse decrypted message failed, pro config missing features"); // Parse the proof from protobufs + const SessionProtos::ProProof& proto_proof = pro_msg.proof(); session::config::ProProof& proof = result.pro_proof; // clang-format off size_t proof_errors = 0; - proof_errors += !proto_proof.has_version() || proto_proof.version() != static_cast(session::config::ProProofVersion_v0); - proof_errors += !proto_proof.has_genindexhash() || proto_proof.genindexhash().size() != proof.gen_index_hash.max_size(); + proof_errors += !proto_proof.has_version() || proto_proof.version() != static_cast(session::config::ProProofVersion_v0); + proof_errors += !proto_proof.has_genindexhash() || proto_proof.genindexhash().size() != proof.gen_index_hash.max_size(); proof_errors += !proto_proof.has_rotatingpublickey() || proto_proof.rotatingpublickey().size() != proof.rotating_pubkey.max_size(); proof_errors += !proto_proof.has_expiryunixts(); proof_errors += !proto_proof.has_sig() || proto_proof.sig().size() != proof.sig.max_size(); @@ -485,7 +480,7 @@ DecryptedEnvelope decrypt_envelope( result.pro_status = verify_result == 0 ? ProStatus::Valid : ProStatus::InvalidUserSig; // Fill out the resulting proof structure, we have parsed successfully - result.pro_features = proto_flags; + result.pro_features = pro_msg.features(); std::memcpy(result.envelope.pro_sig.data(), pro_sig.data(), pro_sig.size()); std::memcpy( @@ -562,14 +557,21 @@ session_protocol_encrypt_for_destination( LIBSESSION_EXPORT session_protocol_decrypted_envelope session_protocol_decrypt_envelope( - const span_u8 ed25519_privkey, + const session_protocol_decrypt_envelope_keys* keys, const span_u8 envelope_plaintext, uint64_t unix_ts, const span_u8 pro_backend_pubkey) { session_protocol_decrypted_envelope result = {}; try { + + DecryptEnvelopeKey keys_cpp = { + .use_group_keys = keys->use_group_keys, + .group_keys = + reinterpret_cast(keys->group_keys->internals), + .recipient_ed25519_privkey = keys->recipient_ed25519_privkey}; + DecryptedEnvelope result_cpp = decrypt_envelope( - ed25519_privkey.cpp_span(), + keys_cpp, envelope_plaintext.cpp_span(), std::chrono::sys_seconds(std::chrono::seconds(unix_ts)), {}); diff --git a/tests/test_session_protocol.cpp b/tests/test_session_protocol.cpp index 86820102..cd13c8c7 100644 --- a/tests/test_session_protocol.cpp +++ b/tests/test_session_protocol.cpp @@ -1,24 +1,114 @@ #include #include -#include -#include -#include +#include #include #include -#include "SessionProtos.pb.h" +#include +#include +#include +#include +#include +#include +#include "WebSocketResources.pb.h" +#include "SessionProtos.pb.h" #include "utils.hpp" using namespace session; +struct SerialisedProtobufContentWithProForTesting { + config::ProProof proof; + std::string plaintext; + array_uc64 sig_over_plaintext_with_user_pro_key; + array_uc32 pro_proof_hash; +}; + +static SerialisedProtobufContentWithProForTesting build_protobuf_content_with_session_pro( + std::string_view data_body, + const array_uc64& user_rotating_privkey, + const array_uc64& pro_backend_privkey, + std::chrono::sys_seconds pro_expiry_unix_ts, + PRO_FEATURES features) { + SerialisedProtobufContentWithProForTesting result = {}; + + // Create protobuf `Content.dataMessage` + SessionProtos::Content content = {}; + SessionProtos::DataMessage* data = content.mutable_datamessage(); + data->set_body(std::string(data_body)); + + // Generate a dummy proof + crypto_sign_ed25519_sk_to_pk(result.proof.rotating_pubkey.data(), user_rotating_privkey.data()); + result.proof.expiry_unix_ts = pro_expiry_unix_ts; + + // Sign the proof by the dummy "Session Pro Backend" key + result.pro_proof_hash = result.proof.hash(); + crypto_sign_ed25519_detached( + result.proof.sig.data(), + nullptr, + result.pro_proof_hash.data(), + result.pro_proof_hash.size(), + pro_backend_privkey.data()); + + // Create protobuf `Content.proMessage` + SessionProtos::ProMessage* pro = content.mutable_promessage(); + pro->set_features(features); + + // Create protobuf `Content.proMessage.proof` + SessionProtos::ProProof* proto_proof = pro->mutable_proof(); + proto_proof->set_version(result.proof.version); + proto_proof->set_genindexhash( + result.proof.gen_index_hash.data(), result.proof.gen_index_hash.size()); + proto_proof->set_rotatingpublickey( + result.proof.rotating_pubkey.data(), result.proof.rotating_pubkey.size()); + proto_proof->set_expiryunixts(result.proof.expiry_unix_ts.time_since_epoch().count()); + proto_proof->set_sig(result.proof.sig.data(), result.proof.sig.size()); + + // Generate the plaintext + result.plaintext = content.SerializeAsString(); + REQUIRE(result.plaintext.size() > data_body.size()); + + // Sign the plaintext with the user's pro key + crypto_sign_ed25519_detached( + result.sig_over_plaintext_with_user_pro_key.data(), + nullptr, + reinterpret_cast(result.plaintext.data()), + result.plaintext.size(), + user_rotating_privkey.data()); + + return result; +} + TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { + // Do tests that require no setup + SECTION("Ensure get pro fetaures detects large message") { + // Try a message below the size threshold + PRO_FEATURES features = get_pro_features_for_msg( + PRO_STANDARD_CHARACTER_LIMIT, + PRO_EXTRA_FEATURES_PRO_BADGE | PRO_EXTRA_FEATURES_ANIMATED_AVATAR); + REQUIRE(features == (PRO_FEATURES_PRO_BADGE | PRO_FEATURES_ANIMATED_AVATAR)); + + // Try a message exceeding the size threshold + features = get_pro_features_for_msg( + PRO_STANDARD_CHARACTER_LIMIT + 1, + PRO_EXTRA_FEATURES_PRO_BADGE | PRO_EXTRA_FEATURES_ANIMATED_AVATAR); + REQUIRE(features == (PRO_FEATURES_10K_CHARACTER_LIMIT | PRO_FEATURES_PRO_BADGE | + PRO_FEATURES_ANIMATED_AVATAR)); + + // Try asking for just one extra feature + features = get_pro_features_for_msg(100, PRO_EXTRA_FEATURES_PRO_BADGE); + REQUIRE(features == PRO_FEATURES_PRO_BADGE); + } + + // Tests that require some setup code using namespace session; TestKeys keys = get_deterministic_test_keys(); // Tuesday, 12 August 2025 03:58:21 UTC const std::chrono::milliseconds timestamp_ms = std::chrono::seconds(1754971101); + const std::chrono::sys_seconds timestamp_s = std::chrono::sys_seconds( + std::chrono::duration_cast(timestamp_ms)); const std::string_view data_body = "hello"; SECTION("Encrypt with and w/o pro sig produce same payload size") { @@ -44,11 +134,18 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { REQUIRE(encrypt_with_pro_sig.encrypted); // Should have the same payload size - REQUIRE(encrypt_without_pro_sig.ciphertext.size() == encrypt_with_pro_sig.ciphertext.size()); + REQUIRE(encrypt_without_pro_sig.ciphertext.size() == + encrypt_with_pro_sig.ciphertext.size()); } - SECTION("Encrypt/decrypt for contact in default namespace") { - // Build content + // Setup a dummy "Session Pro Backend" key + // We reuse test key 1 as the "Session Pro" backend key that signs the proofs as it + // doesn't matter what key really, just that we have one available for signing. + const array_uc64& pro_backend_ed_sk = keys.ed_sk1; + const array_uc32& pro_backend_ed_pk = keys.ed_pk1; + + SECTION("Encrypt/decrypt for contact in default namespace w/o pro attached") { + // Build content without pro attached std::string plaintext; { SessionProtos::Content content = {}; @@ -65,7 +162,8 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { dest.type = DestinationType::Contact; dest.sent_timestamp_ms = timestamp_ms; REQUIRE(dest.recipient_pubkey.size() == keys.session_pk1.size()); - std::memcpy(dest.recipient_pubkey.data(), keys.session_pk1.data(), keys.session_pk1.size()); + std::memcpy( + dest.recipient_pubkey.data(), keys.session_pk1.data(), keys.session_pk1.size()); encrypt_result = session::encrypt_for_destination( to_span(plaintext), keys.ed_sk0, dest, config::Namespace::Default); @@ -73,15 +171,15 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { } // Decrypt envelope + DecryptEnvelopeKey decrypt_keys = {}; + decrypt_keys.use_group_keys = false; + decrypt_keys.recipient_ed25519_privkey = keys.ed_sk1; DecryptedEnvelope decrypt_result = session::decrypt_envelope( - keys.ed_sk1, - encrypt_result.ciphertext, - std::chrono::sys_seconds( - std::chrono::duration_cast(timestamp_ms)), pro_backend::PUBKEY); + decrypt_keys, encrypt_result.ciphertext, timestamp_s, pro_backend_ed_pk); // Verify pro config::ProProof nil_proof = {}; - REQUIRE(decrypt_result.pro_status == ProStatus::Nil); // Pro was not attached + REQUIRE(decrypt_result.pro_status == ProStatus::Nil); // Pro was not attached REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); REQUIRE(decrypt_result.pro_proof.hash() == nil_proof.hash()); @@ -94,31 +192,6 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { REQUIRE(data.body() == data_body); } - SECTION("Ensure get pro fetaures detects large message") { - // Try a message below the size threshold - PRO_FEATURES features = get_pro_features_for_msg( - PRO_STANDARD_CHARACTER_LIMIT, - PRO_EXTRA_FEATURES_PRO_BADGE | PRO_EXTRA_FEATURES_ANIMATED_AVATAR); - REQUIRE(features == (PRO_FEATURES_PRO_BADGE | PRO_FEATURES_ANIMATED_AVATAR)); - - // Try a message exceeding the size threshold - features = get_pro_features_for_msg( - PRO_STANDARD_CHARACTER_LIMIT + 1, - PRO_EXTRA_FEATURES_PRO_BADGE | PRO_EXTRA_FEATURES_ANIMATED_AVATAR); - REQUIRE(features == (PRO_FEATURES_10K_CHARACTER_LIMIT | PRO_FEATURES_PRO_BADGE | - PRO_FEATURES_ANIMATED_AVATAR)); - - // Try asking for just one extra feature - features = get_pro_features_for_msg(100, PRO_EXTRA_FEATURES_PRO_BADGE); - REQUIRE(features == PRO_FEATURES_PRO_BADGE); - } - - // Prepare a Session Pro proof - // We reuse test key 1 as the "Session Pro" backend key that signs the proofs as it - // doesn't matter what key really, just that we have one for signing. - const array_uc64& pro_backend_ed_sk = keys.ed_sk1; - const array_uc32& pro_backend_ed_pk = keys.ed_pk1; - // Generate the user's Session Pro rotating key for testing encrypted payloads with Session // Pro metadata const auto user_pro_seed = @@ -130,137 +203,89 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { // Build protobuf `Content` message, serialise to `plaintext` and get it signed by the user's // "Session Pro" key into `sig_over_plaintext_with_user_pro_key` - std::string plaintext; - array_uc64 sig_over_plaintext_with_user_pro_key = {}; - array_uc32 pro_proof_hash = {}; - { - SessionProtos::Content content = {}; - - // Create protobuf `Content.dataMessage` - SessionProtos::DataMessage* data = content.mutable_datamessage(); - data->set_body(std::string(data_body)); - - // Generate a dummy proof - config::ProProof proof = {}; - proof.rotating_pubkey = user_pro_ed_pk; - proof.expiry_unix_ts = std::chrono::sys_seconds( - std::chrono::duration_cast(timestamp_ms)); - - // Sign the proof by the dummy "Session Pro Backend" key - pro_proof_hash = proof.hash(); - crypto_sign_ed25519_detached( - proof.sig.data(), - nullptr, - pro_proof_hash.data(), - pro_proof_hash.size(), - pro_backend_ed_sk.data()); - - // Create protobuf `Content.proMessage` - SessionProtos::ProMessage *pro = content.mutable_promessage(); - pro->set_flags(PRO_FEATURES_NIL); - - // Create protobuf `Content.proMessage.proof` - SessionProtos::ProProof *proto_proof = pro->mutable_proof(); - proto_proof->set_version(proof.version); - proto_proof->set_genindexhash(proof.gen_index_hash.data(), proof.gen_index_hash.size()); - proto_proof->set_rotatingpublickey(proof.rotating_pubkey.data(), proof.rotating_pubkey.size()); - proto_proof->set_expiryunixts(proof.expiry_unix_ts.time_since_epoch().count()); - proto_proof->set_sig(proof.sig.data(), proof.sig.size()); - - // Generate the plaintext - plaintext = content.SerializeAsString(); - REQUIRE(plaintext.size() > data_body.size()); - - // Sign the plaintext with the user's pro key - crypto_sign_ed25519_detached( - sig_over_plaintext_with_user_pro_key.data(), - nullptr, - reinterpret_cast(plaintext.data()), - plaintext.size(), - user_pro_ed_sk.data()); - } + SerialisedProtobufContentWithProForTesting protobuf_content_with_pro = + build_protobuf_content_with_session_pro( + /*data_body*/ data_body, + /*user_rotating_privkey*/ user_pro_ed_sk, + /*pro_backend_privkey*/ pro_backend_ed_sk, + /*pro_expiry_unix_ts*/ timestamp_s, + PRO_FEATURES_NIL); + + // Setup base destination object with the pro signature w/ Session pubkey 1 as the recipient + session::Destination base_dest = {}; + base_dest.sent_timestamp_ms = timestamp_ms; + base_dest.pro_sig = protobuf_content_with_pro.sig_over_plaintext_with_user_pro_key; + REQUIRE(base_dest.recipient_pubkey.size() == keys.session_pk1.size()); + std::memcpy( + base_dest.recipient_pubkey.data(), keys.session_pk1.data(), keys.session_pk1.size()); + + SECTION("Check non-encryptable messages produce only plaintext") { + auto dest_list = { + DestinationType::OpenGroup, + DestinationType::OpenGroupInbox, + DestinationType::Contact}; - SECTION("Encrypt/decrypt for contact in default namespace with Pro") { - // Build content - std::string plaintext; - array_uc64 sig_over_plaintext_with_user_pro_key = {}; - array_uc32 pro_proof_hash = {}; - { - SessionProtos::Content content = {}; + for (auto dest_type : dest_list) { + if (dest_type == DestinationType::OpenGroup) + INFO("Trying open groups"); + else if (dest_type == DestinationType::OpenGroupInbox) + INFO("Trying open group inbox"); + else + INFO("Trying contacts to non-default namespace"); - // Create protobuf `Content.dataMessage` - SessionProtos::DataMessage* data = content.mutable_datamessage(); - data->set_body(std::string(data_body)); + session::Destination dest = base_dest; + dest.type = dest_type; - // Generate a dummy proof - config::ProProof proof = {}; - proof.rotating_pubkey = user_pro_ed_pk; - proof.expiry_unix_ts = std::chrono::sys_seconds( - std::chrono::duration_cast(timestamp_ms)); - - // Sign the proof by the dummy "Session Pro Backend" key - pro_proof_hash = proof.hash(); - crypto_sign_ed25519_detached( - proof.sig.data(), - nullptr, - pro_proof_hash.data(), - pro_proof_hash.size(), - pro_backend_ed_sk.data()); - - // Create protobuf `Content.proMessage` - SessionProtos::ProMessage *pro = content.mutable_promessage(); - pro->set_flags(PRO_FEATURES_NIL); - - // Create protobuf `Content.proMessage.proof` - SessionProtos::ProProof *proto_proof = pro->mutable_proof(); - proto_proof->set_version(proof.version); - proto_proof->set_genindexhash(proof.gen_index_hash.data(), proof.gen_index_hash.size()); - proto_proof->set_rotatingpublickey(proof.rotating_pubkey.data(), proof.rotating_pubkey.size()); - proto_proof->set_expiryunixts(proof.expiry_unix_ts.time_since_epoch().count()); - proto_proof->set_sig(proof.sig.data(), proof.sig.size()); - - // Generate the plaintext - plaintext = content.SerializeAsString(); - REQUIRE(plaintext.size() > data_body.size()); + config::Namespace space = config::Namespace::Default; + if (dest_type == DestinationType::Contact) { + space = config::Namespace::Contacts; + } else if (dest_type == DestinationType::OpenGroupInbox) { + auto [blind15_pk, blind15_sk] = session::blind15_key_pair( + keys.ed_sk1, keys.ed_pk1, /*blind factor*/ nullptr); + dest.recipient_pubkey[0] = 0x15; + std::memcpy(dest.recipient_pubkey.data() + 1, blind15_pk.data(), blind15_pk.size()); + } + + EncryptedForDestination encrypt_result = session::encrypt_for_destination( + to_span(protobuf_content_with_pro.plaintext), keys.ed_sk0, dest, space); - // Sign the plaintext with the user's pro key - crypto_sign_ed25519_detached( - sig_over_plaintext_with_user_pro_key.data(), - nullptr, - reinterpret_cast(plaintext.data()), - plaintext.size(), - user_pro_ed_sk.data()); + if (dest_type == DestinationType::OpenGroupInbox) { + REQUIRE(encrypt_result.encrypted); + REQUIRE(encrypt_result.ciphertext.size()); + } else { + REQUIRE_FALSE(encrypt_result.encrypted); + REQUIRE(encrypt_result.ciphertext.empty()); + } } + } - // Encrypt + SECTION("Encrypt/decrypt for contact in default namespace with Pro") { + // Encrypt content EncryptedForDestination encrypt_result = {}; { - session::Destination dest = {}; + session::Destination dest = base_dest; dest.type = DestinationType::Contact; - dest.sent_timestamp_ms = timestamp_ms; - dest.pro_sig = sig_over_plaintext_with_user_pro_key; - REQUIRE(dest.recipient_pubkey.size() == keys.session_pk1.size()); - std::memcpy(dest.recipient_pubkey.data(), keys.session_pk1.data(), keys.session_pk1.size()); - encrypt_result = session::encrypt_for_destination( - to_span(plaintext), keys.ed_sk0, dest, config::Namespace::Default); + to_span(protobuf_content_with_pro.plaintext), + keys.ed_sk0, + dest, + config::Namespace::Default); REQUIRE(encrypt_result.encrypted); } // Decrypt envelope + DecryptEnvelopeKey decrypt_keys = {}; + decrypt_keys.use_group_keys = false; + decrypt_keys.recipient_ed25519_privkey = keys.ed_sk1; DecryptedEnvelope decrypt_result = session::decrypt_envelope( - keys.ed_sk1, - encrypt_result.ciphertext, - std::chrono::sys_seconds( - std::chrono::duration_cast(timestamp_ms)), - pro_backend_ed_pk); + decrypt_keys, encrypt_result.ciphertext, timestamp_s, pro_backend_ed_pk); // Verify pro - REQUIRE(decrypt_result.pro_status == ProStatus::Valid); // Pro was attached - REQUIRE(decrypt_result.pro_proof.hash() == pro_proof_hash); - REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); // No features requested + REQUIRE(decrypt_result.pro_status == ProStatus::Valid); // Pro was attached + REQUIRE(decrypt_result.pro_proof.hash() == protobuf_content_with_pro.pro_proof_hash); + REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); // No features requested - // Verify it is decryptable + // Verify the content can be parsed w/ protobufs SessionProtos::Content decrypt_content = {}; REQUIRE(decrypt_content.ParseFromArray( decrypt_result.content_plaintext.data(), decrypt_result.content_plaintext.size())); @@ -269,74 +294,96 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { REQUIRE(data.body() == data_body); } - SECTION("Check non-encryptable messages produce plaintext") { - auto dest_list = { - DestinationType::OpenGroup, - DestinationType::OpenGroupInbox, - DestinationType::Contact}; + SECTION("Encrypt/decrypt for contact in default namespace with Pro + features") { - for (auto dest_type : dest_list) { - if (dest_type == DestinationType::OpenGroup) - INFO("Trying open groups"); - else if (dest_type == DestinationType::OpenGroupInbox) - INFO("Trying open group inbox"); - else - INFO("Trying contacts to non-default namespace"); + std::string large_message; + large_message.resize(PRO_STANDARD_CHARACTER_LIMIT + 1); - session::Destination dest = {}; - dest.type = dest_type; - dest.sent_timestamp_ms = timestamp_ms; - dest.pro_sig = sig_over_plaintext_with_user_pro_key; - REQUIRE(dest.recipient_pubkey.size() == keys.session_pk1.size()); - std::memcpy( - dest.recipient_pubkey.data(), keys.session_pk1.data(), keys.session_pk1.size()); + PRO_FEATURES features = + get_pro_features_for_msg(large_message.size(), PRO_EXTRA_FEATURES_PRO_BADGE); + REQUIRE(features == (PRO_FEATURES_10K_CHARACTER_LIMIT | PRO_FEATURES_PRO_BADGE)); - config::Namespace space = config::Namespace::Default; - if (dest_type == DestinationType::Contact) { - space = config::Namespace::Contacts; - dest.recipient_pubkey[0] = 0x15; - } + SerialisedProtobufContentWithProForTesting protobuf_content_with_pro_and_features = + build_protobuf_content_with_session_pro( + /*data_body*/ large_message, + /*user_rotating_privkey*/ user_pro_ed_sk, + /*pro_backend_privkey*/ pro_backend_ed_sk, + /*pro_expiry_unix_ts*/ timestamp_s, + features); - EncryptedForDestination encrypt_result = - session::encrypt_for_destination(to_span(plaintext), keys.ed_sk0, dest, space); - REQUIRE_FALSE(encrypt_result.encrypted); - REQUIRE(encrypt_result.ciphertext.empty()); + // Encrypt content + EncryptedForDestination encrypt_result = {}; + { + session::Destination dest = base_dest; + dest.type = DestinationType::Contact; + dest.pro_sig = + protobuf_content_with_pro_and_features.sig_over_plaintext_with_user_pro_key; + encrypt_result = session::encrypt_for_destination( + to_span(protobuf_content_with_pro_and_features.plaintext), + keys.ed_sk0, + dest, + config::Namespace::Default); + REQUIRE(encrypt_result.encrypted); } - } + // Decrypt envelope + DecryptEnvelopeKey decrypt_keys = {}; + decrypt_keys.use_group_keys = false; + decrypt_keys.recipient_ed25519_privkey = keys.ed_sk1; + DecryptedEnvelope decrypt_result = session::decrypt_envelope( + decrypt_keys, encrypt_result.ciphertext, timestamp_s, pro_backend_ed_pk); - SECTION("Encrypt/decrypt for legacy closed group (w/ encrypted envelope, plaintext content) " - "with Pro") { + // Verify pro + REQUIRE(decrypt_result.pro_status == ProStatus::Valid); // Pro was attached + REQUIRE(decrypt_result.pro_proof.hash() == + protobuf_content_with_pro_and_features.pro_proof_hash); + REQUIRE(decrypt_result.pro_features == + (PRO_FEATURES_10K_CHARACTER_LIMIT | PRO_FEATURES_PRO_BADGE)); + // Verify the content can be parsed w/ protobufs + SessionProtos::Content decrypt_content = {}; + REQUIRE(decrypt_content.ParseFromArray( + decrypt_result.content_plaintext.data(), decrypt_result.content_plaintext.size())); + REQUIRE(decrypt_content.has_datamessage()); + const SessionProtos::DataMessage& data = decrypt_content.datamessage(); + REQUIRE(data.body() == large_message); + } + + SECTION("Encrypt/decrypt for legacy groups (w/ encrypted envelope, plaintext content) with Pro") { // Encrypt EncryptedForDestination encrypt_result = {}; { - session::Destination dest = {}; + Destination dest = base_dest; dest.type = DestinationType::ClosedGroup; - dest.sent_timestamp_ms = timestamp_ms; - dest.pro_sig = sig_over_plaintext_with_user_pro_key; - REQUIRE(dest.recipient_pubkey.size() == keys.session_pk1.size()); - std::memcpy(dest.recipient_pubkey.data(), keys.session_pk1.data(), keys.session_pk1.size()); + assert(dest.recipient_pubkey[0] == 0x05); encrypt_result = session::encrypt_for_destination( - to_span(plaintext), keys.ed_sk0, dest, config::Namespace::Default); + to_span(protobuf_content_with_pro.plaintext), + keys.ed_sk0, + dest, + config::Namespace::Default); REQUIRE(encrypt_result.encrypted); } + // Legacy groups wrap in websocket message + WebSocketProtos::WebSocketMessage ws_msg; + REQUIRE(ws_msg.ParseFromArray(encrypt_result.ciphertext.data(), encrypt_result.ciphertext.size())); + REQUIRE(ws_msg.has_request()); + REQUIRE(ws_msg.request().has_body()); + // Decrypt envelope + DecryptEnvelopeKey decrypt_keys = {}; + decrypt_keys.use_group_keys = false; + decrypt_keys.recipient_ed25519_privkey = keys.ed_sk1; DecryptedEnvelope decrypt_result = session::decrypt_envelope( - keys.ed_sk1, - encrypt_result.ciphertext, - std::chrono::sys_seconds( - std::chrono::duration_cast(timestamp_ms)), - pro_backend_ed_pk); + decrypt_keys, to_span(ws_msg.request().body()), timestamp_s, pro_backend_ed_pk); // Verify pro - REQUIRE(decrypt_result.pro_status == ProStatus::Valid); // Pro was attached - REQUIRE(decrypt_result.pro_proof.hash() == pro_proof_hash); - REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); // No features requested + REQUIRE(decrypt_result.pro_status == ProStatus::Valid); // Pro was attached + REQUIRE(decrypt_result.pro_proof.hash() == protobuf_content_with_pro.pro_proof_hash); + REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); // No features requested - // Verify it is decryptable + // Verify the content can be parsed w/ protobufs SessionProtos::Content decrypt_content = {}; REQUIRE(decrypt_content.ParseFromArray( decrypt_result.content_plaintext.data(), decrypt_result.content_plaintext.size())); @@ -345,42 +392,138 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { REQUIRE(data.body() == data_body); } - SECTION("Encrypt/decrypt for sync messages with Pro") { + SECTION("Encrypt/decrypt for groups v2 (w/ encrypted envelope, plaintext content) with Pro") { + // TODO: Finish setting up a fake group + const auto group_v2_seed = + "0123456789abcdef0123456789abcdeff00baadeadb33f000000000000000000"_hexbytes; + array_uc64 group_v2_sk = {}; + array_uc32 group_v2_pk = {}; + crypto_sign_ed25519_seed_keypair( + group_v2_pk.data(), group_v2_sk.data(), group_v2_seed.data()); + + auto group_v2_info = config::groups::Info(group_v2_pk, group_v2_sk, std::nullopt); + auto group_v2_members = config::groups::Members(group_v2_pk, group_v2_sk, std::nullopt); + auto group_v2_keys = config::groups::Keys( + keys.ed_sk0, + group_v2_pk, + group_v2_sk, + std::nullopt, + group_v2_info, + group_v2_members); // Encrypt +#if 0 EncryptedForDestination encrypt_result = {}; { - session::Destination dest = {}; - dest.type = DestinationType::SyncMessage; - dest.sent_timestamp_ms = timestamp_ms; - dest.pro_sig = sig_over_plaintext_with_user_pro_key; - REQUIRE(dest.recipient_pubkey.size() == keys.session_pk1.size()); - std::memcpy(dest.recipient_pubkey.data(), keys.session_pk1.data(), keys.session_pk1.size()); + Destination dest = base_dest; + dest.type = DestinationType::ClosedGroup; + dest.closed_group_pubkey[0] = 0x03; + std::memcpy(dest.closed_group_pubkey.data() + 1, group_v2_pk.data(), group_v2_pk.size()); + dest.closed_group_keys = &group_v2_keys; encrypt_result = session::encrypt_for_destination( - to_span(plaintext), keys.ed_sk0, dest, config::Namespace::Default); + to_span(protobuf_content_with_pro.plaintext), + keys.ed_sk0, + dest, + config::Namespace::GroupMessages); REQUIRE(encrypt_result.encrypted); } // Decrypt envelope + DecryptEnvelopeKey decrypt_keys = {}; + decrypt_keys.use_group_keys = true; + decrypt_keys.group_keys = &group_v2_keys; + + // TODO: Finish setting up a group so we can check the decrypted result for now this will + // throw because the keys aren't setup correctly. + CHECK_THROWS(session::decrypt_envelope( + decrypt_keys, encrypt_result.ciphertext, timestamp_s, pro_backend_ed_pk)); +#endif + } + + SECTION("Encrypt/decrypt for sync messages with Pro") { + // Encrypt + EncryptedForDestination encrypt_result = {}; + { + session::Destination dest = base_dest; + dest.type = DestinationType::SyncMessage; + encrypt_result = session::encrypt_for_destination( + to_span(protobuf_content_with_pro.plaintext), + keys.ed_sk0, + dest, + config::Namespace::Default); + REQUIRE(encrypt_result.encrypted); + } + + // Decrypt envelope + DecryptEnvelopeKey decrypt_keys = {}; + decrypt_keys.use_group_keys = false; + decrypt_keys.recipient_ed25519_privkey = keys.ed_sk1; DecryptedEnvelope decrypt_result = session::decrypt_envelope( - keys.ed_sk1, - encrypt_result.ciphertext, - std::chrono::sys_seconds( - std::chrono::duration_cast(timestamp_ms)), - pro_backend_ed_pk); + decrypt_keys, encrypt_result.ciphertext, timestamp_s, pro_backend_ed_pk); // Verify pro - REQUIRE(decrypt_result.pro_status == ProStatus::Valid); // Pro was attached - REQUIRE(decrypt_result.pro_proof.hash() == pro_proof_hash); - REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); // No features requested + REQUIRE(decrypt_result.pro_status == ProStatus::Valid); // Pro was attached + REQUIRE(decrypt_result.pro_proof.hash() == protobuf_content_with_pro.pro_proof_hash); + REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); // No features requested - // Verify it is decryptable + // Verify the content can be parsed w/ protobufs SessionProtos::Content decrypt_content = {}; REQUIRE(decrypt_content.ParseFromArray( decrypt_result.content_plaintext.data(), decrypt_result.content_plaintext.size())); REQUIRE(decrypt_content.has_datamessage()); const SessionProtos::DataMessage& data = decrypt_content.datamessage(); REQUIRE(data.body() == data_body); + + // Try decrypt with a timestamp past the pro proof expiry date + DecryptedEnvelope decrypt_result_again = session::decrypt_envelope( + decrypt_keys, + encrypt_result.ciphertext, + protobuf_content_with_pro.proof.expiry_unix_ts + std::chrono::seconds(1), + pro_backend_ed_pk); + REQUIRE(decrypt_result_again.pro_status == ProStatus::Expired); + + // Try decrypt with bad key (ed_sk0 which was the sender; ed_sk1 the recipient) + DecryptEnvelopeKey bad_decrypt_keys = {}; + bad_decrypt_keys.use_group_keys = false; + bad_decrypt_keys.recipient_ed25519_privkey = keys.ed_sk0; + CHECK_THROWS( + session::decrypt_envelope( + bad_decrypt_keys, + encrypt_result.ciphertext, + protobuf_content_with_pro.proof.expiry_unix_ts, + pro_backend_ed_pk)); + + // Try decrypt with a bad backend key + array_uc32 bad_pro_backend_ed_pk = pro_backend_ed_pk; + bad_pro_backend_ed_pk[0] ^= 1; + decrypt_result_again = session::decrypt_envelope( + decrypt_keys, + encrypt_result.ciphertext, + protobuf_content_with_pro.proof.expiry_unix_ts, + bad_pro_backend_ed_pk); + REQUIRE(decrypt_result_again.pro_status == ProStatus::InvalidProBackendSig); + } + + SECTION("Encrypt/decrypt for sync messages with Pro and bad rotating signature") { + EncryptedForDestination encrypt_result = {}; + { + session::Destination dest = base_dest; + dest.type = DestinationType::SyncMessage; + (*dest.pro_sig)[0] ^= 1; // Break the sig by flipping a bit + encrypt_result = session::encrypt_for_destination( + to_span(protobuf_content_with_pro.plaintext), + keys.ed_sk0, + dest, + config::Namespace::Default); + REQUIRE(encrypt_result.encrypted); + } + + DecryptEnvelopeKey decrypt_keys = {}; + decrypt_keys.use_group_keys = false; + decrypt_keys.recipient_ed25519_privkey = keys.ed_sk1; + DecryptedEnvelope decrypt_result = session::decrypt_envelope( + decrypt_keys, encrypt_result.ciphertext, timestamp_s, pro_backend_ed_pk); + REQUIRE(decrypt_result.pro_status == ProStatus::InvalidUserSig); } } From 0bacb89b844f15fd30c45202a98aa0b6c7f7e95c Mon Sep 17 00:00:00 2001 From: doylet Date: Thu, 14 Aug 2025 16:19:25 +1000 Subject: [PATCH 25/59] Do not enforce library types in C interface Design of the interface should be accomodating not opionated. This also fixes a bug where the pro backend key wasn't been initialised yet in the C interface --- include/session/session_protocol.h | 10 +++++++--- src/session_protocol.cpp | 30 +++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index fba14177..08873c22 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -173,8 +173,10 @@ PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_FEAT /// an exception then this is caught internally and success is set to false. LIBSESSION_EXPORT session_protocol_encrypted_for_destination session_protocol_encrypt_for_destination( - const span_u8 plaintext, + const void *plaintext, + size_t plaintext_len, const span_u8 ed25519_privkey, + size_t ed25519_privkey_len, const session_protocol_destination* dest, NAMESPACE space); @@ -217,9 +219,11 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_for_destinat LIBSESSION_EXPORT session_protocol_decrypted_envelope session_protocol_decrypt_envelope( const session_protocol_decrypt_envelope_keys* keys, - const span_u8 envelope_payload, + const void* envelope_plaintext, + size_t envelope_plaintext_len, uint64_t unix_ts, - const span_u8 pro_backend_pubkey); + const void* pro_backend_pubkey, + size_t pro_backend_pubkey_len); #ifdef __cplusplus } diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index 06967c6b..425adb4f 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -524,15 +524,18 @@ PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_FEAT LIBSESSION_EXPORT session_protocol_encrypted_for_destination session_protocol_encrypt_for_destination( - const span_u8 plaintext, - const span_u8 ed25519_privkey, + const void *plaintext, + size_t plaintext_len, + const void *ed25519_privkey, + size_t ed25519_privkey_len, const session_protocol_destination* dest, NAMESPACE space) { session_protocol_encrypted_for_destination result = {}; try { EncryptedForDestinationInternal result_internal = encrypt_for_destination_internal( - /*plaintext=*/{plaintext.data, plaintext.size}, - /*ed25519_privkey=*/{ed25519_privkey.data, ed25519_privkey.size}, + /*plaintext=*/{static_cast(plaintext), plaintext_len}, + /*ed25519_privkey=*/ + {static_cast(ed25519_privkey), ed25519_privkey_len}, /*dest_type=*/static_cast(dest->type), /*dest_pro_sig=*/dest->has_pro_sig ? dest->pro_sig : std::span(), /*dest_recipient_pubkey=*/dest->recipient_pubkey, @@ -558,12 +561,21 @@ session_protocol_encrypt_for_destination( LIBSESSION_EXPORT session_protocol_decrypted_envelope session_protocol_decrypt_envelope( const session_protocol_decrypt_envelope_keys* keys, - const span_u8 envelope_plaintext, + const void* envelope_plaintext, + size_t envelope_plaintext_len, uint64_t unix_ts, - const span_u8 pro_backend_pubkey) { + const void* pro_backend_pubkey, + size_t pro_backend_pubkey_len) { session_protocol_decrypted_envelope result = {}; - try { + // Setup the pro backend pubkey + array_uc32 pro_backend_pubkey_cpp = {}; + if (pro_backend_pubkey_len != sizeof(pro_backend_pubkey_cpp)) + return result; + std::memcpy(pro_backend_pubkey_cpp.data(), pro_backend_pubkey, pro_backend_pubkey_len); + + try { + // Setup decryption keys and decrypt DecryptEnvelopeKey keys_cpp = { .use_group_keys = keys->use_group_keys, .group_keys = @@ -572,9 +584,9 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( DecryptedEnvelope result_cpp = decrypt_envelope( keys_cpp, - envelope_plaintext.cpp_span(), + {static_cast(envelope_plaintext), envelope_plaintext_len}, std::chrono::sys_seconds(std::chrono::seconds(unix_ts)), - {}); + pro_backend_pubkey_cpp); // Marshall into c type result = { From 39b8edcddb1c1c97b47fad118eff265a2a4ab2ae Mon Sep 17 00:00:00 2001 From: doylet Date: Thu, 14 Aug 2025 16:24:42 +1000 Subject: [PATCH 26/59] Pro version field should use a key that sorts to the top Due to BT encoding using sort order to order keys. Version at top means we can conditionally handle version changes easily. --- include/session/config/pro.hpp | 2 +- src/config/pro.cpp | 2 +- src/config/user_profile.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/session/config/pro.hpp b/include/session/config/pro.hpp index 678b1e09..a2b35f31 100644 --- a/include/session/config/pro.hpp +++ b/include/session/config/pro.hpp @@ -13,7 +13,7 @@ enum ProProofVersion { ProProofVersion_v0 }; /// keys used currently or in the past (so that we don't reuse): /// -/// v - version +/// @ - version /// g - gen_index_hash /// r - rotating ed25519 pubkey /// e - expiry unix timestamp (in seconds) diff --git a/src/config/pro.cpp b/src/config/pro.cpp index a997fdd5..ec2ef9f1 100644 --- a/src/config/pro.cpp +++ b/src/config/pro.cpp @@ -89,7 +89,7 @@ array_uc32 ProProof::hash() const { } bool ProProof::load(const dict& root) { - std::optional version = maybe_int(root, "v"); + std::optional version = maybe_int(root, "@"); std::optional> maybe_gen_index_hash = maybe_vector(root, "g"); std::optional> maybe_rotating_pubkey = maybe_vector(root, "r"); std::optional maybe_expiry_unix_ts = maybe_ts(root, "e"); diff --git a/src/config/user_profile.cpp b/src/config/user_profile.cpp index 85d87054..33018291 100644 --- a/src/config/user_profile.cpp +++ b/src/config/user_profile.cpp @@ -137,7 +137,7 @@ void UserProfile::set_pro_config(ProConfig const &pro) { const ProProof& pro_proof = pro.proof; auto proof_dict = root["p"]; - proof_dict["v"] = pro_proof.version; + proof_dict["@"] = pro_proof.version; proof_dict["g"] = pro_proof.gen_index_hash; proof_dict["r"] = pro_proof.rotating_pubkey; proof_dict["e"] = pro_proof.expiry_unix_ts.time_since_epoch().count(); From 4e2b3d023d2926cf6127038f4f4f0cd91044d59a Mon Sep 17 00:00:00 2001 From: doylet Date: Thu, 14 Aug 2025 16:47:07 +1000 Subject: [PATCH 27/59] Fix C session protocol using std::span and missing comments --- include/session/session_protocol.h | 31 +++++++++++++--------------- include/session/session_protocol.hpp | 10 ++++----- src/session_protocol.cpp | 4 +++- 3 files changed, 21 insertions(+), 24 deletions(-) diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index 08873c22..93ff0e96 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -21,6 +21,9 @@ enum { PRO_STANDARD_CHARACTER_LIMIT = 2'000, }; +// Bit flags for features that are not currently able to be determined by the state stored in +// Libsession. They are to be passed in by the client into `get_pro_msg_for_features` to return the +// bitset of `PRO_FEATURES` that a message will use. typedef uint64_t PRO_EXTRA_FEATURES; enum PRO_EXTRA_FEATURES_ { PRO_EXTRA_FEATURES_NIL = 0, @@ -28,6 +31,8 @@ enum PRO_EXTRA_FEATURES_ { PRO_EXTRA_FEATURES_ANIMATED_AVATAR = 1 << 1, }; +// Bitset of Session Pro features that a message uses. This bitset is stored in the protobuf +// `Content.proMessage` when a message is sent for other clients to consume. typedef uint64_t PRO_FEATURES; enum PRO_FEATURES_ { PRO_FEATURES_NIL = 0, @@ -38,7 +43,7 @@ enum PRO_FEATURES_ { PRO_FEATURES_10K_CHARACTER_LIMIT | PRO_FEATURES_PRO_BADGE | PRO_FEATURES_ANIMATED_AVATAR }; -enum PRO_STATUS { +enum PRO_STATUS { // See session::ProStatus PRO_STATUS_NIL, PRO_STATUS_INVALID_PRO_BACKEND_SIG, PRO_STATUS_INVALID_USER_SIG, @@ -46,7 +51,7 @@ enum PRO_STATUS { PRO_STATUS_EXPIRED, }; -enum DESTINATION_TYPE { +enum DESTINATION_TYPE { // See session::DestinationType DESTINATION_TYPE_CONTACT, DESTINATION_TYPE_SYNC_MESSAGE, DESTINATION_TYPE_CLOSED_GROUP, @@ -54,7 +59,7 @@ enum DESTINATION_TYPE { DESTINATION_TYPE_OPEN_GROUP_INBOX, }; -struct session_protocol_destination { +struct session_protocol_destination { // See session::Destination DESTINATION_TYPE type; // The pro signature is optional, set this flag to true to make the encryption function take @@ -73,6 +78,8 @@ enum ENVELOPE_TYPE { ENVELOPE_TYPE_CLOSED_GROUP_MESSGE, }; +// Indicates which optional fields in the envelope has been populated out of the optional fields in +// an envelope after it has been parsed off the wire. typedef uint32_t ENVELOPE_FLAGS; enum ENVELOPE_FLAGS_ { ENVELOPE_FLAGS_SOURCE = 1 << 0, @@ -92,20 +99,10 @@ struct session_protocol_envelope { }; struct session_protocol_decrypt_envelope_keys { - // Indicate to the envelope decrypting function that it should use the group keys to decrypt the - // envelope (e.g.: for groups v2 envelopes where the envelope is encrypted and the body - // unencrypted). The `group_keys` must be set if this flag is true. The recipient ed25519 - // private key field is ignored if this flag is set. bool use_group_keys; - - // Keys to use to decrypt the envelope. const config_group_keys* group_keys; - - // The libsodium-style secret key of the sender, 64 bytes. Can also be passed as a 32-byte seed. - // Used to decrypt the encrypted content. This field is used if `use_group_keys` is false in - // which case the group keys are ignored. This is for envelopes where the envelope itself is - // unencrypted and the contents is encrypted for this secret key. - std::span recipient_ed25519_privkey; + const void* recipient_ed25519_privkey; + size_t recipient_ed25519_privkey_len; }; struct session_protocol_decrypted_envelope { @@ -173,9 +170,9 @@ PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_FEAT /// an exception then this is caught internally and success is set to false. LIBSESSION_EXPORT session_protocol_encrypted_for_destination session_protocol_encrypt_for_destination( - const void *plaintext, + const void* plaintext, size_t plaintext_len, - const span_u8 ed25519_privkey, + const void* ed25519_privkey, size_t ed25519_privkey_len, const session_protocol_destination* dest, NAMESPACE space); diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index 6b710b18..58b9f7f7 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -48,12 +48,10 @@ enum class ProStatus { enum class DestinationType { Contact, SyncMessage, - /// Both legacy and non-legacy closed groups are to be identified as `ClosedGroup`. A non-legacy /// group is detected by the (0x03) prefix byte on the given `dest_closed_group_pubkey` /// specified in Destination. ClosedGroup, - OpenGroup, OpenGroupInbox, }; @@ -95,14 +93,14 @@ struct Envelope { EnvelopeType type; std::chrono::milliseconds timestamp; - /// Optional fields. These fields are set if the appropriate flag has been set in `flags` - /// otherwise the corresponding values are to be ignored and those fields will be - /// zero-initialised. + // Optional fields. These fields are set if the appropriate flag has been set in `flags` + // otherwise the corresponding values are to be ignored and those fields will be + // zero-initialised. array_uc33 source; uint32_t source_device; uint64_t server_timestamp; - /// Signature by the sending client's rotating key + // Signature by the sending client's rotating key array_uc64 pro_sig; }; diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index 425adb4f..22f4c188 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -580,7 +580,9 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( .use_group_keys = keys->use_group_keys, .group_keys = reinterpret_cast(keys->group_keys->internals), - .recipient_ed25519_privkey = keys->recipient_ed25519_privkey}; + .recipient_ed25519_privkey = { + static_cast(keys->recipient_ed25519_privkey), + keys->recipient_ed25519_privkey_len}}; DecryptedEnvelope result_cpp = decrypt_envelope( keys_cpp, From 899f2e07e646c3a02f93aa354ad4fb6afb801bfb Mon Sep 17 00:00:00 2001 From: doylet Date: Thu, 14 Aug 2025 17:16:20 +1000 Subject: [PATCH 28/59] Fixup some comments, add missing x25519 pubkey from C decrypted envelope --- include/session/session_protocol.h | 12 ++++++----- include/session/session_protocol.hpp | 17 ++++++++------- include/session/types.h | 8 ------- src/session_protocol.cpp | 31 +++++++++++----------------- 4 files changed, 29 insertions(+), 39 deletions(-) diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index 93ff0e96..9f07e2c6 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -112,6 +112,7 @@ struct session_protocol_decrypted_envelope { session_protocol_envelope envelope; span_u8 content_plaintext; uint8_t sender_ed25519_pubkey[32]; + uint8_t sender_x25519_pubkey[32]; PRO_STATUS pro_status; pro_proof pro_proof; PRO_FEATURES pro_features; @@ -130,8 +131,8 @@ struct session_protocol_encrypted_for_destination { /// Determine the Pro features that are used in a given conversation message. /// /// Inputs: -/// - `msg` -- the conversation message to determine if the message is requires access to the 10k -/// character limit available in Session Pro +/// - `msg_size` -- the size of the message in bytes to determine if the message requires access to +/// the higher character limit available in Session Pro /// - `flags` -- extra pro features that are known by clients that they wish to be activated on /// this message /// @@ -139,7 +140,7 @@ struct session_protocol_encrypted_for_destination { /// - Session Pro feature flags suitable for writing directly into the protobuf `ProMessage` in /// `Content` LIBSESSION_EXPORT -PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_FEATURES flags); +PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_EXTRA_FEATURES flags); /// API: session_protocol/session_protocol_encrypt_for_destination /// @@ -161,7 +162,8 @@ PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_FEAT /// Outputs: /// - The encryption result for the plaintext. If the destination and namespace combination did not /// require encryption, no payload is returned in the ciphertext and the user should proceed with -/// the plaintext. This should be validated by checking the `encrypted` flag on the result. +/// the plaintext. This should be validated by checking the `encrypted` flag on the result to +/// determine if the ciphertext or plaintext is to be used. /// /// The retured payload is suitable for sending on the wire (i.e: it has been protobuf /// encoded/wrapped if necessary). @@ -205,7 +207,7 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_for_destinat /// proof in the message. /// - `pro_backend_pubkey` -- the Session Pro backend public key to verify the signature embedded in /// the proof, validating whether or not the attached proof was indeed issued by an authorised -/// issuer +/// issuer. Ignored if there's no proof in the message. /// /// Outputs: /// - The decrypted envelope. It contains the fields of the envelope and the Session Pro metadata diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index 58b9f7f7..192166e2 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -6,8 +6,8 @@ #include #include -/// A complimentary file to session encrypt which has the low level encryption function for Session -/// protocol types. This file contains high-level helper functions for decoding payloads on the +/// A complimentary file to session encrypt (which has the low level encryption function for Session +/// protocol types). This file contains high-level helper functions for decoding payloads on the /// Session protocol. Prefer functions here before resorting to the lower-level cryptography. // NOTE: In the CPP file we use C-style enums for bitfields and CPP-style enums for non-bitfield @@ -116,6 +116,8 @@ struct DecryptedEnvelope { // was available. array_uc32 sender_ed25519_pubkey; + // The x25519 pubkey, always populated on successful parse. Either it's present from decrypting + // a Groups v2 envelope or it's re-derived from the Ed25519 pubkey. array_uc32 sender_x25519_pubkey; // Status flag for validity of the Session Pro proof embedded in the envelope if it has one. @@ -167,15 +169,15 @@ struct EncryptedForDestination /// Determine the Pro features that are used in a given conversation message. /// /// Inputs: -/// - `msg` -- the conversation message to determine if the message is requires access to the 10k -/// character limit available in Session Pro +/// - `msg_size` -- the size of the message in bytes to determine if the message requires access to +/// the higher character limit available in Session Pro /// - `flags` -- extra pro features that are known by clients that they wish to be activated on /// this message /// /// Outputs: /// - Session Pro feature flags suitable for writing directly into the protobuf `ProMessage` in /// `Content` -PRO_FEATURES get_pro_features_for_msg(size_t msg_size, PRO_FEATURES flags); +PRO_FEATURES get_pro_features_for_msg(size_t msg_size, PRO_EXTRA_FEATURES flags); /// API: session_protocol/encrypt_for_destination /// @@ -195,7 +197,7 @@ PRO_FEATURES get_pro_features_for_msg(size_t msg_size, PRO_FEATURES flags); /// This function throws if the API is misused (i.e.: A field was not set, but was required to be /// set for the given destination and namespace. For example the closed group keys not being set /// when sending to a group prefixed [0x3] key in a closed group into the group message namespace) -/// but otherwise always returns a struct with values. +/// but otherwise returns a struct with values. /// /// Inputs: /// - `plaintext` -- the protobuf serialised payload containing the protobuf encoded stream, @@ -209,7 +211,8 @@ PRO_FEATURES get_pro_features_for_msg(size_t msg_size, PRO_FEATURES flags); /// Outputs: /// - The encryption result for the plaintext. If the destination and namespace combination did not /// require encryption, no payload is returned in the ciphertext and the user should proceed with -/// the plaintext. This should be validated by checking the `encrypted` flag on the result. +/// the plaintext. This should be validated by checking the `encrypted` flag on the result to +/// determine if the ciphertext or plaintext is to be used. /// /// The retured payload is suitable for sending on the wire (i.e: it has been protobuf /// encoded/wrapped if necessary). diff --git a/include/session/types.h b/include/session/types.h index adca1f36..107a084c 100644 --- a/include/session/types.h +++ b/include/session/types.h @@ -3,10 +3,6 @@ #include #include -#if defined(__cplusplus) -#include -#endif - #ifdef __cplusplus extern "C" { #endif @@ -15,10 +11,6 @@ extern "C" { struct span_u8 { uint8_t* data; size_t size; - -#if defined(__cplusplus) - std::span cpp_span() const { return {data, size}; } -#endif }; struct bytes32 { diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index 22f4c188..5cb0c3c2 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -303,15 +303,6 @@ EncryptedForDestination encrypt_for_destination( return result; } -struct DecryptedEnvelopeInternal { - Envelope envelope; - std::vector content_plaintext; - std::vector sender_ed25519_pubkey; - ProStatus pro_status; - config::ProProof pro_proof; - PRO_FEATURES pro_features; -}; - DecryptedEnvelope decrypt_envelope( const DecryptEnvelopeKey& keys, std::span envelope_payload, @@ -437,7 +428,7 @@ DecryptedEnvelope decrypt_envelope( // be set but will be ignored. So in all instances a signature must be attached (real or // dummy). if (!envelope.has_prosig()) - throw std::runtime_error("Parse envelope failed, pro message is missing signature"); + throw std::runtime_error("Parse envelope failed, message is missing pro signature"); // Copy (maybe dummy) pro signature into our result struct const std::string& pro_sig = envelope.prosig(); @@ -496,11 +487,9 @@ DecryptedEnvelope decrypt_envelope( std::memcpy(proof.sig.data(), proto_proof.sig().data(), proto_proof.sig().size()); if (result.pro_status == ProStatus::Valid) { - // Verify the at the proof is verified by the Session Pro Backend key (e.g.: It has been - // authorised by the backend as having a valid backing payment). - if (proof.verify(pro_backend_pubkey)) - result.pro_status = ProStatus::Valid; - else + // Verify the at the proof is verified by the Session Pro Backend key (e.g.: It was + // issued by an authoritative backend) + if (!proof.verify(pro_backend_pubkey)) result.pro_status = ProStatus::InvalidProBackendSig; // Check if the proof has expired @@ -517,7 +506,7 @@ DecryptedEnvelope decrypt_envelope( using namespace session; LIBSESSION_EXPORT -PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_FEATURES flags) { +PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_EXTRA_FEATURES flags) { PRO_FEATURES result = get_pro_features_for_msg(msg_size, flags); return result; } @@ -604,8 +593,10 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( .server_timestamp = result_cpp.envelope.server_timestamp, .pro_sig = {}, }, - .content_plaintext = {}, + .content_plaintext = span_u8_copy_or_throw( + result_cpp.content_plaintext.data(), result_cpp.content_plaintext.size()), .sender_ed25519_pubkey = {}, + .sender_x25519_pubkey = {}, .pro_status = static_cast(result_cpp.pro_status), .pro_proof = { @@ -628,12 +619,14 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( result_cpp.envelope.pro_sig.data(), sizeof(result.envelope.pro_sig)); - result.content_plaintext = span_u8_copy_or_throw( - result_cpp.content_plaintext.data(), result_cpp.content_plaintext.size()); std::memcpy( result.sender_ed25519_pubkey, result_cpp.sender_ed25519_pubkey.data(), sizeof(result.sender_ed25519_pubkey)); + std::memcpy( + result.sender_x25519_pubkey, + result_cpp.sender_x25519_pubkey.data(), + sizeof(result.sender_x25519_pubkey)); std::memcpy( result.pro_proof.gen_index_hash, From 817a102e3c7162498ade227f1874f6c1644c61e8 Mon Sep 17 00:00:00 2001 From: doylet Date: Thu, 14 Aug 2025 17:37:30 +1000 Subject: [PATCH 29/59] Linting --- include/session/config/namespaces.h | 1 - include/session/config/namespaces.hpp | 1 + include/session/config/pro.h | 10 +++---- include/session/config/user_profile.h | 6 ++-- include/session/config/user_profile.hpp | 2 +- include/session/pro_backend.hpp | 2 +- include/session/session_protocol.hpp | 6 ++-- include/session/types.h | 4 +-- include/session/types.hpp | 2 +- src/config/user_profile.cpp | 7 ++--- src/pro_backend.cpp | 37 ++++++++++++++++++++----- src/session_protocol.cpp | 24 ++++++++-------- src/types.cpp | 11 +++----- tests/test_config_pro.cpp | 2 +- tests/test_config_userprofile.cpp | 24 ++++++++-------- tests/test_session_protocol.cpp | 25 +++++++++-------- tests/utils.hpp | 4 +-- 17 files changed, 94 insertions(+), 74 deletions(-) diff --git a/include/session/config/namespaces.h b/include/session/config/namespaces.h index a2a7aee7..ea875195 100644 --- a/include/session/config/namespaces.h +++ b/include/session/config/namespaces.h @@ -29,7 +29,6 @@ typedef enum NAMESPACE { NAMESPACE_LOCAL = 9999, } NAMESPACE; - #ifdef __cplusplus } // extern "C" #endif diff --git a/include/session/config/namespaces.hpp b/include/session/config/namespaces.hpp index 8ac4abd6..680f780a 100644 --- a/include/session/config/namespaces.hpp +++ b/include/session/config/namespaces.hpp @@ -1,6 +1,7 @@ #pragma once #include + #include "namespaces.h" namespace session::config { diff --git a/include/session/config/pro.h b/include/session/config/pro.h index cd5c8bc7..581797c3 100644 --- a/include/session/config/pro.h +++ b/include/session/config/pro.h @@ -4,8 +4,8 @@ extern "C" { #endif -#include #include +#include #include #include "../export.h" @@ -23,13 +23,13 @@ struct pro_pro_config { pro_proof proof; }; -LIBSESSION_EXPORT pro_proof pro_proof_init(char const *dump, size_t dump_len); +LIBSESSION_EXPORT pro_proof pro_proof_init(char const* dump, size_t dump_len); -LIBSESSION_EXPORT pro_pro_config pro_pro_init(char const *dump, size_t dump_len); +LIBSESSION_EXPORT pro_pro_config pro_pro_init(char const* dump, size_t dump_len); -LIBSESSION_EXPORT bool pro_proof_verify(pro_proof const *proof, uint8_t const *verify_pubkey); +LIBSESSION_EXPORT bool pro_proof_verify(pro_proof const* proof, uint8_t const* verify_pubkey); -LIBSESSION_EXPORT bool pro_pro_verify(pro_pro_config const *pro, uint8_t const *verify_pubkey); +LIBSESSION_EXPORT bool pro_pro_verify(pro_pro_config const* pro, uint8_t const* verify_pubkey); #ifdef __cplusplus } // extern "C" diff --git a/include/session/config/user_profile.h b/include/session/config/user_profile.h index 61df3434..ee7c842e 100644 --- a/include/session/config/user_profile.h +++ b/include/session/config/user_profile.h @@ -5,8 +5,8 @@ extern "C" { #endif #include "base.h" -#include "profile_pic.h" #include "pro.h" +#include "profile_pic.h" /// API: user_profile/user_profile_init /// @@ -300,7 +300,7 @@ LIBSESSION_EXPORT int64_t user_profile_get_profile_updated(config_object* conf); /// Outputs: /// - `bool` -- True if the user profile had Pro data associated with it. Otherwise false and the /// pro structure will remain untouched. -LIBSESSION_EXPORT bool user_profile_get_pro_config(const config_object* conf, pro_pro_config *pro); +LIBSESSION_EXPORT bool user_profile_get_pro_config(const config_object* conf, pro_pro_config* pro); /// API: user_profile/user_profile_set_pro_config /// @@ -320,7 +320,7 @@ LIBSESSION_EXPORT bool user_profile_get_pro_config(const config_object* conf, pr /// /// Outputs: /// - `void` -- Returns nothing -LIBSESSION_EXPORT void user_profile_set_pro_config(config_object* conf, const pro_pro_config *pro); +LIBSESSION_EXPORT void user_profile_set_pro_config(config_object* conf, const pro_pro_config* pro); #ifdef __cplusplus } // extern "C" diff --git a/include/session/config/user_profile.hpp b/include/session/config/user_profile.hpp index 8314ea91..a96c2b49 100644 --- a/include/session/config/user_profile.hpp +++ b/include/session/config/user_profile.hpp @@ -7,8 +7,8 @@ #include "base.hpp" #include "namespaces.hpp" -#include "profile_pic.hpp" #include "pro.hpp" +#include "profile_pic.hpp" namespace session::config { diff --git a/include/session/pro_backend.hpp b/include/session/pro_backend.hpp index 0504f664..442f15ab 100644 --- a/include/session/pro_backend.hpp +++ b/include/session/pro_backend.hpp @@ -49,4 +49,4 @@ master_rotating_sigs build_add_payment_sigs( const array_uc32& payment_token_hash, std::chrono::seconds unix_ts); -} // namespace session::pro +} // namespace session::pro_backend diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index 192166e2..2a789184 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -134,8 +134,7 @@ struct DecryptedEnvelope { PRO_FEATURES pro_features; }; -struct DecryptEnvelopeKey -{ +struct DecryptEnvelopeKey { // Indicate to the envelope decrypting function that it should use the group keys to decrypt the // envelope (e.g.: for groups v2 envelopes where the envelope is encrypted and the body // unencrypted). The `group_keys` must be set if this flag is true. The recipient ed25519 @@ -152,8 +151,7 @@ struct DecryptEnvelopeKey std::span recipient_ed25519_privkey; }; -struct EncryptedForDestination -{ +struct EncryptedForDestination { // Indicates if the ciphertext was encrypted or not. This can be false if the message sent to // the destination and namespace does not require encryption. In this case `ciphertext` is not // set and the user should proceed with the original plaintext. diff --git a/include/session/types.h b/include/session/types.h index 107a084c..fa6b8872 100644 --- a/include/session/types.h +++ b/include/session/types.h @@ -1,7 +1,7 @@ #pragma once -#include #include +#include #ifdef __cplusplus extern "C" { @@ -29,7 +29,7 @@ span_u8 span_u8_alloc_or_throw(size_t size); /// Create a span of bytes that copies the payload at `data` for `size` bytes. If allocation fails /// this function throws a runtime exception. The `data` pointer is span must be freed once the span /// is no longer needed. -span_u8 span_u8_copy_or_throw(const void *data, size_t size); +span_u8 span_u8_copy_or_throw(const void* data, size_t size); #ifdef __cplusplus } diff --git a/include/session/types.hpp b/include/session/types.hpp index 4cd9022f..1bc2ca00 100644 --- a/include/session/types.hpp +++ b/include/session/types.hpp @@ -1,7 +1,7 @@ #pragma once -#include #include +#include namespace session { using array_uc32 = std::array; diff --git a/src/config/user_profile.cpp b/src/config/user_profile.cpp index 33018291..92bbf419 100644 --- a/src/config/user_profile.cpp +++ b/src/config/user_profile.cpp @@ -131,7 +131,7 @@ std::optional UserProfile::get_pro_config() const { return result; } -void UserProfile::set_pro_config(ProConfig const &pro) { +void UserProfile::set_pro_config(ProConfig const& pro) { auto root = data["s"]; root["r"] = pro.rotating_privkey; @@ -250,7 +250,7 @@ LIBSESSION_C_API int64_t user_profile_get_profile_updated(config_object* conf) { return unbox(conf)->get_profile_updated().time_since_epoch().count(); } -LIBSESSION_C_API bool user_profile_get_pro_data(const config_object* conf, pro_pro_config *pro) { +LIBSESSION_C_API bool user_profile_get_pro_data(const config_object* conf, pro_pro_config* pro) { if (auto val = unbox(conf)->get_pro_config(); val) { static_assert(sizeof pro->proof.gen_index_hash == sizeof(val->proof.gen_index_hash)); static_assert(sizeof pro->proof.rotating_pubkey == sizeof(val->proof.rotating_pubkey)); @@ -271,7 +271,7 @@ LIBSESSION_C_API bool user_profile_get_pro_data(const config_object* conf, pro_p return false; } -LIBSESSION_C_API void user_profile_set_pro_data(config_object* conf, const pro_pro_config *pro) { +LIBSESSION_C_API void user_profile_set_pro_data(config_object* conf, const pro_pro_config* pro) { ProConfig val = {}; val.proof.version = pro->proof.version; std::memcpy( @@ -288,5 +288,4 @@ LIBSESSION_C_API void user_profile_set_pro_data(config_object* conf, const pro_p unbox(conf)->set_pro_config(val); } - } // extern "C" diff --git a/src/pro_backend.cpp b/src/pro_backend.cpp index 97e1cd06..a40299a5 100644 --- a/src/pro_backend.cpp +++ b/src/pro_backend.cpp @@ -11,7 +11,9 @@ namespace session::pro_backend { static_assert(PUBKEY.size() == crypto_sign_ed25519_PUBLICKEYBYTES); master_rotating_sigs build_get_proof_sigs( - const array_uc64& master_privkey, const array_uc64& rotating_privkey, std::chrono::seconds unix_ts) { + const array_uc64& master_privkey, + const array_uc64& rotating_privkey, + std::chrono::seconds unix_ts) { // Derive the public keys array_uc32 master_pubkey; array_uc32 rotating_pubkey; @@ -27,13 +29,24 @@ master_rotating_sigs build_get_proof_sigs( crypto_generichash_blake2b_update(&state, &version, sizeof(version)); crypto_generichash_blake2b_update(&state, master_pubkey.data(), master_pubkey.size()); crypto_generichash_blake2b_update(&state, rotating_pubkey.data(), rotating_pubkey.size()); - crypto_generichash_blake2b_update(&state, reinterpret_cast(&unix_ts_s), sizeof(unix_ts_s)); + crypto_generichash_blake2b_update( + &state, reinterpret_cast(&unix_ts_s), sizeof(unix_ts_s)); crypto_generichash_blake2b_final(&state, hash_to_sign.data(), hash_to_sign.size()); // Sign the hash with both keys master_rotating_sigs result = {}; - crypto_sign_ed25519_detached(result.master_sig.data(), nullptr, hash_to_sign.data(), hash_to_sign.size(), master_privkey.data()); - crypto_sign_ed25519_detached(result.rotating_sig.data(), nullptr, hash_to_sign.data(), hash_to_sign.size(), rotating_privkey.data()); + crypto_sign_ed25519_detached( + result.master_sig.data(), + nullptr, + hash_to_sign.data(), + hash_to_sign.size(), + master_privkey.data()); + crypto_sign_ed25519_detached( + result.rotating_sig.data(), + nullptr, + hash_to_sign.data(), + hash_to_sign.size(), + rotating_privkey.data()); return result; } @@ -61,8 +74,18 @@ master_rotating_sigs build_add_payment_sigs( // Sign the hash with both keys master_rotating_sigs result = {}; - crypto_sign_ed25519_detached(result.master_sig.data(), nullptr, hash_to_sign.data(), hash_to_sign.size(), master_privkey.data()); - crypto_sign_ed25519_detached(result.rotating_sig.data(), nullptr, hash_to_sign.data(), hash_to_sign.size(), rotating_privkey.data()); + crypto_sign_ed25519_detached( + result.master_sig.data(), + nullptr, + hash_to_sign.data(), + hash_to_sign.size(), + master_privkey.data()); + crypto_sign_ed25519_detached( + result.rotating_sig.data(), + nullptr, + hash_to_sign.data(), + hash_to_sign.size(), + rotating_privkey.data()); return result; } @@ -105,4 +128,4 @@ std::string add_payment_request::to_json() const { oxenc::to_hex(rotating_sig)); return result; } -} // namespace session::pro +} // namespace session::pro_backend diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index 5cb0c3c2..f8db66ad 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -189,7 +189,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( if (dest_pro_sig.empty()) { // If there's no pro signature specified, we still fill out the pro signature with a // dummy 64 byte stream. This is to make pro and non-pro messages indistinguishable. - std::string *pro_sig = envelope.mutable_prosig(); + std::string* pro_sig = envelope.mutable_prosig(); pro_sig->resize(sizeof(array_uc64)); randombytes_buf(pro_sig->data(), pro_sig->size()); } else { @@ -209,7 +209,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( WebSocketProtos::WebSocketMessage_Type::WebSocketMessage_Type_REQUEST); // Make request - WebSocketProtos::WebSocketRequestMessage *req_msg = msg.mutable_request(); + WebSocketProtos::WebSocketRequestMessage* req_msg = msg.mutable_request(); req_msg->set_body(envelope.SerializeAsString()); // Write message as ciphertext @@ -332,7 +332,7 @@ DecryptedEnvelope decrypt_envelope( sender_x25519_pubkey.size())}; // Update the plaintext to use the decrypted envelope - envelope_plaintext = envelope_plaintext_from_group_keys; // Update the plaintext + envelope_plaintext = envelope_plaintext_from_group_keys; // Update the plaintext // Copy keys out std::memcpy( @@ -364,10 +364,8 @@ DecryptedEnvelope decrypt_envelope( // the source is a Session public key (see: encrypt_for_destination) const std::string& source = envelope.source(); if (source.size() != result.envelope.source.max_size()) - throw std::runtime_error( - fmt::format( - "Parse envelope failed, source had unexpected size ({} bytes)", - source.size())); + throw std::runtime_error(fmt::format( + "Parse envelope failed, source had unexpected size ({} bytes)", source.size())); std::memcpy(result.envelope.source.data(), source.data(), source.size()); result.envelope.flags |= ENVELOPE_FLAGS_SOURCE; } @@ -411,7 +409,10 @@ DecryptedEnvelope decrypt_envelope( "key."); } else { result.content_plaintext.resize(envelope.content().size()); - std::memcpy(result.content_plaintext.data(), envelope.content().data(), envelope.content().size()); + std::memcpy( + result.content_plaintext.data(), + envelope.content().data(), + envelope.content().size()); } // TODO: We parse the content in libsession to extract pro metadata but we return the unparsed @@ -421,7 +422,8 @@ DecryptedEnvelope decrypt_envelope( // interface. SessionProtos::Content content = {}; if (!content.ParseFromArray(result.content_plaintext.data(), result.content_plaintext.size())) - throw std::runtime_error{fmt::format("Parse content from envelope failed: {}", result.content_plaintext.size())}; + throw std::runtime_error{fmt::format( + "Parse content from envelope failed: {}", result.content_plaintext.size())}; // A signature must always be present on the envelope. This is to make a pro and non-pro // envelope indistinguishable. If the message does not have pro then this signature must still @@ -513,9 +515,9 @@ PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_EXTR LIBSESSION_EXPORT session_protocol_encrypted_for_destination session_protocol_encrypt_for_destination( - const void *plaintext, + const void* plaintext, size_t plaintext_len, - const void *ed25519_privkey, + const void* ed25519_privkey, size_t ed25519_privkey_len, const session_protocol_destination* dest, NAMESPACE space) { diff --git a/src/types.cpp b/src/types.cpp index a2c53461..5285f954 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -1,20 +1,17 @@ -#include - #include +#include -span_u8 span_u8_alloc_or_throw(size_t size) -{ +span_u8 span_u8_alloc_or_throw(size_t size) { span_u8 result = {}; result.size = size; - result.data = static_cast(malloc(size)); + result.data = static_cast(malloc(size)); if (!result.data) throw std::runtime_error( fmt::format("Failed to allocate {} bytes for span, out of memory", size)); return result; } -span_u8 span_u8_copy_or_throw(const void *data, size_t size) -{ +span_u8 span_u8_copy_or_throw(const void* data, size_t size) { span_u8 result = span_u8_alloc_or_throw(size); std::memcpy(result.data, data, result.size); return result; diff --git a/tests/test_config_pro.cpp b/tests/test_config_pro.cpp index 75d02941..58a7c932 100644 --- a/tests/test_config_pro.cpp +++ b/tests/test_config_pro.cpp @@ -80,7 +80,7 @@ TEST_CASE("Pro", "[config][pro]") { { session::config::dict bad_dict = good_dict; std::array broken_sig = pro.proof.sig; - broken_sig[0] = ~broken_sig[0]; // Break the sig + broken_sig[0] = ~broken_sig[0]; // Break the sig // clang-format off const session::config::ProProof& proof = pro.proof; diff --git a/tests/test_config_userprofile.cpp b/tests/test_config_userprofile.cpp index 76235849..17ba0cd6 100644 --- a/tests/test_config_userprofile.cpp +++ b/tests/test_config_userprofile.cpp @@ -63,24 +63,24 @@ TEST_CASE("UserProfile", "[config][user_profile]") { session::config::UserProfile profile{std::span{seed}, std::nullopt}; - CHECK_THROWS(profile.set_name( - "123456789012345678901234567890123456789012345678901234567890123456789" - "0123456789012345678901234567890A")); - CHECK_NOTHROW(profile.set_name_truncated( - "12345678901234567890123456789012345678901234567890123456789" - "01234567890123456789012345678901234567890A")); + CHECK_THROWS( + profile.set_name("123456789012345678901234567890123456789012345678901234567890123456789" + "0123456789012345678901234567890A")); + CHECK_NOTHROW( + profile.set_name_truncated("12345678901234567890123456789012345678901234567890123456789" + "01234567890123456789012345678901234567890A")); CHECK(profile.get_name() == "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" "901234567890"); - CHECK_NOTHROW(profile.set_name_truncated( - "12345678901234567890123456789012345678901234567890123456789" - "01234567890123456789012345678901234567🎂")); + CHECK_NOTHROW( + profile.set_name_truncated("12345678901234567890123456789012345678901234567890123456789" + "01234567890123456789012345678901234567🎂")); CHECK(profile.get_name() == "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" "901234567"); - CHECK_NOTHROW(profile.set_name_truncated( - "12345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345🎂🎂")); + CHECK_NOTHROW( + profile.set_name_truncated("12345678901234567890123456789012345678901234567890123456789" + "012345678901234567890123456789012345🎂🎂")); CHECK(profile.get_name() == "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" "9012345🎂"); diff --git a/tests/test_session_protocol.cpp b/tests/test_session_protocol.cpp index cd13c8c7..2a1334a2 100644 --- a/tests/test_session_protocol.cpp +++ b/tests/test_session_protocol.cpp @@ -2,17 +2,17 @@ #include #include +#include +#include +#include #include #include #include #include -#include -#include -#include #include -#include "WebSocketResources.pb.h" #include "SessionProtos.pb.h" +#include "WebSocketResources.pb.h" #include "utils.hpp" using namespace session; @@ -349,7 +349,8 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { REQUIRE(data.body() == large_message); } - SECTION("Encrypt/decrypt for legacy groups (w/ encrypted envelope, plaintext content) with Pro") { + SECTION("Encrypt/decrypt for legacy groups (w/ encrypted envelope, plaintext content) with " + "Pro") { // Encrypt EncryptedForDestination encrypt_result = {}; { @@ -367,7 +368,8 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { // Legacy groups wrap in websocket message WebSocketProtos::WebSocketMessage ws_msg; - REQUIRE(ws_msg.ParseFromArray(encrypt_result.ciphertext.data(), encrypt_result.ciphertext.size())); + REQUIRE(ws_msg.ParseFromArray( + encrypt_result.ciphertext.data(), encrypt_result.ciphertext.size())); REQUIRE(ws_msg.has_request()); REQUIRE(ws_msg.request().has_body()); @@ -487,12 +489,11 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { DecryptEnvelopeKey bad_decrypt_keys = {}; bad_decrypt_keys.use_group_keys = false; bad_decrypt_keys.recipient_ed25519_privkey = keys.ed_sk0; - CHECK_THROWS( - session::decrypt_envelope( - bad_decrypt_keys, - encrypt_result.ciphertext, - protobuf_content_with_pro.proof.expiry_unix_ts, - pro_backend_ed_pk)); + CHECK_THROWS(session::decrypt_envelope( + bad_decrypt_keys, + encrypt_result.ciphertext, + protobuf_content_with_pro.proof.expiry_unix_ts, + pro_backend_ed_pk)); // Try decrypt with a bad backend key array_uc32 bad_pro_backend_ed_pk = pro_backend_ed_pk; diff --git a/tests/utils.hpp b/tests/utils.hpp index 4b4474ce..d02eb009 100644 --- a/tests/utils.hpp +++ b/tests/utils.hpp @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -12,9 +13,8 @@ #include #include -#include "session/util.hpp" #include "session/types.hpp" -#include +#include "session/util.hpp" using namespace std::literals; using namespace oxenc::literals; From 4bc54801da6c574d9a4df5b31cea998c43863d10 Mon Sep 17 00:00:00 2001 From: doylet Date: Thu, 14 Aug 2025 17:42:23 +1000 Subject: [PATCH 30/59] Fix pro tests breaking due to version change to @ --- tests/test_config_pro.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_config_pro.cpp b/tests/test_config_pro.cpp index 58a7c932..8ef9e38a 100644 --- a/tests/test_config_pro.cpp +++ b/tests/test_config_pro.cpp @@ -56,7 +56,7 @@ TEST_CASE("Pro", "[config][pro]") { good_dict = { {"r", std::string(reinterpret_cast(rotating_sk.data()), rotating_sk.size())}, {"p", session::config::dict{ - /*version*/ {"v", 0}, + /*version*/ {"@", 0}, /*gen_index_hash*/ {"g", std::string(reinterpret_cast(proof.gen_index_hash.data()), proof.gen_index_hash.size())}, /*rotating pubkey*/ {"r", std::string(reinterpret_cast(proof.rotating_pubkey.data()), proof.rotating_pubkey.size())}, /*expiry unix ts*/ {"e", proof.expiry_unix_ts.time_since_epoch().count()}, @@ -87,7 +87,7 @@ TEST_CASE("Pro", "[config][pro]") { bad_dict = { {"r", std::string(reinterpret_cast(rotating_sk.data()), rotating_sk.size())}, {"p", session::config::dict{ - /*version*/ {"v", 0}, + /*version*/ {"@", 0}, /*gen_index_hash*/ {"g", std::string(reinterpret_cast(proof.gen_index_hash.data()), proof.gen_index_hash.size())}, /*rotating pubkey*/ {"r", std::string(reinterpret_cast(proof.rotating_pubkey.data()), proof.rotating_pubkey.size())}, /*expiry unix ts*/ {"e", proof.expiry_unix_ts.time_since_epoch().count()}, From 8b5e1fdeb009f4eb2a6d85637578a238514bfdaa Mon Sep 17 00:00:00 2001 From: doylet Date: Fri, 15 Aug 2025 12:07:09 +1000 Subject: [PATCH 31/59] Move group msg encryption primitive into session encrypt, avoids circular dependency --- include/session/config/groups/keys.hpp | 53 +----- include/session/session_encrypt.hpp | 105 +++++++++++ include/session/util.hpp | 12 +- src/CMakeLists.txt | 2 +- src/config/groups/keys.cpp | 194 ++------------------ src/config/internal.cpp | 59 ------- src/config/internal.hpp | 13 -- src/session_encrypt.cpp | 236 +++++++++++++++++++++++++ src/util.cpp | 57 ++++++ 9 files changed, 435 insertions(+), 296 deletions(-) diff --git a/include/session/config/groups/keys.hpp b/include/session/config/groups/keys.hpp index 3e20c9b7..83938e5c 100644 --- a/include/session/config/groups/keys.hpp +++ b/include/session/config/groups/keys.hpp @@ -664,46 +664,12 @@ class Keys : public ConfigSig { /// API: groups/Keys::encrypt_message /// - /// Compresses, signs, and encrypts group message content. - /// - /// This method is passed a binary value containing a group message (typically a serialized - /// protobuf, but this method doesn't care about the specific data). That data will be, in - /// order: - /// - compressed (but only if this actually reduces the data size) - /// - signed by the user's underlying session Ed25519 pubkey - /// - tagged with the user's underlying session Ed25519 pubkey (from which the session id can be - /// computed). - /// - all of the above encoded into a bt-encoded dict - /// - suffix-padded with null bytes so that the final output value will be a multiple of 256 - /// bytes - /// - encrypted with the most-current group encryption key - /// - /// Since compression and padding is applied as part of this method, it is not required that the - /// given message include its own padding (and in fact, such padding will typically be - /// compressed down to nothing (if non-random)). - /// - /// This final encrypted value is then returned to be pushed to the swarm as-is (i.e. not - /// further wrapped). For users downloading the message, all of the above is processed in - /// reverse by passing the returned message into `decrypt_message()`. - /// - /// The current implementation uses XChaCha20-Poly1305 for encryption and zstd for compression; - /// the bt-encoded value is a dict consisting of keys: - /// - "": the version of this encoding, currently set to 1. This *MUST* be bumped if this is - /// changed in such a way that older clients will not be able to properly decrypt such a - /// message. - /// - "a": the *Ed25519* pubkey (32 bytes) of the author of the message. (This will be - /// converted to a x25519 pubkey to extract the sender's session id when decrypting). - /// - "s": signature by "a" of whichever of "d" or "z" are included in the data. - /// Exacly one of: - /// - "d": the uncompressed data (which must be non-empty if present) - /// - "z": the zstd-compressed data (which must be non-empty if present) - /// - /// When compression is enabled (by omitting the `compress` argument or specifying it as true) - /// then ZSTD compression will be *attempted* on the plaintext message and will be used if the - /// compressed data is smaller than the uncompressed data. If disabled, or if compression does - /// not reduce the size, then the message will not be compressed. - /// - /// This method will throw on failure, which can happen in two cases: + /// Compresses, signs, and encrypts group message content with the user's underlying session + /// Ed25519 pubkey and the most-current group encryption key. + /// + /// See: crypto/encrypt_for_group + /// + /// This method will throw on failure: /// - if there no encryption keys are available at all (which should not occur in normal use). /// - if given a plaintext buffer larger than 1MB (even if the compressed version would be much /// smaller). It is recommended that clients impose their own limits much smaller than this @@ -728,12 +694,9 @@ class Keys : public ConfigSig { /// API: groups/Keys::decrypt_message /// - /// Decrypts group message content that was presumably encrypted with `encrypt_message`, - /// verifies the sender signature, decompresses the message (if necessary) and then returns the - /// author pubkey and the plaintext data. + /// Decrypts group message content that encrypted with `encrypt_message`. /// - /// To prevent against memory exhaustion attacks, this method will fail if the value is - /// a compressed value that would decompress to a value larger than 1MB. + /// See: crypto/decrypt_group_message /// /// Inputs: /// - `ciphertext` -- an encrypted, encoded, signed, (possibly) compressed message as produced diff --git a/include/session/session_encrypt.hpp b/include/session/session_encrypt.hpp index b4b6f5ed..82bca79c 100644 --- a/include/session/session_encrypt.hpp +++ b/include/session/session_encrypt.hpp @@ -108,6 +108,81 @@ std::vector encrypt_for_blinded_recipient( std::span recipient_blinded_id, std::span message); +static constexpr size_t GROUPS_MAX_PLAINTEXT_MESSAGE_SIZE = 1'000'000; + +/// API: crypto/encrypt_for_group +/// +/// Compresses, signs, and encrypts group message content. +/// +/// This function is passed a binary value containing a group message (typically a serialized +/// protobuf, but this method doesn't care about the specific data). That data will be, in +/// order: +/// - compressed (but only if this actually reduces the data size) +/// - signed by the user's underlying session Ed25519 pubkey +/// - tagged with the user's underlying session Ed25519 pubkey (from which the session id can be +/// computed). +/// - all of the above encoded into a bt-encoded dict +/// - suffix-padded with null bytes so that the final output value will be a multiple of 256 +/// bytes +/// - encrypted with the most-current group encryption key +/// +/// Since compression and padding is applied as part of this method, it is not required that the +/// given message include its own padding (and in fact, such padding will typically be +/// compressed down to nothing (if non-random)). +/// +/// This final encrypted value is then returned to be pushed to the swarm as-is (i.e. not +/// further wrapped). For users downloading the message, all of the above is processed in +/// reverse by passing the returned message into `decrypt_message()`. +/// +/// The current implementation uses XChaCha20-Poly1305 for encryption and zstd for compression; +/// the bt-encoded value is a dict consisting of keys: +/// - "": the version of this encoding, currently set to 1. This *MUST* be bumped if this is +/// changed in such a way that older clients will not be able to properly decrypt such a +/// message. +/// - "a": the *Ed25519* pubkey (32 bytes) of the author of the message. (This will be +/// converted to a x25519 pubkey to extract the sender's session id when decrypting). +/// - "s": signature by "a" of whichever of "d" or "z" are included in the data. +/// Exacly one of: +/// - "d": the uncompressed data (which must be non-empty if present) +/// - "z": the zstd-compressed data (which must be non-empty if present) +/// +/// When compression is enabled (by omitting the `compress` argument or specifying it as true) +/// then ZSTD compression will be *attempted* on the plaintext message and will be used if the +/// compressed data is smaller than the uncompressed data. If disabled, or if compression does +/// not reduce the size, then the message will not be compressed. +/// +/// This function will throw on failure: +/// - if any of the keys passed in are invalidly sized or non-valid keys +/// - if there no encryption keys are available at all (which should not occur in normal use). +/// - if given a plaintext buffer larger than 1MB (even if the compressed version would be much +/// smaller). It is recommended that clients impose their own limits much smaller than this +/// on data passed into encrypt_message; this limitation is in *this* function to match the +/// `decrypt_message` limit which is merely intended to guard against decompression memory +/// exhaustion attacks. +/// +/// Inputs: +/// - `user_ed25519_privkey` -- the private key of the user. Can be a 32-byte seed, or a 64-byte +/// libsodium secret key. The latter is a bit faster as it doesn't have to re-compute the pubkey +/// - `group_ed25519_pubkey` -- the 32 byte public key of the group +/// - `group_ed25519_privkey` -- the private key of the user. Can be a 32-byte seed, or a 64-byte +/// libsodium secret key +/// - `plaintext` -- the binary message to encrypt. +/// - `compress` -- can be specified as `false` to forcibly disable compression. Normally +/// omitted, to use compression if and only if it reduces the size. +/// - `padding` -- the padding multiple: padding will be added as needed to attain a multiple of +/// this value for the final result. 0 or 1 disables padding entirely. Normally omitted to +/// use the default of next-multiple-of-256. +/// +/// Outputs: +/// - `ciphertext` -- the encrypted, etc. value to send to the swarm +std::vector encrypt_for_group( + std::span user_ed25519_privkey, + std::span group_ed25519_pubkey, + std::span group_ed25519_privkey, + std::span plaintext, + bool compress, + size_t padding); + /// API: crypto/sign_for_recipient /// /// Performs the signing steps for session protocol encryption. This is responsible for producing @@ -247,6 +322,36 @@ std::pair, std::string> decrypt_from_blinded_recipien std::span recipient_id, std::span ciphertext); +/// API: crypto/decrypt_group_message +/// +/// Decrypts group message content that was presumably encrypted with `encrypt_group_message`, +/// verifies the sender signature, decompresses the message (if necessary) and then returns the +/// author pubkey and the plaintext data. +/// +/// To prevent against memory exhaustion attacks, this method will fail if the value is +/// a compressed value that would decompress to a value larger than 1MB. +/// +/// Inputs: +/// - `decrypt_ed25519_privkey` -- the private key to use to decrypt the message. Can be a 32-byte +/// seed, or a 64-byte libsodium secret key. The public key component is not used. +/// - `group_ed25519_pubkey` -- the 32 byte public key of the group +/// - `ciphertext` -- an encrypted, encoded, signed, (possibly) compressed message as produced +/// by `encrypt_message()`. +/// +/// Outputs: +/// - `std::pair>` -- the session ID (in hex) and the +/// plaintext binary +/// data that was encrypted. +/// +/// On failure this throws a std::exception-derived exception with a `.what()` string containing +/// some diagnostic info on what part failed. Typically a production session client would catch +/// (and possibly log) but otherwise ignore such exceptions and just not process the message if +/// it throws. +std::pair> decrypt_group_message( + std::span decrypt_ed25519_privkey, + std::span group_ed25519_pubkey, + std::span ciphertext); + /// API: crypto/decrypt_ons_response /// /// Decrypts the response of an ONS lookup. diff --git a/include/session/util.hpp b/include/session/util.hpp index fc57908f..8e3f8601 100644 --- a/include/session/util.hpp +++ b/include/session/util.hpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -276,4 +275,15 @@ static_assert(std::is_same_v< std::chrono::seconds, decltype(std::declval().time_since_epoch())>); +/// ZSTD-compresses a value. `prefix` can be prepended on the returned value, if needed. Throws on +/// serious error. +std::vector zstd_compress( + std::span data, + int level = 1, + std::span prefix = {}); + +/// ZSTD-decompresses a value. Returns nullopt if decompression fails. If max_size is non-zero +/// then this returns nullopt if the decompressed size would exceed that limit. +std::optional> zstd_decompress( + std::span data, size_t max_size = 0); } // namespace session diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 469b96c8..10ea8eef 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -84,6 +84,7 @@ target_link_libraries(util PUBLIC common oxen::logging + libzstd::static ) target_link_libraries(crypto @@ -100,7 +101,6 @@ target_link_libraries(config libsession::protos PRIVATE libsodium::sodium-internal - libzstd::static ) if(ENABLE_ONIONREQ) diff --git a/src/config/groups/keys.cpp b/src/config/groups/keys.cpp index 534ecc35..dd2eca4d 100644 --- a/src/config/groups/keys.cpp +++ b/src/config/groups/keys.cpp @@ -23,6 +23,7 @@ #include "session/config/groups/members.hpp" #include "session/multi_encrypt.hpp" #include "session/xed25519.hpp" +#include "session/session_encrypt.hpp" using namespace std::literals; @@ -1201,203 +1202,42 @@ static constexpr size_t ENCRYPT_OVERHEAD = std::vector Keys::encrypt_message( std::span plaintext, bool compress, size_t padding) const { - if (plaintext.size() > MAX_PLAINTEXT_MESSAGE_SIZE) - throw std::runtime_error{"Cannot encrypt plaintext: message size is too large"}; - std::vector _compressed; - if (compress) { - _compressed = zstd_compress(plaintext); - if (_compressed.size() < plaintext.size()) - plaintext = _compressed; - else { - _compressed.clear(); - compress = false; - } - } - // `plaintext` is now pointing at either the original input data, or at `_compressed` local - // variable containing the compressed form of that data. - - oxenc::bt_dict_producer dict{}; - - // encoded data version (bump this if something changes in an incompatible way) - dict.append("", 1); - - // Sender ed pubkey, by which the message can be validated. Note that there are *two* - // components to this validation: first the regular signature validation of the "s" signature we - // add below, but then also validation that this Ed25519 converts to the Session ID of the - // claimed sender of the message inside the encoded message data. - dict.append( - "a", std::string_view{reinterpret_cast(user_ed25519_sk.data()) + 32, 32}); - - if (!compress) - dict.append("d", to_string_view(plaintext)); - - // We sign `plaintext || group_ed25519_pubkey` rather than just `plaintext` so that if this - // encrypted data will not validate if cross-posted to any other group. We don't actually - // include the pubkey alongside, because that is implicitly known by the group members that - // receive it. assert(_sign_pk); - std::vector to_sign(plaintext.size() + _sign_pk->size()); - std::memcpy(to_sign.data(), plaintext.data(), plaintext.size()); - std::memcpy(to_sign.data() + plaintext.size(), _sign_pk->data(), _sign_pk->size()); - - std::array signature; - crypto_sign_ed25519_detached( - signature.data(), nullptr, to_sign.data(), to_sign.size(), user_ed25519_sk.data()); - dict.append("s", to_string_view(signature)); - - if (compress) - dict.append("z", to_string_view(plaintext)); - - auto encoded = std::move(dict).str(); - - // suppose size == 250, padding = 256 - // so size + overhead(40) == 290 - // need padding of (256 - (290 % 256)) = 256 - 34 = 222 - // thus 290 + 222 = 512 - size_t final_len = ENCRYPT_OVERHEAD + encoded.size(); - if (padding > 1 && final_len % padding != 0) { - size_t to_append = padding - (final_len % padding); - encoded.resize(encoded.size() + to_append); - } - - std::vector ciphertext; - ciphertext.resize(ENCRYPT_OVERHEAD + encoded.size()); - randombytes_buf(ciphertext.data(), crypto_aead_xchacha20poly1305_ietf_NPUBBYTES); - std::span nonce{ - ciphertext.data(), crypto_aead_xchacha20poly1305_ietf_NPUBBYTES}; - if (0 != crypto_aead_xchacha20poly1305_ietf_encrypt( - ciphertext.data() + crypto_aead_xchacha20poly1305_ietf_NPUBBYTES, - nullptr, - to_unsigned(encoded.data()), - encoded.size(), - nullptr, - 0, - nullptr, - nonce.data(), - group_enc_key().data())) - throw std::runtime_error{"Encryption failed"}; - + std::vector ciphertext = encrypt_for_group( + user_ed25519_sk, *_sign_pk, group_enc_key(), plaintext, compress, padding); return ciphertext; } std::pair> Keys::decrypt_message( std::span ciphertext) const { - if (ciphertext.size() < ENCRYPT_OVERHEAD) - throw std::runtime_error{"ciphertext is too small to be encrypted data"}; - - std::vector plain; - - auto nonce = ciphertext.subspan(0, crypto_aead_xchacha20poly1305_ietf_NPUBBYTES); - ciphertext = ciphertext.subspan(crypto_aead_xchacha20poly1305_ietf_NPUBBYTES); - plain.resize(ciphertext.size() - crypto_aead_xchacha20poly1305_ietf_ABYTES); + assert(_sign_pk); + std::pair> result; // // Decrypt, using all the possible keys, starting with a pending one (if we have one) // bool decrypt_success = false; - if (auto pending = pending_key(); - pending && try_decrypting(plain.data(), ciphertext, nonce, *pending)) { - decrypt_success = true; - } else { + if (auto pending = pending_key(); pending) { + try { + result = decrypt_group_message(*pending, *_sign_pk, ciphertext); + decrypt_success = true; + } catch (const std::exception&) { + } + } + + if (!decrypt_success) { for (auto& k : keys_) { - if (try_decrypting(plain.data(), ciphertext, nonce, k.key)) { + try { + result = decrypt_group_message(k.key, *_sign_pk, ciphertext); decrypt_success = true; break; + } catch (const std::exception&) { } } } if (!decrypt_success) // none of the keys worked throw std::runtime_error{"unable to decrypt ciphertext with any current group keys"}; - - // - // Removing any null padding bytes from the end - // - if (auto it = - std::find_if(plain.rbegin(), plain.rend(), [](unsigned char c) { return c != 0; }); - it != plain.rend()) - plain.resize(plain.size() - std::distance(plain.rbegin(), it)); - - // - // Now what we have less should be a bt_dict - // - if (plain.empty() || plain.front() != 'd' || plain.back() != 'e') - throw std::runtime_error{"decrypted data is not a bencoded dict"}; - - oxenc::bt_dict_consumer dict{to_string_view(plain)}; - - if (!dict.skip_until("")) - throw std::runtime_error{"group message version tag (\"\") is missing"}; - if (auto v = dict.consume_integer(); v != 1) - throw std::runtime_error{ - "group message version tag (" + std::to_string(v) + - ") is not compatible (we support v1)"}; - - if (!dict.skip_until("a")) - throw std::runtime_error{"missing message author pubkey"}; - auto ed_pk = to_span(dict.consume_string_view()); - if (ed_pk.size() != 32) - throw std::runtime_error{ - "message author pubkey size (" + std::to_string(ed_pk.size()) + ") is invalid"}; - - std::array x_pk; - if (0 != crypto_sign_ed25519_pk_to_curve25519(x_pk.data(), ed_pk.data())) - throw std::runtime_error{ - "author ed25519 pubkey is invalid (unable to convert it to a session id)"}; - - std::pair> result; - auto& [session_id, data] = result; - session_id.reserve(66); - session_id += "05"; - oxenc::to_hex(x_pk.begin(), x_pk.end(), std::back_inserter(session_id)); - - std::span raw_data; - if (dict.skip_until("d")) { - raw_data = to_span(dict.consume_string_view()); - if (raw_data.empty()) - throw std::runtime_error{"uncompressed message data (\"d\") cannot be empty"}; - } - - if (!dict.skip_until("s")) - throw std::runtime_error{"message signature is missing"}; - auto ed_sig = to_span(dict.consume_string_view()); - if (ed_sig.size() != 64) - throw std::runtime_error{ - "message signature size (" + std::to_string(ed_sig.size()) + ") is invalid"}; - - bool compressed = false; - if (dict.skip_until("z")) { - if (!raw_data.empty()) - throw std::runtime_error{ - "message signature cannot contain both compressed (z) and uncompressed (d) " - "data"}; - raw_data = to_span(dict.consume_string_view()); - if (raw_data.empty()) - throw std::runtime_error{"compressed message data (\"z\") cannot be empty"}; - - compressed = true; - } else if (raw_data.empty()) - throw std::runtime_error{"message must contain compressed (z) or uncompressed (d) data"}; - - // The value we verify is the raw data *followed by* the group Ed25519 pubkey. (See the comment - // in encrypt_message). - assert(_sign_pk); - std::vector to_verify; - to_verify.resize(raw_data.size() + _sign_pk->size()); - std::memcpy(to_verify.data(), raw_data.data(), raw_data.size()); - std::memcpy(to_verify.data() + raw_data.size(), _sign_pk->data(), _sign_pk->size()); - if (0 != crypto_sign_ed25519_verify_detached( - ed_sig.data(), to_verify.data(), to_verify.size(), ed_pk.data())) - throw std::runtime_error{"message signature failed validation"}; - - if (compressed) { - if (auto decomp = zstd_decompress(raw_data, MAX_PLAINTEXT_MESSAGE_SIZE)) { - data = std::move(*decomp); - } else - throw std::runtime_error{"message decompression failed"}; - } else - data.assign(raw_data.begin(), raw_data.end()); - return result; } diff --git a/src/config/internal.cpp b/src/config/internal.cpp index 8ed6f61d..aa802e5c 100644 --- a/src/config/internal.cpp +++ b/src/config/internal.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include @@ -242,62 +241,4 @@ void load_unknowns( throw oxenc::bt_deserialize_invalid{"invalid bencoded value type"}; } } - -namespace { - struct zstd_decomp_freer { - void operator()(ZSTD_DStream* z) const { ZSTD_freeDStream(z); } - }; - - using zstd_decomp_ptr = std::unique_ptr; -} // namespace - -std::vector zstd_compress( - std::span data, int level, std::span prefix) { - std::vector compressed; - if (prefix.empty()) - compressed.resize(ZSTD_compressBound(data.size())); - else { - compressed.resize(prefix.size() + ZSTD_compressBound(data.size())); - std::copy(prefix.begin(), prefix.end(), compressed.begin()); - } - auto size = ZSTD_compress( - compressed.data() + prefix.size(), - compressed.size() - prefix.size(), - data.data(), - data.size(), - level); - if (ZSTD_isError(size)) - throw std::runtime_error{"Compression failed: " + std::string{ZSTD_getErrorName(size)}}; - - compressed.resize(prefix.size() + size); - return compressed; -} - -std::optional> zstd_decompress( - std::span data, size_t max_size) { - zstd_decomp_ptr z_decompressor{ZSTD_createDStream()}; - auto* zds = z_decompressor.get(); - - ZSTD_initDStream(zds); - ZSTD_inBuffer input{/*.src=*/data.data(), /*.size=*/data.size(), /*.pos=*/0}; - std::array out_buf; - ZSTD_outBuffer output{/*.dst=*/out_buf.data(), /*.size=*/out_buf.size(), /*.pos=*/0}; - - std::vector decompressed; - - size_t ret; - do { - output.pos = 0; - if (ret = ZSTD_decompressStream(zds, &output, &input); ZSTD_isError(ret)) - return std::nullopt; - - if (max_size > 0 && decompressed.size() + output.pos > max_size) - return std::nullopt; - - decompressed.insert(decompressed.end(), out_buf.begin(), out_buf.begin() + output.pos); - } while (ret > 0 || input.pos < input.size); - - return decompressed; -} - } // namespace session::config diff --git a/src/config/internal.hpp b/src/config/internal.hpp index 2b843856..8d8908e2 100644 --- a/src/config/internal.hpp +++ b/src/config/internal.hpp @@ -254,19 +254,6 @@ void load_unknowns( oxenc::bt_dict_consumer& in, std::string_view previous, std::string_view until); - -/// ZSTD-compresses a value. `prefix` can be prepended on the returned value, if needed. Throws on -/// serious error. -std::vector zstd_compress( - std::span data, - int level = 1, - std::span prefix = {}); - -/// ZSTD-decompresses a value. Returns nullopt if decompression fails. If max_size is non-zero -/// then this returns nullopt if the decompressed size would exceed that limit. -std::optional> zstd_decompress( - std::span data, size_t max_size = 0); - } // namespace session::config namespace fmt { diff --git a/src/session_encrypt.cpp b/src/session_encrypt.cpp index 36246618..1614693e 100644 --- a/src/session_encrypt.cpp +++ b/src/session_encrypt.cpp @@ -14,6 +14,9 @@ #include #include #include +#include +#include +#include #include #include @@ -360,6 +363,115 @@ std::vector encrypt_for_blinded_recipient( return ciphertext; } +static constexpr size_t GROUPS_ENCRYPT_OVERHEAD = + crypto_aead_xchacha20poly1305_ietf_NPUBBYTES + crypto_aead_xchacha20poly1305_ietf_ABYTES; + +std::vector encrypt_for_group( + std::span user_ed25519_privkey, + std::span group_ed25519_pubkey, + std::span group_ed25519_privkey, + std::span plaintext, + bool compress, + size_t padding) { + if (plaintext.size() > GROUPS_MAX_PLAINTEXT_MESSAGE_SIZE) + throw std::runtime_error{"Cannot encrypt plaintext: message size is too large"}; + + // Generate the user's pubkey if they passed in a 32 byte secret key instead of the + // libsodium-style 64 byte secret key. + cleared_uc64 user_ed25519_privkey_from_seed; + if (user_ed25519_privkey.size() == 32) { + uc32 ignore_pk; + crypto_sign_ed25519_seed_keypair( + ignore_pk.data(), + user_ed25519_privkey_from_seed.data(), + user_ed25519_privkey.data()); + user_ed25519_privkey = { + user_ed25519_privkey_from_seed.data(), user_ed25519_privkey_from_seed.size()}; + } else if (user_ed25519_privkey.size() != 64) { + throw std::invalid_argument{"Invalid user_ed25519_privkey: expected 32 or 64 bytes"}; + } + + if (group_ed25519_privkey.size() != 32 && group_ed25519_privkey.size() != 64) + throw std::invalid_argument{"Invalid group_ed25519_privkey: expected 32 or 64 bytes"}; + if (group_ed25519_pubkey.size() != crypto_sign_ed25519_PUBLICKEYBYTES) + throw std::invalid_argument{"Invalid group_ed25519_pubkey: expected 32 bytes"}; + + std::vector _compressed; + if (compress) { + _compressed = zstd_compress(plaintext); + if (_compressed.size() < plaintext.size()) + plaintext = _compressed; + else { + _compressed.clear(); + compress = false; + } + } + // `plaintext` is now pointing at either the original input data, or at `_compressed` local + // variable containing the compressed form of that data. + + oxenc::bt_dict_producer dict{}; + + // encoded data version (bump this if something changes in an incompatible way) + dict.append("", 1); + + // Sender ed pubkey, by which the message can be validated. Note that there are *two* + // components to this validation: first the regular signature validation of the "s" signature we + // add below, but then also validation that this Ed25519 converts to the Session ID of the + // claimed sender of the message inside the encoded message data. + dict.append( + "a", std::string_view{reinterpret_cast(user_ed25519_privkey.data()) + 32, 32}); + + if (!compress) + dict.append("d", to_string_view(plaintext)); + + // We sign `plaintext || group_ed25519_pubkey` rather than just `plaintext` so that if this + // encrypted data will not validate if cross-posted to any other group. We don't actually + // include the pubkey alongside, because that is implicitly known by the group members that + // receive it. + std::vector to_sign(plaintext.size() + group_ed25519_pubkey.size()); + std::memcpy(to_sign.data(), plaintext.data(), plaintext.size()); + std::memcpy(to_sign.data() + plaintext.size(), group_ed25519_pubkey.data(), group_ed25519_pubkey.size()); + + std::array signature; + crypto_sign_ed25519_detached( + signature.data(), nullptr, to_sign.data(), to_sign.size(), user_ed25519_privkey.data()); + dict.append("s", to_string_view(signature)); + + if (compress) + dict.append("z", to_string_view(plaintext)); + + auto encoded = std::move(dict).str(); + + // suppose size == 250, padding = 256 + // so size + overhead(40) == 290 + // need padding of (256 - (290 % 256)) = 256 - 34 = 222 + // thus 290 + 222 = 512 + size_t final_len = GROUPS_ENCRYPT_OVERHEAD + encoded.size(); + if (padding > 1 && final_len % padding != 0) { + size_t to_append = padding - (final_len % padding); + encoded.resize(encoded.size() + to_append); + } + + std::vector ciphertext; + ciphertext.resize(GROUPS_ENCRYPT_OVERHEAD + encoded.size()); + randombytes_buf(ciphertext.data(), crypto_aead_xchacha20poly1305_ietf_NPUBBYTES); + std::span nonce{ + ciphertext.data(), crypto_aead_xchacha20poly1305_ietf_NPUBBYTES}; + if (0 != crypto_aead_xchacha20poly1305_ietf_encrypt( + ciphertext.data() + crypto_aead_xchacha20poly1305_ietf_NPUBBYTES, + nullptr, + to_unsigned(encoded.data()), + encoded.size(), + nullptr, + 0, + nullptr, + nonce.data(), + group_ed25519_privkey.data())) + throw std::runtime_error{"Encryption failed"}; + + return ciphertext; +} + std::pair, std::string> decrypt_incoming_session_id( std::span ed25519_privkey, std::span ciphertext) { auto [buf, sender_ed_pk] = decrypt_incoming(ed25519_privkey, ciphertext); @@ -566,6 +678,130 @@ std::pair, std::string> decrypt_from_blinded_recipien return result; } +std::pair> decrypt_group_message( + std::span decrypt_ed25519_privkey, + std::span group_ed25519_pubkey, + std::span ciphertext) { + if (ciphertext.size() < GROUPS_ENCRYPT_OVERHEAD) + throw std::runtime_error{"ciphertext is too small to be encrypted data"}; + if (decrypt_ed25519_privkey.size() != 32 && decrypt_ed25519_privkey.size() != 64) + throw std::invalid_argument{"Invalid decrypt_ed25519_privkey: expected 32 or 64 bytes"}; + if (group_ed25519_pubkey.size() != crypto_sign_ed25519_PUBLICKEYBYTES) + throw std::invalid_argument{"Invalid decrypt_ed25519_privkey: expected 32 bytes"}; + + // Note we only use the secret key of the decrypt_ed25519_privkey so we don't care about + // generating the pubkey component if the user only passed in a 32 byte libsodium-style secret + // key. + + std::vector plain; + + auto nonce = ciphertext.subspan(0, crypto_aead_xchacha20poly1305_ietf_NPUBBYTES); + ciphertext = ciphertext.subspan(crypto_aead_xchacha20poly1305_ietf_NPUBBYTES); + plain.resize(ciphertext.size() - crypto_aead_xchacha20poly1305_ietf_ABYTES); + + // Decrypt using specific key + bool decrypt_success = 0 == crypto_aead_xchacha20poly1305_ietf_decrypt( + plain.data(), + nullptr, + nullptr, + ciphertext.data(), + ciphertext.size(), + nullptr, + 0, + nonce.data(), + decrypt_ed25519_privkey.data()); + if (!decrypt_success) // none of the keys worked + throw std::runtime_error{"unable to decrypt ciphertext with any current group keys"}; + + // + // Removing any null padding bytes from the end + // + if (auto it = + std::find_if(plain.rbegin(), plain.rend(), [](unsigned char c) { return c != 0; }); + it != plain.rend()) + plain.resize(plain.size() - std::distance(plain.rbegin(), it)); + + // + // Now what we have less should be a bt_dict + // + if (plain.empty() || plain.front() != 'd' || plain.back() != 'e') + throw std::runtime_error{"decrypted data is not a bencoded dict"}; + + oxenc::bt_dict_consumer dict{to_string_view(plain)}; + + if (!dict.skip_until("")) + throw std::runtime_error{"group message version tag (\"\") is missing"}; + if (auto v = dict.consume_integer(); v != 1) + throw std::runtime_error{ + "group message version tag (" + std::to_string(v) + + ") is not compatible (we support v1)"}; + + if (!dict.skip_until("a")) + throw std::runtime_error{"missing message author pubkey"}; + auto ed_pk = to_span(dict.consume_string_view()); + if (ed_pk.size() != 32) + throw std::runtime_error{ + "message author pubkey size (" + std::to_string(ed_pk.size()) + ") is invalid"}; + + std::array x_pk; + if (0 != crypto_sign_ed25519_pk_to_curve25519(x_pk.data(), ed_pk.data())) + throw std::runtime_error{ + "author ed25519 pubkey is invalid (unable to convert it to a session id)"}; + + std::pair> result; + auto& [session_id, data] = result; + session_id.reserve(66); + session_id += "05"; + oxenc::to_hex(x_pk.begin(), x_pk.end(), std::back_inserter(session_id)); + + std::span raw_data; + if (dict.skip_until("d")) { + raw_data = to_span(dict.consume_string_view()); + if (raw_data.empty()) + throw std::runtime_error{"uncompressed message data (\"d\") cannot be empty"}; + } + + if (!dict.skip_until("s")) + throw std::runtime_error{"message signature is missing"}; + auto ed_sig = to_span(dict.consume_string_view()); + if (ed_sig.size() != 64) + throw std::runtime_error{ + "message signature size (" + std::to_string(ed_sig.size()) + ") is invalid"}; + + bool compressed = false; + if (dict.skip_until("z")) { + if (!raw_data.empty()) + throw std::runtime_error{ + "message signature cannot contain both compressed (z) and uncompressed (d) " + "data"}; + raw_data = to_span(dict.consume_string_view()); + if (raw_data.empty()) + throw std::runtime_error{"compressed message data (\"z\") cannot be empty"}; + + compressed = true; + } else if (raw_data.empty()) + throw std::runtime_error{"message must contain compressed (z) or uncompressed (d) data"}; + + // The value we verify is the raw data *followed by* the group Ed25519 pubkey. (See the comment + // in encrypt_message). + std::vector to_verify(raw_data.size() + group_ed25519_pubkey.size()); + std::memcpy(to_verify.data(), raw_data.data(), raw_data.size()); + std::memcpy(to_verify.data() + raw_data.size(), group_ed25519_pubkey.data(), group_ed25519_pubkey.size()); + if (0 != crypto_sign_ed25519_verify_detached( + ed_sig.data(), to_verify.data(), to_verify.size(), ed_pk.data())) + throw std::runtime_error{"message signature failed validation"}; + + if (compressed) { + if (auto decomp = zstd_decompress(raw_data, GROUPS_MAX_PLAINTEXT_MESSAGE_SIZE)) { + data = std::move(*decomp); + } else + throw std::runtime_error{"message decompression failed"}; + } else + data.assign(raw_data.begin(), raw_data.end()); + + return result; +} + std::string decrypt_ons_response( std::string_view lowercase_name, std::span ciphertext, diff --git a/src/util.cpp b/src/util.cpp index 60409c58..12b5450e 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,5 +1,6 @@ #include #include +#include namespace session { @@ -91,4 +92,60 @@ static_assert(std::is_same_v< std::chrono::seconds, decltype(std::declval().time_since_epoch())>); +namespace { + struct zstd_decomp_freer { + void operator()(ZSTD_DStream* z) const { ZSTD_freeDStream(z); } + }; + + using zstd_decomp_ptr = std::unique_ptr; +} // namespace + +std::vector zstd_compress( + std::span data, int level, std::span prefix) { + std::vector compressed; + if (prefix.empty()) + compressed.resize(ZSTD_compressBound(data.size())); + else { + compressed.resize(prefix.size() + ZSTD_compressBound(data.size())); + std::copy(prefix.begin(), prefix.end(), compressed.begin()); + } + auto size = ZSTD_compress( + compressed.data() + prefix.size(), + compressed.size() - prefix.size(), + data.data(), + data.size(), + level); + if (ZSTD_isError(size)) + throw std::runtime_error{"Compression failed: " + std::string{ZSTD_getErrorName(size)}}; + + compressed.resize(prefix.size() + size); + return compressed; +} + +std::optional> zstd_decompress( + std::span data, size_t max_size) { + zstd_decomp_ptr z_decompressor{ZSTD_createDStream()}; + auto* zds = z_decompressor.get(); + + ZSTD_initDStream(zds); + ZSTD_inBuffer input{/*.src=*/data.data(), /*.size=*/data.size(), /*.pos=*/0}; + std::array out_buf; + ZSTD_outBuffer output{/*.dst=*/out_buf.data(), /*.size=*/out_buf.size(), /*.pos=*/0}; + + std::vector decompressed; + + size_t ret; + do { + output.pos = 0; + if (ret = ZSTD_decompressStream(zds, &output, &input); ZSTD_isError(ret)) + return std::nullopt; + + if (max_size > 0 && decompressed.size() + output.pos > max_size) + return std::nullopt; + + decompressed.insert(decompressed.end(), out_buf.begin(), out_buf.begin() + output.pos); + } while (ret > 0 || input.pos < input.size); + + return decompressed; +} } // namespace session From 9bb7d27681250fd833b348dc86a4916be36b203f Mon Sep 17 00:00:00 2001 From: doylet Date: Mon, 18 Aug 2025 16:21:27 +1000 Subject: [PATCH 32/59] Move group encryption into session encrypt This lets the higher-level layer, session protocol to use low level encryption instead of relying on config to decrypt group messages. Decryption of a group message is a low-level cryptography routine which actually belongs in session encrypt. --- include/session/config/groups/keys.h | 13 +++ include/session/config/groups/keys.hpp | 5 + include/session/session_encrypt.h | 82 ++++++++++++++ include/session/session_encrypt.hpp | 17 ++- include/session/session_protocol.h | 11 +- include/session/session_protocol.hpp | 51 +++++---- include/session/types.h | 8 -- src/config/groups/keys.cpp | 29 ++++- src/session_encrypt.cpp | 105 +++++++++++++++--- src/session_protocol.cpp | 145 ++++++++++++++----------- tests/test_session_protocol.cpp | 56 ++++++---- 11 files changed, 378 insertions(+), 144 deletions(-) diff --git a/include/session/config/groups/keys.h b/include/session/config/groups/keys.h index f0ee5025..fbc34a0d 100644 --- a/include/session/config/groups/keys.h +++ b/include/session/config/groups/keys.h @@ -6,6 +6,7 @@ extern "C" { #include "../base.h" #include "../util.h" +#include "../../types.h" // This is an opaque type analagous to `config_object` but specific to the groups keys object. // @@ -132,6 +133,18 @@ LIBSESSION_EXPORT size_t groups_keys_size(const config_group_keys* conf); /// - `const unsigned char*` -- pointer to the 32-byte key, or nullptr if there LIBSESSION_EXPORT const unsigned char* groups_keys_get_key(const config_group_keys* conf, size_t N); +/// API: groups/groups_keys_group_enc_key +/// +/// Accesses the current encryption key: that is, the most current group decryption key. Returns the +/// 32 byte private key, or, an empty span if there are no encryption keys at all. +/// +/// Inputs: +/// - `conf` -- the groups config object +/// +/// Outputs: +/// - `true` if we have admin keys, `false` otherwise. +LIBSESSION_EXPORT const span_u8 groups_keys_group_enc_key(const config_group_keys* conf); + /// API: groups/groups_keys_is_admin /// /// Returns true if this object has the group private keys, i.e. the user is an all-powerful diff --git a/include/session/config/groups/keys.hpp b/include/session/config/groups/keys.hpp index 83938e5c..c8f7c194 100644 --- a/include/session/config/groups/keys.hpp +++ b/include/session/config/groups/keys.hpp @@ -697,6 +697,11 @@ class Keys : public ConfigSig { /// Decrypts group message content that encrypted with `encrypt_message`. /// /// See: crypto/decrypt_group_message + /// verifies the sender signature, decompresses the message (if necessary) and then returns the + /// author pubkey and the plaintext data. + /// + /// To prevent against memory exhaustion attacks, this method will fail if the value is + /// a compressed value that would decompress to a value larger than 1MB. /// /// Inputs: /// - `ciphertext` -- an encrypted, encoded, signed, (possibly) compressed message as produced diff --git a/include/session/session_encrypt.h b/include/session/session_encrypt.h index f5a1c2b6..eccadc12 100644 --- a/include/session/session_encrypt.h +++ b/include/session/session_encrypt.h @@ -8,6 +8,7 @@ extern "C" { #include #include "export.h" +#include "types.h" /// API: crypto/session_encrypt_for_recipient_deterministic /// @@ -67,6 +68,53 @@ LIBSESSION_EXPORT bool session_encrypt_for_blinded_recipient( unsigned char** ciphertext_out, size_t* ciphertext_len); +typedef struct { + bool success; + span_u8 ciphertext; +} session_encrypt_group_message; + +/// API: crypto/session_encrypt_for_group +/// +/// Compresses, signs, and encrypts group message content. +/// +/// See: crypto/encrypt_for_group +/// +/// This function will set `success` to false on failure: +/// - if any of the keys passed in are invalidly sized or non-valid keys +/// - if there no encryption keys are available at all (which should not occur in normal use). +/// - if given a plaintext buffer larger than 1MB (even if the compressed version would be much +/// smaller). It is recommended that clients impose their own limits much smaller than this +/// on data passed into encrypt_message; this limitation is in *this* function to match the +/// `decrypt_message` limit which is merely intended to guard against decompression memory +/// exhaustion attacks. +/// +/// Inputs: +/// - `user_ed25519_privkey` -- the private key of the user. Can be a 32-byte seed, or a 64-byte +/// libsodium secret key. The latter is a bit faster as it doesn't have to re-compute the pubkey +/// - `group_ed25519_pubkey` -- the 32 byte public key of the group +/// - `group_ed25519_privkey` -- the private key of the user. Can be a 32-byte seed, or a 64-byte +/// libsodium secret key +/// - `plaintext` -- the binary message to encrypt. +/// - `compress` -- can be specified as `false` to forcibly disable compression. Normally +/// omitted, to use compression if and only if it reduces the size. +/// - `padding` -- the padding multiple: padding will be added as needed to attain a multiple of +/// this value for the final result. 0 or 1 disables padding entirely. Normally omitted to +/// use the default of next-multiple-of-256. +/// +/// Outputs: +/// - `ciphertext` -- the encrypted, etc. value to send to the swarm +LIBSESSION_EXPORT session_encrypt_group_message session_encrypt_for_group( + const unsigned char *user_ed25519_privkey, + size_t user_ed25519_privkey_len, + const unsigned char *group_ed25519_pubkey, + size_t group_ed25519_pubkey_len, + const unsigned char *group_ed25519_privkey, + size_t group_ed25519_privkey_len, + const unsigned char *plaintext, + size_t plaintext_len, + bool compress, + size_t padding); + /// API: crypto/session_decrypt_incoming /// /// This function attempts to decrypt a message using the SessionProtocol. @@ -166,6 +214,40 @@ LIBSESSION_EXPORT bool session_decrypt_for_blinded_recipient( unsigned char** plaintext_out, size_t* plaintext_len); +typedef struct { + bool success; + size_t index; // Index of the key that successfully decrypted the message + char session_id[66]; // In hex + span_u8 plaintext; +} session_decrypt_group_message_result; + +/// API: crypto/session_decrypt_group_message +/// +/// Decrypts group message content that was presumably encrypted with `session_encrypt_for_group`, +/// verifies the sender signature, decompresses the message (if necessary) and then returns the +/// author pubkey and the plaintext data. +/// +/// See: crypto/decrypt_group_message +/// +/// Inputs: +/// - `decrypt_ed25519_privkey_list` -- the list of private keys to try to decrypt the message with. +/// Can be a 32-byte seed, or a 64-byte libsodium secret key. The public key component is not +/// used. +/// - `group_ed25519_pubkey` -- the 32 byte public key of the group +/// - `ciphertext` -- an encrypted, encoded, signed, (possibly) compressed message as produced +/// by `encrypt_message()`. +/// +/// Outputs: +/// The struct with the results of decryption. On failure this sets the `success` boolean to false +/// and all fields should be ignored except `success`. +session_decrypt_group_message_result session_decrypt_group_message( + const span_u8 *decrypt_ed25519_privkey_list, + size_t decrypt_ed25519_privkey_len, + const unsigned char *group_ed25519_pubkey, + size_t group_ed25519_pubkey_len, + const unsigned char *ciphertext, + size_t ciphertext_len); + /// API: crypto/session_decrypt_ons_response /// /// This function attempts to decrypt an ONS response. diff --git a/include/session/session_encrypt.hpp b/include/session/session_encrypt.hpp index 82bca79c..d5e21f48 100644 --- a/include/session/session_encrypt.hpp +++ b/include/session/session_encrypt.hpp @@ -322,9 +322,15 @@ std::pair, std::string> decrypt_from_blinded_recipien std::span recipient_id, std::span ciphertext); +struct DecryptGroupMessage { + size_t index; // Index of the key that successfully decrypted the message + std::string session_id; // In hex + std::vector plaintext; +}; + /// API: crypto/decrypt_group_message /// -/// Decrypts group message content that was presumably encrypted with `encrypt_group_message`, +/// Decrypts group message content that was presumably encrypted with `encrypt_for_group`, /// verifies the sender signature, decompresses the message (if necessary) and then returns the /// author pubkey and the plaintext data. /// @@ -332,8 +338,9 @@ std::pair, std::string> decrypt_from_blinded_recipien /// a compressed value that would decompress to a value larger than 1MB. /// /// Inputs: -/// - `decrypt_ed25519_privkey` -- the private key to use to decrypt the message. Can be a 32-byte -/// seed, or a 64-byte libsodium secret key. The public key component is not used. +/// - `decrypt_ed25519_privkey_list` -- the list of private keys to try to decrypt the message with. +/// Can be a 32-byte seed, or a 64-byte libsodium secret key. The public key component is not +/// used. /// - `group_ed25519_pubkey` -- the 32 byte public key of the group /// - `ciphertext` -- an encrypted, encoded, signed, (possibly) compressed message as produced /// by `encrypt_message()`. @@ -347,8 +354,8 @@ std::pair, std::string> decrypt_from_blinded_recipien /// some diagnostic info on what part failed. Typically a production session client would catch /// (and possibly log) but otherwise ignore such exceptions and just not process the message if /// it throws. -std::pair> decrypt_group_message( - std::span decrypt_ed25519_privkey, +DecryptGroupMessage decrypt_group_message( + std::span> decrypt_ed25519_privkey_list, std::span group_ed25519_pubkey, std::span ciphertext); diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index 9f07e2c6..aaee6ea3 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -69,8 +69,8 @@ struct session_protocol_destination { // See session::Destination uint8_t recipient_pubkey[33]; uint64_t sent_timestamp_ms; uint8_t open_group_inbox_server_pubkey[32]; - uint8_t closed_group_pubkey[33]; - const config_group_keys* closed_group_keys; + uint8_t closed_group_ed25519_pubkey[33]; + uint8_t closed_group_ed25519_privkey[32]; }; enum ENVELOPE_TYPE { @@ -99,10 +99,9 @@ struct session_protocol_envelope { }; struct session_protocol_decrypt_envelope_keys { - bool use_group_keys; - const config_group_keys* group_keys; - const void* recipient_ed25519_privkey; - size_t recipient_ed25519_privkey_len; + span_u8 group_ed25519_pubkey; + const span_u8 *ed25519_privkeys; + size_t ed25519_privkeys_len; }; struct session_protocol_decrypted_envelope { diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index 2a789184..e56dadcd 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -75,12 +75,14 @@ struct Destination { // When type => OpenGroupInbox: set this pubkey to the server's key array_uc32 open_group_inbox_server_pubkey; - // When type => ClosedGroup: set the following 'closed_group' prefixed fields - array_uc33 closed_group_pubkey; - - // Must be set to the group keys for a 0x03 prefix (e.g. groups v2) `closed_group_pubkey` to - // encrypt the message. - const session::config::groups::Keys* closed_group_keys; + // When type => ClosedGroup: set to the group keys for a 0x03 prefix (e.g. groups v2) + // `closed_group_pubkey` to encrypt the message. Public key of the group for groups v2 messages + array_uc33 closed_group_ed25519_pubkey; + + // When type => ClosedGroup: Set the private key of the group for groups v2 messages. Typically + // the latest encryption key for the group, e.g: `Keys::group_enc_key` or + // `groups_keys_group_enc_key` + array_uc32 closed_group_ed25519_privkey; }; enum class EnvelopeType { @@ -135,20 +137,29 @@ struct DecryptedEnvelope { }; struct DecryptEnvelopeKey { - // Indicate to the envelope decrypting function that it should use the group keys to decrypt the - // envelope (e.g.: for groups v2 envelopes where the envelope is encrypted and the body - // unencrypted). The `group_keys` must be set if this flag is true. The recipient ed25519 - // private key field is ignored if this flag is set. - bool use_group_keys; - - // Keys to use to decrypt the envelope. - const config::groups::Keys* group_keys; - - // The libsodium-style secret key of the sender, 64 bytes. Can also be passed as a 32-byte seed. - // Used to decrypt the encrypted content. This field is used if `use_group_keys` is false in - // which case the group keys are ignored. This is for envelopes where the envelope itself is - // unencrypted and the contents is encrypted for this secret key. - std::span recipient_ed25519_privkey; + // Set the key to decrypt the envelope. If this key is set then it's assumed that the envelope + // payload is encrypted (e.g. groups v2) and that the contents are unencrypted. If this key is + // not set the it's assumed the envelope is not encrypted but the contents are encrypted (e.g.: + // 1o1 or legacy group). + std::optional> group_ed25519_pubkey; + + // List of libsodium-style secret key to decrypt the envelope from. Can also be passed as a 32 + // byte secret key. The public key component is not used. + // + // If the `group_ed25519_pubkey` is set then a list of keys is accepted to attempt to decrypt + // the envelope. For envelopes generated by a group message, we assume that the envelope is + // encrypted and must be decrypted by the group keys associated with it (of which there may be + // many candidate keys depending on how many times the group has been rekeyed). It's recommended + // to pass `Keys::group_keys()` or in the C API use the `groups_keys_size` and + // `group_keys_get_key` combo to retrieve the keys to attempt to use to decrypt this message. + // + // If `group_ed25519_pubkey` is _not_ set then this function assumes the envelope is unencrypted + // but the content is encrypted (e.g.: 1o1 and legacy group messages). The function will attempt + // to decrypt the envelope's contents with the given keys. Typically in these cases you will + // pass exactly 1 key for decryption but this function makes no pre-existing assumptions on the + // number of keys and will attempt all given keys specified regardless until it finds one that + // successfully decrypts the envelope contents. + std::span> ed25519_privkeys; }; struct EncryptedForDestination { diff --git a/include/session/types.h b/include/session/types.h index fa6b8872..db1db396 100644 --- a/include/session/types.h +++ b/include/session/types.h @@ -13,14 +13,6 @@ struct span_u8 { size_t size; }; -struct bytes32 { - uint8_t data[32]; -}; - -struct bytes64 { - uint8_t data[64]; -}; - /// Create a span of bytes that owns the `size` bytes of memory requested. If allocation fails, this /// function throws a runtime exception. The `data` pointer is span must be freed once the span /// is no longer needed. diff --git a/src/config/groups/keys.cpp b/src/config/groups/keys.cpp index dd2eca4d..a2dee3ef 100644 --- a/src/config/groups/keys.cpp +++ b/src/config/groups/keys.cpp @@ -1211,15 +1211,16 @@ std::vector Keys::encrypt_message( std::pair> Keys::decrypt_message( std::span ciphertext) const { assert(_sign_pk); - std::pair> result; // // Decrypt, using all the possible keys, starting with a pending one (if we have one) // + DecryptGroupMessage decrypt = {}; bool decrypt_success = false; if (auto pending = pending_key(); pending) { try { - result = decrypt_group_message(*pending, *_sign_pk, ciphertext); + std::span> key_list = {&(*pending), 1}; + decrypt = decrypt_group_message(key_list, *_sign_pk, ciphertext); decrypt_success = true; } catch (const std::exception&) { } @@ -1228,7 +1229,9 @@ std::pair> Keys::decrypt_message( if (!decrypt_success) { for (auto& k : keys_) { try { - result = decrypt_group_message(k.key, *_sign_pk, ciphertext); + std::span key = {k.key.data(), k.key.size()}; + std::span> key_list = {&key, 1}; + decrypt = decrypt_group_message(key_list, *_sign_pk, ciphertext); decrypt_success = true; break; } catch (const std::exception&) { @@ -1238,6 +1241,11 @@ std::pair> Keys::decrypt_message( if (!decrypt_success) // none of the keys worked throw std::runtime_error{"unable to decrypt ciphertext with any current group keys"}; + + + std::pair> result; + result.first = std::move(decrypt.session_id); + result.second = std::move(decrypt.plaintext); return result; } @@ -1348,13 +1356,26 @@ LIBSESSION_C_API size_t groups_keys_size(const config_group_keys* conf) { return unbox(conf).size(); } -LIBSESSION_C_API const unsigned char* group_keys_get_key(const config_group_keys* conf, size_t N) { +LIBSESSION_C_API const unsigned char* groups_keys_get_key(const config_group_keys* conf, size_t N) { auto keys = unbox(conf).group_keys(); if (N >= keys.size()) return nullptr; return keys[N].data(); } +LIBSESSION_C_API const span_u8 groups_keys_group_enc_key(const config_group_keys* conf) +{ + span_u8 result = {}; + try { + std::span key = unbox(conf).group_enc_key(); + result.data = const_cast(key.data()); + result.size = key.size(); + assert(result.size == 32); + } catch (const std::exception& e) { + } + return result; +} + LIBSESSION_C_API bool groups_keys_is_admin(const config_group_keys* conf) { return unbox(conf).admin(); } diff --git a/src/session_encrypt.cpp b/src/session_encrypt.cpp index 1614693e..dc234d25 100644 --- a/src/session_encrypt.cpp +++ b/src/session_encrypt.cpp @@ -678,14 +678,13 @@ std::pair, std::string> decrypt_from_blinded_recipien return result; } -std::pair> decrypt_group_message( - std::span decrypt_ed25519_privkey, +DecryptGroupMessage decrypt_group_message( + std::span> decrypt_ed25519_privkey_list, std::span group_ed25519_pubkey, std::span ciphertext) { + DecryptGroupMessage result = {}; if (ciphertext.size() < GROUPS_ENCRYPT_OVERHEAD) throw std::runtime_error{"ciphertext is too small to be encrypted data"}; - if (decrypt_ed25519_privkey.size() != 32 && decrypt_ed25519_privkey.size() != 64) - throw std::invalid_argument{"Invalid decrypt_ed25519_privkey: expected 32 or 64 bytes"}; if (group_ed25519_pubkey.size() != crypto_sign_ed25519_PUBLICKEYBYTES) throw std::invalid_argument{"Invalid decrypt_ed25519_privkey: expected 32 bytes"}; @@ -699,17 +698,27 @@ std::pair> decrypt_group_message( ciphertext = ciphertext.subspan(crypto_aead_xchacha20poly1305_ietf_NPUBBYTES); plain.resize(ciphertext.size() - crypto_aead_xchacha20poly1305_ietf_ABYTES); - // Decrypt using specific key - bool decrypt_success = 0 == crypto_aead_xchacha20poly1305_ietf_decrypt( - plain.data(), - nullptr, - nullptr, - ciphertext.data(), - ciphertext.size(), - nullptr, - 0, - nonce.data(), - decrypt_ed25519_privkey.data()); + bool decrypt_success = false; + for (size_t index = 0; index < decrypt_ed25519_privkey_list.size(); index++) { + const auto& decrypt_ed25519_privkey = decrypt_ed25519_privkey_list[index]; + if (decrypt_ed25519_privkey.size() != 32 && decrypt_ed25519_privkey.size() != 64) + throw std::invalid_argument{"Invalid decrypt_ed25519_privkey: expected 32 or 64 bytes"}; + decrypt_success = 0 == crypto_aead_xchacha20poly1305_ietf_decrypt( + plain.data(), + nullptr, + nullptr, + ciphertext.data(), + ciphertext.size(), + nullptr, + 0, + nonce.data(), + decrypt_ed25519_privkey.data()); + if (decrypt_success) { + result.index = index; + break; + } + } + if (!decrypt_success) // none of the keys worked throw std::runtime_error{"unable to decrypt ciphertext with any current group keys"}; @@ -748,8 +757,7 @@ std::pair> decrypt_group_message( throw std::runtime_error{ "author ed25519 pubkey is invalid (unable to convert it to a session id)"}; - std::pair> result; - auto& [session_id, data] = result; + auto& [_, session_id, data] = result; session_id.reserve(66); session_id += "05"; oxenc::to_hex(x_pk.begin(), x_pk.end(), std::back_inserter(session_id)); @@ -1098,6 +1106,36 @@ LIBSESSION_C_API bool session_encrypt_for_blinded_recipient( } } +LIBSESSION_C_API session_encrypt_group_message session_encrypt_for_group( + const unsigned char *user_ed25519_privkey, + size_t user_ed25519_privkey_len, + const unsigned char *group_ed25519_pubkey, + size_t group_ed25519_pubkey_len, + const unsigned char *group_ed25519_privkey, + size_t group_ed25519_privkey_len, + const unsigned char *plaintext, + size_t plaintext_len, + bool compress, + size_t padding) +{ + session_encrypt_group_message result = {}; + try { + std::vector result_cpp = encrypt_for_group( + {user_ed25519_privkey, user_ed25519_privkey_len}, + {group_ed25519_pubkey, group_ed25519_pubkey_len}, + {group_ed25519_privkey, group_ed25519_privkey_len}, + {plaintext, plaintext_len}, + compress, + padding); + result = { + .success = true, + .ciphertext = span_u8_copy_or_throw(result_cpp.data(), result_cpp.size()), + }; + } catch(...) { + } + return result; +} + LIBSESSION_C_API bool session_decrypt_incoming( const unsigned char* ciphertext_in, size_t ciphertext_len, @@ -1175,6 +1213,39 @@ LIBSESSION_C_API bool session_decrypt_for_blinded_recipient( } } +LIBSESSION_C_API session_decrypt_group_message_result session_decrypt_group_message( + const span_u8 *decrypt_ed25519_privkey_list, + size_t decrypt_ed25519_privkey_len, + const unsigned char *group_ed25519_pubkey, + size_t group_ed25519_pubkey_len, + const unsigned char *ciphertext, + size_t ciphertext_len) +{ + session_decrypt_group_message_result result = {}; + for (size_t index = 0; index < decrypt_ed25519_privkey_len; index++) { + std::span key = { + decrypt_ed25519_privkey_list[index].data, decrypt_ed25519_privkey_list[index].size}; + + DecryptGroupMessage result_cpp = {}; + try { + result_cpp = decrypt_group_message( + {&key, 1}, + {group_ed25519_pubkey, group_ed25519_pubkey_len}, + {ciphertext, ciphertext_len}); + result = { + .success = true, + .index = index, + .plaintext = span_u8_copy_or_throw(result.plaintext.data, result.plaintext.size), + }; + assert(result_cpp.session_id.size() == sizeof(result.session_id)); + std::memcpy(result.session_id, result_cpp.session_id.data(), sizeof(result.session_id)); + break; + } catch (...) { + } + } + return result; +} + LIBSESSION_C_API bool session_decrypt_ons_response( const char* name_in, const unsigned char* ciphertext_in, diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index f8db66ad..bf7d5e1d 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -52,7 +53,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( std::chrono::milliseconds dest_sent_timestamp_ms, std::span dest_open_group_inbox_server_pubkey, std::span dest_closed_group_pubkey, - const config::groups::Keys* dest_closed_group_keys, + std::span dest_closed_group_ed25519_privkey, config::Namespace space, UseMalloc use_malloc) { @@ -60,6 +61,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( assert(dest_recipient_pubkey.size() == 1 + crypto_sign_ed25519_PUBLICKEYBYTES); assert(dest_open_group_inbox_server_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); assert(dest_closed_group_pubkey.size() == 1 + crypto_sign_ed25519_PUBLICKEYBYTES); + assert(dest_closed_group_ed25519_privkey.size() == 32 || dest_closed_group_ed25519_privkey.size() == 64); // All incoming arguments are passed in from typed, fixed-sized arrays so we do not need to // throw if these sizes are wrong. It being wrong would be a development error. @@ -104,10 +106,6 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( dest_closed_group_pubkey[0] == static_cast(SessionIDPrefix::group); if (has_03_prefix) { if (space == config::Namespace::GroupMessages) { - if (!dest_closed_group_keys) - throw std::runtime_error( - "API misuse: Sending to a closed group into the group messages " - "namespace requires the closed group keys to be set"); enc.mode = Mode::Envelope; enc.before_envelope_encrypt_for_recipient_deterministic = false; enc.after_envelope = AfterEnvelope::KeysEncryptMessage; @@ -224,13 +222,15 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( } break; case AfterEnvelope::KeysEncryptMessage: { - assert(dest_closed_group_keys && - "Dev error, API miuse was not detected. We should throw an exception " - "when this happens earlier"); - std::string bytes = envelope.SerializeAsString(); - std::vector ciphertext = - dest_closed_group_keys->encrypt_message(to_span(bytes)); + std::vector ciphertext = encrypt_for_group( + ed25519_privkey, + dest_closed_group_pubkey, + dest_closed_group_ed25519_privkey, + to_span(bytes), + /*compress*/ true, + /*padding*/ 256); + if (use_malloc == UseMalloc::Yes) { result.ciphertext_c = span_u8_copy_or_throw(ciphertext.data(), ciphertext.size()); @@ -291,8 +291,8 @@ EncryptedForDestination encrypt_for_destination( /*dest_recipient_pubkey=*/dest.recipient_pubkey, /*dest_sent_timestamp_ms=*/dest.sent_timestamp_ms, /*dest_open_group_inbox_server_pubkey=*/dest.open_group_inbox_server_pubkey, - /*dest_closed_group_pubkey=*/dest.closed_group_pubkey, - /*dest_closed_group_keys=*/dest.closed_group_keys, + /*dest_closed_group_ed25519_pubkey=*/dest.closed_group_ed25519_pubkey, + /*dest_closed_group_ed25519_privkey=*/dest.closed_group_ed25519_privkey, /*space=*/space, /*use_malloc=*/UseMalloc::No); @@ -316,29 +316,26 @@ DecryptedEnvelope decrypt_envelope( // provided. We will decrypt the payload to get the plaintext. In all other cases, the envelope // is assumed to be unencrypted and can be used verbatim. std::vector envelope_plaintext_from_group_keys; - if (keys.use_group_keys) { - if (!keys.group_keys) - throw std::runtime_error( - "API misuse: Envelope decryption with group keys was requested but no key was " - "set"); - - // Decrypt - std::string sender_x25519_pubkey; - std::tie(sender_x25519_pubkey, envelope_plaintext_from_group_keys) = - keys.group_keys->decrypt_message(envelope_plaintext); - if (sender_x25519_pubkey.size() != crypto_sign_ed25519_PUBLICKEYBYTES) + if (keys.group_ed25519_pubkey) { + // Decrypt using the keys + DecryptGroupMessage decrypt = decrypt_group_message( + keys.ed25519_privkeys, *keys.group_ed25519_pubkey, envelope_plaintext); + + if (decrypt.session_id.size() != ((crypto_sign_ed25519_PUBLICKEYBYTES + 1) * 2)) throw std::runtime_error{fmt::format( - "Parse encrypted envelope failed, extracted x25519 pubkey was wrong size: {}", - sender_x25519_pubkey.size())}; + "Parse encrypted envelope failed, extracted session ID was wrong size: " + "{}", + decrypt.session_id.size())}; // Update the plaintext to use the decrypted envelope - envelope_plaintext = envelope_plaintext_from_group_keys; // Update the plaintext + envelope_plaintext = std::move(decrypt.plaintext); // Copy keys out - std::memcpy( - result.sender_x25519_pubkey.data(), - sender_x25519_pubkey.data(), - sender_x25519_pubkey.size()); + assert(decrypt.session_id.starts_with("05")); + oxenc::from_hex( + decrypt.session_id.begin() + 2, + decrypt.session_id.end() - 2, + result.sender_x25519_pubkey.begin()); } if (!envelope.ParseFromArray(envelope_plaintext.data(), envelope_plaintext.size())) @@ -389,12 +386,33 @@ DecryptedEnvelope decrypt_envelope( // Decrypt content // The envelope is encrypted in GroupsV2, contents unencrypted. In 1o1 and legacy groups, the // envelope is encrypted, contents is encrypted. - bool has_encrypted_content = !keys.use_group_keys; - if (has_encrypted_content) { + if (keys.group_ed25519_pubkey) { + result.content_plaintext.resize(envelope.content().size()); + std::memcpy( + result.content_plaintext.data(), + envelope.content().data(), + envelope.content().size()); + } else { std::span content_str = session::to_span(envelope.content()); - auto [content_plaintext, sender_ed25519_pubkey] = - session::decrypt_incoming(keys.recipient_ed25519_privkey, content_str); - assert(result.sender_ed25519_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); + bool decrypt_success = false; + std::vector content_plaintext; + std::vector sender_ed25519_pubkey; + for (const auto& privkey_it : keys.ed25519_privkeys) { + try { + std::tie(content_plaintext, sender_ed25519_pubkey) = + session::decrypt_incoming(privkey_it, content_str); + assert(result.sender_ed25519_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); + decrypt_success = true; + break; + } catch (const std::exception& e) { + } + } + + if (!decrypt_success) { + throw std::runtime_error{fmt::format( + "Envelope content decryption failed, tried {} key(s)", + keys.ed25519_privkeys.size())}; + } result.content_plaintext = std::move(content_plaintext); std::memcpy( @@ -403,16 +421,12 @@ DecryptedEnvelope decrypt_envelope( result.sender_ed25519_pubkey.size()); if (crypto_sign_ed25519_pk_to_curve25519( - result.sender_x25519_pubkey.data(), result.sender_ed25519_pubkey.data()) != 0) + result.sender_x25519_pubkey.data(), result.sender_ed25519_pubkey.data()) != + 0) throw std::runtime_error( - "Parse content failed, ed25519 public key could not be converted to x25519 " + "Parse content failed, ed25519 public key could not be converted to " + "x25519 " "key."); - } else { - result.content_plaintext.resize(envelope.content().size()); - std::memcpy( - result.content_plaintext.data(), - envelope.content().data(), - envelope.content().size()); } // TODO: We parse the content in libsession to extract pro metadata but we return the unparsed @@ -532,9 +546,8 @@ session_protocol_encrypt_for_destination( /*dest_recipient_pubkey=*/dest->recipient_pubkey, /*dest_sent_timestamp_ms=*/std::chrono::milliseconds(dest->sent_timestamp_ms), /*dest_open_group_inbox_server_pubkey=*/dest->open_group_inbox_server_pubkey, - /*dest_closed_group_pubkey=*/dest->closed_group_pubkey, - /*dest_closed_group_keys=*/ - static_cast(dest->closed_group_keys->internals), + /*dest_closed_group_ed25519_pubkey=*/dest->closed_group_ed25519_pubkey, + /*dest_closed_group_ed25519_privkey=*/dest->closed_group_ed25519_privkey, /*space=*/static_cast(space), /*use_malloc=*/UseMalloc::Yes); @@ -565,22 +578,30 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( return result; std::memcpy(pro_backend_pubkey_cpp.data(), pro_backend_pubkey, pro_backend_pubkey_len); - try { - // Setup decryption keys and decrypt - DecryptEnvelopeKey keys_cpp = { - .use_group_keys = keys->use_group_keys, - .group_keys = - reinterpret_cast(keys->group_keys->internals), - .recipient_ed25519_privkey = { - static_cast(keys->recipient_ed25519_privkey), - keys->recipient_ed25519_privkey_len}}; - - DecryptedEnvelope result_cpp = decrypt_envelope( - keys_cpp, - {static_cast(envelope_plaintext), envelope_plaintext_len}, - std::chrono::sys_seconds(std::chrono::seconds(unix_ts)), - pro_backend_pubkey_cpp); + // Setup decryption keys and decrypt + DecryptEnvelopeKey keys_cpp = {}; + if (keys->group_ed25519_pubkey.size) { + keys_cpp.group_ed25519_pubkey = std::span( + keys->group_ed25519_pubkey.data, keys->group_ed25519_pubkey.size); + } + DecryptedEnvelope result_cpp = {}; + for (size_t index = 0; index < keys->ed25519_privkeys_len; index++) { + std::span key = { + keys->ed25519_privkeys[index].data, keys->ed25519_privkeys[index].size}; + keys_cpp.ed25519_privkeys = {&key, 1}; + try { + result_cpp = decrypt_envelope( + keys_cpp, + {static_cast(envelope_plaintext), envelope_plaintext_len}, + std::chrono::sys_seconds(std::chrono::seconds(unix_ts)), + pro_backend_pubkey_cpp); + break; + } catch (...) { + } + } + + try { // Marshall into c type result = { .success = false, diff --git a/tests/test_session_protocol.cpp b/tests/test_session_protocol.cpp index 2a1334a2..f9ff4df2 100644 --- a/tests/test_session_protocol.cpp +++ b/tests/test_session_protocol.cpp @@ -171,9 +171,9 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { } // Decrypt envelope + std::span key = keys.ed_sk1; DecryptEnvelopeKey decrypt_keys = {}; - decrypt_keys.use_group_keys = false; - decrypt_keys.recipient_ed25519_privkey = keys.ed_sk1; + decrypt_keys.ed25519_privkeys = {&key, 1}; DecryptedEnvelope decrypt_result = session::decrypt_envelope( decrypt_keys, encrypt_result.ciphertext, timestamp_s, pro_backend_ed_pk); @@ -274,9 +274,9 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { } // Decrypt envelope + std::span key = keys.ed_sk1; DecryptEnvelopeKey decrypt_keys = {}; - decrypt_keys.use_group_keys = false; - decrypt_keys.recipient_ed25519_privkey = keys.ed_sk1; + decrypt_keys.ed25519_privkeys = {&key, 1}; DecryptedEnvelope decrypt_result = session::decrypt_envelope( decrypt_keys, encrypt_result.ciphertext, timestamp_s, pro_backend_ed_pk); @@ -327,9 +327,9 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { } // Decrypt envelope + std::span key = keys.ed_sk1; DecryptEnvelopeKey decrypt_keys = {}; - decrypt_keys.use_group_keys = false; - decrypt_keys.recipient_ed25519_privkey = keys.ed_sk1; + decrypt_keys.ed25519_privkeys = {&key, 1}; DecryptedEnvelope decrypt_result = session::decrypt_envelope( decrypt_keys, encrypt_result.ciphertext, timestamp_s, pro_backend_ed_pk); @@ -374,9 +374,9 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { REQUIRE(ws_msg.request().has_body()); // Decrypt envelope + std::span key = keys.ed_sk1; DecryptEnvelopeKey decrypt_keys = {}; - decrypt_keys.use_group_keys = false; - decrypt_keys.recipient_ed25519_privkey = keys.ed_sk1; + decrypt_keys.ed25519_privkeys = {&key, 1}; DecryptedEnvelope decrypt_result = session::decrypt_envelope( decrypt_keys, to_span(ws_msg.request().body()), timestamp_s, pro_backend_ed_pk); @@ -458,9 +458,9 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { } // Decrypt envelope + std::span key = keys.ed_sk1; DecryptEnvelopeKey decrypt_keys = {}; - decrypt_keys.use_group_keys = false; - decrypt_keys.recipient_ed25519_privkey = keys.ed_sk1; + decrypt_keys.ed25519_privkeys = {&key, 1}; DecryptedEnvelope decrypt_result = session::decrypt_envelope( decrypt_keys, encrypt_result.ciphertext, timestamp_s, pro_backend_ed_pk); @@ -485,16 +485,6 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { pro_backend_ed_pk); REQUIRE(decrypt_result_again.pro_status == ProStatus::Expired); - // Try decrypt with bad key (ed_sk0 which was the sender; ed_sk1 the recipient) - DecryptEnvelopeKey bad_decrypt_keys = {}; - bad_decrypt_keys.use_group_keys = false; - bad_decrypt_keys.recipient_ed25519_privkey = keys.ed_sk0; - CHECK_THROWS(session::decrypt_envelope( - bad_decrypt_keys, - encrypt_result.ciphertext, - protobuf_content_with_pro.proof.expiry_unix_ts, - pro_backend_ed_pk)); - // Try decrypt with a bad backend key array_uc32 bad_pro_backend_ed_pk = pro_backend_ed_pk; bad_pro_backend_ed_pk[0] ^= 1; @@ -504,6 +494,28 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { protobuf_content_with_pro.proof.expiry_unix_ts, bad_pro_backend_ed_pk); REQUIRE(decrypt_result_again.pro_status == ProStatus::InvalidProBackendSig); + + // Try decrypt with bad key (ed_sk0 which was the sender; ed_sk1 the recipient) + std::span bad_key = keys.ed_sk0; + DecryptEnvelopeKey bad_decrypt_keys = {}; + decrypt_keys.ed25519_privkeys = {&bad_key, 1}; + REQUIRE_THROWS( + session::decrypt_envelope( + bad_decrypt_keys, + encrypt_result.ciphertext, + protobuf_content_with_pro.proof.expiry_unix_ts, + pro_backend_ed_pk)); + + // Try decrypt with multiple keys, 1 bad, 1 good key + auto key_list = std::array{bad_key, key}; + DecryptEnvelopeKey multi_decrypt_keys = {}; + multi_decrypt_keys.ed25519_privkeys = key_list; + decrypt_result_again = session::decrypt_envelope( + multi_decrypt_keys, + encrypt_result.ciphertext, + protobuf_content_with_pro.proof.expiry_unix_ts, + pro_backend_ed_pk); + REQUIRE(decrypt_result_again.pro_status == ProStatus::Valid); } SECTION("Encrypt/decrypt for sync messages with Pro and bad rotating signature") { @@ -520,9 +532,9 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { REQUIRE(encrypt_result.encrypted); } + std::span key = keys.ed_sk1; DecryptEnvelopeKey decrypt_keys = {}; - decrypt_keys.use_group_keys = false; - decrypt_keys.recipient_ed25519_privkey = keys.ed_sk1; + decrypt_keys.ed25519_privkeys = {&key, 1}; DecryptedEnvelope decrypt_result = session::decrypt_envelope( decrypt_keys, encrypt_result.ciphertext, timestamp_s, pro_backend_ed_pk); REQUIRE(decrypt_result.pro_status == ProStatus::InvalidUserSig); From e36c6e5a782ce1ceea11af53494305aed5d3bccd Mon Sep 17 00:00:00 2001 From: doylet Date: Mon, 18 Aug 2025 21:56:47 +1000 Subject: [PATCH 33/59] Update nomenclamenture, Closed/OpenGroup to Group/Community respectively --- include/session/blinding.h | 10 +-- include/session/config/base.hpp | 2 +- .../session/config/convo_info_volatile.hpp | 4 +- include/session/config/groups/info.hpp | 6 +- include/session/config/groups/keys.h | 2 +- include/session/config/namespaces.h | 4 +- include/session/config/namespaces.hpp | 2 +- include/session/config/user_groups.hpp | 10 +-- include/session/session_encrypt.h | 34 ++++----- include/session/session_encrypt.hpp | 6 +- include/session/session_protocol.h | 14 ++-- include/session/session_protocol.hpp | 34 ++++----- proto/SessionProtos.proto | 4 +- src/config/groups/keys.cpp | 6 +- src/config/internal.hpp | 2 +- src/session_encrypt.cpp | 76 ++++++++++--------- src/session_protocol.cpp | 47 ++++++------ src/util.cpp | 3 +- tests/test_config_convo_info_volatile.cpp | 12 +-- tests/test_config_user_groups.cpp | 14 ++-- tests/test_session_protocol.cpp | 37 +++++---- 21 files changed, 166 insertions(+), 163 deletions(-) diff --git a/include/session/blinding.h b/include/session/blinding.h index e3724883..aa689e35 100644 --- a/include/session/blinding.h +++ b/include/session/blinding.h @@ -15,7 +15,7 @@ extern "C" { /// /// Inputs: /// - `ed25519_seckey` -- [in] the Ed25519 private key of the sender (64 bytes). -/// - `server_pk` -- [in] the public key of the open group server to generate the +/// - `server_pk` -- [in] the public key of the community server to generate the /// blinded id for (32 bytes). /// - `blinded_pk_out` -- [out] pointer to a buffer of at least 32 bytes where the blinded_pk will /// be written if generation was successful. @@ -36,7 +36,7 @@ LIBSESSION_EXPORT bool session_blind15_key_pair( /// /// Inputs: /// - `ed25519_seckey` -- [in] the Ed25519 private key of the sender (64 bytes). -/// - `server_pk` -- [in] the public key of the open group server to generate the +/// - `server_pk` -- [in] the public key of the community server to generate the /// blinded id for (32 bytes). /// - `blinded_pk_out` -- [out] pointer to a buffer of at least 32 bytes where the blinded_pk will /// be written if generation was successful. @@ -75,7 +75,7 @@ LIBSESSION_EXPORT bool session_blind_version_key_pair( /// /// Inputs: /// - `ed25519_seckey` -- [in] the Ed25519 private key of the sender (64 bytes). -/// - `server_pk` -- [in] the public key of the open group server to generate the +/// - `server_pk` -- [in] the public key of the community server to generate the /// blinded id for (32 bytes). /// - `msg` -- [in] Pointer to a data buffer containing the message to generate a signature for. /// - `msg_len` -- [in] Length of `msg` @@ -97,7 +97,7 @@ LIBSESSION_EXPORT bool session_blind15_sign( /// /// Inputs: /// - `ed25519_seckey` -- [in] the Ed25519 private key of the sender (64 bytes). -/// - `server_pk` -- [in] the public key of the open group server to generate the +/// - `server_pk` -- [in] the public key of the community server to generate the /// blinded id for (32 bytes). /// - `msg` -- [in] Pointer to a data buffer containing the message to generate a signature for. /// - `msg_len` -- [in] Length of `msg` @@ -145,7 +145,7 @@ LIBSESSION_EXPORT bool session_blind_version_sign( /// Inputs: /// - `session_id` -- [in] the session_id to compare (66 bytes with a 05 prefix). /// - `blinded_id` -- [in] the blinded_id to compare, can be either 15 or 25 blinded (66 bytes). -/// - `server_pk` -- [in] the public key of the open group server to the blinded id came from (64 +/// - `server_pk` -- [in] the public key of the community server to the blinded id came from (64 /// bytes). /// /// Outputs: diff --git a/include/session/config/base.hpp b/include/session/config/base.hpp index f1be01f4..64bb7b06 100644 --- a/include/session/config/base.hpp +++ b/include/session/config/base.hpp @@ -944,7 +944,7 @@ class ConfigBase : public ConfigSig { /// API: base/ConfigBase::load_key /// /// Called to load an ed25519 key for encryption; this is meant for use by single-ownership - /// config types, like UserProfile, but not shared config types (closed groups). + /// config types, like UserProfile, but not shared config types (groups). /// /// Takes a binary string which is either the 32-byte seed, or 64-byte libsodium secret (which /// is just the seed and pubkey concatenated together), and then calls `key(...)` with the seed. diff --git a/include/session/config/convo_info_volatile.hpp b/include/session/config/convo_info_volatile.hpp index 25cece37..3b0f75ee 100644 --- a/include/session/config/convo_info_volatile.hpp +++ b/include/session/config/convo_info_volatile.hpp @@ -44,13 +44,13 @@ class val_loader; /// included, but will be 0 if no messages are read. /// u - will be present and set to 1 if this conversation is specifically marked unread. /// -/// g - group conversations (aka new, non-legacy closed groups). The key is the group identifier +/// g - group conversations (aka new, non-legacy groups). The key is the group identifier /// (beginning with 03). Values are dicts with keys: /// r - the unix timestamp (in integer milliseconds) of the last-read message. Always /// included, but will be 0 if no messages are read. /// u - will be present and set to 1 if this conversation is specifically marked unread. /// -/// C - legacy group conversations (aka closed groups). The key is the group identifier (which +/// C - legacy group conversations (aka groups). The key is the group identifier (which /// looks indistinguishable from a Session ID, but isn't really a proper Session ID). Values /// are dicts with keys: /// r - the unix timestamp (integer milliseconds) of the last-read message. Always included, diff --git a/include/session/config/groups/info.hpp b/include/session/config/groups/info.hpp index 64c2e48f..66c0149c 100644 --- a/include/session/config/groups/info.hpp +++ b/include/session/config/groups/info.hpp @@ -236,7 +236,7 @@ class Info : public ConfigBase { /// API: groups/Info::set_delete_before /// /// Sets a "delete before" unix timestamp: this instructs clients to delete all messages from - /// the closed group history with a timestamp earlier than this value. Returns nullopt if no + /// the group history with a timestamp earlier than this value. Returns nullopt if no /// delete-before timestamp is set. /// /// The given value is checked for sanity (e.g. if you pass milliseconds it will be @@ -250,7 +250,7 @@ class Info : public ConfigBase { /// API: groups/Info::get_delete_before /// /// Returns the delete-before unix timestamp (seconds) for the group; clients should delete all - /// messages from the closed group with timestamps earlier than this value, if set. + /// messages from the group with timestamps earlier than this value, if set. /// /// Returns std::nullopt if no delete-before timestamp is set. /// @@ -279,7 +279,7 @@ class Info : public ConfigBase { /// API: groups/Info::get_delete_attach_before /// /// Returns the delete-attachments-before unix timestamp (seconds) for the group; clients should - /// delete all messages from the closed group with timestamps earlier than this value, if set. + /// delete all messages from the group with timestamps earlier than this value, if set. /// /// Returns std::nullopt if no delete-attachments-before timestamp is set. /// diff --git a/include/session/config/groups/keys.h b/include/session/config/groups/keys.h index fbc34a0d..102436b1 100644 --- a/include/session/config/groups/keys.h +++ b/include/session/config/groups/keys.h @@ -4,9 +4,9 @@ extern "C" { #endif +#include "../../types.h" #include "../base.h" #include "../util.h" -#include "../../types.h" // This is an opaque type analagous to `config_object` but specific to the groups keys object. // diff --git a/include/session/config/namespaces.h b/include/session/config/namespaces.h index ea875195..b9670323 100644 --- a/include/session/config/namespaces.h +++ b/include/session/config/namespaces.h @@ -5,7 +5,7 @@ extern "C" { #endif typedef enum NAMESPACE { - // Messages sent to an updated closed group which should be able to be retrieved by revoked + // Messages sent to an updated group which should be able to be retrieved by revoked // members are stored in this namespace NAMESPACE_REVOKED_RETRIEVABLE_GROUP_MESSAGES = -11, @@ -16,7 +16,7 @@ typedef enum NAMESPACE { NAMESPACE_CONVO_INFO_VOLATILE = 4, NAMESPACE_USER_GROUPS = 5, - // Messages sent to a closed group: + // Messages sent to a group: NAMESPACE_GROUP_MESSAGES = 11, // Groups config namespaces (i.e. for shared config of the group itself, not one user's group // settings) diff --git a/include/session/config/namespaces.hpp b/include/session/config/namespaces.hpp index 680f780a..6945f70a 100644 --- a/include/session/config/namespaces.hpp +++ b/include/session/config/namespaces.hpp @@ -16,7 +16,7 @@ enum class Namespace : std::int16_t { ConvoInfoVolatile = NAMESPACE_CONVO_INFO_VOLATILE, UserGroups = NAMESPACE_USER_GROUPS, - // Messages sent to a closed group: + // Messages sent to a group: GroupMessages = NAMESPACE_GROUP_MESSAGES, // Groups config namespaces (i.e. for shared config of the group itself, not one user's group // settings) diff --git a/include/session/config/user_groups.hpp b/include/session/config/user_groups.hpp index 55febbc9..8a60913b 100644 --- a/include/session/config/user_groups.hpp +++ b/include/session/config/user_groups.hpp @@ -88,8 +88,8 @@ struct base_group_info { notify_mode notifications = notify_mode::defaulted; // When the user wants notifications int64_t mute_until = 0; // unix timestamp (seconds) until which notifications are disabled - std::string name; // human-readable; always set for a legacy closed group, only used before - // joining a new closed group (after joining the group info provide the name) + std::string name; // human-readable; always set for a legacy group, only used before + // joining a new group (after joining the group info provide the name) bool invited = false; // True if this is currently in the invite-but-not-accepted state. @@ -97,7 +97,7 @@ struct base_group_info { void load(const dict& info_dict); }; -/// Struct containing legacy group info (aka "closed groups"). +/// Struct containing legacy group info (aka "groups"). struct legacy_group_info : base_group_info { std::string session_id; // The legacy group "session id" (33 bytes). std::vector enc_pubkey; // bytes (32 or empty) @@ -185,7 +185,7 @@ struct legacy_group_info : base_group_info { constexpr int NOT_REMOVED = 0, KICKED_FROM_GROUP = 1, GROUP_DESTROYED = 2; -/// Struct containing new group info (aka "closed groups v2"). +/// Struct containing new group info (aka "groups v2"). struct group_info : base_group_info { std::string id; // The group pubkey (66 hex digits); this is an ed25519 key, prefixed with "03" // (to distinguish it from a 05 x25519 pubkey session id). @@ -344,7 +344,7 @@ class UserGroups : public ConfigBase { /// API: user_groups/UserGroups::get_group /// - /// Looks up and returns a group (aka new closed group) by group ID (hex, looks like a Session + /// Looks up and returns a group (aka new group) by group ID (hex, looks like a Session /// ID but starting with 03). Returns nullopt if the group was not found, otherwise returns a /// filled out `group_info`. /// diff --git a/include/session/session_encrypt.h b/include/session/session_encrypt.h index eccadc12..758ab857 100644 --- a/include/session/session_encrypt.h +++ b/include/session/session_encrypt.h @@ -45,7 +45,7 @@ LIBSESSION_EXPORT bool session_encrypt_for_recipient_deterministic( /// - `plaintext_in` -- [in] Pointer to a data buffer containing the encrypted data. /// - `plaintext_len` -- [in] Length of `plaintext_in` /// - `ed25519_privkey` -- [in] the Ed25519 private key of the sender (64 bytes). -/// - `open_group_pubkey` -- [in] the public key of the open group server to route +/// - `community_pubkey` -- [in] the public key of the community server to route /// the blinded message through (32 bytes). /// - `recipient_blinded_id` -- [in] the blinded id of the recipient including the blinding /// prefix (33 bytes), 'blind15' or 'blind25' encryption will be chosed based on this value. @@ -63,7 +63,7 @@ LIBSESSION_EXPORT bool session_encrypt_for_blinded_recipient( const unsigned char* plaintext_in, size_t plaintext_len, const unsigned char* ed25519_privkey, /* 64 bytes */ - const unsigned char* open_group_pubkey, /* 32 bytes */ + const unsigned char* community_pubkey, /* 32 bytes */ const unsigned char* recipient_blinded_id, /* 33 bytes */ unsigned char** ciphertext_out, size_t* ciphertext_len); @@ -104,13 +104,13 @@ typedef struct { /// Outputs: /// - `ciphertext` -- the encrypted, etc. value to send to the swarm LIBSESSION_EXPORT session_encrypt_group_message session_encrypt_for_group( - const unsigned char *user_ed25519_privkey, + const unsigned char* user_ed25519_privkey, size_t user_ed25519_privkey_len, - const unsigned char *group_ed25519_pubkey, + const unsigned char* group_ed25519_pubkey, size_t group_ed25519_pubkey_len, - const unsigned char *group_ed25519_privkey, + const unsigned char* group_ed25519_privkey, size_t group_ed25519_privkey_len, - const unsigned char *plaintext, + const unsigned char* plaintext, size_t plaintext_len, bool compress, size_t padding); @@ -183,7 +183,7 @@ LIBSESSION_EXPORT bool session_decrypt_incoming_legacy_group( /// - `ciphertext_in` -- [in] Pointer to a data buffer containing the encrypted data. /// - `ciphertext_len` -- [in] Length of `ciphertext_in` /// - `ed25519_privkey` -- [in] the Ed25519 private key of the receiver (64 bytes). -/// - `open_group_pubkey` -- [in] the public key of the open group server to route +/// - `community_pubkey` -- [in] the public key of the community server to route /// the blinded message through (32 bytes). /// - `sender_id` -- [in] the blinded id of the sender including the blinding prefix (33 bytes), /// 'blind15' or 'blind25' decryption will be chosed based on this value. @@ -206,18 +206,18 @@ LIBSESSION_EXPORT bool session_decrypt_incoming_legacy_group( LIBSESSION_EXPORT bool session_decrypt_for_blinded_recipient( const unsigned char* ciphertext_in, size_t ciphertext_len, - const unsigned char* ed25519_privkey, /* 64 bytes */ - const unsigned char* open_group_pubkey, /* 32 bytes */ - const unsigned char* sender_id, /* 33 bytes */ - const unsigned char* recipient_id, /* 33 bytes */ - char* session_id_out, /* 67 byte output buffer */ + const unsigned char* ed25519_privkey, /* 64 bytes */ + const unsigned char* community_pubkey, /* 32 bytes */ + const unsigned char* sender_id, /* 33 bytes */ + const unsigned char* recipient_id, /* 33 bytes */ + char* session_id_out, /* 67 byte output buffer */ unsigned char** plaintext_out, size_t* plaintext_len); typedef struct { bool success; - size_t index; // Index of the key that successfully decrypted the message - char session_id[66]; // In hex + size_t index; // Index of the key that successfully decrypted the message + char session_id[66]; // In hex span_u8 plaintext; } session_decrypt_group_message_result; @@ -241,11 +241,11 @@ typedef struct { /// The struct with the results of decryption. On failure this sets the `success` boolean to false /// and all fields should be ignored except `success`. session_decrypt_group_message_result session_decrypt_group_message( - const span_u8 *decrypt_ed25519_privkey_list, + const span_u8* decrypt_ed25519_privkey_list, size_t decrypt_ed25519_privkey_len, - const unsigned char *group_ed25519_pubkey, + const unsigned char* group_ed25519_pubkey, size_t group_ed25519_pubkey_len, - const unsigned char *ciphertext, + const unsigned char* ciphertext, size_t ciphertext_len); /// API: crypto/session_decrypt_ons_response diff --git a/include/session/session_encrypt.hpp b/include/session/session_encrypt.hpp index d5e21f48..f3415e09 100644 --- a/include/session/session_encrypt.hpp +++ b/include/session/session_encrypt.hpp @@ -303,7 +303,7 @@ std::pair, std::string> decrypt_incoming_session_id( /// 64-byte /// libsodium secret key. The latter is a bit faster as it doesn't have to re-compute the pubkey /// from the seed. -/// - `server_pk` -- the public key of the open group server to route the blinded message through +/// - `server_pk` -- the public key of the community server to route the blinded message through /// (32 bytes). /// - `sender_id` -- the blinded id of the sender including the blinding prefix (33 bytes), /// 'blind15' or 'blind25' decryption will be chosed based on this value. @@ -323,8 +323,8 @@ std::pair, std::string> decrypt_from_blinded_recipien std::span ciphertext); struct DecryptGroupMessage { - size_t index; // Index of the key that successfully decrypted the message - std::string session_id; // In hex + size_t index; // Index of the key that successfully decrypted the message + std::string session_id; // In hex std::vector plaintext; }; diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index aaee6ea3..9d504c35 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -54,9 +54,9 @@ enum PRO_STATUS { // See session::ProStatus enum DESTINATION_TYPE { // See session::DestinationType DESTINATION_TYPE_CONTACT, DESTINATION_TYPE_SYNC_MESSAGE, - DESTINATION_TYPE_CLOSED_GROUP, - DESTINATION_TYPE_OPEN_GROUP, - DESTINATION_TYPE_OPEN_GROUP_INBOX, + DESTINATION_TYPE_GROUP, + DESTINATION_TYPE_COMMUNITY, + DESTINATION_TYPE_COMMUNITY_INBOX, }; struct session_protocol_destination { // See session::Destination @@ -68,9 +68,9 @@ struct session_protocol_destination { // See session::Destination uint8_t pro_sig[64]; uint8_t recipient_pubkey[33]; uint64_t sent_timestamp_ms; - uint8_t open_group_inbox_server_pubkey[32]; - uint8_t closed_group_ed25519_pubkey[33]; - uint8_t closed_group_ed25519_privkey[32]; + uint8_t community_inbox_server_pubkey[32]; + uint8_t group_ed25519_pubkey[33]; + uint8_t group_ed25519_privkey[32]; }; enum ENVELOPE_TYPE { @@ -100,7 +100,7 @@ struct session_protocol_envelope { struct session_protocol_decrypt_envelope_keys { span_u8 group_ed25519_pubkey; - const span_u8 *ed25519_privkeys; + const span_u8* ed25519_privkeys; size_t ed25519_privkeys_len; }; diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index e56dadcd..50e4532f 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -48,12 +48,12 @@ enum class ProStatus { enum class DestinationType { Contact, SyncMessage, - /// Both legacy and non-legacy closed groups are to be identified as `ClosedGroup`. A non-legacy - /// group is detected by the (0x03) prefix byte on the given `dest_closed_group_pubkey` - /// specified in Destination. - ClosedGroup, - OpenGroup, - OpenGroupInbox, + /// Both legacy and non-legacy groups are to be identified as `Group`. A non-legacy + /// group is detected by the (0x03) prefix byte on the given `dest_group_pubkey` specified in + /// Destination. + Group, + Community, + CommunityInbox, }; struct Destination { @@ -66,23 +66,23 @@ struct Destination { std::optional pro_sig; // Set to the recipient of the message if it requires one. Ignored otherwise (for example - // ignored in OpenGroup) + // ignored in type => Community) array_uc33 recipient_pubkey; // The timestamp to assign to the message envelope std::chrono::milliseconds sent_timestamp_ms; - // When type => OpenGroupInbox: set this pubkey to the server's key - array_uc32 open_group_inbox_server_pubkey; + // When type => CommunityInbox: set this pubkey to the server's key + array_uc32 community_inbox_server_pubkey; - // When type => ClosedGroup: set to the group keys for a 0x03 prefix (e.g. groups v2) - // `closed_group_pubkey` to encrypt the message. Public key of the group for groups v2 messages - array_uc33 closed_group_ed25519_pubkey; + // When type => Group: set to the group public keys for a 0x03 prefix (e.g. groups v2) + // `group_pubkey` to encrypt the message for. + array_uc33 group_ed25519_pubkey; - // When type => ClosedGroup: Set the private key of the group for groups v2 messages. Typically + // When type => Group: Set the private key of the group for groups v2 messages. Typically // the latest encryption key for the group, e.g: `Keys::group_enc_key` or // `groups_keys_group_enc_key` - array_uc32 closed_group_ed25519_privkey; + array_uc32 group_ed25519_privkey; }; enum class EnvelopeType { @@ -196,7 +196,7 @@ PRO_FEATURES get_pro_features_for_msg(size_t msg_size, PRO_EXTRA_FEATURES flags) /// /// This function supports all combinatoric combinations of the destination type and namespace /// including returning plaintext if the message is not meant to be encrypted and or wrapping in the -/// additional websocket wrapper or encrypting the envelope with the closed group keys if necessary +/// additional websocket wrapper or encrypting the envelope with the group keys if necessary /// e.t.c. /// /// Calling this function requires filling out the options in the `Destination` struct with the @@ -204,8 +204,8 @@ PRO_FEATURES get_pro_features_for_msg(size_t msg_size, PRO_EXTRA_FEATURES flags) /// annotation on `Destination` for more information. /// /// This function throws if the API is misused (i.e.: A field was not set, but was required to be -/// set for the given destination and namespace. For example the closed group keys not being set -/// when sending to a group prefixed [0x3] key in a closed group into the group message namespace) +/// set for the given destination and namespace. For example the group keys not being set +/// when sending to a group prefixed [0x3] key in a group into the group message namespace) /// but otherwise returns a struct with values. /// /// Inputs: diff --git a/proto/SessionProtos.proto b/proto/SessionProtos.proto index 58083a39..a6db5ee1 100644 --- a/proto/SessionProtos.proto +++ b/proto/SessionProtos.proto @@ -311,11 +311,11 @@ message GroupUpdateMemberChangeMessage { } message GroupUpdateMemberLeftMessage { - // the pubkey of the member left is included as part of the closed group encryption logic (senderIdentity on desktop) + // the pubkey of the member left is included as part of the group encryption logic (senderIdentity on desktop) } message GroupUpdateMemberLeftNotificationMessage { - // the pubkey of the member left is included as part of the closed group encryption logic (senderIdentity on desktop) + // the pubkey of the member left is included as part of the group encryption logic (senderIdentity on desktop) } message GroupUpdateInviteResponseMessage { diff --git a/src/config/groups/keys.cpp b/src/config/groups/keys.cpp index a2dee3ef..1931326f 100644 --- a/src/config/groups/keys.cpp +++ b/src/config/groups/keys.cpp @@ -22,8 +22,8 @@ #include "session/config/groups/keys.h" #include "session/config/groups/members.hpp" #include "session/multi_encrypt.hpp" -#include "session/xed25519.hpp" #include "session/session_encrypt.hpp" +#include "session/xed25519.hpp" using namespace std::literals; @@ -1242,7 +1242,6 @@ std::pair> Keys::decrypt_message( if (!decrypt_success) // none of the keys worked throw std::runtime_error{"unable to decrypt ciphertext with any current group keys"}; - std::pair> result; result.first = std::move(decrypt.session_id); result.second = std::move(decrypt.plaintext); @@ -1363,8 +1362,7 @@ LIBSESSION_C_API const unsigned char* groups_keys_get_key(const config_group_key return keys[N].data(); } -LIBSESSION_C_API const span_u8 groups_keys_group_enc_key(const config_group_keys* conf) -{ +LIBSESSION_C_API const span_u8 groups_keys_group_enc_key(const config_group_keys* conf) { span_u8 result = {}; try { std::span key = unbox(conf).group_enc_key(); diff --git a/src/config/internal.hpp b/src/config/internal.hpp index 8d8908e2..26d02f18 100644 --- a/src/config/internal.hpp +++ b/src/config/internal.hpp @@ -151,7 +151,7 @@ std::string session_id_to_bytes(std::string_view session_id, std::string_view pr std::array session_id_pk( std::string_view session_id, std::string_view prefix = "05"); -// Validates an open group pubkey; we accept it in hex, base32z, or base64 (padded or unpadded). +// Validates a community pubkey; we accept it in hex, base32z, or base64 (padded or unpadded). // Throws std::invalid_argument if invalid. void check_encoded_pubkey(std::string_view pk); diff --git a/src/session_encrypt.cpp b/src/session_encrypt.cpp index dc234d25..54e8c4c6 100644 --- a/src/session_encrypt.cpp +++ b/src/session_encrypt.cpp @@ -1,6 +1,8 @@ #include "session/session_encrypt.hpp" #include +#include +#include #include #include #include @@ -14,8 +16,6 @@ #include #include #include -#include -#include #include #include @@ -419,7 +419,8 @@ std::vector encrypt_for_group( // add below, but then also validation that this Ed25519 converts to the Session ID of the // claimed sender of the message inside the encoded message data. dict.append( - "a", std::string_view{reinterpret_cast(user_ed25519_privkey.data()) + 32, 32}); + "a", + std::string_view{reinterpret_cast(user_ed25519_privkey.data()) + 32, 32}); if (!compress) dict.append("d", to_string_view(plaintext)); @@ -430,7 +431,10 @@ std::vector encrypt_for_group( // receive it. std::vector to_sign(plaintext.size() + group_ed25519_pubkey.size()); std::memcpy(to_sign.data(), plaintext.data(), plaintext.size()); - std::memcpy(to_sign.data() + plaintext.size(), group_ed25519_pubkey.data(), group_ed25519_pubkey.size()); + std::memcpy( + to_sign.data() + plaintext.size(), + group_ed25519_pubkey.data(), + group_ed25519_pubkey.size()); std::array signature; crypto_sign_ed25519_detached( @@ -704,15 +708,15 @@ DecryptGroupMessage decrypt_group_message( if (decrypt_ed25519_privkey.size() != 32 && decrypt_ed25519_privkey.size() != 64) throw std::invalid_argument{"Invalid decrypt_ed25519_privkey: expected 32 or 64 bytes"}; decrypt_success = 0 == crypto_aead_xchacha20poly1305_ietf_decrypt( - plain.data(), - nullptr, - nullptr, - ciphertext.data(), - ciphertext.size(), - nullptr, - 0, - nonce.data(), - decrypt_ed25519_privkey.data()); + plain.data(), + nullptr, + nullptr, + ciphertext.data(), + ciphertext.size(), + nullptr, + 0, + nonce.data(), + decrypt_ed25519_privkey.data()); if (decrypt_success) { result.index = index; break; @@ -794,7 +798,10 @@ DecryptGroupMessage decrypt_group_message( // in encrypt_message). std::vector to_verify(raw_data.size() + group_ed25519_pubkey.size()); std::memcpy(to_verify.data(), raw_data.data(), raw_data.size()); - std::memcpy(to_verify.data() + raw_data.size(), group_ed25519_pubkey.data(), group_ed25519_pubkey.size()); + std::memcpy( + to_verify.data() + raw_data.size(), + group_ed25519_pubkey.data(), + group_ed25519_pubkey.size()); if (0 != crypto_sign_ed25519_verify_detached( ed_sig.data(), to_verify.data(), to_verify.size(), ed_pk.data())) throw std::runtime_error{"message signature failed validation"}; @@ -1086,14 +1093,14 @@ LIBSESSION_C_API bool session_encrypt_for_blinded_recipient( const unsigned char* plaintext_in, size_t plaintext_len, const unsigned char* ed25519_privkey, - const unsigned char* open_group_pubkey, + const unsigned char* community_pubkey, const unsigned char* recipient_blinded_id, unsigned char** ciphertext_out, size_t* ciphertext_len) { try { auto ciphertext = session::encrypt_for_blinded_recipient( std::span{ed25519_privkey, 64}, - std::span{open_group_pubkey, 32}, + std::span{community_pubkey, 32}, std::span{recipient_blinded_id, 33}, std::span{plaintext_in, plaintext_len}); @@ -1107,17 +1114,16 @@ LIBSESSION_C_API bool session_encrypt_for_blinded_recipient( } LIBSESSION_C_API session_encrypt_group_message session_encrypt_for_group( - const unsigned char *user_ed25519_privkey, + const unsigned char* user_ed25519_privkey, size_t user_ed25519_privkey_len, - const unsigned char *group_ed25519_pubkey, + const unsigned char* group_ed25519_pubkey, size_t group_ed25519_pubkey_len, - const unsigned char *group_ed25519_privkey, + const unsigned char* group_ed25519_privkey, size_t group_ed25519_privkey_len, - const unsigned char *plaintext, + const unsigned char* plaintext, size_t plaintext_len, bool compress, - size_t padding) -{ + size_t padding) { session_encrypt_group_message result = {}; try { std::vector result_cpp = encrypt_for_group( @@ -1128,10 +1134,10 @@ LIBSESSION_C_API session_encrypt_group_message session_encrypt_for_group( compress, padding); result = { - .success = true, - .ciphertext = span_u8_copy_or_throw(result_cpp.data(), result_cpp.size()), + .success = true, + .ciphertext = span_u8_copy_or_throw(result_cpp.data(), result_cpp.size()), }; - } catch(...) { + } catch (...) { } return result; } @@ -1188,7 +1194,7 @@ LIBSESSION_C_API bool session_decrypt_for_blinded_recipient( const unsigned char* ciphertext_in, size_t ciphertext_len, const unsigned char* ed25519_privkey, - const unsigned char* open_group_pubkey, + const unsigned char* community_pubkey, const unsigned char* sender_id, const unsigned char* recipient_id, char* session_id_out, @@ -1197,7 +1203,7 @@ LIBSESSION_C_API bool session_decrypt_for_blinded_recipient( try { auto result = session::decrypt_from_blinded_recipient( std::span{ed25519_privkey, 64}, - std::span{open_group_pubkey, 32}, + std::span{community_pubkey, 32}, std::span{sender_id, 33}, std::span{recipient_id, 33}, std::span{ciphertext_in, ciphertext_len}); @@ -1214,13 +1220,12 @@ LIBSESSION_C_API bool session_decrypt_for_blinded_recipient( } LIBSESSION_C_API session_decrypt_group_message_result session_decrypt_group_message( - const span_u8 *decrypt_ed25519_privkey_list, + const span_u8* decrypt_ed25519_privkey_list, size_t decrypt_ed25519_privkey_len, - const unsigned char *group_ed25519_pubkey, + const unsigned char* group_ed25519_pubkey, size_t group_ed25519_pubkey_len, - const unsigned char *ciphertext, - size_t ciphertext_len) -{ + const unsigned char* ciphertext, + size_t ciphertext_len) { session_decrypt_group_message_result result = {}; for (size_t index = 0; index < decrypt_ed25519_privkey_len; index++) { std::span key = { @@ -1233,9 +1238,10 @@ LIBSESSION_C_API session_decrypt_group_message_result session_decrypt_group_mess {group_ed25519_pubkey, group_ed25519_pubkey_len}, {ciphertext, ciphertext_len}); result = { - .success = true, - .index = index, - .plaintext = span_u8_copy_or_throw(result.plaintext.data, result.plaintext.size), + .success = true, + .index = index, + .plaintext = + span_u8_copy_or_throw(result.plaintext.data, result.plaintext.size), }; assert(result_cpp.session_id.size() == sizeof(result.session_id)); std::memcpy(result.session_id, result_cpp.session_id.data(), sizeof(result.session_id)); diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index bf7d5e1d..03fee24f 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -51,17 +51,17 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( std::span dest_pro_sig, std::span dest_recipient_pubkey, std::chrono::milliseconds dest_sent_timestamp_ms, - std::span dest_open_group_inbox_server_pubkey, - std::span dest_closed_group_pubkey, - std::span dest_closed_group_ed25519_privkey, + std::span dest_community_inbox_server_pubkey, + std::span dest_group_pubkey, + std::span dest_group_ed25519_privkey, config::Namespace space, UseMalloc use_malloc) { assert(dest_pro_sig.empty() || dest_pro_sig.size() == crypto_sign_ed25519_BYTES); assert(dest_recipient_pubkey.size() == 1 + crypto_sign_ed25519_PUBLICKEYBYTES); - assert(dest_open_group_inbox_server_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); - assert(dest_closed_group_pubkey.size() == 1 + crypto_sign_ed25519_PUBLICKEYBYTES); - assert(dest_closed_group_ed25519_privkey.size() == 32 || dest_closed_group_ed25519_privkey.size() == 64); + assert(dest_community_inbox_server_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); + assert(dest_group_pubkey.size() == 1 + crypto_sign_ed25519_PUBLICKEYBYTES); + assert(dest_group_ed25519_privkey.size() == 32 || dest_group_ed25519_privkey.size() == 64); // All incoming arguments are passed in from typed, fixed-sized arrays so we do not need to // throw if these sizes are wrong. It being wrong would be a development error. @@ -78,7 +78,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( Nil, EnvelopeIsCipherText, // No extra bit-mangling required after enveloping WrapInWSMessage, // Wrap in the protobuf websocket message after enveloping - KeysEncryptMessage, // Encrypt with the closed group keys after ennveloping + KeysEncryptMessage, // Encrypt with the group keys after ennveloping }; struct EncodeContext { @@ -101,9 +101,9 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( // Figure out how to encrypt the message based on the destination and setup the encoding context EncodeContext enc = {}; switch (dest_type) { - case DestinationType::ClosedGroup: { + case DestinationType::Group: { bool has_03_prefix = - dest_closed_group_pubkey[0] == static_cast(SessionIDPrefix::group); + dest_group_pubkey[0] == static_cast(SessionIDPrefix::group); if (has_03_prefix) { if (space == config::Namespace::GroupMessages) { enc.mode = Mode::Envelope; @@ -120,13 +120,13 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( enc.mode = Mode::Plaintext; } } else { - // Legacy closed groups which have a 05 prefixed key + // Legacy groups which have a 05 prefixed key enc.mode = Mode::Envelope; enc.before_envelope_encrypt_for_recipient_deterministic = true; enc.envelope_type = SessionProtos::Envelope_Type::Envelope_Type_CLOSED_GROUP_MESSAGE; enc.after_envelope = AfterEnvelope::WrapInWSMessage; - enc.envelope_src = dest_closed_group_pubkey; + enc.envelope_src = dest_group_pubkey; } } break; @@ -151,11 +151,11 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( enc.after_envelope = AfterEnvelope::EnvelopeIsCipherText; } break; - case DestinationType::OpenGroup: { + case DestinationType::Community: { enc.mode = Mode::Plaintext; } break; - case DestinationType::OpenGroupInbox: { + case DestinationType::CommunityInbox: { enc.mode = Mode::EncryptForBlindedRecipient; } break; } @@ -225,8 +225,8 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( std::string bytes = envelope.SerializeAsString(); std::vector ciphertext = encrypt_for_group( ed25519_privkey, - dest_closed_group_pubkey, - dest_closed_group_ed25519_privkey, + dest_group_pubkey, + dest_group_ed25519_privkey, to_span(bytes), /*compress*/ true, /*padding*/ 256); @@ -262,7 +262,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( result.encrypted = true; std::vector ciphertext = encrypt_for_blinded_recipient( ed25519_privkey, - dest_open_group_inbox_server_pubkey, + dest_community_inbox_server_pubkey, dest_recipient_pubkey, // recipient blinded pubkey plaintext); @@ -290,9 +290,9 @@ EncryptedForDestination encrypt_for_destination( /*dest_pro_sig=*/dest.pro_sig ? *dest.pro_sig : std::span(), /*dest_recipient_pubkey=*/dest.recipient_pubkey, /*dest_sent_timestamp_ms=*/dest.sent_timestamp_ms, - /*dest_open_group_inbox_server_pubkey=*/dest.open_group_inbox_server_pubkey, - /*dest_closed_group_ed25519_pubkey=*/dest.closed_group_ed25519_pubkey, - /*dest_closed_group_ed25519_privkey=*/dest.closed_group_ed25519_privkey, + /*dest_community_inbox_server_pubkey=*/dest.community_inbox_server_pubkey, + /*dest_group_ed25519_pubkey=*/dest.group_ed25519_pubkey, + /*dest_group_ed25519_privkey=*/dest.group_ed25519_privkey, /*space=*/space, /*use_malloc=*/UseMalloc::No); @@ -421,8 +421,7 @@ DecryptedEnvelope decrypt_envelope( result.sender_ed25519_pubkey.size()); if (crypto_sign_ed25519_pk_to_curve25519( - result.sender_x25519_pubkey.data(), result.sender_ed25519_pubkey.data()) != - 0) + result.sender_x25519_pubkey.data(), result.sender_ed25519_pubkey.data()) != 0) throw std::runtime_error( "Parse content failed, ed25519 public key could not be converted to " "x25519 " @@ -545,9 +544,9 @@ session_protocol_encrypt_for_destination( /*dest_pro_sig=*/dest->has_pro_sig ? dest->pro_sig : std::span(), /*dest_recipient_pubkey=*/dest->recipient_pubkey, /*dest_sent_timestamp_ms=*/std::chrono::milliseconds(dest->sent_timestamp_ms), - /*dest_open_group_inbox_server_pubkey=*/dest->open_group_inbox_server_pubkey, - /*dest_closed_group_ed25519_pubkey=*/dest->closed_group_ed25519_pubkey, - /*dest_closed_group_ed25519_privkey=*/dest->closed_group_ed25519_privkey, + /*dest_community_inbox_server_pubkey=*/dest->community_inbox_server_pubkey, + /*dest_group_ed25519_pubkey=*/dest->group_ed25519_pubkey, + /*dest_group_ed25519_privkey=*/dest->group_ed25519_privkey, /*space=*/static_cast(space), /*use_malloc=*/UseMalloc::Yes); diff --git a/src/util.cpp b/src/util.cpp index 12b5450e..c05c7bdc 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,6 +1,7 @@ +#include + #include #include -#include namespace session { diff --git a/tests/test_config_convo_info_volatile.cpp b/tests/test_config_convo_info_volatile.cpp index 11c55bb3..31e88dc6 100644 --- a/tests/test_config_convo_info_volatile.cpp +++ b/tests/test_config_convo_info_volatile.cpp @@ -70,11 +70,11 @@ TEST_CASE("Conversations", "[config][conversations]") { CHECK(convos.needs_push()); CHECK(convos.needs_dump()); - const auto open_group_pubkey = + const auto community_pubkey = "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"_hexbytes; auto og = convos.get_or_construct_community( - "http://Example.ORG:5678", "SudokuRoom", open_group_pubkey); + "http://Example.ORG:5678", "SudokuRoom", community_pubkey); CHECK(og.base_url() == "http://example.org:5678"); // Note: lower-case CHECK(og.room() == "sudokuroom"); // Note: lower-case CHECK(og.pubkey().size() == 32); @@ -145,7 +145,7 @@ TEST_CASE("Conversations", "[config][conversations]") { REQUIRE(x2); CHECK(x2->base_url() == "http://example.org:5678"); CHECK(x2->room() == "sudokuroom"); - CHECK(x2->pubkey_hex() == to_hex(open_group_pubkey)); + CHECK(x2->pubkey_hex() == to_hex(community_pubkey)); CHECK(x2->unread); auto x3 = convos2.get_group(benders_nightmare_group); @@ -352,7 +352,7 @@ TEST_CASE("Conversations (C API)", "[config][conversations][c]") { CHECK(config_needs_push(conf)); CHECK(config_needs_dump(conf)); - const auto open_group_pubkey = + const auto community_pubkey = "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"_hexbytes; convo_info_volatile_community og; @@ -373,7 +373,7 @@ TEST_CASE("Conversations (C API)", "[config][conversations][c]") { CHECK(conf->last_error == "Invalid community URL: room token contains invalid characters"sv); CHECK(convo_info_volatile_get_or_construct_community( - conf, &og, "http://Example.ORG:5678", "SudokuRoom", open_group_pubkey.data())); + conf, &og, "http://Example.ORG:5678", "SudokuRoom", community_pubkey.data())); CHECK(conf->last_error == nullptr); CHECK(og.base_url == "http://example.org:5678"sv); // Note: lower-case CHECK(og.room == "sudokuroom"sv); // Note: lower-case @@ -427,7 +427,7 @@ TEST_CASE("Conversations (C API)", "[config][conversations][c]") { REQUIRE(convo_info_volatile_get_community(conf2, &og, "http://EXAMPLE.org:5678", "sudokuRoom")); CHECK(og.base_url == "http://example.org:5678"sv); CHECK(og.room == "sudokuroom"sv); - CHECK(oxenc::to_hex(og.pubkey, og.pubkey + 32) == to_hex(open_group_pubkey)); + CHECK(oxenc::to_hex(og.pubkey, og.pubkey + 32) == to_hex(community_pubkey)); auto another_id = "051111111111111111111111111111111111111111111111111111111111111111"; convo_info_volatile_1to1 c2; diff --git a/tests/test_config_user_groups.cpp b/tests/test_config_user_groups.cpp index db94916b..dfb5ce33 100644 --- a/tests/test_config_user_groups.cpp +++ b/tests/test_config_user_groups.cpp @@ -164,7 +164,7 @@ TEST_CASE("User Groups", "[config][groups]") { std::array lg_sk; crypto_sign_ed25519_seed_keypair( lg_pk.data(), lg_sk.data(), reinterpret_cast(lgroup_seed.data())); - // Note: this isn't exactly what Session actually does here for legacy closed groups (rather it + // Note: this isn't exactly what Session actually does here for legacy groups (rather it // uses X25519 keys) but for this test the distinction doesn't matter. c.enc_pubkey.assign(lg_pk.data(), lg_pk.data() + lg_pk.size()); c.enc_seckey.assign(lg_sk.data(), lg_sk.data() + 32); @@ -181,11 +181,11 @@ TEST_CASE("User Groups", "[config][groups]") { CHECK(groups.needs_push()); CHECK(groups.needs_dump()); - const auto open_group_pubkey = + const auto community_pubkey = "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"_hexbytes; auto og = groups.get_or_construct_community( - "http://Example.ORG:5678", "SudokuRoom", open_group_pubkey); + "http://Example.ORG:5678", "SudokuRoom", community_pubkey); CHECK(og.base_url() == "http://example.org:5678"); // Note: lower-case CHECK(og.room() == "SudokuRoom"); // Note: case-preserving CHECK(og.room_norm() == "sudokuroom"); @@ -281,7 +281,7 @@ TEST_CASE("User Groups", "[config][groups]") { CHECK(x2->base_url() == "http://example.org:5678"); CHECK(x2->room() == "SudokuRoom"); // Case preserved from the stored value, not the input value CHECK(x2->room_norm() == "sudokuroom"); - CHECK(x2->pubkey_hex() == to_hex(open_group_pubkey)); + CHECK(x2->pubkey_hex() == to_hex(community_pubkey)); CHECK(x2->priority == 14); CHECK_FALSE(g2.needs_push()); @@ -871,17 +871,17 @@ TEST_CASE("User groups mute_until & joined_at are always seconds", "[config][gro } { - const auto open_group_pubkey = + const auto community_pubkey = "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"_hexbytes; const auto url = "http://example.org:5678"; const auto room = "sudoku_room"; - auto comm = c.get_or_construct_community(url, room, open_group_pubkey); + auto comm = c.get_or_construct_community(url, room, community_pubkey); int64_t joined_at = get_timestamp_ms(); int64_t mute_until = get_timestamp_ms(); comm.joined_at = joined_at; comm.mute_until = mute_until; c.set(comm); - auto comm2 = c.get_or_construct_community(url, room, open_group_pubkey); + auto comm2 = c.get_or_construct_community(url, room, community_pubkey); CHECK(comm2.joined_at == joined_at / 1'000); // joined_at was given in milliseconds CHECK(comm2.mute_until == mute_until / 1'000); // mute_until was given in milliseconds c.erase_community(url, room); diff --git a/tests/test_session_protocol.cpp b/tests/test_session_protocol.cpp index f9ff4df2..b7f596fb 100644 --- a/tests/test_session_protocol.cpp +++ b/tests/test_session_protocol.cpp @@ -221,15 +221,15 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { SECTION("Check non-encryptable messages produce only plaintext") { auto dest_list = { - DestinationType::OpenGroup, - DestinationType::OpenGroupInbox, + DestinationType::Community, + DestinationType::CommunityInbox, DestinationType::Contact}; for (auto dest_type : dest_list) { - if (dest_type == DestinationType::OpenGroup) - INFO("Trying open groups"); - else if (dest_type == DestinationType::OpenGroupInbox) - INFO("Trying open group inbox"); + if (dest_type == DestinationType::Community) + INFO("Trying community"); + else if (dest_type == DestinationType::CommunityInbox) + INFO("Trying community inbox"); else INFO("Trying contacts to non-default namespace"); @@ -239,7 +239,7 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { config::Namespace space = config::Namespace::Default; if (dest_type == DestinationType::Contact) { space = config::Namespace::Contacts; - } else if (dest_type == DestinationType::OpenGroupInbox) { + } else if (dest_type == DestinationType::CommunityInbox) { auto [blind15_pk, blind15_sk] = session::blind15_key_pair( keys.ed_sk1, keys.ed_pk1, /*blind factor*/ nullptr); dest.recipient_pubkey[0] = 0x15; @@ -249,7 +249,7 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { EncryptedForDestination encrypt_result = session::encrypt_for_destination( to_span(protobuf_content_with_pro.plaintext), keys.ed_sk0, dest, space); - if (dest_type == DestinationType::OpenGroupInbox) { + if (dest_type == DestinationType::CommunityInbox) { REQUIRE(encrypt_result.encrypted); REQUIRE(encrypt_result.ciphertext.size()); } else { @@ -355,7 +355,7 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { EncryptedForDestination encrypt_result = {}; { Destination dest = base_dest; - dest.type = DestinationType::ClosedGroup; + dest.type = DestinationType::Group; assert(dest.recipient_pubkey[0] == 0x05); encrypt_result = session::encrypt_for_destination( @@ -418,10 +418,10 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { EncryptedForDestination encrypt_result = {}; { Destination dest = base_dest; - dest.type = DestinationType::ClosedGroup; - dest.closed_group_pubkey[0] = 0x03; - std::memcpy(dest.closed_group_pubkey.data() + 1, group_v2_pk.data(), group_v2_pk.size()); - dest.closed_group_keys = &group_v2_keys; + dest.type = DestinationType::Group; + dest.group_pubkey[0] = 0x03; + std::memcpy(dest.group_pubkey.data() + 1, group_v2_pk.data(), group_v2_pk.size()); + dest.group_keys = &group_v2_keys; encrypt_result = session::encrypt_for_destination( to_span(protobuf_content_with_pro.plaintext), @@ -499,12 +499,11 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { std::span bad_key = keys.ed_sk0; DecryptEnvelopeKey bad_decrypt_keys = {}; decrypt_keys.ed25519_privkeys = {&bad_key, 1}; - REQUIRE_THROWS( - session::decrypt_envelope( - bad_decrypt_keys, - encrypt_result.ciphertext, - protobuf_content_with_pro.proof.expiry_unix_ts, - pro_backend_ed_pk)); + REQUIRE_THROWS(session::decrypt_envelope( + bad_decrypt_keys, + encrypt_result.ciphertext, + protobuf_content_with_pro.proof.expiry_unix_ts, + pro_backend_ed_pk)); // Try decrypt with multiple keys, 1 bad, 1 good key auto key_list = std::array{bad_key, key}; From cb207d78b2e9d0730fa10e14064ad9a104d15341 Mon Sep 17 00:00:00 2001 From: doylet Date: Mon, 18 Aug 2025 21:59:55 +1000 Subject: [PATCH 34/59] Add some missing typedefs on C structs --- include/session/config/pro.h | 8 ++++---- include/session/session_encrypt.h | 4 ++-- include/session/session_protocol.h | 32 +++++++++++++++--------------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/session/config/pro.h b/include/session/config/pro.h index 581797c3..d745b522 100644 --- a/include/session/config/pro.h +++ b/include/session/config/pro.h @@ -10,18 +10,18 @@ extern "C" { #include "../export.h" -struct pro_proof { +typedef struct pro_proof { uint8_t version; uint8_t gen_index_hash[32]; uint8_t rotating_pubkey[32]; uint64_t expiry_unix_ts; uint8_t sig[64]; -}; +} pro_proof; -struct pro_pro_config { +typedef struct pro_pro_config { uint8_t rotating_privkey[64]; pro_proof proof; -}; +} pro_pro_config; LIBSESSION_EXPORT pro_proof pro_proof_init(char const* dump, size_t dump_len); diff --git a/include/session/session_encrypt.h b/include/session/session_encrypt.h index 758ab857..2e61da50 100644 --- a/include/session/session_encrypt.h +++ b/include/session/session_encrypt.h @@ -68,7 +68,7 @@ LIBSESSION_EXPORT bool session_encrypt_for_blinded_recipient( unsigned char** ciphertext_out, size_t* ciphertext_len); -typedef struct { +typedef struct session_encrypt_group_message { bool success; span_u8 ciphertext; } session_encrypt_group_message; @@ -214,7 +214,7 @@ LIBSESSION_EXPORT bool session_decrypt_for_blinded_recipient( unsigned char** plaintext_out, size_t* plaintext_len); -typedef struct { +typedef struct session_decrypt_group_message_result { bool success; size_t index; // Index of the key that successfully decrypted the message char session_id[66]; // In hex diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index 9d504c35..06173f20 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -43,23 +43,23 @@ enum PRO_FEATURES_ { PRO_FEATURES_10K_CHARACTER_LIMIT | PRO_FEATURES_PRO_BADGE | PRO_FEATURES_ANIMATED_AVATAR }; -enum PRO_STATUS { // See session::ProStatus +typedef enum PRO_STATUS { // See session::ProStatus PRO_STATUS_NIL, PRO_STATUS_INVALID_PRO_BACKEND_SIG, PRO_STATUS_INVALID_USER_SIG, PRO_STATUS_VALID, PRO_STATUS_EXPIRED, -}; +} PRO_STATUS; -enum DESTINATION_TYPE { // See session::DestinationType +typedef enum DESTINATION_TYPE { // See session::DestinationType DESTINATION_TYPE_CONTACT, DESTINATION_TYPE_SYNC_MESSAGE, DESTINATION_TYPE_GROUP, DESTINATION_TYPE_COMMUNITY, DESTINATION_TYPE_COMMUNITY_INBOX, -}; +} DESTINATION_TYPE; -struct session_protocol_destination { // See session::Destination +typedef struct session_protocol_destination { // See session::Destination DESTINATION_TYPE type; // The pro signature is optional, set this flag to true to make the encryption function take @@ -71,12 +71,12 @@ struct session_protocol_destination { // See session::Destination uint8_t community_inbox_server_pubkey[32]; uint8_t group_ed25519_pubkey[33]; uint8_t group_ed25519_privkey[32]; -}; +} session_protocol_destination; -enum ENVELOPE_TYPE { +typedef enum ENVELOPE_TYPE { ENVELOPE_TYPE_SESSION_MESSAGE, ENVELOPE_TYPE_CLOSED_GROUP_MESSGE, -}; +} ENVELOPE_TYPE; // Indicates which optional fields in the envelope has been populated out of the optional fields in // an envelope after it has been parsed off the wire. @@ -88,7 +88,7 @@ enum ENVELOPE_FLAGS_ { ENVELOPE_FLAGS_PRO_SIG = 1 << 3, }; -struct session_protocol_envelope { +typedef struct session_protocol_envelope { ENVELOPE_FLAGS flags; ENVELOPE_TYPE type; uint64_t timestamp_ms; @@ -96,15 +96,15 @@ struct session_protocol_envelope { uint32_t source_device; uint64_t server_timestamp; uint8_t pro_sig[64]; -}; +} session_protocol_envelope; -struct session_protocol_decrypt_envelope_keys { +typedef struct session_protocol_decrypt_envelope_keys { span_u8 group_ed25519_pubkey; const span_u8* ed25519_privkeys; size_t ed25519_privkeys_len; -}; +} session_protocol_decrypt_envelope_keys; -struct session_protocol_decrypted_envelope { +typedef struct session_protocol_decrypted_envelope { // Indicates if the decryption was successful. If the decryption step failed and threw an // exception, this is false. bool success; @@ -115,15 +115,15 @@ struct session_protocol_decrypted_envelope { PRO_STATUS pro_status; pro_proof pro_proof; PRO_FEATURES pro_features; -}; +} session_protocol_decrypted_envelope; -struct session_protocol_encrypted_for_destination { +typedef struct session_protocol_encrypted_for_destination { // Indicates if the decryption was successful. If the decryption step failed and threw an // exception, this is false. bool success; bool encrypted; span_u8 ciphertext; -}; +} session_protocol_encrypted_for_destination; /// API: session_protocol/session_protocol_get_pro_features_for_msg /// From 735682582f3114ed11724d3f0f480cc3a970e11c Mon Sep 17 00:00:00 2001 From: doylet Date: Mon, 18 Aug 2025 22:22:42 +1000 Subject: [PATCH 35/59] Document the free-eing requirement on the C interface for session protocol/encrypt --- include/session/session_encrypt.h | 14 +++++-- include/session/session_protocol.h | 55 ++++++++++++++++++++-------- include/session/session_protocol.hpp | 40 +++++++++++++++++--- 3 files changed, 84 insertions(+), 25 deletions(-) diff --git a/include/session/session_encrypt.h b/include/session/session_encrypt.h index 2e61da50..50d99f50 100644 --- a/include/session/session_encrypt.h +++ b/include/session/session_encrypt.h @@ -102,7 +102,9 @@ typedef struct session_encrypt_group_message { /// use the default of next-multiple-of-256. /// /// Outputs: -/// - `ciphertext` -- the encrypted, etc. value to send to the swarm +/// - `success` -- True if the encryption was successful, false otherwise +/// - `ciphertext` -- the encrypted, etc. value to send to the swarm. This ciphertext must be freed +/// with the CRT's `free` when the caller is done with the memory. LIBSESSION_EXPORT session_encrypt_group_message session_encrypt_for_group( const unsigned char* user_ed25519_privkey, size_t user_ed25519_privkey_len, @@ -218,7 +220,7 @@ typedef struct session_decrypt_group_message_result { bool success; size_t index; // Index of the key that successfully decrypted the message char session_id[66]; // In hex - span_u8 plaintext; + span_u8 plaintext; // Decrypted message on success. Must be freed by calling the CRT's `free` } session_decrypt_group_message_result; /// API: crypto/session_decrypt_group_message @@ -238,8 +240,12 @@ typedef struct session_decrypt_group_message_result { /// by `encrypt_message()`. /// /// Outputs: -/// The struct with the results of decryption. On failure this sets the `success` boolean to false -/// and all fields should be ignored except `success`. +/// - `success` -- True if the decryption was successful, false otherwise +/// - `index` -- Index of the key that successfully decrypted the message if decryption was +/// successful. +/// - `session_id` -- The 66 byte 05 prefixed session ID of the user that sent the message +/// - `plaintext` -- Decrypted message if successful. This plaintext must be freed with the CRT's +/// `free` when the caller is done with the memory. session_decrypt_group_message_result session_decrypt_group_message( const span_u8* decrypt_ed25519_privkey_list, size_t decrypt_ed25519_privkey_len, diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index 06173f20..46ff6674 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -118,8 +118,8 @@ typedef struct session_protocol_decrypted_envelope { } session_protocol_decrypted_envelope; typedef struct session_protocol_encrypted_for_destination { - // Indicates if the decryption was successful. If the decryption step failed and threw an - // exception, this is false. + // Indicates if the encryption was successful. If any step failed and threw an exception, this + // is false. bool success; bool encrypted; span_u8 ciphertext; @@ -159,16 +159,20 @@ PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_EXTR /// - `space` -- the namespace to encrypt the message for /// /// Outputs: -/// - The encryption result for the plaintext. If the destination and namespace combination did not -/// require encryption, no payload is returned in the ciphertext and the user should proceed with -/// the plaintext. This should be validated by checking the `encrypted` flag on the result to -/// determine if the ciphertext or plaintext is to be used. +/// - `success` -- True if encryption was successful, if the underlying implementation threw +/// an exception then this is caught internally and success is set to false. All remaining fields +/// are to be ignored in the result on failure. +/// - `encrypted` -- True if any encryption was performed. If the combination of the namespace and +/// destination does not require encryption, this flag is false. In this case, `ciphertext` will +/// not be assigned. The caller should proceed with the `plaintext` they initially passed in. +/// - `ciphertext` -- Encryption result for the plaintext. If the destination and namespace +/// combination did not require encryption, no payload is returned in the ciphertext and the user +/// should proceed with the plaintext. This should be validated by checking the `encrypted` flag +/// on the result to determine if the ciphertext or plaintext is to be used. /// /// The retured payload is suitable for sending on the wire (i.e: it has been protobuf -/// encoded/wrapped if necessary). -/// -/// The success flag is set if encryption was successful, if the underlying implementation threw -/// an exception then this is caught internally and success is set to false. +/// encoded/wrapped if necessary). The ciphertext must be freed with the CRT's `free` when the +/// caller is done with the memory. LIBSESSION_EXPORT session_protocol_encrypted_for_destination session_protocol_encrypt_for_destination( const void* plaintext, @@ -209,11 +213,32 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_for_destinat /// issuer. Ignored if there's no proof in the message. /// /// Outputs: -/// - The decrypted envelope. It contains the fields of the envelope and the Session Pro metadata -/// within the envelope if there were any. -/// -/// The success flag is set if encryption was successful, if the underlying implementation threw -/// an exception then this is caught internally and success is set to false. +/// - `success` -- True if encryption was successful, if the underlying implementation threw +/// an exception then this is caught internally and success is set to false. All remaining fields +/// in the result are to be ignored on failure. +/// - `envelope` -- Envelope structure that was decrypted/parsed from the `envelope_plaintext` +/// - `content_plaintext` -- Decrypted contents of the envelope structure. This is the protobuf +/// encoded stream that can be parsed into a protobuf `Content` structure. +/// +/// The plaintext must be freed by the CRT's `free` after the caller is done with the memory. +/// - `sender_ed25519_pubkey` -- The sender's ed25519 public key embedded in the encrypted payload. +/// This is only set for session message envelopes. Groups envelopes only embed the sender's +/// x25519 public key in which case this field is set to the zero public key. +/// - `sender_x25519_pubkey` -- The sender's x25519 public key. It's always set on successful +/// decryption either by extracting the key from the encrypted groups envelope, or, by deriving +/// the x25519 key from the sender's ed25519 key in the case of a session message envelope. +/// - `pro_status` -- The pro status associated with the envelope, if any, that the sender has +/// embedded into the envelope being parsed. This field is set to nil if there was no pro metadata +/// associated with the envelope. +/// +/// This field should be used to determine the presence of pro and whether or not the caller +/// can respect the contents of the pro proof and features. A valid pro proof that can be used +/// effectively after parsing is indicated by this value being set to the Valid enum. +/// - `pro_proof` -- The pro proof in the envelope. This field is set to all zeros if `pro_status` +/// was nil, otherwise it's populated with proof data. +/// - `pro_features` -- Pro features that were activated in this envelope by the sender. This field +/// is only set if `pro_status` is not nil. It should only be enforced if the `pro_status` was +/// the Valid enum. LIBSESSION_EXPORT session_protocol_decrypted_envelope session_protocol_decrypt_envelope( const session_protocol_decrypt_envelope_keys* keys, diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index 50e4532f..70a82932 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -218,10 +218,16 @@ PRO_FEATURES get_pro_features_for_msg(size_t msg_size, PRO_EXTRA_FEATURES flags) /// - `space` -- the namespace to encrypt the message for /// /// Outputs: -/// - The encryption result for the plaintext. If the destination and namespace combination did not -/// require encryption, no payload is returned in the ciphertext and the user should proceed with -/// the plaintext. This should be validated by checking the `encrypted` flag on the result to -/// determine if the ciphertext or plaintext is to be used. +/// - `success` -- True if encryption was successful, if the underlying implementation threw +/// an exception then this is caught internally and success is set to false. All remaining fields +/// are to be ignored in the result on failure. +/// - `encrypted` -- True if any encryption was performed. If the combination of the namespace and +/// destination does not require encryption, this flag is false. In this case, `ciphertext` will +/// not be assigned. The caller should proceed with the `plaintext` they initially passed in. +/// - `ciphertext` -- Encryption result for the plaintext. If the destination and namespace +/// combination did not require encryption, no payload is returned in the ciphertext and the user +/// should proceed with the plaintext. This should be validated by checking the `encrypted` flag +/// on the result to determine if the ciphertext or plaintext is to be used. /// /// The retured payload is suitable for sending on the wire (i.e: it has been protobuf /// encoded/wrapped if necessary). @@ -270,8 +276,30 @@ EncryptedForDestination encrypt_for_destination( /// issuer /// /// Outputs: -/// - The decrypted envelope. It contains the fields of the envelope and the Session Pro metadata -/// within the envelope if there were any. +/// - `success` -- True if encryption was successful, if the underlying implementation threw +/// an exception then this is caught internally and success is set to false. All remaining fields +/// in the result are to be ignored on failure. +/// - `envelope` -- Envelope structure that was decrypted/parsed from the `envelope_plaintext` +/// - `content_plaintext` -- Decrypted contents of the envelope structure. This is the protobuf +/// encoded stream that can be parsed into a protobuf `Content` structure. +/// - `sender_ed25519_pubkey` -- The sender's ed25519 public key embedded in the encrypted payload. +/// This is only set for session message envelopes. Groups envelopes only embed the sender's +/// x25519 public key in which case this field is set to the zero public key. +/// - `sender_x25519_pubkey` -- The sender's x25519 public key. It's always set on successful +/// decryption either by extracting the key from the encrypted groups envelope, or, by deriving +/// the x25519 key from the sender's ed25519 key in the case of a session message envelope. +/// - `pro_status` -- The pro status associated with the envelope, if any, that the sender has +/// embedded into the envelope being parsed. This field is set to nil if there was no pro metadata +/// associated with the envelope. +/// +/// This field should be used to determine the presence of pro and whether or not the caller +/// can respect the contents of the pro proof and features. A valid pro proof that can be used +/// effectively after parsing is indicated by this value being set to the Valid enum. +/// - `pro_proof` -- The pro proof in the envelope. This field is set to all zeros if `pro_status` +/// was nil, otherwise it's populated with proof data. +/// - `pro_features` -- Pro features that were activated in this envelope by the sender. This field +/// is only set if `pro_status` is not nil. It should only be enforced if the `pro_status` was +/// the Valid enum. DecryptedEnvelope decrypt_envelope( const DecryptEnvelopeKey& keys, std::span envelope_payload, From 68c27ffd971139b64fe1bdc13d750f1bd37c5a22 Mon Sep 17 00:00:00 2001 From: doylet Date: Mon, 18 Aug 2025 22:30:49 +1000 Subject: [PATCH 36/59] We cannot enforce the presence of a pro signature We still require it to be optional whilst old clients are sending envelopes without the signature attached (real or dummy) --- src/session_protocol.cpp | 133 +++++++++++++++++++++------------------ 1 file changed, 72 insertions(+), 61 deletions(-) diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index 03fee24f..03b5144f 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -442,75 +442,86 @@ DecryptedEnvelope decrypt_envelope( // envelope indistinguishable. If the message does not have pro then this signature must still // be set but will be ignored. So in all instances a signature must be attached (real or // dummy). - if (!envelope.has_prosig()) - throw std::runtime_error("Parse envelope failed, message is missing pro signature"); - - // Copy (maybe dummy) pro signature into our result struct - const std::string& pro_sig = envelope.prosig(); - if (pro_sig.size() != crypto_sign_ed25519_BYTES) - throw std::runtime_error("Parse envelope failed, pro signature has wrong size"); - static_assert(sizeof(result.envelope.pro_sig) == crypto_sign_ed25519_BYTES); - std::memcpy(result.envelope.pro_sig.data(), pro_sig.data(), pro_sig.size()); - - if (content.has_promessage()) { - // Mark the envelope as having a pro signature that the caller can use. - result.envelope.flags |= ENVELOPE_FLAGS_PRO_SIG; - - // Extract the pro message - const SessionProtos::ProMessage& pro_msg = content.promessage(); - if (!pro_msg.has_proof()) - throw std::runtime_error("Parse decrypted message failed, pro config missing proof"); - if (!pro_msg.has_features()) - throw std::runtime_error("Parse decrypted message failed, pro config missing features"); - - // Parse the proof from protobufs - const SessionProtos::ProProof& proto_proof = pro_msg.proof(); - session::config::ProProof& proof = result.pro_proof; - // clang-format off + // + // TODO: However for backwards compatibility, so old client's sending their envelopes to new + // clients won't have the pro signature set. We have to allow these for now until we + // deprecate the supporting of messages from those clients. For forwards compatibility, the new + // clients will send the message with the pro signature attached. The old clients will ignore + // the new fields. + // + // This should be deprecated in about 1-2yrs from this message. 2025-08-18 doyle + if (envelope.has_prosig()) { + // Copy (maybe dummy) pro signature into our result struct + const std::string& pro_sig = envelope.prosig(); + if (pro_sig.size() != crypto_sign_ed25519_BYTES) + throw std::runtime_error("Parse envelope failed, pro signature has wrong size"); + static_assert(sizeof(result.envelope.pro_sig) == crypto_sign_ed25519_BYTES); + std::memcpy(result.envelope.pro_sig.data(), pro_sig.data(), pro_sig.size()); + + if (content.has_promessage()) { + // Mark the envelope as having a pro signature that the caller can use. + result.envelope.flags |= ENVELOPE_FLAGS_PRO_SIG; + + // Extract the pro message + const SessionProtos::ProMessage& pro_msg = content.promessage(); + if (!pro_msg.has_proof()) + throw std::runtime_error( + "Parse decrypted message failed, pro config missing proof"); + if (!pro_msg.has_features()) + throw std::runtime_error( + "Parse decrypted message failed, pro config missing features"); + + // Parse the proof from protobufs + const SessionProtos::ProProof& proto_proof = pro_msg.proof(); + session::config::ProProof& proof = result.pro_proof; + // clang-format off size_t proof_errors = 0; proof_errors += !proto_proof.has_version() || proto_proof.version() != static_cast(session::config::ProProofVersion_v0); proof_errors += !proto_proof.has_genindexhash() || proto_proof.genindexhash().size() != proof.gen_index_hash.max_size(); proof_errors += !proto_proof.has_rotatingpublickey() || proto_proof.rotatingpublickey().size() != proof.rotating_pubkey.max_size(); proof_errors += !proto_proof.has_expiryunixts(); proof_errors += !proto_proof.has_sig() || proto_proof.sig().size() != proof.sig.max_size(); - // clang-format on - if (proof_errors) - throw std::runtime_error("Parse decrypted message failed, pro metadata was malformed"); + // clang-format on + if (proof_errors) + throw std::runtime_error( + "Parse decrypted message failed, pro metadata was malformed"); + + // Verify the sig since we have extracted the rotating public key from the embedded + // proof + int verify_result = crypto_sign_ed25519_verify_detached( + reinterpret_cast(pro_sig.data()), + result.content_plaintext.data(), + result.content_plaintext.size(), + reinterpret_cast(proto_proof.rotatingpublickey().data())); + result.pro_status = verify_result == 0 ? ProStatus::Valid : ProStatus::InvalidUserSig; + + // Fill out the resulting proof structure, we have parsed successfully + result.pro_features = pro_msg.features(); + std::memcpy(result.envelope.pro_sig.data(), pro_sig.data(), pro_sig.size()); + + std::memcpy( + proof.gen_index_hash.data(), + proto_proof.genindexhash().data(), + proto_proof.genindexhash().size()); + std::memcpy( + proof.rotating_pubkey.data(), + proto_proof.rotatingpublickey().data(), + proto_proof.rotatingpublickey().size()); + proof.expiry_unix_ts = + std::chrono::sys_seconds(std::chrono::seconds(proto_proof.expiryunixts())); + std::memcpy(proof.sig.data(), proto_proof.sig().data(), proto_proof.sig().size()); - // Verify the sig since we have extracted the rotating public key from the embedded proof - int verify_result = crypto_sign_ed25519_verify_detached( - reinterpret_cast(pro_sig.data()), - result.content_plaintext.data(), - result.content_plaintext.size(), - reinterpret_cast(proto_proof.rotatingpublickey().data())); - result.pro_status = verify_result == 0 ? ProStatus::Valid : ProStatus::InvalidUserSig; - - // Fill out the resulting proof structure, we have parsed successfully - result.pro_features = pro_msg.features(); - std::memcpy(result.envelope.pro_sig.data(), pro_sig.data(), pro_sig.size()); - - std::memcpy( - proof.gen_index_hash.data(), - proto_proof.genindexhash().data(), - proto_proof.genindexhash().size()); - std::memcpy( - proof.rotating_pubkey.data(), - proto_proof.rotatingpublickey().data(), - proto_proof.rotatingpublickey().size()); - proof.expiry_unix_ts = - std::chrono::sys_seconds(std::chrono::seconds(proto_proof.expiryunixts())); - std::memcpy(proof.sig.data(), proto_proof.sig().data(), proto_proof.sig().size()); - - if (result.pro_status == ProStatus::Valid) { - // Verify the at the proof is verified by the Session Pro Backend key (e.g.: It was - // issued by an authoritative backend) - if (!proof.verify(pro_backend_pubkey)) - result.pro_status = ProStatus::InvalidProBackendSig; - - // Check if the proof has expired if (result.pro_status == ProStatus::Valid) { - if (unix_ts > result.pro_proof.expiry_unix_ts) - result.pro_status = ProStatus::Expired; + // Verify the at the proof is verified by the Session Pro Backend key (e.g.: It was + // issued by an authoritative backend) + if (!proof.verify(pro_backend_pubkey)) + result.pro_status = ProStatus::InvalidProBackendSig; + + // Check if the proof has expired + if (result.pro_status == ProStatus::Valid) { + if (unix_ts > result.pro_proof.expiry_unix_ts) + result.pro_status = ProStatus::Expired; + } } } } From ecfc9b79abbbaddc50d5b09f27c68bb6dd605b98 Mon Sep 17 00:00:00 2001 From: doylet Date: Tue, 19 Aug 2025 19:37:52 +1000 Subject: [PATCH 37/59] Don't use assert in test key-gen which breaks in release mode --- tests/utils.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/utils.hpp b/tests/utils.hpp index d02eb009..e03a93b2 100644 --- a/tests/utils.hpp +++ b/tests/utils.hpp @@ -152,7 +152,8 @@ static inline TestKeys get_deterministic_test_keys() { crypto_sign_ed25519_seed_keypair(result.ed_pk0.data(), result.ed_sk0.data(), result.seed0.data()); // X25519 - assert(0 == crypto_sign_ed25519_pk_to_curve25519(result.curve_pk0.data(), result.ed_pk0.data())); + bool converted = crypto_sign_ed25519_pk_to_curve25519(result.curve_pk0.data(), result.ed_pk0.data()); + assert(converted); // Session PK result.session_pk0[0] = 0x05; @@ -169,7 +170,8 @@ static inline TestKeys get_deterministic_test_keys() { crypto_sign_ed25519_seed_keypair(result.ed_pk1.data(), result.ed_sk1.data(), result.seed1.data()); // X25519 - assert(0 == crypto_sign_ed25519_pk_to_curve25519(result.curve_pk1.data(), result.ed_pk1.data())); + bool converted = crypto_sign_ed25519_pk_to_curve25519(result.curve_pk1.data(), result.ed_pk1.data()); + assert(converted); // Session PK result.session_pk1[0] = 0x05; From a5c4ed82a17a34475aaed1be6ae8f6e9d93bc727 Mon Sep 17 00:00:00 2001 From: doylet Date: Tue, 19 Aug 2025 20:22:04 +1000 Subject: [PATCH 38/59] Add error logging to C apis --- include/session/config/pro.h | 3 + include/session/session_encrypt.h | 40 +- include/session/session_protocol.h | 40 +- include/session/session_protocol.hpp | 25 +- include/session/types.h | 4 + src/config/pro.cpp | 10 +- src/session_encrypt.cpp | 26 +- src/session_protocol.cpp | 194 ++++---- tests/test_session_encrypt.cpp | 3 +- tests/test_session_protocol.cpp | 678 ++++++++++++++++++++++++++- tests/utils.hpp | 4 +- 11 files changed, 915 insertions(+), 112 deletions(-) diff --git a/include/session/config/pro.h b/include/session/config/pro.h index d745b522..ae1f1eba 100644 --- a/include/session/config/pro.h +++ b/include/session/config/pro.h @@ -9,6 +9,7 @@ extern "C" { #include #include "../export.h" +#include "../types.h" typedef struct pro_proof { uint8_t version; @@ -27,6 +28,8 @@ LIBSESSION_EXPORT pro_proof pro_proof_init(char const* dump, size_t dump_len); LIBSESSION_EXPORT pro_pro_config pro_pro_init(char const* dump, size_t dump_len); +LIBSESSION_EXPORT bytes32 pro_proof_hash(pro_proof const* proof); + LIBSESSION_EXPORT bool pro_proof_verify(pro_proof const* proof, uint8_t const* verify_pubkey); LIBSESSION_EXPORT bool pro_pro_verify(pro_pro_config const* pro, uint8_t const* verify_pubkey); diff --git a/include/session/session_encrypt.h b/include/session/session_encrypt.h index 50d99f50..2d60541e 100644 --- a/include/session/session_encrypt.h +++ b/include/session/session_encrypt.h @@ -71,6 +71,7 @@ LIBSESSION_EXPORT bool session_encrypt_for_blinded_recipient( typedef struct session_encrypt_group_message { bool success; span_u8 ciphertext; + size_t error_len_incl_null_terminator; } session_encrypt_group_message; /// API: crypto/session_encrypt_for_group @@ -100,11 +101,26 @@ typedef struct session_encrypt_group_message { /// - `padding` -- the padding multiple: padding will be added as needed to attain a multiple of /// this value for the final result. 0 or 1 disables padding entirely. Normally omitted to /// use the default of next-multiple-of-256. +/// - `error` -- Pointer to the character buffer to be populated with the error message if the +/// returned `success` was false, untouched otherwise. If this is set to `NULL`, then on failure, +/// the returned `error_len_incl_null_terminator` is the number of bytes required by the user to +/// receive the error. The message may be truncated if the buffer is too small, but it's always +/// guaranteed that `error` is null-terminated on failure when a buffer is passed in even if the +/// error must be truncated to fit in the buffer. +/// - `error_len` -- The capacity of the character buffer passed by the user. This should be 0 if +/// `error` is NULL. This function will fill the buffer up to `error_len - 1` characters with the +/// last character reserved for the null-terminator. /// /// Outputs: /// - `success` -- True if the encryption was successful, false otherwise /// - `ciphertext` -- the encrypted, etc. value to send to the swarm. This ciphertext must be freed /// with the CRT's `free` when the caller is done with the memory. +/// - `error_len_incl_null_terminator` The length of the error message if `success` was false. If +/// the user passes in an non-`NULL` error buffer this is amount of characters written to the +/// error buffer. If the user passes in a `NULL` error buffer, this is the amount of characters +/// required to write the error. Both counts include the null-terminator. The user must allocate +/// at minimum the requested length, including the null-terminator in order for the error message +/// to be preserved in full. LIBSESSION_EXPORT session_encrypt_group_message session_encrypt_for_group( const unsigned char* user_ed25519_privkey, size_t user_ed25519_privkey_len, @@ -115,7 +131,9 @@ LIBSESSION_EXPORT session_encrypt_group_message session_encrypt_for_group( const unsigned char* plaintext, size_t plaintext_len, bool compress, - size_t padding); + size_t padding, + char *error, + size_t error_len); /// API: crypto/session_decrypt_incoming /// @@ -221,6 +239,7 @@ typedef struct session_decrypt_group_message_result { size_t index; // Index of the key that successfully decrypted the message char session_id[66]; // In hex span_u8 plaintext; // Decrypted message on success. Must be freed by calling the CRT's `free` + char error_len_incl_null_terminator; } session_decrypt_group_message_result; /// API: crypto/session_decrypt_group_message @@ -238,6 +257,15 @@ typedef struct session_decrypt_group_message_result { /// - `group_ed25519_pubkey` -- the 32 byte public key of the group /// - `ciphertext` -- an encrypted, encoded, signed, (possibly) compressed message as produced /// by `encrypt_message()`. +/// - `error` -- Pointer to the character buffer to be populated with the error message if the +/// returned `success` was false, untouched otherwise. If this is set to `NULL`, then on failure, +/// the returned `error_len_incl_null_terminator` is the number of bytes required by the user to +/// receive the error. The message may be truncated if the buffer is too small, but it's always +/// guaranteed that `error` is null-terminated on failure when a buffer is passed in even if the +/// error must be truncated to fit in the buffer. +/// - `error_len` -- The capacity of the character buffer passed by the user. This should be 0 if +/// `error` is NULL. This function will fill the buffer up to `error_len - 1` characters with the +/// last character reserved for the null-terminator. /// /// Outputs: /// - `success` -- True if the decryption was successful, false otherwise @@ -246,13 +274,21 @@ typedef struct session_decrypt_group_message_result { /// - `session_id` -- The 66 byte 05 prefixed session ID of the user that sent the message /// - `plaintext` -- Decrypted message if successful. This plaintext must be freed with the CRT's /// `free` when the caller is done with the memory. +/// - `error_len_incl_null_terminator` The length of the error message if `success` was false. If +/// the user passes in an non-`NULL` error buffer this is amount of characters written to the +/// error buffer. If the user passes in a `NULL` error buffer, this is the amount of characters +/// required to write the error. Both counts include the null-terminator. The user must allocate +/// at minimum the requested length, including the null-terminator in order for the error message +/// to be preserved in full. session_decrypt_group_message_result session_decrypt_group_message( const span_u8* decrypt_ed25519_privkey_list, size_t decrypt_ed25519_privkey_len, const unsigned char* group_ed25519_pubkey, size_t group_ed25519_pubkey_len, const unsigned char* ciphertext, - size_t ciphertext_len); + size_t ciphertext_len, + char *error, + size_t error_len); /// API: crypto/session_decrypt_ons_response /// diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index 46ff6674..52419079 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -115,6 +115,7 @@ typedef struct session_protocol_decrypted_envelope { PRO_STATUS pro_status; pro_proof pro_proof; PRO_FEATURES pro_features; + size_t error_len_incl_null_terminator; } session_protocol_decrypted_envelope; typedef struct session_protocol_encrypted_for_destination { @@ -123,6 +124,7 @@ typedef struct session_protocol_encrypted_for_destination { bool success; bool encrypted; span_u8 ciphertext; + size_t error_len_incl_null_terminator; } session_protocol_encrypted_for_destination; /// API: session_protocol/session_protocol_get_pro_features_for_msg @@ -157,6 +159,15 @@ PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_EXTR /// - `dest` -- the extra metadata indicating the destination of the message and the necessary data /// to encrypt a message for that destination. /// - `space` -- the namespace to encrypt the message for +/// - `error` -- Pointer to the character buffer to be populated with the error message if the +/// returned `success` was false, untouched otherwise. If this is set to `NULL`, then on failure, +/// the returned `error_len_incl_null_terminator` is the number of bytes required by the user to +/// receive the error. The message may be truncated if the buffer is too small, but it's always +/// guaranteed that `error` is null-terminated on failure when a buffer is passed in even if the +/// error must be truncated to fit in the buffer. +/// - `error_len` -- The capacity of the character buffer passed by the user. This should be 0 if +/// `error` is NULL. This function will fill the buffer up to `error_len - 1` characters with the +/// last character reserved for the null-terminator. /// /// Outputs: /// - `success` -- True if encryption was successful, if the underlying implementation threw @@ -173,6 +184,12 @@ PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_EXTR /// The retured payload is suitable for sending on the wire (i.e: it has been protobuf /// encoded/wrapped if necessary). The ciphertext must be freed with the CRT's `free` when the /// caller is done with the memory. +/// - `error_len_incl_null_terminator` The length of the error message if `success` was false. If +/// the user passes in an non-`NULL` error buffer this is amount of characters written to the +/// error buffer. If the user passes in a `NULL` error buffer, this is the amount of characters +/// required to write the error. Both counts include the null-terminator. The user must allocate +/// at minimum the requested length, including the null-terminator in order for the error message +/// to be preserved in full. LIBSESSION_EXPORT session_protocol_encrypted_for_destination session_protocol_encrypt_for_destination( const void* plaintext, @@ -180,7 +197,9 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_for_destinat const void* ed25519_privkey, size_t ed25519_privkey_len, const session_protocol_destination* dest, - NAMESPACE space); + NAMESPACE space, + char* error, + size_t error_len); /// API: session_protocol/session_protocol_decrypt_envelope /// @@ -211,6 +230,15 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_for_destinat /// - `pro_backend_pubkey` -- the Session Pro backend public key to verify the signature embedded in /// the proof, validating whether or not the attached proof was indeed issued by an authorised /// issuer. Ignored if there's no proof in the message. +/// - `error` -- Pointer to the character buffer to be populated with the error message if the +/// returned `success` was false, untouched otherwise. If this is set to `NULL`, then on failure, +/// the returned `error_len_incl_null_terminator` is the number of bytes required by the user to +/// receive the error. The message may be truncated if the buffer is too small, but it's always +/// guaranteed that `error` is null-terminated on failure when a buffer is passed in even if the +/// error must be truncated to fit in the buffer. +/// - `error_len` -- The capacity of the character buffer passed by the user. This should be 0 if +/// `error` is NULL. This function will fill the buffer up to `error_len - 1` characters with the +/// last character reserved for the null-terminator. /// /// Outputs: /// - `success` -- True if encryption was successful, if the underlying implementation threw @@ -239,6 +267,12 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_for_destinat /// - `pro_features` -- Pro features that were activated in this envelope by the sender. This field /// is only set if `pro_status` is not nil. It should only be enforced if the `pro_status` was /// the Valid enum. +/// - `error_len_incl_null_terminator` The length of the error message if `success` was false. If +/// the user passes in an non-`NULL` error buffer this is amount of characters written to the +/// error buffer. If the user passes in a `NULL` error buffer, this is the amount of characters +/// required to write the error. Both counts include the null-terminator. The user must allocate +/// at minimum the requested length, including the null-terminator in order for the error message +/// to be preserved in full. LIBSESSION_EXPORT session_protocol_decrypted_envelope session_protocol_decrypt_envelope( const session_protocol_decrypt_envelope_keys* keys, @@ -246,7 +280,9 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( size_t envelope_plaintext_len, uint64_t unix_ts, const void* pro_backend_pubkey, - size_t pro_backend_pubkey_len); + size_t pro_backend_pubkey_len, + char* error, + size_t error_len); #ifdef __cplusplus } diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index 70a82932..ed75d12c 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -38,22 +38,27 @@ namespace config::groups { } enum class ProStatus { - Nil, // Proof not set - InvalidProBackendSig, // Proof set; pro proof sig was not produced by the Pro backend key - InvalidUserSig, // Proof set; envelope pro sig was not produced by the Rotating key - Valid, // Proof set, is verified; has not expired - Expired, // Proof set, is verified; has expired + // Proof not set + Nil = PRO_STATUS_NIL, + // Proof set; pro proof sig was not produced by the Pro backend key + InvalidProBackendSig = PRO_STATUS_INVALID_PRO_BACKEND_SIG, + // Proof set; envelope pro sig was not produced by the Rotating key + InvalidUserSig = PRO_STATUS_INVALID_USER_SIG, + // Proof set, is verified; has not expired + Valid = PRO_STATUS_VALID, + // Proof set, is verified; has expired + Expired = PRO_STATUS_EXPIRED, }; enum class DestinationType { - Contact, - SyncMessage, + Contact = DESTINATION_TYPE_CONTACT, + SyncMessage = DESTINATION_TYPE_SYNC_MESSAGE, /// Both legacy and non-legacy groups are to be identified as `Group`. A non-legacy /// group is detected by the (0x03) prefix byte on the given `dest_group_pubkey` specified in /// Destination. - Group, - Community, - CommunityInbox, + Group = DESTINATION_TYPE_GROUP, + Community = DESTINATION_TYPE_COMMUNITY, + CommunityInbox = DESTINATION_TYPE_COMMUNITY_INBOX, }; struct Destination { diff --git a/include/session/types.h b/include/session/types.h index db1db396..e5cfba32 100644 --- a/include/session/types.h +++ b/include/session/types.h @@ -13,6 +13,10 @@ struct span_u8 { size_t size; }; +struct bytes32 { + uint8_t data[32]; +}; + /// Create a span of bytes that owns the `size` bytes of memory requested. If allocation fails, this /// function throws a runtime exception. The `data` pointer is span must be freed once the span /// is no longer needed. diff --git a/src/config/pro.cpp b/src/config/pro.cpp index ec2ef9f1..d2cfa4fa 100644 --- a/src/config/pro.cpp +++ b/src/config/pro.cpp @@ -56,7 +56,7 @@ bool pro_verify_internal( return false; session::array_uc32 rederived_pk; - [[maybe_unused]] session::cleared_uc32 rederived_sk; + [[maybe_unused]] session::cleared_uc64 rederived_sk; crypto_sign_ed25519_seed_keypair( rederived_pk.data(), rederived_sk.data(), rotating_privkey.data()); @@ -156,6 +156,14 @@ static_assert((sizeof((pro_proof*)0)->gen_index_hash) == 32); static_assert((sizeof((pro_proof*)0)->rotating_pubkey) == crypto_sign_ed25519_PUBLICKEYBYTES); static_assert((sizeof((pro_proof*)0)->sig) == crypto_sign_ed25519_BYTES); +LIBSESSION_C_API bytes32 pro_proof_hash(pro_proof const* proof) { + session::array_uc32 hash = proof_hash_internal( + proof->version, proof->gen_index_hash, proof->rotating_pubkey, proof->expiry_unix_ts); + bytes32 result = {}; + std::memcpy(result.data, hash.data(), hash.size()); + return result; +} + LIBSESSION_C_API bool pro_proof_verify(pro_proof const* proof, uint8_t const* verify_pubkey) { auto verify_pubkey_span = std::span(verify_pubkey, crypto_sign_ed25519_PUBLICKEYBYTES); diff --git a/src/session_encrypt.cpp b/src/session_encrypt.cpp index 54e8c4c6..dd715127 100644 --- a/src/session_encrypt.cpp +++ b/src/session_encrypt.cpp @@ -552,12 +552,13 @@ std::pair, std::vector> decrypt_incomi auto& [buf, sender_ed_pk] = result; buf.resize(outer_size); - if (0 != crypto_box_seal_open( + int opened = crypto_box_seal_open( buf.data(), ciphertext.data(), ciphertext.size(), x25519_pubkey.data(), - x25519_seckey.data())) + x25519_seckey.data()); + if (opened != 0) throw std::runtime_error{"Decryption failed"}; uc64 sig; @@ -1123,7 +1124,9 @@ LIBSESSION_C_API session_encrypt_group_message session_encrypt_for_group( const unsigned char* plaintext, size_t plaintext_len, bool compress, - size_t padding) { + size_t padding, + char *error, + size_t error_len) { session_encrypt_group_message result = {}; try { std::vector result_cpp = encrypt_for_group( @@ -1137,7 +1140,11 @@ LIBSESSION_C_API session_encrypt_group_message session_encrypt_for_group( .success = true, .ciphertext = span_u8_copy_or_throw(result_cpp.data(), result_cpp.size()), }; - } catch (...) { + } catch (const std::exception& e) { + std::string error_cpp = e.what(); + result.error_len_incl_null_terminator = + std::snprintf(error, error_len, "%.*s", (int)error_cpp.size(), error_cpp.data()) + + 1; } return result; } @@ -1225,7 +1232,9 @@ LIBSESSION_C_API session_decrypt_group_message_result session_decrypt_group_mess const unsigned char* group_ed25519_pubkey, size_t group_ed25519_pubkey_len, const unsigned char* ciphertext, - size_t ciphertext_len) { + size_t ciphertext_len, + char *error, + size_t error_len) { session_decrypt_group_message_result result = {}; for (size_t index = 0; index < decrypt_ed25519_privkey_len; index++) { std::span key = { @@ -1246,7 +1255,12 @@ LIBSESSION_C_API session_decrypt_group_message_result session_decrypt_group_mess assert(result_cpp.session_id.size() == sizeof(result.session_id)); std::memcpy(result.session_id, result_cpp.session_id.data(), sizeof(result.session_id)); break; - } catch (...) { + } catch (const std::exception& e) { + std::string error_cpp = e.what(); + result.error_len_incl_null_terminator = + std::snprintf( + error, error_len, "%.*s", (int)error_cpp.size(), error_cpp.data()) + + 1; } } return result; diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index 03b5144f..bdeb1023 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -211,14 +211,16 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( req_msg->set_body(envelope.SerializeAsString()); // Write message as ciphertext + [[maybe_unused]] bool serialized = false; if (use_malloc == UseMalloc::Yes) { - result.ciphertext_c = span_u8_alloc_or_throw(envelope.ByteSizeLong()); - msg.SerializeToArray(result.ciphertext_c.data, result.ciphertext_c.size); + result.ciphertext_c = span_u8_alloc_or_throw(msg.ByteSizeLong()); + serialized = msg.SerializeToArray(result.ciphertext_c.data, result.ciphertext_c.size); } else { result.ciphertext_cpp.resize(msg.ByteSizeLong()); - msg.SerializeToArray( + serialized = msg.SerializeToArray( result.ciphertext_cpp.data(), result.ciphertext_cpp.size()); } + assert(serialized); } break; case AfterEnvelope::KeysEncryptMessage: { @@ -240,15 +242,17 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( } break; case AfterEnvelope::EnvelopeIsCipherText: { + [[maybe_unused]] bool serialized = false; if (use_malloc == UseMalloc::Yes) { result.ciphertext_c = span_u8_alloc_or_throw(envelope.ByteSizeLong()); - envelope.SerializeToArray( + serialized = envelope.SerializeToArray( result.ciphertext_c.data, result.ciphertext_c.size); } else { result.ciphertext_cpp.resize(envelope.ByteSizeLong()); - envelope.SerializeToArray( + serialized = envelope.SerializeToArray( result.ciphertext_cpp.data(), result.ciphertext_cpp.size()); } + assert(serialized); } break; } @@ -393,18 +397,18 @@ DecryptedEnvelope decrypt_envelope( envelope.content().data(), envelope.content().size()); } else { - std::span content_str = session::to_span(envelope.content()); + const std::string& content = envelope.content(); bool decrypt_success = false; std::vector content_plaintext; std::vector sender_ed25519_pubkey; for (const auto& privkey_it : keys.ed25519_privkeys) { try { std::tie(content_plaintext, sender_ed25519_pubkey) = - session::decrypt_incoming(privkey_it, content_str); + session::decrypt_incoming(privkey_it, to_span(content)); assert(result.sender_ed25519_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); decrypt_success = true; break; - } catch (const std::exception& e) { + } catch (...) { } } @@ -475,12 +479,12 @@ DecryptedEnvelope decrypt_envelope( const SessionProtos::ProProof& proto_proof = pro_msg.proof(); session::config::ProProof& proof = result.pro_proof; // clang-format off - size_t proof_errors = 0; - proof_errors += !proto_proof.has_version() || proto_proof.version() != static_cast(session::config::ProProofVersion_v0); - proof_errors += !proto_proof.has_genindexhash() || proto_proof.genindexhash().size() != proof.gen_index_hash.max_size(); - proof_errors += !proto_proof.has_rotatingpublickey() || proto_proof.rotatingpublickey().size() != proof.rotating_pubkey.max_size(); - proof_errors += !proto_proof.has_expiryunixts(); - proof_errors += !proto_proof.has_sig() || proto_proof.sig().size() != proof.sig.max_size(); + size_t proof_errors = 0; + proof_errors += !proto_proof.has_version() || proto_proof.version() != static_cast(session::config::ProProofVersion_v0); + proof_errors += !proto_proof.has_genindexhash() || proto_proof.genindexhash().size() != proof.gen_index_hash.max_size(); + proof_errors += !proto_proof.has_rotatingpublickey() || proto_proof.rotatingpublickey().size() != proof.rotating_pubkey.max_size(); + proof_errors += !proto_proof.has_expiryunixts(); + proof_errors += !proto_proof.has_sig() || proto_proof.sig().size() != proof.sig.max_size(); // clang-format on if (proof_errors) throw std::runtime_error( @@ -531,20 +535,22 @@ DecryptedEnvelope decrypt_envelope( using namespace session; -LIBSESSION_EXPORT +LIBSESSION_C_API PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_EXTRA_FEATURES flags) { PRO_FEATURES result = get_pro_features_for_msg(msg_size, flags); return result; } -LIBSESSION_EXPORT session_protocol_encrypted_for_destination +LIBSESSION_C_API session_protocol_encrypted_for_destination session_protocol_encrypt_for_destination( const void* plaintext, size_t plaintext_len, const void* ed25519_privkey, size_t ed25519_privkey_len, const session_protocol_destination* dest, - NAMESPACE space) { + NAMESPACE space, + char* error, + size_t error_len) { session_protocol_encrypted_for_destination result = {}; try { EncryptedForDestinationInternal result_internal = encrypt_for_destination_internal( @@ -566,20 +572,30 @@ session_protocol_encrypt_for_destination( .encrypted = result_internal.encrypted, .ciphertext = result_internal.ciphertext_c, }; - } catch (...) { + } catch (const std::exception& e) { + std::string error_cpp = e.what(); + result.error_len_incl_null_terminator = std::snprintf( + error, + error_len, + "%.*s", + static_cast(error_cpp.size()), + error_cpp.data()) + + 1; } return result; } -LIBSESSION_EXPORT +LIBSESSION_C_API session_protocol_decrypted_envelope session_protocol_decrypt_envelope( const session_protocol_decrypt_envelope_keys* keys, const void* envelope_plaintext, size_t envelope_plaintext_len, uint64_t unix_ts, const void* pro_backend_pubkey, - size_t pro_backend_pubkey_len) { + size_t pro_backend_pubkey_len, + char* error, + size_t error_len) { session_protocol_decrypted_envelope result = {}; // Setup the pro backend pubkey @@ -606,77 +622,85 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( {static_cast(envelope_plaintext), envelope_plaintext_len}, std::chrono::sys_seconds(std::chrono::seconds(unix_ts)), pro_backend_pubkey_cpp); + result.success = true; break; - } catch (...) { + } catch (const std::exception& e) { + std::string error_cpp = e.what(); + result.error_len_incl_null_terminator = std::snprintf( + error, + error_len, + "%.*s", + static_cast(error_cpp.size()), + error_cpp.data()) + + 1; } } - try { - // Marshall into c type - result = { - .success = false, - .envelope = - { - .flags = result_cpp.envelope.flags, - .type = static_cast(result_cpp.envelope.type), - .timestamp_ms = static_cast( - result_cpp.envelope.timestamp.count()), - .source = {}, - .source_device = result_cpp.envelope.source_device, - .server_timestamp = result_cpp.envelope.server_timestamp, - .pro_sig = {}, - }, - .content_plaintext = span_u8_copy_or_throw( - result_cpp.content_plaintext.data(), result_cpp.content_plaintext.size()), - .sender_ed25519_pubkey = {}, - .sender_x25519_pubkey = {}, - .pro_status = static_cast(result_cpp.pro_status), - .pro_proof = - { - .version = result_cpp.pro_proof.version, - .gen_index_hash = {}, - .rotating_pubkey = {}, - .expiry_unix_ts = static_cast( - result_cpp.pro_proof.expiry_unix_ts.time_since_epoch() - .count()), - .sig = {}, - }, - .pro_features = result_cpp.pro_features}; - - std::memcpy( - result.envelope.source, - result_cpp.envelope.source.data(), - sizeof(result.envelope.source)); - std::memcpy( - result.envelope.pro_sig, - result_cpp.envelope.pro_sig.data(), - sizeof(result.envelope.pro_sig)); - - std::memcpy( - result.sender_ed25519_pubkey, - result_cpp.sender_ed25519_pubkey.data(), - sizeof(result.sender_ed25519_pubkey)); - std::memcpy( - result.sender_x25519_pubkey, - result_cpp.sender_x25519_pubkey.data(), - sizeof(result.sender_x25519_pubkey)); - - std::memcpy( - result.pro_proof.gen_index_hash, - result_cpp.pro_proof.gen_index_hash.data(), - sizeof(result.pro_proof.gen_index_hash)); - std::memcpy( - result.pro_proof.rotating_pubkey, - result_cpp.pro_proof.rotating_pubkey.data(), - sizeof(result.pro_proof.rotating_pubkey)); - std::memcpy( - result.pro_proof.sig, - result_cpp.pro_proof.sig.data(), - sizeof(result.pro_proof.sig)); + if (keys->ed25519_privkeys_len == 0) { + result.error_len_incl_null_terminator = + std::snprintf(error, error_len, "No keys ed25519_privkeys were provided") + 1; + } - result.success = true; - } catch (...) { + // Marshall into c type + try { + result.content_plaintext = span_u8_copy_or_throw( + result_cpp.content_plaintext.data(), result_cpp.content_plaintext.size()); + } catch (const std::exception& e) { + std::string error_cpp = e.what(); + result.success = false; + result.error_len_incl_null_terminator = std::snprintf( + error, + error_len, + "%.*s", + static_cast(error_cpp.size()), + error_cpp.data()) + + 1; } + result.envelope.flags = result_cpp.envelope.flags; + result.envelope.type = static_cast(result_cpp.envelope.type); + result.envelope.timestamp_ms = static_cast(result_cpp.envelope.timestamp.count()); + result.envelope.source_device = result_cpp.envelope.source_device; + result.envelope.server_timestamp = result_cpp.envelope.server_timestamp; + result.pro_status = static_cast(result_cpp.pro_status); + result.pro_proof.version = result_cpp.pro_proof.version; + result.pro_proof.expiry_unix_ts = + static_cast(result_cpp.pro_proof.expiry_unix_ts.time_since_epoch().count()); + result.pro_features = result_cpp.pro_features; + + // Since we support multiple keys, if some of the keys failed but one of them succeeded, we will + // zero out the error buffer to avoid conflating one of the failures with the function actually + // succeeding. + if (result.success) + result.error_len_incl_null_terminator = 0; + + std::memcpy( + result.envelope.source, + result_cpp.envelope.source.data(), + sizeof(result.envelope.source)); + std::memcpy( + result.envelope.pro_sig, + result_cpp.envelope.pro_sig.data(), + sizeof(result.envelope.pro_sig)); + + std::memcpy( + result.sender_ed25519_pubkey, + result_cpp.sender_ed25519_pubkey.data(), + sizeof(result.sender_ed25519_pubkey)); + std::memcpy( + result.sender_x25519_pubkey, + result_cpp.sender_x25519_pubkey.data(), + sizeof(result.sender_x25519_pubkey)); + + std::memcpy( + result.pro_proof.gen_index_hash, + result_cpp.pro_proof.gen_index_hash.data(), + sizeof(result.pro_proof.gen_index_hash)); + std::memcpy( + result.pro_proof.rotating_pubkey, + result_cpp.pro_proof.rotating_pubkey.data(), + sizeof(result.pro_proof.rotating_pubkey)); + std::memcpy( + result.pro_proof.sig, result_cpp.pro_proof.sig.data(), sizeof(result.pro_proof.sig)); return result; } diff --git a/tests/test_session_encrypt.cpp b/tests/test_session_encrypt.cpp index 41efa1ff..70514b11 100644 --- a/tests/test_session_encrypt.cpp +++ b/tests/test_session_encrypt.cpp @@ -103,8 +103,7 @@ TEST_CASE("Session protocol deterministic encryption", "[session-protocol][encry std::vector sid_raw; oxenc::from_hex(sid.begin(), sid.end(), std::back_inserter(sid_raw)); REQUIRE(sid == "05d2ad010eeb72d72e561d9de7bd7b6989af77dcabffa03a5111a6c859ae5c3a72"); - REQUIRE(sid_raw == - "05d2ad010eeb72d72e561d9de7bd7b6989af77dcabffa03a5111a6c859ae5c3a72"_hexbytes); + REQUIRE(sid_raw == "05d2ad010eeb72d72e561d9de7bd7b6989af77dcabffa03a5111a6c859ae5c3a72"_hexbytes); const auto seed2 = "00112233445566778899aabbccddeeff00000000000000000000000000000000"_hexbytes; std::array ed_pk2, curve_pk2; diff --git a/tests/test_session_protocol.cpp b/tests/test_session_protocol.cpp index b7f596fb..d87eb66b 100644 --- a/tests/test_session_protocol.cpp +++ b/tests/test_session_protocol.cpp @@ -114,7 +114,6 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { SECTION("Encrypt with and w/o pro sig produce same payload size") { // Same payload size because the encrypt function should put in a dummy signature if one // wasn't specific to make pro and non-pro envelopes indistinguishable. - session::Destination dest = {}; dest.type = DestinationType::Contact; dest.sent_timestamp_ms = timestamp_ms; @@ -498,7 +497,7 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { // Try decrypt with bad key (ed_sk0 which was the sender; ed_sk1 the recipient) std::span bad_key = keys.ed_sk0; DecryptEnvelopeKey bad_decrypt_keys = {}; - decrypt_keys.ed25519_privkeys = {&bad_key, 1}; + bad_decrypt_keys.ed25519_privkeys = {&bad_key, 1}; REQUIRE_THROWS(session::decrypt_envelope( bad_decrypt_keys, encrypt_result.ciphertext, @@ -539,3 +538,678 @@ TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { REQUIRE(decrypt_result.pro_status == ProStatus::InvalidUserSig); } } + +TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { + + // Do tests that require no setup + SECTION("Ensure get pro fetaures detects large message") { + // Try a message below the size threshold + PRO_FEATURES features = session_protocol_get_pro_features_for_msg( + PRO_STANDARD_CHARACTER_LIMIT, + PRO_EXTRA_FEATURES_PRO_BADGE | PRO_EXTRA_FEATURES_ANIMATED_AVATAR); + REQUIRE(features == (PRO_FEATURES_PRO_BADGE | PRO_FEATURES_ANIMATED_AVATAR)); + + // Try a message exceeding the size threshold + features = session_protocol_get_pro_features_for_msg( + PRO_STANDARD_CHARACTER_LIMIT + 1, + PRO_EXTRA_FEATURES_PRO_BADGE | PRO_EXTRA_FEATURES_ANIMATED_AVATAR); + REQUIRE(features == (PRO_FEATURES_10K_CHARACTER_LIMIT | PRO_FEATURES_PRO_BADGE | + PRO_FEATURES_ANIMATED_AVATAR)); + + // Try asking for just one extra feature + features = session_protocol_get_pro_features_for_msg(100, PRO_EXTRA_FEATURES_PRO_BADGE); + REQUIRE(features == PRO_FEATURES_PRO_BADGE); + } + + // Tests that require some setup code + using namespace session; + TestKeys keys = get_deterministic_test_keys(); + + // Tuesday, 12 August 2025 03:58:21 UTC + const std::chrono::milliseconds timestamp_ms = std::chrono::seconds(1754971101); + const std::chrono::sys_seconds timestamp_s = std::chrono::sys_seconds( + std::chrono::duration_cast(timestamp_ms)); + const std::string_view data_body = "hello"; + + SECTION("Encrypt with and w/o pro sig produce same payload size") { + // Same payload size because the encrypt function should put in a dummy signature if one + // wasn't specific to make pro and non-pro envelopes indistinguishable. + + session_protocol_destination dest = {}; + dest.type = DESTINATION_TYPE_CONTACT; + dest.sent_timestamp_ms = timestamp_ms.count(); + std::memcpy(dest.recipient_pubkey, keys.session_pk1.data(), sizeof(dest.recipient_pubkey)); + + // Withhold the pro signature + dest.has_pro_sig = false; + char error[256]; + session_protocol_encrypted_for_destination encrypt_without_pro_sig = + session_protocol_encrypt_for_destination( + data_body.data(), + data_body.size(), + keys.ed_sk0.data(), + keys.ed_sk0.size(), + &dest, + NAMESPACE_DEFAULT, + error, + sizeof(error)); + INFO(error); + REQUIRE(encrypt_without_pro_sig.error_len_incl_null_terminator == 0); + + // Set the pro signature + dest.has_pro_sig = true; + session_protocol_encrypted_for_destination encrypt_with_pro_sig = + session_protocol_encrypt_for_destination( + data_body.data(), + data_body.size(), + keys.ed_sk0.data(), + keys.ed_sk0.size(), + &dest, + NAMESPACE_DEFAULT, + error, + sizeof(error)); + REQUIRE(encrypt_with_pro_sig.error_len_incl_null_terminator == 0); + + REQUIRE(encrypt_without_pro_sig.encrypted); + REQUIRE(encrypt_with_pro_sig.encrypted); + + // Should have the same payload size + REQUIRE(encrypt_without_pro_sig.ciphertext.size == encrypt_with_pro_sig.ciphertext.size); + free(encrypt_without_pro_sig.ciphertext.data); + free(encrypt_with_pro_sig.ciphertext.data); + } + + // Setup a dummy "Session Pro Backend" key + // We reuse test key 1 as the "Session Pro" backend key that signs the proofs as it + // doesn't matter what key really, just that we have one available for signing. + const array_uc64& pro_backend_ed_sk = keys.ed_sk1; + const array_uc32& pro_backend_ed_pk = keys.ed_pk1; + char error[256]; + + SECTION("Encrypt/decrypt for contact in default namespace w/o pro attached") { + // Build content without pro attached + std::string plaintext; + { + SessionProtos::Content content = {}; + SessionProtos::DataMessage* data = content.mutable_datamessage(); + data->set_body(std::string(data_body)); + plaintext = content.SerializeAsString(); + REQUIRE(plaintext.size() > data_body.size()); + } + + // Encrypt + session_protocol_encrypted_for_destination encrypt_result = {}; + { + session_protocol_destination dest = {}; + dest.type = DESTINATION_TYPE_CONTACT; + dest.sent_timestamp_ms = timestamp_ms.count(); + REQUIRE(sizeof(dest.recipient_pubkey) == keys.session_pk1.size()); + std::memcpy(dest.recipient_pubkey, keys.session_pk1.data(), keys.session_pk1.size()); + + encrypt_result = session_protocol_encrypt_for_destination( + plaintext.data(), + plaintext.size(), + keys.ed_sk0.data(), + keys.ed_sk0.size(), + &dest, + NAMESPACE_DEFAULT, + error, + sizeof(error)); + REQUIRE(encrypt_result.encrypted); + REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); + } + + // Decrypt envelope + span_u8 key = {keys.ed_sk1.data(), keys.ed_sk1.size()}; + session_protocol_decrypt_envelope_keys decrypt_keys = {}; + decrypt_keys.ed25519_privkeys = &key; + decrypt_keys.ed25519_privkeys_len = 1; + session_protocol_decrypted_envelope decrypt_result = session_protocol_decrypt_envelope( + &decrypt_keys, + encrypt_result.ciphertext.data, + encrypt_result.ciphertext.size, + timestamp_s.time_since_epoch().count(), + pro_backend_ed_pk.data(), + pro_backend_ed_pk.size(),error, sizeof(error)); + REQUIRE(decrypt_result.success); + REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); + free(encrypt_result.ciphertext.data); + + // Verify pro + config::ProProof nil_proof = {}; + array_uc32 nil_hash = nil_proof.hash(); + bytes32 decrypt_result_pro_hash = pro_proof_hash(&decrypt_result.pro_proof); + REQUIRE(decrypt_result.pro_status == PRO_STATUS_NIL); // Pro was not attached + REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); + REQUIRE(std::memcmp( + decrypt_result_pro_hash.data, + nil_hash.data(), + sizeof(decrypt_result_pro_hash.data)) == 0); + + // Verify it is decryptable + SessionProtos::Content decrypt_content = {}; + REQUIRE(decrypt_content.ParseFromArray( + decrypt_result.content_plaintext.data, decrypt_result.content_plaintext.size)); + REQUIRE(decrypt_content.has_datamessage()); + const SessionProtos::DataMessage& data = decrypt_content.datamessage(); + REQUIRE(data.body() == data_body); + free(decrypt_result.content_plaintext.data); + } + + // Generate the user's Session Pro rotating key for testing encrypted payloads with Session + // Pro metadata + const auto user_pro_seed = + "0123456789abcdef0123456789abcdeff00baa00000000000000000000000000"_hexbytes; + array_uc32 user_pro_ed_pk; + array_uc64 user_pro_ed_sk; + crypto_sign_ed25519_seed_keypair( + user_pro_ed_pk.data(), user_pro_ed_sk.data(), user_pro_seed.data()); + + // Build protobuf `Content` message, serialise to `plaintext` and get it signed by the user's + // "Session Pro" key into `sig_over_plaintext_with_user_pro_key` + SerialisedProtobufContentWithProForTesting protobuf_content_with_pro = + build_protobuf_content_with_session_pro( + /*data_body*/ data_body, + /*user_rotating_privkey*/ user_pro_ed_sk, + /*pro_backend_privkey*/ pro_backend_ed_sk, + /*pro_expiry_unix_ts*/ timestamp_s, + PRO_FEATURES_NIL); + + // Setup base destination object with the pro signature w/ Session pubkey 1 as the recipient + session_protocol_destination base_dest = {}; + base_dest.sent_timestamp_ms = timestamp_ms.count(); + base_dest.has_pro_sig = true; + std::memcpy( + base_dest.pro_sig, + protobuf_content_with_pro.sig_over_plaintext_with_user_pro_key.data(), + sizeof(base_dest.pro_sig)); + + REQUIRE(sizeof(base_dest.recipient_pubkey) == keys.session_pk1.size()); + std::memcpy(base_dest.recipient_pubkey, keys.session_pk1.data(), keys.session_pk1.size()); + + SECTION("Check non-encryptable messages produce only plaintext") { + auto dest_list = { + DESTINATION_TYPE_COMMUNITY, + DESTINATION_TYPE_COMMUNITY_INBOX, + DESTINATION_TYPE_CONTACT}; + + for (auto dest_type : dest_list) { + if (dest_type == DESTINATION_TYPE_COMMUNITY) + INFO("Trying community"); + else if (dest_type == DESTINATION_TYPE_COMMUNITY_INBOX) + INFO("Trying community inbox"); + else + INFO("Trying contacts to non-default namespace"); + + session_protocol_destination dest = base_dest; + dest.type = dest_type; + + NAMESPACE space = NAMESPACE_DEFAULT; + if (dest_type == DESTINATION_TYPE_CONTACT) { + space = NAMESPACE_CONTACTS; + } else if (dest_type == DESTINATION_TYPE_COMMUNITY_INBOX) { + auto [blind15_pk, blind15_sk] = session::blind15_key_pair( + keys.ed_sk1, keys.ed_pk1, /*blind factor*/ nullptr); + dest.recipient_pubkey[0] = 0x15; + std::memcpy(dest.recipient_pubkey + 1, blind15_pk.data(), blind15_pk.size()); + } + + session_protocol_encrypted_for_destination encrypt_result = + session_protocol_encrypt_for_destination( + protobuf_content_with_pro.plaintext.data(), + protobuf_content_with_pro.plaintext.size(), + keys.ed_sk0.data(), + keys.ed_sk0.size(), + &dest, + space, + error, + sizeof(error)); + + if (dest_type == DESTINATION_TYPE_COMMUNITY_INBOX) { + REQUIRE(encrypt_result.encrypted); + REQUIRE(encrypt_result.ciphertext.size > 0); + } else { + REQUIRE_FALSE(encrypt_result.encrypted); + REQUIRE(encrypt_result.ciphertext.size == 0); + } + REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); + free(encrypt_result.ciphertext.data); + } + } + + SECTION("Encrypt/decrypt for contact in default namespace with Pro") { + // Encrypt content + session_protocol_encrypted_for_destination encrypt_result = {}; + { + session_protocol_destination dest = base_dest; + dest.type = DESTINATION_TYPE_CONTACT; + encrypt_result = session_protocol_encrypt_for_destination( + protobuf_content_with_pro.plaintext.data(), + protobuf_content_with_pro.plaintext.size(), + keys.ed_sk0.data(), + keys.ed_sk0.size(), + &dest, + NAMESPACE_DEFAULT, + error, + sizeof(error)); + REQUIRE(encrypt_result.encrypted); + REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); + } + + // Decrypt envelope + span_u8 key = {keys.ed_sk1.data(), keys.ed_sk1.size()}; + session_protocol_decrypt_envelope_keys decrypt_keys = {}; + decrypt_keys.ed25519_privkeys = &key; + decrypt_keys.ed25519_privkeys_len = 1; + session_protocol_decrypted_envelope decrypt_result = session_protocol_decrypt_envelope( + &decrypt_keys, + encrypt_result.ciphertext.data, + encrypt_result.ciphertext.size, + timestamp_s.time_since_epoch().count(), + pro_backend_ed_pk.data(), + pro_backend_ed_pk.size(), + error, + sizeof(error)); + REQUIRE(decrypt_result.success); + REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); + free(encrypt_result.ciphertext.data); + + // Verify pro + REQUIRE(decrypt_result.pro_status == PRO_STATUS_VALID); // Pro was attached + bytes32 hash = pro_proof_hash(&decrypt_result.pro_proof); + REQUIRE(std::memcmp( + hash.data, + protobuf_content_with_pro.pro_proof_hash.data(), + sizeof(hash.data)) == 0); + REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); // No features requested + + // Verify the content can be parsed w/ protobufs + SessionProtos::Content decrypt_content = {}; + REQUIRE(decrypt_content.ParseFromArray( + decrypt_result.content_plaintext.data, decrypt_result.content_plaintext.size)); + REQUIRE(decrypt_content.has_datamessage()); + const SessionProtos::DataMessage& data = decrypt_content.datamessage(); + REQUIRE(data.body() == data_body); + free(decrypt_result.content_plaintext.data); + } + + SECTION("Encrypt/decrypt for contact in default namespace with Pro + features") { + + std::string large_message; + large_message.resize(PRO_STANDARD_CHARACTER_LIMIT + 1); + + PRO_FEATURES features = + get_pro_features_for_msg(large_message.size(), PRO_EXTRA_FEATURES_PRO_BADGE); + REQUIRE(features == (PRO_FEATURES_10K_CHARACTER_LIMIT | PRO_FEATURES_PRO_BADGE)); + + SerialisedProtobufContentWithProForTesting protobuf_content_with_pro_and_features = + build_protobuf_content_with_session_pro( + /*data_body*/ large_message, + /*user_rotating_privkey*/ user_pro_ed_sk, + /*pro_backend_privkey*/ pro_backend_ed_sk, + /*pro_expiry_unix_ts*/ timestamp_s, + features); + + // Encrypt content + session_protocol_encrypted_for_destination encrypt_result = {}; + { + session_protocol_destination dest = base_dest; + dest.type = DESTINATION_TYPE_CONTACT; + std::memcpy( + dest.pro_sig, + protobuf_content_with_pro_and_features.sig_over_plaintext_with_user_pro_key + .data(), + sizeof(dest.pro_sig)); + + encrypt_result = session_protocol_encrypt_for_destination( + protobuf_content_with_pro_and_features.plaintext.data(), + protobuf_content_with_pro_and_features.plaintext.size(), + keys.ed_sk0.data(), + keys.ed_sk0.size(), + &dest, + NAMESPACE_DEFAULT, + error, + sizeof(error)); + REQUIRE(encrypt_result.encrypted); + REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); + } + + // Decrypt envelope + span_u8 key = {keys.ed_sk1.data(), keys.ed_sk1.size()}; + session_protocol_decrypt_envelope_keys decrypt_keys = {}; + decrypt_keys.ed25519_privkeys = &key; + decrypt_keys.ed25519_privkeys_len = 1; + session_protocol_decrypted_envelope decrypt_result = session_protocol_decrypt_envelope( + &decrypt_keys, + encrypt_result.ciphertext.data, + encrypt_result.ciphertext.size, + timestamp_s.time_since_epoch().count(), + pro_backend_ed_pk.data(), + pro_backend_ed_pk.size(), + error, + sizeof(error)); + REQUIRE(decrypt_result.success); + REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); + free(encrypt_result.ciphertext.data); + + // Verify pro + REQUIRE(decrypt_result.pro_status == PRO_STATUS_VALID); // Pro was attached + bytes32 hash = pro_proof_hash(&decrypt_result.pro_proof); + REQUIRE(std::memcmp( + hash.data, + protobuf_content_with_pro.pro_proof_hash.data(), + sizeof(hash.data)) == 0); + REQUIRE(decrypt_result.pro_features == + (PRO_FEATURES_10K_CHARACTER_LIMIT | PRO_FEATURES_PRO_BADGE)); + + // Verify the content can be parsed w/ protobufs + SessionProtos::Content decrypt_content = {}; + REQUIRE(decrypt_content.ParseFromArray( + decrypt_result.content_plaintext.data, decrypt_result.content_plaintext.size)); + REQUIRE(decrypt_content.has_datamessage()); + const SessionProtos::DataMessage& data = decrypt_content.datamessage(); + REQUIRE(data.body() == large_message); + free(decrypt_result.content_plaintext.data); + } + + SECTION("Encrypt/decrypt for legacy groups (w/ encrypted envelope, plaintext content) with " + "Pro") { + // Encrypt + session_protocol_encrypted_for_destination encrypt_result = {}; + { + session_protocol_destination dest = base_dest; + dest.type = DESTINATION_TYPE_GROUP; + assert(dest.recipient_pubkey[0] == 0x05); + + encrypt_result = session_protocol_encrypt_for_destination( + protobuf_content_with_pro.plaintext.data(), + protobuf_content_with_pro.plaintext.size(), + keys.ed_sk0.data(), + keys.ed_sk0.size(), + &dest, + NAMESPACE_DEFAULT, + error, + sizeof(error)); + REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); + REQUIRE(encrypt_result.success); + REQUIRE(encrypt_result.encrypted); + } + + // Legacy groups wrap in websocket message + WebSocketProtos::WebSocketMessage ws_msg; + REQUIRE(ws_msg.ParseFromArray( + encrypt_result.ciphertext.data, encrypt_result.ciphertext.size)); + REQUIRE(ws_msg.has_request()); + REQUIRE(ws_msg.request().has_body()); + free(encrypt_result.ciphertext.data); + + // Decrypt envelope + span_u8 key = {keys.ed_sk1.data(), keys.ed_sk1.size()}; + session_protocol_decrypt_envelope_keys decrypt_keys = {}; + decrypt_keys.ed25519_privkeys = &key; + decrypt_keys.ed25519_privkeys_len = 1; + session_protocol_decrypted_envelope decrypt_result = session_protocol_decrypt_envelope( + &decrypt_keys, + ws_msg.request().body().data(), + ws_msg.request().body().size(), + timestamp_s.time_since_epoch().count(), + pro_backend_ed_pk.data(), + pro_backend_ed_pk.size(), + error, + sizeof(error)); + REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); + REQUIRE(decrypt_result.success); + + // Verify pro + REQUIRE(decrypt_result.pro_status == PRO_STATUS_VALID); // Pro was attached + bytes32 hash = pro_proof_hash(&decrypt_result.pro_proof); + REQUIRE(std::memcmp( + hash.data, + protobuf_content_with_pro.pro_proof_hash.data(), + sizeof(hash.data)) == 0); + REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); // No features requested + + // Verify the content can be parsed w/ protobufs + SessionProtos::Content decrypt_content = {}; + REQUIRE(decrypt_content.ParseFromArray( + decrypt_result.content_plaintext.data, decrypt_result.content_plaintext.size)); + REQUIRE(decrypt_content.has_datamessage()); + const SessionProtos::DataMessage& data = decrypt_content.datamessage(); + REQUIRE(data.body() == data_body); + free(decrypt_result.content_plaintext.data); + } + + SECTION("Encrypt/decrypt for groups v2 (w/ encrypted envelope, plaintext content) with Pro") { + // TODO: Finish setting up a fake group + const auto group_v2_seed = + "0123456789abcdef0123456789abcdeff00baadeadb33f000000000000000000"_hexbytes; + array_uc64 group_v2_sk = {}; + array_uc32 group_v2_pk = {}; + crypto_sign_ed25519_seed_keypair( + group_v2_pk.data(), group_v2_sk.data(), group_v2_seed.data()); + + auto group_v2_info = config::groups::Info(group_v2_pk, group_v2_sk, std::nullopt); + auto group_v2_members = config::groups::Members(group_v2_pk, group_v2_sk, std::nullopt); + auto group_v2_keys = config::groups::Keys( + keys.ed_sk0, + group_v2_pk, + group_v2_sk, + std::nullopt, + group_v2_info, + group_v2_members); + + // Encrypt +#if 0 + EncryptedForDestination encrypt_result = {}; + { + Destination dest = base_dest; + dest.type = DestinationType::Group; + dest.group_pubkey[0] = 0x03; + std::memcpy(dest.group_pubkey.data() + 1, group_v2_pk.data(), group_v2_pk.size()); + dest.group_keys = &group_v2_keys; + + encrypt_result = session::encrypt_for_destination( + to_span(protobuf_content_with_pro.plaintext), + keys.ed_sk0, + dest, + config::Namespace::GroupMessages); + REQUIRE(encrypt_result.encrypted); + } + + // Decrypt envelope + DecryptEnvelopeKey decrypt_keys = {}; + decrypt_keys.use_group_keys = true; + decrypt_keys.group_keys = &group_v2_keys; + + // TODO: Finish setting up a group so we can check the decrypted result for now this will + // throw because the keys aren't setup correctly. + CHECK_THROWS(session::decrypt_envelope( + decrypt_keys, encrypt_result.ciphertext, timestamp_s, pro_backend_ed_pk)); +#endif + } + + SECTION("Encrypt/decrypt for sync messages with Pro") { + // Encrypt + session_protocol_encrypted_for_destination encrypt_result = {}; + { + session_protocol_destination dest = base_dest; + dest.type = DESTINATION_TYPE_SYNC_MESSAGE; + encrypt_result = session_protocol_encrypt_for_destination( + protobuf_content_with_pro.plaintext.data(), + protobuf_content_with_pro.plaintext.size(), + keys.ed_sk0.data(), + keys.ed_sk0.size(), + &dest, + NAMESPACE_DEFAULT, + error, + sizeof(error)); + REQUIRE(encrypt_result.encrypted); + REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); + } + + // Decrypt + span_u8 key = {keys.ed_sk1.data(), keys.ed_sk1.size()}; + session_protocol_decrypt_envelope_keys decrypt_keys = {}; + decrypt_keys.ed25519_privkeys = &key; + decrypt_keys.ed25519_privkeys_len = 1; + { + session_protocol_decrypted_envelope decrypt_result = session_protocol_decrypt_envelope( + &decrypt_keys, + encrypt_result.ciphertext.data, + encrypt_result.ciphertext.size, + timestamp_s.time_since_epoch().count(), + pro_backend_ed_pk.data(), + pro_backend_ed_pk.size(), + error, + sizeof(error)); + REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); + REQUIRE(decrypt_result.success); + + // Verify pro + REQUIRE(decrypt_result.pro_status == PRO_STATUS_VALID); // Pro was attached + bytes32 hash = pro_proof_hash(&decrypt_result.pro_proof); + REQUIRE(std::memcmp( + hash.data, + protobuf_content_with_pro.pro_proof_hash.data(), + sizeof(hash.data)) == 0); + REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); // No features requested + + // Verify the content can be parsed w/ protobufs + SessionProtos::Content decrypt_content = {}; + REQUIRE(decrypt_content.ParseFromArray( + decrypt_result.content_plaintext.data, decrypt_result.content_plaintext.size)); + REQUIRE(decrypt_content.has_datamessage()); + const SessionProtos::DataMessage& data = decrypt_content.datamessage(); + REQUIRE(data.body() == data_body); + free(decrypt_result.content_plaintext.data); + } + + // Try decrypt with a timestamp past the pro proof expiry date + { + session_protocol_decrypted_envelope decrypt_result = + session_protocol_decrypt_envelope( + &decrypt_keys, + encrypt_result.ciphertext.data, + encrypt_result.ciphertext.size, + protobuf_content_with_pro.proof.expiry_unix_ts.time_since_epoch() + .count() + + 1, + pro_backend_ed_pk.data(), + pro_backend_ed_pk.size(), + error, + sizeof(error)); + REQUIRE(decrypt_result.success); + REQUIRE(decrypt_result.pro_status == PRO_STATUS_EXPIRED); + REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); + free(decrypt_result.content_plaintext.data); + } + + // Try decrypt with a bad backend key + { + array_uc32 bad_pro_backend_ed_pk = pro_backend_ed_pk; + bad_pro_backend_ed_pk[0] ^= 1; + session_protocol_decrypted_envelope decrypt_result = + session_protocol_decrypt_envelope( + &decrypt_keys, + encrypt_result.ciphertext.data, + encrypt_result.ciphertext.size, + protobuf_content_with_pro.proof.expiry_unix_ts.time_since_epoch() + .count(), + bad_pro_backend_ed_pk.data(), + bad_pro_backend_ed_pk.size(), + error, + sizeof(error)); + REQUIRE(decrypt_result.success); + REQUIRE(decrypt_result.pro_status == PRO_STATUS_INVALID_PRO_BACKEND_SIG); + REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); + free(decrypt_result.content_plaintext.data); + } + + // Try decrypt with bad key (ed_sk0 which was the sender; ed_sk1 the recipient) + span_u8 bad_key = {keys.ed_sk0.data(), keys.ed_sk0.size()}; + { + session_protocol_decrypt_envelope_keys bad_decrypt_keys = {}; + bad_decrypt_keys.ed25519_privkeys = &bad_key; + bad_decrypt_keys.ed25519_privkeys_len = 1; + session_protocol_decrypted_envelope decrypt_result = session_protocol_decrypt_envelope( + &bad_decrypt_keys, + encrypt_result.ciphertext.data, + encrypt_result.ciphertext.size, + protobuf_content_with_pro.proof.expiry_unix_ts.time_since_epoch().count(), + pro_backend_ed_pk.data(), + pro_backend_ed_pk.size(), + error, + sizeof(error)); + INFO("Checking error from bad envelope decryption: " << std::string_view( + error, decrypt_result.error_len_incl_null_terminator - 1)); + REQUIRE(!decrypt_result.success); + REQUIRE(decrypt_result.error_len_incl_null_terminator > 0); + REQUIRE(decrypt_result.error_len_incl_null_terminator <= sizeof(error)); + free(decrypt_result.content_plaintext.data); + } + + // Try decrypt with multiple keys, 1 bad, 1 good key + { + auto key_list = std::array{bad_key, key}; + session_protocol_decrypt_envelope_keys multi_decrypt_keys = {}; + multi_decrypt_keys.ed25519_privkeys = key_list.data(); + multi_decrypt_keys.ed25519_privkeys_len = key_list.size(); + session_protocol_decrypted_envelope decrypt_result = + session_protocol_decrypt_envelope( + &multi_decrypt_keys, + encrypt_result.ciphertext.data, + encrypt_result.ciphertext.size, + protobuf_content_with_pro.proof.expiry_unix_ts.time_since_epoch() + .count(), + pro_backend_ed_pk.data(), + pro_backend_ed_pk.size(), + error, + sizeof(error)); + REQUIRE(decrypt_result.success); + REQUIRE(decrypt_result.pro_status == PRO_STATUS_VALID); + REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); + free(decrypt_result.content_plaintext.data); + } + free(encrypt_result.ciphertext.data); + } + + SECTION("Encrypt/decrypt for sync messages with Pro and bad rotating signature") { + session_protocol_encrypted_for_destination encrypt_result = {}; + { + session_protocol_destination dest = base_dest; + dest.type = DESTINATION_TYPE_SYNC_MESSAGE; + dest.has_pro_sig = true; + dest.pro_sig[0] ^= 1; // Break the sig by flipping a bit + encrypt_result = session_protocol_encrypt_for_destination( + protobuf_content_with_pro.plaintext.data(), + protobuf_content_with_pro.plaintext.size(), + keys.ed_sk0.data(), + keys.ed_sk0.size(), + &dest, + NAMESPACE_DEFAULT, + error, + sizeof(error)); + REQUIRE(encrypt_result.encrypted); + REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); + } + + span_u8 key = {keys.ed_sk1.data(), keys.ed_sk1.size()}; + session_protocol_decrypt_envelope_keys decrypt_keys = {}; + decrypt_keys.ed25519_privkeys = &key; + decrypt_keys.ed25519_privkeys_len = 1; + session_protocol_decrypted_envelope decrypt_result = session_protocol_decrypt_envelope( + &decrypt_keys, + encrypt_result.ciphertext.data, + encrypt_result.ciphertext.size, + timestamp_s.time_since_epoch().count(), + pro_backend_ed_pk.data(), + pro_backend_ed_pk.size(), + error, + sizeof(error)); + REQUIRE(decrypt_result.success); + REQUIRE(decrypt_result.pro_status == PRO_STATUS_INVALID_USER_SIG); + REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); + free(encrypt_result.ciphertext.data); + free(decrypt_result.content_plaintext.data); + } +} diff --git a/tests/utils.hpp b/tests/utils.hpp index e03a93b2..ce801905 100644 --- a/tests/utils.hpp +++ b/tests/utils.hpp @@ -152,7 +152,7 @@ static inline TestKeys get_deterministic_test_keys() { crypto_sign_ed25519_seed_keypair(result.ed_pk0.data(), result.ed_sk0.data(), result.seed0.data()); // X25519 - bool converted = crypto_sign_ed25519_pk_to_curve25519(result.curve_pk0.data(), result.ed_pk0.data()); + bool converted = crypto_sign_ed25519_pk_to_curve25519(result.curve_pk0.data(), result.ed_pk0.data()) == 0; assert(converted); // Session PK @@ -170,7 +170,7 @@ static inline TestKeys get_deterministic_test_keys() { crypto_sign_ed25519_seed_keypair(result.ed_pk1.data(), result.ed_sk1.data(), result.seed1.data()); // X25519 - bool converted = crypto_sign_ed25519_pk_to_curve25519(result.curve_pk1.data(), result.ed_pk1.data()); + bool converted = crypto_sign_ed25519_pk_to_curve25519(result.curve_pk1.data(), result.ed_pk1.data()) == 0; assert(converted); // Session PK From 7afeb59ae4b627c799220564a13348b4a08e7b7a Mon Sep 17 00:00:00 2001 From: doylet Date: Wed, 20 Aug 2025 12:12:50 +1000 Subject: [PATCH 39/59] Add TODO on the purpose of PUBKEY in pro_backend --- include/session/pro_backend.hpp | 3 +++ src/pro_backend.cpp | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/session/pro_backend.hpp b/include/session/pro_backend.hpp index 442f15ab..9a05d08c 100644 --- a/include/session/pro_backend.hpp +++ b/include/session/pro_backend.hpp @@ -5,9 +5,12 @@ namespace session::pro_backend { +/// TODO: Assign the Session Pro backend public key for verifying proofs to allow users of the +/// library to have the pubkey available for verifying proofs. constexpr array_uc32 PUBKEY = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; +static_assert(sizeof(PUBKEY) == array_uc32{}.size()); struct add_payment_request { std::uint8_t version; diff --git a/src/pro_backend.cpp b/src/pro_backend.cpp index a40299a5..f54d5bf8 100644 --- a/src/pro_backend.cpp +++ b/src/pro_backend.cpp @@ -8,8 +8,6 @@ #include namespace session::pro_backend { - -static_assert(PUBKEY.size() == crypto_sign_ed25519_PUBLICKEYBYTES); master_rotating_sigs build_get_proof_sigs( const array_uc64& master_privkey, const array_uc64& rotating_privkey, From 633b199c15967847710c8e97d1aada6368a85b0f Mon Sep 17 00:00:00 2001 From: doylet Date: Wed, 20 Aug 2025 12:17:29 +1000 Subject: [PATCH 40/59] Add note that character limit is UTF16 code units for now --- include/session/session_protocol.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index 52419079..8e892b8b 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -15,10 +15,20 @@ extern "C" { #endif enum { - /// Number of characters that a standard message can use. If the message exceeds this then the - /// message must activate the higher character limit feature provided by Session Pro which - /// allows messages up to 10k characters. + /// TODO: This comment needs to be updated to be _codepoints_ once libsession implements the + /// character count for the platforms. Currently they use code units but it should be + /// codepoints. This allows the platforms to use their native text representation up until the + /// API boundary where they will convert to UTF8 to have it managed by libsession. + + /// Maximum number of UTF16 code units that a standard message can use. If the message exceeds + /// this then the message must activate the higher character limit feature provided by Session + /// Pro which allows messages up to 10k characters. PRO_STANDARD_CHARACTER_LIMIT = 2'000, + + /// Maximum number of UTF16 code units that a Session Pro entitled user can send in a message. + /// This is not used in the codebase, but is provided for convenience to centralise protocol + /// definitions for users of the library to consume. + PRO_HIGHER_CHARACTER_LIMIT = 10'000, }; // Bit flags for features that are not currently able to be determined by the state stored in From 608b6a5058a396ed89399ae696960e28f3766c3e Mon Sep 17 00:00:00 2001 From: doylet Date: Wed, 20 Aug 2025 12:43:40 +1000 Subject: [PATCH 41/59] Remove outdated comment, these encrypt dests just receive plaintext --- src/session_protocol.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index bdeb1023..c62aaec3 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -114,8 +114,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( } else if (space == config::Namespace::RevokedRetrievableGroupMessages) { enc.mode = Mode::Plaintext; } else { - // Config messages should be sent directly rather than via this method (just - // return plaintext and no-op). See: + // See: // https://github.com/session-foundation/session-ios/blob/82deef869d0f7389b799295817f42ad14f8a1316/SessionMessagingKit/Sending%20%26%20Receiving/MessageSender.swift#L494 enc.mode = Mode::Plaintext; } @@ -137,8 +136,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( enc.envelope_type = SessionProtos::Envelope_Type::Envelope_Type_SESSION_MESSAGE; enc.after_envelope = AfterEnvelope::EnvelopeIsCipherText; } else { - // Config messages should be sent directly rather than via this method (return just - // the plaintext and no-op) See: + // See: // https://github.com/session-foundation/session-ios/blob/82deef869d0f7389b799295817f42ad14f8a1316/SessionMessagingKit/Sending%20%26%20Receiving/MessageSender.swift#L498 enc.mode = Mode::Plaintext; } From f7e5a5420d71ee9b9c8f026811831ea08805bae2 Mon Sep 17 00:00:00 2001 From: doylet Date: Wed, 20 Aug 2025 12:49:04 +1000 Subject: [PATCH 42/59] Remove the CPP session protocol tests, keep C API The C-API is a wrapper over the C-interface so it thunks into the C++ implementation anyway so it tests both the C and C++ api for us with a very few exceptions. But for the most part, testing the C API kills two birds with one stone and reduces the test maintenance overhead of having to manage 2 test suites in parallel for the same API. --- tests/test_session_protocol.cpp | 460 -------------------------------- 1 file changed, 460 deletions(-) diff --git a/tests/test_session_protocol.cpp b/tests/test_session_protocol.cpp index d87eb66b..18127983 100644 --- a/tests/test_session_protocol.cpp +++ b/tests/test_session_protocol.cpp @@ -79,466 +79,6 @@ static SerialisedProtobufContentWithProForTesting build_protobuf_content_with_se return result; } -TEST_CASE("Session protocol helpers", "[session-protocol][helpers]") { - - // Do tests that require no setup - SECTION("Ensure get pro fetaures detects large message") { - // Try a message below the size threshold - PRO_FEATURES features = get_pro_features_for_msg( - PRO_STANDARD_CHARACTER_LIMIT, - PRO_EXTRA_FEATURES_PRO_BADGE | PRO_EXTRA_FEATURES_ANIMATED_AVATAR); - REQUIRE(features == (PRO_FEATURES_PRO_BADGE | PRO_FEATURES_ANIMATED_AVATAR)); - - // Try a message exceeding the size threshold - features = get_pro_features_for_msg( - PRO_STANDARD_CHARACTER_LIMIT + 1, - PRO_EXTRA_FEATURES_PRO_BADGE | PRO_EXTRA_FEATURES_ANIMATED_AVATAR); - REQUIRE(features == (PRO_FEATURES_10K_CHARACTER_LIMIT | PRO_FEATURES_PRO_BADGE | - PRO_FEATURES_ANIMATED_AVATAR)); - - // Try asking for just one extra feature - features = get_pro_features_for_msg(100, PRO_EXTRA_FEATURES_PRO_BADGE); - REQUIRE(features == PRO_FEATURES_PRO_BADGE); - } - - // Tests that require some setup code - using namespace session; - TestKeys keys = get_deterministic_test_keys(); - - // Tuesday, 12 August 2025 03:58:21 UTC - const std::chrono::milliseconds timestamp_ms = std::chrono::seconds(1754971101); - const std::chrono::sys_seconds timestamp_s = std::chrono::sys_seconds( - std::chrono::duration_cast(timestamp_ms)); - const std::string_view data_body = "hello"; - - SECTION("Encrypt with and w/o pro sig produce same payload size") { - // Same payload size because the encrypt function should put in a dummy signature if one - // wasn't specific to make pro and non-pro envelopes indistinguishable. - session::Destination dest = {}; - dest.type = DestinationType::Contact; - dest.sent_timestamp_ms = timestamp_ms; - dest.recipient_pubkey = keys.session_pk1; - - // Withhold the pro signature - dest.pro_sig = std::nullopt; - EncryptedForDestination encrypt_without_pro_sig = encrypt_for_destination( - to_span(data_body), keys.ed_sk0, dest, config::Namespace::Default); - - // Set the pro signature - dest.pro_sig.emplace(); - EncryptedForDestination encrypt_with_pro_sig = encrypt_for_destination( - to_span(data_body), keys.ed_sk0, dest, config::Namespace::Default); - - REQUIRE(encrypt_without_pro_sig.encrypted); - REQUIRE(encrypt_with_pro_sig.encrypted); - - // Should have the same payload size - REQUIRE(encrypt_without_pro_sig.ciphertext.size() == - encrypt_with_pro_sig.ciphertext.size()); - } - - // Setup a dummy "Session Pro Backend" key - // We reuse test key 1 as the "Session Pro" backend key that signs the proofs as it - // doesn't matter what key really, just that we have one available for signing. - const array_uc64& pro_backend_ed_sk = keys.ed_sk1; - const array_uc32& pro_backend_ed_pk = keys.ed_pk1; - - SECTION("Encrypt/decrypt for contact in default namespace w/o pro attached") { - // Build content without pro attached - std::string plaintext; - { - SessionProtos::Content content = {}; - SessionProtos::DataMessage* data = content.mutable_datamessage(); - data->set_body(std::string(data_body)); - plaintext = content.SerializeAsString(); - REQUIRE(plaintext.size() > data_body.size()); - } - - // Encrypt - EncryptedForDestination encrypt_result = {}; - { - session::Destination dest = {}; - dest.type = DestinationType::Contact; - dest.sent_timestamp_ms = timestamp_ms; - REQUIRE(dest.recipient_pubkey.size() == keys.session_pk1.size()); - std::memcpy( - dest.recipient_pubkey.data(), keys.session_pk1.data(), keys.session_pk1.size()); - - encrypt_result = session::encrypt_for_destination( - to_span(plaintext), keys.ed_sk0, dest, config::Namespace::Default); - REQUIRE(encrypt_result.encrypted); - } - - // Decrypt envelope - std::span key = keys.ed_sk1; - DecryptEnvelopeKey decrypt_keys = {}; - decrypt_keys.ed25519_privkeys = {&key, 1}; - DecryptedEnvelope decrypt_result = session::decrypt_envelope( - decrypt_keys, encrypt_result.ciphertext, timestamp_s, pro_backend_ed_pk); - - // Verify pro - config::ProProof nil_proof = {}; - REQUIRE(decrypt_result.pro_status == ProStatus::Nil); // Pro was not attached - REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); - REQUIRE(decrypt_result.pro_proof.hash() == nil_proof.hash()); - - // Verify it is decryptable - SessionProtos::Content decrypt_content = {}; - REQUIRE(decrypt_content.ParseFromArray( - decrypt_result.content_plaintext.data(), decrypt_result.content_plaintext.size())); - REQUIRE(decrypt_content.has_datamessage()); - const SessionProtos::DataMessage& data = decrypt_content.datamessage(); - REQUIRE(data.body() == data_body); - } - - // Generate the user's Session Pro rotating key for testing encrypted payloads with Session - // Pro metadata - const auto user_pro_seed = - "0123456789abcdef0123456789abcdeff00baa00000000000000000000000000"_hexbytes; - array_uc32 user_pro_ed_pk; - array_uc64 user_pro_ed_sk; - crypto_sign_ed25519_seed_keypair( - user_pro_ed_pk.data(), user_pro_ed_sk.data(), user_pro_seed.data()); - - // Build protobuf `Content` message, serialise to `plaintext` and get it signed by the user's - // "Session Pro" key into `sig_over_plaintext_with_user_pro_key` - SerialisedProtobufContentWithProForTesting protobuf_content_with_pro = - build_protobuf_content_with_session_pro( - /*data_body*/ data_body, - /*user_rotating_privkey*/ user_pro_ed_sk, - /*pro_backend_privkey*/ pro_backend_ed_sk, - /*pro_expiry_unix_ts*/ timestamp_s, - PRO_FEATURES_NIL); - - // Setup base destination object with the pro signature w/ Session pubkey 1 as the recipient - session::Destination base_dest = {}; - base_dest.sent_timestamp_ms = timestamp_ms; - base_dest.pro_sig = protobuf_content_with_pro.sig_over_plaintext_with_user_pro_key; - REQUIRE(base_dest.recipient_pubkey.size() == keys.session_pk1.size()); - std::memcpy( - base_dest.recipient_pubkey.data(), keys.session_pk1.data(), keys.session_pk1.size()); - - SECTION("Check non-encryptable messages produce only plaintext") { - auto dest_list = { - DestinationType::Community, - DestinationType::CommunityInbox, - DestinationType::Contact}; - - for (auto dest_type : dest_list) { - if (dest_type == DestinationType::Community) - INFO("Trying community"); - else if (dest_type == DestinationType::CommunityInbox) - INFO("Trying community inbox"); - else - INFO("Trying contacts to non-default namespace"); - - session::Destination dest = base_dest; - dest.type = dest_type; - - config::Namespace space = config::Namespace::Default; - if (dest_type == DestinationType::Contact) { - space = config::Namespace::Contacts; - } else if (dest_type == DestinationType::CommunityInbox) { - auto [blind15_pk, blind15_sk] = session::blind15_key_pair( - keys.ed_sk1, keys.ed_pk1, /*blind factor*/ nullptr); - dest.recipient_pubkey[0] = 0x15; - std::memcpy(dest.recipient_pubkey.data() + 1, blind15_pk.data(), blind15_pk.size()); - } - - EncryptedForDestination encrypt_result = session::encrypt_for_destination( - to_span(protobuf_content_with_pro.plaintext), keys.ed_sk0, dest, space); - - if (dest_type == DestinationType::CommunityInbox) { - REQUIRE(encrypt_result.encrypted); - REQUIRE(encrypt_result.ciphertext.size()); - } else { - REQUIRE_FALSE(encrypt_result.encrypted); - REQUIRE(encrypt_result.ciphertext.empty()); - } - } - } - - SECTION("Encrypt/decrypt for contact in default namespace with Pro") { - // Encrypt content - EncryptedForDestination encrypt_result = {}; - { - session::Destination dest = base_dest; - dest.type = DestinationType::Contact; - encrypt_result = session::encrypt_for_destination( - to_span(protobuf_content_with_pro.plaintext), - keys.ed_sk0, - dest, - config::Namespace::Default); - REQUIRE(encrypt_result.encrypted); - } - - // Decrypt envelope - std::span key = keys.ed_sk1; - DecryptEnvelopeKey decrypt_keys = {}; - decrypt_keys.ed25519_privkeys = {&key, 1}; - DecryptedEnvelope decrypt_result = session::decrypt_envelope( - decrypt_keys, encrypt_result.ciphertext, timestamp_s, pro_backend_ed_pk); - - // Verify pro - REQUIRE(decrypt_result.pro_status == ProStatus::Valid); // Pro was attached - REQUIRE(decrypt_result.pro_proof.hash() == protobuf_content_with_pro.pro_proof_hash); - REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); // No features requested - - // Verify the content can be parsed w/ protobufs - SessionProtos::Content decrypt_content = {}; - REQUIRE(decrypt_content.ParseFromArray( - decrypt_result.content_plaintext.data(), decrypt_result.content_plaintext.size())); - REQUIRE(decrypt_content.has_datamessage()); - const SessionProtos::DataMessage& data = decrypt_content.datamessage(); - REQUIRE(data.body() == data_body); - } - - SECTION("Encrypt/decrypt for contact in default namespace with Pro + features") { - - std::string large_message; - large_message.resize(PRO_STANDARD_CHARACTER_LIMIT + 1); - - PRO_FEATURES features = - get_pro_features_for_msg(large_message.size(), PRO_EXTRA_FEATURES_PRO_BADGE); - REQUIRE(features == (PRO_FEATURES_10K_CHARACTER_LIMIT | PRO_FEATURES_PRO_BADGE)); - - SerialisedProtobufContentWithProForTesting protobuf_content_with_pro_and_features = - build_protobuf_content_with_session_pro( - /*data_body*/ large_message, - /*user_rotating_privkey*/ user_pro_ed_sk, - /*pro_backend_privkey*/ pro_backend_ed_sk, - /*pro_expiry_unix_ts*/ timestamp_s, - features); - - // Encrypt content - EncryptedForDestination encrypt_result = {}; - { - session::Destination dest = base_dest; - dest.type = DestinationType::Contact; - dest.pro_sig = - protobuf_content_with_pro_and_features.sig_over_plaintext_with_user_pro_key; - encrypt_result = session::encrypt_for_destination( - to_span(protobuf_content_with_pro_and_features.plaintext), - keys.ed_sk0, - dest, - config::Namespace::Default); - REQUIRE(encrypt_result.encrypted); - } - - // Decrypt envelope - std::span key = keys.ed_sk1; - DecryptEnvelopeKey decrypt_keys = {}; - decrypt_keys.ed25519_privkeys = {&key, 1}; - DecryptedEnvelope decrypt_result = session::decrypt_envelope( - decrypt_keys, encrypt_result.ciphertext, timestamp_s, pro_backend_ed_pk); - - // Verify pro - REQUIRE(decrypt_result.pro_status == ProStatus::Valid); // Pro was attached - REQUIRE(decrypt_result.pro_proof.hash() == - protobuf_content_with_pro_and_features.pro_proof_hash); - REQUIRE(decrypt_result.pro_features == - (PRO_FEATURES_10K_CHARACTER_LIMIT | PRO_FEATURES_PRO_BADGE)); - - // Verify the content can be parsed w/ protobufs - SessionProtos::Content decrypt_content = {}; - REQUIRE(decrypt_content.ParseFromArray( - decrypt_result.content_plaintext.data(), decrypt_result.content_plaintext.size())); - REQUIRE(decrypt_content.has_datamessage()); - const SessionProtos::DataMessage& data = decrypt_content.datamessage(); - REQUIRE(data.body() == large_message); - } - - SECTION("Encrypt/decrypt for legacy groups (w/ encrypted envelope, plaintext content) with " - "Pro") { - // Encrypt - EncryptedForDestination encrypt_result = {}; - { - Destination dest = base_dest; - dest.type = DestinationType::Group; - assert(dest.recipient_pubkey[0] == 0x05); - - encrypt_result = session::encrypt_for_destination( - to_span(protobuf_content_with_pro.plaintext), - keys.ed_sk0, - dest, - config::Namespace::Default); - REQUIRE(encrypt_result.encrypted); - } - - // Legacy groups wrap in websocket message - WebSocketProtos::WebSocketMessage ws_msg; - REQUIRE(ws_msg.ParseFromArray( - encrypt_result.ciphertext.data(), encrypt_result.ciphertext.size())); - REQUIRE(ws_msg.has_request()); - REQUIRE(ws_msg.request().has_body()); - - // Decrypt envelope - std::span key = keys.ed_sk1; - DecryptEnvelopeKey decrypt_keys = {}; - decrypt_keys.ed25519_privkeys = {&key, 1}; - DecryptedEnvelope decrypt_result = session::decrypt_envelope( - decrypt_keys, to_span(ws_msg.request().body()), timestamp_s, pro_backend_ed_pk); - - // Verify pro - REQUIRE(decrypt_result.pro_status == ProStatus::Valid); // Pro was attached - REQUIRE(decrypt_result.pro_proof.hash() == protobuf_content_with_pro.pro_proof_hash); - REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); // No features requested - - // Verify the content can be parsed w/ protobufs - SessionProtos::Content decrypt_content = {}; - REQUIRE(decrypt_content.ParseFromArray( - decrypt_result.content_plaintext.data(), decrypt_result.content_plaintext.size())); - REQUIRE(decrypt_content.has_datamessage()); - const SessionProtos::DataMessage& data = decrypt_content.datamessage(); - REQUIRE(data.body() == data_body); - } - - SECTION("Encrypt/decrypt for groups v2 (w/ encrypted envelope, plaintext content) with Pro") { - // TODO: Finish setting up a fake group - const auto group_v2_seed = - "0123456789abcdef0123456789abcdeff00baadeadb33f000000000000000000"_hexbytes; - array_uc64 group_v2_sk = {}; - array_uc32 group_v2_pk = {}; - crypto_sign_ed25519_seed_keypair( - group_v2_pk.data(), group_v2_sk.data(), group_v2_seed.data()); - - auto group_v2_info = config::groups::Info(group_v2_pk, group_v2_sk, std::nullopt); - auto group_v2_members = config::groups::Members(group_v2_pk, group_v2_sk, std::nullopt); - auto group_v2_keys = config::groups::Keys( - keys.ed_sk0, - group_v2_pk, - group_v2_sk, - std::nullopt, - group_v2_info, - group_v2_members); - - // Encrypt -#if 0 - EncryptedForDestination encrypt_result = {}; - { - Destination dest = base_dest; - dest.type = DestinationType::Group; - dest.group_pubkey[0] = 0x03; - std::memcpy(dest.group_pubkey.data() + 1, group_v2_pk.data(), group_v2_pk.size()); - dest.group_keys = &group_v2_keys; - - encrypt_result = session::encrypt_for_destination( - to_span(protobuf_content_with_pro.plaintext), - keys.ed_sk0, - dest, - config::Namespace::GroupMessages); - REQUIRE(encrypt_result.encrypted); - } - - // Decrypt envelope - DecryptEnvelopeKey decrypt_keys = {}; - decrypt_keys.use_group_keys = true; - decrypt_keys.group_keys = &group_v2_keys; - - // TODO: Finish setting up a group so we can check the decrypted result for now this will - // throw because the keys aren't setup correctly. - CHECK_THROWS(session::decrypt_envelope( - decrypt_keys, encrypt_result.ciphertext, timestamp_s, pro_backend_ed_pk)); -#endif - } - - SECTION("Encrypt/decrypt for sync messages with Pro") { - // Encrypt - EncryptedForDestination encrypt_result = {}; - { - session::Destination dest = base_dest; - dest.type = DestinationType::SyncMessage; - encrypt_result = session::encrypt_for_destination( - to_span(protobuf_content_with_pro.plaintext), - keys.ed_sk0, - dest, - config::Namespace::Default); - REQUIRE(encrypt_result.encrypted); - } - - // Decrypt envelope - std::span key = keys.ed_sk1; - DecryptEnvelopeKey decrypt_keys = {}; - decrypt_keys.ed25519_privkeys = {&key, 1}; - DecryptedEnvelope decrypt_result = session::decrypt_envelope( - decrypt_keys, encrypt_result.ciphertext, timestamp_s, pro_backend_ed_pk); - - // Verify pro - REQUIRE(decrypt_result.pro_status == ProStatus::Valid); // Pro was attached - REQUIRE(decrypt_result.pro_proof.hash() == protobuf_content_with_pro.pro_proof_hash); - REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); // No features requested - - // Verify the content can be parsed w/ protobufs - SessionProtos::Content decrypt_content = {}; - REQUIRE(decrypt_content.ParseFromArray( - decrypt_result.content_plaintext.data(), decrypt_result.content_plaintext.size())); - REQUIRE(decrypt_content.has_datamessage()); - const SessionProtos::DataMessage& data = decrypt_content.datamessage(); - REQUIRE(data.body() == data_body); - - // Try decrypt with a timestamp past the pro proof expiry date - DecryptedEnvelope decrypt_result_again = session::decrypt_envelope( - decrypt_keys, - encrypt_result.ciphertext, - protobuf_content_with_pro.proof.expiry_unix_ts + std::chrono::seconds(1), - pro_backend_ed_pk); - REQUIRE(decrypt_result_again.pro_status == ProStatus::Expired); - - // Try decrypt with a bad backend key - array_uc32 bad_pro_backend_ed_pk = pro_backend_ed_pk; - bad_pro_backend_ed_pk[0] ^= 1; - decrypt_result_again = session::decrypt_envelope( - decrypt_keys, - encrypt_result.ciphertext, - protobuf_content_with_pro.proof.expiry_unix_ts, - bad_pro_backend_ed_pk); - REQUIRE(decrypt_result_again.pro_status == ProStatus::InvalidProBackendSig); - - // Try decrypt with bad key (ed_sk0 which was the sender; ed_sk1 the recipient) - std::span bad_key = keys.ed_sk0; - DecryptEnvelopeKey bad_decrypt_keys = {}; - bad_decrypt_keys.ed25519_privkeys = {&bad_key, 1}; - REQUIRE_THROWS(session::decrypt_envelope( - bad_decrypt_keys, - encrypt_result.ciphertext, - protobuf_content_with_pro.proof.expiry_unix_ts, - pro_backend_ed_pk)); - - // Try decrypt with multiple keys, 1 bad, 1 good key - auto key_list = std::array{bad_key, key}; - DecryptEnvelopeKey multi_decrypt_keys = {}; - multi_decrypt_keys.ed25519_privkeys = key_list; - decrypt_result_again = session::decrypt_envelope( - multi_decrypt_keys, - encrypt_result.ciphertext, - protobuf_content_with_pro.proof.expiry_unix_ts, - pro_backend_ed_pk); - REQUIRE(decrypt_result_again.pro_status == ProStatus::Valid); - } - - SECTION("Encrypt/decrypt for sync messages with Pro and bad rotating signature") { - EncryptedForDestination encrypt_result = {}; - { - session::Destination dest = base_dest; - dest.type = DestinationType::SyncMessage; - (*dest.pro_sig)[0] ^= 1; // Break the sig by flipping a bit - encrypt_result = session::encrypt_for_destination( - to_span(protobuf_content_with_pro.plaintext), - keys.ed_sk0, - dest, - config::Namespace::Default); - REQUIRE(encrypt_result.encrypted); - } - - std::span key = keys.ed_sk1; - DecryptEnvelopeKey decrypt_keys = {}; - decrypt_keys.ed25519_privkeys = {&key, 1}; - DecryptedEnvelope decrypt_result = session::decrypt_envelope( - decrypt_keys, encrypt_result.ciphertext, timestamp_s, pro_backend_ed_pk); - REQUIRE(decrypt_result.pro_status == ProStatus::InvalidUserSig); - } -} - TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { // Do tests that require no setup From a068576cfb9500fc31c17f62bb8a2ee5ceba53f4 Mon Sep 17 00:00:00 2001 From: doylet Date: Wed, 20 Aug 2025 15:11:18 +1000 Subject: [PATCH 43/59] Fix groups message not encrypting correctly --- src/session_protocol.cpp | 16 +++++--- tests/test_session_protocol.cpp | 72 ++++++++++++++++++++------------- 2 files changed, 53 insertions(+), 35 deletions(-) diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index c62aaec3..847040d9 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -52,7 +52,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( std::span dest_recipient_pubkey, std::chrono::milliseconds dest_sent_timestamp_ms, std::span dest_community_inbox_server_pubkey, - std::span dest_group_pubkey, + std::span dest_group_ed25519_pubkey, std::span dest_group_ed25519_privkey, config::Namespace space, UseMalloc use_malloc) { @@ -60,7 +60,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( assert(dest_pro_sig.empty() || dest_pro_sig.size() == crypto_sign_ed25519_BYTES); assert(dest_recipient_pubkey.size() == 1 + crypto_sign_ed25519_PUBLICKEYBYTES); assert(dest_community_inbox_server_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); - assert(dest_group_pubkey.size() == 1 + crypto_sign_ed25519_PUBLICKEYBYTES); + assert(dest_group_ed25519_pubkey.size() == 1 + crypto_sign_ed25519_PUBLICKEYBYTES); assert(dest_group_ed25519_privkey.size() == 32 || dest_group_ed25519_privkey.size() == 64); // All incoming arguments are passed in from typed, fixed-sized arrays so we do not need to @@ -103,7 +103,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( switch (dest_type) { case DestinationType::Group: { bool has_03_prefix = - dest_group_pubkey[0] == static_cast(SessionIDPrefix::group); + dest_group_ed25519_pubkey[0] == static_cast(SessionIDPrefix::group); if (has_03_prefix) { if (space == config::Namespace::GroupMessages) { enc.mode = Mode::Envelope; @@ -125,7 +125,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( enc.envelope_type = SessionProtos::Envelope_Type::Envelope_Type_CLOSED_GROUP_MESSAGE; enc.after_envelope = AfterEnvelope::WrapInWSMessage; - enc.envelope_src = dest_group_pubkey; + enc.envelope_src = dest_group_ed25519_pubkey; } } break; @@ -223,9 +223,12 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( case AfterEnvelope::KeysEncryptMessage: { std::string bytes = envelope.SerializeAsString(); + if (dest_group_ed25519_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES + 1) + dest_group_ed25519_pubkey = dest_group_ed25519_pubkey.subspan(1); + std::vector ciphertext = encrypt_for_group( ed25519_privkey, - dest_group_pubkey, + dest_group_ed25519_pubkey, dest_group_ed25519_privkey, to_span(bytes), /*compress*/ true, @@ -330,7 +333,8 @@ DecryptedEnvelope decrypt_envelope( decrypt.session_id.size())}; // Update the plaintext to use the decrypted envelope - envelope_plaintext = std::move(decrypt.plaintext); + envelope_plaintext_from_group_keys = std::move(decrypt.plaintext); + envelope_plaintext = envelope_plaintext_from_group_keys; // Copy keys out assert(decrypt.session_id.starts_with("05")); diff --git a/tests/test_session_protocol.cpp b/tests/test_session_protocol.cpp index 18127983..39d1525d 100644 --- a/tests/test_session_protocol.cpp +++ b/tests/test_session_protocol.cpp @@ -528,44 +528,58 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { crypto_sign_ed25519_seed_keypair( group_v2_pk.data(), group_v2_sk.data(), group_v2_seed.data()); - auto group_v2_info = config::groups::Info(group_v2_pk, group_v2_sk, std::nullopt); - auto group_v2_members = config::groups::Members(group_v2_pk, group_v2_sk, std::nullopt); - auto group_v2_keys = config::groups::Keys( - keys.ed_sk0, - group_v2_pk, - group_v2_sk, - std::nullopt, - group_v2_info, - group_v2_members); - // Encrypt -#if 0 - EncryptedForDestination encrypt_result = {}; + session_protocol_encrypted_for_destination encrypt_result = {}; { - Destination dest = base_dest; - dest.type = DestinationType::Group; - dest.group_pubkey[0] = 0x03; - std::memcpy(dest.group_pubkey.data() + 1, group_v2_pk.data(), group_v2_pk.size()); - dest.group_keys = &group_v2_keys; - - encrypt_result = session::encrypt_for_destination( - to_span(protobuf_content_with_pro.plaintext), - keys.ed_sk0, - dest, - config::Namespace::GroupMessages); + session_protocol_destination dest = base_dest; + dest.type = DESTINATION_TYPE_GROUP; + dest.group_ed25519_pubkey[0] = 0x03; + std::memcpy(dest.group_ed25519_pubkey + 1, group_v2_pk.data(), group_v2_pk.size()); + std::memcpy( + dest.group_ed25519_privkey, + group_v2_sk.data(), + sizeof(dest.group_ed25519_privkey)); + + encrypt_result = session_protocol_encrypt_for_destination( + protobuf_content_with_pro.plaintext.data(), + protobuf_content_with_pro.plaintext.size(), + keys.ed_sk0.data(), + keys.ed_sk0.size(), + &dest, + NAMESPACE_GROUP_MESSAGES, + error, + sizeof(error)); + INFO("Encrypt for group error: " << error); + REQUIRE(encrypt_result.success); REQUIRE(encrypt_result.encrypted); + REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); } // Decrypt envelope - DecryptEnvelopeKey decrypt_keys = {}; - decrypt_keys.use_group_keys = true; - decrypt_keys.group_keys = &group_v2_keys; + span_u8 key = {group_v2_sk.data(), group_v2_sk.size()}; + session_protocol_decrypt_envelope_keys decrypt_keys = {}; + decrypt_keys.group_ed25519_pubkey = {group_v2_pk.data(), group_v2_pk.size()}; + decrypt_keys.ed25519_privkeys = &key; + decrypt_keys.ed25519_privkeys_len = 1; // TODO: Finish setting up a group so we can check the decrypted result for now this will // throw because the keys aren't setup correctly. - CHECK_THROWS(session::decrypt_envelope( - decrypt_keys, encrypt_result.ciphertext, timestamp_s, pro_backend_ed_pk)); -#endif + session_protocol_decrypted_envelope decrypt_result = session_protocol_decrypt_envelope( + &decrypt_keys, + encrypt_result.ciphertext.data, + encrypt_result.ciphertext.size, + timestamp_s.time_since_epoch().count(), + pro_backend_ed_pk.data(), + pro_backend_ed_pk.size(), + error, + sizeof(error)); + INFO("Decrypt for group error: " << error); + REQUIRE(decrypt_result.success); + REQUIRE(decrypt_result.pro_status == PRO_STATUS_VALID); + REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); + + free(encrypt_result.ciphertext.data); + free(decrypt_result.content_plaintext.data); } SECTION("Encrypt/decrypt for sync messages with Pro") { From 8bfeb8853f90f204063a0af0a8e135db0ce7ea7a Mon Sep 17 00:00:00 2001 From: doylet Date: Wed, 20 Aug 2025 15:40:04 +1000 Subject: [PATCH 44/59] Remove envelope type, it is inferred from the namespace All the payloads in the returned envelope are decrypted so we shouldn't care too much about the type at that point. The caller can immediately start working with the contents. --- include/session/session_protocol.h | 6 ------ include/session/session_protocol.hpp | 6 ------ src/session_protocol.cpp | 20 ++++++-------------- 3 files changed, 6 insertions(+), 26 deletions(-) diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index 8e892b8b..d5566e93 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -83,11 +83,6 @@ typedef struct session_protocol_destination { // See session::Destination uint8_t group_ed25519_privkey[32]; } session_protocol_destination; -typedef enum ENVELOPE_TYPE { - ENVELOPE_TYPE_SESSION_MESSAGE, - ENVELOPE_TYPE_CLOSED_GROUP_MESSGE, -} ENVELOPE_TYPE; - // Indicates which optional fields in the envelope has been populated out of the optional fields in // an envelope after it has been parsed off the wire. typedef uint32_t ENVELOPE_FLAGS; @@ -100,7 +95,6 @@ enum ENVELOPE_FLAGS_ { typedef struct session_protocol_envelope { ENVELOPE_FLAGS flags; - ENVELOPE_TYPE type; uint64_t timestamp_ms; uint8_t source[33]; uint32_t source_device; diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index ed75d12c..78fdaf86 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -90,14 +90,8 @@ struct Destination { array_uc32 group_ed25519_privkey; }; -enum class EnvelopeType { - SessionMessage = ENVELOPE_TYPE_SESSION_MESSAGE, - ClosedGroupMessage = ENVELOPE_TYPE_CLOSED_GROUP_MESSGE, -}; - struct Envelope { ENVELOPE_FLAGS flags; - EnvelopeType type; std::chrono::milliseconds timestamp; // Optional fields. These fields are set if the appropriate flag has been set in `flags` diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index 847040d9..e56a3db9 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -347,19 +347,12 @@ DecryptedEnvelope decrypt_envelope( if (!envelope.ParseFromArray(envelope_plaintext.data(), envelope_plaintext.size())) throw std::runtime_error{"Parse envelope from plaintext failed"}; - // Parse type (unconditionallty) - if (!envelope.has_type()) - throw std::runtime_error("Parse envelope failed, missing type"); - - switch (envelope.type()) { - case SessionProtos::Envelope_Type_SESSION_MESSAGE: - result.envelope.type = EnvelopeType::SessionMessage; - break; - - case SessionProtos::Envelope_Type_CLOSED_GROUP_MESSAGE: - result.envelope.type = EnvelopeType::ClosedGroupMessage; - break; - } + // TODO: We do not parse the envelop type anymore, we infer the type from + // the namespace. Deciding whether or not we decrypt the envelope vs the content depends on + // whether or not the group keys were passed in so we don't care about the type anymore. + // + // When the type is removed, we can remove this TODO. This is just a reminder as to why we skip + // over that field but it's still in the schema and still being set on the sending side. // Parse source (optional) if (envelope.has_source()) { @@ -660,7 +653,6 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( } result.envelope.flags = result_cpp.envelope.flags; - result.envelope.type = static_cast(result_cpp.envelope.type); result.envelope.timestamp_ms = static_cast(result_cpp.envelope.timestamp.count()); result.envelope.source_device = result_cpp.envelope.source_device; result.envelope.server_timestamp = result_cpp.envelope.server_timestamp; From d3ff9a464ec9ebbaaba3895fcbc568fb4fe5c4a7 Mon Sep 17 00:00:00 2001 From: doylet Date: Wed, 20 Aug 2025 15:57:56 +1000 Subject: [PATCH 45/59] Encapsulate the freeing of session protocol encrypt/decrypt funcs --- include/session/session_protocol.h | 33 +++++++++++++++++++++-- src/session_protocol.cpp | 16 ++++++++++++ tests/test_session_protocol.cpp | 42 +++++++++++++++--------------- 3 files changed, 68 insertions(+), 23 deletions(-) diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index d5566e93..da9bf495 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -155,6 +155,9 @@ PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_EXTR /// /// See: session_protocol/encrypt_for_destination for more information /// +/// The encryption result must be freed with `session_protocol_encrypt_for_destination_free` when +/// the caller is done with the result. +/// /// Inputs: /// - `plaintext` -- the protobuf serialised payload containing the protobuf encoded stream, /// `Content`. It must not be already be encrypted. @@ -186,8 +189,7 @@ PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_EXTR /// on the result to determine if the ciphertext or plaintext is to be used. /// /// The retured payload is suitable for sending on the wire (i.e: it has been protobuf -/// encoded/wrapped if necessary). The ciphertext must be freed with the CRT's `free` when the -/// caller is done with the memory. +/// encoded/wrapped if necessary). /// - `error_len_incl_null_terminator` The length of the error message if `success` was false. If /// the user passes in an non-`NULL` error buffer this is amount of characters written to the /// error buffer. If the user passes in a `NULL` error buffer, this is the amount of characters @@ -205,6 +207,18 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_for_destinat char* error, size_t error_len); +/// API: session_protocol/session_protocol_encrypt_for_destination_free +/// +/// Free the encryption result for a destination produced by +/// `session_protocol_encrypt_for_destination`. It is safe to pass a `NULL` or any result returned +/// by the encrypt function irrespective of if the function succeeded or failed. +/// +/// Inputs: +/// - `encrypt` -- Encryption result to free. This object is zeroed out on free and should no longer +/// be used after it is freed. +LIBSESSION_EXPORT void session_protocol_encrypt_for_destination_free( + session_protocol_encrypted_for_destination* encrypt); + /// API: session_protocol/session_protocol_decrypt_envelope /// /// Given an envelope payload (i.e.: protobuf encoded stream of `Envelope` or encrypted `Envelope` @@ -217,6 +231,9 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_for_destinat /// /// See: session_protocol/decrypt_envelope for more information /// +/// The encryption result must be freed with `session_protocol_decrypt_envelope_free` when the +/// caller is done with the result. +/// /// Inputs: /// - `keys` -- the keys to decrypt either the envelope or the envelope contents. Groups v2 /// envelopes where the envelope is encrypted must set the group key. Envelopes with an encrypted @@ -288,6 +305,18 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( char* error, size_t error_len); +/// API: session_protocol/session_protocol_decrypt_envelope_free +/// +/// Free the decryption result produced by `session_protocol_decrypt_envelope`. It is safe to pass a +/// `NULL` or any result returned by the decrypt function irrespective of if the function succeeded +/// or failed. +/// +/// Inputs: +/// - `envelope` -- Decryption result to free. This object is zeroed out on free and should no longer +/// be used after it is freed. +LIBSESSION_EXPORT void session_protocol_decrypt_envelope_free( + session_protocol_decrypted_envelope* envelope); + #ifdef __cplusplus } #endif diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index e56a3db9..4297c0a3 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -581,6 +581,14 @@ session_protocol_encrypt_for_destination( return result; } +LIBSESSION_C_API void session_protocol_encrypt_for_destination_free( + session_protocol_encrypted_for_destination* encrypt) { + if (encrypt) { + free(encrypt->ciphertext.data); + *encrypt = {}; + } +} + LIBSESSION_C_API session_protocol_decrypted_envelope session_protocol_decrypt_envelope( const session_protocol_decrypt_envelope_keys* keys, @@ -698,3 +706,11 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( result.pro_proof.sig, result_cpp.pro_proof.sig.data(), sizeof(result.pro_proof.sig)); return result; } + +LIBSESSION_C_API +void session_protocol_decrypt_envelope_free(session_protocol_decrypted_envelope* envelope) { + if (envelope) { + free(envelope->content_plaintext.data); + *envelope = {}; + } +} diff --git a/tests/test_session_protocol.cpp b/tests/test_session_protocol.cpp index 39d1525d..dc004cfa 100644 --- a/tests/test_session_protocol.cpp +++ b/tests/test_session_protocol.cpp @@ -155,8 +155,8 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { // Should have the same payload size REQUIRE(encrypt_without_pro_sig.ciphertext.size == encrypt_with_pro_sig.ciphertext.size); - free(encrypt_without_pro_sig.ciphertext.data); - free(encrypt_with_pro_sig.ciphertext.data); + session_protocol_encrypt_for_destination_free(&encrypt_without_pro_sig); + session_protocol_encrypt_for_destination_free(&encrypt_with_pro_sig); } // Setup a dummy "Session Pro Backend" key @@ -213,7 +213,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { pro_backend_ed_pk.size(),error, sizeof(error)); REQUIRE(decrypt_result.success); REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); - free(encrypt_result.ciphertext.data); + session_protocol_encrypt_for_destination_free(&encrypt_result); // Verify pro config::ProProof nil_proof = {}; @@ -233,7 +233,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { REQUIRE(decrypt_content.has_datamessage()); const SessionProtos::DataMessage& data = decrypt_content.datamessage(); REQUIRE(data.body() == data_body); - free(decrypt_result.content_plaintext.data); + session_protocol_decrypt_envelope_free(&decrypt_result); } // Generate the user's Session Pro rotating key for testing encrypted payloads with Session @@ -313,7 +313,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { REQUIRE(encrypt_result.ciphertext.size == 0); } REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); - free(encrypt_result.ciphertext.data); + session_protocol_encrypt_for_destination_free(&encrypt_result); } } @@ -352,7 +352,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { sizeof(error)); REQUIRE(decrypt_result.success); REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); - free(encrypt_result.ciphertext.data); + session_protocol_encrypt_for_destination_free(&encrypt_result); // Verify pro REQUIRE(decrypt_result.pro_status == PRO_STATUS_VALID); // Pro was attached @@ -370,7 +370,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { REQUIRE(decrypt_content.has_datamessage()); const SessionProtos::DataMessage& data = decrypt_content.datamessage(); REQUIRE(data.body() == data_body); - free(decrypt_result.content_plaintext.data); + session_protocol_decrypt_envelope_free(&decrypt_result); } SECTION("Encrypt/decrypt for contact in default namespace with Pro + features") { @@ -430,7 +430,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { sizeof(error)); REQUIRE(decrypt_result.success); REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); - free(encrypt_result.ciphertext.data); + session_protocol_encrypt_for_destination_free(&encrypt_result); // Verify pro REQUIRE(decrypt_result.pro_status == PRO_STATUS_VALID); // Pro was attached @@ -449,7 +449,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { REQUIRE(decrypt_content.has_datamessage()); const SessionProtos::DataMessage& data = decrypt_content.datamessage(); REQUIRE(data.body() == large_message); - free(decrypt_result.content_plaintext.data); + session_protocol_decrypt_envelope_free(&decrypt_result); } SECTION("Encrypt/decrypt for legacy groups (w/ encrypted envelope, plaintext content) with " @@ -481,7 +481,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { encrypt_result.ciphertext.data, encrypt_result.ciphertext.size)); REQUIRE(ws_msg.has_request()); REQUIRE(ws_msg.request().has_body()); - free(encrypt_result.ciphertext.data); + session_protocol_encrypt_for_destination_free(&encrypt_result); // Decrypt envelope span_u8 key = {keys.ed_sk1.data(), keys.ed_sk1.size()}; @@ -516,7 +516,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { REQUIRE(decrypt_content.has_datamessage()); const SessionProtos::DataMessage& data = decrypt_content.datamessage(); REQUIRE(data.body() == data_body); - free(decrypt_result.content_plaintext.data); + session_protocol_decrypt_envelope_free(&decrypt_result); } SECTION("Encrypt/decrypt for groups v2 (w/ encrypted envelope, plaintext content) with Pro") { @@ -578,8 +578,8 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { REQUIRE(decrypt_result.pro_status == PRO_STATUS_VALID); REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); - free(encrypt_result.ciphertext.data); - free(decrypt_result.content_plaintext.data); + session_protocol_encrypt_for_destination_free(&encrypt_result); + session_protocol_decrypt_envelope_free(&decrypt_result); } SECTION("Encrypt/decrypt for sync messages with Pro") { @@ -635,7 +635,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { REQUIRE(decrypt_content.has_datamessage()); const SessionProtos::DataMessage& data = decrypt_content.datamessage(); REQUIRE(data.body() == data_body); - free(decrypt_result.content_plaintext.data); + session_protocol_decrypt_envelope_free(&decrypt_result); } // Try decrypt with a timestamp past the pro proof expiry date @@ -655,7 +655,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { REQUIRE(decrypt_result.success); REQUIRE(decrypt_result.pro_status == PRO_STATUS_EXPIRED); REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); - free(decrypt_result.content_plaintext.data); + session_protocol_decrypt_envelope_free(&decrypt_result); } // Try decrypt with a bad backend key @@ -676,7 +676,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { REQUIRE(decrypt_result.success); REQUIRE(decrypt_result.pro_status == PRO_STATUS_INVALID_PRO_BACKEND_SIG); REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); - free(decrypt_result.content_plaintext.data); + session_protocol_decrypt_envelope_free(&decrypt_result); } // Try decrypt with bad key (ed_sk0 which was the sender; ed_sk1 the recipient) @@ -699,7 +699,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { REQUIRE(!decrypt_result.success); REQUIRE(decrypt_result.error_len_incl_null_terminator > 0); REQUIRE(decrypt_result.error_len_incl_null_terminator <= sizeof(error)); - free(decrypt_result.content_plaintext.data); + session_protocol_decrypt_envelope_free(&decrypt_result); } // Try decrypt with multiple keys, 1 bad, 1 good key @@ -722,9 +722,9 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { REQUIRE(decrypt_result.success); REQUIRE(decrypt_result.pro_status == PRO_STATUS_VALID); REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); - free(decrypt_result.content_plaintext.data); + session_protocol_decrypt_envelope_free(&decrypt_result); } - free(encrypt_result.ciphertext.data); + session_protocol_encrypt_for_destination_free(&encrypt_result); } SECTION("Encrypt/decrypt for sync messages with Pro and bad rotating signature") { @@ -763,7 +763,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { REQUIRE(decrypt_result.success); REQUIRE(decrypt_result.pro_status == PRO_STATUS_INVALID_USER_SIG); REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); - free(encrypt_result.ciphertext.data); - free(decrypt_result.content_plaintext.data); + session_protocol_encrypt_for_destination_free(&encrypt_result); + session_protocol_decrypt_envelope_free(&decrypt_result); } } From 0b2dbe2998ce90ccbaa06ab68a87ca3c9d80a0f4 Mon Sep 17 00:00:00 2001 From: doylet Date: Wed, 20 Aug 2025 16:14:55 +1000 Subject: [PATCH 46/59] Prohibit the creation of legacy groups messages, no longer supported --- src/session_protocol.cpp | 97 ++++++++++----------------------- tests/test_session_protocol.cpp | 81 ++++++--------------------- 2 files changed, 46 insertions(+), 132 deletions(-) diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index 4297c0a3..0c502e8b 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -73,14 +73,6 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( EncryptForBlindedRecipient, }; - // The step to partake after enveloping the content payload - enum class AfterEnvelope { - Nil, - EnvelopeIsCipherText, // No extra bit-mangling required after enveloping - WrapInWSMessage, // Wrap in the protobuf websocket message after enveloping - KeysEncryptMessage, // Encrypt with the group keys after ennveloping - }; - struct EncodeContext { Mode mode; // Parameters for BuildMode => Envelope @@ -95,7 +87,8 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( // Type of message to mark the enevelope as std::optional envelope_type; - AfterEnvelope after_envelope; + + bool after_envelope_keys_encrypt_message; // Encrypt with group keys }; // Figure out how to encrypt the message based on the destination and setup the encoding context @@ -108,7 +101,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( if (space == config::Namespace::GroupMessages) { enc.mode = Mode::Envelope; enc.before_envelope_encrypt_for_recipient_deterministic = false; - enc.after_envelope = AfterEnvelope::KeysEncryptMessage; + enc.after_envelope_keys_encrypt_message = true; enc.envelope_type = SessionProtos::Envelope_Type::Envelope_Type_CLOSED_GROUP_MESSAGE; } else if (space == config::Namespace::RevokedRetrievableGroupMessages) { @@ -120,12 +113,9 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( } } else { // Legacy groups which have a 05 prefixed key - enc.mode = Mode::Envelope; - enc.before_envelope_encrypt_for_recipient_deterministic = true; - enc.envelope_type = - SessionProtos::Envelope_Type::Envelope_Type_CLOSED_GROUP_MESSAGE; - enc.after_envelope = AfterEnvelope::WrapInWSMessage; - enc.envelope_src = dest_group_ed25519_pubkey; + throw std::runtime_error{ + "Unsupported configuration, encrypting for a legacy group (0x05 prefix) is " + "no longer supported"}; } } break; @@ -134,7 +124,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( enc.mode = Mode::Envelope; enc.before_envelope_encrypt_for_recipient_deterministic = true; enc.envelope_type = SessionProtos::Envelope_Type::Envelope_Type_SESSION_MESSAGE; - enc.after_envelope = AfterEnvelope::EnvelopeIsCipherText; + enc.after_envelope_keys_encrypt_message = false; } else { // See: // https://github.com/session-foundation/session-ios/blob/82deef869d0f7389b799295817f42ad14f8a1316/SessionMessagingKit/Sending%20%26%20Receiving/MessageSender.swift#L498 @@ -146,7 +136,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( enc.mode = Mode::Envelope; enc.before_envelope_encrypt_for_recipient_deterministic = true; enc.envelope_type = SessionProtos::Envelope_Type::Envelope_Type_SESSION_MESSAGE; - enc.after_envelope = AfterEnvelope::EnvelopeIsCipherText; + enc.after_envelope_keys_encrypt_message = false; } break; case DestinationType::Community: { @@ -193,56 +183,26 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( } result.encrypted = true; - switch (enc.after_envelope) { - case AfterEnvelope::Nil: - assert(false && "Dev error, after envelope action was not set"); - break; - - case AfterEnvelope::WrapInWSMessage: { - // Setup message - WebSocketProtos::WebSocketMessage msg = {}; - msg.set_type( - WebSocketProtos::WebSocketMessage_Type::WebSocketMessage_Type_REQUEST); - - // Make request - WebSocketProtos::WebSocketRequestMessage* req_msg = msg.mutable_request(); - req_msg->set_body(envelope.SerializeAsString()); - - // Write message as ciphertext - [[maybe_unused]] bool serialized = false; - if (use_malloc == UseMalloc::Yes) { - result.ciphertext_c = span_u8_alloc_or_throw(msg.ByteSizeLong()); - serialized = msg.SerializeToArray(result.ciphertext_c.data, result.ciphertext_c.size); - } else { - result.ciphertext_cpp.resize(msg.ByteSizeLong()); - serialized = msg.SerializeToArray( - result.ciphertext_cpp.data(), result.ciphertext_cpp.size()); - } - assert(serialized); - } break; - - case AfterEnvelope::KeysEncryptMessage: { - std::string bytes = envelope.SerializeAsString(); - if (dest_group_ed25519_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES + 1) - dest_group_ed25519_pubkey = dest_group_ed25519_pubkey.subspan(1); - - std::vector ciphertext = encrypt_for_group( - ed25519_privkey, - dest_group_ed25519_pubkey, - dest_group_ed25519_privkey, - to_span(bytes), - /*compress*/ true, - /*padding*/ 256); - - if (use_malloc == UseMalloc::Yes) { - result.ciphertext_c = - span_u8_copy_or_throw(ciphertext.data(), ciphertext.size()); - } else { - result.ciphertext_cpp = std::move(ciphertext); - } - } break; - - case AfterEnvelope::EnvelopeIsCipherText: { + if (enc.after_envelope_keys_encrypt_message) { + std::string bytes = envelope.SerializeAsString(); + if (dest_group_ed25519_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES + 1) + dest_group_ed25519_pubkey = dest_group_ed25519_pubkey.subspan(1); + + std::vector ciphertext = encrypt_for_group( + ed25519_privkey, + dest_group_ed25519_pubkey, + dest_group_ed25519_privkey, + to_span(bytes), + /*compress*/ true, + /*padding*/ 256); + + if (use_malloc == UseMalloc::Yes) { + result.ciphertext_c = + span_u8_copy_or_throw(ciphertext.data(), ciphertext.size()); + } else { + result.ciphertext_cpp = std::move(ciphertext); + } + } else { [[maybe_unused]] bool serialized = false; if (use_malloc == UseMalloc::Yes) { result.ciphertext_c = span_u8_alloc_or_throw(envelope.ByteSizeLong()); @@ -254,7 +214,6 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( result.ciphertext_cpp.data(), result.ciphertext_cpp.size()); } assert(serialized); - } break; } } break; diff --git a/tests/test_session_protocol.cpp b/tests/test_session_protocol.cpp index dc004cfa..2921f85f 100644 --- a/tests/test_session_protocol.cpp +++ b/tests/test_session_protocol.cpp @@ -452,71 +452,26 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { session_protocol_decrypt_envelope_free(&decrypt_result); } - SECTION("Encrypt/decrypt for legacy groups (w/ encrypted envelope, plaintext content) with " - "Pro") { - // Encrypt - session_protocol_encrypted_for_destination encrypt_result = {}; - { - session_protocol_destination dest = base_dest; - dest.type = DESTINATION_TYPE_GROUP; - assert(dest.recipient_pubkey[0] == 0x05); + SECTION("Encrypt/decrypt for legacy groups is rejected") { + session_protocol_destination dest = base_dest; + dest.type = DESTINATION_TYPE_GROUP; + assert(dest.recipient_pubkey[0] == 0x05); - encrypt_result = session_protocol_encrypt_for_destination( - protobuf_content_with_pro.plaintext.data(), - protobuf_content_with_pro.plaintext.size(), - keys.ed_sk0.data(), - keys.ed_sk0.size(), - &dest, - NAMESPACE_DEFAULT, - error, - sizeof(error)); - REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); - REQUIRE(encrypt_result.success); - REQUIRE(encrypt_result.encrypted); - } - - // Legacy groups wrap in websocket message - WebSocketProtos::WebSocketMessage ws_msg; - REQUIRE(ws_msg.ParseFromArray( - encrypt_result.ciphertext.data, encrypt_result.ciphertext.size)); - REQUIRE(ws_msg.has_request()); - REQUIRE(ws_msg.request().has_body()); + session_protocol_encrypted_for_destination encrypt_result = + session_protocol_encrypt_for_destination( + protobuf_content_with_pro.plaintext.data(), + protobuf_content_with_pro.plaintext.size(), + keys.ed_sk0.data(), + keys.ed_sk0.size(), + &dest, + NAMESPACE_DEFAULT, + error, + sizeof(error)); + REQUIRE(encrypt_result.error_len_incl_null_terminator > 0); + REQUIRE(encrypt_result.error_len_incl_null_terminator <= sizeof(error)); + REQUIRE(!encrypt_result.success); + REQUIRE(!encrypt_result.encrypted); session_protocol_encrypt_for_destination_free(&encrypt_result); - - // Decrypt envelope - span_u8 key = {keys.ed_sk1.data(), keys.ed_sk1.size()}; - session_protocol_decrypt_envelope_keys decrypt_keys = {}; - decrypt_keys.ed25519_privkeys = &key; - decrypt_keys.ed25519_privkeys_len = 1; - session_protocol_decrypted_envelope decrypt_result = session_protocol_decrypt_envelope( - &decrypt_keys, - ws_msg.request().body().data(), - ws_msg.request().body().size(), - timestamp_s.time_since_epoch().count(), - pro_backend_ed_pk.data(), - pro_backend_ed_pk.size(), - error, - sizeof(error)); - REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); - REQUIRE(decrypt_result.success); - - // Verify pro - REQUIRE(decrypt_result.pro_status == PRO_STATUS_VALID); // Pro was attached - bytes32 hash = pro_proof_hash(&decrypt_result.pro_proof); - REQUIRE(std::memcmp( - hash.data, - protobuf_content_with_pro.pro_proof_hash.data(), - sizeof(hash.data)) == 0); - REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); // No features requested - - // Verify the content can be parsed w/ protobufs - SessionProtos::Content decrypt_content = {}; - REQUIRE(decrypt_content.ParseFromArray( - decrypt_result.content_plaintext.data, decrypt_result.content_plaintext.size)); - REQUIRE(decrypt_content.has_datamessage()); - const SessionProtos::DataMessage& data = decrypt_content.datamessage(); - REQUIRE(data.body() == data_body); - session_protocol_decrypt_envelope_free(&decrypt_result); } SECTION("Encrypt/decrypt for groups v2 (w/ encrypted envelope, plaintext content) with Pro") { From ea411a89e6f544e461b444731dc4cc12ffd21dbe Mon Sep 17 00:00:00 2001 From: doylet Date: Wed, 20 Aug 2025 17:32:32 +1000 Subject: [PATCH 47/59] Fix linting --- include/session/session_encrypt.h | 4 +- include/session/session_protocol.h | 3 +- src/session_encrypt.cpp | 14 +++--- src/session_protocol.cpp | 24 +++++----- tests/test_session_encrypt.cpp | 3 +- tests/test_session_protocol.cpp | 75 ++++++++++++++---------------- 6 files changed, 60 insertions(+), 63 deletions(-) diff --git a/include/session/session_encrypt.h b/include/session/session_encrypt.h index 2d60541e..5e062905 100644 --- a/include/session/session_encrypt.h +++ b/include/session/session_encrypt.h @@ -132,7 +132,7 @@ LIBSESSION_EXPORT session_encrypt_group_message session_encrypt_for_group( size_t plaintext_len, bool compress, size_t padding, - char *error, + char* error, size_t error_len); /// API: crypto/session_decrypt_incoming @@ -287,7 +287,7 @@ session_decrypt_group_message_result session_decrypt_group_message( size_t group_ed25519_pubkey_len, const unsigned char* ciphertext, size_t ciphertext_len, - char *error, + char* error, size_t error_len); /// API: crypto/session_decrypt_ons_response diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index da9bf495..dc4ff135 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -312,7 +312,8 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( /// or failed. /// /// Inputs: -/// - `envelope` -- Decryption result to free. This object is zeroed out on free and should no longer +/// - `envelope` -- Decryption result to free. This object is zeroed out on free and should no +/// longer /// be used after it is freed. LIBSESSION_EXPORT void session_protocol_decrypt_envelope_free( session_protocol_decrypted_envelope* envelope); diff --git a/src/session_encrypt.cpp b/src/session_encrypt.cpp index dd715127..6a622d01 100644 --- a/src/session_encrypt.cpp +++ b/src/session_encrypt.cpp @@ -553,11 +553,11 @@ std::pair, std::vector> decrypt_incomi buf.resize(outer_size); int opened = crypto_box_seal_open( - buf.data(), - ciphertext.data(), - ciphertext.size(), - x25519_pubkey.data(), - x25519_seckey.data()); + buf.data(), + ciphertext.data(), + ciphertext.size(), + x25519_pubkey.data(), + x25519_seckey.data()); if (opened != 0) throw std::runtime_error{"Decryption failed"}; @@ -1125,7 +1125,7 @@ LIBSESSION_C_API session_encrypt_group_message session_encrypt_for_group( size_t plaintext_len, bool compress, size_t padding, - char *error, + char* error, size_t error_len) { session_encrypt_group_message result = {}; try { @@ -1233,7 +1233,7 @@ LIBSESSION_C_API session_decrypt_group_message_result session_decrypt_group_mess size_t group_ed25519_pubkey_len, const unsigned char* ciphertext, size_t ciphertext_len, - char *error, + char* error, size_t error_len) { session_decrypt_group_message_result result = {}; for (size_t index = 0; index < decrypt_ed25519_privkey_len; index++) { diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index 0c502e8b..6bd1e745 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -88,7 +88,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( // Type of message to mark the enevelope as std::optional envelope_type; - bool after_envelope_keys_encrypt_message; // Encrypt with group keys + bool after_envelope_keys_encrypt_message; // Encrypt with group keys }; // Figure out how to encrypt the message based on the destination and setup the encoding context @@ -203,17 +203,17 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( result.ciphertext_cpp = std::move(ciphertext); } } else { - [[maybe_unused]] bool serialized = false; - if (use_malloc == UseMalloc::Yes) { - result.ciphertext_c = span_u8_alloc_or_throw(envelope.ByteSizeLong()); - serialized = envelope.SerializeToArray( - result.ciphertext_c.data, result.ciphertext_c.size); - } else { - result.ciphertext_cpp.resize(envelope.ByteSizeLong()); - serialized = envelope.SerializeToArray( - result.ciphertext_cpp.data(), result.ciphertext_cpp.size()); - } - assert(serialized); + [[maybe_unused]] bool serialized = false; + if (use_malloc == UseMalloc::Yes) { + result.ciphertext_c = span_u8_alloc_or_throw(envelope.ByteSizeLong()); + serialized = envelope.SerializeToArray( + result.ciphertext_c.data, result.ciphertext_c.size); + } else { + result.ciphertext_cpp.resize(envelope.ByteSizeLong()); + serialized = envelope.SerializeToArray( + result.ciphertext_cpp.data(), result.ciphertext_cpp.size()); + } + assert(serialized); } } break; diff --git a/tests/test_session_encrypt.cpp b/tests/test_session_encrypt.cpp index 70514b11..41efa1ff 100644 --- a/tests/test_session_encrypt.cpp +++ b/tests/test_session_encrypt.cpp @@ -103,7 +103,8 @@ TEST_CASE("Session protocol deterministic encryption", "[session-protocol][encry std::vector sid_raw; oxenc::from_hex(sid.begin(), sid.end(), std::back_inserter(sid_raw)); REQUIRE(sid == "05d2ad010eeb72d72e561d9de7bd7b6989af77dcabffa03a5111a6c859ae5c3a72"); - REQUIRE(sid_raw == "05d2ad010eeb72d72e561d9de7bd7b6989af77dcabffa03a5111a6c859ae5c3a72"_hexbytes); + REQUIRE(sid_raw == + "05d2ad010eeb72d72e561d9de7bd7b6989af77dcabffa03a5111a6c859ae5c3a72"_hexbytes); const auto seed2 = "00112233445566778899aabbccddeeff00000000000000000000000000000000"_hexbytes; std::array ed_pk2, curve_pk2; diff --git a/tests/test_session_protocol.cpp b/tests/test_session_protocol.cpp index 2921f85f..866d3209 100644 --- a/tests/test_session_protocol.cpp +++ b/tests/test_session_protocol.cpp @@ -210,7 +210,9 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { encrypt_result.ciphertext.size, timestamp_s.time_since_epoch().count(), pro_backend_ed_pk.data(), - pro_backend_ed_pk.size(),error, sizeof(error)); + pro_backend_ed_pk.size(), + error, + sizeof(error)); REQUIRE(decrypt_result.success); REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); session_protocol_encrypt_for_destination_free(&encrypt_result); @@ -222,9 +224,9 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { REQUIRE(decrypt_result.pro_status == PRO_STATUS_NIL); // Pro was not attached REQUIRE(decrypt_result.pro_features == PRO_FEATURES_NIL); REQUIRE(std::memcmp( - decrypt_result_pro_hash.data, - nil_hash.data(), - sizeof(decrypt_result_pro_hash.data)) == 0); + decrypt_result_pro_hash.data, + nil_hash.data(), + sizeof(decrypt_result_pro_hash.data)) == 0); // Verify it is decryptable SessionProtos::Content decrypt_content = {}; @@ -487,8 +489,8 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { session_protocol_encrypted_for_destination encrypt_result = {}; { session_protocol_destination dest = base_dest; - dest.type = DESTINATION_TYPE_GROUP; - dest.group_ed25519_pubkey[0] = 0x03; + dest.type = DESTINATION_TYPE_GROUP; + dest.group_ed25519_pubkey[0] = 0x03; std::memcpy(dest.group_ed25519_pubkey + 1, group_v2_pk.data(), group_v2_pk.size()); std::memcpy( dest.group_ed25519_privkey, @@ -595,18 +597,15 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { // Try decrypt with a timestamp past the pro proof expiry date { - session_protocol_decrypted_envelope decrypt_result = - session_protocol_decrypt_envelope( - &decrypt_keys, - encrypt_result.ciphertext.data, - encrypt_result.ciphertext.size, - protobuf_content_with_pro.proof.expiry_unix_ts.time_since_epoch() - .count() + - 1, - pro_backend_ed_pk.data(), - pro_backend_ed_pk.size(), - error, - sizeof(error)); + session_protocol_decrypted_envelope decrypt_result = session_protocol_decrypt_envelope( + &decrypt_keys, + encrypt_result.ciphertext.data, + encrypt_result.ciphertext.size, + protobuf_content_with_pro.proof.expiry_unix_ts.time_since_epoch().count() + 1, + pro_backend_ed_pk.data(), + pro_backend_ed_pk.size(), + error, + sizeof(error)); REQUIRE(decrypt_result.success); REQUIRE(decrypt_result.pro_status == PRO_STATUS_EXPIRED); REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); @@ -617,17 +616,15 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { { array_uc32 bad_pro_backend_ed_pk = pro_backend_ed_pk; bad_pro_backend_ed_pk[0] ^= 1; - session_protocol_decrypted_envelope decrypt_result = - session_protocol_decrypt_envelope( - &decrypt_keys, - encrypt_result.ciphertext.data, - encrypt_result.ciphertext.size, - protobuf_content_with_pro.proof.expiry_unix_ts.time_since_epoch() - .count(), - bad_pro_backend_ed_pk.data(), - bad_pro_backend_ed_pk.size(), - error, - sizeof(error)); + session_protocol_decrypted_envelope decrypt_result = session_protocol_decrypt_envelope( + &decrypt_keys, + encrypt_result.ciphertext.data, + encrypt_result.ciphertext.size, + protobuf_content_with_pro.proof.expiry_unix_ts.time_since_epoch().count(), + bad_pro_backend_ed_pk.data(), + bad_pro_backend_ed_pk.size(), + error, + sizeof(error)); REQUIRE(decrypt_result.success); REQUIRE(decrypt_result.pro_status == PRO_STATUS_INVALID_PRO_BACKEND_SIG); REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); @@ -663,17 +660,15 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { session_protocol_decrypt_envelope_keys multi_decrypt_keys = {}; multi_decrypt_keys.ed25519_privkeys = key_list.data(); multi_decrypt_keys.ed25519_privkeys_len = key_list.size(); - session_protocol_decrypted_envelope decrypt_result = - session_protocol_decrypt_envelope( - &multi_decrypt_keys, - encrypt_result.ciphertext.data, - encrypt_result.ciphertext.size, - protobuf_content_with_pro.proof.expiry_unix_ts.time_since_epoch() - .count(), - pro_backend_ed_pk.data(), - pro_backend_ed_pk.size(), - error, - sizeof(error)); + session_protocol_decrypted_envelope decrypt_result = session_protocol_decrypt_envelope( + &multi_decrypt_keys, + encrypt_result.ciphertext.data, + encrypt_result.ciphertext.size, + protobuf_content_with_pro.proof.expiry_unix_ts.time_since_epoch().count(), + pro_backend_ed_pk.data(), + pro_backend_ed_pk.size(), + error, + sizeof(error)); REQUIRE(decrypt_result.success); REQUIRE(decrypt_result.pro_status == PRO_STATUS_VALID); REQUIRE(decrypt_result.error_len_incl_null_terminator == 0); From d5c6e261de6632a0d6318eaa64a3641c3c797b3a Mon Sep 17 00:00:00 2001 From: doylet Date: Thu, 21 Aug 2025 11:59:45 +1000 Subject: [PATCH 48/59] Remove the need for ProStatus::Nil by using std::optional --- include/session/session_protocol.hpp | 35 ++++++++----------- src/session_protocol.cpp | 51 +++++++++++++++------------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index 78fdaf86..2527ea33 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -38,16 +38,12 @@ namespace config::groups { } enum class ProStatus { - // Proof not set - Nil = PRO_STATUS_NIL, - // Proof set; pro proof sig was not produced by the Pro backend key + // Pro proof sig was not signed by the Pro backend key InvalidProBackendSig = PRO_STATUS_INVALID_PRO_BACKEND_SIG, - // Proof set; envelope pro sig was not produced by the Rotating key + // Pro sig in the envelope was not signed by the Rotating key InvalidUserSig = PRO_STATUS_INVALID_USER_SIG, - // Proof set, is verified; has not expired - Valid = PRO_STATUS_VALID, - // Proof set, is verified; has expired - Expired = PRO_STATUS_EXPIRED, + Valid = PRO_STATUS_VALID, // Proof is verified; has not expired + Expired = PRO_STATUS_EXPIRED, // Proof is verified; has expired }; enum class DestinationType { @@ -105,6 +101,14 @@ struct Envelope { array_uc64 pro_sig; }; +struct DecryptedPro { + ProStatus status; // Validity of the proof embedded in the envelope + // Session Pro proof that was embedded in the envelope, this is always populated irrespective of + // the status but the validity of the contents should be verified by checking `status` + config::ProProof proof; + PRO_FEATURES features; // Bit flag features that were used in the embedded message +}; + struct DecryptedEnvelope { // The envelope parsed from the plaintext Envelope envelope; @@ -121,18 +125,9 @@ struct DecryptedEnvelope { // a Groups v2 envelope or it's re-derived from the Ed25519 pubkey. array_uc32 sender_x25519_pubkey; - // Status flag for validity of the Session Pro proof embedded in the envelope if it has one. - // The status is set to `Nil` if there is no Session Pro proof in the message. Otherwise it's - // set to one of the other values to which the remaining pro fields will be populated with data - // parsed from the envelope. - ProStatus pro_status; - - // The embedded Session Pro proof, only set if the status was not `Nil`. - config::ProProof pro_proof; - - // Session Pro bit flag features that were used in the embedded message, only set if the status - // was not `Nil`. - PRO_FEATURES pro_features; + // Set if the envelope included a pro payload. The caller must check the status to determine if + // the embedded pro data/proof was valid, invalid or whether or not the proof has expired. + std::optional pro; }; struct DecryptEnvelopeKey { diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index 6bd1e745..805c503c 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -419,6 +419,7 @@ DecryptedEnvelope decrypt_envelope( if (content.has_promessage()) { // Mark the envelope as having a pro signature that the caller can use. result.envelope.flags |= ENVELOPE_FLAGS_PRO_SIG; + DecryptedPro& pro = result.pro.emplace(); // Extract the pro message const SessionProtos::ProMessage& pro_msg = content.promessage(); @@ -431,7 +432,7 @@ DecryptedEnvelope decrypt_envelope( // Parse the proof from protobufs const SessionProtos::ProProof& proto_proof = pro_msg.proof(); - session::config::ProProof& proof = result.pro_proof; + session::config::ProProof& proof = pro.proof; // clang-format off size_t proof_errors = 0; proof_errors += !proto_proof.has_version() || proto_proof.version() != static_cast(session::config::ProProofVersion_v0); @@ -451,10 +452,10 @@ DecryptedEnvelope decrypt_envelope( result.content_plaintext.data(), result.content_plaintext.size(), reinterpret_cast(proto_proof.rotatingpublickey().data())); - result.pro_status = verify_result == 0 ? ProStatus::Valid : ProStatus::InvalidUserSig; + pro.status = verify_result == 0 ? ProStatus::Valid : ProStatus::InvalidUserSig; // Fill out the resulting proof structure, we have parsed successfully - result.pro_features = pro_msg.features(); + pro.features = pro_msg.features(); std::memcpy(result.envelope.pro_sig.data(), pro_sig.data(), pro_sig.size()); std::memcpy( @@ -469,16 +470,16 @@ DecryptedEnvelope decrypt_envelope( std::chrono::sys_seconds(std::chrono::seconds(proto_proof.expiryunixts())); std::memcpy(proof.sig.data(), proto_proof.sig().data(), proto_proof.sig().size()); - if (result.pro_status == ProStatus::Valid) { + if (pro.status == ProStatus::Valid) { // Verify the at the proof is verified by the Session Pro Backend key (e.g.: It was // issued by an authoritative backend) if (!proof.verify(pro_backend_pubkey)) - result.pro_status = ProStatus::InvalidProBackendSig; + pro.status = ProStatus::InvalidProBackendSig; // Check if the proof has expired - if (result.pro_status == ProStatus::Valid) { - if (unix_ts > result.pro_proof.expiry_unix_ts) - result.pro_status = ProStatus::Expired; + if (pro.status == ProStatus::Valid) { + if (unix_ts > pro.proof.expiry_unix_ts) + pro.status = ProStatus::Expired; } } } @@ -623,11 +624,25 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( result.envelope.timestamp_ms = static_cast(result_cpp.envelope.timestamp.count()); result.envelope.source_device = result_cpp.envelope.source_device; result.envelope.server_timestamp = result_cpp.envelope.server_timestamp; - result.pro_status = static_cast(result_cpp.pro_status); - result.pro_proof.version = result_cpp.pro_proof.version; - result.pro_proof.expiry_unix_ts = - static_cast(result_cpp.pro_proof.expiry_unix_ts.time_since_epoch().count()); - result.pro_features = result_cpp.pro_features; + + if (result_cpp.pro) { + const DecryptedPro& pro = *result_cpp.pro; + result.pro_status = static_cast(pro.status); + result.pro_proof.version = pro.proof.version; + result.pro_proof.expiry_unix_ts = + static_cast(pro.proof.expiry_unix_ts.time_since_epoch().count()); + result.pro_features = pro.features; + + std::memcpy( + result.pro_proof.gen_index_hash, + pro.proof.gen_index_hash.data(), + sizeof(result.pro_proof.gen_index_hash)); + std::memcpy( + result.pro_proof.rotating_pubkey, + pro.proof.rotating_pubkey.data(), + sizeof(result.pro_proof.rotating_pubkey)); + std::memcpy(result.pro_proof.sig, pro.proof.sig.data(), sizeof(pro.proof.sig)); + } // Since we support multiple keys, if some of the keys failed but one of them succeeded, we will // zero out the error buffer to avoid conflating one of the failures with the function actually @@ -653,16 +668,6 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( result_cpp.sender_x25519_pubkey.data(), sizeof(result.sender_x25519_pubkey)); - std::memcpy( - result.pro_proof.gen_index_hash, - result_cpp.pro_proof.gen_index_hash.data(), - sizeof(result.pro_proof.gen_index_hash)); - std::memcpy( - result.pro_proof.rotating_pubkey, - result_cpp.pro_proof.rotating_pubkey.data(), - sizeof(result.pro_proof.rotating_pubkey)); - std::memcpy( - result.pro_proof.sig, result_cpp.pro_proof.sig.data(), sizeof(result.pro_proof.sig)); return result; } From 91d8be75c850edf3f1160785a6eb1682de9f1890 Mon Sep 17 00:00:00 2001 From: doylet Date: Thu, 21 Aug 2025 14:05:50 +1000 Subject: [PATCH 49/59] Add docs to pro config --- include/session/config/pro.h | 48 +++++++++++++++++++++++++++++++----- src/config/pro.cpp | 14 ++++++----- src/config/user_profile.cpp | 4 +-- 3 files changed, 52 insertions(+), 14 deletions(-) diff --git a/include/session/config/pro.h b/include/session/config/pro.h index ae1f1eba..fd2da318 100644 --- a/include/session/config/pro.h +++ b/include/session/config/pro.h @@ -24,15 +24,51 @@ typedef struct pro_pro_config { pro_proof proof; } pro_pro_config; -LIBSESSION_EXPORT pro_proof pro_proof_init(char const* dump, size_t dump_len); - -LIBSESSION_EXPORT pro_pro_config pro_pro_init(char const* dump, size_t dump_len); - +/// API: pro/pro_proof_hash +/// +/// Generate the 32 byte hash that is to be signed by the rotating key or Session Pro Backend key to +/// embed in the envelope or proof respectively which other clients use to authenticate the validity +/// of a proof. +/// +/// Inputs: +/// - `proof` -- Proof to calculate the hash from +/// +/// Outputs: +/// - `bytes32` -- The 32 byte hash calculated from the proof LIBSESSION_EXPORT bytes32 pro_proof_hash(pro_proof const* proof); -LIBSESSION_EXPORT bool pro_proof_verify(pro_proof const* proof, uint8_t const* verify_pubkey); +/// API: pro/pro_proof_verify +/// +/// Verify the proof was signed by the `verify_pubkey` +/// +/// Inputs: +/// - `proof` -- Proof to verify +/// - `verify_pubkey` -- Array of bytes containing the public key to (typically the Session Pro +/// Backend public key) verify the proof against. +/// - `verify_pubkey_len` -- Length of the `verify_pubkey` this must be 32 bytes, but is +/// parameterised to detect errors about incorrectly sized arrays by the caller. +/// +/// Outputs: +/// - `bytes32` -- The 32 byte hash calculated from the proof +LIBSESSION_EXPORT bool pro_proof_verify( + pro_proof const* proof, uint8_t const* verify_pubkey, size_t verify_pubkey_len); -LIBSESSION_EXPORT bool pro_pro_verify(pro_pro_config const* pro, uint8_t const* verify_pubkey); +/// API: pro/pro_verify +/// +/// Verify the proof was signed by the `verify_pubkey` and that the `rotating_privkey` in the `pro` +/// config rederives to the `rotating_pubkey` embedded in the proof. +/// +/// Inputs: +/// - `proof` -- Proof to verify +/// - `verify_pubkey` -- Array of bytes containing the public key to (typically the Session Pro +/// Backend public key) verify the proof against. +/// - `verify_pubkey_len` -- Length of the `verify_pubkey` this must be 32 bytes, but is +/// parameterised to detect errors about incorrectly sized arrays by the caller. +/// +/// Outputs: +/// - `bytes32` -- The 32 byte hash calculated from the proof +LIBSESSION_EXPORT bool pro_pro_verify( + pro_pro_config const* pro, uint8_t const* verify_pubkey, size_t verify_pubkey_len); #ifdef __cplusplus } // extern "C" diff --git a/src/config/pro.cpp b/src/config/pro.cpp index d2cfa4fa..30c76ef9 100644 --- a/src/config/pro.cpp +++ b/src/config/pro.cpp @@ -164,9 +164,11 @@ LIBSESSION_C_API bytes32 pro_proof_hash(pro_proof const* proof) { return result; } -LIBSESSION_C_API bool pro_proof_verify(pro_proof const* proof, uint8_t const* verify_pubkey) { - auto verify_pubkey_span = - std::span(verify_pubkey, crypto_sign_ed25519_PUBLICKEYBYTES); +LIBSESSION_C_API bool pro_proof_verify( + pro_proof const* proof, uint8_t const* verify_pubkey, size_t verify_pubkey_len) { + if (verify_pubkey_len != crypto_sign_ed25519_PUBLICKEYBYTES) + return false; + auto verify_pubkey_span = std::span(verify_pubkey, verify_pubkey_len); auto gen_index_hash = std::span(proof->gen_index_hash, sizeof proof->gen_index_hash); auto rotating_pubkey = @@ -179,9 +181,9 @@ LIBSESSION_C_API bool pro_proof_verify(pro_proof const* proof, uint8_t const* ve return result; } -LIBSESSION_C_API bool pro_pro_verify(pro_pro_config const* pro, uint8_t const* verify_pubkey) { - auto verify_pubkey_span = - std::span(verify_pubkey, crypto_sign_ed25519_PUBLICKEYBYTES); +LIBSESSION_C_API bool pro_pro_verify( + pro_pro_config const* pro, uint8_t const* verify_pubkey, size_t verify_pubkey_len) { + auto verify_pubkey_span = std::span(verify_pubkey, verify_pubkey_len); auto rotating_privkey = std::span(pro->rotating_privkey, sizeof pro->rotating_privkey); auto gen_index_hash = std::span( diff --git a/src/config/user_profile.cpp b/src/config/user_profile.cpp index 92bbf419..486d6a28 100644 --- a/src/config/user_profile.cpp +++ b/src/config/user_profile.cpp @@ -250,7 +250,7 @@ LIBSESSION_C_API int64_t user_profile_get_profile_updated(config_object* conf) { return unbox(conf)->get_profile_updated().time_since_epoch().count(); } -LIBSESSION_C_API bool user_profile_get_pro_data(const config_object* conf, pro_pro_config* pro) { +LIBSESSION_C_API bool user_profile_get_pro_config(const config_object* conf, pro_pro_config* pro) { if (auto val = unbox(conf)->get_pro_config(); val) { static_assert(sizeof pro->proof.gen_index_hash == sizeof(val->proof.gen_index_hash)); static_assert(sizeof pro->proof.rotating_pubkey == sizeof(val->proof.rotating_pubkey)); @@ -271,7 +271,7 @@ LIBSESSION_C_API bool user_profile_get_pro_data(const config_object* conf, pro_p return false; } -LIBSESSION_C_API void user_profile_set_pro_data(config_object* conf, const pro_pro_config* pro) { +LIBSESSION_C_API void user_profile_set_pro_config(config_object* conf, const pro_pro_config* pro) { ProConfig val = {}; val.proof.version = pro->proof.version; std::memcpy( From 6c6d45583f16e2f7b923b429125bbf6beea7102f Mon Sep 17 00:00:00 2001 From: doylet Date: Thu, 21 Aug 2025 16:00:26 +1000 Subject: [PATCH 50/59] Add helper functions for getting PRO_STATUS from proof standalone from decryption --- include/session/config/pro.h | 94 ++++++++++++++- include/session/config/pro.hpp | 83 ++++++++++++- include/session/session_protocol.h | 8 -- include/session/session_protocol.hpp | 11 +- src/config/pro.cpp | 167 +++++++++++++++++++++------ src/session_protocol.cpp | 47 ++++---- tests/test_config_pro.cpp | 116 ++++++++++++++----- 7 files changed, 407 insertions(+), 119 deletions(-) diff --git a/include/session/config/pro.h b/include/session/config/pro.h index fd2da318..df2b155c 100644 --- a/include/session/config/pro.h +++ b/include/session/config/pro.h @@ -11,6 +11,19 @@ extern "C" { #include "../export.h" #include "../types.h" +typedef enum PRO_STATUS { // See session::ProStatus + PRO_STATUS_NIL, + PRO_STATUS_INVALID_PRO_BACKEND_SIG, + PRO_STATUS_INVALID_USER_SIG, + PRO_STATUS_VALID, + PRO_STATUS_EXPIRED, +} PRO_STATUS; + +typedef struct pro_signed_message { + span_u8 sig; + span_u8 msg; +} pro_signed_message; + typedef struct pro_proof { uint8_t version; uint8_t gen_index_hash[32]; @@ -19,7 +32,7 @@ typedef struct pro_proof { uint8_t sig[64]; } pro_proof; -typedef struct pro_pro_config { +typedef struct pro_config { uint8_t rotating_privkey[64]; pro_proof proof; } pro_pro_config; @@ -37,7 +50,7 @@ typedef struct pro_pro_config { /// - `bytes32` -- The 32 byte hash calculated from the proof LIBSESSION_EXPORT bytes32 pro_proof_hash(pro_proof const* proof); -/// API: pro/pro_proof_verify +/// API: pro/pro_proof_verify_signature /// /// Verify the proof was signed by the `verify_pubkey` /// @@ -49,10 +62,79 @@ LIBSESSION_EXPORT bytes32 pro_proof_hash(pro_proof const* proof); /// parameterised to detect errors about incorrectly sized arrays by the caller. /// /// Outputs: -/// - `bytes32` -- The 32 byte hash calculated from the proof -LIBSESSION_EXPORT bool pro_proof_verify( +/// - `bool` -- True if verified, false otherwise +LIBSESSION_EXPORT bool pro_proof_verify_signature( pro_proof const* proof, uint8_t const* verify_pubkey, size_t verify_pubkey_len); +/// API: pro/pro_proof_verify_message +/// +/// Check if the `rotating_pubkey` in the proof was the signatory of the message and signature +/// passed in. This function throws if an signature is passed in that isn't 64 bytes. +/// +/// Inputs: +/// - `proof` -- Proof to verify +/// - `sig` -- Signature to verify with the `rotating_pubkey`. The signature should have +/// originally been signed over `msg` passed in. +/// - `sig_len` -- Length of the signature, should be 64 bytes +/// - `msg` -- Message that the signature signed over with. It will be verified using the +/// embedded `rotating_pubkey`. +/// - `msg_len` -- Length of the message +/// +/// Outputs: +/// - `bool` -- True if verified, false otherwise (bad signature, or, invalid arguments). +LIBSESSION_EXPORT bool pro_proof_verify_message( + pro_proof const* proof, + uint8_t const* sig, + size_t sig_len, + uint8_t const* msg, + size_t msg_len); + +/// API: pro/pro_proof_is_active +/// +/// Check if the Pro proof is currently entitled to Pro given the `unix_ts` with respect to the +/// proof's `expiry_unix_ts` +/// +/// Inputs: +/// - `proof` -- Proof to verify +/// - `unix_ts_s` -- The unix timestamp in seconds to check the proof expiry time against +/// +/// Outputs: +/// - `bool` -- True if expired, false otherwise +LIBSESSION_EXPORT bool pro_proof_is_active(pro_proof const* proof, uint64_t unix_ts_s); + +/// API: pro/pro_proof_status +/// +/// Evaluate the status of the pro proof by checking it is signed by the `verify_pubkey`, it has +/// not expired via `unix_ts_s` and optionally verify that the `signed_msg` was signed by the +/// `rotating_pubkey` embedded in the proof. +/// +/// Internally this function calls `pro_proof_verify_signature`, `pro_proof_verify_message` and +/// optionally `pro_proof_is_active` in sequence. This function fails if an invalidly sized public +/// key or signature are passed in. They must be 32 and 64 bytes respectively, the appropriate +/// invalid status will be returned. +/// +/// Inputs: +/// - `proof` -- Proof to verify +/// - `verify_pubkey` -- 32 byte Ed25519 public key of the corresponding secret key to check if +/// they are the original signatory of the proof. +/// - `verify_pubkey_len` -- Length of the `verify_pubkey` should be 32 bytes +/// they are the original signatory of the proof. +/// - `unix_ts` -- Unix timestamp in seconds to compared against the embedded `expiry_unix_ts` +/// to determine if the proof has expired or not +/// - `signed_msg` -- Optionally set the payload to the message with the signature to verify if +/// the embedded `rotating_pubkey` in the proof signed the given message. +/// +/// Outputs: +/// - `status` - The derived status given the components of the message. If `signed_msg` is +/// not set then this function can never return `PRO_STATUS_INVALID_USER_SIG` from the set of +/// possible enum values. Otherwise this funtion can return all possible values. +LIBSESSION_EXPORT PRO_STATUS pro_proof_status( + pro_proof const* proof, + const uint8_t* verify_pubkey, + size_t verify_pubkey_len, + uint64_t unix_ts_s, + const pro_signed_message* signed_msg); + /// API: pro/pro_verify /// /// Verify the proof was signed by the `verify_pubkey` and that the `rotating_privkey` in the `pro` @@ -67,8 +149,8 @@ LIBSESSION_EXPORT bool pro_proof_verify( /// /// Outputs: /// - `bytes32` -- The 32 byte hash calculated from the proof -LIBSESSION_EXPORT bool pro_pro_verify( - pro_pro_config const* pro, uint8_t const* verify_pubkey, size_t verify_pubkey_len); +LIBSESSION_EXPORT bool pro_config_verify_signature( + pro_config const* pro, uint8_t const* verify_pubkey, size_t verify_pubkey_len); #ifdef __cplusplus } // extern "C" diff --git a/include/session/config/pro.hpp b/include/session/config/pro.hpp index a2b35f31..011abc77 100644 --- a/include/session/config/pro.hpp +++ b/include/session/config/pro.hpp @@ -1,5 +1,7 @@ #pragma once +#include + #include #include #include @@ -11,6 +13,20 @@ namespace session::config { enum ProProofVersion { ProProofVersion_v0 }; +enum class ProStatus { + // Pro proof sig was not signed by the Pro backend key + InvalidProBackendSig = PRO_STATUS_INVALID_PRO_BACKEND_SIG, + // Pro sig in the envelope was not signed by the Rotating key + InvalidUserSig = PRO_STATUS_INVALID_USER_SIG, + Valid = PRO_STATUS_VALID, // Proof is verified; has not expired + Expired = PRO_STATUS_EXPIRED, // Proof is verified; has expired +}; + +struct ProSignedMessage { + std::span sig; + std::span msg; +}; + /// keys used currently or in the past (so that we don't reuse): /// /// @ - version @@ -39,21 +55,76 @@ class ProProof { /// clients. array_uc64 sig; - /// API: pro/Proof::verify + /// API: pro/Proof::verify_signature /// /// Verify that the proof's contents was not tampered with by hashing the proof and checking /// that the hash was signed by the secret key of the given Ed25519 public key. /// /// For Session Pro intents and purposes, we expect proofs to be signed by the Session Pro - /// Backend public key. + /// Backend public key. This function throws if an incorrectly sized key is passed in. /// /// Inputs: - /// - `verify_pubkey` -- Ed25519 public key of the corresponding secret key to check if they are - /// the original signatory of the proof. + /// - `verify_pubkey` -- 32 byte Ed25519 public key of the corresponding secret key to check if + /// they are the original signatory of the proof. /// /// Outputs: /// - `bool` - True if the given key was the signatory of the proof, false otherwise - bool verify(const array_uc32& verify_pubkey) const; + bool verify_signature(const std::span& verify_pubkey) const; + + /// API: pro/Proof::verify_message + /// + /// Check if the `rotating_pubkey` in the proof was the signatory of the message and signature + /// passed in. This function throws if an signature is passed in that isn't 64 bytes. + /// + /// Inputs: + /// - `sig` -- Signature to verify with the `rotating_pubkey`. The signature should have + /// originally been signed over `msg` passed in. + /// - `msg` -- Message that the signature signed over with. It will be verified using the + /// embedded `rotating_pubkey`. + /// + /// Outputs: + /// - `bool` - True if the message was signed by the embedded `rotating_pubkey` false otherwise. + bool verify_message(std::span sig, const std::span msg) const; + + /// API: pro/Proof::is_active + /// + /// Check if Pro proof is currently entitled to Pro given the `unix_ts` with respect to the + /// proof's `expiry_unix_ts` + /// + /// Inputs: + /// - `unix_ts` -- Unix timestamp in seconds to compared against the embedded `expiry_unix_ts` + /// to determine if the proof has expired or not + /// + /// Outputs: + /// - `bool` - True if proof is active (i.e. has not expired), false otherwise. + bool is_active(std::chrono::sys_seconds unix_ts) const; + + /// API: pro/Proof::status + /// + /// Evaluate the status of the pro proof by checking it is signed by the `verify_pubkey`, it has + /// not expired via `unix_ts` and optionally verify that the `signed_msg` was signed by the + /// `rotating_pubkey` embedded in the proof. + /// + /// Internally this function calls `verify_signature`, `verify_message` and optionally + /// `is_active` in sequence. This function throws if an invalidly sized public key or signature + /// are passed in. They must be 32 and 64 bytes respectively. + /// + /// Inputs: + /// - `verify_pubkey` -- 32 byte Ed25519 public key of the corresponding secret key to check if + /// they are the original signatory of the proof. + /// - `unix_ts` -- Unix timestamp in seconds to compared against the embedded `expiry_unix_ts` + /// to determine if the proof has expired or not + /// - `signed_msg` -- Optionally set the payload to the message with the signature to verify if + /// the embedded `rotating_pubkey` in the proof signed the given message. + /// + /// Outputs: + /// - `ProStatus` - The derived status given the components of the message. If `signed_msg` is + /// not set then this function can never return `ProStatus::InvalidUserSig` from the set of + /// possible enum values. Otherwise this funtion can return all possible values. + ProStatus status( + std::span verify_pubkey, + std::chrono::sys_seconds unix_ts, + const std::optional& signed_msg); /// API: pro/Proof::hash /// @@ -89,7 +160,7 @@ class ProConfig { /// Outputs: /// - `bool` - True if the proof was verified and the proof's rotating public key corresponds to /// the public component of the `rotating_privkey`. - bool verify(const array_uc32& verify_pubkey) const; + bool verify_signature(const array_uc32& verify_pubkey) const; bool load(const dict& root); }; diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index dc4ff135..90300122 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -53,14 +53,6 @@ enum PRO_FEATURES_ { PRO_FEATURES_10K_CHARACTER_LIMIT | PRO_FEATURES_PRO_BADGE | PRO_FEATURES_ANIMATED_AVATAR }; -typedef enum PRO_STATUS { // See session::ProStatus - PRO_STATUS_NIL, - PRO_STATUS_INVALID_PRO_BACKEND_SIG, - PRO_STATUS_INVALID_USER_SIG, - PRO_STATUS_VALID, - PRO_STATUS_EXPIRED, -} PRO_STATUS; - typedef enum DESTINATION_TYPE { // See session::DestinationType DESTINATION_TYPE_CONTACT, DESTINATION_TYPE_SYNC_MESSAGE, diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index 2527ea33..b38ab116 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -37,15 +37,6 @@ namespace config::groups { class Keys; } -enum class ProStatus { - // Pro proof sig was not signed by the Pro backend key - InvalidProBackendSig = PRO_STATUS_INVALID_PRO_BACKEND_SIG, - // Pro sig in the envelope was not signed by the Rotating key - InvalidUserSig = PRO_STATUS_INVALID_USER_SIG, - Valid = PRO_STATUS_VALID, // Proof is verified; has not expired - Expired = PRO_STATUS_EXPIRED, // Proof is verified; has expired -}; - enum class DestinationType { Contact = DESTINATION_TYPE_CONTACT, SyncMessage = DESTINATION_TYPE_SYNC_MESSAGE, @@ -102,7 +93,7 @@ struct Envelope { }; struct DecryptedPro { - ProStatus status; // Validity of the proof embedded in the envelope + config::ProStatus status; // Validity of the proof embedded in the envelope // Session Pro proof that was embedded in the envelope, this is always populated irrespective of // the status but the validity of the contents should be verified by checking `status` config::ProProof proof; diff --git a/src/config/pro.cpp b/src/config/pro.cpp index 30c76ef9..281a5c2a 100644 --- a/src/config/pro.cpp +++ b/src/config/pro.cpp @@ -26,7 +26,7 @@ session::array_uc32 proof_hash_internal( return result; } -bool proof_verify_internal( +bool proof_verify_signature_internal( std::span hash, std::span sig, std::span verify_pubkey) { @@ -35,13 +35,14 @@ bool proof_verify_internal( assert(hash.size() == 32); assert(sig.size() == crypto_sign_ed25519_BYTES); assert(verify_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); + int verify_result = crypto_sign_ed25519_verify_detached( sig.data(), hash.data(), hash.size(), verify_pubkey.data()); bool result = verify_result == 0; return result; } -bool pro_verify_internal( +bool config_verify_signature_internal( std::span rotating_privkey, std::span verify_pubkey, std::uint8_t version, @@ -52,7 +53,7 @@ bool pro_verify_internal( session::array_uc32 hash = proof_hash_internal(version, gen_index_hash, rotating_pubkey, expiry_unix_ts); - if (!proof_verify_internal(hash, sig, verify_pubkey)) + if (!proof_verify_signature_internal(hash, sig, verify_pubkey)) return false; session::array_uc32 rederived_pk; @@ -67,6 +68,28 @@ bool pro_verify_internal( return result; } +bool proof_verify_message_internal( + std::span rotating_pubkey, + std::span sig, + std::span msg) { + // C++ throws on bad size, C uses a fixed sized array + assert(rotating_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); + if (sig.size() != crypto_sign_ed25519_BYTES) + return false; + + int verify_result = crypto_sign_ed25519_verify_detached( + reinterpret_cast(sig.data()), + msg.data(), + msg.size(), + reinterpret_cast(rotating_pubkey.data())); + bool result = verify_result == 0; + return result; +} + +bool proof_is_active_internal(uint64_t expiry_unix_ts, uint64_t unix_ts_s) { + bool result = unix_ts_s <= expiry_unix_ts; + return result; +} } // namespace namespace session::config { @@ -76,9 +99,50 @@ static_assert(sizeof(((ProProof*)0)->gen_index_hash) == 32); static_assert(sizeof(((ProProof*)0)->rotating_pubkey) == crypto_sign_ed25519_PUBLICKEYBYTES); static_assert(sizeof(((ProProof*)0)->sig) == crypto_sign_ed25519_BYTES); -bool ProProof::verify(const array_uc32& verify_pubkey) const { +bool ProProof::verify_signature(const std::span& verify_pubkey) const { + if (verify_pubkey.size() != crypto_sign_ed25519_PUBLICKEYBYTES) + throw std::invalid_argument{fmt::format( + "Invalid verify_pubkey: Must be 32 byte Ed25519 public key (was: {})", + verify_pubkey.size())}; + array_uc32 hash_to_sign = hash(); - bool result = proof_verify_internal(hash_to_sign, sig, verify_pubkey); + bool result = proof_verify_signature_internal(hash_to_sign, sig, verify_pubkey); + return result; +} + +bool ProProof::verify_message(std::span sig, std::span msg) const { + if (sig.size() != crypto_sign_ed25519_BYTES) + throw std::invalid_argument{fmt::format( + "Invalid signed_msg: Signature must be 64 bytes (was: {})", sig.size())}; + bool result = proof_verify_message_internal(rotating_pubkey, sig, msg); + return result; +} + +bool ProProof::is_active(std::chrono::sys_seconds unix_ts) const { + bool result = proof_is_active_internal( + expiry_unix_ts.time_since_epoch().count(), unix_ts.time_since_epoch().count()); + return result; +} + +ProStatus ProProof::status( + std::span verify_pubkey, + std::chrono::sys_seconds unix_ts, + const std::optional& signed_msg) { + ProStatus result = ProStatus::Valid; + // Verify the at the proof is verified by the Session Pro Backend key (e.g.: It was + // issued by an authoritative backend) + if (!verify_signature(verify_pubkey)) + result = ProStatus::InvalidProBackendSig; + + // Check if the message was signed if the user passed one in to verify against + if (result == ProStatus::Valid && signed_msg) { + if (!verify_message(signed_msg->sig, signed_msg->msg)) + result = ProStatus::InvalidUserSig; + } + + // Check if the proof has expired + if (result == ProStatus::Valid && !is_active(unix_ts)) + result = ProStatus::Expired; return result; } @@ -113,9 +177,9 @@ bool ProProof::load(const dict& root) { return true; } -bool ProConfig::verify(const array_uc32& verify_pubkey) const { +bool ProConfig::verify_signature(const array_uc32& verify_pubkey) const { uint64_t expiry_unix_ts = proof.expiry_unix_ts.time_since_epoch().count(); - bool result = pro_verify_internal( + bool result = config_verify_signature_internal( rotating_privkey, verify_pubkey, proof.version, @@ -157,48 +221,83 @@ static_assert((sizeof((pro_proof*)0)->rotating_pubkey) == crypto_sign_ed25519_PU static_assert((sizeof((pro_proof*)0)->sig) == crypto_sign_ed25519_BYTES); LIBSESSION_C_API bytes32 pro_proof_hash(pro_proof const* proof) { - session::array_uc32 hash = proof_hash_internal( - proof->version, proof->gen_index_hash, proof->rotating_pubkey, proof->expiry_unix_ts); bytes32 result = {}; - std::memcpy(result.data, hash.data(), hash.size()); + if (proof) { + session::array_uc32 hash = proof_hash_internal( + proof->version, + proof->gen_index_hash, + proof->rotating_pubkey, + proof->expiry_unix_ts); + std::memcpy(result.data, hash.data(), hash.size()); + } return result; } -LIBSESSION_C_API bool pro_proof_verify( +LIBSESSION_C_API bool pro_proof_verify_signature( pro_proof const* proof, uint8_t const* verify_pubkey, size_t verify_pubkey_len) { - if (verify_pubkey_len != crypto_sign_ed25519_PUBLICKEYBYTES) + if (!proof || verify_pubkey_len != crypto_sign_ed25519_PUBLICKEYBYTES) return false; auto verify_pubkey_span = std::span(verify_pubkey, verify_pubkey_len); - auto gen_index_hash = - std::span(proof->gen_index_hash, sizeof proof->gen_index_hash); - auto rotating_pubkey = - std::span(proof->rotating_pubkey, sizeof proof->rotating_pubkey); - auto sig = std::span(proof->sig, sizeof proof->sig); - session::array_uc32 hash = proof_hash_internal( - proof->version, gen_index_hash, rotating_pubkey, proof->expiry_unix_ts); - bool result = proof_verify_internal(hash, sig, verify_pubkey_span); + proof->version, proof->gen_index_hash, proof->rotating_pubkey, proof->expiry_unix_ts); + bool result = proof_verify_signature_internal(hash, proof->sig, verify_pubkey_span); + return result; +} + +LIBSESSION_C_API bool pro_proof_verify_message( + pro_proof const* proof, + uint8_t const* sig, + size_t sig_len, + uint8_t const* msg, + size_t msg_len) { + std::span sig_span = {sig, sig_len}; + std::span msg_span = {msg, msg_len}; + bool result = proof_verify_message_internal(proof->rotating_pubkey, sig_span, msg_span); return result; } -LIBSESSION_C_API bool pro_pro_verify( +LIBSESSION_C_API bool pro_proof_is_active(pro_proof const* proof, uint64_t unix_ts_s) { + bool result = proof && proof_is_active_internal(proof->expiry_unix_ts, unix_ts_s); + return result; +} + +LIBSESSION_C_API PRO_STATUS pro_proof_status( + pro_proof const* proof, + const uint8_t* verify_pubkey, + size_t verify_pubkey_len, + uint64_t unix_ts_s, + const pro_signed_message* signed_msg) { + PRO_STATUS result = PRO_STATUS_VALID; + if (!pro_proof_verify_signature(proof, verify_pubkey, verify_pubkey_len)) + result = PRO_STATUS_INVALID_PRO_BACKEND_SIG; + + // Check if the message was signed if the user passed one in to verify against + if (result == PRO_STATUS_VALID && signed_msg) { + if (!pro_proof_verify_message( + proof, + signed_msg->sig.data, + signed_msg->sig.size, + signed_msg->msg.data, + signed_msg->msg.size)) + result = PRO_STATUS_INVALID_USER_SIG; + } + + // Check if the proof has expired + if (result == PRO_STATUS_VALID && !pro_proof_is_active(proof, unix_ts_s)) + result = PRO_STATUS_EXPIRED; + return result; +} + +LIBSESSION_C_API bool pro_config_verify_signature( pro_pro_config const* pro, uint8_t const* verify_pubkey, size_t verify_pubkey_len) { auto verify_pubkey_span = std::span(verify_pubkey, verify_pubkey_len); - auto rotating_privkey = - std::span(pro->rotating_privkey, sizeof pro->rotating_privkey); - auto gen_index_hash = std::span( - pro->proof.gen_index_hash, sizeof pro->proof.gen_index_hash); - auto rotating_pubkey = std::span( - pro->proof.rotating_pubkey, sizeof pro->proof.rotating_pubkey); - auto sig = std::span(pro->proof.sig, sizeof pro->proof.sig); - - bool result = pro_verify_internal( - rotating_privkey, + bool result = config_verify_signature_internal( + pro->rotating_privkey, verify_pubkey_span, pro->proof.version, - gen_index_hash, - rotating_pubkey, + pro->proof.gen_index_hash, + pro->proof.rotating_pubkey, pro->proof.expiry_unix_ts, - sig); + pro->proof.sig); return result; } diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index 805c503c..aaefed27 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -445,15 +445,6 @@ DecryptedEnvelope decrypt_envelope( throw std::runtime_error( "Parse decrypted message failed, pro metadata was malformed"); - // Verify the sig since we have extracted the rotating public key from the embedded - // proof - int verify_result = crypto_sign_ed25519_verify_detached( - reinterpret_cast(pro_sig.data()), - result.content_plaintext.data(), - result.content_plaintext.size(), - reinterpret_cast(proto_proof.rotatingpublickey().data())); - pro.status = verify_result == 0 ? ProStatus::Valid : ProStatus::InvalidUserSig; - // Fill out the resulting proof structure, we have parsed successfully pro.features = pro_msg.features(); std::memcpy(result.envelope.pro_sig.data(), pro_sig.data(), pro_sig.size()); @@ -470,18 +461,12 @@ DecryptedEnvelope decrypt_envelope( std::chrono::sys_seconds(std::chrono::seconds(proto_proof.expiryunixts())); std::memcpy(proof.sig.data(), proto_proof.sig().data(), proto_proof.sig().size()); - if (pro.status == ProStatus::Valid) { - // Verify the at the proof is verified by the Session Pro Backend key (e.g.: It was - // issued by an authoritative backend) - if (!proof.verify(pro_backend_pubkey)) - pro.status = ProStatus::InvalidProBackendSig; - - // Check if the proof has expired - if (pro.status == ProStatus::Valid) { - if (unix_ts > pro.proof.expiry_unix_ts) - pro.status = ProStatus::Expired; - } - } + // Evaluate the pro status given the extracted components (was it signed, is it expired, + // was the message signed validly?) + config::ProSignedMessage signed_msg = {}; + signed_msg.sig = to_span(pro_sig); + signed_msg.msg = result.content_plaintext; + pro.status = proof.status(pro_backend_pubkey, unix_ts, signed_msg); } } return result; @@ -563,9 +548,19 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( // Setup the pro backend pubkey array_uc32 pro_backend_pubkey_cpp = {}; - if (pro_backend_pubkey_len != sizeof(pro_backend_pubkey_cpp)) - return result; - std::memcpy(pro_backend_pubkey_cpp.data(), pro_backend_pubkey, pro_backend_pubkey_len); + if (pro_backend_pubkey) { + if (pro_backend_pubkey_len != sizeof(pro_backend_pubkey_cpp)) { + result.error_len_incl_null_terminator = std::snprintf( + error, + error_len, + "Invalid pro_backend_pubkey: Key was " + "set but was not 32 bytes, was: %zu", + pro_backend_pubkey_len) + + 1; + return result; + } + std::memcpy(pro_backend_pubkey_cpp.data(), pro_backend_pubkey, pro_backend_pubkey_len); + } // Setup decryption keys and decrypt DecryptEnvelopeKey keys_cpp = {}; @@ -645,8 +640,8 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( } // Since we support multiple keys, if some of the keys failed but one of them succeeded, we will - // zero out the error buffer to avoid conflating one of the failures with the function actually - // succeeding. + // zero out the error buffer to avoid conflating one of the failures when the function actually + // succeeded. if (result.success) result.error_len_incl_null_terminator = 0; diff --git a/tests/test_config_pro.cpp b/tests/test_config_pro.cpp index 8ef9e38a..9937c659 100644 --- a/tests/test_config_pro.cpp +++ b/tests/test_config_pro.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -8,7 +9,7 @@ using namespace oxenc::literals; TEST_CASE("Pro", "[config][pro]") { // Setup keys - std::array rotating_pk, signing_pk; + std::array rotating_pk, signing_pk; session::cleared_uc64 rotating_sk, signing_sk; { crypto_sign_ed25519_keypair(rotating_pk.data(), rotating_sk.data()); @@ -16,43 +17,100 @@ TEST_CASE("Pro", "[config][pro]") { } // Setup the Pro data structure - session::config::ProConfig pro = {}; + session::config::ProConfig pro_cpp = {}; + pro_config pro = {}; { - pro.rotating_privkey = rotating_sk; - pro.proof.version = 0; - pro.proof.rotating_pubkey = rotating_pk; - pro.proof.expiry_unix_ts = std::chrono::sys_seconds(1s); - + // CPP + pro_cpp.rotating_privkey = rotating_sk; + pro_cpp.proof.version = 0; + pro_cpp.proof.rotating_pubkey = rotating_pk; + pro_cpp.proof.expiry_unix_ts = std::chrono::sys_seconds(1s); constexpr auto gen_index_hash = "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"_hex_u; - static_assert(pro.proof.gen_index_hash.max_size() == gen_index_hash.size()); - std::memcpy(pro.proof.gen_index_hash.data(), gen_index_hash.data(), gen_index_hash.size()); + static_assert(pro_cpp.proof.gen_index_hash.max_size() == gen_index_hash.size()); + std::memcpy( + pro_cpp.proof.gen_index_hash.data(), gen_index_hash.data(), gen_index_hash.size()); + + // C + std::memcpy(pro.rotating_privkey, rotating_sk.data(), rotating_sk.size()); + pro.proof.version = pro_cpp.proof.version; + std::memcpy(pro.proof.rotating_pubkey, rotating_pk.data(), rotating_pk.size()); + pro.proof.expiry_unix_ts = pro_cpp.proof.expiry_unix_ts.time_since_epoch().count(); + std::memcpy(pro.proof.gen_index_hash, gen_index_hash.data(), gen_index_hash.size()); } - // Do the signing + // Generate and write the hashes that are signed by the faux pro backend into the proof { - static_assert(crypto_sign_ed25519_BYTES == pro.proof.sig.max_size()); - std::array hash_to_sign = pro.proof.hash(); + // Generate the hashes + static_assert(crypto_sign_ed25519_BYTES == pro_cpp.proof.sig.max_size()); + std::array hash_to_sign_cpp = pro_cpp.proof.hash(); + bytes32 hash_to_sign = pro_proof_hash(&pro.proof); + + static_assert(hash_to_sign_cpp.size() == sizeof(hash_to_sign)); + CHECK(std::memcmp(hash_to_sign_cpp.data(), hash_to_sign.data, hash_to_sign_cpp.size()) == + 0); + + // Write the signature into the proof int sig_result = crypto_sign_ed25519_detached( - pro.proof.sig.data(), + pro_cpp.proof.sig.data(), nullptr, - hash_to_sign.data(), - hash_to_sign.size(), + hash_to_sign_cpp.data(), + hash_to_sign_cpp.size(), + signing_sk.data()); + CHECK(sig_result == 0); + + sig_result = crypto_sign_ed25519_detached( + pro.proof.sig, + nullptr, + hash_to_sign.data, + sizeof(hash_to_sign.data), signing_sk.data()); CHECK(sig_result == 0); } - // Verify the proof + // Verify the signature in the proof was signed by the faux pro backend key "signing_sk" { - CHECK_FALSE(pro.verify(rotating_pk)); - CHECK(pro.verify(signing_pk)); + CHECK_FALSE(pro_cpp.verify_signature(rotating_pk)); + CHECK(pro_cpp.verify_signature(signing_pk)); + + CHECK_FALSE(pro_config_verify_signature(&pro, rotating_pk.data(), rotating_pk.size())); + CHECK(pro_config_verify_signature(&pro, signing_pk.data(), signing_pk.size())); + } + + // Verify expiry + { + CHECK(pro_cpp.proof.is_active(pro_cpp.proof.expiry_unix_ts)); + CHECK_FALSE(pro_cpp.proof.is_active(pro_cpp.proof.expiry_unix_ts + 1s)); + + CHECK(pro_proof_is_active(&pro.proof, pro.proof.expiry_unix_ts)); + CHECK_FALSE(pro_proof_is_active(&pro.proof, pro.proof.expiry_unix_ts + 1)); + } + + // Verify it can verify messages signed with the rotating public key + { + std::string_view body = "hello world"; + std::array sig = {}; + int sign_result = crypto_sign_ed25519_detached( + sig.data(), + nullptr, + reinterpret_cast(body.data()), + body.size(), + rotating_sk.data()); + CHECK(sign_result == 0); + CHECK(pro_cpp.proof.verify_message(sig, session::to_span(body))); + CHECK(pro_proof_verify_message( + &pro.proof, + sig.data(), + sig.size(), + reinterpret_cast(body.data()), + body.size())); } // Try loading the proof from dict session::config::dict good_dict; { // clang-format off - const session::config::ProProof& proof = pro.proof; + const session::config::ProProof& proof = pro_cpp.proof; good_dict = { {"r", std::string(reinterpret_cast(rotating_sk.data()), rotating_sk.size())}, {"p", session::config::dict{ @@ -67,23 +125,23 @@ TEST_CASE("Pro", "[config][pro]") { session::config::ProConfig loaded_pro = {}; CHECK(loaded_pro.load(good_dict)); - CHECK(loaded_pro.rotating_privkey == pro.rotating_privkey); - CHECK(loaded_pro.proof.version == pro.proof.version); - CHECK(loaded_pro.proof.gen_index_hash == pro.proof.gen_index_hash); - CHECK(loaded_pro.proof.rotating_pubkey == pro.proof.rotating_pubkey); - CHECK(loaded_pro.proof.expiry_unix_ts == pro.proof.expiry_unix_ts); - CHECK(loaded_pro.proof.sig == pro.proof.sig); - CHECK(loaded_pro.verify(signing_pk)); + CHECK(loaded_pro.rotating_privkey == pro_cpp.rotating_privkey); + CHECK(loaded_pro.proof.version == pro_cpp.proof.version); + CHECK(loaded_pro.proof.gen_index_hash == pro_cpp.proof.gen_index_hash); + CHECK(loaded_pro.proof.rotating_pubkey == pro_cpp.proof.rotating_pubkey); + CHECK(loaded_pro.proof.expiry_unix_ts == pro_cpp.proof.expiry_unix_ts); + CHECK(loaded_pro.proof.sig == pro_cpp.proof.sig); + CHECK(loaded_pro.verify_signature(signing_pk)); } // Try loading a proof with a bad signature in it from dict { session::config::dict bad_dict = good_dict; - std::array broken_sig = pro.proof.sig; + std::array broken_sig = pro_cpp.proof.sig; broken_sig[0] = ~broken_sig[0]; // Break the sig // clang-format off - const session::config::ProProof& proof = pro.proof; + const session::config::ProProof& proof = pro_cpp.proof; bad_dict = { {"r", std::string(reinterpret_cast(rotating_sk.data()), rotating_sk.size())}, {"p", session::config::dict{ @@ -98,6 +156,6 @@ TEST_CASE("Pro", "[config][pro]") { session::config::ProConfig loaded_pro = {}; CHECK(loaded_pro.load(bad_dict)); - CHECK_FALSE(loaded_pro.verify(signing_pk)); + CHECK_FALSE(loaded_pro.verify_signature(signing_pk)); } } From 37eb19a06799f46b09bfbcf31368ac9db17028a8 Mon Sep 17 00:00:00 2001 From: doylet Date: Mon, 25 Aug 2025 10:26:28 +1000 Subject: [PATCH 51/59] Re-add missing wrapping of 1o1 messages Was mistakenly removed, upon review of iOS code 1o1s are wrapped in an envelope. --- include/session/session_protocol.h | 6 +- include/session/session_protocol.hpp | 6 +- src/session_protocol.cpp | 142 +++++++++++++++++++-------- 3 files changed, 107 insertions(+), 47 deletions(-) diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index 90300122..07e56014 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -213,9 +213,9 @@ LIBSESSION_EXPORT void session_protocol_encrypt_for_destination_free( /// API: session_protocol/session_protocol_decrypt_envelope /// -/// Given an envelope payload (i.e.: protobuf encoded stream of `Envelope` or encrypted `Envelope` -/// using a Groups v2 key) parse (or decrypt) the envelope and return the envelope content decrypted -/// if necessary. +/// Given an envelope payload (i.e.: protobuf encoded stream of `WebsocketRequestMessage` which +/// wraps an `Envelope` for 1o1 messages/sync messages, or `Envelope` encrypted using a Groups v2 +/// key) parse (or decrypt) the envelope and return the envelope content decrypted if necessary. /// /// A groups v2 envelope will get decrypted with the group keys. A non-groups v2 envelope will get /// decrypted with the specified Ed25519 private key in the `keys` object. Only one of these keys diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index b38ab116..7c2016a9 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -224,9 +224,9 @@ EncryptedForDestination encrypt_for_destination( /// API: session_protocol/decrypt_envelope /// -/// Given an envelope payload (i.e.: protobuf encoded stream of `Envelope` or encrypted `Envelope` -/// using a Groups v2 key) parse (or decrypt) the envelope and return the envelope content decrypted -/// if necessary. +/// Given an envelope payload (i.e.: protobuf encoded stream of `WebsocketRequestMessage` which +/// wraps an `Envelope` for 1o1 messages/sync messages, or `Envelope` encrypted using a Groups v2 +/// key) parse (or decrypt) the envelope and return the envelope content decrypted if necessary. /// /// A groups v2 envelope will get decrypted with the group keys. A non-groups v2 envelope will get /// decrypted with the specified Ed25519 private key in the `keys` object. Only one of these keys diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index aaefed27..05197349 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -73,6 +73,14 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( EncryptForBlindedRecipient, }; + // The step to partake after enveloping the content payload + enum class AfterEnvelope { + Nil, + EnvelopeIsCipherText, // No extra bit-mangling required after enveloping + WrapInWSMessage, // Wrap in the protobuf websocket message after enveloping + KeysEncryptMessage, // Encrypt with the group keys after ennveloping + }; + struct EncodeContext { Mode mode; // Parameters for BuildMode => Envelope @@ -88,7 +96,8 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( // Type of message to mark the enevelope as std::optional envelope_type; - bool after_envelope_keys_encrypt_message; // Encrypt with group keys + // Action to take after generating the envelope (e.g.: further encryption/wrapping) + AfterEnvelope after_envelope; }; // Figure out how to encrypt the message based on the destination and setup the encoding context @@ -101,7 +110,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( if (space == config::Namespace::GroupMessages) { enc.mode = Mode::Envelope; enc.before_envelope_encrypt_for_recipient_deterministic = false; - enc.after_envelope_keys_encrypt_message = true; + enc.after_envelope = AfterEnvelope::KeysEncryptMessage; enc.envelope_type = SessionProtos::Envelope_Type::Envelope_Type_CLOSED_GROUP_MESSAGE; } else if (space == config::Namespace::RevokedRetrievableGroupMessages) { @@ -124,7 +133,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( enc.mode = Mode::Envelope; enc.before_envelope_encrypt_for_recipient_deterministic = true; enc.envelope_type = SessionProtos::Envelope_Type::Envelope_Type_SESSION_MESSAGE; - enc.after_envelope_keys_encrypt_message = false; + enc.after_envelope = AfterEnvelope::WrapInWSMessage; } else { // See: // https://github.com/session-foundation/session-ios/blob/82deef869d0f7389b799295817f42ad14f8a1316/SessionMessagingKit/Sending%20%26%20Receiving/MessageSender.swift#L498 @@ -136,7 +145,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( enc.mode = Mode::Envelope; enc.before_envelope_encrypt_for_recipient_deterministic = true; enc.envelope_type = SessionProtos::Envelope_Type::Envelope_Type_SESSION_MESSAGE; - enc.after_envelope_keys_encrypt_message = false; + enc.after_envelope = AfterEnvelope::WrapInWSMessage; } break; case DestinationType::Community: { @@ -183,37 +192,69 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( } result.encrypted = true; - if (enc.after_envelope_keys_encrypt_message) { - std::string bytes = envelope.SerializeAsString(); - if (dest_group_ed25519_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES + 1) - dest_group_ed25519_pubkey = dest_group_ed25519_pubkey.subspan(1); - - std::vector ciphertext = encrypt_for_group( - ed25519_privkey, - dest_group_ed25519_pubkey, - dest_group_ed25519_privkey, - to_span(bytes), - /*compress*/ true, - /*padding*/ 256); - - if (use_malloc == UseMalloc::Yes) { - result.ciphertext_c = - span_u8_copy_or_throw(ciphertext.data(), ciphertext.size()); - } else { - result.ciphertext_cpp = std::move(ciphertext); - } - } else { - [[maybe_unused]] bool serialized = false; - if (use_malloc == UseMalloc::Yes) { - result.ciphertext_c = span_u8_alloc_or_throw(envelope.ByteSizeLong()); - serialized = envelope.SerializeToArray( - result.ciphertext_c.data, result.ciphertext_c.size); - } else { - result.ciphertext_cpp.resize(envelope.ByteSizeLong()); - serialized = envelope.SerializeToArray( - result.ciphertext_cpp.data(), result.ciphertext_cpp.size()); - } - assert(serialized); + switch (enc.after_envelope) { + case AfterEnvelope::Nil: + assert(false && "Dev error, after envelope action was not set"); + break; + + case AfterEnvelope::KeysEncryptMessage: { + std::string bytes = envelope.SerializeAsString(); + if (dest_group_ed25519_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES + 1) + dest_group_ed25519_pubkey = dest_group_ed25519_pubkey.subspan(1); + + std::vector ciphertext = encrypt_for_group( + ed25519_privkey, + dest_group_ed25519_pubkey, + dest_group_ed25519_privkey, + to_span(bytes), + /*compress*/ true, + /*padding*/ 256); + + if (use_malloc == UseMalloc::Yes) { + result.ciphertext_c = + span_u8_copy_or_throw(ciphertext.data(), ciphertext.size()); + } else { + result.ciphertext_cpp = std::move(ciphertext); + } + } break; + + case AfterEnvelope::WrapInWSMessage: { + // Setup message + WebSocketProtos::WebSocketMessage msg = {}; + msg.set_type( + WebSocketProtos::WebSocketMessage_Type::WebSocketMessage_Type_REQUEST); + + // Make request + WebSocketProtos::WebSocketRequestMessage* req_msg = msg.mutable_request(); + req_msg->set_body(envelope.SerializeAsString()); + + // Write message as ciphertext + [[maybe_unused]] bool serialized = false; + if (use_malloc == UseMalloc::Yes) { + result.ciphertext_c = span_u8_alloc_or_throw(msg.ByteSizeLong()); + serialized = msg.SerializeToArray( + result.ciphertext_c.data, result.ciphertext_c.size); + } else { + result.ciphertext_cpp.resize(msg.ByteSizeLong()); + serialized = msg.SerializeToArray( + result.ciphertext_cpp.data(), result.ciphertext_cpp.size()); + } + assert(serialized); + } break; + + case AfterEnvelope::EnvelopeIsCipherText: { + [[maybe_unused]] bool serialized = false; + if (use_malloc == UseMalloc::Yes) { + result.ciphertext_c = span_u8_alloc_or_throw(envelope.ByteSizeLong()); + serialized = envelope.SerializeToArray( + result.ciphertext_c.data, result.ciphertext_c.size); + } else { + result.ciphertext_cpp.resize(envelope.ByteSizeLong()); + serialized = envelope.SerializeToArray( + result.ciphertext_cpp.data(), result.ciphertext_cpp.size()); + } + assert(serialized); + } break; } } break; @@ -278,8 +319,9 @@ DecryptedEnvelope decrypt_envelope( // The caller is indicating that the envelope_payload is encrypted, if the group keys are // provided. We will decrypt the payload to get the plaintext. In all other cases, the envelope - // is assumed to be unencrypted and can be used verbatim. - std::vector envelope_plaintext_from_group_keys; + // is assumed to be websocket wrapped + std::vector envelope_from_decrypted_groups; + std::string envelope_from_websocket_message; if (keys.group_ed25519_pubkey) { // Decrypt using the keys DecryptGroupMessage decrypt = decrypt_group_message( @@ -292,8 +334,8 @@ DecryptedEnvelope decrypt_envelope( decrypt.session_id.size())}; // Update the plaintext to use the decrypted envelope - envelope_plaintext_from_group_keys = std::move(decrypt.plaintext); - envelope_plaintext = envelope_plaintext_from_group_keys; + envelope_from_decrypted_groups = std::move(decrypt.plaintext); + envelope_plaintext = envelope_from_decrypted_groups; // Copy keys out assert(decrypt.session_id.starts_with("05")); @@ -301,6 +343,25 @@ DecryptedEnvelope decrypt_envelope( decrypt.session_id.begin() + 2, decrypt.session_id.end() - 2, result.sender_x25519_pubkey.begin()); + } else { + // Assumed to be a 1o1/sync message which is wrapped in a websocket message + WebSocketProtos::WebSocketMessage ws_msg; + if (!ws_msg.ParseFromArray(envelope_plaintext.data(), envelope_plaintext.size())) + throw std::runtime_error{fmt::format( + "Parse websocket wrapped envelope from payload failed: {}", + envelope_plaintext.size())}; + + if (!ws_msg.has_request()) + throw std::runtime_error{"Parse websocket wrapped envelope failed, missing request"}; + + if (!ws_msg.request().has_body()) + throw std::runtime_error{ + "Parse websocket wrapped envelope failed, missing request body"}; + + WebSocketProtos::WebSocketRequestMessage* request = ws_msg.mutable_request(); + std::string* body = request->mutable_body(); + envelope_from_websocket_message = std::move(*body); + envelope_plaintext = to_span(envelope_from_websocket_message); } if (!envelope.ParseFromArray(envelope_plaintext.data(), envelope_plaintext.size())) @@ -381,8 +442,7 @@ DecryptedEnvelope decrypt_envelope( if (crypto_sign_ed25519_pk_to_curve25519( result.sender_x25519_pubkey.data(), result.sender_ed25519_pubkey.data()) != 0) throw std::runtime_error( - "Parse content failed, ed25519 public key could not be converted to " - "x25519 " + "Parse content failed, ed25519 public key could not be converted to x25519 " "key."); } From 2a497894fe82761b15bc5460065e931bf9966ce8 Mon Sep 17 00:00:00 2001 From: doylet Date: Mon, 25 Aug 2025 15:21:56 +1000 Subject: [PATCH 52/59] Mitigate snprintf error prone return value --- include/session/types.h | 18 ++++++++++++++++++ src/session_encrypt.cpp | 5 +++-- src/session_protocol.cpp | 12 +++++++----- src/types.cpp | 14 ++++++++++++++ 4 files changed, 42 insertions(+), 7 deletions(-) diff --git a/include/session/types.h b/include/session/types.h index e5cfba32..a5eb1c44 100644 --- a/include/session/types.h +++ b/include/session/types.h @@ -27,6 +27,24 @@ span_u8 span_u8_alloc_or_throw(size_t size); /// is no longer needed. span_u8 span_u8_copy_or_throw(const void* data, size_t size); +/// A wrapper around snprintf that fixes a common bug in the value the printing function returns +/// when a buffer is passed in. Irrespective of whether a buffer is passed in, snprintf is defined +/// to return: +/// +/// number of characters (not including the terminating null character) which would have been +/// written to buffer if bufsz was ignored +/// +/// This means if the user passes in a buffer to small, the return value is always the amount of +/// bytes required. This means the user always has to calculate the number of bytes written as: +/// +/// size_t bytes_written = min(snprintf(buffer, size, ...), size); +/// +/// This is error prone. This function does the `min(...)` for you so that this function +/// _always_ calculates the actual number of bytes written (not including the null-terminator). If a +/// NULL is passed in then this function returns the number of bytes actually needed to write the +/// entire string (as per normal snprintf behaviour). +int snprintf_bytes_written_clamped(char* buffer, size_t size, char const* fmt, ...); + #ifdef __cplusplus } #endif diff --git a/src/session_encrypt.cpp b/src/session_encrypt.cpp index 6a622d01..feb28a99 100644 --- a/src/session_encrypt.cpp +++ b/src/session_encrypt.cpp @@ -1143,7 +1143,8 @@ LIBSESSION_C_API session_encrypt_group_message session_encrypt_for_group( } catch (const std::exception& e) { std::string error_cpp = e.what(); result.error_len_incl_null_terminator = - std::snprintf(error, error_len, "%.*s", (int)error_cpp.size(), error_cpp.data()) + + snprintf_bytes_written_clamped( + error, error_len, "%.*s", (int)error_cpp.size(), error_cpp.data()) + 1; } return result; @@ -1258,7 +1259,7 @@ LIBSESSION_C_API session_decrypt_group_message_result session_decrypt_group_mess } catch (const std::exception& e) { std::string error_cpp = e.what(); result.error_len_incl_null_terminator = - std::snprintf( + snprintf_bytes_written_clamped( error, error_len, "%.*s", (int)error_cpp.size(), error_cpp.data()) + 1; } diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index 05197349..753b4def 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -574,7 +574,7 @@ session_protocol_encrypt_for_destination( }; } catch (const std::exception& e) { std::string error_cpp = e.what(); - result.error_len_incl_null_terminator = std::snprintf( + result.error_len_incl_null_terminator = snprintf_bytes_written_clamped( error, error_len, "%.*s", @@ -610,7 +610,7 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( array_uc32 pro_backend_pubkey_cpp = {}; if (pro_backend_pubkey) { if (pro_backend_pubkey_len != sizeof(pro_backend_pubkey_cpp)) { - result.error_len_incl_null_terminator = std::snprintf( + result.error_len_incl_null_terminator = snprintf_bytes_written_clamped( error, error_len, "Invalid pro_backend_pubkey: Key was " @@ -644,7 +644,7 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( break; } catch (const std::exception& e) { std::string error_cpp = e.what(); - result.error_len_incl_null_terminator = std::snprintf( + result.error_len_incl_null_terminator = snprintf_bytes_written_clamped( error, error_len, "%.*s", @@ -656,7 +656,9 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( if (keys->ed25519_privkeys_len == 0) { result.error_len_incl_null_terminator = - std::snprintf(error, error_len, "No keys ed25519_privkeys were provided") + 1; + snprintf_bytes_written_clamped( + error, error_len, "No keys ed25519_privkeys were provided") + + 1; } // Marshall into c type @@ -666,7 +668,7 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( } catch (const std::exception& e) { std::string error_cpp = e.what(); result.success = false; - result.error_len_incl_null_terminator = std::snprintf( + result.error_len_incl_null_terminator = snprintf_bytes_written_clamped( error, error_len, "%.*s", diff --git a/src/types.cpp b/src/types.cpp index 5285f954..bca3c989 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -1,6 +1,8 @@ #include #include +#include + span_u8 span_u8_alloc_or_throw(size_t size) { span_u8 result = {}; result.size = size; @@ -16,3 +18,15 @@ span_u8 span_u8_copy_or_throw(const void* data, size_t size) { std::memcpy(result.data, data, result.size); return result; } + +int snprintf_bytes_written_clamped(char* buffer, size_t size, char const* fmt, ...) { + va_list args; + va_start(args, fmt); + int bytes_required_not_incl_null = vsnprintf(buffer, size, fmt, args); + va_end(args); + + int result = bytes_required_not_incl_null; + if (buffer) + result = std::min(static_cast(size), result); + return result; +} From 680d077e50b7c54387badfe283df5a2f6ea790b8 Mon Sep 17 00:00:00 2001 From: doylet Date: Mon, 25 Aug 2025 16:57:33 +1000 Subject: [PATCH 53/59] Address some outdated doc comments --- include/session/session_protocol.h | 8 ++------ include/session/session_protocol.hpp | 11 +++++------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index 07e56014..96dcd4d4 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -128,8 +128,8 @@ typedef struct session_protocol_encrypted_for_destination { /// Determine the Pro features that are used in a given conversation message. /// /// Inputs: -/// - `msg_size` -- the size of the message in bytes to determine if the message requires access to -/// the higher character limit available in Session Pro +/// - `msg_size` -- the size of the message in UTF16 code units to determine if the message requires +/// access to the higher character limit available in Session Pro /// - `flags` -- extra pro features that are known by clients that they wish to be activated on /// this message /// @@ -217,10 +217,6 @@ LIBSESSION_EXPORT void session_protocol_encrypt_for_destination_free( /// wraps an `Envelope` for 1o1 messages/sync messages, or `Envelope` encrypted using a Groups v2 /// key) parse (or decrypt) the envelope and return the envelope content decrypted if necessary. /// -/// A groups v2 envelope will get decrypted with the group keys. A non-groups v2 envelope will get -/// decrypted with the specified Ed25519 private key in the `keys` object. Only one of these keys -/// need to be set depending on the type of envelope payload passed into the function. -/// /// See: session_protocol/decrypt_envelope for more information /// /// The encryption result must be freed with `session_protocol_decrypt_envelope_free` when the diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index 7c2016a9..5c1e5441 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -163,8 +163,8 @@ struct EncryptedForDestination { /// Determine the Pro features that are used in a given conversation message. /// /// Inputs: -/// - `msg_size` -- the size of the message in bytes to determine if the message requires access to -/// the higher character limit available in Session Pro +/// - `msg_size` -- the size of the message in UTF16 code units to determine if the message requires +/// access to the higher character limit available in Session Pro /// - `flags` -- extra pro features that are known by clients that they wish to be activated on /// this message /// @@ -232,10 +232,9 @@ EncryptedForDestination encrypt_for_destination( /// decrypted with the specified Ed25519 private key in the `keys` object. Only one of these keys /// need to be set depending on the type of envelope payload passed into the function. /// -/// If the message does not use Session Pro features, the pro status will be set to nil and all -/// other pro fields are to be ignored. If the pro status is non-nil then the pro fields will be -/// populated with data about the Session Pro proof embedded in the envelope including the features -/// used and if the proof was valid/expired e.t.c. +/// If the message does not use Session Pro features, the `pro` object will be set to nil. Otherwise +/// the pro fields will be populated with data about the Session Pro proof embedded in the envelope +/// including the features used and if the proof was valid/expired e.t.c. /// /// This function will throw if parsing failed such as a required field is missing, the field is /// smaller or larger than expected, decryption failed, or an invariant failed. Notably this From bf5e703ecd85dd93e6a0956d09e4eca4cee37888 Mon Sep 17 00:00:00 2001 From: doylet Date: Fri, 29 Aug 2025 11:43:30 +1000 Subject: [PATCH 54/59] Use bytes32/64/33 in session protocol, add wrapper encrypt for {1o1,group,comms} functions --- include/session/session_protocol.h | 61 ++++++-- include/session/session_protocol.hpp | 33 ++++- include/session/types.h | 8 ++ src/config/groups/keys.cpp | 4 +- src/session_protocol.cpp | 172 +++++++++++++++++++++-- src/types.cpp | 4 +- tests/test_session_protocol.cpp | 200 +++++++++++++-------------- 7 files changed, 347 insertions(+), 135 deletions(-) diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index 96dcd4d4..1213a0e3 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -64,15 +64,14 @@ typedef enum DESTINATION_TYPE { // See session::DestinationType typedef struct session_protocol_destination { // See session::Destination DESTINATION_TYPE type; - // The pro signature is optional, set this flag to true to make the encryption function take - // into account the signature or otherwise the signature is ignored. - bool has_pro_sig; - uint8_t pro_sig[64]; - uint8_t recipient_pubkey[33]; + // The pro signature is optional, set the pointer to a 64 byte pro signature + // to include it into the encrypted message, ignored otherwise + const bytes64 *pro_sig; + bytes33 recipient_pubkey; uint64_t sent_timestamp_ms; - uint8_t community_inbox_server_pubkey[32]; - uint8_t group_ed25519_pubkey[33]; - uint8_t group_ed25519_privkey[32]; + bytes32 community_inbox_server_pubkey; + bytes33 group_ed25519_pubkey; + bytes32 group_ed25519_privkey; } session_protocol_destination; // Indicates which optional fields in the envelope has been populated out of the optional fields in @@ -88,10 +87,10 @@ enum ENVELOPE_FLAGS_ { typedef struct session_protocol_envelope { ENVELOPE_FLAGS flags; uint64_t timestamp_ms; - uint8_t source[33]; + bytes33 source; uint32_t source_device; uint64_t server_timestamp; - uint8_t pro_sig[64]; + bytes64 pro_sig; } session_protocol_envelope; typedef struct session_protocol_decrypt_envelope_keys { @@ -106,8 +105,8 @@ typedef struct session_protocol_decrypted_envelope { bool success; session_protocol_envelope envelope; span_u8 content_plaintext; - uint8_t sender_ed25519_pubkey[32]; - uint8_t sender_x25519_pubkey[32]; + bytes32 sender_ed25519_pubkey; + bytes32 sender_x25519_pubkey; PRO_STATUS pro_status; pro_proof pro_proof; PRO_FEATURES pro_features; @@ -139,6 +138,44 @@ typedef struct session_protocol_encrypted_for_destination { LIBSESSION_EXPORT PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_EXTRA_FEATURES flags); +LIBSESSION_EXPORT +session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for_1o1( + const void* plaintext, + size_t plaintext_len, + const void* ed25519_privkey, + size_t ed25519_privkey_len, + uint64_t sent_timestamp_ms, + const bytes33* recipient_pubkey, + const bytes64* pro_sig, + char* error, + size_t error_len); + +LIBSESSION_EXPORT +session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for_community_inbox( + const void* plaintext, + size_t plaintext_len, + const void* ed25519_privkey, + size_t ed25519_privkey_len, + uint64_t sent_timestamp_ms, + const bytes33* recipient_pubkey, + const bytes32* community_pubkey, + const bytes64* pro_sig, + char* error, + size_t error_len); + +LIBSESSION_EXPORT +session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for_group( + const void* plaintext, + size_t plaintext_len, + const void* ed25519_privkey, + size_t ed25519_privkey_len, + uint64_t sent_timestamp_ms, + const bytes33* group_ed25519_pubkey, + const bytes32* group_ed25519_privkey, + const bytes64* pro_sig, + char* error, + size_t error_len); + /// API: session_protocol/session_protocol_encrypt_for_destination /// /// Given an unencrypted plaintext representation of the content (i.e.: protobuf encoded stream of diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index 5c1e5441..8133ad2e 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -57,12 +57,12 @@ struct Destination { // this signature. std::optional pro_sig; - // Set to the recipient of the message if it requires one. Ignored otherwise (for example - // ignored in type => Community) - array_uc33 recipient_pubkey; - // The timestamp to assign to the message envelope std::chrono::milliseconds sent_timestamp_ms; + // + // When type => (CommunityInbox || SyncMessage || Contact): set to the recipient's Session + // public key + array_uc33 recipient_pubkey; // When type => CommunityInbox: set this pubkey to the server's key array_uc32 community_inbox_server_pubkey; @@ -74,7 +74,7 @@ struct Destination { // When type => Group: Set the private key of the group for groups v2 messages. Typically // the latest encryption key for the group, e.g: `Keys::group_enc_key` or // `groups_keys_group_enc_key` - array_uc32 group_ed25519_privkey; + cleared_uc32 group_ed25519_privkey; }; struct Envelope { @@ -173,6 +173,29 @@ struct EncryptedForDestination { /// `Content` PRO_FEATURES get_pro_features_for_msg(size_t msg_size, PRO_EXTRA_FEATURES flags); +EncryptedForDestination encrypt_and_wrap_for_1o1( + std::span plaintext, + std::span ed25519_privkey, + std::chrono::milliseconds sent_timestamp, + const array_uc33& recipient_pubkey, + const std::optional& pro_sig); + +EncryptedForDestination encrypt_and_wrap_for_community_inbox( + std::span plaintext, + std::span ed25519_privkey, + std::chrono::milliseconds sent_timestamp, + const array_uc33& recipient_pubkey, + const array_uc32& community_pubkey, + const std::optional& pro_sig); + +EncryptedForDestination encrypt_and_wrap_for_group( + std::span plaintext, + std::span ed25519_privkey, + std::chrono::milliseconds sent_timestamp, + const array_uc33& group_ed25519_pubkey, + const cleared_uc32& group_ed25519_privkey, + const std::optional& pro_sig); + /// API: session_protocol/encrypt_for_destination /// /// Given an unencrypted plaintext representation of the content (i.e.: protobuf encoded stream of diff --git a/include/session/types.h b/include/session/types.h index a5eb1c44..47026c2d 100644 --- a/include/session/types.h +++ b/include/session/types.h @@ -17,6 +17,14 @@ struct bytes32 { uint8_t data[32]; }; +struct bytes33 { + uint8_t data[33]; +}; + +struct bytes64 { + uint8_t data[64]; +}; + /// Create a span of bytes that owns the `size` bytes of memory requested. If allocation fails, this /// function throws a runtime exception. The `data` pointer is span must be freed once the span /// is no longer needed. diff --git a/src/config/groups/keys.cpp b/src/config/groups/keys.cpp index 1931326f..a09c8d88 100644 --- a/src/config/groups/keys.cpp +++ b/src/config/groups/keys.cpp @@ -1240,7 +1240,9 @@ std::pair> Keys::decrypt_message( } if (!decrypt_success) // none of the keys worked - throw std::runtime_error{"unable to decrypt ciphertext with any current group keys"}; + throw std::runtime_error{fmt::format( + "unable to decrypt ciphertext with any current group keys; tried {}", + keys_.size() + (pending_key() ? 1 : 0))}; std::pair> result; result.first = std::move(decrypt.session_id); diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index 753b4def..eb8d048c 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -34,6 +34,58 @@ PRO_FEATURES get_pro_features_for_msg(size_t msg_size, PRO_EXTRA_FEATURES extra) return result; } +EncryptedForDestination encrypt_and_wrap_for_1o1( + std::span plaintext, + std::span ed25519_privkey, + std::chrono::milliseconds sent_timestamp, + const array_uc33& recipient_pubkey, + const std::optional& pro_sig) +{ + Destination dest = {}; + dest.type = DestinationType::Contact; + dest.pro_sig = pro_sig; + dest.sent_timestamp_ms = sent_timestamp; + dest.recipient_pubkey = recipient_pubkey; + EncryptedForDestination result = encrypt_for_destination(plaintext, ed25519_privkey, dest, config::Namespace::Default); + return result; +} + +EncryptedForDestination encrypt_and_wrap_for_community_inbox( + std::span plaintext, + std::span ed25519_privkey, + std::chrono::milliseconds sent_timestamp, + const array_uc33& recipient_pubkey, + const array_uc32& community_pubkey, + const std::optional& pro_sig) +{ + Destination dest = {}; + dest.type = DestinationType::CommunityInbox; + dest.pro_sig = pro_sig; + dest.sent_timestamp_ms = sent_timestamp; + dest.recipient_pubkey = recipient_pubkey; + dest.community_inbox_server_pubkey = community_pubkey; + EncryptedForDestination result = encrypt_for_destination(plaintext, ed25519_privkey, dest, config::Namespace::Default); + return result; +} + +EncryptedForDestination encrypt_and_wrap_for_group( + std::span plaintext, + std::span ed25519_privkey, + std::chrono::milliseconds sent_timestamp, + const array_uc33& group_ed25519_pubkey, + const cleared_uc32& group_ed25519_privkey, + const std::optional& pro_sig) +{ + Destination dest = {}; + dest.type = DestinationType::Group; + dest.pro_sig = pro_sig; + dest.sent_timestamp_ms = sent_timestamp; + dest.group_ed25519_pubkey = group_ed25519_pubkey; + dest.group_ed25519_privkey = group_ed25519_privkey; + EncryptedForDestination result = encrypt_for_destination(plaintext, ed25519_privkey, dest, config::Namespace::GroupMessages); + return result; +} + // Interop between the C and CPP API. The C api will request malloc which writes to `ciphertext_c`. // This pointer is taken verbatim and avoids requiring a copy from the CPP vector. The CPP api will // steal the contents from `ciphertext_cpp`. @@ -541,6 +593,100 @@ PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_EXTR return result; } +LIBSESSION_C_API +session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for_1o1( + const void* plaintext, + size_t plaintext_len, + const void* ed25519_privkey, + size_t ed25519_privkey_len, + uint64_t sent_timestamp_ms, + const bytes33* recipient_pubkey, + const bytes64* pro_sig, + char* error, + size_t error_len) { + + session_protocol_destination dest = {}; + dest.type = DESTINATION_TYPE_CONTACT; + dest.pro_sig = pro_sig; + dest.recipient_pubkey = *recipient_pubkey; + dest.sent_timestamp_ms = sent_timestamp_ms; + + session_protocol_encrypted_for_destination result = session_protocol_encrypt_for_destination( + plaintext, + plaintext_len, + ed25519_privkey, + ed25519_privkey_len, + &dest, + NAMESPACE_DEFAULT, + error, + error_len); + return result; +} + +LIBSESSION_C_API +session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for_community_inbox( + const void* plaintext, + size_t plaintext_len, + const void* ed25519_privkey, + size_t ed25519_privkey_len, + uint64_t sent_timestamp_ms, + const bytes33* recipient_pubkey, + const bytes32* community_pubkey, + const bytes64* pro_sig, + char* error, + size_t error_len) { + + session_protocol_destination dest = {}; + dest.type = DESTINATION_TYPE_COMMUNITY_INBOX; + dest.pro_sig = pro_sig; + dest.sent_timestamp_ms = sent_timestamp_ms; + dest.recipient_pubkey = *recipient_pubkey; + dest.community_inbox_server_pubkey = *community_pubkey; + + session_protocol_encrypted_for_destination result = session_protocol_encrypt_for_destination( + plaintext, + plaintext_len, + ed25519_privkey, + ed25519_privkey_len, + &dest, + NAMESPACE_DEFAULT, + error, + error_len); + return result; +} + +LIBSESSION_C_API +session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for_group( + const void* plaintext, + size_t plaintext_len, + const void* ed25519_privkey, + size_t ed25519_privkey_len, + uint64_t sent_timestamp_ms, + const bytes33* group_ed25519_pubkey, + const bytes32* group_ed25519_privkey, + const bytes64* pro_sig, + char* error, + size_t error_len) { + + session_protocol_destination dest = {}; + dest.type = DESTINATION_TYPE_GROUP; + dest.pro_sig = pro_sig; + dest.group_ed25519_pubkey = *group_ed25519_pubkey; + dest.group_ed25519_privkey = *group_ed25519_privkey; + dest.sent_timestamp_ms = sent_timestamp_ms; + + session_protocol_encrypted_for_destination result = session_protocol_encrypt_for_destination( + plaintext, + plaintext_len, + ed25519_privkey, + ed25519_privkey_len, + &dest, + NAMESPACE_GROUP_MESSAGES, + error, + error_len); + return result; +} + LIBSESSION_C_API session_protocol_encrypted_for_destination session_protocol_encrypt_for_destination( const void* plaintext, @@ -558,12 +704,12 @@ session_protocol_encrypt_for_destination( /*ed25519_privkey=*/ {static_cast(ed25519_privkey), ed25519_privkey_len}, /*dest_type=*/static_cast(dest->type), - /*dest_pro_sig=*/dest->has_pro_sig ? dest->pro_sig : std::span(), - /*dest_recipient_pubkey=*/dest->recipient_pubkey, + /*dest_pro_sig=*/dest->pro_sig ? dest->pro_sig->data : std::span(), + /*dest_recipient_pubkey=*/dest->recipient_pubkey.data, /*dest_sent_timestamp_ms=*/std::chrono::milliseconds(dest->sent_timestamp_ms), - /*dest_community_inbox_server_pubkey=*/dest->community_inbox_server_pubkey, - /*dest_group_ed25519_pubkey=*/dest->group_ed25519_pubkey, - /*dest_group_ed25519_privkey=*/dest->group_ed25519_privkey, + /*dest_community_inbox_server_pubkey=*/dest->community_inbox_server_pubkey.data, + /*dest_group_ed25519_pubkey=*/dest->group_ed25519_pubkey.data, + /*dest_group_ed25519_privkey=*/dest->group_ed25519_privkey.data, /*space=*/static_cast(space), /*use_malloc=*/UseMalloc::Yes); @@ -708,22 +854,22 @@ session_protocol_decrypted_envelope session_protocol_decrypt_envelope( result.error_len_incl_null_terminator = 0; std::memcpy( - result.envelope.source, + result.envelope.source.data, result_cpp.envelope.source.data(), - sizeof(result.envelope.source)); + sizeof(result.envelope.source.data)); std::memcpy( - result.envelope.pro_sig, + result.envelope.pro_sig.data, result_cpp.envelope.pro_sig.data(), - sizeof(result.envelope.pro_sig)); + sizeof(result.envelope.pro_sig.data)); std::memcpy( - result.sender_ed25519_pubkey, + result.sender_ed25519_pubkey.data, result_cpp.sender_ed25519_pubkey.data(), - sizeof(result.sender_ed25519_pubkey)); + sizeof(result.sender_ed25519_pubkey.data)); std::memcpy( - result.sender_x25519_pubkey, + result.sender_x25519_pubkey.data, result_cpp.sender_x25519_pubkey.data(), - sizeof(result.sender_x25519_pubkey)); + sizeof(result.sender_x25519_pubkey.data)); return result; } diff --git a/src/types.cpp b/src/types.cpp index bca3c989..c8dc8c23 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -26,7 +26,7 @@ int snprintf_bytes_written_clamped(char* buffer, size_t size, char const* fmt, . va_end(args); int result = bytes_required_not_incl_null; - if (buffer) - result = std::min(static_cast(size), result); + if (buffer && size && bytes_required_not_incl_null >= (size - 1)) + result = size - 1; return result; } diff --git a/tests/test_session_protocol.cpp b/tests/test_session_protocol.cpp index 866d3209..b8ca16af 100644 --- a/tests/test_session_protocol.cpp +++ b/tests/test_session_protocol.cpp @@ -22,6 +22,8 @@ struct SerialisedProtobufContentWithProForTesting { std::string plaintext; array_uc64 sig_over_plaintext_with_user_pro_key; array_uc32 pro_proof_hash; + bytes64 sig_over_plaintext_with_user_pro_key_c; + bytes32 pro_proof_hash_c; }; static SerialisedProtobufContentWithProForTesting build_protobuf_content_with_session_pro( @@ -76,6 +78,15 @@ static SerialisedProtobufContentWithProForTesting build_protobuf_content_with_se result.plaintext.size(), user_rotating_privkey.data()); + // Setup the C versions for convenience + std::memcpy( + result.sig_over_plaintext_with_user_pro_key_c.data, + result.sig_over_plaintext_with_user_pro_key.data(), + sizeof(result.sig_over_plaintext_with_user_pro_key_c.data)); + std::memcpy( + result.pro_proof_hash_c.data, + result.pro_proof_hash.data(), + sizeof(result.pro_proof_hash_c.data)); return result; } @@ -114,38 +125,36 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { SECTION("Encrypt with and w/o pro sig produce same payload size") { // Same payload size because the encrypt function should put in a dummy signature if one // wasn't specific to make pro and non-pro envelopes indistinguishable. - - session_protocol_destination dest = {}; - dest.type = DESTINATION_TYPE_CONTACT; - dest.sent_timestamp_ms = timestamp_ms.count(); - std::memcpy(dest.recipient_pubkey, keys.session_pk1.data(), sizeof(dest.recipient_pubkey)); + bytes33 recipient_pubkey = {}; + std::memcpy(recipient_pubkey.data, keys.session_pk1.data(), sizeof(recipient_pubkey.data)); // Withhold the pro signature - dest.has_pro_sig = false; char error[256]; session_protocol_encrypted_for_destination encrypt_without_pro_sig = - session_protocol_encrypt_for_destination( + session_protocol_encrypt_and_wrap_for_1o1( data_body.data(), data_body.size(), keys.ed_sk0.data(), keys.ed_sk0.size(), - &dest, - NAMESPACE_DEFAULT, + timestamp_ms.count(), + &recipient_pubkey, + nullptr, error, sizeof(error)); INFO(error); REQUIRE(encrypt_without_pro_sig.error_len_incl_null_terminator == 0); // Set the pro signature - dest.has_pro_sig = true; + bytes64 pro_sig = {}; session_protocol_encrypted_for_destination encrypt_with_pro_sig = - session_protocol_encrypt_for_destination( + session_protocol_encrypt_and_wrap_for_1o1( data_body.data(), data_body.size(), keys.ed_sk0.data(), keys.ed_sk0.size(), - &dest, - NAMESPACE_DEFAULT, + timestamp_ms.count(), + &recipient_pubkey, + &pro_sig, error, sizeof(error)); REQUIRE(encrypt_with_pro_sig.error_len_incl_null_terminator == 0); @@ -180,19 +189,18 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { // Encrypt session_protocol_encrypted_for_destination encrypt_result = {}; { - session_protocol_destination dest = {}; - dest.type = DESTINATION_TYPE_CONTACT; - dest.sent_timestamp_ms = timestamp_ms.count(); - REQUIRE(sizeof(dest.recipient_pubkey) == keys.session_pk1.size()); - std::memcpy(dest.recipient_pubkey, keys.session_pk1.data(), keys.session_pk1.size()); + bytes64* pro_sig = nullptr; + bytes33 recipient_pubkey = {}; + std::memcpy(recipient_pubkey.data, keys.session_pk1.data(), keys.session_pk1.size()); - encrypt_result = session_protocol_encrypt_for_destination( + encrypt_result = session_protocol_encrypt_and_wrap_for_1o1( plaintext.data(), plaintext.size(), keys.ed_sk0.data(), keys.ed_sk0.size(), - &dest, - NAMESPACE_DEFAULT, + timestamp_ms.count(), + &recipient_pubkey, + pro_sig, error, sizeof(error)); REQUIRE(encrypt_result.encrypted); @@ -258,16 +266,18 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { PRO_FEATURES_NIL); // Setup base destination object with the pro signature w/ Session pubkey 1 as the recipient - session_protocol_destination base_dest = {}; - base_dest.sent_timestamp_ms = timestamp_ms.count(); - base_dest.has_pro_sig = true; + bytes64 base_pro_sig = {}; std::memcpy( - base_dest.pro_sig, + base_pro_sig.data, protobuf_content_with_pro.sig_over_plaintext_with_user_pro_key.data(), - sizeof(base_dest.pro_sig)); + sizeof(base_pro_sig.data)); - REQUIRE(sizeof(base_dest.recipient_pubkey) == keys.session_pk1.size()); - std::memcpy(base_dest.recipient_pubkey, keys.session_pk1.data(), keys.session_pk1.size()); + session_protocol_destination base_dest = {}; + base_dest.sent_timestamp_ms = timestamp_ms.count(); + base_dest.pro_sig = &base_pro_sig; + + REQUIRE(sizeof(base_dest.recipient_pubkey.data) == keys.session_pk1.size()); + std::memcpy(base_dest.recipient_pubkey.data, keys.session_pk1.data(), keys.session_pk1.size()); SECTION("Check non-encryptable messages produce only plaintext") { auto dest_list = { @@ -292,8 +302,8 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { } else if (dest_type == DESTINATION_TYPE_COMMUNITY_INBOX) { auto [blind15_pk, blind15_sk] = session::blind15_key_pair( keys.ed_sk1, keys.ed_pk1, /*blind factor*/ nullptr); - dest.recipient_pubkey[0] = 0x15; - std::memcpy(dest.recipient_pubkey + 1, blind15_pk.data(), blind15_pk.size()); + dest.recipient_pubkey.data[0] = 0x15; + std::memcpy(dest.recipient_pubkey.data + 1, blind15_pk.data(), blind15_pk.size()); } session_protocol_encrypted_for_destination encrypt_result = @@ -321,22 +331,19 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { SECTION("Encrypt/decrypt for contact in default namespace with Pro") { // Encrypt content - session_protocol_encrypted_for_destination encrypt_result = {}; - { - session_protocol_destination dest = base_dest; - dest.type = DESTINATION_TYPE_CONTACT; - encrypt_result = session_protocol_encrypt_for_destination( - protobuf_content_with_pro.plaintext.data(), - protobuf_content_with_pro.plaintext.size(), - keys.ed_sk0.data(), - keys.ed_sk0.size(), - &dest, - NAMESPACE_DEFAULT, - error, - sizeof(error)); - REQUIRE(encrypt_result.encrypted); - REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); - } + session_protocol_encrypted_for_destination encrypt_result = + session_protocol_encrypt_and_wrap_for_1o1( + protobuf_content_with_pro.plaintext.data(), + protobuf_content_with_pro.plaintext.size(), + keys.ed_sk0.data(), + keys.ed_sk0.size(), + base_dest.sent_timestamp_ms, + &base_dest.recipient_pubkey, + base_dest.pro_sig, + error, + sizeof(error)); + REQUIRE(encrypt_result.encrypted); + REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); // Decrypt envelope span_u8 key = {keys.ed_sk1.data(), keys.ed_sk1.size()}; @@ -393,28 +400,20 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { features); // Encrypt content - session_protocol_encrypted_for_destination encrypt_result = {}; - { - session_protocol_destination dest = base_dest; - dest.type = DESTINATION_TYPE_CONTACT; - std::memcpy( - dest.pro_sig, - protobuf_content_with_pro_and_features.sig_over_plaintext_with_user_pro_key - .data(), - sizeof(dest.pro_sig)); - - encrypt_result = session_protocol_encrypt_for_destination( - protobuf_content_with_pro_and_features.plaintext.data(), - protobuf_content_with_pro_and_features.plaintext.size(), - keys.ed_sk0.data(), - keys.ed_sk0.size(), - &dest, - NAMESPACE_DEFAULT, - error, - sizeof(error)); - REQUIRE(encrypt_result.encrypted); - REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); - } + session_protocol_encrypted_for_destination encrypt_result = + session_protocol_encrypt_and_wrap_for_1o1( + protobuf_content_with_pro_and_features.plaintext.data(), + protobuf_content_with_pro_and_features.plaintext.size(), + keys.ed_sk0.data(), + keys.ed_sk0.size(), + base_dest.sent_timestamp_ms, + &base_dest.recipient_pubkey, + &protobuf_content_with_pro_and_features + .sig_over_plaintext_with_user_pro_key_c, + error, + sizeof(error)); + REQUIRE(encrypt_result.encrypted); + REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); // Decrypt envelope span_u8 key = {keys.ed_sk1.data(), keys.ed_sk1.size()}; @@ -457,7 +456,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { SECTION("Encrypt/decrypt for legacy groups is rejected") { session_protocol_destination dest = base_dest; dest.type = DESTINATION_TYPE_GROUP; - assert(dest.recipient_pubkey[0] == 0x05); + assert(dest.recipient_pubkey.data[0] == 0x05); session_protocol_encrypted_for_destination encrypt_result = session_protocol_encrypt_for_destination( @@ -488,22 +487,22 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { // Encrypt session_protocol_encrypted_for_destination encrypt_result = {}; { - session_protocol_destination dest = base_dest; - dest.type = DESTINATION_TYPE_GROUP; - dest.group_ed25519_pubkey[0] = 0x03; - std::memcpy(dest.group_ed25519_pubkey + 1, group_v2_pk.data(), group_v2_pk.size()); + bytes33 group_v2_session_pk = {}; + bytes32 group_v2_session_sk = {}; + group_v2_session_pk.data[0] = 0x03; + std::memcpy(group_v2_session_pk.data + 1, group_v2_pk.data(), group_v2_pk.size()); std::memcpy( - dest.group_ed25519_privkey, - group_v2_sk.data(), - sizeof(dest.group_ed25519_privkey)); + group_v2_session_sk.data, group_v2_sk.data(), sizeof(group_v2_session_sk.data)); - encrypt_result = session_protocol_encrypt_for_destination( + encrypt_result = session_protocol_encrypt_and_wrap_for_group( protobuf_content_with_pro.plaintext.data(), protobuf_content_with_pro.plaintext.size(), keys.ed_sk0.data(), keys.ed_sk0.size(), - &dest, - NAMESPACE_GROUP_MESSAGES, + base_dest.sent_timestamp_ms, + &group_v2_session_pk, + &group_v2_session_sk, + base_dest.pro_sig, error, sizeof(error)); INFO("Encrypt for group error: " << error); @@ -541,22 +540,19 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { SECTION("Encrypt/decrypt for sync messages with Pro") { // Encrypt - session_protocol_encrypted_for_destination encrypt_result = {}; - { - session_protocol_destination dest = base_dest; - dest.type = DESTINATION_TYPE_SYNC_MESSAGE; - encrypt_result = session_protocol_encrypt_for_destination( - protobuf_content_with_pro.plaintext.data(), - protobuf_content_with_pro.plaintext.size(), - keys.ed_sk0.data(), - keys.ed_sk0.size(), - &dest, - NAMESPACE_DEFAULT, - error, - sizeof(error)); - REQUIRE(encrypt_result.encrypted); - REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); - } + session_protocol_encrypted_for_destination encrypt_result = + session_protocol_encrypt_and_wrap_for_1o1( + protobuf_content_with_pro.plaintext.data(), + protobuf_content_with_pro.plaintext.size(), + keys.ed_sk0.data(), + keys.ed_sk0.size(), + base_dest.sent_timestamp_ms, + &base_dest.recipient_pubkey, + base_dest.pro_sig, + error, + sizeof(error)); + REQUIRE(encrypt_result.encrypted); + REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); // Decrypt span_u8 key = {keys.ed_sk1.data(), keys.ed_sk1.size()}; @@ -680,17 +676,17 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { SECTION("Encrypt/decrypt for sync messages with Pro and bad rotating signature") { session_protocol_encrypted_for_destination encrypt_result = {}; { - session_protocol_destination dest = base_dest; - dest.type = DESTINATION_TYPE_SYNC_MESSAGE; - dest.has_pro_sig = true; - dest.pro_sig[0] ^= 1; // Break the sig by flipping a bit - encrypt_result = session_protocol_encrypt_for_destination( + bytes64 pro_sig = base_pro_sig; + pro_sig.data[0] ^= 1; // Break the sig by flipping a bit + + encrypt_result = session_protocol_encrypt_and_wrap_for_1o1( protobuf_content_with_pro.plaintext.data(), protobuf_content_with_pro.plaintext.size(), keys.ed_sk0.data(), keys.ed_sk0.size(), - &dest, - NAMESPACE_DEFAULT, + base_dest.sent_timestamp_ms, + &base_dest.recipient_pubkey, + &pro_sig, error, sizeof(error)); REQUIRE(encrypt_result.encrypted); From fd5a5dde6018bc15f493fb1696a9a932737bd794 Mon Sep 17 00:00:00 2001 From: doylet Date: Fri, 29 Aug 2025 11:52:55 +1000 Subject: [PATCH 55/59] Remove destinations that don't encrypt With the new helper functions encrypt_and_wrap_for_{1o1,group,community} its clearer that this API only really should be called in these 3 circumstances. Making it a kitchen sink black boxes the whole process but seems to give people options (destinations) that are meaningless as they don't do anything but we imply they might. I think it's better to get rid of it and simplify the calling interface. --- include/session/session_protocol.h | 4 +--- include/session/session_protocol.hpp | 4 +--- src/session_protocol.cpp | 23 +++-------------------- tests/test_group_keys.cpp | 2 +- tests/test_session_protocol.cpp | 20 +++++--------------- 5 files changed, 11 insertions(+), 42 deletions(-) diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index 1213a0e3..af82dd9e 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -54,10 +54,8 @@ enum PRO_FEATURES_ { }; typedef enum DESTINATION_TYPE { // See session::DestinationType - DESTINATION_TYPE_CONTACT, - DESTINATION_TYPE_SYNC_MESSAGE, + DESTINATION_TYPE_CONTACT_OR_SYNC_MESSAGE, DESTINATION_TYPE_GROUP, - DESTINATION_TYPE_COMMUNITY, DESTINATION_TYPE_COMMUNITY_INBOX, } DESTINATION_TYPE; diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index 8133ad2e..a05c077b 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -38,13 +38,11 @@ namespace config::groups { } enum class DestinationType { - Contact = DESTINATION_TYPE_CONTACT, - SyncMessage = DESTINATION_TYPE_SYNC_MESSAGE, + ContactOrSyncMessage = DESTINATION_TYPE_CONTACT_OR_SYNC_MESSAGE, /// Both legacy and non-legacy groups are to be identified as `Group`. A non-legacy /// group is detected by the (0x03) prefix byte on the given `dest_group_pubkey` specified in /// Destination. Group = DESTINATION_TYPE_GROUP, - Community = DESTINATION_TYPE_COMMUNITY, CommunityInbox = DESTINATION_TYPE_COMMUNITY_INBOX, }; diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index eb8d048c..0f8096c1 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -42,7 +42,7 @@ EncryptedForDestination encrypt_and_wrap_for_1o1( const std::optional& pro_sig) { Destination dest = {}; - dest.type = DestinationType::Contact; + dest.type = DestinationType::ContactOrSyncMessage; dest.pro_sig = pro_sig; dest.sent_timestamp_ms = sent_timestamp; dest.recipient_pubkey = recipient_pubkey; @@ -180,30 +180,13 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( } } break; - case DestinationType::Contact: { - if (space == config::Namespace::Default) { - enc.mode = Mode::Envelope; - enc.before_envelope_encrypt_for_recipient_deterministic = true; - enc.envelope_type = SessionProtos::Envelope_Type::Envelope_Type_SESSION_MESSAGE; - enc.after_envelope = AfterEnvelope::WrapInWSMessage; - } else { - // See: - // https://github.com/session-foundation/session-ios/blob/82deef869d0f7389b799295817f42ad14f8a1316/SessionMessagingKit/Sending%20%26%20Receiving/MessageSender.swift#L498 - enc.mode = Mode::Plaintext; - } - } break; - - case DestinationType::SyncMessage: { + case DestinationType::ContactOrSyncMessage: { enc.mode = Mode::Envelope; enc.before_envelope_encrypt_for_recipient_deterministic = true; enc.envelope_type = SessionProtos::Envelope_Type::Envelope_Type_SESSION_MESSAGE; enc.after_envelope = AfterEnvelope::WrapInWSMessage; } break; - case DestinationType::Community: { - enc.mode = Mode::Plaintext; - } break; - case DestinationType::CommunityInbox: { enc.mode = Mode::EncryptForBlindedRecipient; } break; @@ -606,7 +589,7 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for size_t error_len) { session_protocol_destination dest = {}; - dest.type = DESTINATION_TYPE_CONTACT; + dest.type = DESTINATION_TYPE_CONTACT_OR_SYNC_MESSAGE; dest.pro_sig = pro_sig; dest.recipient_pubkey = *recipient_pubkey; dest.sent_timestamp_ms = sent_timestamp_ms; diff --git a/tests/test_group_keys.cpp b/tests/test_group_keys.cpp index 33d5dea4..b10d9ae2 100644 --- a/tests/test_group_keys.cpp +++ b/tests/test_group_keys.cpp @@ -444,7 +444,7 @@ TEST_CASE("Group Keys - C++ API", "[config][groups][keys][cpp]") { bad_compressed.back() ^= 0b100; CHECK_THROWS_WITH( members.back().keys.decrypt_message(bad_compressed), - "unable to decrypt ciphertext with any current group keys"); + "unable to decrypt ciphertext with any current group keys; tried 4"); // Duplicate members[1] from dumps auto& m1b = members.emplace_back( diff --git a/tests/test_session_protocol.cpp b/tests/test_session_protocol.cpp index b8ca16af..1d80e9d3 100644 --- a/tests/test_session_protocol.cpp +++ b/tests/test_session_protocol.cpp @@ -281,14 +281,11 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { SECTION("Check non-encryptable messages produce only plaintext") { auto dest_list = { - DESTINATION_TYPE_COMMUNITY, DESTINATION_TYPE_COMMUNITY_INBOX, - DESTINATION_TYPE_CONTACT}; + DESTINATION_TYPE_CONTACT_OR_SYNC_MESSAGE}; for (auto dest_type : dest_list) { - if (dest_type == DESTINATION_TYPE_COMMUNITY) - INFO("Trying community"); - else if (dest_type == DESTINATION_TYPE_COMMUNITY_INBOX) + if (dest_type == DESTINATION_TYPE_COMMUNITY_INBOX) INFO("Trying community inbox"); else INFO("Trying contacts to non-default namespace"); @@ -297,9 +294,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { dest.type = dest_type; NAMESPACE space = NAMESPACE_DEFAULT; - if (dest_type == DESTINATION_TYPE_CONTACT) { - space = NAMESPACE_CONTACTS; - } else if (dest_type == DESTINATION_TYPE_COMMUNITY_INBOX) { + if (dest_type == DESTINATION_TYPE_COMMUNITY_INBOX) { auto [blind15_pk, blind15_sk] = session::blind15_key_pair( keys.ed_sk1, keys.ed_pk1, /*blind factor*/ nullptr); dest.recipient_pubkey.data[0] = 0x15; @@ -317,13 +312,8 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { error, sizeof(error)); - if (dest_type == DESTINATION_TYPE_COMMUNITY_INBOX) { - REQUIRE(encrypt_result.encrypted); - REQUIRE(encrypt_result.ciphertext.size > 0); - } else { - REQUIRE_FALSE(encrypt_result.encrypted); - REQUIRE(encrypt_result.ciphertext.size == 0); - } + REQUIRE(encrypt_result.encrypted); + REQUIRE(encrypt_result.ciphertext.size > 0); REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); session_protocol_encrypt_for_destination_free(&encrypt_result); } From 8d0948c84aa04042848b7030717ea8c4f98f7e45 Mon Sep 17 00:00:00 2001 From: doylet Date: Fri, 29 Aug 2025 12:34:30 +1000 Subject: [PATCH 56/59] Remove namespace from encrypt for destination We assume that you are encrypting for the destination AND into the correct namespace. Encrypting for 1o1 as a caller has the intent that you want to "talk" to someone and in all cases this would have to be encrypted which is the most obvious outcome of what you would expect to get if you asked libsession to do it. The namespace complicated things unnecessarily by making it appear as if there's an alternative way to encrypt if you were targetting different namespace. Technically this is true, if you target another namesspace/mailbox there are different conventions on how an application should consume data from that mailbox but that is not related to the task of encrypting for a conversation (1o1, group, community, sync message). --- include/session/session_protocol.h | 164 ++++++++++++++++++++++++--- include/session/session_protocol.hpp | 130 ++++++++++++++------- src/session_protocol.cpp | 71 ++++-------- tests/test_session_protocol.cpp | 34 ++---- 4 files changed, 266 insertions(+), 133 deletions(-) diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index af82dd9e..204bb31f 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -1,6 +1,5 @@ #include -#include "config/namespaces.h" #include "config/pro.h" #include "export.h" #include "types.h" @@ -64,7 +63,7 @@ typedef struct session_protocol_destination { // See session::Destination // The pro signature is optional, set the pointer to a 64 byte pro signature // to include it into the encrypted message, ignored otherwise - const bytes64 *pro_sig; + const bytes64* pro_sig; bytes33 recipient_pubkey; uint64_t sent_timestamp_ms; bytes32 community_inbox_server_pubkey; @@ -115,7 +114,6 @@ typedef struct session_protocol_encrypted_for_destination { // Indicates if the encryption was successful. If any step failed and threw an exception, this // is false. bool success; - bool encrypted; span_u8 ciphertext; size_t error_len_incl_null_terminator; } session_protocol_encrypted_for_destination; @@ -136,8 +134,52 @@ typedef struct session_protocol_encrypted_for_destination { LIBSESSION_EXPORT PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_EXTRA_FEATURES flags); +/// API: session_protocol_encrypt_for_1o1 +/// +/// Encrypt a plaintext message for a one-on-one (1o1) conversation or sync message in the Session +/// Protocol. This function wraps the plaintext in the necessary structures and encrypts it for +/// transmission to a single recipient. +/// +/// See: session_protocol/encrypt_for_1o1 for more information +/// +/// The encryption result must be freed with session_protocol_encrypt_for_destination_free when +/// the caller is done with the result. +/// +/// Inputs: +/// - `plaintext` -- The protobuf serialized payload containing the Content to be encrypted +/// - `plaintext_len` -- The length of the plaintext buffer in bytes. +/// - `ed25519_privkey` -- The sender's libsodium-style secret key (64 bytes). Can also be passed as +/// a 32-byte seed. Used to encrypt the plaintext. +/// - `ed25519_privkey_len` -- The length of the ed25519_privkey buffer in bytes (32 or 64). +/// - `sent_timestamp_ms` -- The timestamp to assign to the message envelope, in milliseconds. +/// - `recipient_pubkey` -- The recipient's Session public key (33 bytes). +/// - `pro_sig` -- Optional signature over the unencrypted plaintext with the user's Session Pro +/// rotating public key, if using Session Pro features. If provided, the corresponding proof must +/// be set in the Content protobuf. Pass NULL if not using Session Pro features. +/// - `error` -- Pointer to the character buffer to be populated with the error message if the +/// returned success was false, untouched otherwise. If this is set to NULL, then on failure, +/// the returned error_len_incl_null_terminator is the number of bytes required by the user to +/// receive the error. The message may be truncated if the buffer is too small, but it's always +/// guaranteed that error is null-terminated on failure when a buffer is passed in even if the +/// error must be truncated to fit in the buffer. +/// - `error_len` -- The capacity of the character buffer passed by the user. This should be 0 if +/// error is NULL. This function will fill the buffer up to error_len - 1 characters with the last +/// character reserved for the null-terminator. +/// +/// Outputs: +/// - `success` -- True if encryption was successful, if the underlying implementation threw +/// an exception then this is caught internally and success is set to false. All remaining fields +/// are to be ignored in the result on failure. +/// - `ciphertext` -- Encryption result for the plaintext. The returned payload is suitable for +/// sending on the wire (i.e: it has been protobuf encoded/wrapped if necessary). +/// - `error_len_incl_null_terminator` -- The length of the error message if success was false. If +/// the user passes in a non-NULL error buffer this is the amount of characters written to the +/// error buffer. If the user passes in a NULL error buffer, this is the amount of characters +/// required to write the error. Both counts include the null-terminator. The user must allocate +/// at minimum the requested length, including the null-terminator in order for the error message +/// to be preserved in full. LIBSESSION_EXPORT -session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for_1o1( +session_protocol_encrypted_for_destination session_protocol_encrypt_for_1o1( const void* plaintext, size_t plaintext_len, const void* ed25519_privkey, @@ -148,8 +190,56 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for char* error, size_t error_len); +/// API: session_protocol_encrypt_for_community_inbox +/// +/// Encrypt a plaintext message for a community inbox in the Session Protocol. This function wraps +/// the plaintext in the necessary structures and encrypts it for transmission to a community inbox +/// server. +/// +/// See: session_protocol/encrypt_for_community_inbox for more information +/// +/// The encryption result must be freed with session_protocol_encrypt_for_destination_free when +/// the caller is done with the result. +/// +/// Inputs: +/// - `plaintext `-- The protobuf serialized payload containing the Content to be encrypted. Must +/// not be already encrypted. +/// - `plaintext_len` -- The length of the plaintext buffer in bytes. +/// - `ed25519_privkey` -- The sender's libsodium-style secret key (64 bytes). Can also be passed as +/// a 32-byte seed. Used to encrypt the plaintext. +/// - `ed25519_privkey_len` -- The length of the ed25519_privkey buffer in bytes (32 or 64). +/// - `sent_timestamp_ms` -- The timestamp to assign to the message envelope, in milliseconds. +/// - `recipient_pubkey` -- The recipient's Session public key (33 bytes). +/// - `community_pubkey` -- The community inbox server's public key (32 bytes). +/// - `pro_sig` -- Optional signature over the unencrypted plaintext with the user's Session Pro +/// rotating public key, if using Session Pro features. If provided, the corresponding proof must +/// be set in the Content protobuf. Pass NULL if not using Session Pro features. TODO: Pro sig +/// is not incorporated into community/inbox messages yet. +/// - `error` -- Pointer to the character buffer to be populated with the error message if the +/// returned success was false, untouched otherwise. If this is set to NULL, then on failure, +/// the returned error_len_incl_null_terminator is the number of bytes required by the user to +/// receive the error. The message may be truncated if the buffer is too small, but it's always +/// guaranteed that error is null-terminated on failure when a buffer is passed in even if the +/// error must be truncated to fit in the buffer. +/// - `error_len` -- The capacity of the character buffer passed by the user. This should be 0 if +/// error is NULL. This function will fill the buffer up to error_len - 1 characters with the +/// last character reserved for the null-terminator. +/// +/// Outputs: +/// - `success` -- True if encryption was successful, if the underlying implementation threw +/// an exception then this is caught internally and success is set to false. All remaining fields +/// are to be ignored in the result on failure. +/// - `ciphertext` -- Encryption result for the plaintext. The returned payload is suitable for +/// sending on the wire (i.e: it has been protobuf encoded/wrapped if necessary). +/// - `error_len_incl_null_terminator` -- The length of the error message if success was false. If +/// the user passes in a non-NULL error buffer this is the amount of characters written to the +/// error buffer. If the user passes in a NULL error buffer, this is the amount of characters +/// required to write the error. Both counts include the null-terminator. The user must allocate +/// at minimum the requested length, including the null-terminator in order for the error message +/// to be preserved in full. + LIBSESSION_EXPORT -session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for_community_inbox( +session_protocol_encrypted_for_destination session_protocol_encrypt_for_community_inbox( const void* plaintext, size_t plaintext_len, const void* ed25519_privkey, @@ -161,8 +251,56 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for char* error, size_t error_len); +/// API: session_protocol_encrypt_for_group +/// +/// Encrypt a plaintext message for a group in the Session Protocol. This function wraps the +/// plaintext in the necessary structures and encrypts it for transmission to a group, using the +/// group's encryption key. Only v2 groups, (0x03) prefixed keys are supported. Passing a legacy +/// group (0x05) prefixed key will cause the function to return a failure with an error message. +/// +/// See: session_protocol/encrypt_for_group for more information +/// +/// The encryption result must be freed with session_protocol_encrypt_for_destination_free when +/// the caller is done with the result. +/// +/// Inputs: +/// - `plaintext` -- The protobuf serialized payload containing the Content to be encrypted. Must +/// not be already encrypted. +/// - `plaintext_len` -- The length of the plaintext buffer in bytes. +/// - `ed25519_privkey` -- The sender's libsodium-style secret key (64 bytes). Can also be passed as +/// a 32-byte seed. Used to encrypt the plaintext. +/// - `ed25519_privkey_len` -- The length of the ed25519_privkey buffer in bytes (32 or 64). +/// - `sent_timestamp_ms` -- The timestamp to assign to the message envelope, in milliseconds. +/// - `group_ed25519_pubkey` -- The group's public key (33 bytes) for encryption with a 0x03 prefix. +/// - `group_ed25519_privkey` -- The group's private key (32 bytes) for groups v2 messages, typically +/// the latest encryption key for the group (e.g., Keys::group_enc_key). +/// - `pro_sig` -- Optional signature over the unencrypted plaintext with the user's Session Pro +/// rotating public key, if using Session Pro features. If provided, the corresponding proof must +/// be set in the Content protobuf. Pass NULL if not using Session Pro features. +/// - `error` -- Pointer to the character buffer to be populated with the error message if the +/// returned success was false, untouched otherwise. If this is set to NULL, then on failure, +/// the returned error_len_incl_null_terminator is the number of bytes required by the user to +/// receive the error. The message may be truncated if the buffer is too small, but it's always +/// guaranteed that error is null-terminated on failure when a buffer is passed in even if the +/// error must be truncated to fit in the buffer. +/// - `error_len` -- The capacity of the character buffer passed by the user. This should be 0 if +/// error is NULL. This function will fill the buffer up to error_len - 1 characters with the +/// last character reserved for the null-terminator. +/// +/// Outputs: +/// - `success` -- True if encryption was successful, if the underlying implementation threw +/// an exception then this is caught internally and success is set to false. All remaining fields +/// are to be ignored in the result on failure. +/// - `ciphertext` -- Encryption result for the plaintext. The returned payload is suitable for +/// sending on the wire (i.e: it has been protobuf encoded/wrapped if necessary). +/// - `error_len_incl_null_terminator` -- The length of the error message if success was false. If +/// the user passes in a non-NULL error buffer this is the amount of characters written to the +/// error buffer. If the user passes in a NULL error buffer, this is the amount of characters +/// required to write the error. Both counts include the null-terminator. The user must allocate +/// at minimum the requested length, including the null-terminator in order for the error message +/// to be preserved in full. LIBSESSION_EXPORT -session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for_group( +session_protocol_encrypted_for_destination session_protocol_encrypt_for_group( const void* plaintext, size_t plaintext_len, const void* ed25519_privkey, @@ -192,7 +330,6 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for /// passed as a 32-byte seed. Used to encrypt the plaintext. /// - `dest` -- the extra metadata indicating the destination of the message and the necessary data /// to encrypt a message for that destination. -/// - `space` -- the namespace to encrypt the message for /// - `error` -- Pointer to the character buffer to be populated with the error message if the /// returned `success` was false, untouched otherwise. If this is set to `NULL`, then on failure, /// the returned `error_len_incl_null_terminator` is the number of bytes required by the user to @@ -207,16 +344,8 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for /// - `success` -- True if encryption was successful, if the underlying implementation threw /// an exception then this is caught internally and success is set to false. All remaining fields /// are to be ignored in the result on failure. -/// - `encrypted` -- True if any encryption was performed. If the combination of the namespace and -/// destination does not require encryption, this flag is false. In this case, `ciphertext` will -/// not be assigned. The caller should proceed with the `plaintext` they initially passed in. -/// - `ciphertext` -- Encryption result for the plaintext. If the destination and namespace -/// combination did not require encryption, no payload is returned in the ciphertext and the user -/// should proceed with the plaintext. This should be validated by checking the `encrypted` flag -/// on the result to determine if the ciphertext or plaintext is to be used. -/// -/// The retured payload is suitable for sending on the wire (i.e: it has been protobuf -/// encoded/wrapped if necessary). +/// - `ciphertext` -- Encryption result for the plaintext. The retured payload is suitable for +/// sending on the wire (i.e: it has been protobuf encoded/wrapped if necessary). /// - `error_len_incl_null_terminator` The length of the error message if `success` was false. If /// the user passes in an non-`NULL` error buffer this is amount of characters written to the /// error buffer. If the user passes in a `NULL` error buffer, this is the amount of characters @@ -230,7 +359,6 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_for_destinat const void* ed25519_privkey, size_t ed25519_privkey_len, const session_protocol_destination* dest, - NAMESPACE space, char* error, size_t error_len); diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index a05c077b..f5e9976a 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -145,17 +145,6 @@ struct DecryptEnvelopeKey { std::span> ed25519_privkeys; }; -struct EncryptedForDestination { - // Indicates if the ciphertext was encrypted or not. This can be false if the message sent to - // the destination and namespace does not require encryption. In this case `ciphertext` is not - // set and the user should proceed with the original plaintext. - bool encrypted; - - // The plaintext encrypted in a manner suitable for the desired destination and namespace. This - // is not set if `encrypted` is false. - std::vector ciphertext; -}; - /// API: session_protocol/get_pro_features_for_msg /// /// Determine the Pro features that are used in a given conversation message. @@ -171,14 +160,66 @@ struct EncryptedForDestination { /// `Content` PRO_FEATURES get_pro_features_for_msg(size_t msg_size, PRO_EXTRA_FEATURES flags); -EncryptedForDestination encrypt_and_wrap_for_1o1( +/// API: session_protocol/encrypt_for_1o1 +/// +/// Encrypt a plaintext message for a one-on-one (1o1) conversation or sync message in the Session +/// Protocol. This function wraps the plaintext in the necessary structures and encrypts it for +/// transmission to a single recipient. +/// +/// This is a high-level convenience function that internally calls encrypt_for_destination with +/// the appropriate Destination configuration for a 1o1 or sync message. +/// +/// This function throws if any input argument is invalid (e.g., incorrect key sizes). +/// +/// Inputs: +/// - plaintext -- The protobuf serialized payload containing the Content to be encrypted. Must +/// not be already encrypted. +/// - ed25519_privkey -- The sender's libsodium-style secret key (64 bytes). Can also be passed as +/// a 32-byte seed. Used to encrypt the plaintext. +/// - sent_timestamp -- The timestamp to assign to the message envelope, in milliseconds. +/// - recipient_pubkey -- The recipient's Session public key (33 bytes). +/// - pro_sig -- Optional signature over the unencrypted plaintext with the user's Session Pro +/// rotating public key, if using Session Pro features. If provided, the corresponding proof must +/// be set in the Content protobuf. +/// +/// Outputs: +/// - Encryption result for the plaintext. The retured payload is suitable for sending on the wire +/// (i.e: it has been protobuf encoded/wrapped if necessary). +std::vector encrypt_for_1o1( std::span plaintext, std::span ed25519_privkey, std::chrono::milliseconds sent_timestamp, const array_uc33& recipient_pubkey, const std::optional& pro_sig); -EncryptedForDestination encrypt_and_wrap_for_community_inbox( +/// API: session_protocol/encrypt_for_community_inbox +/// +/// Encrypt a plaintext message for a community inbox in the Session Protocol. This function wraps +/// the plaintext in the necessary structures and encrypts it for transmission to a community inbox +/// server. +/// +/// This is a high-level convenience function that internally calls encrypt_for_destination with +/// the appropriate Destination configuration for a community inbox message. +/// +/// This function throws if any input argument is invalid (e.g., incorrect key sizes). +/// +/// Inputs: +/// - plaintext -- The protobuf serialized payload containing the Content to be encrypted. Must +/// not be already encrypted. +/// - ed25519_privkey -- The sender's libsodium-style secret key (64 bytes). Can also be passed as +/// a 32-byte seed. Used to encrypt the plaintext. +/// - sent_timestamp -- The timestamp to assign to the message envelope, in milliseconds. +/// - recipient_pubkey -- The recipient's Session public key (33 bytes). +/// - community_pubkey -- The community inbox server's public key (32 bytes). +/// - pro_sig -- Optional signature over the unencrypted plaintext with the user's Session Pro +/// rotating public key, if using Session Pro features. If provided, the corresponding proof must +/// be set in the Content protobuf. +/// TODO: Pro sig is not incorporated into community/inbox messages yet +/// +/// Outputs: +/// - Encryption result for the plaintext. The retured payload is suitable for sending on the wire +/// (i.e: it has been protobuf encoded/wrapped if necessary). +std::vector encrypt_for_community_inbox( std::span plaintext, std::span ed25519_privkey, std::chrono::milliseconds sent_timestamp, @@ -186,7 +227,35 @@ EncryptedForDestination encrypt_and_wrap_for_community_inbox( const array_uc32& community_pubkey, const std::optional& pro_sig); -EncryptedForDestination encrypt_and_wrap_for_group( +/// API: session_protocol/encrypt_for_group +/// +/// Encrypt a plaintext message for a group in the Session Protocol. This function wraps the +/// plaintext in the necessary structures and encrypts it for transmission to a group, using the +/// group's encryption key. Only v2 groups, (0x03) prefixed keys are supported. Passing a legacy +/// group (0x05) prefixed key will cause the function to throw. +/// +/// This is a high-level convenience function that internally calls encrypt_for_destination with +/// the appropriate Destination configuration for a group message. +/// +/// This function throws if any input argument is invalid (e.g., incorrect key sizes). +/// +/// Inputs: +/// - plaintext -- The protobuf serialized payload containing the Content to be encrypted. Must +/// not be already encrypted. +/// - ed25519_privkey -- The sender's libsodium-style secret key (64 bytes). Can also be passed as +/// a 32-byte seed. Used to encrypt the plaintext. +/// - sent_timestamp -- The timestamp to assign to the message envelope, in milliseconds. +/// - group_ed25519_pubkey -- The group's public key (33 bytes) for encryption with a 0x03 prefix +/// - group_ed25519_privkey -- The group's private key (32 bytes) for groups v2 messages, typically +/// the latest encryption key for the group (e.g., Keys::group_enc_key). +/// - pro_sig -- Optional signature over the unencrypted plaintext with the user's Session Pro +/// rotating public key, if using Session Pro features. If provided, the corresponding proof must +/// be set in the Content protobuf. +/// +/// Outputs: +/// - Encryption result for the plaintext. The retured payload is suitable for sending on the wire +/// (i.e: it has been protobuf encoded/wrapped if necessary). +std::vector encrypt_for_group( std::span plaintext, std::span ed25519_privkey, std::chrono::milliseconds sent_timestamp, @@ -200,18 +269,14 @@ EncryptedForDestination encrypt_and_wrap_for_group( /// `Content`), encrypt and/or wrap the plaintext in the necessary structures for transmission on /// the Session Protocol. /// -/// This function supports all combinatoric combinations of the destination type and namespace -/// including returning plaintext if the message is not meant to be encrypted and or wrapping in the -/// additional websocket wrapper or encrypting the envelope with the group keys if necessary -/// e.t.c. -/// /// Calling this function requires filling out the options in the `Destination` struct with the -/// appropriate values for the desired combination of destination type and namespace. Check the -/// annotation on `Destination` for more information. +/// appropriate values for the desired destination. Check the annotation on `Destination` for more +/// information on how to fill this struct. Alternatively, there are higher level functions, encrypt +/// for 1o1, group and community functions which thunk into this low-level function for convenience. /// /// This function throws if the API is misused (i.e.: A field was not set, but was required to be /// set for the given destination and namespace. For example the group keys not being set -/// when sending to a group prefixed [0x3] key in a group into the group message namespace) +/// when sending to a group prefixed [0x3] key in a group) /// but otherwise returns a struct with values. /// /// Inputs: @@ -221,27 +286,14 @@ EncryptedForDestination encrypt_and_wrap_for_group( /// passed as a 32-byte seed. Used to encrypt the plaintext. /// - `dest` -- the extra metadata indicating the destination of the message and the necessary data /// to encrypt a message for that destination. -/// - `space` -- the namespace to encrypt the message for /// /// Outputs: -/// - `success` -- True if encryption was successful, if the underlying implementation threw -/// an exception then this is caught internally and success is set to false. All remaining fields -/// are to be ignored in the result on failure. -/// - `encrypted` -- True if any encryption was performed. If the combination of the namespace and -/// destination does not require encryption, this flag is false. In this case, `ciphertext` will -/// not be assigned. The caller should proceed with the `plaintext` they initially passed in. -/// - `ciphertext` -- Encryption result for the plaintext. If the destination and namespace -/// combination did not require encryption, no payload is returned in the ciphertext and the user -/// should proceed with the plaintext. This should be validated by checking the `encrypted` flag -/// on the result to determine if the ciphertext or plaintext is to be used. -/// -/// The retured payload is suitable for sending on the wire (i.e: it has been protobuf -/// encoded/wrapped if necessary). -EncryptedForDestination encrypt_for_destination( +/// - Encryption result for the plaintext. The retured payload is suitable for sending on the wire +/// (i.e: it has been protobuf encoded/wrapped if necessary). +std::vector encrypt_for_destination( std::span plaintext, std::span ed25519_privkey, - const Destination& dest, - config::Namespace space); + const Destination& dest); /// API: session_protocol/decrypt_envelope /// diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index 0f8096c1..0158d00e 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -34,55 +34,52 @@ PRO_FEATURES get_pro_features_for_msg(size_t msg_size, PRO_EXTRA_FEATURES extra) return result; } -EncryptedForDestination encrypt_and_wrap_for_1o1( +std::vector encrypt_for_1o1( std::span plaintext, std::span ed25519_privkey, std::chrono::milliseconds sent_timestamp, const array_uc33& recipient_pubkey, - const std::optional& pro_sig) -{ + const std::optional& pro_sig) { Destination dest = {}; dest.type = DestinationType::ContactOrSyncMessage; dest.pro_sig = pro_sig; dest.sent_timestamp_ms = sent_timestamp; dest.recipient_pubkey = recipient_pubkey; - EncryptedForDestination result = encrypt_for_destination(plaintext, ed25519_privkey, dest, config::Namespace::Default); + std::vector result = encrypt_for_destination(plaintext, ed25519_privkey, dest); return result; } -EncryptedForDestination encrypt_and_wrap_for_community_inbox( +std::vector encrypt_for_community_inbox( std::span plaintext, std::span ed25519_privkey, std::chrono::milliseconds sent_timestamp, const array_uc33& recipient_pubkey, const array_uc32& community_pubkey, - const std::optional& pro_sig) -{ + const std::optional& pro_sig) { Destination dest = {}; dest.type = DestinationType::CommunityInbox; dest.pro_sig = pro_sig; dest.sent_timestamp_ms = sent_timestamp; dest.recipient_pubkey = recipient_pubkey; dest.community_inbox_server_pubkey = community_pubkey; - EncryptedForDestination result = encrypt_for_destination(plaintext, ed25519_privkey, dest, config::Namespace::Default); + std::vector result = encrypt_for_destination(plaintext, ed25519_privkey, dest); return result; } -EncryptedForDestination encrypt_and_wrap_for_group( +std::vector encrypt_for_group( std::span plaintext, std::span ed25519_privkey, std::chrono::milliseconds sent_timestamp, const array_uc33& group_ed25519_pubkey, const cleared_uc32& group_ed25519_privkey, - const std::optional& pro_sig) -{ + const std::optional& pro_sig) { Destination dest = {}; dest.type = DestinationType::Group; dest.pro_sig = pro_sig; dest.sent_timestamp_ms = sent_timestamp; dest.group_ed25519_pubkey = group_ed25519_pubkey; dest.group_ed25519_privkey = group_ed25519_privkey; - EncryptedForDestination result = encrypt_for_destination(plaintext, ed25519_privkey, dest, config::Namespace::GroupMessages); + std::vector result = encrypt_for_destination(plaintext, ed25519_privkey, dest); return result; } @@ -90,7 +87,6 @@ EncryptedForDestination encrypt_and_wrap_for_group( // This pointer is taken verbatim and avoids requiring a copy from the CPP vector. The CPP api will // steal the contents from `ciphertext_cpp`. struct EncryptedForDestinationInternal { - bool encrypted; std::vector ciphertext_cpp; span_u8 ciphertext_c; }; @@ -106,7 +102,6 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( std::span dest_community_inbox_server_pubkey, std::span dest_group_ed25519_pubkey, std::span dest_group_ed25519_privkey, - config::Namespace space, UseMalloc use_malloc) { assert(dest_pro_sig.empty() || dest_pro_sig.size() == crypto_sign_ed25519_BYTES); @@ -121,7 +116,6 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( EncryptedForDestinationInternal result = {}; enum class Mode { Envelope, - Plaintext, EncryptForBlindedRecipient, }; @@ -159,19 +153,11 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( bool has_03_prefix = dest_group_ed25519_pubkey[0] == static_cast(SessionIDPrefix::group); if (has_03_prefix) { - if (space == config::Namespace::GroupMessages) { - enc.mode = Mode::Envelope; - enc.before_envelope_encrypt_for_recipient_deterministic = false; - enc.after_envelope = AfterEnvelope::KeysEncryptMessage; - enc.envelope_type = - SessionProtos::Envelope_Type::Envelope_Type_CLOSED_GROUP_MESSAGE; - } else if (space == config::Namespace::RevokedRetrievableGroupMessages) { - enc.mode = Mode::Plaintext; - } else { - // See: - // https://github.com/session-foundation/session-ios/blob/82deef869d0f7389b799295817f42ad14f8a1316/SessionMessagingKit/Sending%20%26%20Receiving/MessageSender.swift#L494 - enc.mode = Mode::Plaintext; - } + enc.mode = Mode::Envelope; + enc.before_envelope_encrypt_for_recipient_deterministic = false; + enc.after_envelope = AfterEnvelope::KeysEncryptMessage; + enc.envelope_type = + SessionProtos::Envelope_Type::Envelope_Type_CLOSED_GROUP_MESSAGE; } else { // Legacy groups which have a 05 prefixed key throw std::runtime_error{ @@ -226,7 +212,6 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( envelope.set_prosig(dest_pro_sig.data(), dest_pro_sig.size()); } - result.encrypted = true; switch (enc.after_envelope) { case AfterEnvelope::Nil: assert(false && "Dev error, after envelope action was not set"); @@ -294,12 +279,7 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( } break; - case Mode::Plaintext: { - // No-op. We do not populate the ciphertext because there was no encryption. - } break; - case Mode::EncryptForBlindedRecipient: { - result.encrypted = true; std::vector ciphertext = encrypt_for_blinded_recipient( ed25519_privkey, dest_community_inbox_server_pubkey, @@ -317,11 +297,10 @@ static EncryptedForDestinationInternal encrypt_for_destination_internal( return result; } -EncryptedForDestination encrypt_for_destination( +std::vector encrypt_for_destination( std::span plaintext, std::span ed25519_privkey, - const Destination& dest, - config::Namespace space) { + const Destination& dest) { EncryptedForDestinationInternal result_internal = encrypt_for_destination_internal( /*plaintext=*/plaintext, @@ -333,13 +312,9 @@ EncryptedForDestination encrypt_for_destination( /*dest_community_inbox_server_pubkey=*/dest.community_inbox_server_pubkey, /*dest_group_ed25519_pubkey=*/dest.group_ed25519_pubkey, /*dest_group_ed25519_privkey=*/dest.group_ed25519_privkey, - /*space=*/space, /*use_malloc=*/UseMalloc::No); - EncryptedForDestination result = { - .encrypted = result_internal.encrypted, - .ciphertext = std::move(result_internal.ciphertext_cpp), - }; + std::vector result = std::move(result_internal.ciphertext_cpp); return result; } @@ -577,7 +552,7 @@ PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_EXTR } LIBSESSION_C_API -session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for_1o1( +session_protocol_encrypted_for_destination session_protocol_encrypt_for_1o1( const void* plaintext, size_t plaintext_len, const void* ed25519_privkey, @@ -600,14 +575,13 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for ed25519_privkey, ed25519_privkey_len, &dest, - NAMESPACE_DEFAULT, error, error_len); return result; } LIBSESSION_C_API -session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for_community_inbox( +session_protocol_encrypted_for_destination session_protocol_encrypt_for_community_inbox( const void* plaintext, size_t plaintext_len, const void* ed25519_privkey, @@ -632,14 +606,13 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for ed25519_privkey, ed25519_privkey_len, &dest, - NAMESPACE_DEFAULT, error, error_len); return result; } LIBSESSION_C_API -session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for_group( +session_protocol_encrypted_for_destination session_protocol_encrypt_for_group( const void* plaintext, size_t plaintext_len, const void* ed25519_privkey, @@ -664,7 +637,6 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_and_wrap_for ed25519_privkey, ed25519_privkey_len, &dest, - NAMESPACE_GROUP_MESSAGES, error, error_len); return result; @@ -677,7 +649,6 @@ session_protocol_encrypt_for_destination( const void* ed25519_privkey, size_t ed25519_privkey_len, const session_protocol_destination* dest, - NAMESPACE space, char* error, size_t error_len) { session_protocol_encrypted_for_destination result = {}; @@ -693,12 +664,10 @@ session_protocol_encrypt_for_destination( /*dest_community_inbox_server_pubkey=*/dest->community_inbox_server_pubkey.data, /*dest_group_ed25519_pubkey=*/dest->group_ed25519_pubkey.data, /*dest_group_ed25519_privkey=*/dest->group_ed25519_privkey.data, - /*space=*/static_cast(space), /*use_malloc=*/UseMalloc::Yes); result = { .success = true, - .encrypted = result_internal.encrypted, .ciphertext = result_internal.ciphertext_c, }; } catch (const std::exception& e) { diff --git a/tests/test_session_protocol.cpp b/tests/test_session_protocol.cpp index 1d80e9d3..148c419a 100644 --- a/tests/test_session_protocol.cpp +++ b/tests/test_session_protocol.cpp @@ -131,7 +131,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { // Withhold the pro signature char error[256]; session_protocol_encrypted_for_destination encrypt_without_pro_sig = - session_protocol_encrypt_and_wrap_for_1o1( + session_protocol_encrypt_for_1o1( data_body.data(), data_body.size(), keys.ed_sk0.data(), @@ -147,7 +147,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { // Set the pro signature bytes64 pro_sig = {}; session_protocol_encrypted_for_destination encrypt_with_pro_sig = - session_protocol_encrypt_and_wrap_for_1o1( + session_protocol_encrypt_for_1o1( data_body.data(), data_body.size(), keys.ed_sk0.data(), @@ -159,9 +159,6 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { sizeof(error)); REQUIRE(encrypt_with_pro_sig.error_len_incl_null_terminator == 0); - REQUIRE(encrypt_without_pro_sig.encrypted); - REQUIRE(encrypt_with_pro_sig.encrypted); - // Should have the same payload size REQUIRE(encrypt_without_pro_sig.ciphertext.size == encrypt_with_pro_sig.ciphertext.size); session_protocol_encrypt_for_destination_free(&encrypt_without_pro_sig); @@ -193,7 +190,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { bytes33 recipient_pubkey = {}; std::memcpy(recipient_pubkey.data, keys.session_pk1.data(), keys.session_pk1.size()); - encrypt_result = session_protocol_encrypt_and_wrap_for_1o1( + encrypt_result = session_protocol_encrypt_for_1o1( plaintext.data(), plaintext.size(), keys.ed_sk0.data(), @@ -203,7 +200,6 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { pro_sig, error, sizeof(error)); - REQUIRE(encrypt_result.encrypted); REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); } @@ -281,8 +277,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { SECTION("Check non-encryptable messages produce only plaintext") { auto dest_list = { - DESTINATION_TYPE_COMMUNITY_INBOX, - DESTINATION_TYPE_CONTACT_OR_SYNC_MESSAGE}; + DESTINATION_TYPE_COMMUNITY_INBOX, DESTINATION_TYPE_CONTACT_OR_SYNC_MESSAGE}; for (auto dest_type : dest_list) { if (dest_type == DESTINATION_TYPE_COMMUNITY_INBOX) @@ -292,8 +287,6 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { session_protocol_destination dest = base_dest; dest.type = dest_type; - - NAMESPACE space = NAMESPACE_DEFAULT; if (dest_type == DESTINATION_TYPE_COMMUNITY_INBOX) { auto [blind15_pk, blind15_sk] = session::blind15_key_pair( keys.ed_sk1, keys.ed_pk1, /*blind factor*/ nullptr); @@ -308,11 +301,9 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { keys.ed_sk0.data(), keys.ed_sk0.size(), &dest, - space, error, sizeof(error)); - REQUIRE(encrypt_result.encrypted); REQUIRE(encrypt_result.ciphertext.size > 0); REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); session_protocol_encrypt_for_destination_free(&encrypt_result); @@ -322,7 +313,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { SECTION("Encrypt/decrypt for contact in default namespace with Pro") { // Encrypt content session_protocol_encrypted_for_destination encrypt_result = - session_protocol_encrypt_and_wrap_for_1o1( + session_protocol_encrypt_for_1o1( protobuf_content_with_pro.plaintext.data(), protobuf_content_with_pro.plaintext.size(), keys.ed_sk0.data(), @@ -332,7 +323,6 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { base_dest.pro_sig, error, sizeof(error)); - REQUIRE(encrypt_result.encrypted); REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); // Decrypt envelope @@ -391,7 +381,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { // Encrypt content session_protocol_encrypted_for_destination encrypt_result = - session_protocol_encrypt_and_wrap_for_1o1( + session_protocol_encrypt_for_1o1( protobuf_content_with_pro_and_features.plaintext.data(), protobuf_content_with_pro_and_features.plaintext.size(), keys.ed_sk0.data(), @@ -402,7 +392,6 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { .sig_over_plaintext_with_user_pro_key_c, error, sizeof(error)); - REQUIRE(encrypt_result.encrypted); REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); // Decrypt envelope @@ -455,13 +444,11 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { keys.ed_sk0.data(), keys.ed_sk0.size(), &dest, - NAMESPACE_DEFAULT, error, sizeof(error)); REQUIRE(encrypt_result.error_len_incl_null_terminator > 0); REQUIRE(encrypt_result.error_len_incl_null_terminator <= sizeof(error)); REQUIRE(!encrypt_result.success); - REQUIRE(!encrypt_result.encrypted); session_protocol_encrypt_for_destination_free(&encrypt_result); } @@ -484,7 +471,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { std::memcpy( group_v2_session_sk.data, group_v2_sk.data(), sizeof(group_v2_session_sk.data)); - encrypt_result = session_protocol_encrypt_and_wrap_for_group( + encrypt_result = session_protocol_encrypt_for_group( protobuf_content_with_pro.plaintext.data(), protobuf_content_with_pro.plaintext.size(), keys.ed_sk0.data(), @@ -497,7 +484,6 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { sizeof(error)); INFO("Encrypt for group error: " << error); REQUIRE(encrypt_result.success); - REQUIRE(encrypt_result.encrypted); REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); } @@ -531,7 +517,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { SECTION("Encrypt/decrypt for sync messages with Pro") { // Encrypt session_protocol_encrypted_for_destination encrypt_result = - session_protocol_encrypt_and_wrap_for_1o1( + session_protocol_encrypt_for_1o1( protobuf_content_with_pro.plaintext.data(), protobuf_content_with_pro.plaintext.size(), keys.ed_sk0.data(), @@ -541,7 +527,6 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { base_dest.pro_sig, error, sizeof(error)); - REQUIRE(encrypt_result.encrypted); REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); // Decrypt @@ -669,7 +654,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { bytes64 pro_sig = base_pro_sig; pro_sig.data[0] ^= 1; // Break the sig by flipping a bit - encrypt_result = session_protocol_encrypt_and_wrap_for_1o1( + encrypt_result = session_protocol_encrypt_for_1o1( protobuf_content_with_pro.plaintext.data(), protobuf_content_with_pro.plaintext.size(), keys.ed_sk0.data(), @@ -679,7 +664,6 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { &pro_sig, error, sizeof(error)); - REQUIRE(encrypt_result.encrypted); REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); } From f9ae0d3a47ff179fb4748a3dd5cd3e70c6b9faca Mon Sep 17 00:00:00 2001 From: doylet Date: Fri, 29 Aug 2025 15:49:27 +1000 Subject: [PATCH 57/59] Linting --- include/session/session_protocol.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index 204bb31f..b28ac490 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -272,7 +272,8 @@ session_protocol_encrypted_for_destination session_protocol_encrypt_for_communit /// - `ed25519_privkey_len` -- The length of the ed25519_privkey buffer in bytes (32 or 64). /// - `sent_timestamp_ms` -- The timestamp to assign to the message envelope, in milliseconds. /// - `group_ed25519_pubkey` -- The group's public key (33 bytes) for encryption with a 0x03 prefix. -/// - `group_ed25519_privkey` -- The group's private key (32 bytes) for groups v2 messages, typically +/// - `group_ed25519_privkey` -- The group's private key (32 bytes) for groups v2 messages, +/// typically /// the latest encryption key for the group (e.g., Keys::group_enc_key). /// - `pro_sig` -- Optional signature over the unencrypted plaintext with the user's Session Pro /// rotating public key, if using Session Pro features. If provided, the corresponding proof must From a0fbd434c305b955879974941fcb919c7fb7c0f5 Mon Sep 17 00:00:00 2001 From: doylet Date: Wed, 24 Sep 2025 12:47:40 +1000 Subject: [PATCH 58/59] Add missing memory header for zstd --- include/session/config/user_profile.hpp | 1 - src/util.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/include/session/config/user_profile.hpp b/include/session/config/user_profile.hpp index a96c2b49..a59c191e 100644 --- a/include/session/config/user_profile.hpp +++ b/include/session/config/user_profile.hpp @@ -1,7 +1,6 @@ #pragma once #include -#include #include #include diff --git a/src/util.cpp b/src/util.cpp index c05c7bdc..30bc4dcc 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,6 +1,7 @@ #include #include +#include #include namespace session { From db2e063cd73715433a0466c6219671b2c460addf Mon Sep 17 00:00:00 2001 From: doylet Date: Wed, 24 Sep 2025 15:07:01 +1000 Subject: [PATCH 59/59] Move ProProof into session_protocol.hpp Pro proof is part of the session protocol and is required by some of the higher-level helper functions in the crypto layer. Because of this we were having some circular dependency issues, Debian 12 ARM build was complaining that session_protocol.cpp was calling out to functions in session/config/pro.h which sits in a layer above us. This created a circular dependency and upon re-assessment the pro proof structures really belong in the protocol layer. What does belong in the config section is the top-level pro config object that contains the Session Pro rotating key pair and the proof itself. --- include/session/config/pro.h | 121 +---------- include/session/config/pro.hpp | 141 +----------- include/session/pro_backend.hpp | 3 +- include/session/session_encrypt.hpp | 2 + include/session/session_protocol.h | 124 ++++++++++- include/session/session_protocol.hpp | 125 ++++++++++- src/config/pro.cpp | 312 +++++---------------------- src/session_protocol.cpp | 201 ++++++++++++++++- tests/test_config_pro.cpp | 4 +- tests/test_session_protocol.cpp | 8 +- 10 files changed, 511 insertions(+), 530 deletions(-) diff --git a/include/session/config/pro.h b/include/session/config/pro.h index df2b155c..b8bfadb0 100644 --- a/include/session/config/pro.h +++ b/include/session/config/pro.h @@ -9,132 +9,13 @@ extern "C" { #include #include "../export.h" -#include "../types.h" - -typedef enum PRO_STATUS { // See session::ProStatus - PRO_STATUS_NIL, - PRO_STATUS_INVALID_PRO_BACKEND_SIG, - PRO_STATUS_INVALID_USER_SIG, - PRO_STATUS_VALID, - PRO_STATUS_EXPIRED, -} PRO_STATUS; - -typedef struct pro_signed_message { - span_u8 sig; - span_u8 msg; -} pro_signed_message; - -typedef struct pro_proof { - uint8_t version; - uint8_t gen_index_hash[32]; - uint8_t rotating_pubkey[32]; - uint64_t expiry_unix_ts; - uint8_t sig[64]; -} pro_proof; +#include "session/session_protocol.h" typedef struct pro_config { uint8_t rotating_privkey[64]; pro_proof proof; } pro_pro_config; -/// API: pro/pro_proof_hash -/// -/// Generate the 32 byte hash that is to be signed by the rotating key or Session Pro Backend key to -/// embed in the envelope or proof respectively which other clients use to authenticate the validity -/// of a proof. -/// -/// Inputs: -/// - `proof` -- Proof to calculate the hash from -/// -/// Outputs: -/// - `bytes32` -- The 32 byte hash calculated from the proof -LIBSESSION_EXPORT bytes32 pro_proof_hash(pro_proof const* proof); - -/// API: pro/pro_proof_verify_signature -/// -/// Verify the proof was signed by the `verify_pubkey` -/// -/// Inputs: -/// - `proof` -- Proof to verify -/// - `verify_pubkey` -- Array of bytes containing the public key to (typically the Session Pro -/// Backend public key) verify the proof against. -/// - `verify_pubkey_len` -- Length of the `verify_pubkey` this must be 32 bytes, but is -/// parameterised to detect errors about incorrectly sized arrays by the caller. -/// -/// Outputs: -/// - `bool` -- True if verified, false otherwise -LIBSESSION_EXPORT bool pro_proof_verify_signature( - pro_proof const* proof, uint8_t const* verify_pubkey, size_t verify_pubkey_len); - -/// API: pro/pro_proof_verify_message -/// -/// Check if the `rotating_pubkey` in the proof was the signatory of the message and signature -/// passed in. This function throws if an signature is passed in that isn't 64 bytes. -/// -/// Inputs: -/// - `proof` -- Proof to verify -/// - `sig` -- Signature to verify with the `rotating_pubkey`. The signature should have -/// originally been signed over `msg` passed in. -/// - `sig_len` -- Length of the signature, should be 64 bytes -/// - `msg` -- Message that the signature signed over with. It will be verified using the -/// embedded `rotating_pubkey`. -/// - `msg_len` -- Length of the message -/// -/// Outputs: -/// - `bool` -- True if verified, false otherwise (bad signature, or, invalid arguments). -LIBSESSION_EXPORT bool pro_proof_verify_message( - pro_proof const* proof, - uint8_t const* sig, - size_t sig_len, - uint8_t const* msg, - size_t msg_len); - -/// API: pro/pro_proof_is_active -/// -/// Check if the Pro proof is currently entitled to Pro given the `unix_ts` with respect to the -/// proof's `expiry_unix_ts` -/// -/// Inputs: -/// - `proof` -- Proof to verify -/// - `unix_ts_s` -- The unix timestamp in seconds to check the proof expiry time against -/// -/// Outputs: -/// - `bool` -- True if expired, false otherwise -LIBSESSION_EXPORT bool pro_proof_is_active(pro_proof const* proof, uint64_t unix_ts_s); - -/// API: pro/pro_proof_status -/// -/// Evaluate the status of the pro proof by checking it is signed by the `verify_pubkey`, it has -/// not expired via `unix_ts_s` and optionally verify that the `signed_msg` was signed by the -/// `rotating_pubkey` embedded in the proof. -/// -/// Internally this function calls `pro_proof_verify_signature`, `pro_proof_verify_message` and -/// optionally `pro_proof_is_active` in sequence. This function fails if an invalidly sized public -/// key or signature are passed in. They must be 32 and 64 bytes respectively, the appropriate -/// invalid status will be returned. -/// -/// Inputs: -/// - `proof` -- Proof to verify -/// - `verify_pubkey` -- 32 byte Ed25519 public key of the corresponding secret key to check if -/// they are the original signatory of the proof. -/// - `verify_pubkey_len` -- Length of the `verify_pubkey` should be 32 bytes -/// they are the original signatory of the proof. -/// - `unix_ts` -- Unix timestamp in seconds to compared against the embedded `expiry_unix_ts` -/// to determine if the proof has expired or not -/// - `signed_msg` -- Optionally set the payload to the message with the signature to verify if -/// the embedded `rotating_pubkey` in the proof signed the given message. -/// -/// Outputs: -/// - `status` - The derived status given the components of the message. If `signed_msg` is -/// not set then this function can never return `PRO_STATUS_INVALID_USER_SIG` from the set of -/// possible enum values. Otherwise this funtion can return all possible values. -LIBSESSION_EXPORT PRO_STATUS pro_proof_status( - pro_proof const* proof, - const uint8_t* verify_pubkey, - size_t verify_pubkey_len, - uint64_t unix_ts_s, - const pro_signed_message* signed_msg); - /// API: pro/pro_verify /// /// Verify the proof was signed by the `verify_pubkey` and that the `rotating_privkey` in the `pro` diff --git a/include/session/config/pro.hpp b/include/session/config/pro.hpp index 011abc77..62715a6b 100644 --- a/include/session/config/pro.hpp +++ b/include/session/config/pro.hpp @@ -1,143 +1,22 @@ #pragma once -#include - -#include -#include #include #include -#include -#include +#include namespace session::config { -enum ProProofVersion { ProProofVersion_v0 }; - -enum class ProStatus { - // Pro proof sig was not signed by the Pro backend key - InvalidProBackendSig = PRO_STATUS_INVALID_PRO_BACKEND_SIG, - // Pro sig in the envelope was not signed by the Rotating key - InvalidUserSig = PRO_STATUS_INVALID_USER_SIG, - Valid = PRO_STATUS_VALID, // Proof is verified; has not expired - Expired = PRO_STATUS_EXPIRED, // Proof is verified; has expired -}; - -struct ProSignedMessage { - std::span sig; - std::span msg; -}; - -/// keys used currently or in the past (so that we don't reuse): -/// -/// @ - version -/// g - gen_index_hash -/// r - rotating ed25519 pubkey -/// e - expiry unix timestamp (in seconds) -/// s - proof signature, signed by the Session Pro Backend's ed25519 key -class ProProof { - public: - /// Version of the proof set by the Session Pro Backend - std::uint8_t version; - - /// Hash of the generation index set by the Session Pro Backend - array_uc32 gen_index_hash; - - /// The public key that the Session client registers their Session Pro entitlement under. - /// Session clients must sign messages with this key along side the sending of this proof for - /// the network to authenticate their usage of the proof - array_uc32 rotating_pubkey; - - /// Unix epoch timestamp to which this proof's entitlement to Session Pro features is valid to - std::chrono::sys_seconds expiry_unix_ts; - - /// Signature over the contents of the proof. It is signed by the Session Pro Backend key which - /// is the entity responsible for issueing tamper-proof Sesison Pro certificates for Session - /// clients. - array_uc64 sig; - - /// API: pro/Proof::verify_signature - /// - /// Verify that the proof's contents was not tampered with by hashing the proof and checking - /// that the hash was signed by the secret key of the given Ed25519 public key. - /// - /// For Session Pro intents and purposes, we expect proofs to be signed by the Session Pro - /// Backend public key. This function throws if an incorrectly sized key is passed in. - /// - /// Inputs: - /// - `verify_pubkey` -- 32 byte Ed25519 public key of the corresponding secret key to check if - /// they are the original signatory of the proof. - /// - /// Outputs: - /// - `bool` - True if the given key was the signatory of the proof, false otherwise - bool verify_signature(const std::span& verify_pubkey) const; - - /// API: pro/Proof::verify_message - /// - /// Check if the `rotating_pubkey` in the proof was the signatory of the message and signature - /// passed in. This function throws if an signature is passed in that isn't 64 bytes. - /// - /// Inputs: - /// - `sig` -- Signature to verify with the `rotating_pubkey`. The signature should have - /// originally been signed over `msg` passed in. - /// - `msg` -- Message that the signature signed over with. It will be verified using the - /// embedded `rotating_pubkey`. - /// - /// Outputs: - /// - `bool` - True if the message was signed by the embedded `rotating_pubkey` false otherwise. - bool verify_message(std::span sig, const std::span msg) const; - - /// API: pro/Proof::is_active - /// - /// Check if Pro proof is currently entitled to Pro given the `unix_ts` with respect to the - /// proof's `expiry_unix_ts` - /// - /// Inputs: - /// - `unix_ts` -- Unix timestamp in seconds to compared against the embedded `expiry_unix_ts` - /// to determine if the proof has expired or not - /// - /// Outputs: - /// - `bool` - True if proof is active (i.e. has not expired), false otherwise. - bool is_active(std::chrono::sys_seconds unix_ts) const; - - /// API: pro/Proof::status - /// - /// Evaluate the status of the pro proof by checking it is signed by the `verify_pubkey`, it has - /// not expired via `unix_ts` and optionally verify that the `signed_msg` was signed by the - /// `rotating_pubkey` embedded in the proof. - /// - /// Internally this function calls `verify_signature`, `verify_message` and optionally - /// `is_active` in sequence. This function throws if an invalidly sized public key or signature - /// are passed in. They must be 32 and 64 bytes respectively. - /// - /// Inputs: - /// - `verify_pubkey` -- 32 byte Ed25519 public key of the corresponding secret key to check if - /// they are the original signatory of the proof. - /// - `unix_ts` -- Unix timestamp in seconds to compared against the embedded `expiry_unix_ts` - /// to determine if the proof has expired or not - /// - `signed_msg` -- Optionally set the payload to the message with the signature to verify if - /// the embedded `rotating_pubkey` in the proof signed the given message. - /// - /// Outputs: - /// - `ProStatus` - The derived status given the components of the message. If `signed_msg` is - /// not set then this function can never return `ProStatus::InvalidUserSig` from the set of - /// possible enum values. Otherwise this funtion can return all possible values. - ProStatus status( - std::span verify_pubkey, - std::chrono::sys_seconds unix_ts, - const std::optional& signed_msg); - - /// API: pro/Proof::hash - /// - /// Create a 32-byte hash from the proof. This hash is the payload that is signed in the proof. - array_uc32 hash() const; - - bool load(const dict& root); -}; - /// keys used currently or in the past (so that we don't reuse): /// -/// r - rotating ed25519 privkey -/// p - proof +/// p + pro data +/// | +/// +-- @ - version +/// +-- g - gen_index_hash +/// +-- r - rotating ed25519 pubkey +/// +-- e - expiry unix timestamp (in seconds) +/// +-- s - proof signature, signed by the Session Pro Backend's ed25519 key +/// +-- r - rotating ed25519 privkey +/// +-- p - proof class ProConfig { public: /// Private key for the public key key specified in the proof. This is synced between clients diff --git a/include/session/pro_backend.hpp b/include/session/pro_backend.hpp index 9a05d08c..15c2cbfc 100644 --- a/include/session/pro_backend.hpp +++ b/include/session/pro_backend.hpp @@ -1,7 +1,8 @@ #pragma once -#include +#include #include +#include namespace session::pro_backend { diff --git a/include/session/session_encrypt.hpp b/include/session/session_encrypt.hpp index f3415e09..78d23528 100644 --- a/include/session/session_encrypt.hpp +++ b/include/session/session_encrypt.hpp @@ -1,5 +1,7 @@ #pragma once +#include + #include #include #include diff --git a/include/session/session_protocol.h b/include/session/session_protocol.h index b28ac490..c929b023 100644 --- a/include/session/session_protocol.h +++ b/include/session/session_protocol.h @@ -1,14 +1,13 @@ +#pragma once + #include -#include "config/pro.h" #include "export.h" #include "types.h" /// The C header for session_protocol. See the CPP header for more indepth comments. Only the /// differences between the C and CPP headers are documented to avoid duplication. -struct config_group_keys; - #ifdef __cplusplus extern "C" { #endif @@ -30,6 +29,27 @@ enum { PRO_HIGHER_CHARACTER_LIMIT = 10'000, }; +typedef enum PRO_STATUS { // See session::ProStatus + PRO_STATUS_NIL, + PRO_STATUS_INVALID_PRO_BACKEND_SIG, + PRO_STATUS_INVALID_USER_SIG, + PRO_STATUS_VALID, + PRO_STATUS_EXPIRED, +} PRO_STATUS; + +typedef struct pro_signed_message { + span_u8 sig; + span_u8 msg; +} pro_signed_message; + +typedef struct pro_proof { + uint8_t version; + uint8_t gen_index_hash[32]; + uint8_t rotating_pubkey[32]; + uint64_t expiry_unix_ts; + uint8_t sig[64]; +} pro_proof; + // Bit flags for features that are not currently able to be determined by the state stored in // Libsession. They are to be passed in by the client into `get_pro_msg_for_features` to return the // bitset of `PRO_FEATURES` that a message will use. @@ -118,6 +138,104 @@ typedef struct session_protocol_encrypted_for_destination { size_t error_len_incl_null_terminator; } session_protocol_encrypted_for_destination; +/// API: pro/pro_proof_hash +/// +/// Generate the 32 byte hash that is to be signed by the rotating key or Session Pro Backend key to +/// embed in the envelope or proof respectively which other clients use to authenticate the validity +/// of a proof. +/// +/// Inputs: +/// - `proof` -- Proof to calculate the hash from +/// +/// Outputs: +/// - `bytes32` -- The 32 byte hash calculated from the proof +LIBSESSION_EXPORT bytes32 pro_proof_hash(pro_proof const* proof); + +/// API: pro/pro_proof_verify_signature +/// +/// Verify the proof was signed by the `verify_pubkey` +/// +/// Inputs: +/// - `proof` -- Proof to verify +/// - `verify_pubkey` -- Array of bytes containing the public key to (typically the Session Pro +/// Backend public key) verify the proof against. +/// - `verify_pubkey_len` -- Length of the `verify_pubkey` this must be 32 bytes, but is +/// parameterised to detect errors about incorrectly sized arrays by the caller. +/// +/// Outputs: +/// - `bool` -- True if verified, false otherwise +LIBSESSION_EXPORT bool pro_proof_verify_signature( + pro_proof const* proof, uint8_t const* verify_pubkey, size_t verify_pubkey_len); + +/// API: pro/pro_proof_verify_message +/// +/// Check if the `rotating_pubkey` in the proof was the signatory of the message and signature +/// passed in. This function throws if an signature is passed in that isn't 64 bytes. +/// +/// Inputs: +/// - `proof` -- Proof to verify +/// - `sig` -- Signature to verify with the `rotating_pubkey`. The signature should have +/// originally been signed over `msg` passed in. +/// - `sig_len` -- Length of the signature, should be 64 bytes +/// - `msg` -- Message that the signature signed over with. It will be verified using the +/// embedded `rotating_pubkey`. +/// - `msg_len` -- Length of the message +/// +/// Outputs: +/// - `bool` -- True if verified, false otherwise (bad signature, or, invalid arguments). +LIBSESSION_EXPORT bool pro_proof_verify_message( + pro_proof const* proof, + uint8_t const* sig, + size_t sig_len, + uint8_t const* msg, + size_t msg_len); + +/// API: pro/pro_proof_is_active +/// +/// Check if the Pro proof is currently entitled to Pro given the `unix_ts` with respect to the +/// proof's `expiry_unix_ts` +/// +/// Inputs: +/// - `proof` -- Proof to verify +/// - `unix_ts_s` -- The unix timestamp in seconds to check the proof expiry time against +/// +/// Outputs: +/// - `bool` -- True if expired, false otherwise +LIBSESSION_EXPORT bool pro_proof_is_active(pro_proof const* proof, uint64_t unix_ts_s); + +/// API: pro/pro_proof_status +/// +/// Evaluate the status of the pro proof by checking it is signed by the `verify_pubkey`, it has +/// not expired via `unix_ts_s` and optionally verify that the `signed_msg` was signed by the +/// `rotating_pubkey` embedded in the proof. +/// +/// Internally this function calls `pro_proof_verify_signature`, `pro_proof_verify_message` and +/// optionally `pro_proof_is_active` in sequence. This function fails if an invalidly sized public +/// key or signature are passed in. They must be 32 and 64 bytes respectively, the appropriate +/// invalid status will be returned. +/// +/// Inputs: +/// - `proof` -- Proof to verify +/// - `verify_pubkey` -- 32 byte Ed25519 public key of the corresponding secret key to check if +/// they are the original signatory of the proof. +/// - `verify_pubkey_len` -- Length of the `verify_pubkey` should be 32 bytes +/// they are the original signatory of the proof. +/// - `unix_ts` -- Unix timestamp in seconds to compared against the embedded `expiry_unix_ts` +/// to determine if the proof has expired or not +/// - `signed_msg` -- Optionally set the payload to the message with the signature to verify if +/// the embedded `rotating_pubkey` in the proof signed the given message. +/// +/// Outputs: +/// - `status` - The derived status given the components of the message. If `signed_msg` is +/// not set then this function can never return `PRO_STATUS_INVALID_USER_SIG` from the set of +/// possible enum values. Otherwise this funtion can return all possible values. +LIBSESSION_EXPORT PRO_STATUS pro_proof_status( + pro_proof const* proof, + const uint8_t* verify_pubkey, + size_t verify_pubkey_len, + uint64_t unix_ts_s, + const pro_signed_message* signed_msg); + /// API: session_protocol/session_protocol_get_pro_features_for_msg /// /// Determine the Pro features that are used in a given conversation message. diff --git a/include/session/session_protocol.hpp b/include/session/session_protocol.hpp index f5e9976a..1e9ce19c 100644 --- a/include/session/session_protocol.hpp +++ b/include/session/session_protocol.hpp @@ -2,7 +2,10 @@ #include -#include +#include +#include +#include +#include #include #include @@ -33,9 +36,119 @@ namespace session { -namespace config::groups { - class Keys; -} +enum ProProofVersion { ProProofVersion_v0 }; + +enum class ProStatus { + // Pro proof sig was not signed by the Pro backend key + InvalidProBackendSig = PRO_STATUS_INVALID_PRO_BACKEND_SIG, + // Pro sig in the envelope was not signed by the Rotating key + InvalidUserSig = PRO_STATUS_INVALID_USER_SIG, + Valid = PRO_STATUS_VALID, // Proof is verified; has not expired + Expired = PRO_STATUS_EXPIRED, // Proof is verified; has expired +}; + +struct ProSignedMessage { + std::span sig; + std::span msg; +}; + +class ProProof { + public: + /// Version of the proof set by the Session Pro Backend + std::uint8_t version; + + /// Hash of the generation index set by the Session Pro Backend + array_uc32 gen_index_hash; + + /// The public key that the Session client registers their Session Pro entitlement under. + /// Session clients must sign messages with this key along side the sending of this proof for + /// the network to authenticate their usage of the proof + array_uc32 rotating_pubkey; + + /// Unix epoch timestamp to which this proof's entitlement to Session Pro features is valid to + std::chrono::sys_seconds expiry_unix_ts; + + /// Signature over the contents of the proof. It is signed by the Session Pro Backend key which + /// is the entity responsible for issueing tamper-proof Sesison Pro certificates for Session + /// clients. + array_uc64 sig; + + /// API: pro/Proof::verify_signature + /// + /// Verify that the proof's contents was not tampered with by hashing the proof and checking + /// that the hash was signed by the secret key of the given Ed25519 public key. + /// + /// For Session Pro intents and purposes, we expect proofs to be signed by the Session Pro + /// Backend public key. This function throws if an incorrectly sized key is passed in. + /// + /// Inputs: + /// - `verify_pubkey` -- 32 byte Ed25519 public key of the corresponding secret key to check if + /// they are the original signatory of the proof. + /// + /// Outputs: + /// - `bool` - True if the given key was the signatory of the proof, false otherwise + bool verify_signature(const std::span& verify_pubkey) const; + + /// API: pro/Proof::verify_message + /// + /// Check if the `rotating_pubkey` in the proof was the signatory of the message and signature + /// passed in. This function throws if an signature is passed in that isn't 64 bytes. + /// + /// Inputs: + /// - `sig` -- Signature to verify with the `rotating_pubkey`. The signature should have + /// originally been signed over `msg` passed in. + /// - `msg` -- Message that the signature signed over with. It will be verified using the + /// embedded `rotating_pubkey`. + /// + /// Outputs: + /// - `bool` - True if the message was signed by the embedded `rotating_pubkey` false otherwise. + bool verify_message(std::span sig, const std::span msg) const; + + /// API: pro/Proof::is_active + /// + /// Check if Pro proof is currently entitled to Pro given the `unix_ts` with respect to the + /// proof's `expiry_unix_ts` + /// + /// Inputs: + /// - `unix_ts` -- Unix timestamp in seconds to compared against the embedded `expiry_unix_ts` + /// to determine if the proof has expired or not + /// + /// Outputs: + /// - `bool` - True if proof is active (i.e. has not expired), false otherwise. + bool is_active(std::chrono::sys_seconds unix_ts) const; + + /// API: pro/Proof::status + /// + /// Evaluate the status of the pro proof by checking it is signed by the `verify_pubkey`, it has + /// not expired via `unix_ts` and optionally verify that the `signed_msg` was signed by the + /// `rotating_pubkey` embedded in the proof. + /// + /// Internally this function calls `verify_signature`, `verify_message` and optionally + /// `is_active` in sequence. This function throws if an invalidly sized public key or signature + /// are passed in. They must be 32 and 64 bytes respectively. + /// + /// Inputs: + /// - `verify_pubkey` -- 32 byte Ed25519 public key of the corresponding secret key to check if + /// they are the original signatory of the proof. + /// - `unix_ts` -- Unix timestamp in seconds to compared against the embedded `expiry_unix_ts` + /// to determine if the proof has expired or not + /// - `signed_msg` -- Optionally set the payload to the message with the signature to verify if + /// the embedded `rotating_pubkey` in the proof signed the given message. + /// + /// Outputs: + /// - `ProStatus` - The derived status given the components of the message. If `signed_msg` is + /// not set then this function can never return `ProStatus::InvalidUserSig` from the set of + /// possible enum values. Otherwise this funtion can return all possible values. + ProStatus status( + std::span verify_pubkey, + std::chrono::sys_seconds unix_ts, + const std::optional& signed_msg); + + /// API: pro/Proof::hash + /// + /// Create a 32-byte hash from the proof. This hash is the payload that is signed in the proof. + array_uc32 hash() const; +}; enum class DestinationType { ContactOrSyncMessage = DESTINATION_TYPE_CONTACT_OR_SYNC_MESSAGE, @@ -91,10 +204,10 @@ struct Envelope { }; struct DecryptedPro { - config::ProStatus status; // Validity of the proof embedded in the envelope + ProStatus status; // Validity of the proof embedded in the envelope // Session Pro proof that was embedded in the envelope, this is always populated irrespective of // the status but the validity of the contents should be verified by checking `status` - config::ProProof proof; + ProProof proof; PRO_FEATURES features; // Bit flag features that were used in the embedded message }; diff --git a/src/config/pro.cpp b/src/config/pro.cpp index 281a5c2a..66e92156 100644 --- a/src/config/pro.cpp +++ b/src/config/pro.cpp @@ -6,54 +6,11 @@ #include "internal.hpp" -namespace { -session::array_uc32 proof_hash_internal( - std::uint8_t version, - std::span gen_index_hash, - std::span rotating_pubkey, - std::uint64_t expiry_unix_ts) { - // This must match the hashing routine at - // https://github.com/Doy-lee/session-pro-backend/blob/9417e00adbff3bf608b7ae831f87045bdab06232/backend.py#L545-L558 - session::array_uc32 result = {}; - crypto_generichash_blake2b_state state; - crypto_generichash_blake2b_init(&state, /*key*/ nullptr, 0, result.max_size()); - crypto_generichash_blake2b_update(&state, &version, sizeof(version)); - crypto_generichash_blake2b_update(&state, gen_index_hash.data(), gen_index_hash.size()); - crypto_generichash_blake2b_update(&state, rotating_pubkey.data(), rotating_pubkey.size()); - crypto_generichash_blake2b_update( - &state, reinterpret_cast(&expiry_unix_ts), sizeof(expiry_unix_ts)); - crypto_generichash_blake2b_final(&state, result.data(), result.size()); - return result; -} - -bool proof_verify_signature_internal( - std::span hash, - std::span sig, - std::span verify_pubkey) { - // The C/C++ interface verifies that the payloads are the correct size using the type system so - // only need asserts here. - assert(hash.size() == 32); - assert(sig.size() == crypto_sign_ed25519_BYTES); - assert(verify_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); - - int verify_result = crypto_sign_ed25519_verify_detached( - sig.data(), hash.data(), hash.size(), verify_pubkey.data()); - bool result = verify_result == 0; - return result; -} - -bool config_verify_signature_internal( - std::span rotating_privkey, - std::span verify_pubkey, - std::uint8_t version, - std::span gen_index_hash, - std::span rotating_pubkey, - std::uint64_t expiry_unix_ts, - std::span sig) { - - session::array_uc32 hash = - proof_hash_internal(version, gen_index_hash, rotating_pubkey, expiry_unix_ts); - if (!proof_verify_signature_internal(hash, sig, verify_pubkey)) +namespace session::config { +static_assert(sizeof(((ProConfig*)0)->rotating_privkey) == crypto_sign_ed25519_SECRETKEYBYTES); +bool ProConfig::verify_signature(const array_uc32& verify_pubkey) const { + uint64_t expiry_unix_ts = proof.expiry_unix_ts.time_since_epoch().count(); + if (!proof.verify_signature(verify_pubkey)) return false; session::array_uc32 rederived_pk; @@ -62,131 +19,10 @@ bool config_verify_signature_internal( rederived_pk.data(), rederived_sk.data(), rotating_privkey.data()); bool result = false; - if (rederived_pk.size() == rotating_pubkey.size()) - result = std::memcmp(rederived_pk.data(), rotating_pubkey.data(), rederived_pk.size()) == 0; - - return result; -} - -bool proof_verify_message_internal( - std::span rotating_pubkey, - std::span sig, - std::span msg) { - // C++ throws on bad size, C uses a fixed sized array - assert(rotating_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); - if (sig.size() != crypto_sign_ed25519_BYTES) - return false; - - int verify_result = crypto_sign_ed25519_verify_detached( - reinterpret_cast(sig.data()), - msg.data(), - msg.size(), - reinterpret_cast(rotating_pubkey.data())); - bool result = verify_result == 0; - return result; -} - -bool proof_is_active_internal(uint64_t expiry_unix_ts, uint64_t unix_ts_s) { - bool result = unix_ts_s <= expiry_unix_ts; - return result; -} -} // namespace - -namespace session::config { - -static_assert(sizeof(((ProConfig*)0)->rotating_privkey) == crypto_sign_ed25519_SECRETKEYBYTES); -static_assert(sizeof(((ProProof*)0)->gen_index_hash) == 32); -static_assert(sizeof(((ProProof*)0)->rotating_pubkey) == crypto_sign_ed25519_PUBLICKEYBYTES); -static_assert(sizeof(((ProProof*)0)->sig) == crypto_sign_ed25519_BYTES); - -bool ProProof::verify_signature(const std::span& verify_pubkey) const { - if (verify_pubkey.size() != crypto_sign_ed25519_PUBLICKEYBYTES) - throw std::invalid_argument{fmt::format( - "Invalid verify_pubkey: Must be 32 byte Ed25519 public key (was: {})", - verify_pubkey.size())}; - - array_uc32 hash_to_sign = hash(); - bool result = proof_verify_signature_internal(hash_to_sign, sig, verify_pubkey); - return result; -} - -bool ProProof::verify_message(std::span sig, std::span msg) const { - if (sig.size() != crypto_sign_ed25519_BYTES) - throw std::invalid_argument{fmt::format( - "Invalid signed_msg: Signature must be 64 bytes (was: {})", sig.size())}; - bool result = proof_verify_message_internal(rotating_pubkey, sig, msg); - return result; -} - -bool ProProof::is_active(std::chrono::sys_seconds unix_ts) const { - bool result = proof_is_active_internal( - expiry_unix_ts.time_since_epoch().count(), unix_ts.time_since_epoch().count()); - return result; -} - -ProStatus ProProof::status( - std::span verify_pubkey, - std::chrono::sys_seconds unix_ts, - const std::optional& signed_msg) { - ProStatus result = ProStatus::Valid; - // Verify the at the proof is verified by the Session Pro Backend key (e.g.: It was - // issued by an authoritative backend) - if (!verify_signature(verify_pubkey)) - result = ProStatus::InvalidProBackendSig; - - // Check if the message was signed if the user passed one in to verify against - if (result == ProStatus::Valid && signed_msg) { - if (!verify_message(signed_msg->sig, signed_msg->msg)) - result = ProStatus::InvalidUserSig; - } - - // Check if the proof has expired - if (result == ProStatus::Valid && !is_active(unix_ts)) - result = ProStatus::Expired; - return result; -} - -array_uc32 ProProof::hash() const { - array_uc32 result = proof_hash_internal( - version, gen_index_hash, rotating_pubkey, expiry_unix_ts.time_since_epoch().count()); - return result; -} - -bool ProProof::load(const dict& root) { - std::optional version = maybe_int(root, "@"); - std::optional> maybe_gen_index_hash = maybe_vector(root, "g"); - std::optional> maybe_rotating_pubkey = maybe_vector(root, "r"); - std::optional maybe_expiry_unix_ts = maybe_ts(root, "e"); - std::optional> maybe_sig = maybe_vector(root, "s"); - - if (!version) - return false; - if (!maybe_gen_index_hash || maybe_gen_index_hash->size() != gen_index_hash.size()) - return false; - if (!maybe_rotating_pubkey || maybe_rotating_pubkey->size() != rotating_pubkey.max_size()) - return false; - if (!maybe_sig || maybe_sig->size() != sig.max_size()) - return false; - - version = *version; - std::memcpy(gen_index_hash.data(), maybe_gen_index_hash->data(), gen_index_hash.size()); - std::memcpy(rotating_pubkey.data(), maybe_rotating_pubkey->data(), rotating_pubkey.size()); - expiry_unix_ts = *maybe_expiry_unix_ts; - std::memcpy(sig.data(), maybe_sig->data(), sig.size()); - - return true; -} - -bool ProConfig::verify_signature(const array_uc32& verify_pubkey) const { - uint64_t expiry_unix_ts = proof.expiry_unix_ts.time_since_epoch().count(); - bool result = config_verify_signature_internal( - rotating_privkey, - verify_pubkey, - proof.version, - proof.gen_index_hash, - proof.rotating_pubkey, - expiry_unix_ts, - proof.sig); + if (rederived_pk.size() == proof.rotating_pubkey.size()) + result = std::memcmp( + rederived_pk.data(), proof.rotating_pubkey.data(), rederived_pk.size()) == + 0; return result; } @@ -205,8 +41,36 @@ bool ProConfig::load(const dict& root) { if (!maybe_rotating_privkey || maybe_rotating_privkey->size() != rotating_privkey.max_size()) return false; - if (!proof.load(*p)) - return false; + // NOTE: Load into the proof object + { + std::optional version = maybe_int(*p, "@"); + std::optional> maybe_gen_index_hash = maybe_vector(*p, "g"); + std::optional> maybe_rotating_pubkey = maybe_vector(*p, "r"); + std::optional maybe_expiry_unix_ts = maybe_ts(*p, "e"); + std::optional> maybe_sig = maybe_vector(*p, "s"); + + if (!version) + return false; + if (!maybe_gen_index_hash || maybe_gen_index_hash->size() != proof.gen_index_hash.size()) + return false; + if (!maybe_rotating_pubkey || + maybe_rotating_pubkey->size() != proof.rotating_pubkey.max_size()) + return false; + if (!maybe_sig || maybe_sig->size() != proof.sig.max_size()) + return false; + + version = *version; + std::memcpy( + proof.gen_index_hash.data(), + maybe_gen_index_hash->data(), + proof.gen_index_hash.size()); + std::memcpy( + proof.rotating_pubkey.data(), + maybe_rotating_pubkey->data(), + proof.rotating_pubkey.size()); + proof.expiry_unix_ts = *maybe_expiry_unix_ts; + std::memcpy(proof.sig.data(), maybe_sig->data(), proof.sig.size()); + } std::memcpy(rotating_privkey.data(), maybe_rotating_privkey->data(), rotating_privkey.size()); return true; @@ -216,88 +80,30 @@ bool ProConfig::load(const dict& root) { // Ensure these are byte buffers and we can just use sizeof to build std::spans to interop with C++ static_assert((sizeof((pro_pro_config*)0)->rotating_privkey) == crypto_sign_ed25519_SECRETKEYBYTES); -static_assert((sizeof((pro_proof*)0)->gen_index_hash) == 32); -static_assert((sizeof((pro_proof*)0)->rotating_pubkey) == crypto_sign_ed25519_PUBLICKEYBYTES); -static_assert((sizeof((pro_proof*)0)->sig) == crypto_sign_ed25519_BYTES); - -LIBSESSION_C_API bytes32 pro_proof_hash(pro_proof const* proof) { - bytes32 result = {}; - if (proof) { - session::array_uc32 hash = proof_hash_internal( - proof->version, - proof->gen_index_hash, - proof->rotating_pubkey, - proof->expiry_unix_ts); - std::memcpy(result.data, hash.data(), hash.size()); - } - return result; -} - -LIBSESSION_C_API bool pro_proof_verify_signature( - pro_proof const* proof, uint8_t const* verify_pubkey, size_t verify_pubkey_len) { - if (!proof || verify_pubkey_len != crypto_sign_ed25519_PUBLICKEYBYTES) - return false; - auto verify_pubkey_span = std::span(verify_pubkey, verify_pubkey_len); - session::array_uc32 hash = proof_hash_internal( - proof->version, proof->gen_index_hash, proof->rotating_pubkey, proof->expiry_unix_ts); - bool result = proof_verify_signature_internal(hash, proof->sig, verify_pubkey_span); - return result; -} - -LIBSESSION_C_API bool pro_proof_verify_message( - pro_proof const* proof, - uint8_t const* sig, - size_t sig_len, - uint8_t const* msg, - size_t msg_len) { - std::span sig_span = {sig, sig_len}; - std::span msg_span = {msg, msg_len}; - bool result = proof_verify_message_internal(proof->rotating_pubkey, sig_span, msg_span); - return result; -} - -LIBSESSION_C_API bool pro_proof_is_active(pro_proof const* proof, uint64_t unix_ts_s) { - bool result = proof && proof_is_active_internal(proof->expiry_unix_ts, unix_ts_s); - return result; -} - -LIBSESSION_C_API PRO_STATUS pro_proof_status( - pro_proof const* proof, - const uint8_t* verify_pubkey, - size_t verify_pubkey_len, - uint64_t unix_ts_s, - const pro_signed_message* signed_msg) { - PRO_STATUS result = PRO_STATUS_VALID; - if (!pro_proof_verify_signature(proof, verify_pubkey, verify_pubkey_len)) - result = PRO_STATUS_INVALID_PRO_BACKEND_SIG; - - // Check if the message was signed if the user passed one in to verify against - if (result == PRO_STATUS_VALID && signed_msg) { - if (!pro_proof_verify_message( - proof, - signed_msg->sig.data, - signed_msg->sig.size, - signed_msg->msg.data, - signed_msg->msg.size)) - result = PRO_STATUS_INVALID_USER_SIG; - } - - // Check if the proof has expired - if (result == PRO_STATUS_VALID && !pro_proof_is_active(proof, unix_ts_s)) - result = PRO_STATUS_EXPIRED; - return result; -} LIBSESSION_C_API bool pro_config_verify_signature( pro_pro_config const* pro, uint8_t const* verify_pubkey, size_t verify_pubkey_len) { - auto verify_pubkey_span = std::span(verify_pubkey, verify_pubkey_len); - bool result = config_verify_signature_internal( - pro->rotating_privkey, - verify_pubkey_span, - pro->proof.version, + if (verify_pubkey_len != crypto_sign_ed25519_PUBLICKEYBYTES) + return false; + + session::config::ProConfig config = {}; + std::memcpy( + config.rotating_privkey.data(), pro->rotating_privkey, sizeof pro->rotating_privkey); + config.proof.version = pro->proof.version; + std::memcpy( + config.proof.gen_index_hash.data(), pro->proof.gen_index_hash, + sizeof pro->proof.gen_index_hash); + std::memcpy( + config.proof.rotating_pubkey.data(), pro->proof.rotating_pubkey, - pro->proof.expiry_unix_ts, - pro->proof.sig); + sizeof pro->proof.rotating_pubkey); + config.proof.expiry_unix_ts = + std::chrono::sys_seconds(std::chrono::seconds(pro->proof.expiry_unix_ts)); + std::memcpy(config.proof.sig.data(), pro->proof.sig, sizeof pro->proof.sig); + + session::array_uc32 verify_pubkey_cpp; + std::memcpy(verify_pubkey_cpp.data(), verify_pubkey, verify_pubkey_len); + bool result = config.verify_signature(verify_pubkey_cpp); return result; } diff --git a/src/session_protocol.cpp b/src/session_protocol.cpp index 0158d00e..4153187d 100644 --- a/src/session_protocol.cpp +++ b/src/session_protocol.cpp @@ -1,13 +1,9 @@ #include #include -#include +#include #include #include -#include -#include -#include -#include #include #include #include @@ -16,8 +12,125 @@ #include "WebSocketResources.pb.h" #include "session/export.h" +namespace { +session::array_uc32 proof_hash_internal( + std::uint8_t version, + std::span gen_index_hash, + std::span rotating_pubkey, + std::uint64_t expiry_unix_ts) { + // This must match the hashing routine at + // https://github.com/Doy-lee/session-pro-backend/blob/9417e00adbff3bf608b7ae831f87045bdab06232/backend.py#L545-L558 + session::array_uc32 result = {}; + crypto_generichash_blake2b_state state; + crypto_generichash_blake2b_init(&state, /*key*/ nullptr, 0, result.max_size()); + crypto_generichash_blake2b_update(&state, &version, sizeof(version)); + crypto_generichash_blake2b_update(&state, gen_index_hash.data(), gen_index_hash.size()); + crypto_generichash_blake2b_update(&state, rotating_pubkey.data(), rotating_pubkey.size()); + crypto_generichash_blake2b_update( + &state, reinterpret_cast(&expiry_unix_ts), sizeof(expiry_unix_ts)); + crypto_generichash_blake2b_final(&state, result.data(), result.size()); + return result; +} + +bool proof_verify_signature_internal( + std::span hash, + std::span sig, + std::span verify_pubkey) { + // The C/C++ interface verifies that the payloads are the correct size using the type system so + // only need asserts here. + assert(hash.size() == 32); + assert(sig.size() == crypto_sign_ed25519_BYTES); + assert(verify_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); + + int verify_result = crypto_sign_ed25519_verify_detached( + sig.data(), hash.data(), hash.size(), verify_pubkey.data()); + bool result = verify_result == 0; + return result; +} + +bool proof_verify_message_internal( + std::span rotating_pubkey, + std::span sig, + std::span msg) { + // C++ throws on bad size, C uses a fixed sized array + assert(rotating_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); + if (sig.size() != crypto_sign_ed25519_BYTES) + return false; + + int verify_result = crypto_sign_ed25519_verify_detached( + reinterpret_cast(sig.data()), + msg.data(), + msg.size(), + reinterpret_cast(rotating_pubkey.data())); + bool result = verify_result == 0; + return result; +} + +bool proof_is_active_internal(uint64_t expiry_unix_ts, uint64_t unix_ts_s) { + bool result = unix_ts_s <= expiry_unix_ts; + return result; +} +} // namespace + namespace session { +static_assert(sizeof(((ProProof*)0)->gen_index_hash) == 32); +static_assert(sizeof(((ProProof*)0)->rotating_pubkey) == crypto_sign_ed25519_PUBLICKEYBYTES); +static_assert(sizeof(((ProProof*)0)->sig) == crypto_sign_ed25519_BYTES); + +bool ProProof::verify_signature(const std::span& verify_pubkey) const { + if (verify_pubkey.size() != crypto_sign_ed25519_PUBLICKEYBYTES) + throw std::invalid_argument{fmt::format( + "Invalid verify_pubkey: Must be 32 byte Ed25519 public key (was: {})", + verify_pubkey.size())}; + + array_uc32 hash_to_sign = hash(); + bool result = proof_verify_signature_internal(hash_to_sign, sig, verify_pubkey); + return result; +} + +bool ProProof::verify_message(std::span sig, std::span msg) const { + if (sig.size() != crypto_sign_ed25519_BYTES) + throw std::invalid_argument{fmt::format( + "Invalid signed_msg: Signature must be 64 bytes (was: {})", sig.size())}; + bool result = proof_verify_message_internal(rotating_pubkey, sig, msg); + return result; +} + +bool ProProof::is_active(std::chrono::sys_seconds unix_ts) const { + bool result = proof_is_active_internal( + expiry_unix_ts.time_since_epoch().count(), unix_ts.time_since_epoch().count()); + return result; +} + +ProStatus ProProof::status( + std::span verify_pubkey, + std::chrono::sys_seconds unix_ts, + const std::optional& signed_msg) { + ProStatus result = ProStatus::Valid; + // Verify the at the proof is verified by the Session Pro Backend key (e.g.: It was + // issued by an authoritative backend) + if (!verify_signature(verify_pubkey)) + result = ProStatus::InvalidProBackendSig; + + // Check if the message was signed if the user passed one in to verify against + if (result == ProStatus::Valid && signed_msg) { + if (!verify_message(signed_msg->sig, signed_msg->msg)) + result = ProStatus::InvalidUserSig; + } + + // Check if the proof has expired + if (result == ProStatus::Valid && !is_active(unix_ts)) + result = ProStatus::Expired; + return result; +} + +array_uc32 ProProof::hash() const { + array_uc32 result = proof_hash_internal( + version, gen_index_hash, rotating_pubkey, expiry_unix_ts.time_since_epoch().count()); + return result; +} + PRO_FEATURES get_pro_features_for_msg(size_t msg_size, PRO_EXTRA_FEATURES extra) { PRO_FEATURES result = PRO_FEATURES_NIL; @@ -502,10 +615,10 @@ DecryptedEnvelope decrypt_envelope( // Parse the proof from protobufs const SessionProtos::ProProof& proto_proof = pro_msg.proof(); - session::config::ProProof& proof = pro.proof; + session::ProProof& proof = pro.proof; // clang-format off size_t proof_errors = 0; - proof_errors += !proto_proof.has_version() || proto_proof.version() != static_cast(session::config::ProProofVersion_v0); + proof_errors += !proto_proof.has_version() || proto_proof.version() != static_cast(session::ProProofVersion_v0); proof_errors += !proto_proof.has_genindexhash() || proto_proof.genindexhash().size() != proof.gen_index_hash.max_size(); proof_errors += !proto_proof.has_rotatingpublickey() || proto_proof.rotatingpublickey().size() != proof.rotating_pubkey.max_size(); proof_errors += !proto_proof.has_expiryunixts(); @@ -533,7 +646,7 @@ DecryptedEnvelope decrypt_envelope( // Evaluate the pro status given the extracted components (was it signed, is it expired, // was the message signed validly?) - config::ProSignedMessage signed_msg = {}; + ProSignedMessage signed_msg = {}; signed_msg.sig = to_span(pro_sig); signed_msg.msg = result.content_plaintext; pro.status = proof.status(pro_backend_pubkey, unix_ts, signed_msg); @@ -545,6 +658,78 @@ DecryptedEnvelope decrypt_envelope( using namespace session; +static_assert((sizeof((pro_proof*)0)->gen_index_hash) == 32); +static_assert((sizeof((pro_proof*)0)->rotating_pubkey) == crypto_sign_ed25519_PUBLICKEYBYTES); +static_assert((sizeof((pro_proof*)0)->sig) == crypto_sign_ed25519_BYTES); + +LIBSESSION_C_API bytes32 pro_proof_hash(pro_proof const* proof) { + bytes32 result = {}; + if (proof) { + session::array_uc32 hash = proof_hash_internal( + proof->version, + proof->gen_index_hash, + proof->rotating_pubkey, + proof->expiry_unix_ts); + std::memcpy(result.data, hash.data(), hash.size()); + } + return result; +} + +LIBSESSION_C_API bool pro_proof_verify_signature( + pro_proof const* proof, uint8_t const* verify_pubkey, size_t verify_pubkey_len) { + if (!proof || verify_pubkey_len != crypto_sign_ed25519_PUBLICKEYBYTES) + return false; + auto verify_pubkey_span = std::span(verify_pubkey, verify_pubkey_len); + session::array_uc32 hash = proof_hash_internal( + proof->version, proof->gen_index_hash, proof->rotating_pubkey, proof->expiry_unix_ts); + bool result = proof_verify_signature_internal(hash, proof->sig, verify_pubkey_span); + return result; +} + +LIBSESSION_C_API bool pro_proof_verify_message( + pro_proof const* proof, + uint8_t const* sig, + size_t sig_len, + uint8_t const* msg, + size_t msg_len) { + std::span sig_span = {sig, sig_len}; + std::span msg_span = {msg, msg_len}; + bool result = proof_verify_message_internal(proof->rotating_pubkey, sig_span, msg_span); + return result; +} + +LIBSESSION_C_API bool pro_proof_is_active(pro_proof const* proof, uint64_t unix_ts_s) { + bool result = proof && proof_is_active_internal(proof->expiry_unix_ts, unix_ts_s); + return result; +} + +LIBSESSION_C_API PRO_STATUS pro_proof_status( + pro_proof const* proof, + const uint8_t* verify_pubkey, + size_t verify_pubkey_len, + uint64_t unix_ts_s, + const pro_signed_message* signed_msg) { + PRO_STATUS result = PRO_STATUS_VALID; + if (!pro_proof_verify_signature(proof, verify_pubkey, verify_pubkey_len)) + result = PRO_STATUS_INVALID_PRO_BACKEND_SIG; + + // Check if the message was signed if the user passed one in to verify against + if (result == PRO_STATUS_VALID && signed_msg) { + if (!pro_proof_verify_message( + proof, + signed_msg->sig.data, + signed_msg->sig.size, + signed_msg->msg.data, + signed_msg->msg.size)) + result = PRO_STATUS_INVALID_USER_SIG; + } + + // Check if the proof has expired + if (result == PRO_STATUS_VALID && !pro_proof_is_active(proof, unix_ts_s)) + result = PRO_STATUS_EXPIRED; + return result; +} + LIBSESSION_C_API PRO_FEATURES session_protocol_get_pro_features_for_msg(size_t msg_size, PRO_EXTRA_FEATURES flags) { PRO_FEATURES result = get_pro_features_for_msg(msg_size, flags); diff --git a/tests/test_config_pro.cpp b/tests/test_config_pro.cpp index 9937c659..eb98ece2 100644 --- a/tests/test_config_pro.cpp +++ b/tests/test_config_pro.cpp @@ -110,7 +110,7 @@ TEST_CASE("Pro", "[config][pro]") { session::config::dict good_dict; { // clang-format off - const session::config::ProProof& proof = pro_cpp.proof; + const session::ProProof& proof = pro_cpp.proof; good_dict = { {"r", std::string(reinterpret_cast(rotating_sk.data()), rotating_sk.size())}, {"p", session::config::dict{ @@ -141,7 +141,7 @@ TEST_CASE("Pro", "[config][pro]") { broken_sig[0] = ~broken_sig[0]; // Break the sig // clang-format off - const session::config::ProProof& proof = pro_cpp.proof; + const session::ProProof& proof = pro_cpp.proof; bad_dict = { {"r", std::string(reinterpret_cast(rotating_sk.data()), rotating_sk.size())}, {"p", session::config::dict{ diff --git a/tests/test_session_protocol.cpp b/tests/test_session_protocol.cpp index 148c419a..5e3e2bec 100644 --- a/tests/test_session_protocol.cpp +++ b/tests/test_session_protocol.cpp @@ -2,10 +2,6 @@ #include #include -#include -#include -#include -#include #include #include #include @@ -18,7 +14,7 @@ using namespace session; struct SerialisedProtobufContentWithProForTesting { - config::ProProof proof; + ProProof proof; std::string plaintext; array_uc64 sig_over_plaintext_with_user_pro_key; array_uc32 pro_proof_hash; @@ -222,7 +218,7 @@ TEST_CASE("Session protocol helpers C API", "[session-protocol][helpers]") { session_protocol_encrypt_for_destination_free(&encrypt_result); // Verify pro - config::ProProof nil_proof = {}; + ProProof nil_proof = {}; array_uc32 nil_hash = nil_proof.hash(); bytes32 decrypt_result_pro_hash = pro_proof_hash(&decrypt_result.pro_proof); REQUIRE(decrypt_result.pro_status == PRO_STATUS_NIL); // Pro was not attached