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 f0ee5025..102436b1 100644 --- a/include/session/config/groups/keys.h +++ b/include/session/config/groups/keys.h @@ -4,6 +4,7 @@ extern "C" { #endif +#include "../../types.h" #include "../base.h" #include "../util.h" @@ -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 3e20c9b7..c8f7c194 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,7 +694,9 @@ class Keys : public ConfigSig { /// API: groups/Keys::decrypt_message /// - /// Decrypts group message content that was presumably encrypted with `encrypt_message`, + /// 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. /// diff --git a/include/session/config/namespaces.h b/include/session/config/namespaces.h new file mode 100644 index 00000000..b9670323 --- /dev/null +++ b/include/session/config/namespaces.h @@ -0,0 +1,34 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum NAMESPACE { + // 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, + + // 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 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 690f6cba..6945f70a 100644 --- a/include/session/config/namespaces.hpp +++ b/include/session/config/namespaces.hpp @@ -2,25 +2,31 @@ #include +#include "namespaces.h" + namespace session::config { enum class Namespace : std::int16_t { - UserProfile = 2, - Contacts = 3, - ConvoInfoVolatile = 4, - UserGroups = 5, + RevokedRetrievableGroupMessages = NAMESPACE_REVOKED_RETRIEVABLE_GROUP_MESSAGES, + + // Messages sent to one-to-one conversations are stored in this namespace + 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, + // 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) - 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/config/pro.h b/include/session/config/pro.h new file mode 100644 index 00000000..b8bfadb0 --- /dev/null +++ b/include/session/config/pro.h @@ -0,0 +1,38 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +#include "../export.h" +#include "session/session_protocol.h" + +typedef struct pro_config { + uint8_t rotating_privkey[64]; + pro_proof proof; +} pro_pro_config; + +/// 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_config_verify_signature( + pro_config const* pro, uint8_t const* verify_pubkey, size_t verify_pubkey_len); + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/include/session/config/pro.hpp b/include/session/config/pro.hpp new file mode 100644 index 00000000..62715a6b --- /dev/null +++ b/include/session/config/pro.hpp @@ -0,0 +1,46 @@ +#pragma once + +#include +#include +#include + +namespace session::config { + +/// keys used currently or in the past (so that we don't reuse): +/// +/// 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 + /// to allow multiple clients to synchronise the Session Pro Proof and also the keys necessary + /// to use the proof. + cleared_uc64 rotating_privkey; + + /// A cryptographic proof for entitling an Ed25519 key to Session Pro + ProProof 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_signature(const array_uc32& verify_pubkey) const; + + bool load(const dict& root); +}; +}; // namespace session::config 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/config/user_profile.h b/include/session/config/user_profile.h index 94d3531c..ee7c842e 100644 --- a/include/session/config/user_profile.h +++ b/include/session/config/user_profile.h @@ -5,6 +5,7 @@ extern "C" { #endif #include "base.h" +#include "pro.h" #include "profile_pic.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 c9601086..a59c191e 100644 --- a/include/session/config/user_profile.hpp +++ b/include/session/config/user_profile.hpp @@ -1,12 +1,12 @@ #pragma once #include -#include #include #include #include "base.hpp" #include "namespaces.hpp" +#include "pro.hpp" #include "profile_pic.hpp" namespace session::config { @@ -24,6 +24,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 +32,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 +166,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 +186,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 +242,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_config() 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_config(const ProConfig& pro); }; } // namespace session::config diff --git a/include/session/ed25519.h b/include/session/ed25519.h index 82abd521..9418154d 100644 --- a/include/session/ed25519.h +++ b/include/session/ed25519.h @@ -95,6 +95,23 @@ 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_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_sk_out /*64 byte output buffer*/); + #ifdef __cplusplus } #endif diff --git a/include/session/ed25519.hpp b/include/session/ed25519.hpp index 264b2000..d4a7b892 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 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/include/session/pro_backend.hpp b/include/session/pro_backend.hpp new file mode 100644 index 00000000..15c2cbfc --- /dev/null +++ b/include/session/pro_backend.hpp @@ -0,0 +1,56 @@ +#pragma once + +#include +#include +#include + +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; + 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_backend diff --git a/include/session/session_encrypt.h b/include/session/session_encrypt.h index f5a1c2b6..5e062905 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 /// @@ -44,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. @@ -62,11 +63,78 @@ 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); +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 +/// +/// 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. +/// - `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, + 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, + char* error, + size_t error_len); + /// API: crypto/session_decrypt_incoming /// /// This function attempts to decrypt a message using the SessionProtocol. @@ -135,7 +203,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. @@ -158,14 +226,70 @@ 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 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; // 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 +/// +/// 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()`. +/// - `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 +/// - `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. +/// - `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, + char* error, + size_t error_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 c357a2f0..78d23528 100644 --- a/include/session/session_encrypt.hpp +++ b/include/session/session_encrypt.hpp @@ -1,11 +1,12 @@ #pragma once +#include + #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. // @@ -109,6 +110,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 @@ -229,7 +305,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. @@ -248,6 +324,43 @@ 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_for_group`, +/// 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_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: +/// - `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. +DecryptGroupMessage decrypt_group_message( + std::span> decrypt_ed25519_privkey_list, + 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/session_protocol.h b/include/session/session_protocol.h new file mode 100644 index 00000000..c929b023 --- /dev/null +++ b/include/session/session_protocol.h @@ -0,0 +1,593 @@ +#pragma once + +#include + +#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. + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + /// 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, +}; + +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. +typedef uint64_t PRO_EXTRA_FEATURES; +enum PRO_EXTRA_FEATURES_ { + PRO_EXTRA_FEATURES_NIL = 0, + PRO_EXTRA_FEATURES_PRO_BADGE = 1 << 0, + 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, + 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 +}; + +typedef enum DESTINATION_TYPE { // See session::DestinationType + DESTINATION_TYPE_CONTACT_OR_SYNC_MESSAGE, + DESTINATION_TYPE_GROUP, + DESTINATION_TYPE_COMMUNITY_INBOX, +} DESTINATION_TYPE; + +typedef struct session_protocol_destination { // See session::Destination + DESTINATION_TYPE type; + + // 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; + 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 +// an envelope after it has been parsed off the wire. +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, +}; + +typedef struct session_protocol_envelope { + ENVELOPE_FLAGS flags; + uint64_t timestamp_ms; + bytes33 source; + uint32_t source_device; + uint64_t server_timestamp; + bytes64 pro_sig; +} session_protocol_envelope; + +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; + +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; + session_protocol_envelope envelope; + span_u8 content_plaintext; + bytes32 sender_ed25519_pubkey; + bytes32 sender_x25519_pubkey; + 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 { + // Indicates if the encryption was successful. If any step failed and threw an exception, this + // is false. + bool success; + span_u8 ciphertext; + 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. +/// +/// Inputs: +/// - `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 +/// +/// 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(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_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); + +/// 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_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); + +/// 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_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 +/// `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 +/// +/// 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. +/// - `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. +/// - `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 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 +/// 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, + size_t plaintext_len, + const void* ed25519_privkey, + size_t ed25519_privkey_len, + const session_protocol_destination* dest, + 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 `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. +/// +/// 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 +/// 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. 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 +/// 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. +/// - `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, + const void* envelope_plaintext, + size_t envelope_plaintext_len, + uint64_t unix_ts, + const void* pro_backend_pubkey, + size_t pro_backend_pubkey_len, + 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/include/session/session_protocol.hpp b/include/session/session_protocol.hpp new file mode 100644 index 00000000..1e9ce19c --- /dev/null +++ b/include/session/session_protocol.hpp @@ -0,0 +1,478 @@ +#pragma once + +#include + +#include +#include +#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. + +// 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: +// +// 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. + +namespace session { + +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, + /// 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, + CommunityInbox = DESTINATION_TYPE_COMMUNITY_INBOX, +}; + +struct Destination { + DestinationType type; + + // 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; + + // 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; + + // 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 => 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` + cleared_uc32 group_ed25519_privkey; +}; + +struct Envelope { + ENVELOPE_FLAGS flags; + 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. + array_uc33 source; + uint32_t source_device; + uint64_t server_timestamp; + + // Signature by the sending client's rotating key + 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` + 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; + + // Decrypted envelope content into plaintext + std::vector content_plaintext; + + // 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; + + // 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; + + // 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 { + // 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; +}; + +/// API: session_protocol/get_pro_features_for_msg +/// +/// Determine the Pro features that are used in a given conversation message. +/// +/// Inputs: +/// - `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 +/// +/// 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_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. +/// +/// 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); + +/// 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, + const array_uc33& recipient_pubkey, + const array_uc32& community_pubkey, + const std::optional& pro_sig); + +/// 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, + 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 +/// `Content`), encrypt and/or wrap the plaintext in the necessary structures for transmission on +/// the Session Protocol. +/// +/// Calling this function requires filling out the options in the `Destination` struct with the +/// 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) +/// but otherwise 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. +/// +/// 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_destination( + std::span plaintext, + std::span ed25519_privkey, + const Destination& dest); + +/// API: session_protocol/decrypt_envelope +/// +/// 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 +/// 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` 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 +/// 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: +/// - `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 +/// +/// 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 +/// 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, + 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 new file mode 100644 index 00000000..47026c2d --- /dev/null +++ b/include/session/types.h @@ -0,0 +1,58 @@ +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/// C friendly buffer structure that is a pointer and length to a span of bytes. +struct span_u8 { + uint8_t* data; + size_t size; +}; + +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. +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); + +/// 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/include/session/types.hpp b/include/session/types.hpp index 2f361c49..1bc2ca00 100644 --- a/include/session/types.hpp +++ b/include/session/types.hpp @@ -1,13 +1,23 @@ #pragma once +#include #include -#include -#include -#include -#include -namespace session { namespace config { +namespace session { +using array_uc32 = std::array; +using array_uc33 = std::array; +using array_uc64 = std::array; - using seqno_t = std::int64_t; +enum class SessionIDPrefix { + standard = 0, + group = 0x3, + community_blinded_legacy = 0x5, + community_blinded = 0x15, + version_blinded = 0x25, + unblinded = 0x7, +}; -}} // namespace session::config +namespace config { + using seqno_t = std::int64_t; +} +} // namespace session 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/proto/SessionProtos.pb.cc b/proto/SessionProtos.pb.cc index cd353a0f..7b56cc16 100644 --- a/proto/SessionProtos.pb.cc +++ b/proto/SessionProtos.pb.cc @@ -24,6 +24,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 @@ -91,11 +92,14 @@ 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_.sharedconfigmessage_)*/nullptr + , /*decltype(_impl_.promessage_)*/nullptr + , /*decltype(_impl_.expirationtype_)*/0 + , /*decltype(_impl_.expirationtimer_)*/0u + , /*decltype(_impl_.sigtimestamp_)*/uint64_t{0u}} {} struct ContentDefaultTypeInternal { PROTOBUF_CONSTEXPR ContentDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -250,42 +254,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_)*/{} @@ -299,10 +267,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() @@ -313,64 +280,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{}}} {} -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_)*/{} @@ -427,6 +336,180 @@ 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): _impl_{ + /*decltype(_impl_._cached_size_)*/{}} {} +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): _impl_{ + /*decltype(_impl_._cached_size_)*/{}} {} +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_; +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 ProMessage::ProMessage( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.proof_)*/nullptr + , /*decltype(_impl_.features_)*/uint64_t{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 namespace SessionProtos { bool Envelope_Type_IsValid(int value) { @@ -545,6 +628,69 @@ 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)) +bool Content_ExpirationType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +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; +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)) bool CallMessage_Type_IsValid(int value) { switch (value) { case 1: @@ -792,89 +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)) -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; -} -#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: @@ -1107,6 +1170,132 @@ 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)) +bool GroupUpdateInfoChangeMessage_Type_IsValid(int value) { + switch (value) { + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +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; +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)) +bool GroupUpdateMemberChangeMessage_Type_IsValid(int value) { + switch (value) { + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +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; +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)) // =================================================================== @@ -1114,25 +1303,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; } }; @@ -1150,6 +1342,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_){} @@ -1172,6 +1365,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_)); @@ -1187,6 +1388,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} @@ -1200,6 +1402,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() { @@ -1215,6 +1421,7 @@ inline void Envelope::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); _impl_.source_.Destroy(); _impl_.content_.Destroy(); + _impl_.prosig_.Destroy(); } void Envelope::SetCachedSize(int size) const { @@ -1228,15 +1435,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_)); @@ -1311,6 +1521,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 @@ -1343,7 +1562,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); @@ -1356,13 +1575,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); } @@ -1374,11 +1593,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 = 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); @@ -1408,7 +1633,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()); @@ -1424,7 +1649,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 + @@ -1439,15 +1664,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()); } @@ -1474,7 +1706,7 @@ void Envelope::MergeFrom(const Envelope& from) { (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()); } @@ -1482,15 +1714,18 @@ void Envelope::MergeFrom(const Envelope& from) { _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; @@ -1524,6 +1759,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_) @@ -2399,24 +2638,33 @@ class Content::_Internal { 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; + (*has_bits)[0] |= 16u; } static const ::SessionProtos::UnsendRequest& unsendrequest(const Content* msg); static void set_has_unsendrequest(HasBits* has_bits) { - (*has_bits)[0] |= 64u; + (*has_bits)[0] |= 32u; } static const ::SessionProtos::MessageRequestResponse& messagerequestresponse(const Content* msg); static void set_has_messagerequestresponse(HasBits* has_bits) { - (*has_bits)[0] |= 128u; + (*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] |= 512u; + } + static void set_has_expirationtimer(HasBits* has_bits) { + (*has_bits)[0] |= 1024u; + } + static void set_has_sigtimestamp(HasBits* has_bits) { + (*has_bits)[0] |= 2048u; + } + static const ::SessionProtos::ProMessage& promessage(const Content* msg); + static void set_has_promessage(HasBits* has_bits) { (*has_bits)[0] |= 256u; } }; @@ -2437,10 +2685,6 @@ 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_; @@ -2457,6 +2701,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::MessageLite(arena, is_message_owned) { @@ -2473,11 +2721,14 @@ Content::Content(const Content& from) , 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_.sharedconfigmessage_){nullptr} + , decltype(_impl_.promessage_){nullptr} + , decltype(_impl_.expirationtype_){} + , decltype(_impl_.expirationtimer_){} + , decltype(_impl_.sigtimestamp_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); if (from._internal_has_datamessage()) { @@ -2492,9 +2743,6 @@ Content::Content(const Content& from) 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_); } @@ -2507,6 +2755,12 @@ 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_)); // @@protoc_insertion_point(copy_constructor:SessionProtos.Content) } @@ -2521,11 +2775,14 @@ inline void Content::SharedCtor( , 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_.promessage_){nullptr} + , decltype(_impl_.expirationtype_){0} + , decltype(_impl_.expirationtimer_){0u} + , decltype(_impl_.sigtimestamp_){uint64_t{0u}} }; } @@ -2544,11 +2801,11 @@ inline void Content::SharedDtor() { 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_.promessage_; } void Content::SetCachedSize(int size) const { @@ -2580,25 +2837,30 @@ void Content::Clear() { _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) { + if (cached_has_bits & 0x00000020u) { GOOGLE_DCHECK(_impl_.unsendrequest_ != nullptr); _impl_.unsendrequest_->Clear(); } - if (cached_has_bits & 0x00000080u) { + 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 & 0x00000100u) { - GOOGLE_DCHECK(_impl_.sharedconfigmessage_ != nullptr); - _impl_.sharedconfigmessage_->Clear(); + 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_)); } _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); @@ -2643,14 +2905,6 @@ const char* Content::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) } 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)) { @@ -2683,6 +2937,45 @@ const char* Content::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) } 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; + 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 @@ -2742,41 +3035,60 @@ uint8_t* Content::_InternalSerialize( _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) { + if (cached_has_bits & 0x00000010u) { 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) { + if (cached_has_bits & 0x00000020u) { 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) { + if (cached_has_bits & 0x00000040u) { 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) { + if (cached_has_bits & 0x00000080u) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: InternalWriteMessage(11, _Internal::sharedconfigmessage(this), _Internal::sharedconfigmessage(this).GetCachedSize(), target, stream); } + // optional .SessionProtos.Content.ExpirationType expirationType = 12; + 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 & 0x00000400u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(13, this->_internal_expirationtimer(), target); + } + + // optional uint64 sigTimestamp = 15; + 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 = 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); @@ -2823,42 +3135,60 @@ size_t Content::ByteSizeLong() const { *_impl_.typingmessage_); } - // optional .SessionProtos.ConfigurationMessage configurationMessage = 7; + // optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; if (cached_has_bits & 0x00000010u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.configurationmessage_); + *_impl_.dataextractionnotification_); } - // optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; + // optional .SessionProtos.UnsendRequest unsendRequest = 9; if (cached_has_bits & 0x00000020u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.dataextractionnotification_); + *_impl_.unsendrequest_); } - // optional .SessionProtos.UnsendRequest unsendRequest = 9; + // optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; if (cached_has_bits & 0x00000040u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.unsendrequest_); + *_impl_.messagerequestresponse_); } - // optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; + // optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; if (cached_has_bits & 0x00000080u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.messagerequestresponse_); + *_impl_.sharedconfigmessage_); } } - // optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; - if (cached_has_bits & 0x00000100u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.sharedconfigmessage_); - } + 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 & 0x00000400u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_expirationtimer()); + } + + // optional uint64 sigTimestamp = 15; + if (cached_has_bits & 0x00000800u) { + 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(); } @@ -2899,25 +3229,37 @@ void Content::MergeFrom(const Content& from) { 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) { + if (cached_has_bits & 0x00000020u) { _this->_internal_mutable_unsendrequest()->::SessionProtos::UnsendRequest::MergeFrom( from._internal_unsendrequest()); } - if (cached_has_bits & 0x00000080u) { + 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 & 0x00000100u) { - _this->_internal_mutable_sharedconfigmessage()->::SessionProtos::SharedConfigMessage::MergeFrom( - from._internal_sharedconfigmessage()); + if (cached_has_bits & 0x00000f00u) { + if (cached_has_bits & 0x00000100u) { + _this->_internal_mutable_promessage()->::SessionProtos::ProMessage::MergeFrom( + from._internal_promessage()); + } + if (cached_has_bits & 0x00000200u) { + _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; } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } @@ -2942,9 +3284,6 @@ bool Content::IsInitialized() const { 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; } @@ -2965,8 +3304,8 @@ void Content::InternalSwap(Content* 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(Content, _impl_.sharedconfigmessage_) - + sizeof(Content::_impl_.sharedconfigmessage_) + 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_)); @@ -5875,77 +6214,178 @@ std::string DataMessage_OpenGroupInvitation::GetTypeName() const { // =================================================================== -class DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_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_encryptedkeypair(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 bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; + 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 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; } }; -DataMessage_ClosedGroupControlMessage_KeyPairWrapper::DataMessage_ClosedGroupControlMessage_KeyPairWrapper(::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::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::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) } -DataMessage_ClosedGroupControlMessage_KeyPairWrapper::DataMessage_ClosedGroupControlMessage_KeyPairWrapper(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from) +DataMessage::DataMessage(const DataMessage& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataMessage_ClosedGroupControlMessage_KeyPairWrapper* 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_.encryptedkeypair_){}}; + , 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_.publickey_.InitDefault(); + _impl_.body_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.Set("", GetArenaForAllocation()); + _impl_.body_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_publickey()) { - _this->_impl_.publickey_.Set(from._internal_publickey(), + if (from._internal_has_body()) { + _this->_impl_.body_.Set(from._internal_body(), + _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()); } - _impl_.encryptedkeypair_.InitDefault(); + _impl_.synctarget_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.encryptedkeypair_.Set("", GetArenaForAllocation()); + _impl_.synctarget_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_encryptedkeypair()) { - _this->_impl_.encryptedkeypair_.Set(from._internal_encryptedkeypair(), + if (from._internal_has_synctarget()) { + _this->_impl_.synctarget_.Set(from._internal_synctarget(), _this->GetArenaForAllocation()); } - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) + 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_ClosedGroupControlMessage_KeyPairWrapper::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_.encryptedkeypair_){} + , 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_.publickey_.InitDefault(); + _impl_.body_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.publickey_.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_.encryptedkeypair_.InitDefault(); + _impl_.synctarget_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.encryptedkeypair_.Set("", GetArenaForAllocation()); + _impl_.synctarget_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -DataMessage_ClosedGroupControlMessage_KeyPairWrapper::~DataMessage_ClosedGroupControlMessage_KeyPairWrapper() { - // @@protoc_insertion_point(destructor:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) +DataMessage::~DataMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.DataMessage) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -5953,60 +6393,200 @@ DataMessage_ClosedGroupControlMessage_KeyPairWrapper::~DataMessage_ClosedGroupCo SharedDtor(); } -inline void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::SharedDtor() { +inline void DataMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.publickey_.Destroy(); - _impl_.encryptedkeypair_.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_.groupupdatemessage_; } -void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::SetCachedSize(int size) const { +void DataMessage::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::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 & 0x00000003u) { + if (cached_has_bits & 0x000000ffu) { if (cached_has_bits & 0x00000001u) { - _impl_.publickey_.ClearNonDefaultToEmpty(); + _impl_.body_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.encryptedkeypair_.ClearNonDefaultToEmpty(); + _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(); + } + 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(); } -const char* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_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 bytes encryptedKeyPair = 2; + // repeated .SessionProtos.AttachmentPointer attachments = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_encryptedkeypair(); + 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 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 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; + 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 @@ -6031,75 +6611,206 @@ const char* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_InternalParse #undef CHK_ } -uint8_t* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_InternalSerialize( +uint8_t* DataMessage::_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) 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 bytes encryptedKeyPair = 2; - if (cached_has_bits & 0x00000002u) { - target = stream->WriteBytesMaybeAliased( - 2, this->_internal_encryptedkeypair(), 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); } - 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 flags = 4; + if (cached_has_bits & 0x00000200u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_flags(), target); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) - 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; + // optional bytes profileKey = 6; + if (cached_has_bits & 0x00000002u) { + target = stream->WriteBytesMaybeAliased( + 6, this->_internal_profilekey(), target); + } - if (_internal_has_publickey()) { - // required bytes publicKey = 1; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_publickey()); + // optional uint64 timestamp = 7; + if (cached_has_bits & 0x00000100u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(7, this->_internal_timestamp(), target); } - if (_internal_has_encryptedkeypair()) { - // required bytes encryptedKeyPair = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_encryptedkeypair()); + // 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_ClosedGroupControlMessage_KeyPairWrapper::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) - 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 bytes publicKey = 1; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_publickey()); + // 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 bytes encryptedKeyPair = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_encryptedkeypair()); + // 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(); + // 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) { + 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())) { + 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; +} + +size_t DataMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage) + 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.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_); + } + + // 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; + } + + } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } @@ -6108,169 +6819,175 @@ size_t DataMessage_ClosedGroupControlMessage_KeyPairWrapper::ByteSizeLong() cons return total_size; } -void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::CheckTypeAndMergeFrom( +void DataMessage::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::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 & 0x00000003u) { + 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_encryptedkeypair(from._internal_encryptedkeypair()); + _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(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::CopyFrom(const DataMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool DataMessage_ClosedGroupControlMessage_KeyPairWrapper::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_groupupdatemessage()) { + if (!_impl_.groupupdatemessage_->IsInitialized()) return false; + } return true; } -void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::InternalSwap(DataMessage_ClosedGroupControlMessage_KeyPairWrapper* 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 + &_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_.encryptedkeypair_, lhs_arena, - &other->_impl_.encryptedkeypair_, rhs_arena + &_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_ClosedGroupControlMessage_KeyPairWrapper::GetTypeName() const { - return "SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper"; +std::string DataMessage::GetTypeName() const { + return "SessionProtos.DataMessage"; } // =================================================================== -class DataMessage_ClosedGroupControlMessage::_Internal { +class ReceiptMessage::_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 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; + return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 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, +ReceiptMessage::ReceiptMessage(::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.ReceiptMessage) } -DataMessage_ClosedGroupControlMessage::DataMessage_ClosedGroupControlMessage(const DataMessage_ClosedGroupControlMessage& from) +ReceiptMessage::ReceiptMessage(const ReceiptMessage& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataMessage_ClosedGroupControlMessage* const _this = this; (void)_this; + ReceiptMessage* 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_.timestamp_){from._impl_.timestamp_} , 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()); - } - 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) + _this->_impl_.type_ = from._impl_.type_; + // @@protoc_insertion_point(copy_constructor:SessionProtos.ReceiptMessage) } -inline void DataMessage_ClosedGroupControlMessage::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_.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_.timestamp_){arena} + , decltype(_impl_.type_){0} }; - _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) +ReceiptMessage::~ReceiptMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.ReceiptMessage) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -6278,142 +6995,59 @@ DataMessage_ClosedGroupControlMessage::~DataMessage_ClosedGroupControlMessage() SharedDtor(); } -inline void DataMessage_ClosedGroupControlMessage::SharedDtor() { +inline void ReceiptMessage::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_.timestamp_.~RepeatedField(); } -void DataMessage_ClosedGroupControlMessage::SetCachedSize(int size) const { +void ReceiptMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataMessage_ClosedGroupControlMessage::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage.ClosedGroupControlMessage) +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; - _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) { - _impl_.publickey_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000002u) { - _impl_.name_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000004u) { - GOOGLE_DCHECK(_impl_.encryptionkeypair_ != nullptr); - _impl_.encryptionkeypair_->Clear(); - } - } - if (cached_has_bits & 0x00000018u) { - _impl_.expirationtimer_ = 0u; - _impl_.type_ = 1; - } + _impl_.timestamp_.Clear(); + _impl_.type_ = 0; _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* DataMessage_ClosedGroupControlMessage::_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 .SessionProtos.DataMessage.ClosedGroupControlMessage.Type type = 1; + // 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::DataMessage_ClosedGroupControlMessage_Type_IsValid(val))) { - _internal_set_type(static_cast<::SessionProtos::DataMessage_ClosedGroupControlMessage_Type>(val)); + 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; - // optional bytes publicKey = 2; + // repeated uint64 timestamp = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_publickey(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional 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 .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; - 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)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { ptr -= 1; do { ptr += 1; - ptr = ctx->ParseMessage(_internal_add_wrappers(), ptr); + _internal_add_timestamp(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&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); + } 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; @@ -6442,78 +7076,39 @@ const char* DataMessage_ClosedGroupControlMessage::_InternalParse(const char* pt #undef CHK_ } -uint8_t* DataMessage_ClosedGroupControlMessage::_InternalSerialize( +uint8_t* ReceiptMessage::_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.ReceiptMessage) 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 .SessionProtos.ReceiptMessage.Type type = 1; + if (cached_has_bits & 0x00000001u) { 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( - 2, this->_internal_publickey(), target); - } - - // optional string name = 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); - } - - // optional uint32 expirationTimer = 8; - 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::WriteUInt32ToArray(8, this->_internal_expirationtimer(), 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.DataMessage.ClosedGroupControlMessage) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ReceiptMessage) return target; } -size_t DataMessage_ClosedGroupControlMessage::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage.ClosedGroupControlMessage) +size_t ReceiptMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ReceiptMessage) size_t total_size = 0; - // required .SessionProtos.DataMessage.ClosedGroupControlMessage.Type type = 1; + // required .SessionProtos.ReceiptMessage.Type type = 1; if (_internal_has_type()) { total_size += 1 + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); @@ -6522,58 +7117,15 @@ size_t DataMessage_ClosedGroupControlMessage::ByteSizeLong() const { // 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); + // 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; } - 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()); - } - - // 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 = 4; - if (cached_has_bits & 0x00000004u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.encryptionkeypair_); - } - - // optional uint32 expirationTimer = 8; - 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(); } @@ -6582,272 +7134,237 @@ size_t DataMessage_ClosedGroupControlMessage::ByteSizeLong() const { return total_size; } -void DataMessage_ClosedGroupControlMessage::CheckTypeAndMergeFrom( +void ReceiptMessage::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 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_.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 & 0x00000001u) { - _this->_internal_set_publickey(from._internal_publickey()); - } - 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_; - } - if (cached_has_bits & 0x00000010u) { - _this->_impl_.type_ = from._impl_.type_; - } - _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_); } -void DataMessage_ClosedGroupControlMessage::CopyFrom(const DataMessage_ClosedGroupControlMessage& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.DataMessage.ClosedGroupControlMessage) +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_ClosedGroupControlMessage::IsInitialized() const { +bool ReceiptMessage::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 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]); - _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_)); + _impl_.timestamp_.InternalSwap(&other->_impl_.timestamp_); swap(_impl_.type_, other->_impl_.type_); } -std::string DataMessage_ClosedGroupControlMessage::GetTypeName() const { - return "SessionProtos.DataMessage.ClosedGroupControlMessage"; +std::string ReceiptMessage::GetTypeName() const { + return "SessionProtos.ReceiptMessage"; } // =================================================================== -class DataMessage::_Internal { +class AttachmentPointer::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_body(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } - static void set_has_flags(HasBits* has_bits) { - (*has_bits)[0] |= 256u; + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_id(HasBits* has_bits) { + (*has_bits)[0] |= 128u; } - static void set_has_expiretimer(HasBits* has_bits) { - (*has_bits)[0] |= 512u; + static void set_has_contenttype(HasBits* has_bits) { + (*has_bits)[0] |= 1u; } - static void set_has_profilekey(HasBits* has_bits) { + static void set_has_key(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static void set_has_timestamp(HasBits* has_bits) { - (*has_bits)[0] |= 1024u; + static void set_has_size(HasBits* has_bits) { + (*has_bits)[0] |= 256u; } - static const ::SessionProtos::DataMessage_Quote& quote(const DataMessage* msg); - static void set_has_quote(HasBits* has_bits) { + 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 const ::SessionProtos::DataMessage_Reaction& reaction(const DataMessage* msg); - static void set_has_reaction(HasBits* has_bits) { + static void set_has_filename(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 void set_has_flags(HasBits* has_bits) { + (*has_bits)[0] |= 512u; } - 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_width(HasBits* has_bits) { + (*has_bits)[0] |= 1024u; } - 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_height(HasBits* has_bits) { + (*has_bits)[0] |= 2048u; } - static void set_has_synctarget(HasBits* has_bits) { - (*has_bits)[0] |= 4u; + static void set_has_caption(HasBits* has_bits) { + (*has_bits)[0] |= 32u; } - static void set_has_blockscommunitymessagerequests(HasBits* has_bits) { - (*has_bits)[0] |= 2048u; + 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; } }; -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, +AttachmentPointer::AttachmentPointer(::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.AttachmentPointer) } -DataMessage::DataMessage(const DataMessage& from) +AttachmentPointer::AttachmentPointer(const AttachmentPointer& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - DataMessage* const _this = this; (void)_this; + AttachmentPointer* 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_.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_.expiretimer_){} - , decltype(_impl_.timestamp_){} - , decltype(_impl_.blockscommunitymessagerequests_){}}; + , decltype(_impl_.width_){} + , decltype(_impl_.height_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.body_.InitDefault(); + _impl_.contenttype_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.body_.Set("", GetArenaForAllocation()); + _impl_.contenttype_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_body()) { - _this->_impl_.body_.Set(from._internal_body(), + if (from._internal_has_contenttype()) { + _this->_impl_.contenttype_.Set(from._internal_contenttype(), _this->GetArenaForAllocation()); } - _impl_.profilekey_.InitDefault(); + _impl_.key_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilekey_.Set("", GetArenaForAllocation()); + _impl_.key_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_profilekey()) { - _this->_impl_.profilekey_.Set(from._internal_profilekey(), + if (from._internal_has_key()) { + _this->_impl_.key_.Set(from._internal_key(), _this->GetArenaForAllocation()); } - _impl_.synctarget_.InitDefault(); + _impl_.thumbnail_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.synctarget_.Set("", GetArenaForAllocation()); + _impl_.thumbnail_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_synctarget()) { - _this->_impl_.synctarget_.Set(from._internal_synctarget(), + if (from._internal_has_thumbnail()) { + _this->_impl_.thumbnail_.Set(from._internal_thumbnail(), _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_); + _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()); } - if (from._internal_has_profile()) { - _this->_impl_.profile_ = new ::SessionProtos::LokiProfile(*from._impl_.profile_); + _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()); } - if (from._internal_has_opengroupinvitation()) { - _this->_impl_.opengroupinvitation_ = new ::SessionProtos::DataMessage_OpenGroupInvitation(*from._impl_.opengroupinvitation_); + _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()); } - if (from._internal_has_closedgroupcontrolmessage()) { - _this->_impl_.closedgroupcontrolmessage_ = new ::SessionProtos::DataMessage_ClosedGroupControlMessage(*from._impl_.closedgroupcontrolmessage_); + _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_.flags_, &from._impl_.flags_, - static_cast(reinterpret_cast(&_impl_.blockscommunitymessagerequests_) - - reinterpret_cast(&_impl_.flags_)) + sizeof(_impl_.blockscommunitymessagerequests_)); - // @@protoc_insertion_point(copy_constructor:SessionProtos.DataMessage) + ::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::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_.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_.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_.expiretimer_){0u} - , decltype(_impl_.timestamp_){uint64_t{0u}} - , decltype(_impl_.blockscommunitymessagerequests_){false} + , decltype(_impl_.width_){0u} + , decltype(_impl_.height_){0u} }; - _impl_.body_.InitDefault(); + _impl_.contenttype_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.body_.Set("", GetArenaForAllocation()); + _impl_.contenttype_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilekey_.InitDefault(); + _impl_.key_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.profilekey_.Set("", GetArenaForAllocation()); + _impl_.key_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.synctarget_.InitDefault(); + _impl_.thumbnail_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.synctarget_.Set("", GetArenaForAllocation()); + _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::~DataMessage() { - // @@protoc_insertion_point(destructor:SessionProtos.DataMessage) +AttachmentPointer::~AttachmentPointer() { + // @@protoc_insertion_point(destructor:SessionProtos.AttachmentPointer) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -6855,205 +7372,172 @@ DataMessage::~DataMessage() { SharedDtor(); } -inline void DataMessage::SharedDtor() { +inline void AttachmentPointer::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_.contenttype_.Destroy(); + _impl_.key_.Destroy(); + _impl_.thumbnail_.Destroy(); + _impl_.digest_.Destroy(); + _impl_.filename_.Destroy(); + _impl_.caption_.Destroy(); + _impl_.url_.Destroy(); } -void DataMessage::SetCachedSize(int size) const { +void AttachmentPointer::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void DataMessage::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.DataMessage) +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; - _impl_.attachments_.Clear(); - _impl_.preview_.Clear(); cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x000000ffu) { + if (cached_has_bits & 0x0000007fu) { if (cached_has_bits & 0x00000001u) { - _impl_.body_.ClearNonDefaultToEmpty(); + _impl_.contenttype_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.profilekey_.ClearNonDefaultToEmpty(); + _impl_.key_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000004u) { - _impl_.synctarget_.ClearNonDefaultToEmpty(); + _impl_.thumbnail_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000008u) { - GOOGLE_DCHECK(_impl_.quote_ != nullptr); - _impl_.quote_->Clear(); + _impl_.digest_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000010u) { - GOOGLE_DCHECK(_impl_.reaction_ != nullptr); - _impl_.reaction_->Clear(); + _impl_.filename_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000020u) { - GOOGLE_DCHECK(_impl_.profile_ != nullptr); - _impl_.profile_->Clear(); + _impl_.caption_.ClearNonDefaultToEmpty(); } 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_.url_.ClearNonDefaultToEmpty(); } } + _impl_.id_ = uint64_t{0u}; if (cached_has_bits & 0x00000f00u) { - ::memset(&_impl_.flags_, 0, static_cast( - reinterpret_cast(&_impl_.blockscommunitymessagerequests_) - - reinterpret_cast(&_impl_.flags_)) + sizeof(_impl_.blockscommunitymessagerequests_)); + ::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* DataMessage::_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) { - // optional string body = 1; + // required fixed64 id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_body(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); + 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; - // repeated .SessionProtos.AttachmentPointer attachments = 2; + // optional string contentType = 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)); + auto str = _internal_mutable_contenttype(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); } else goto handle_unusual; continue; - // optional uint32 flags = 4; + // 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_flags(&has_bits); - _impl_.flags_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + _Internal::set_has_size(&has_bits); + _impl_.size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; - // optional uint32 expireTimer = 5; + // optional bytes thumbnail = 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); + 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 profileKey = 6; + // optional bytes digest = 6; case 6: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { - auto str = _internal_mutable_profilekey(); + auto str = _internal_mutable_digest(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional uint64 timestamp = 7; + // optional string fileName = 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); + 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 .SessionProtos.DataMessage.Quote quote = 8; + // optional uint32 flags = 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); + 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 .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; - case 102: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { - ptr = ctx->ParseMessage(_internal_mutable_opengroupinvitation(), ptr); + // 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 .SessionProtos.DataMessage.ClosedGroupControlMessage closedGroupControlMessage = 104; - case 104: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { - ptr = ctx->ParseMessage(_internal_mutable_closedgroupcontrolmessage(), ptr); + // 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 syncTarget = 105; - case 105: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { - auto str = _internal_mutable_synctarget(); + // 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 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); + // 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); } else goto handle_unusual; @@ -7082,214 +7566,176 @@ const char* DataMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* c #undef CHK_ } -uint8_t* DataMessage::_InternalSerialize( +uint8_t* AttachmentPointer::_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.AttachmentPointer) uint32_t cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - // optional string body = 1; - if (cached_has_bits & 0x00000001u) { - 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) { + // required fixed64 id = 1; + if (cached_has_bits & 0x00000080u) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_flags(), target); + target = ::_pbi::WireFormatLite::WriteFixed64ToArray(1, this->_internal_id(), target); } - // optional uint32 expireTimer = 5; - if (cached_has_bits & 0x00000200u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_expiretimer(), target); + // optional string contentType = 2; + if (cached_has_bits & 0x00000001u) { + target = stream->WriteStringMaybeAliased( + 2, this->_internal_contenttype(), target); } - // optional bytes profileKey = 6; + // optional bytes key = 3; if (cached_has_bits & 0x00000002u) { target = stream->WriteBytesMaybeAliased( - 6, this->_internal_profilekey(), target); + 3, this->_internal_key(), target); } - // optional uint64 timestamp = 7; - if (cached_has_bits & 0x00000400u) { + // optional uint32 size = 4; + if (cached_has_bits & 0x00000100u) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray(7, this->_internal_timestamp(), target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_size(), 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); + // optional bytes thumbnail = 5; + if (cached_has_bits & 0x00000004u) { + target = stream->WriteBytesMaybeAliased( + 5, this->_internal_thumbnail(), target); } - // 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 bytes digest = 6; + if (cached_has_bits & 0x00000008u) { + target = stream->WriteBytesMaybeAliased( + 6, this->_internal_digest(), target); } - // optional .SessionProtos.DataMessage.Reaction reaction = 11; + // optional string fileName = 7; if (cached_has_bits & 0x00000010u) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(11, _Internal::reaction(this), - _Internal::reaction(this).GetCachedSize(), target, stream); + target = stream->WriteStringMaybeAliased( + 7, this->_internal_filename(), 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); + // optional uint32 flags = 8; + if (cached_has_bits & 0x00000200u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(8, this->_internal_flags(), target); } - // 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 uint32 width = 9; + if (cached_has_bits & 0x00000400u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(9, this->_internal_width(), target); } - // 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 uint32 height = 10; + if (cached_has_bits & 0x00000800u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(10, this->_internal_height(), target); } - // optional string syncTarget = 105; - if (cached_has_bits & 0x00000004u) { + // optional string caption = 11; + if (cached_has_bits & 0x00000020u) { target = stream->WriteStringMaybeAliased( - 105, this->_internal_synctarget(), target); + 11, this->_internal_caption(), target); } - // optional bool blocksCommunityMessageRequests = 106; - if (cached_has_bits & 0x00000800u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(106, this->_internal_blockscommunitymessagerequests(), 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.DataMessage) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.AttachmentPointer) return target; } -size_t DataMessage::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.DataMessage) +size_t AttachmentPointer::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.AttachmentPointer) size_t total_size = 0; - uint32_t cached_has_bits = 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; - // 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 & 0x0000007fu) { + // optional string contentType = 2; if (cached_has_bits & 0x00000001u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_body()); + this->_internal_contenttype()); } - // optional bytes profileKey = 6; + // optional bytes key = 3; if (cached_has_bits & 0x00000002u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_profilekey()); + this->_internal_key()); } - // optional string syncTarget = 105; + // optional bytes thumbnail = 5; if (cached_has_bits & 0x00000004u) { - total_size += 2 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_synctarget()); + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_thumbnail()); } - // optional .SessionProtos.DataMessage.Quote quote = 8; + // optional bytes digest = 6; if (cached_has_bits & 0x00000008u) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.quote_); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_digest()); } - // optional .SessionProtos.DataMessage.Reaction reaction = 11; + // optional string fileName = 7; if (cached_has_bits & 0x00000010u) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.reaction_); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_filename()); } - // optional .SessionProtos.LokiProfile profile = 101; + // optional string caption = 11; if (cached_has_bits & 0x00000020u) { - total_size += 2 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.profile_); + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_caption()); } - // optional .SessionProtos.DataMessage.OpenGroupInvitation openGroupInvitation = 102; + // optional string url = 101; if (cached_has_bits & 0x00000040u) { 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_); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_url()); } } if (cached_has_bits & 0x00000f00u) { - // optional uint32 flags = 4; + // optional uint32 size = 4; if (cached_has_bits & 0x00000100u) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_size()); } - // optional uint32 expireTimer = 5; + // optional uint32 flags = 8; if (cached_has_bits & 0x00000200u) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_expiretimer()); + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_flags()); } - // optional uint64 timestamp = 7; + // optional uint32 width = 9; if (cached_has_bits & 0x00000400u) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_timestamp()); + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_width()); } - // optional bool blocksCommunityMessageRequests = 106; + // optional uint32 height = 10; if (cached_has_bits & 0x00000800u) { - total_size += 2 + 1; + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_height()); } } @@ -7301,224 +7747,2423 @@ size_t DataMessage::ByteSizeLong() const { return total_size; } -void DataMessage::CheckTypeAndMergeFrom( +void AttachmentPointer::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 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; - _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()); + _this->_internal_set_contenttype(from._internal_contenttype()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_profilekey(from._internal_profilekey()); + _this->_internal_set_key(from._internal_key()); } if (cached_has_bits & 0x00000004u) { - _this->_internal_set_synctarget(from._internal_synctarget()); + _this->_internal_set_thumbnail(from._internal_thumbnail()); } if (cached_has_bits & 0x00000008u) { - _this->_internal_mutable_quote()->::SessionProtos::DataMessage_Quote::MergeFrom( - from._internal_quote()); + _this->_internal_set_digest(from._internal_digest()); } if (cached_has_bits & 0x00000010u) { - _this->_internal_mutable_reaction()->::SessionProtos::DataMessage_Reaction::MergeFrom( - from._internal_reaction()); + _this->_internal_set_filename(from._internal_filename()); } if (cached_has_bits & 0x00000020u) { - _this->_internal_mutable_profile()->::SessionProtos::LokiProfile::MergeFrom( - from._internal_profile()); + _this->_internal_set_caption(from._internal_caption()); } if (cached_has_bits & 0x00000040u) { - _this->_internal_mutable_opengroupinvitation()->::SessionProtos::DataMessage_OpenGroupInvitation::MergeFrom( - from._internal_opengroupinvitation()); + _this->_internal_set_url(from._internal_url()); } if (cached_has_bits & 0x00000080u) { - _this->_internal_mutable_closedgroupcontrolmessage()->::SessionProtos::DataMessage_ClosedGroupControlMessage::MergeFrom( - from._internal_closedgroupcontrolmessage()); + _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_.flags_ = from._impl_.flags_; + _this->_impl_.size_ = from._impl_.size_; } if (cached_has_bits & 0x00000200u) { - _this->_impl_.expiretimer_ = from._impl_.expiretimer_; + _this->_impl_.flags_ = from._impl_.flags_; } if (cached_has_bits & 0x00000400u) { - _this->_impl_.timestamp_ = from._impl_.timestamp_; + _this->_impl_.width_ = from._impl_.width_; } if (cached_has_bits & 0x00000800u) { - _this->_impl_.blockscommunitymessagerequests_ = from._impl_.blockscommunitymessagerequests_; + _this->_impl_.height_ = from._impl_.height_; } _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 AttachmentPointer::CopyFrom(const AttachmentPointer& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.AttachmentPointer) 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; +bool AttachmentPointer::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; + return true; +} + +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_.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_)); +} + +std::string AttachmentPointer::GetTypeName() const { + return "SessionProtos.AttachmentPointer"; +} + + +// =================================================================== + +class SharedConfigMessage::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_kind(HasBits* has_bits) { + (*has_bits)[0] |= 4u; } - if (_internal_has_reaction()) { - if (!_impl_.reaction_->IsInitialized()) return false; + static void set_has_seqno(HasBits* has_bits) { + (*has_bits)[0] |= 2u; } - if (_internal_has_opengroupinvitation()) { - if (!_impl_.opengroupinvitation_->IsInitialized()) return false; + static void set_has_data(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x00000007) ^ 0x00000007) != 0; } - if (_internal_has_closedgroupcontrolmessage()) { - if (!_impl_.closedgroupcontrolmessage_->IsInitialized()) return false; +}; + +SharedConfigMessage::SharedConfigMessage(::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.SharedConfigMessage) +} +SharedConfigMessage::SharedConfigMessage(const SharedConfigMessage& from) + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { + SharedConfigMessage* 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_){}}; + + _internal_metadata_.MergeFrom(from._internal_metadata_); + _impl_.data_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.data_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_data()) { + _this->_impl_.data_.Set(from._internal_data(), + _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) +} + +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_.data_){} + , decltype(_impl_.seqno_){int64_t{0}} + , decltype(_impl_.kind_){1} + }; + _impl_.data_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.data_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +SharedConfigMessage::~SharedConfigMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.SharedConfigMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void SharedConfigMessage::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.data_.Destroy(); +} + +void SharedConfigMessage::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +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 & 0x00000001u) { + _impl_.data_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000006u) { + _impl_.seqno_ = int64_t{0}; + _impl_.kind_ = 1; + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +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 .SessionProtos.SharedConfigMessage.Kind kind = 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()); + } + } else + goto handle_unusual; + continue; + // required int64 seqno = 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); + } 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 + 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* SharedConfigMessage::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@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 .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); + } + + // required bytes data = 3; + if (cached_has_bits & 0x00000001u) { + target = stream->WriteBytesMaybeAliased( + 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); + } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.SharedConfigMessage) + return target; +} + +size_t SharedConfigMessage::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.SharedConfigMessage) + 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()); + } + + if (_internal_has_seqno()) { + // required int64 seqno = 2; + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_seqno()); + } + + if (_internal_has_kind()) { + // required .SessionProtos.SharedConfigMessage.Kind kind = 1; + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); + } + + 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; + 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(); + } + 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 SharedConfigMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} + +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; + (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->_internal_metadata_.MergeFrom(from._internal_metadata_); +} + +void SharedConfigMessage::CopyFrom(const SharedConfigMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.SharedConfigMessage) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SharedConfigMessage::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; + return true; +} + +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_.data_, lhs_arena, + &other->_impl_.data_, rhs_arena + ); + swap(_impl_.seqno_, other->_impl_.seqno_); + swap(_impl_.kind_, other->_impl_.kind_); +} + +std::string SharedConfigMessage::GetTypeName() const { + return "SessionProtos.SharedConfigMessage"; +} + + +// =================================================================== + +class GroupUpdateMessage::_Internal { + public: + 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 const ::SessionProtos::GroupUpdateInfoChangeMessage& infochangemessage(const GroupUpdateMessage* msg); + static void set_has_infochangemessage(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static const ::SessionProtos::GroupUpdateMemberChangeMessage& memberchangemessage(const GroupUpdateMessage* msg); + static void set_has_memberchangemessage(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static const ::SessionProtos::GroupUpdatePromoteMessage& promotemessage(const GroupUpdateMessage* msg); + static void set_has_promotemessage(HasBits* has_bits) { + (*has_bits)[0] |= 8u; + } + 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::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_; +} +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) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdateMessage) +} +GroupUpdateMessage::GroupUpdateMessage(const GroupUpdateMessage& from) + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { + GroupUpdateMessage* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._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}}; + + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from._internal_has_invitemessage()) { + _this->_impl_.invitemessage_ = new ::SessionProtos::GroupUpdateInviteMessage(*from._impl_.invitemessage_); + } + if (from._internal_has_infochangemessage()) { + _this->_impl_.infochangemessage_ = new ::SessionProtos::GroupUpdateInfoChangeMessage(*from._impl_.infochangemessage_); + } + if (from._internal_has_memberchangemessage()) { + _this->_impl_.memberchangemessage_ = new ::SessionProtos::GroupUpdateMemberChangeMessage(*from._impl_.memberchangemessage_); + } + 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 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_.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} + }; +} + +GroupUpdateMessage::~GroupUpdateMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void GroupUpdateMessage::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + 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 GroupUpdateMessage::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +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; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x000000ffu) { + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(_impl_.invitemessage_ != nullptr); + _impl_.invitemessage_->Clear(); + } + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(_impl_.infochangemessage_ != nullptr); + _impl_.infochangemessage_->Clear(); + } + if (cached_has_bits & 0x00000004u) { + 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(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +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) { + // optional .SessionProtos.GroupUpdateInviteMessage inviteMessage = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_invitemessage(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.GroupUpdateInfoChangeMessage infoChangeMessage = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_infochangemessage(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.GroupUpdateMemberChangeMessage memberChangeMessage = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr = ctx->ParseMessage(_internal_mutable_memberchangemessage(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.GroupUpdatePromoteMessage promoteMessage = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr = ctx->ParseMessage(_internal_mutable_promotemessage(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.GroupUpdateMemberLeftMessage memberLeftMessage = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + ptr = ctx->ParseMessage(_internal_mutable_memberleftmessage(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.GroupUpdateInviteResponseMessage inviteResponse = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { + ptr = ctx->ParseMessage(_internal_mutable_inviteresponse(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.GroupUpdateDeleteMemberContentMessage deleteMemberContent = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { + ptr = ctx->ParseMessage(_internal_mutable_deletemembercontent(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .SessionProtos.GroupUpdateMemberLeftNotificationMessage memberLeftNotificationMessage = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { + ptr = ctx->ParseMessage(_internal_mutable_memberleftnotificationmessage(), 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* GroupUpdateMessage::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@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]; + // optional .SessionProtos.GroupUpdateInviteMessage inviteMessage = 1; + if (cached_has_bits & 0x00000001u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::invitemessage(this), + _Internal::invitemessage(this).GetCachedSize(), target, stream); + } + + // optional .SessionProtos.GroupUpdateInfoChangeMessage infoChangeMessage = 2; + if (cached_has_bits & 0x00000002u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::infochangemessage(this), + _Internal::infochangemessage(this).GetCachedSize(), target, stream); + } + + // optional .SessionProtos.GroupUpdateMemberChangeMessage memberChangeMessage = 3; + if (cached_has_bits & 0x00000004u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::memberchangemessage(this), + _Internal::memberchangemessage(this).GetCachedSize(), target, stream); + } + + // 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); + } + + // 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); + } + + // optional .SessionProtos.GroupUpdateInviteResponseMessage inviteResponse = 6; + if (cached_has_bits & 0x00000020u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(6, _Internal::inviteresponse(this), + _Internal::inviteresponse(this).GetCachedSize(), target, stream); + } + + // 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); + } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateMessage) + return target; +} + +size_t GroupUpdateMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.GroupUpdateMessage) + size_t total_size = 0; + + 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.GroupUpdateInviteMessage inviteMessage = 1; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.invitemessage_); + } + + // optional .SessionProtos.GroupUpdateInfoChangeMessage infoChangeMessage = 2; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.infochangemessage_); + } + + // optional .SessionProtos.GroupUpdateMemberChangeMessage memberChangeMessage = 3; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.memberchangemessage_); + } + + // optional .SessionProtos.GroupUpdatePromoteMessage promoteMessage = 4; + if (cached_has_bits & 0x00000008u) { + 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; +} + +void GroupUpdateMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} + +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; + (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_invitemessage()->::SessionProtos::GroupUpdateInviteMessage::MergeFrom( + from._internal_invitemessage()); + } + if (cached_has_bits & 0x00000002u) { + _this->_internal_mutable_infochangemessage()->::SessionProtos::GroupUpdateInfoChangeMessage::MergeFrom( + from._internal_infochangemessage()); + } + if (cached_has_bits & 0x00000004u) { + _this->_internal_mutable_memberchangemessage()->::SessionProtos::GroupUpdateMemberChangeMessage::MergeFrom( + from._internal_memberchangemessage()); + } + if (cached_has_bits & 0x00000008u) { + _this->_internal_mutable_promotemessage()->::SessionProtos::GroupUpdatePromoteMessage::MergeFrom( + from._internal_promotemessage()); + } + if (cached_has_bits & 0x00000010u) { + _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->_internal_metadata_.MergeFrom(from._internal_metadata_); +} + +void GroupUpdateMessage::CopyFrom(const GroupUpdateMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.GroupUpdateMessage) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +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 GroupUpdateMessage::InternalSwap(GroupUpdateMessage* 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(GroupUpdateMessage, _impl_.memberleftnotificationmessage_) + + sizeof(GroupUpdateMessage::_impl_.memberleftnotificationmessage_) + - PROTOBUF_FIELD_OFFSET(GroupUpdateMessage, _impl_.invitemessage_)>( + reinterpret_cast(&_impl_.invitemessage_), + reinterpret_cast(&other->_impl_.invitemessage_)); +} + +std::string GroupUpdateMessage::GetTypeName() const { + return "SessionProtos.GroupUpdateMessage"; +} + + +// =================================================================== + +class GroupUpdateInviteMessage::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_groupsessionid(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_name(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_memberauthdata(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static void set_has_adminsignature(HasBits* has_bits) { + (*has_bits)[0] |= 8u; + } + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x0000000f) ^ 0x0000000f) != 0; + } +}; + +GroupUpdateInviteMessage::GroupUpdateInviteMessage(::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.GroupUpdateInviteMessage) +} +GroupUpdateInviteMessage::GroupUpdateInviteMessage(const GroupUpdateInviteMessage& from) + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { + GroupUpdateInviteMessage* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.groupsessionid_){} + , decltype(_impl_.name_){} + , decltype(_impl_.memberauthdata_){} + , decltype(_impl_.adminsignature_){}}; + + _internal_metadata_.MergeFrom(from._internal_metadata_); + _impl_.groupsessionid_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.groupsessionid_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_groupsessionid()) { + _this->_impl_.groupsessionid_.Set(from._internal_groupsessionid(), + _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_.memberauthdata_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.memberauthdata_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_memberauthdata()) { + _this->_impl_.memberauthdata_.Set(from._internal_memberauthdata(), + _this->GetArenaForAllocation()); + } + _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()); + } + // @@protoc_insertion_point(copy_constructor:SessionProtos.GroupUpdateInviteMessage) +} + +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_.groupsessionid_){} + , decltype(_impl_.name_){} + , decltype(_impl_.memberauthdata_){} + , decltype(_impl_.adminsignature_){} + }; + _impl_.groupsessionid_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.groupsessionid_.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_.memberauthdata_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _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 +} + +GroupUpdateInviteMessage::~GroupUpdateInviteMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateInviteMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void GroupUpdateInviteMessage::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.groupsessionid_.Destroy(); + _impl_.name_.Destroy(); + _impl_.memberauthdata_.Destroy(); + _impl_.adminsignature_.Destroy(); +} + +void GroupUpdateInviteMessage::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +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; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x0000000fu) { + if (cached_has_bits & 0x00000001u) { + _impl_.groupsessionid_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000002u) { + _impl_.name_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000004u) { + _impl_.memberauthdata_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000008u) { + _impl_.adminsignature_.ClearNonDefaultToEmpty(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +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) { + // required string groupSessionId = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_groupsessionid(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // 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; + // 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; + // 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; + 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* GroupUpdateInviteMessage::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@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]; + // required string groupSessionId = 1; + if (cached_has_bits & 0x00000001u) { + target = stream->WriteStringMaybeAliased( + 1, this->_internal_groupsessionid(), target); + } + + // required string name = 2; + if (cached_has_bits & 0x00000002u) { + target = stream->WriteStringMaybeAliased( + 2, this->_internal_name(), target); + } + + // required bytes memberAuthData = 3; + if (cached_has_bits & 0x00000004u) { + target = stream->WriteBytesMaybeAliased( + 3, this->_internal_memberauthdata(), target); + } + + // required bytes adminSignature = 4; + if (cached_has_bits & 0x00000008u) { + 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); + } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateInviteMessage) + return target; +} + +size_t GroupUpdateInviteMessage::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.GroupUpdateInviteMessage) + size_t total_size = 0; + + if (_internal_has_groupsessionid()) { + // required string groupSessionId = 1; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_groupsessionid()); + } + + if (_internal_has_name()) { + // required string name = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); + } + + if (_internal_has_memberauthdata()) { + // required bytes memberAuthData = 3; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_memberauthdata()); + } + + if (_internal_has_adminsignature()) { + // required bytes adminSignature = 4; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_adminsignature()); + } + + return total_size; +} +size_t GroupUpdateInviteMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.GroupUpdateInviteMessage) + size_t total_size = 0; + + 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()); + + // required string name = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); + + // required bytes memberAuthData = 3; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_memberauthdata()); + + // required bytes adminSignature = 4; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_adminsignature()); + + } 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 GroupUpdateInviteMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} + +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; + (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_groupsessionid(from._internal_groupsessionid()); + } + if (cached_has_bits & 0x00000002u) { + _this->_internal_set_name(from._internal_name()); + } + if (cached_has_bits & 0x00000004u) { + _this->_internal_set_memberauthdata(from._internal_memberauthdata()); + } + if (cached_has_bits & 0x00000008u) { + _this->_internal_set_adminsignature(from._internal_adminsignature()); + } + } + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); +} + +void GroupUpdateInviteMessage::CopyFrom(const GroupUpdateInviteMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.GroupUpdateInviteMessage) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GroupUpdateInviteMessage::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; + return true; +} + +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]); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.groupsessionid_, lhs_arena, + &other->_impl_.groupsessionid_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.memberauthdata_, lhs_arena, + &other->_impl_.memberauthdata_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.adminsignature_, lhs_arena, + &other->_impl_.adminsignature_, rhs_arena + ); +} + +std::string GroupUpdateInviteMessage::GetTypeName() const { + return "SessionProtos.GroupUpdateInviteMessage"; +} + + +// =================================================================== + +class GroupUpdatePromoteMessage::_Internal { + public: + 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 bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0; + } +}; + +GroupUpdatePromoteMessage::GroupUpdatePromoteMessage(::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.GroupUpdatePromoteMessage) +} +GroupUpdatePromoteMessage::GroupUpdatePromoteMessage(const GroupUpdatePromoteMessage& from) + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { + GroupUpdatePromoteMessage* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.groupidentityseed_){} + , decltype(_impl_.name_){}}; + + _internal_metadata_.MergeFrom(from._internal_metadata_); + _impl_.groupidentityseed_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.groupidentityseed_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_groupidentityseed()) { + _this->_impl_.groupidentityseed_.Set(from._internal_groupidentityseed(), + _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()); + } + // @@protoc_insertion_point(copy_constructor:SessionProtos.GroupUpdatePromoteMessage) +} + +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_.groupidentityseed_){} + , decltype(_impl_.name_){} + }; + _impl_.groupidentityseed_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.groupidentityseed_.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 +} + +GroupUpdatePromoteMessage::~GroupUpdatePromoteMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdatePromoteMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void GroupUpdatePromoteMessage::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.groupidentityseed_.Destroy(); + _impl_.name_.Destroy(); +} + +void GroupUpdatePromoteMessage::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +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; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _impl_.groupidentityseed_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000002u) { + _impl_.name_.ClearNonDefaultToEmpty(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +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) { + // required bytes groupIdentitySeed = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_groupidentityseed(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // 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; + 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* GroupUpdatePromoteMessage::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@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]; + // required bytes groupIdentitySeed = 1; + if (cached_has_bits & 0x00000001u) { + target = stream->WriteBytesMaybeAliased( + 1, this->_internal_groupidentityseed(), target); + } + + // required string name = 2; + if (cached_has_bits & 0x00000002u) { + target = stream->WriteStringMaybeAliased( + 2, 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); + } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdatePromoteMessage) + return target; +} + +size_t GroupUpdatePromoteMessage::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.GroupUpdatePromoteMessage) + size_t total_size = 0; + + if (_internal_has_groupidentityseed()) { + // required bytes groupIdentitySeed = 1; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_groupidentityseed()); + } + + if (_internal_has_name()) { + // required string name = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); + } + + return total_size; +} +size_t GroupUpdatePromoteMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.GroupUpdatePromoteMessage) + size_t total_size = 0; + + 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()); + + // required string name = 2; + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); + + } 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 GroupUpdatePromoteMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} + +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; + (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_groupidentityseed(from._internal_groupidentityseed()); + } + if (cached_has_bits & 0x00000002u) { + _this->_internal_set_name(from._internal_name()); + } + } + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); +} + +void GroupUpdatePromoteMessage::CopyFrom(const GroupUpdatePromoteMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.GroupUpdatePromoteMessage) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GroupUpdatePromoteMessage::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; + return true; +} + +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]); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.groupidentityseed_, lhs_arena, + &other->_impl_.groupidentityseed_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena + ); +} + +std::string GroupUpdatePromoteMessage::GetTypeName() const { + return "SessionProtos.GroupUpdatePromoteMessage"; +} + + +// =================================================================== + +class GroupUpdateInfoChangeMessage::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_type(HasBits* has_bits) { + (*has_bits)[0] |= 8u; + } + static void set_has_updatedname(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_updatedexpiration(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static void set_has_adminsignature(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x0000000a) ^ 0x0000000a) != 0; + } +}; + +GroupUpdateInfoChangeMessage::GroupUpdateInfoChangeMessage(::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.GroupUpdateInfoChangeMessage) +} +GroupUpdateInfoChangeMessage::GroupUpdateInfoChangeMessage(const GroupUpdateInfoChangeMessage& from) + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { + GroupUpdateInfoChangeMessage* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.updatedname_){} + , decltype(_impl_.adminsignature_){} + , decltype(_impl_.updatedexpiration_){} + , decltype(_impl_.type_){}}; + + _internal_metadata_.MergeFrom(from._internal_metadata_); + _impl_.updatedname_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.updatedname_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_updatedname()) { + _this->_impl_.updatedname_.Set(from._internal_updatedname(), + _this->GetArenaForAllocation()); + } + _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_.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 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_.updatedname_){} + , decltype(_impl_.adminsignature_){} + , decltype(_impl_.updatedexpiration_){0u} + , decltype(_impl_.type_){1} + }; + _impl_.updatedname_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.updatedname_.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 +} + +GroupUpdateInfoChangeMessage::~GroupUpdateInfoChangeMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateInfoChangeMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void GroupUpdateInfoChangeMessage::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.updatedname_.Destroy(); + _impl_.adminsignature_.Destroy(); +} + +void GroupUpdateInfoChangeMessage::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +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 & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _impl_.updatedname_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000002u) { + _impl_.adminsignature_.ClearNonDefaultToEmpty(); + } + } + if (cached_has_bits & 0x0000000cu) { + _impl_.updatedexpiration_ = 0u; + _impl_.type_ = 1; + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +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 .SessionProtos.GroupUpdateInfoChangeMessage.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::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; + // optional string updatedName = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_updatedname(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional uint32 updatedExpiration = 3; + case 3: + 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; + // 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; + 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* GroupUpdateInfoChangeMessage::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@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 .SessionProtos.GroupUpdateInfoChangeMessage.Type type = 1; + if (cached_has_bits & 0x00000008u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this->_internal_type(), target); + } + + // optional string updatedName = 2; + if (cached_has_bits & 0x00000001u) { + target = stream->WriteStringMaybeAliased( + 2, this->_internal_updatedname(), target); + } + + // optional uint32 updatedExpiration = 3; + if (cached_has_bits & 0x00000004u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_updatedexpiration(), 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); + } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateInfoChangeMessage) + return target; +} + +size_t GroupUpdateInfoChangeMessage::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.GroupUpdateInfoChangeMessage) + 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 (_internal_has_type()) { + // required .SessionProtos.GroupUpdateInfoChangeMessage.Type type = 1; + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); + } + + return total_size; +} +size_t GroupUpdateInfoChangeMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.GroupUpdateInfoChangeMessage) + size_t total_size = 0; + + 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_adminsignature()); + + // required .SessionProtos.GroupUpdateInfoChangeMessage.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; + + // optional string updatedName = 2; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_updatedname()); + } + + // optional uint32 updatedExpiration = 3; + if (cached_has_bits & 0x00000004u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_updatedexpiration()); + } + + 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 GroupUpdateInfoChangeMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} + +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; + (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_updatedname(from._internal_updatedname()); + } + if (cached_has_bits & 0x00000002u) { + _this->_internal_set_adminsignature(from._internal_adminsignature()); + } + if (cached_has_bits & 0x00000004u) { + _this->_impl_.updatedexpiration_ = from._impl_.updatedexpiration_; + } + if (cached_has_bits & 0x00000008u) { + _this->_impl_.type_ = from._impl_.type_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + } + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); +} + +void GroupUpdateInfoChangeMessage::CopyFrom(const GroupUpdateInfoChangeMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.GroupUpdateInfoChangeMessage) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GroupUpdateInfoChangeMessage::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; + return true; +} + +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_.updatedname_, lhs_arena, + &other->_impl_.updatedname_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.adminsignature_, lhs_arena, + &other->_impl_.adminsignature_, rhs_arena + ); + swap(_impl_.updatedexpiration_, other->_impl_.updatedexpiration_); + swap(_impl_.type_, other->_impl_.type_); +} + +std::string GroupUpdateInfoChangeMessage::GetTypeName() const { + return "SessionProtos.GroupUpdateInfoChangeMessage"; +} + + +// =================================================================== + +class GroupUpdateMemberChangeMessage::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_type(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static void set_has_historyshared(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_adminsignature(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x00000005) ^ 0x00000005) != 0; + } +}; + +GroupUpdateMemberChangeMessage::GroupUpdateMemberChangeMessage(::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.GroupUpdateMemberChangeMessage) +} +GroupUpdateMemberChangeMessage::GroupUpdateMemberChangeMessage(const GroupUpdateMemberChangeMessage& from) + : ::PROTOBUF_NAMESPACE_ID::MessageLite() { + GroupUpdateMemberChangeMessage* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.membersessionids_){from._impl_.membersessionids_} + , decltype(_impl_.adminsignature_){} + , decltype(_impl_.historyshared_){} + , decltype(_impl_.type_){}}; + + _internal_metadata_.MergeFrom(from._internal_metadata_); + _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_.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 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_.membersessionids_){arena} + , decltype(_impl_.adminsignature_){} + , decltype(_impl_.historyshared_){false} + , decltype(_impl_.type_){1} + }; + _impl_.adminsignature_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.adminsignature_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +GroupUpdateMemberChangeMessage::~GroupUpdateMemberChangeMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateMemberChangeMessage) + if (auto *arena = _internal_metadata_.DeleteReturnArena()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void GroupUpdateMemberChangeMessage::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.membersessionids_.~RepeatedPtrField(); + _impl_.adminsignature_.Destroy(); +} + +void GroupUpdateMemberChangeMessage::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +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_.membersessionids_.Clear(); + cached_has_bits = _impl_._has_bits_[0]; + 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(); +} + +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) { + // required .SessionProtos.GroupUpdateMemberChangeMessage.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::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 memberSessionIds = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr -= 1; + do { + ptr += 1; + auto str = _internal_add_membersessionids(); + 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 bool historyShared = 3; + case 3: + 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; + // 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; + 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* GroupUpdateMemberChangeMessage::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.GroupUpdateMemberChangeMessage) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + 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 memberSessionIds = 2; + for (int i = 0, n = this->_internal_membersessionids_size(); i < n; i++) { + const auto& s = this->_internal_membersessionids(i); + target = stream->WriteString(2, s, target); + } + + // optional bool historyShared = 3; + if (cached_has_bits & 0x00000002u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_historyshared(), target); + } + + // required bytes adminSignature = 4; + if (cached_has_bits & 0x00000001u) { + 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); + } + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateMemberChangeMessage) + return target; +} + +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 (_internal_has_type()) { + // required .SessionProtos.GroupUpdateMemberChangeMessage.Type type = 1; + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); + } + + 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 string memberSessionIds = 2; + 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)); + } + + // optional bool historyShared = 3; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000002u) { + 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; +} + +void GroupUpdateMemberChangeMessage::CheckTypeAndMergeFrom( + const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { + MergeFrom(*::_pbi::DownCast( + &from)); +} + +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; + (void) cached_has_bits; + + _this->_impl_.membersessionids_.MergeFrom(from._impl_.membersessionids_); + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_adminsignature(from._internal_adminsignature()); + } + if (cached_has_bits & 0x00000002u) { + _this->_impl_.historyshared_ = from._impl_.historyshared_; + } + if (cached_has_bits & 0x00000004u) { + _this->_impl_.type_ = from._impl_.type_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + } + _this->_internal_metadata_.MergeFrom(from._internal_metadata_); +} + +void GroupUpdateMemberChangeMessage::CopyFrom(const GroupUpdateMemberChangeMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.GroupUpdateMemberChangeMessage) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GroupUpdateMemberChangeMessage::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; return true; } -void DataMessage::InternalSwap(DataMessage* 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_.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_.membersessionids_.InternalSwap(&other->_impl_.membersessionids_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.synctarget_, lhs_arena, - &other->_impl_.synctarget_, rhs_arena + &_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_)); + swap(_impl_.historyshared_, other->_impl_.historyshared_); + swap(_impl_.type_, other->_impl_.type_); } -std::string DataMessage::GetTypeName() const { - return "SessionProtos.DataMessage"; +std::string GroupUpdateMemberChangeMessage::GetTypeName() const { + return "SessionProtos.GroupUpdateMemberChangeMessage"; } // =================================================================== -class ConfigurationMessage_ClosedGroup::_Internal { +class GroupUpdateMemberLeftMessage::_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 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; - } }; -const ::SessionProtos::KeyPair& -ConfigurationMessage_ClosedGroup::_Internal::encryptionkeypair(const ConfigurationMessage_ClosedGroup* msg) { - return *msg->_impl_.encryptionkeypair_; -} -ConfigurationMessage_ClosedGroup::ConfigurationMessage_ClosedGroup(::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.ConfigurationMessage.ClosedGroup) + // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdateMemberLeftMessage) } -ConfigurationMessage_ClosedGroup::ConfigurationMessage_ClosedGroup(const ConfigurationMessage_ClosedGroup& from) +GroupUpdateMemberLeftMessage::GroupUpdateMemberLeftMessage(const GroupUpdateMemberLeftMessage& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - ConfigurationMessage_ClosedGroup* const _this = this; (void)_this; + GroupUpdateMemberLeftMessage* 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_._cached_size_)*/{}}; _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()); - } - 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.GroupUpdateMemberLeftMessage) } -inline void ConfigurationMessage_ClosedGroup::SharedCtor( +inline void GroupUpdateMemberLeftMessage::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_.name_){} - , decltype(_impl_.encryptionkeypair_){nullptr} - , decltype(_impl_.expirationtimer_){0u} + /*decltype(_impl_._cached_size_)*/{} }; - _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 } -ConfigurationMessage_ClosedGroup::~ConfigurationMessage_ClosedGroup() { - // @@protoc_insertion_point(destructor:SessionProtos.ConfigurationMessage.ClosedGroup) +GroupUpdateMemberLeftMessage::~GroupUpdateMemberLeftMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateMemberLeftMessage) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -7526,119 +10171,28 @@ ConfigurationMessage_ClosedGroup::~ConfigurationMessage_ClosedGroup() { SharedDtor(); } -inline void ConfigurationMessage_ClosedGroup::SharedDtor() { +inline void GroupUpdateMemberLeftMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.members_.~RepeatedPtrField(); - _impl_.admins_.~RepeatedPtrField(); - _impl_.publickey_.Destroy(); - _impl_.name_.Destroy(); - if (this != internal_default_instance()) delete _impl_.encryptionkeypair_; } -void ConfigurationMessage_ClosedGroup::SetCachedSize(int size) const { +void GroupUpdateMemberLeftMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void ConfigurationMessage_ClosedGroup::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.ConfigurationMessage.ClosedGroup) +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; - _impl_.members_.Clear(); - _impl_.admins_.Clear(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - if (cached_has_bits & 0x00000001u) { - _impl_.publickey_.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(); } -const char* ConfigurationMessage_ClosedGroup::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* GroupUpdateMemberLeftMessage::_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; - 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; - // optional 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); - } else - goto handle_unusual; - continue; - default: - goto handle_unusual; - } // switch - handle_unusual: if ((tag == 0) || ((tag & 7) == 4)) { CHK_(ptr); ctx->SetLastTag(tag); @@ -7651,7 +10205,6 @@ const char* ConfigurationMessage_ClosedGroup::_InternalParse(const char* ptr, :: CHK_(ptr != nullptr); } // while message_done: - _impl_._has_bits_.Or(has_bits); return ptr; failure: ptr = nullptr; @@ -7659,111 +10212,28 @@ const char* ConfigurationMessage_ClosedGroup::_InternalParse(const char* ptr, :: #undef CHK_ } -uint8_t* ConfigurationMessage_ClosedGroup::_InternalSerialize( +uint8_t* GroupUpdateMemberLeftMessage::_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.GroupUpdateMemberLeftMessage) uint32_t cached_has_bits = 0; (void) cached_has_bits; - cached_has_bits = _impl_._has_bits_[0]; - // optional bytes publicKey = 1; - if (cached_has_bits & 0x00000001u) { - target = stream->WriteBytesMaybeAliased( - 1, this->_internal_publickey(), target); - } - - // optional string name = 2; - if (cached_has_bits & 0x00000002u) { - 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); - } - - // 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.ClosedGroup) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateMemberLeftMessage) return target; } -size_t ConfigurationMessage_ClosedGroup::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ConfigurationMessage.ClosedGroup) +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; - // 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)); - } - - // 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)); - } - - 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(); } @@ -7772,209 +10242,76 @@ size_t ConfigurationMessage_ClosedGroup::ByteSizeLong() const { return total_size; } -void ConfigurationMessage_ClosedGroup::CheckTypeAndMergeFrom( +void GroupUpdateMemberLeftMessage::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 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->_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 & 0x00000001u) { - _this->_internal_set_publickey(from._internal_publickey()); - } - 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_); } -void ConfigurationMessage_ClosedGroup::CopyFrom(const ConfigurationMessage_ClosedGroup& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ConfigurationMessage.ClosedGroup) +void GroupUpdateMemberLeftMessage::CopyFrom(const GroupUpdateMemberLeftMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.GroupUpdateMemberLeftMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool ConfigurationMessage_ClosedGroup::IsInitialized() const { - if (_internal_has_encryptionkeypair()) { - if (!_impl_.encryptionkeypair_->IsInitialized()) return false; - } +bool GroupUpdateMemberLeftMessage::IsInitialized() const { return true; } -void ConfigurationMessage_ClosedGroup::InternalSwap(ConfigurationMessage_ClosedGroup* other) { +void GroupUpdateMemberLeftMessage::InternalSwap(GroupUpdateMemberLeftMessage* 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 - ); - ::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"; +std::string GroupUpdateMemberLeftMessage::GetTypeName() const { + return "SessionProtos.GroupUpdateMemberLeftMessage"; } // =================================================================== -class ConfigurationMessage_Contact::_Internal { +class GroupUpdateMemberLeftNotificationMessage::_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) { - (*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_Contact::ConfigurationMessage_Contact(::PROTOBUF_NAMESPACE_ID::Arena* arena, +GroupUpdateMemberLeftNotificationMessage::GroupUpdateMemberLeftNotificationMessage(::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) -} -ConfigurationMessage_Contact::ConfigurationMessage_Contact(const ConfigurationMessage_Contact& from) - : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - ConfigurationMessage_Contact* 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_){}}; + : ::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::MessageLite() { + GroupUpdateMemberLeftNotificationMessage* const _this = this; (void)_this; + new (&_impl_) Impl_{ + /*decltype(_impl_._cached_size_)*/{}}; _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(); - #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()); - } - ::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) + // @@protoc_insertion_point(copy_constructor:SessionProtos.GroupUpdateMemberLeftNotificationMessage) } -inline void ConfigurationMessage_Contact::SharedCtor( +inline void GroupUpdateMemberLeftNotificationMessage::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_._cached_size_)*/{} }; - _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(); - #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_Contact::~ConfigurationMessage_Contact() { - // @@protoc_insertion_point(destructor:SessionProtos.ConfigurationMessage.Contact) +GroupUpdateMemberLeftNotificationMessage::~GroupUpdateMemberLeftNotificationMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateMemberLeftNotificationMessage) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -7982,120 +10319,28 @@ ConfigurationMessage_Contact::~ConfigurationMessage_Contact() { SharedDtor(); } -inline void ConfigurationMessage_Contact::SharedDtor() { +inline void GroupUpdateMemberLeftNotificationMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.publickey_.Destroy(); - _impl_.name_.Destroy(); - _impl_.profilepicture_.Destroy(); - _impl_.profilekey_.Destroy(); } -void ConfigurationMessage_Contact::SetCachedSize(int size) const { +void GroupUpdateMemberLeftNotificationMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void ConfigurationMessage_Contact::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.ConfigurationMessage.Contact) +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; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { - if (cached_has_bits & 0x00000001u) { - _impl_.publickey_.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(); - } - } - ::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_Contact::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* GroupUpdateMemberLeftNotificationMessage::_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 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 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 - handle_unusual: if ((tag == 0) || ((tag & 7) == 4)) { CHK_(ptr); ctx->SetLastTag(tag); @@ -8108,7 +10353,6 @@ const char* ConfigurationMessage_Contact::_InternalParse(const char* ptr, ::_pbi CHK_(ptr != nullptr); } // while message_done: - _impl_._has_bits_.Or(has_bits); return ptr; failure: ptr = nullptr; @@ -8116,137 +10360,28 @@ const char* ConfigurationMessage_Contact::_InternalParse(const char* ptr, ::_pbi #undef CHK_ } -uint8_t* ConfigurationMessage_Contact::_InternalSerialize( +uint8_t* GroupUpdateMemberLeftNotificationMessage::_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.GroupUpdateMemberLeftNotificationMessage) 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 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( - 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.Contact) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateMemberLeftNotificationMessage) return target; } -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_publickey()) { - // required bytes publicKey = 1; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_publickey()); - } - - if (_internal_has_name()) { - // required string name = 2; - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); - } - - return total_size; -} -size_t ConfigurationMessage_Contact::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ConfigurationMessage.Contact) +size_t GroupUpdateMemberLeftNotificationMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.GroupUpdateMemberLeftNotificationMessage) 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(); - } 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) { - 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(); } @@ -8255,187 +10390,88 @@ size_t ConfigurationMessage_Contact::ByteSizeLong() const { return total_size; } -void ConfigurationMessage_Contact::CheckTypeAndMergeFrom( +void GroupUpdateMemberLeftNotificationMessage::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) - 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 & 0x00000001u) { - _this->_internal_set_publickey(from._internal_publickey()); - } - if (cached_has_bits & 0x00000002u) { - _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; - } + +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_); } -void ConfigurationMessage_Contact::CopyFrom(const ConfigurationMessage_Contact& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ConfigurationMessage.Contact) +void GroupUpdateMemberLeftNotificationMessage::CopyFrom(const GroupUpdateMemberLeftNotificationMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.GroupUpdateMemberLeftNotificationMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool ConfigurationMessage_Contact::IsInitialized() const { - if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; +bool GroupUpdateMemberLeftNotificationMessage::IsInitialized() const { return true; } -void ConfigurationMessage_Contact::InternalSwap(ConfigurationMessage_Contact* other) { +void GroupUpdateMemberLeftNotificationMessage::InternalSwap(GroupUpdateMemberLeftNotificationMessage* 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 - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_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_Contact::GetTypeName() const { - return "SessionProtos.ConfigurationMessage.Contact"; +std::string GroupUpdateMemberLeftNotificationMessage::GetTypeName() const { + return "SessionProtos.GroupUpdateMemberLeftNotificationMessage"; } // =================================================================== -class ConfigurationMessage::_Internal { +class GroupUpdateInviteResponseMessage::_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_isapproved(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 bool MissingRequiredFields(const HasBits& has_bits) { + return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0; } }; -ConfigurationMessage::ConfigurationMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, +GroupUpdateInviteResponseMessage::GroupUpdateInviteResponseMessage(::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.GroupUpdateInviteResponseMessage) } -ConfigurationMessage::ConfigurationMessage(const ConfigurationMessage& from) +GroupUpdateInviteResponseMessage::GroupUpdateInviteResponseMessage(const GroupUpdateInviteResponseMessage& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - ConfigurationMessage* const _this = this; (void)_this; + GroupUpdateInviteResponseMessage* 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_.isapproved_){}}; _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()); - } - // @@protoc_insertion_point(copy_constructor:SessionProtos.ConfigurationMessage) + _this->_impl_.isapproved_ = from._impl_.isapproved_; + // @@protoc_insertion_point(copy_constructor:SessionProtos.GroupUpdateInviteResponseMessage) } -inline void ConfigurationMessage::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_.closedgroups_){arena} - , decltype(_impl_.opengroups_){arena} - , decltype(_impl_.contacts_){arena} - , decltype(_impl_.displayname_){} - , decltype(_impl_.profilepicture_){} - , decltype(_impl_.profilekey_){} + , decltype(_impl_.isapproved_){false} }; - _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) +GroupUpdateInviteResponseMessage::~GroupUpdateInviteResponseMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateInviteResponseMessage) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -8443,119 +10479,41 @@ ConfigurationMessage::~ConfigurationMessage() { SharedDtor(); } -inline void ConfigurationMessage::SharedDtor() { +inline void GroupUpdateInviteResponseMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.closedgroups_.~RepeatedPtrField(); - _impl_.opengroups_.~RepeatedPtrField(); - _impl_.contacts_.~RepeatedPtrField(); - _impl_.displayname_.Destroy(); - _impl_.profilepicture_.Destroy(); - _impl_.profilekey_.Destroy(); } -void ConfigurationMessage::SetCachedSize(int size) const { +void GroupUpdateInviteResponseMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void ConfigurationMessage::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.ConfigurationMessage) +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_.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(); - } - if (cached_has_bits & 0x00000002u) { - _impl_.profilepicture_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000004u) { - _impl_.profilekey_.ClearNonDefaultToEmpty(); - } - } + _impl_.isapproved_ = false; _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* ConfigurationMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +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) { - // repeated .SessionProtos.ConfigurationMessage.ClosedGroup closedGroups = 1; + // required bool isApproved = 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); + 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; 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 +10538,39 @@ const char* ConfigurationMessage::_InternalParse(const char* ptr, ::_pbi::ParseC #undef CHK_ } -uint8_t* ConfigurationMessage::_InternalSerialize( +uint8_t* GroupUpdateInviteResponseMessage::_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.GroupUpdateInviteResponseMessage) 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; + // required bool isApproved = 1; 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); + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_isapproved(), 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.GroupUpdateInviteResponseMessage) return target; } -size_t ConfigurationMessage::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ConfigurationMessage) +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; - // 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 & 0x00000007u) { - // 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()); - } - - } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } @@ -8697,127 +10579,106 @@ size_t ConfigurationMessage::ByteSizeLong() const { return total_size; } -void ConfigurationMessage::CheckTypeAndMergeFrom( +void GroupUpdateInviteResponseMessage::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 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; (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 & 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 (from._internal_has_isapproved()) { + _this->_internal_set_isapproved(from._internal_isapproved()); } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void ConfigurationMessage::CopyFrom(const ConfigurationMessage& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ConfigurationMessage) +void GroupUpdateInviteResponseMessage::CopyFrom(const GroupUpdateInviteResponseMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.GroupUpdateInviteResponseMessage) 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; +bool GroupUpdateInviteResponseMessage::IsInitialized() const { + if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; return true; } -void ConfigurationMessage::InternalSwap(ConfigurationMessage* 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]); - _impl_.closedgroups_.InternalSwap(&other->_impl_.closedgroups_); - _impl_.opengroups_.InternalSwap(&other->_impl_.opengroups_); - _impl_.contacts_.InternalSwap(&other->_impl_.contacts_); - ::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 - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.profilekey_, lhs_arena, - &other->_impl_.profilekey_, rhs_arena - ); + swap(_impl_.isapproved_, other->_impl_.isapproved_); } -std::string ConfigurationMessage::GetTypeName() const { - return "SessionProtos.ConfigurationMessage"; +std::string GroupUpdateInviteResponseMessage::GetTypeName() const { + return "SessionProtos.GroupUpdateInviteResponseMessage"; } // =================================================================== -class ReceiptMessage::_Internal { +class GroupUpdateDeleteMemberContentMessage::_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 void set_has_adminsignature(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, +GroupUpdateDeleteMemberContentMessage::GroupUpdateDeleteMemberContentMessage(::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) + // @@protoc_insertion_point(arena_constructor:SessionProtos.GroupUpdateDeleteMemberContentMessage) } -ReceiptMessage::ReceiptMessage(const ReceiptMessage& from) +GroupUpdateDeleteMemberContentMessage::GroupUpdateDeleteMemberContentMessage(const GroupUpdateDeleteMemberContentMessage& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - ReceiptMessage* const _this = this; (void)_this; + GroupUpdateDeleteMemberContentMessage* 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_){}}; + , decltype(_impl_.membersessionids_){from._impl_.membersessionids_} + , decltype(_impl_.messagehashes_){from._impl_.messagehashes_} + , decltype(_impl_.adminsignature_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - _this->_impl_.type_ = from._impl_.type_; - // @@protoc_insertion_point(copy_constructor:SessionProtos.ReceiptMessage) + _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()); + } + // @@protoc_insertion_point(copy_constructor:SessionProtos.GroupUpdateDeleteMemberContentMessage) } -inline void ReceiptMessage::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_.timestamp_){arena} - , decltype(_impl_.type_){0} + , decltype(_impl_.membersessionids_){arena} + , decltype(_impl_.messagehashes_){arena} + , decltype(_impl_.adminsignature_){} }; + _impl_.adminsignature_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.adminsignature_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -ReceiptMessage::~ReceiptMessage() { - // @@protoc_insertion_point(destructor:SessionProtos.ReceiptMessage) +GroupUpdateDeleteMemberContentMessage::~GroupUpdateDeleteMemberContentMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.GroupUpdateDeleteMemberContentMessage) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -8825,59 +10686,73 @@ ReceiptMessage::~ReceiptMessage() { SharedDtor(); } -inline void ReceiptMessage::SharedDtor() { +inline void GroupUpdateDeleteMemberContentMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.timestamp_.~RepeatedField(); + _impl_.membersessionids_.~RepeatedPtrField(); + _impl_.messagehashes_.~RepeatedPtrField(); + _impl_.adminsignature_.Destroy(); } -void ReceiptMessage::SetCachedSize(int size) const { +void GroupUpdateDeleteMemberContentMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void ReceiptMessage::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.ReceiptMessage) +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_.timestamp_.Clear(); - _impl_.type_ = 0; + _impl_.membersessionids_.Clear(); + _impl_.messagehashes_.Clear(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _impl_.adminsignature_.ClearNonDefaultToEmpty(); + } _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* ReceiptMessage::_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.ReceiptMessage.Type type = 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::ReceiptMessage_Type_IsValid(val))) { - _internal_set_type(static_cast<::SessionProtos::ReceiptMessage_Type>(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); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); } else goto handle_unusual; continue; - // repeated uint64 timestamp = 2; + // repeated string messageHashes = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { ptr -= 1; do { ptr += 1; - _internal_add_timestamp(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr)); + auto str = _internal_add_messagehashes(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); 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); + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); + } else + goto handle_unusual; + continue; + // optional bytes adminSignature = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + auto str = _internal_mutable_adminsignature(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; @@ -8906,54 +10781,69 @@ const char* ReceiptMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext #undef CHK_ } -uint8_t* ReceiptMessage::_InternalSerialize( +uint8_t* GroupUpdateDeleteMemberContentMessage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:SessionProtos.ReceiptMessage) + // @@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.ReceiptMessage.Type type = 1; - if (cached_has_bits & 0x00000001u) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 1, this->_internal_type(), target); + // repeated string memberSessionIds = 1; + for (int i = 0, n = this->_internal_membersessionids_size(); i < n; i++) { + const auto& s = this->_internal_membersessionids(i); + target = stream->WriteString(1, s, 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); + // repeated string messageHashes = 2; + for (int i = 0, n = this->_internal_messagehashes_size(); i < n; i++) { + const auto& s = this->_internal_messagehashes(i); + target = stream->WriteString(2, s, target); + } + + cached_has_bits = _impl_._has_bits_[0]; + // optional bytes adminSignature = 3; + if (cached_has_bits & 0x00000001u) { + target = stream->WriteBytesMaybeAliased( + 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); } - // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ReceiptMessage) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.GroupUpdateDeleteMemberContentMessage) return target; } -size_t ReceiptMessage::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ReceiptMessage) +size_t GroupUpdateDeleteMemberContentMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.GroupUpdateDeleteMemberContentMessage) size_t total_size = 0; - // 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; + // 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)); + } + + // 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)); + } + + // 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_adminsignature()); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -8964,237 +10854,157 @@ size_t ReceiptMessage::ByteSizeLong() const { return total_size; } -void ReceiptMessage::CheckTypeAndMergeFrom( +void GroupUpdateDeleteMemberContentMessage::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void ReceiptMessage::MergeFrom(const ReceiptMessage& from) { - ReceiptMessage* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.ReceiptMessage) +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; (void) cached_has_bits; - _this->_impl_.timestamp_.MergeFrom(from._impl_.timestamp_); - if (from._internal_has_type()) { - _this->_internal_set_type(from._internal_type()); + _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_); } -void ReceiptMessage::CopyFrom(const ReceiptMessage& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ReceiptMessage) +void GroupUpdateDeleteMemberContentMessage::CopyFrom(const GroupUpdateDeleteMemberContentMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.GroupUpdateDeleteMemberContentMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool ReceiptMessage::IsInitialized() const { - if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; +bool GroupUpdateDeleteMemberContentMessage::IsInitialized() const { return true; } -void ReceiptMessage::InternalSwap(ReceiptMessage* 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_.timestamp_.InternalSwap(&other->_impl_.timestamp_); - swap(_impl_.type_, other->_impl_.type_); + _impl_.membersessionids_.InternalSwap(&other->_impl_.membersessionids_); + _impl_.messagehashes_.InternalSwap(&other->_impl_.messagehashes_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.adminsignature_, lhs_arena, + &other->_impl_.adminsignature_, rhs_arena + ); } -std::string ReceiptMessage::GetTypeName() const { - return "SessionProtos.ReceiptMessage"; +std::string GroupUpdateDeleteMemberContentMessage::GetTypeName() const { + return "SessionProtos.GroupUpdateDeleteMemberContentMessage"; } // =================================================================== -class AttachmentPointer::_Internal { +class ProProof::_Internal { public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static void set_has_id(HasBits* has_bits) { - (*has_bits)[0] |= 128u; + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_version(HasBits* has_bits) { + (*has_bits)[0] |= 16u; } - static void set_has_contenttype(HasBits* has_bits) { + static void set_has_genindexhash(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static void set_has_key(HasBits* has_bits) { + static void set_has_rotatingpublickey(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) { + static void set_has_expiryunixts(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; + static void set_has_sig(HasBits* has_bits) { + (*has_bits)[0] |= 4u; } }; -AttachmentPointer::AttachmentPointer(::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.AttachmentPointer) + // @@protoc_insertion_point(arena_constructor:SessionProtos.ProProof) } -AttachmentPointer::AttachmentPointer(const AttachmentPointer& from) +ProProof::ProProof(const ProProof& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - AttachmentPointer* 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_.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_.genindexhash_){} + , decltype(_impl_.rotatingpublickey_){} + , decltype(_impl_.sig_){} + , decltype(_impl_.expiryunixts_){} + , decltype(_impl_.version_){}}; _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(); + _impl_.genindexhash_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.caption_.Set("", GetArenaForAllocation()); + _impl_.genindexhash_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_caption()) { - _this->_impl_.caption_.Set(from._internal_caption(), + if (from._internal_has_genindexhash()) { + _this->_impl_.genindexhash_.Set(from._internal_genindexhash(), _this->GetArenaForAllocation()); } - _impl_.url_.InitDefault(); + _impl_.rotatingpublickey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.url_.Set("", GetArenaForAllocation()); + _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_url()) { - _this->_impl_.url_.Set(from._internal_url(), + if (from._internal_has_rotatingpublickey()) { + _this->_impl_.rotatingpublickey_.Set(from._internal_rotatingpublickey(), _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 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_.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(); + _impl_.sig_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.digest_.Set("", GetArenaForAllocation()); + _impl_.sig_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.filename_.InitDefault(); + 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) +} + +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_.filename_.Set("", GetArenaForAllocation()); + _impl_.genindexhash_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.caption_.InitDefault(); + _impl_.rotatingpublickey_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.caption_.Set("", GetArenaForAllocation()); + _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.url_.InitDefault(); + _impl_.sig_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.url_.Set("", GetArenaForAllocation()); + _impl_.sig_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -AttachmentPointer::~AttachmentPointer() { - // @@protoc_insertion_point(destructor:SessionProtos.AttachmentPointer) +ProProof::~ProProof() { + // @@protoc_insertion_point(destructor:SessionProtos.ProProof) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -9202,171 +11012,91 @@ AttachmentPointer::~AttachmentPointer() { SharedDtor(); } -inline void AttachmentPointer::SharedDtor() { +inline void ProProof::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_.genindexhash_.Destroy(); + _impl_.rotatingpublickey_.Destroy(); + _impl_.sig_.Destroy(); } -void AttachmentPointer::SetCachedSize(int size) const { +void ProProof::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void AttachmentPointer::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.AttachmentPointer) +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 & 0x0000007fu) { + if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x00000001u) { - _impl_.contenttype_.ClearNonDefaultToEmpty(); + _impl_.genindexhash_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - _impl_.key_.ClearNonDefaultToEmpty(); + _impl_.rotatingpublickey_.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_.sig_.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_)); + 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* AttachmentPointer::_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) { - // required fixed64 id = 1; + // optional uint32 version = 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); + 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 string contentType = 2; + // optional bytes genIndexHash = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_contenttype(); + auto str = _internal_mutable_genindexhash(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional bytes key = 3; + // optional bytes rotatingPublicKey = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_key(); + auto str = _internal_mutable_rotatingpublickey(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else goto handle_unusual; continue; - // optional uint32 size = 4; + // optional uint64 expiryUnixTs = 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); + _Internal::set_has_expiryunixts(&has_bits); + _impl_.expiryunixts_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else goto handle_unusual; continue; - // optional bytes thumbnail = 5; + // optional bytes sig = 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(); + auto str = _internal_mutable_sig(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); } else @@ -9396,176 +11126,90 @@ const char* AttachmentPointer::_InternalParse(const char* ptr, ::_pbi::ParseCont #undef CHK_ } -uint8_t* AttachmentPointer::_InternalSerialize( +uint8_t* ProProof::_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.ProProof) 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) { + // optional uint32 version = 1; + if (cached_has_bits & 0x00000010u) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteFixed64ToArray(1, this->_internal_id(), target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_version(), target); } - // optional string contentType = 2; + // optional bytes genIndexHash = 2; if (cached_has_bits & 0x00000001u) { - target = stream->WriteStringMaybeAliased( - 2, this->_internal_contenttype(), target); + target = stream->WriteBytesMaybeAliased( + 2, this->_internal_genindexhash(), target); } - // optional bytes key = 3; + // optional bytes rotatingPublicKey = 3; if (cached_has_bits & 0x00000002u) { target = stream->WriteBytesMaybeAliased( - 3, this->_internal_key(), target); + 3, this->_internal_rotatingpublickey(), target); } - // optional uint32 size = 4; - if (cached_has_bits & 0x00000100u) { + // optional uint64 expiryUnixTs = 4; + if (cached_has_bits & 0x00000008u) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_size(), target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_expiryunixts(), target); } - // optional bytes thumbnail = 5; + // optional bytes sig = 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); + 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.AttachmentPointer) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ProProof) return target; } -size_t AttachmentPointer::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.AttachmentPointer) +size_t ProProof::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ProProof) 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 & 0x0000001fu) { + // optional bytes genIndexHash = 2; if (cached_has_bits & 0x00000001u) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_contenttype()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_genindexhash()); } - // optional bytes key = 3; + // optional bytes rotatingPublicKey = 3; if (cached_has_bits & 0x00000002u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_key()); + this->_internal_rotatingpublickey()); } - // optional bytes thumbnail = 5; + // optional bytes sig = 5; if (cached_has_bits & 0x00000004u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_thumbnail()); + this->_internal_sig()); } - // optional bytes digest = 6; + // optional uint64 expiryUnixTs = 4; if (cached_has_bits & 0x00000008u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_digest()); + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_expiryunixts()); } - // optional string fileName = 7; + // optional uint32 version = 1; 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()); + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_version()); } } @@ -9577,193 +11221,138 @@ size_t AttachmentPointer::ByteSizeLong() const { return total_size; } -void AttachmentPointer::CheckTypeAndMergeFrom( +void ProProof::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void AttachmentPointer::MergeFrom(const AttachmentPointer& from) { - AttachmentPointer* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.AttachmentPointer) +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; (void) cached_has_bits; cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x000000ffu) { + if (cached_has_bits & 0x0000001fu) { if (cached_has_bits & 0x00000001u) { - _this->_internal_set_contenttype(from._internal_contenttype()); + _this->_internal_set_genindexhash(from._internal_genindexhash()); } if (cached_has_bits & 0x00000002u) { - _this->_internal_set_key(from._internal_key()); + _this->_internal_set_rotatingpublickey(from._internal_rotatingpublickey()); } if (cached_has_bits & 0x00000004u) { - _this->_internal_set_thumbnail(from._internal_thumbnail()); + _this->_internal_set_sig(from._internal_sig()); } if (cached_has_bits & 0x00000008u) { - _this->_internal_set_digest(from._internal_digest()); + _this->_impl_.expiryunixts_ = from._impl_.expiryunixts_; } 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_.version_ = from._impl_.version_; } _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void AttachmentPointer::CopyFrom(const AttachmentPointer& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.AttachmentPointer) +void ProProof::CopyFrom(const ProProof& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ProProof) if (&from == this) return; Clear(); MergeFrom(from); } -bool AttachmentPointer::IsInitialized() const { - if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; +bool ProProof::IsInitialized() const { return true; } -void AttachmentPointer::InternalSwap(AttachmentPointer* 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_.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 + &_impl_.genindexhash_, lhs_arena, + &other->_impl_.genindexhash_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.caption_, lhs_arena, - &other->_impl_.caption_, rhs_arena + &_impl_.rotatingpublickey_, lhs_arena, + &other->_impl_.rotatingpublickey_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.url_, lhs_arena, - &other->_impl_.url_, rhs_arena + &_impl_.sig_, lhs_arena, + &other->_impl_.sig_, 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_)); + 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 AttachmentPointer::GetTypeName() const { - return "SessionProtos.AttachmentPointer"; +std::string ProProof::GetTypeName() const { + return "SessionProtos.ProProof"; } // =================================================================== -class SharedConfigMessage::_Internal { +class ProMessage::_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 const ::SessionProtos::ProProof& proof(const ProMessage* msg); + static void set_has_proof(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static bool MissingRequiredFields(const HasBits& has_bits) { - return ((has_bits[0] & 0x00000007) ^ 0x00000007) != 0; + static void set_has_features(HasBits* has_bits) { + (*has_bits)[0] |= 2u; } }; -SharedConfigMessage::SharedConfigMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, +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::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:SessionProtos.SharedConfigMessage) + // @@protoc_insertion_point(arena_constructor:SessionProtos.ProMessage) } -SharedConfigMessage::SharedConfigMessage(const SharedConfigMessage& from) +ProMessage::ProMessage(const ProMessage& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { - SharedConfigMessage* const _this = this; (void)_this; + ProMessage* 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_.proof_){nullptr} + , decltype(_impl_.features_){}}; _internal_metadata_.MergeFrom(from._internal_metadata_); - _impl_.data_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.data_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_data()) { - _this->_impl_.data_.Set(from._internal_data(), - _this->GetArenaForAllocation()); + if (from._internal_has_proof()) { + _this->_impl_.proof_ = new ::SessionProtos::ProProof(*from._impl_.proof_); } - ::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) + _this->_impl_.features_ = from._impl_.features_; + // @@protoc_insertion_point(copy_constructor:SessionProtos.ProMessage) } -inline void SharedConfigMessage::SharedCtor( +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_.data_){} - , decltype(_impl_.seqno_){int64_t{0}} - , decltype(_impl_.kind_){1} + , decltype(_impl_.proof_){nullptr} + , decltype(_impl_.features_){uint64_t{0u}} }; - _impl_.data_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.data_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } -SharedConfigMessage::~SharedConfigMessage() { - // @@protoc_insertion_point(destructor:SessionProtos.SharedConfigMessage) +ProMessage::~ProMessage() { + // @@protoc_insertion_point(destructor:SessionProtos.ProMessage) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; @@ -9771,67 +11360,51 @@ SharedConfigMessage::~SharedConfigMessage() { SharedDtor(); } -inline void SharedConfigMessage::SharedDtor() { +inline void ProMessage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.data_.Destroy(); + if (this != internal_default_instance()) delete _impl_.proof_; } -void SharedConfigMessage::SetCachedSize(int size) const { +void ProMessage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void SharedConfigMessage::Clear() { -// @@protoc_insertion_point(message_clear_start:SessionProtos.SharedConfigMessage) +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) { - _impl_.data_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000006u) { - _impl_.seqno_ = int64_t{0}; - _impl_.kind_ = 1; + GOOGLE_DCHECK(_impl_.proof_ != nullptr); + _impl_.proof_->Clear(); } + _impl_.features_ = uint64_t{0u}; _impl_._has_bits_.Clear(); _internal_metadata_.Clear(); } -const char* SharedConfigMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +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.SharedConfigMessage.Kind kind = 1; + // optional .SessionProtos.ProProof proof = 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_proof(), 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 int64 seqno = 2; + // optional uint64 features = 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); - } 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); + _Internal::set_has_features(&has_bits); + _impl_.features_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); } else goto handle_unusual; @@ -9860,88 +11433,57 @@ const char* SharedConfigMessage::_InternalParse(const char* ptr, ::_pbi::ParseCo #undef CHK_ } -uint8_t* SharedConfigMessage::_InternalSerialize( +uint8_t* ProMessage::_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.ProMessage) 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); + // 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 int64 seqno = 2; + // optional uint64 features = 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( - 3, this->_internal_data(), target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_features(), 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.SharedConfigMessage) + // @@protoc_insertion_point(serialize_to_array_end:SessionProtos.ProMessage) return target; } -size_t SharedConfigMessage::RequiredFieldsByteSizeFallback() const { -// @@protoc_insertion_point(required_fields_byte_size_fallback_start:SessionProtos.SharedConfigMessage) - 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()); - } - - if (_internal_has_seqno()) { - // required int64 seqno = 2; - total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_seqno()); - } - - if (_internal_has_kind()) { - // required .SessionProtos.SharedConfigMessage.Kind kind = 1; - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_kind()); - } - - return total_size; -} -size_t SharedConfigMessage::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:SessionProtos.SharedConfigMessage) +size_t ProMessage::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:SessionProtos.ProMessage) size_t total_size = 0; - 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_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(); - } 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 uint64 features = 2; + if (cached_has_bits & 0x00000002u) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_features()); + } + + } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } @@ -9950,63 +11492,58 @@ size_t SharedConfigMessage::ByteSizeLong() const { return total_size; } -void SharedConfigMessage::CheckTypeAndMergeFrom( +void ProMessage::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { - MergeFrom(*::_pbi::DownCast( + MergeFrom(*::_pbi::DownCast( &from)); } -void SharedConfigMessage::MergeFrom(const SharedConfigMessage& from) { - SharedConfigMessage* const _this = this; - // @@protoc_insertion_point(class_specific_merge_from_start:SessionProtos.SharedConfigMessage) +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; (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_data(from._internal_data()); + _this->_internal_mutable_proof()->::SessionProtos::ProProof::MergeFrom( + from._internal_proof()); } if (cached_has_bits & 0x00000002u) { - _this->_impl_.seqno_ = from._impl_.seqno_; - } - if (cached_has_bits & 0x00000004u) { - _this->_impl_.kind_ = from._impl_.kind_; + _this->_impl_.features_ = from._impl_.features_; } _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } -void SharedConfigMessage::CopyFrom(const SharedConfigMessage& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.SharedConfigMessage) +void ProMessage::CopyFrom(const ProMessage& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:SessionProtos.ProMessage) if (&from == this) return; Clear(); MergeFrom(from); } -bool SharedConfigMessage::IsInitialized() const { - if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; +bool ProMessage::IsInitialized() const { return true; } -void SharedConfigMessage::InternalSwap(SharedConfigMessage* other) { +void ProMessage::InternalSwap(ProMessage* 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_.data_, lhs_arena, - &other->_impl_.data_, rhs_arena - ); - swap(_impl_.seqno_, other->_impl_.seqno_); - swap(_impl_.kind_, other->_impl_.kind_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + 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_)); } -std::string SharedConfigMessage::GetTypeName() const { - return "SessionProtos.SharedConfigMessage"; +std::string ProMessage::GetTypeName() const { + return "SessionProtos.ProMessage"; } @@ -10069,30 +11606,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); @@ -10105,6 +11622,50 @@ 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); +} +template<> PROTOBUF_NOINLINE ::SessionProtos::ProProof* +Arena::CreateMaybeMessage< ::SessionProtos::ProProof >(Arena* arena) { + return Arena::CreateMessageInternal< ::SessionProtos::ProProof >(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 e75a5652..43259bae 100644 --- a/proto/SessionProtos.pb.h +++ b/proto/SessionProtos.pb.h @@ -49,15 +49,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 +58,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 +76,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,6 +112,12 @@ extern LokiProfileDefaultTypeInternal _LokiProfile_default_instance_; class MessageRequestResponse; struct MessageRequestResponseDefaultTypeInternal; extern MessageRequestResponseDefaultTypeInternal _MessageRequestResponse_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_; @@ -116,23 +134,29 @@ 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::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*); @@ -178,6 +202,26 @@ inline const std::string& TypingMessage_Action_Name(T 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, + 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 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 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, @@ -257,30 +301,6 @@ inline const std::string& DataMessage_Reaction_Action_Name(T 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)); -} -bool DataMessage_ClosedGroupControlMessage_Type_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataMessage_ClosedGroupControlMessage_Type* value); enum DataMessage_Flags : int { DataMessage_Flags_EXPIRATION_TIMER_UPDATE = 2 }; @@ -357,6 +377,46 @@ inline const std::string& SharedConfigMessage_Kind_Name(T 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, + 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 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 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, + 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 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 GroupUpdateMemberChangeMessage_Type_Name(static_cast(enum_t_value)); +} +bool GroupUpdateMemberChangeMessage_Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, GroupUpdateMemberChangeMessage_Type* value); // =================================================================== class Envelope final : @@ -497,6 +557,7 @@ class Envelope final : enum : int { kSourceFieldNumber = 2, kContentFieldNumber = 8, + kProSigFieldNumber = 11, kTimestampFieldNumber = 5, kServerTimestampFieldNumber = 10, kSourceDeviceFieldNumber = 7, @@ -538,6 +599,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: @@ -605,6 +684,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_; @@ -1255,6 +1335,34 @@ class Content 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; + 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 { @@ -1262,11 +1370,14 @@ class Content final : kCallMessageFieldNumber = 3, kReceiptMessageFieldNumber = 5, kTypingMessageFieldNumber = 6, - kConfigurationMessageFieldNumber = 7, kDataExtractionNotificationFieldNumber = 8, kUnsendRequestFieldNumber = 9, kMessageRequestResponseFieldNumber = 10, kSharedConfigMessageFieldNumber = 11, + kProMessageFieldNumber = 16, + kExpirationTypeFieldNumber = 12, + kExpirationTimerFieldNumber = 13, + kSigTimestampFieldNumber = 15, }; // optional .SessionProtos.DataMessage dataMessage = 1; bool has_datamessage() const; @@ -1340,24 +1451,6 @@ class Content final : ::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: @@ -1430,6 +1523,63 @@ 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: + bool _internal_has_expirationtype() const; + public: + void clear_expirationtype(); + ::SessionProtos::Content_ExpirationType expirationtype() const; + void set_expirationtype(::SessionProtos::Content_ExpirationType value); + private: + ::SessionProtos::Content_ExpirationType _internal_expirationtype() const; + void _internal_set_expirationtype(::SessionProtos::Content_ExpirationType value); + public: + + // optional uint32 expirationTimer = 13; + 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: + + // optional uint64 sigTimestamp = 15; + bool has_sigtimestamp() const; + private: + bool _internal_has_sigtimestamp() const; + public: + void clear_sigtimestamp(); + uint64_t sigtimestamp() const; + void set_sigtimestamp(uint64_t value); + private: + uint64_t _internal_sigtimestamp() const; + void _internal_set_sigtimestamp(uint64_t value); + public: + // @@protoc_insertion_point(class_scope:SessionProtos.Content) private: class _Internal; @@ -1444,11 +1594,14 @@ class Content final : ::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::ProMessage* promessage_; + int expirationtype_; + uint32_t expirationtimer_; + uint64_t sigtimestamp_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; @@ -3266,24 +3419,24 @@ class DataMessage_OpenGroupInvitation final : }; // ------------------------------------------------------------------- -class DataMessage_ClosedGroupControlMessage_KeyPairWrapper final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) */ { +class DataMessage final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage) */ { 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() : DataMessage(nullptr) {} + ~DataMessage() override; + explicit PROTOBUF_CONSTEXPR DataMessage(::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(const DataMessage& from); + DataMessage(DataMessage&& from) noexcept + : DataMessage() { *this = ::std::move(from); } - inline DataMessage_ClosedGroupControlMessage_KeyPairWrapper& operator=(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from) { + inline DataMessage& operator=(const DataMessage& from) { CopyFrom(from); return *this; } - inline DataMessage_ClosedGroupControlMessage_KeyPairWrapper& operator=(DataMessage_ClosedGroupControlMessage_KeyPairWrapper&& from) noexcept { + inline DataMessage& operator=(DataMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -3304,20 +3457,20 @@ class DataMessage_ClosedGroupControlMessage_KeyPairWrapper final : return _internal_metadata_.mutable_unknown_fields(); } - static const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& default_instance() { + static const DataMessage& 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* internal_default_instance() { + return reinterpret_cast( + &_DataMessage_default_instance_); } static constexpr int kIndexInFileMessages = 14; - friend void swap(DataMessage_ClosedGroupControlMessage_KeyPairWrapper& a, DataMessage_ClosedGroupControlMessage_KeyPairWrapper& b) { + friend void swap(DataMessage& a, DataMessage& b) { a.Swap(&b); } - inline void Swap(DataMessage_ClosedGroupControlMessage_KeyPairWrapper* other) { + inline void Swap(DataMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -3330,7 +3483,7 @@ class DataMessage_ClosedGroupControlMessage_KeyPairWrapper final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataMessage_ClosedGroupControlMessage_KeyPairWrapper* other) { + void UnsafeArenaSwap(DataMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -3338,12 +3491,12 @@ class DataMessage_ClosedGroupControlMessage_KeyPairWrapper final : // implements Message ---------------------------------------------- - DataMessage_ClosedGroupControlMessage_KeyPairWrapper* 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_ClosedGroupControlMessage_KeyPairWrapper& from); - void MergeFrom(const DataMessage_ClosedGroupControlMessage_KeyPairWrapper& from); + void CopyFrom(const DataMessage& from); + void MergeFrom(const DataMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3357,15 +3510,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* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper"; + return "SessionProtos.DataMessage"; } protected: - explicit DataMessage_ClosedGroupControlMessage_KeyPairWrapper(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit DataMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -3373,87 +3526,318 @@ class DataMessage_ClosedGroupControlMessage_KeyPairWrapper 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; + 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 { - kPublicKeyFieldNumber = 1, - kEncryptedKeyPairFieldNumber = 2, + 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 bytes publicKey = 1; - bool has_publickey() const; + // repeated .SessionProtos.AttachmentPointer attachments = 2; + int attachments_size() const; private: - bool _internal_has_publickey() const; + int _internal_attachments_size() 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_attachments(); + ::SessionProtos::AttachmentPointer* mutable_attachments(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer >* + mutable_attachments(); 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::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 encryptedKeyPair = 2; - bool has_encryptedkeypair() const; + // repeated .SessionProtos.DataMessage.Preview preview = 10; + int preview_size() const; private: - bool _internal_has_encryptedkeypair() const; + int _internal_preview_size() 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_preview(); + ::SessionProtos::DataMessage_Preview* mutable_preview(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview >* + mutable_preview(); 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 ::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; - // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper) - private: - class _Internal; + // 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: - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; + // optional bytes profileKey = 6; + 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: - 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_; - }; - 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_ClosedGroupControlMessage final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage.ClosedGroupControlMessage) */ { - public: - inline DataMessage_ClosedGroupControlMessage() : DataMessage_ClosedGroupControlMessage(nullptr) {} - ~DataMessage_ClosedGroupControlMessage() override; - explicit PROTOBUF_CONSTEXPR DataMessage_ClosedGroupControlMessage(::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_ClosedGroupControlMessage(const DataMessage_ClosedGroupControlMessage& from); - DataMessage_ClosedGroupControlMessage(DataMessage_ClosedGroupControlMessage&& from) noexcept - : DataMessage_ClosedGroupControlMessage() { - *this = ::std::move(from); - } + // 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::MessageLite /* @@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_ClosedGroupControlMessage& operator=(const DataMessage_ClosedGroupControlMessage& from) { + inline ReceiptMessage& operator=(const ReceiptMessage& from) { CopyFrom(from); return *this; } - inline DataMessage_ClosedGroupControlMessage& operator=(DataMessage_ClosedGroupControlMessage&& from) noexcept { + inline ReceiptMessage& operator=(ReceiptMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -3474,20 +3858,20 @@ class DataMessage_ClosedGroupControlMessage final : return _internal_metadata_.mutable_unknown_fields(); } - static const DataMessage_ClosedGroupControlMessage& default_instance() { + static const ReceiptMessage& default_instance() { return *internal_default_instance(); } - static inline const DataMessage_ClosedGroupControlMessage* internal_default_instance() { - return reinterpret_cast( - &_DataMessage_ClosedGroupControlMessage_default_instance_); + static inline const ReceiptMessage* internal_default_instance() { + return reinterpret_cast( + &_ReceiptMessage_default_instance_); } static constexpr int kIndexInFileMessages = 15; - friend void swap(DataMessage_ClosedGroupControlMessage& a, DataMessage_ClosedGroupControlMessage& b) { + friend void swap(ReceiptMessage& a, ReceiptMessage& b) { a.Swap(&b); } - inline void Swap(DataMessage_ClosedGroupControlMessage* other) { + inline void Swap(ReceiptMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -3500,7 +3884,7 @@ class DataMessage_ClosedGroupControlMessage final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataMessage_ClosedGroupControlMessage* other) { + void UnsafeArenaSwap(ReceiptMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -3508,12 +3892,12 @@ class DataMessage_ClosedGroupControlMessage final : // implements Message ---------------------------------------------- - DataMessage_ClosedGroupControlMessage* 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_ClosedGroupControlMessage& from); - void MergeFrom(const DataMessage_ClosedGroupControlMessage& from); + void CopyFrom(const ReceiptMessage& from); + void MergeFrom(const ReceiptMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3527,15 +3911,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(ReceiptMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataMessage.ClosedGroupControlMessage"; + return "SessionProtos.ReceiptMessage"; } protected: - explicit DataMessage_ClosedGroupControlMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit ReceiptMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -3543,203 +3927,74 @@ 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; + 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 DataMessage_ClosedGroupControlMessage_Type_IsValid(value); + return ReceiptMessage_Type_IsValid(value); } static constexpr Type Type_MIN = - DataMessage_ClosedGroupControlMessage_Type_Type_MIN; + ReceiptMessage_Type_Type_MIN; static constexpr Type Type_MAX = - DataMessage_ClosedGroupControlMessage_Type_Type_MAX; + ReceiptMessage_Type_Type_MAX; static constexpr int Type_ARRAYSIZE = - DataMessage_ClosedGroupControlMessage_Type_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 DataMessage_ClosedGroupControlMessage_Type_Name(enum_t_value); + return ReceiptMessage_Type_Name(enum_t_value); } static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Type* value) { - return DataMessage_ClosedGroupControlMessage_Type_Parse(name, value); + return ReceiptMessage_Type_Parse(name, value); } // accessors ------------------------------------------------------- enum : int { - kMembersFieldNumber = 5, - kAdminsFieldNumber = 6, - kWrappersFieldNumber = 7, - kPublicKeyFieldNumber = 2, - kNameFieldNumber = 3, - kEncryptionKeyPairFieldNumber = 4, - kExpirationTimerFieldNumber = 8, + kTimestampFieldNumber = 2, kTypeFieldNumber = 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; - 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; - 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); - 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); - 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 = 8; - bool has_expirationtimer() const; + // repeated uint64 timestamp = 2; + int timestamp_size() const; private: - bool _internal_has_expirationtimer() const; + int _internal_timestamp_size() const; public: - void clear_expirationtimer(); - uint32_t expirationtimer() const; - void set_expirationtimer(uint32_t value); + void clear_timestamp(); private: - uint32_t _internal_expirationtimer() const; - void _internal_set_expirationtimer(uint32_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.DataMessage.ClosedGroupControlMessage.Type type = 1; + // required .SessionProtos.ReceiptMessage.Type type = 1; bool has_type() const; private: bool _internal_has_type() const; public: void clear_type(); - ::SessionProtos::DataMessage_ClosedGroupControlMessage_Type type() const; - void set_type(::SessionProtos::DataMessage_ClosedGroupControlMessage_Type value); + ::SessionProtos::ReceiptMessage_Type type() const; + void set_type(::SessionProtos::ReceiptMessage_Type value); private: - ::SessionProtos::DataMessage_ClosedGroupControlMessage_Type _internal_type() const; - void _internal_set_type(::SessionProtos::DataMessage_ClosedGroupControlMessage_Type value); + ::SessionProtos::ReceiptMessage_Type _internal_type() const; + void _internal_set_type(::SessionProtos::ReceiptMessage_Type value); public: - // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage.ClosedGroupControlMessage) + // @@protoc_insertion_point(class_scope:SessionProtos.ReceiptMessage) private: class _Internal; @@ -3749,13 +4004,7 @@ 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_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t > timestamp_; int type_; }; union { Impl_ _impl_; }; @@ -3763,24 +4012,24 @@ class DataMessage_ClosedGroupControlMessage final : }; // ------------------------------------------------------------------- -class DataMessage final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.DataMessage) */ { +class AttachmentPointer final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.AttachmentPointer) */ { public: - inline DataMessage() : DataMessage(nullptr) {} - ~DataMessage() override; - explicit PROTOBUF_CONSTEXPR DataMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline AttachmentPointer() : AttachmentPointer(nullptr) {} + ~AttachmentPointer() override; + explicit PROTOBUF_CONSTEXPR AttachmentPointer(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - DataMessage(const DataMessage& from); - DataMessage(DataMessage&& from) noexcept - : DataMessage() { + AttachmentPointer(const AttachmentPointer& from); + AttachmentPointer(AttachmentPointer&& from) noexcept + : AttachmentPointer() { *this = ::std::move(from); } - inline DataMessage& operator=(const DataMessage& from) { + inline AttachmentPointer& operator=(const AttachmentPointer& from) { CopyFrom(from); return *this; } - inline DataMessage& operator=(DataMessage&& from) noexcept { + inline AttachmentPointer& operator=(AttachmentPointer&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -3801,20 +4050,20 @@ class DataMessage final : return _internal_metadata_.mutable_unknown_fields(); } - static const DataMessage& default_instance() { + static const AttachmentPointer& default_instance() { return *internal_default_instance(); } - static inline const DataMessage* internal_default_instance() { - return reinterpret_cast( - &_DataMessage_default_instance_); + static inline const AttachmentPointer* internal_default_instance() { + return reinterpret_cast( + &_AttachmentPointer_default_instance_); } static constexpr int kIndexInFileMessages = 16; - friend void swap(DataMessage& a, DataMessage& b) { + friend void swap(AttachmentPointer& a, AttachmentPointer& b) { a.Swap(&b); } - inline void Swap(DataMessage* other) { + inline void Swap(AttachmentPointer* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -3827,7 +4076,7 @@ class DataMessage final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(DataMessage* other) { + void UnsafeArenaSwap(AttachmentPointer* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -3835,12 +4084,12 @@ class DataMessage final : // implements Message ---------------------------------------------- - DataMessage* 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& from); - void MergeFrom(const DataMessage& from); + void CopyFrom(const AttachmentPointer& from); + void MergeFrom(const AttachmentPointer& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3854,15 +4103,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(AttachmentPointer* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.DataMessage"; + return "SessionProtos.AttachmentPointer"; } protected: - explicit DataMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit AttachmentPointer(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -3870,235 +4119,199 @@ 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; + typedef AttachmentPointer_Flags Flags; + static constexpr Flags VOICE_MESSAGE = + AttachmentPointer_Flags_VOICE_MESSAGE; static inline bool Flags_IsValid(int value) { - return DataMessage_Flags_IsValid(value); + return AttachmentPointer_Flags_IsValid(value); } static constexpr Flags Flags_MIN = - DataMessage_Flags_Flags_MIN; + AttachmentPointer_Flags_Flags_MIN; static constexpr Flags Flags_MAX = - DataMessage_Flags_Flags_MAX; + AttachmentPointer_Flags_Flags_MAX; static constexpr int Flags_ARRAYSIZE = - DataMessage_Flags_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 DataMessage_Flags_Name(enum_t_value); + return AttachmentPointer_Flags_Name(enum_t_value); } static inline bool Flags_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Flags* value) { - return DataMessage_Flags_Parse(name, value); + return AttachmentPointer_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, + kContentTypeFieldNumber = 2, + kKeyFieldNumber = 3, + kThumbnailFieldNumber = 5, + kDigestFieldNumber = 6, + kFileNameFieldNumber = 7, + kCaptionFieldNumber = 11, + kUrlFieldNumber = 101, + kIdFieldNumber = 1, + kSizeFieldNumber = 4, + kFlagsFieldNumber = 8, + kWidthFieldNumber = 9, + kHeightFieldNumber = 10, }; - // repeated .SessionProtos.AttachmentPointer attachments = 2; - int attachments_size() const; + // optional string contentType = 2; + bool has_contenttype() const; private: - int _internal_attachments_size() const; + bool _internal_has_contenttype() const; public: - void clear_attachments(); - ::SessionProtos::AttachmentPointer* mutable_attachments(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer >* - mutable_attachments(); + 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 ::SessionProtos::AttachmentPointer& _internal_attachments(int index) const; - ::SessionProtos::AttachmentPointer* _internal_add_attachments(); + const std::string& _internal_contenttype() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_contenttype(const std::string& value); + std::string* _internal_mutable_contenttype(); 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; + // optional bytes key = 3; + bool has_key() const; private: - int _internal_preview_size() const; + bool _internal_has_key() const; public: - void clear_preview(); - ::SessionProtos::DataMessage_Preview* mutable_preview(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview >* - mutable_preview(); + 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 ::SessionProtos::DataMessage_Preview& _internal_preview(int index) const; - ::SessionProtos::DataMessage_Preview* _internal_add_preview(); + const std::string& _internal_key() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_key(const std::string& value); + std::string* _internal_mutable_key(); 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; + // optional bytes thumbnail = 5; + bool has_thumbnail() const; private: - bool _internal_has_body() const; + bool _internal_has_thumbnail() const; public: - void clear_body(); - const std::string& body() const; + void clear_thumbnail(); + const std::string& thumbnail() 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_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_body() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_body(const std::string& value); - std::string* _internal_mutable_body(); + 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 profileKey = 6; - bool has_profilekey() const; + // optional bytes digest = 6; + bool has_digest() const; private: - bool _internal_has_profilekey() const; + bool _internal_has_digest() const; public: - void clear_profilekey(); - const std::string& profilekey() const; + void clear_digest(); + const std::string& digest() 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_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_profilekey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilekey(const std::string& value); - std::string* _internal_mutable_profilekey(); + 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 syncTarget = 105; - bool has_synctarget() const; + // optional string fileName = 7; + bool has_filename() const; private: - bool _internal_has_synctarget() const; + bool _internal_has_filename() const; public: - void clear_synctarget(); - const std::string& synctarget() const; + void clear_filename(); + const std::string& filename() 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_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_synctarget() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_synctarget(const std::string& value); - std::string* _internal_mutable_synctarget(); + 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.DataMessage.Quote quote = 8; - bool has_quote() const; + // optional string caption = 11; + bool has_caption() const; private: - bool _internal_has_quote() const; + bool _internal_has_caption() 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); + 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 ::SessionProtos::DataMessage_Quote& _internal_quote() const; - ::SessionProtos::DataMessage_Quote* _internal_mutable_quote(); + const std::string& _internal_caption() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_caption(const std::string& value); + std::string* _internal_mutable_caption(); 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; + // optional string url = 101; + bool has_url() const; private: - bool _internal_has_reaction() const; + bool _internal_has_url() 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); + 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 ::SessionProtos::DataMessage_Reaction& _internal_reaction() const; - ::SessionProtos::DataMessage_Reaction* _internal_mutable_reaction(); + const std::string& _internal_url() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_url(const std::string& value); + std::string* _internal_mutable_url(); 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; + // required fixed64 id = 1; + bool has_id() const; private: - bool _internal_has_opengroupinvitation() const; + bool _internal_has_id() 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); + void clear_id(); + uint64_t id() const; + void set_id(uint64_t value); private: - const ::SessionProtos::DataMessage_OpenGroupInvitation& _internal_opengroupinvitation() const; - ::SessionProtos::DataMessage_OpenGroupInvitation* _internal_mutable_opengroupinvitation(); + uint64_t _internal_id() const; + void _internal_set_id(uint64_t value); 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; + // optional uint32 size = 4; + bool has_size() const; private: - bool _internal_has_closedgroupcontrolmessage() const; + bool _internal_has_size() 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); + void clear_size(); + uint32_t size() const; + void set_size(uint32_t value); private: - const ::SessionProtos::DataMessage_ClosedGroupControlMessage& _internal_closedgroupcontrolmessage() const; - ::SessionProtos::DataMessage_ClosedGroupControlMessage* _internal_mutable_closedgroupcontrolmessage(); + uint32_t _internal_size() const; + void _internal_set_size(uint32_t value); public: - void unsafe_arena_set_allocated_closedgroupcontrolmessage( - ::SessionProtos::DataMessage_ClosedGroupControlMessage* closedgroupcontrolmessage); - ::SessionProtos::DataMessage_ClosedGroupControlMessage* unsafe_arena_release_closedgroupcontrolmessage(); - // optional uint32 flags = 4; + // optional uint32 flags = 8; bool has_flags() const; private: bool _internal_has_flags() const; @@ -4111,46 +4324,33 @@ class DataMessage final : 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; + // optional uint32 width = 9; + bool has_width() const; private: - bool _internal_has_timestamp() const; + bool _internal_has_width() const; public: - void clear_timestamp(); - uint64_t timestamp() const; - void set_timestamp(uint64_t value); + void clear_width(); + uint32_t width() const; + void set_width(uint32_t value); private: - uint64_t _internal_timestamp() const; - void _internal_set_timestamp(uint64_t value); + uint32_t _internal_width() const; + void _internal_set_width(uint32_t value); public: - // optional bool blocksCommunityMessageRequests = 106; - bool has_blockscommunitymessagerequests() const; + // optional uint32 height = 10; + bool has_height() const; private: - bool _internal_has_blockscommunitymessagerequests() const; + bool _internal_has_height() const; public: - void clear_blockscommunitymessagerequests(); - bool blockscommunitymessagerequests() const; - void set_blockscommunitymessagerequests(bool value); + void clear_height(); + uint32_t height() const; + void set_height(uint32_t value); private: - bool _internal_blockscommunitymessagerequests() const; - void _internal_set_blockscommunitymessagerequests(bool value); + uint32_t _internal_height() const; + void _internal_set_height(uint32_t value); public: - // @@protoc_insertion_point(class_scope:SessionProtos.DataMessage) + // @@protoc_insertion_point(class_scope:SessionProtos.AttachmentPointer) private: class _Internal; @@ -4160,44 +4360,42 @@ class DataMessage final : 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_; + ::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 expiretimer_; - uint64_t timestamp_; - bool blockscommunitymessagerequests_; + uint32_t width_; + uint32_t height_; }; 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 SharedConfigMessage final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.SharedConfigMessage) */ { public: - inline ConfigurationMessage_ClosedGroup() : ConfigurationMessage_ClosedGroup(nullptr) {} - ~ConfigurationMessage_ClosedGroup() override; - explicit PROTOBUF_CONSTEXPR ConfigurationMessage_ClosedGroup(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline SharedConfigMessage() : SharedConfigMessage(nullptr) {} + ~SharedConfigMessage() override; + explicit PROTOBUF_CONSTEXPR SharedConfigMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ConfigurationMessage_ClosedGroup(const ConfigurationMessage_ClosedGroup& from); - ConfigurationMessage_ClosedGroup(ConfigurationMessage_ClosedGroup&& from) noexcept - : ConfigurationMessage_ClosedGroup() { + SharedConfigMessage(const SharedConfigMessage& from); + SharedConfigMessage(SharedConfigMessage&& from) noexcept + : SharedConfigMessage() { *this = ::std::move(from); } - inline ConfigurationMessage_ClosedGroup& operator=(const ConfigurationMessage_ClosedGroup& from) { + inline SharedConfigMessage& operator=(const SharedConfigMessage& from) { CopyFrom(from); return *this; } - inline ConfigurationMessage_ClosedGroup& operator=(ConfigurationMessage_ClosedGroup&& from) noexcept { + inline SharedConfigMessage& operator=(SharedConfigMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -4218,20 +4416,20 @@ class ConfigurationMessage_ClosedGroup final : return _internal_metadata_.mutable_unknown_fields(); } - static const ConfigurationMessage_ClosedGroup& default_instance() { + static const SharedConfigMessage& default_instance() { return *internal_default_instance(); } - static inline const ConfigurationMessage_ClosedGroup* internal_default_instance() { - return reinterpret_cast( - &_ConfigurationMessage_ClosedGroup_default_instance_); + static inline const SharedConfigMessage* internal_default_instance() { + return reinterpret_cast( + &_SharedConfigMessage_default_instance_); } static constexpr int kIndexInFileMessages = 17; - friend void swap(ConfigurationMessage_ClosedGroup& a, ConfigurationMessage_ClosedGroup& b) { + friend void swap(SharedConfigMessage& a, SharedConfigMessage& b) { a.Swap(&b); } - inline void Swap(ConfigurationMessage_ClosedGroup* other) { + inline void Swap(SharedConfigMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -4244,7 +4442,7 @@ class ConfigurationMessage_ClosedGroup final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ConfigurationMessage_ClosedGroup* other) { + void UnsafeArenaSwap(SharedConfigMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -4252,12 +4450,12 @@ class ConfigurationMessage_ClosedGroup final : // implements Message ---------------------------------------------- - ConfigurationMessage_ClosedGroup* 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); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const ConfigurationMessage_ClosedGroup& from); - void MergeFrom(const ConfigurationMessage_ClosedGroup& from); + void CopyFrom(const SharedConfigMessage& from); + void MergeFrom(const SharedConfigMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -4271,15 +4469,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(SharedConfigMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.ConfigurationMessage.ClosedGroup"; + return "SessionProtos.SharedConfigMessage"; } protected: - explicit ConfigurationMessage_ClosedGroup(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit SharedConfigMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -4287,171 +4485,127 @@ class ConfigurationMessage_ClosedGroup 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 { - kMembersFieldNumber = 4, - kAdminsFieldNumber = 5, - kPublicKeyFieldNumber = 1, - kNameFieldNumber = 2, - kEncryptionKeyPairFieldNumber = 3, - kExpirationTimerFieldNumber = 6, + kDataFieldNumber = 3, + kSeqnoFieldNumber = 2, + kKindFieldNumber = 1, }; - // 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; - 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 = 2; - bool has_name() const; + // required bytes data = 3; + bool has_data() const; private: - bool _internal_has_name() const; + bool _internal_has_data() const; public: - void clear_name(); - const std::string& name() const; + void clear_data(); + const std::string& data() 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_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_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); - std::string* _internal_mutable_name(); + const std::string& _internal_data() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_data(const std::string& value); + std::string* _internal_mutable_data(); public: - // optional .SessionProtos.KeyPair encryptionKeyPair = 3; - bool has_encryptionkeypair() const; + // required int64 seqno = 2; + bool has_seqno() const; private: - bool _internal_has_encryptionkeypair() const; + bool _internal_has_seqno() 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_seqno(); + int64_t seqno() const; + void set_seqno(int64_t value); private: - const ::SessionProtos::KeyPair& _internal_encryptionkeypair() const; - ::SessionProtos::KeyPair* _internal_mutable_encryptionkeypair(); + int64_t _internal_seqno() const; + void _internal_set_seqno(int64_t value); public: - void unsafe_arena_set_allocated_encryptionkeypair( - ::SessionProtos::KeyPair* encryptionkeypair); - ::SessionProtos::KeyPair* unsafe_arena_release_encryptionkeypair(); - // optional uint32 expirationTimer = 6; - bool has_expirationtimer() const; + // required .SessionProtos.SharedConfigMessage.Kind kind = 1; + bool has_kind() const; private: - bool _internal_has_expirationtimer() const; + bool _internal_has_kind() const; public: - void clear_expirationtimer(); - uint32_t expirationtimer() const; - void set_expirationtimer(uint32_t value); + void clear_kind(); + ::SessionProtos::SharedConfigMessage_Kind kind() const; + void set_kind(::SessionProtos::SharedConfigMessage_Kind value); private: - uint32_t _internal_expirationtimer() const; - void _internal_set_expirationtimer(uint32_t value); + ::SessionProtos::SharedConfigMessage_Kind _internal_kind() const; + void _internal_set_kind(::SessionProtos::SharedConfigMessage_Kind value); public: - // @@protoc_insertion_point(class_scope:SessionProtos.ConfigurationMessage.ClosedGroup) + // @@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::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 data_; + int64_t seqno_; + int kind_; }; 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 GroupUpdateMessage final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateMessage) */ { public: - inline ConfigurationMessage_Contact() : ConfigurationMessage_Contact(nullptr) {} - ~ConfigurationMessage_Contact() override; - explicit PROTOBUF_CONSTEXPR ConfigurationMessage_Contact(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline GroupUpdateMessage() : GroupUpdateMessage(nullptr) {} + ~GroupUpdateMessage() override; + explicit PROTOBUF_CONSTEXPR GroupUpdateMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ConfigurationMessage_Contact(const ConfigurationMessage_Contact& from); - ConfigurationMessage_Contact(ConfigurationMessage_Contact&& from) noexcept - : ConfigurationMessage_Contact() { + GroupUpdateMessage(const GroupUpdateMessage& from); + GroupUpdateMessage(GroupUpdateMessage&& from) noexcept + : GroupUpdateMessage() { *this = ::std::move(from); } - inline ConfigurationMessage_Contact& operator=(const ConfigurationMessage_Contact& from) { + inline GroupUpdateMessage& operator=(const GroupUpdateMessage& from) { CopyFrom(from); return *this; } - inline ConfigurationMessage_Contact& operator=(ConfigurationMessage_Contact&& from) noexcept { + inline GroupUpdateMessage& operator=(GroupUpdateMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -4472,20 +4626,20 @@ class ConfigurationMessage_Contact final : return _internal_metadata_.mutable_unknown_fields(); } - static const ConfigurationMessage_Contact& default_instance() { + static const GroupUpdateMessage& default_instance() { return *internal_default_instance(); } - static inline const ConfigurationMessage_Contact* internal_default_instance() { - return reinterpret_cast( - &_ConfigurationMessage_Contact_default_instance_); + static inline const GroupUpdateMessage* internal_default_instance() { + return reinterpret_cast( + &_GroupUpdateMessage_default_instance_); } static constexpr int kIndexInFileMessages = 18; - friend void swap(ConfigurationMessage_Contact& a, ConfigurationMessage_Contact& b) { + friend void swap(GroupUpdateMessage& a, GroupUpdateMessage& b) { a.Swap(&b); } - inline void Swap(ConfigurationMessage_Contact* other) { + inline void Swap(GroupUpdateMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -4498,7 +4652,7 @@ class ConfigurationMessage_Contact final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ConfigurationMessage_Contact* other) { + void UnsafeArenaSwap(GroupUpdateMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -4506,12 +4660,12 @@ class ConfigurationMessage_Contact final : // implements Message ---------------------------------------------- - ConfigurationMessage_Contact* 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); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const ConfigurationMessage_Contact& from); - void MergeFrom(const ConfigurationMessage_Contact& from); + void CopyFrom(const GroupUpdateMessage& from); + void MergeFrom(const GroupUpdateMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -4525,15 +4679,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(GroupUpdateMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.ConfigurationMessage.Contact"; + return "SessionProtos.GroupUpdateMessage"; } protected: - explicit ConfigurationMessage_Contact(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit GroupUpdateMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -4544,169 +4698,201 @@ class ConfigurationMessage_Contact final : // accessors ------------------------------------------------------- enum : int { - kPublicKeyFieldNumber = 1, - kNameFieldNumber = 2, - kProfilePictureFieldNumber = 3, - kProfileKeyFieldNumber = 4, - kIsApprovedFieldNumber = 5, - kIsBlockedFieldNumber = 6, - kDidApproveMeFieldNumber = 7, + kInviteMessageFieldNumber = 1, + kInfoChangeMessageFieldNumber = 2, + kMemberChangeMessageFieldNumber = 3, + kPromoteMessageFieldNumber = 4, + kMemberLeftMessageFieldNumber = 5, + kInviteResponseFieldNumber = 6, + kDeleteMemberContentFieldNumber = 7, + kMemberLeftNotificationMessageFieldNumber = 8, }; - // required bytes publicKey = 1; - 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(); - // required string name = 2; - 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 string profilePicture = 3; - bool has_profilepicture() const; + // optional .SessionProtos.GroupUpdateMemberChangeMessage memberChangeMessage = 3; + bool has_memberchangemessage() const; private: - bool _internal_has_profilepicture() const; + bool _internal_has_memberchangemessage() 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); + 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 std::string& _internal_profilepicture() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilepicture(const std::string& value); - std::string* _internal_mutable_profilepicture(); + const ::SessionProtos::GroupUpdateMemberChangeMessage& _internal_memberchangemessage() const; + ::SessionProtos::GroupUpdateMemberChangeMessage* _internal_mutable_memberchangemessage(); public: + void unsafe_arena_set_allocated_memberchangemessage( + ::SessionProtos::GroupUpdateMemberChangeMessage* memberchangemessage); + ::SessionProtos::GroupUpdateMemberChangeMessage* unsafe_arena_release_memberchangemessage(); - // optional bytes profileKey = 4; - bool has_profilekey() const; + // optional .SessionProtos.GroupUpdatePromoteMessage promoteMessage = 4; + bool has_promotemessage() const; private: - bool _internal_has_profilekey() const; + bool _internal_has_promotemessage() 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_promotemessage(); + const ::SessionProtos::GroupUpdatePromoteMessage& promotemessage() const; + PROTOBUF_NODISCARD ::SessionProtos::GroupUpdatePromoteMessage* release_promotemessage(); + ::SessionProtos::GroupUpdatePromoteMessage* mutable_promotemessage(); + void set_allocated_promotemessage(::SessionProtos::GroupUpdatePromoteMessage* promotemessage); 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::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(); - // optional bool isApproved = 5; - bool has_isapproved() const; + // optional .SessionProtos.GroupUpdateMemberLeftMessage memberLeftMessage = 5; + bool has_memberleftmessage() const; private: - bool _internal_has_isapproved() const; + bool _internal_has_memberleftmessage() const; public: - void clear_isapproved(); - bool isapproved() const; - void set_isapproved(bool 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: - bool _internal_isapproved() const; - void _internal_set_isapproved(bool value); + 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 bool isBlocked = 6; - bool has_isblocked() const; + // optional .SessionProtos.GroupUpdateDeleteMemberContentMessage deleteMemberContent = 7; + bool has_deletemembercontent() const; private: - bool _internal_has_isblocked() const; + bool _internal_has_deletemembercontent() const; public: - void clear_isblocked(); - bool isblocked() const; - void set_isblocked(bool value); + 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: - bool _internal_isblocked() const; - void _internal_set_isblocked(bool value); + 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 bool didApproveMe = 7; - bool has_didapproveme() const; + // optional .SessionProtos.GroupUpdateMemberLeftNotificationMessage memberLeftNotificationMessage = 8; + bool has_memberleftnotificationmessage() const; private: - bool _internal_has_didapproveme() const; + bool _internal_has_memberleftnotificationmessage() const; public: - void clear_didapproveme(); - bool didapproveme() const; - void set_didapproveme(bool value); + 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: - bool _internal_didapproveme() const; - void _internal_set_didapproveme(bool 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.ConfigurationMessage.Contact) + // @@protoc_insertion_point(class_scope:SessionProtos.GroupUpdateMessage) 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 name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilepicture_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr profilekey_; - bool isapproved_; - bool isblocked_; - bool didapproveme_; + ::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 ConfigurationMessage final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ConfigurationMessage) */ { +class GroupUpdateInviteMessage final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateInviteMessage) */ { public: - inline ConfigurationMessage() : ConfigurationMessage(nullptr) {} - ~ConfigurationMessage() override; - explicit PROTOBUF_CONSTEXPR ConfigurationMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline GroupUpdateInviteMessage() : GroupUpdateInviteMessage(nullptr) {} + ~GroupUpdateInviteMessage() override; + explicit PROTOBUF_CONSTEXPR GroupUpdateInviteMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ConfigurationMessage(const ConfigurationMessage& from); - ConfigurationMessage(ConfigurationMessage&& from) noexcept - : ConfigurationMessage() { + GroupUpdateInviteMessage(const GroupUpdateInviteMessage& from); + GroupUpdateInviteMessage(GroupUpdateInviteMessage&& from) noexcept + : GroupUpdateInviteMessage() { *this = ::std::move(from); } - inline ConfigurationMessage& operator=(const ConfigurationMessage& from) { + inline GroupUpdateInviteMessage& operator=(const GroupUpdateInviteMessage& from) { CopyFrom(from); return *this; } - inline ConfigurationMessage& operator=(ConfigurationMessage&& from) noexcept { + inline GroupUpdateInviteMessage& operator=(GroupUpdateInviteMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -4727,20 +4913,20 @@ class ConfigurationMessage final : return _internal_metadata_.mutable_unknown_fields(); } - static const ConfigurationMessage& default_instance() { + static const GroupUpdateInviteMessage& default_instance() { return *internal_default_instance(); } - static inline const ConfigurationMessage* internal_default_instance() { - return reinterpret_cast( - &_ConfigurationMessage_default_instance_); + static inline const GroupUpdateInviteMessage* internal_default_instance() { + return reinterpret_cast( + &_GroupUpdateInviteMessage_default_instance_); } static constexpr int kIndexInFileMessages = 19; - friend void swap(ConfigurationMessage& a, ConfigurationMessage& b) { + friend void swap(GroupUpdateInviteMessage& a, GroupUpdateInviteMessage& b) { a.Swap(&b); } - inline void Swap(ConfigurationMessage* other) { + inline void Swap(GroupUpdateInviteMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -4753,7 +4939,7 @@ class ConfigurationMessage final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ConfigurationMessage* other) { + void UnsafeArenaSwap(GroupUpdateInviteMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -4761,12 +4947,12 @@ class ConfigurationMessage final : // implements Message ---------------------------------------------- - ConfigurationMessage* 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 ConfigurationMessage& from); - void MergeFrom(const ConfigurationMessage& from); + void CopyFrom(const GroupUpdateInviteMessage& from); + void MergeFrom(const GroupUpdateInviteMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -4780,15 +4966,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(GroupUpdateInviteMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.ConfigurationMessage"; + return "SessionProtos.GroupUpdateInviteMessage"; } protected: - explicit ConfigurationMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit GroupUpdateInviteMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -4796,173 +4982,127 @@ class ConfigurationMessage final : // nested types ---------------------------------------------------- - typedef ConfigurationMessage_ClosedGroup ClosedGroup; - typedef ConfigurationMessage_Contact Contact; - // accessors ------------------------------------------------------- enum : int { - kClosedGroupsFieldNumber = 1, - kOpenGroupsFieldNumber = 2, - kContactsFieldNumber = 6, - kDisplayNameFieldNumber = 3, - kProfilePictureFieldNumber = 4, - kProfileKeyFieldNumber = 5, + kGroupSessionIdFieldNumber = 1, + kNameFieldNumber = 2, + kMemberAuthDataFieldNumber = 3, + kAdminSignatureFieldNumber = 4, }; - // repeated .SessionProtos.ConfigurationMessage.ClosedGroup closedGroups = 1; - int closedgroups_size() const; - private: - int _internal_closedgroups_size() const; - public: - void clear_closedgroups(); - ::SessionProtos::ConfigurationMessage_ClosedGroup* mutable_closedgroups(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_ClosedGroup >* - mutable_closedgroups(); - private: - 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; - - // repeated string openGroups = 2; - int opengroups_size() const; + // required string groupSessionId = 1; + bool has_groupsessionid() const; private: - int _internal_opengroups_size() const; + bool _internal_has_groupsessionid() 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_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::ConfigurationMessage_Contact& _internal_contacts(int index) const; - ::SessionProtos::ConfigurationMessage_Contact* _internal_add_contacts(); + 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::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 string name = 2; + bool has_name() const; private: - bool _internal_has_displayname() const; + bool _internal_has_name() const; public: - void clear_displayname(); - const std::string& displayname() const; + void clear_name(); + const std::string& name() 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_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_displayname() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_displayname(const std::string& value); - std::string* _internal_mutable_displayname(); + 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 = 4; - bool has_profilepicture() const; + // required bytes memberAuthData = 3; + bool has_memberauthdata() const; private: - bool _internal_has_profilepicture() const; + bool _internal_has_memberauthdata() const; public: - void clear_profilepicture(); - const std::string& profilepicture() const; + void clear_memberauthdata(); + const std::string& memberauthdata() 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_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_profilepicture() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilepicture(const std::string& value); - std::string* _internal_mutable_profilepicture(); + 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 bytes profileKey = 5; - 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); + 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_profilekey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_profilekey(const std::string& value); - std::string* _internal_mutable_profilekey(); + 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.ConfigurationMessage) + // @@protoc_insertion_point(class_scope:SessionProtos.GroupUpdateInviteMessage) 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_; + ::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; }; // ------------------------------------------------------------------- -class ReceiptMessage final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.ReceiptMessage) */ { +class GroupUpdatePromoteMessage final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdatePromoteMessage) */ { public: - inline ReceiptMessage() : ReceiptMessage(nullptr) {} - ~ReceiptMessage() override; - explicit PROTOBUF_CONSTEXPR ReceiptMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline GroupUpdatePromoteMessage() : GroupUpdatePromoteMessage(nullptr) {} + ~GroupUpdatePromoteMessage() override; + explicit PROTOBUF_CONSTEXPR GroupUpdatePromoteMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ReceiptMessage(const ReceiptMessage& from); - ReceiptMessage(ReceiptMessage&& from) noexcept - : ReceiptMessage() { + GroupUpdatePromoteMessage(const GroupUpdatePromoteMessage& from); + GroupUpdatePromoteMessage(GroupUpdatePromoteMessage&& from) noexcept + : GroupUpdatePromoteMessage() { *this = ::std::move(from); } - inline ReceiptMessage& operator=(const ReceiptMessage& from) { + inline GroupUpdatePromoteMessage& operator=(const GroupUpdatePromoteMessage& from) { CopyFrom(from); return *this; } - inline ReceiptMessage& operator=(ReceiptMessage&& from) noexcept { + inline GroupUpdatePromoteMessage& operator=(GroupUpdatePromoteMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -4983,20 +5123,20 @@ class ReceiptMessage final : return _internal_metadata_.mutable_unknown_fields(); } - static const ReceiptMessage& default_instance() { + static const GroupUpdatePromoteMessage& default_instance() { return *internal_default_instance(); } - static inline const ReceiptMessage* internal_default_instance() { - return reinterpret_cast( - &_ReceiptMessage_default_instance_); + static inline const GroupUpdatePromoteMessage* internal_default_instance() { + return reinterpret_cast( + &_GroupUpdatePromoteMessage_default_instance_); } static constexpr int kIndexInFileMessages = 20; - friend void swap(ReceiptMessage& a, ReceiptMessage& b) { + friend void swap(GroupUpdatePromoteMessage& a, GroupUpdatePromoteMessage& b) { a.Swap(&b); } - inline void Swap(ReceiptMessage* other) { + inline void Swap(GroupUpdatePromoteMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -5009,7 +5149,7 @@ class ReceiptMessage final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ReceiptMessage* other) { + void UnsafeArenaSwap(GroupUpdatePromoteMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -5017,12 +5157,12 @@ class ReceiptMessage final : // implements Message ---------------------------------------------- - ReceiptMessage* 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); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const ReceiptMessage& from); - void MergeFrom(const ReceiptMessage& from); + void CopyFrom(const GroupUpdatePromoteMessage& from); + void MergeFrom(const GroupUpdatePromoteMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -5036,15 +5176,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(GroupUpdatePromoteMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.ReceiptMessage"; + return "SessionProtos.GroupUpdatePromoteMessage"; } protected: - explicit ReceiptMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit GroupUpdatePromoteMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -5052,109 +5192,87 @@ 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, + kGroupIdentitySeedFieldNumber = 1, + kNameFieldNumber = 2, }; - // repeated uint64 timestamp = 2; - int timestamp_size() const; + // required bytes groupIdentitySeed = 1; + bool has_groupidentityseed() const; private: - int _internal_timestamp_size() const; + bool _internal_has_groupidentityseed() const; public: - void clear_timestamp(); + void clear_groupidentityseed(); + const std::string& groupidentityseed() const; + template + 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: - 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_groupidentityseed() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_groupidentityseed(const std::string& value); + std::string* _internal_mutable_groupidentityseed(); 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) + // @@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::RepeatedField< uint64_t > timestamp_; - int type_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr groupidentityseed_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; // ------------------------------------------------------------------- -class AttachmentPointer final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.AttachmentPointer) */ { +class GroupUpdateInfoChangeMessage final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateInfoChangeMessage) */ { public: - inline AttachmentPointer() : AttachmentPointer(nullptr) {} - ~AttachmentPointer() override; - explicit PROTOBUF_CONSTEXPR AttachmentPointer(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline GroupUpdateInfoChangeMessage() : GroupUpdateInfoChangeMessage(nullptr) {} + ~GroupUpdateInfoChangeMessage() override; + explicit PROTOBUF_CONSTEXPR GroupUpdateInfoChangeMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - AttachmentPointer(const AttachmentPointer& from); - AttachmentPointer(AttachmentPointer&& from) noexcept - : AttachmentPointer() { + GroupUpdateInfoChangeMessage(const GroupUpdateInfoChangeMessage& from); + GroupUpdateInfoChangeMessage(GroupUpdateInfoChangeMessage&& from) noexcept + : GroupUpdateInfoChangeMessage() { *this = ::std::move(from); } - inline AttachmentPointer& operator=(const AttachmentPointer& from) { + inline GroupUpdateInfoChangeMessage& operator=(const GroupUpdateInfoChangeMessage& from) { CopyFrom(from); return *this; } - inline AttachmentPointer& operator=(AttachmentPointer&& from) noexcept { + inline GroupUpdateInfoChangeMessage& operator=(GroupUpdateInfoChangeMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -5175,20 +5293,20 @@ class AttachmentPointer final : return _internal_metadata_.mutable_unknown_fields(); } - static const AttachmentPointer& default_instance() { + static const GroupUpdateInfoChangeMessage& default_instance() { return *internal_default_instance(); } - static inline const AttachmentPointer* internal_default_instance() { - return reinterpret_cast( - &_AttachmentPointer_default_instance_); + static inline const GroupUpdateInfoChangeMessage* internal_default_instance() { + return reinterpret_cast( + &_GroupUpdateInfoChangeMessage_default_instance_); } static constexpr int kIndexInFileMessages = 21; - friend void swap(AttachmentPointer& a, AttachmentPointer& b) { + friend void swap(GroupUpdateInfoChangeMessage& a, GroupUpdateInfoChangeMessage& b) { a.Swap(&b); } - inline void Swap(AttachmentPointer* other) { + inline void Swap(GroupUpdateInfoChangeMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -5201,7 +5319,7 @@ class AttachmentPointer final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(AttachmentPointer* other) { + void UnsafeArenaSwap(GroupUpdateInfoChangeMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -5209,12 +5327,12 @@ class AttachmentPointer final : // implements Message ---------------------------------------------- - AttachmentPointer* 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); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; - void CopyFrom(const AttachmentPointer& from); - void MergeFrom(const AttachmentPointer& from); + void CopyFrom(const GroupUpdateInfoChangeMessage& from); + void MergeFrom(const GroupUpdateInfoChangeMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -5228,15 +5346,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(GroupUpdateInfoChangeMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.AttachmentPointer"; + return "SessionProtos.GroupUpdateInfoChangeMessage"; } protected: - explicit AttachmentPointer(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit GroupUpdateInfoChangeMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -5244,283 +5362,145 @@ 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); + 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 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 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; template - static inline const std::string& Flags_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 Flags_Name."); - return AttachmentPointer_Flags_Name(enum_t_value); + "Incorrect type passed to function Type_Name."); + return GroupUpdateInfoChangeMessage_Type_Name(enum_t_value); } - static inline bool Flags_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Flags* value) { - return AttachmentPointer_Flags_Parse(name, value); + static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Type* value) { + return GroupUpdateInfoChangeMessage_Type_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, + kUpdatedNameFieldNumber = 2, + kAdminSignatureFieldNumber = 4, + kUpdatedExpirationFieldNumber = 3, + kTypeFieldNumber = 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; + // optional string updatedName = 2; + bool has_updatedname() const; private: - bool _internal_has_caption() const; + bool _internal_has_updatedname() const; public: - void clear_caption(); - const std::string& caption() const; + void clear_updatedname(); + const std::string& updatedname() 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_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_caption() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_caption(const std::string& value); - std::string* _internal_mutable_caption(); + 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 string url = 101; - bool has_url() const; + // required bytes adminSignature = 4; + bool has_adminsignature() const; private: - bool _internal_has_url() const; + bool _internal_has_adminsignature() const; public: - void clear_url(); - const std::string& url() const; + void clear_adminsignature(); + const std::string& adminsignature() 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); + 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: - uint32_t _internal_flags() const; - void _internal_set_flags(uint32_t 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 uint32 width = 9; - bool has_width() const; + // optional uint32 updatedExpiration = 3; + bool has_updatedexpiration() const; private: - bool _internal_has_width() const; + bool _internal_has_updatedexpiration() const; public: - void clear_width(); - uint32_t width() const; - void set_width(uint32_t value); + void clear_updatedexpiration(); + uint32_t updatedexpiration() const; + void set_updatedexpiration(uint32_t value); private: - uint32_t _internal_width() const; - void _internal_set_width(uint32_t value); + uint32_t _internal_updatedexpiration() const; + void _internal_set_updatedexpiration(uint32_t value); public: - // optional uint32 height = 10; - bool has_height() const; + // required .SessionProtos.GroupUpdateInfoChangeMessage.Type type = 1; + bool has_type() const; private: - bool _internal_has_height() const; + bool _internal_has_type() const; public: - void clear_height(); - uint32_t height() const; - void set_height(uint32_t value); + void clear_type(); + ::SessionProtos::GroupUpdateInfoChangeMessage_Type type() const; + void set_type(::SessionProtos::GroupUpdateInfoChangeMessage_Type value); private: - uint32_t _internal_height() const; - void _internal_set_height(uint32_t value); + ::SessionProtos::GroupUpdateInfoChangeMessage_Type _internal_type() const; + void _internal_set_type(::SessionProtos::GroupUpdateInfoChangeMessage_Type value); public: - // @@protoc_insertion_point(class_scope:SessionProtos.AttachmentPointer) + // @@protoc_insertion_point(class_scope:SessionProtos.GroupUpdateInfoChangeMessage) 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_; - uint64_t id_; - uint32_t size_; - uint32_t flags_; - uint32_t width_; - uint32_t height_; + ::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 SharedConfigMessage final : - public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.SharedConfigMessage) */ { +class GroupUpdateMemberChangeMessage final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateMemberChangeMessage) */ { public: - inline SharedConfigMessage() : SharedConfigMessage(nullptr) {} - ~SharedConfigMessage() override; - explicit PROTOBUF_CONSTEXPR SharedConfigMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline GroupUpdateMemberChangeMessage() : GroupUpdateMemberChangeMessage(nullptr) {} + ~GroupUpdateMemberChangeMessage() override; + explicit PROTOBUF_CONSTEXPR GroupUpdateMemberChangeMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - SharedConfigMessage(const SharedConfigMessage& from); - SharedConfigMessage(SharedConfigMessage&& from) noexcept - : SharedConfigMessage() { + GroupUpdateMemberChangeMessage(const GroupUpdateMemberChangeMessage& from); + GroupUpdateMemberChangeMessage(GroupUpdateMemberChangeMessage&& from) noexcept + : GroupUpdateMemberChangeMessage() { *this = ::std::move(from); } - inline SharedConfigMessage& operator=(const SharedConfigMessage& from) { + inline GroupUpdateMemberChangeMessage& operator=(const GroupUpdateMemberChangeMessage& from) { CopyFrom(from); return *this; } - inline SharedConfigMessage& operator=(SharedConfigMessage&& from) noexcept { + inline GroupUpdateMemberChangeMessage& operator=(GroupUpdateMemberChangeMessage&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -5541,20 +5521,20 @@ class SharedConfigMessage final : return _internal_metadata_.mutable_unknown_fields(); } - static const SharedConfigMessage& default_instance() { + static const GroupUpdateMemberChangeMessage& default_instance() { return *internal_default_instance(); } - static inline const SharedConfigMessage* internal_default_instance() { - return reinterpret_cast( - &_SharedConfigMessage_default_instance_); + static inline const GroupUpdateMemberChangeMessage* internal_default_instance() { + return reinterpret_cast( + &_GroupUpdateMemberChangeMessage_default_instance_); } static constexpr int kIndexInFileMessages = 22; - friend void swap(SharedConfigMessage& a, SharedConfigMessage& b) { + friend void swap(GroupUpdateMemberChangeMessage& a, GroupUpdateMemberChangeMessage& b) { a.Swap(&b); } - inline void Swap(SharedConfigMessage* other) { + inline void Swap(GroupUpdateMemberChangeMessage* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -5567,7 +5547,7 @@ class SharedConfigMessage final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(SharedConfigMessage* other) { + void UnsafeArenaSwap(GroupUpdateMemberChangeMessage* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -5575,12 +5555,12 @@ class SharedConfigMessage final : // implements Message ---------------------------------------------- - SharedConfigMessage* 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 SharedConfigMessage& from); - void MergeFrom(const SharedConfigMessage& from); + void CopyFrom(const GroupUpdateMemberChangeMessage& from); + void MergeFrom(const GroupUpdateMemberChangeMessage& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -5594,15 +5574,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(GroupUpdateMemberChangeMessage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "SessionProtos.SharedConfigMessage"; + return "SessionProtos.GroupUpdateMemberChangeMessage"; } protected: - explicit SharedConfigMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit GroupUpdateMemberChangeMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -5610,88 +5590,111 @@ 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); + 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 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 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; 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 GroupUpdateMemberChangeMessage_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 GroupUpdateMemberChangeMessage_Type_Parse(name, value); } // accessors ------------------------------------------------------- enum : int { - kDataFieldNumber = 3, - kSeqnoFieldNumber = 2, - kKindFieldNumber = 1, + kMemberSessionIdsFieldNumber = 2, + kAdminSignatureFieldNumber = 4, + kHistorySharedFieldNumber = 3, + kTypeFieldNumber = 1, }; - // required bytes data = 3; - bool has_data() const; + // repeated string memberSessionIds = 2; + int membersessionids_size() const; private: - bool _internal_has_data() const; + int _internal_membersessionids_size() const; public: - void clear_data(); - const std::string& data() const; + 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: + + // required bytes adminSignature = 4; + bool has_adminsignature() const; + private: + bool _internal_has_adminsignature() const; + public: + void clear_adminsignature(); + const std::string& adminsignature() 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 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_data() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_data(const std::string& value); - std::string* _internal_mutable_data(); + const std::string& _internal_adminsignature() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_adminsignature(const std::string& value); + std::string* _internal_mutable_adminsignature(); public: - // required int64 seqno = 2; - bool has_seqno() const; + // optional bool historyShared = 3; + bool has_historyshared() const; private: - bool _internal_has_seqno() const; + bool _internal_has_historyshared() const; public: - void clear_seqno(); - int64_t seqno() const; - void set_seqno(int64_t value); + void clear_historyshared(); + bool historyshared() const; + void set_historyshared(bool value); private: - int64_t _internal_seqno() const; - void _internal_set_seqno(int64_t value); + bool _internal_historyshared() const; + void _internal_set_historyshared(bool value); public: - // required .SessionProtos.SharedConfigMessage.Kind kind = 1; - bool has_kind() const; + // required .SessionProtos.GroupUpdateMemberChangeMessage.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::GroupUpdateMemberChangeMessage_Type type() const; + void set_type(::SessionProtos::GroupUpdateMemberChangeMessage_Type value); private: - ::SessionProtos::SharedConfigMessage_Kind _internal_kind() const; - void _internal_set_kind(::SessionProtos::SharedConfigMessage_Kind value); + ::SessionProtos::GroupUpdateMemberChangeMessage_Type _internal_type() const; + void _internal_set_type(::SessionProtos::GroupUpdateMemberChangeMessage_Type value); public: - // @@protoc_insertion_point(class_scope:SessionProtos.SharedConfigMessage) + // @@protoc_insertion_point(class_scope:SessionProtos.GroupUpdateMemberChangeMessage) private: class _Internal; @@ -5704,171 +5707,1140 @@ class SharedConfigMessage final : 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::internal::ArenaStringPtr adminsignature_; + bool historyshared_; + int type_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_SessionProtos_2eproto; }; -// =================================================================== +// ------------------------------------------------------------------- +class GroupUpdateMemberLeftMessage final : + 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); + GroupUpdateMemberLeftMessage(GroupUpdateMemberLeftMessage&& from) noexcept + : GroupUpdateMemberLeftMessage() { + *this = ::std::move(from); + } -#ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -// Envelope + inline GroupUpdateMemberLeftMessage& operator=(const GroupUpdateMemberLeftMessage& from) { + CopyFrom(from); + return *this; + } + inline GroupUpdateMemberLeftMessage& operator=(GroupUpdateMemberLeftMessage&& 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 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) -} + 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(); + } -// 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; + static const GroupUpdateMemberLeftMessage& default_instance() { + return *internal_default_instance(); } - _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.source_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.source_.IsDefault()) { - _impl_.source_.Set("", GetArenaForAllocation()); + static inline const GroupUpdateMemberLeftMessage* internal_default_instance() { + return reinterpret_cast( + &_GroupUpdateMemberLeftMessage_default_instance_); } -#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; + static constexpr int kIndexInFileMessages = + 23; + + friend void swap(GroupUpdateMemberLeftMessage& a, GroupUpdateMemberLeftMessage& b) { + a.Swap(&b); } - _impl_.source_.SetAllocated(source, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.source_.IsDefault()) { - _impl_.source_.Set("", GetArenaForAllocation()); + inline void Swap(GroupUpdateMemberLeftMessage* 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(GroupUpdateMemberLeftMessage* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); } -#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) -} + // implements Message ---------------------------------------------- -// 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; + 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 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; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "SessionProtos.GroupUpdateMemberLeftMessage"; + } + protected: + explicit GroupUpdateMemberLeftMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + std::string GetTypeName() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:SessionProtos.GroupUpdateMemberLeftMessage) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + 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::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); + GroupUpdateMemberLeftNotificationMessage(GroupUpdateMemberLeftNotificationMessage&& from) noexcept + : GroupUpdateMemberLeftNotificationMessage() { + *this = ::std::move(from); + } + + inline GroupUpdateMemberLeftNotificationMessage& operator=(const GroupUpdateMemberLeftNotificationMessage& from) { + CopyFrom(from); + return *this; + } + inline GroupUpdateMemberLeftNotificationMessage& operator=(GroupUpdateMemberLeftNotificationMessage&& 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 GroupUpdateMemberLeftNotificationMessage& default_instance() { + return *internal_default_instance(); + } + static inline const GroupUpdateMemberLeftNotificationMessage* internal_default_instance() { + return reinterpret_cast( + &_GroupUpdateMemberLeftNotificationMessage_default_instance_); + } + static constexpr int kIndexInFileMessages = + 24; + + friend void swap(GroupUpdateMemberLeftNotificationMessage& a, GroupUpdateMemberLeftNotificationMessage& b) { + a.Swap(&b); + } + inline void Swap(GroupUpdateMemberLeftNotificationMessage* 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(GroupUpdateMemberLeftNotificationMessage* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + 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 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; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "SessionProtos.GroupUpdateMemberLeftNotificationMessage"; + } + protected: + explicit GroupUpdateMemberLeftNotificationMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + std::string GetTypeName() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@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_ { + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_SessionProtos_2eproto; +}; +// ------------------------------------------------------------------- + +class GroupUpdateInviteResponseMessage final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:SessionProtos.GroupUpdateInviteResponseMessage) */ { + public: + inline GroupUpdateInviteResponseMessage() : GroupUpdateInviteResponseMessage(nullptr) {} + ~GroupUpdateInviteResponseMessage() override; + explicit PROTOBUF_CONSTEXPR GroupUpdateInviteResponseMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + GroupUpdateInviteResponseMessage(const GroupUpdateInviteResponseMessage& from); + GroupUpdateInviteResponseMessage(GroupUpdateInviteResponseMessage&& from) noexcept + : GroupUpdateInviteResponseMessage() { + *this = ::std::move(from); + } + + inline GroupUpdateInviteResponseMessage& operator=(const GroupUpdateInviteResponseMessage& from) { + CopyFrom(from); + return *this; + } + inline GroupUpdateInviteResponseMessage& operator=(GroupUpdateInviteResponseMessage&& 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 GroupUpdateInviteResponseMessage& default_instance() { + return *internal_default_instance(); + } + static inline const GroupUpdateInviteResponseMessage* internal_default_instance() { + return reinterpret_cast( + &_GroupUpdateInviteResponseMessage_default_instance_); + } + static constexpr int kIndexInFileMessages = + 25; + + friend void swap(GroupUpdateInviteResponseMessage& a, GroupUpdateInviteResponseMessage& b) { + a.Swap(&b); + } + inline void Swap(GroupUpdateInviteResponseMessage* 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(GroupUpdateInviteResponseMessage* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + 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 GroupUpdateInviteResponseMessage& from); + void MergeFrom(const GroupUpdateInviteResponseMessage& 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(GroupUpdateInviteResponseMessage* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "SessionProtos.GroupUpdateInviteResponseMessage"; + } + protected: + explicit GroupUpdateInviteResponseMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + std::string GetTypeName() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kIsApprovedFieldNumber = 1, + }; + // required bool isApproved = 1; + 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: + + // @@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::MessageLite /* @@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 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 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); + } + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; + void CopyFrom(const GroupUpdateDeleteMemberContentMessage& from); + void MergeFrom(const GroupUpdateDeleteMemberContentMessage& 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(GroupUpdateDeleteMemberContentMessage* other); + + private: + 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: + + std::string GetTypeName() 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: + 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.GroupUpdateDeleteMemberContentMessage) + 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 membersessionids_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField messagehashes_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr adminsignature_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_SessionProtos_2eproto; +}; +// ------------------------------------------------------------------- + +class ProProof final : + 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 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 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); + } + 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; + + 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(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: + + std::string GetTypeName() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kGenIndexHashFieldNumber = 2, + kRotatingPublicKeyFieldNumber = 3, + kSigFieldNumber = 5, + kExpiryUnixTsFieldNumber = 4, + kVersionFieldNumber = 1, + }; + // optional 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: + + // optional 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: + + // optional 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: + + // optional 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: + + // optional 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; + + 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 ProMessage final : + public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@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 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 ProMessage& default_instance() { + return *internal_default_instance(); + } + static inline const ProMessage* internal_default_instance() { + return reinterpret_cast( + &_ProMessage_default_instance_); + } + static constexpr int kIndexInFileMessages = + 28; + + 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); + } + void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; + void CopyFrom(const ProMessage& from); + void MergeFrom(const ProMessage& 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(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: + + std::string GetTypeName() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kProofFieldNumber = 1, + kFeaturesFieldNumber = 2, + }; + // optional .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(); + + // optional uint64 features = 2; + bool has_features() const; + private: + bool _internal_has_features() const; + public: + void clear_features(); + uint64_t features() const; + void set_features(uint64_t value); + private: + uint64_t _internal_features() const; + void _internal_set_features(uint64_t value); + public: + + // @@protoc_insertion_point(class_scope:SessionProtos.ProMessage) + 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_; + ::SessionProtos::ProProof* proof_; + uint64_t features_; + }; + 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); @@ -5945,7 +6917,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 { @@ -5953,22 +6925,90 @@ 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_; +} +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] |= 0x00000010u; + _impl_.servertimestamp_ = value; +} +inline void Envelope::set_servertimestamp(uint64_t value) { + _internal_set_servertimestamp(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 uint64_t Envelope::_internal_servertimestamp() const { - return _impl_.servertimestamp_; +inline const std::string& Envelope::_internal_prosig() const { + return _impl_.prosig_.Get(); } -inline uint64_t Envelope::servertimestamp() const { - // @@protoc_insertion_point(field_get:SessionProtos.Envelope.serverTimestamp) - return _internal_servertimestamp(); +inline void Envelope::_internal_set_prosig(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.prosig_.Set(value, GetArenaForAllocation()); } -inline void Envelope::_internal_set_servertimestamp(uint64_t value) { - _impl_._has_bits_[0] |= 0x00000008u; - _impl_.servertimestamp_ = value; +inline std::string* Envelope::_internal_mutable_prosig() { + _impl_._has_bits_[0] |= 0x00000004u; + return _impl_.prosig_.Mutable(GetArenaForAllocation()); } -inline void Envelope::set_servertimestamp(uint64_t value) { - _internal_set_servertimestamp(value); - // @@protoc_insertion_point(field_set:SessionProtos.Envelope.serverTimestamp) +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) } // ------------------------------------------------------------------- @@ -6686,99 +7726,9 @@ inline void Content::set_allocated_typingmessage(::SessionProtos::TypingMessage* // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.typingMessage) } -// 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); - return value; -} -inline bool Content::has_configurationmessage() const { - return _internal_has_configurationmessage(); -} -inline void Content::clear_configurationmessage() { - if (_impl_.configurationmessage_ != nullptr) _impl_.configurationmessage_->Clear(); - _impl_._has_bits_[0] &= ~0x00000010u; -} -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::ConfigurationMessage& Content::configurationmessage() const { - // @@protoc_insertion_point(field_get:SessionProtos.Content.configurationMessage) - return _internal_configurationmessage(); -} -inline void Content::unsafe_arena_set_allocated_configurationmessage( - ::SessionProtos::ConfigurationMessage* configurationmessage) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.configurationmessage_); - } - _impl_.configurationmessage_ = configurationmessage; - if (configurationmessage) { - _impl_._has_bits_[0] |= 0x00000010u; - } else { - _impl_._has_bits_[0] &= ~0x00000010u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.configurationMessage) -} -inline ::SessionProtos::ConfigurationMessage* Content::release_configurationmessage() { - _impl_._has_bits_[0] &= ~0x00000010u; - ::SessionProtos::ConfigurationMessage* temp = _impl_.configurationmessage_; - _impl_.configurationmessage_ = 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* 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; - 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; - } - return _impl_.configurationmessage_; -} -inline ::SessionProtos::ConfigurationMessage* Content::mutable_configurationmessage() { - ::SessionProtos::ConfigurationMessage* _msg = _internal_mutable_configurationmessage(); - // @@protoc_insertion_point(field_mutable:SessionProtos.Content.configurationMessage) - return _msg; -} -inline void Content::set_allocated_configurationmessage(::SessionProtos::ConfigurationMessage* configurationmessage) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete _impl_.configurationmessage_; - } - if (configurationmessage) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(configurationmessage); - if (message_arena != submessage_arena) { - configurationmessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, configurationmessage, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000010u; - } else { - _impl_._has_bits_[0] &= ~0x00000010u; - } - _impl_.configurationmessage_ = configurationmessage; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.configurationMessage) -} - // optional .SessionProtos.DataExtractionNotification dataExtractionNotification = 8; inline bool Content::_internal_has_dataextractionnotification() const { - bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; PROTOBUF_ASSUME(!value || _impl_.dataextractionnotification_ != nullptr); return value; } @@ -6787,7 +7737,7 @@ inline bool Content::has_dataextractionnotification() const { } inline void Content::clear_dataextractionnotification() { if (_impl_.dataextractionnotification_ != nullptr) _impl_.dataextractionnotification_->Clear(); - _impl_._has_bits_[0] &= ~0x00000020u; + _impl_._has_bits_[0] &= ~0x00000010u; } inline const ::SessionProtos::DataExtractionNotification& Content::_internal_dataextractionnotification() const { const ::SessionProtos::DataExtractionNotification* p = _impl_.dataextractionnotification_; @@ -6805,14 +7755,14 @@ inline void Content::unsafe_arena_set_allocated_dataextractionnotification( } _impl_.dataextractionnotification_ = dataextractionnotification; if (dataextractionnotification) { - _impl_._has_bits_[0] |= 0x00000020u; + _impl_._has_bits_[0] |= 0x00000010u; } else { - _impl_._has_bits_[0] &= ~0x00000020u; + _impl_._has_bits_[0] &= ~0x00000010u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.dataExtractionNotification) } inline ::SessionProtos::DataExtractionNotification* Content::release_dataextractionnotification() { - _impl_._has_bits_[0] &= ~0x00000020u; + _impl_._has_bits_[0] &= ~0x00000010u; ::SessionProtos::DataExtractionNotification* temp = _impl_.dataextractionnotification_; _impl_.dataextractionnotification_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE @@ -6828,13 +7778,13 @@ inline ::SessionProtos::DataExtractionNotification* Content::release_dataextract } inline ::SessionProtos::DataExtractionNotification* Content::unsafe_arena_release_dataextractionnotification() { // @@protoc_insertion_point(field_release:SessionProtos.Content.dataExtractionNotification) - _impl_._has_bits_[0] &= ~0x00000020u; + _impl_._has_bits_[0] &= ~0x00000010u; ::SessionProtos::DataExtractionNotification* temp = _impl_.dataextractionnotification_; _impl_.dataextractionnotification_ = nullptr; return temp; } inline ::SessionProtos::DataExtractionNotification* Content::_internal_mutable_dataextractionnotification() { - _impl_._has_bits_[0] |= 0x00000020u; + _impl_._has_bits_[0] |= 0x00000010u; if (_impl_.dataextractionnotification_ == nullptr) { auto* p = CreateMaybeMessage<::SessionProtos::DataExtractionNotification>(GetArenaForAllocation()); _impl_.dataextractionnotification_ = p; @@ -6858,9 +7808,9 @@ inline void Content::set_allocated_dataextractionnotification(::SessionProtos::D dataextractionnotification = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, dataextractionnotification, submessage_arena); } - _impl_._has_bits_[0] |= 0x00000020u; + _impl_._has_bits_[0] |= 0x00000010u; } else { - _impl_._has_bits_[0] &= ~0x00000020u; + _impl_._has_bits_[0] &= ~0x00000010u; } _impl_.dataextractionnotification_ = dataextractionnotification; // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.dataExtractionNotification) @@ -6868,7 +7818,7 @@ inline void Content::set_allocated_dataextractionnotification(::SessionProtos::D // optional .SessionProtos.UnsendRequest unsendRequest = 9; inline bool Content::_internal_has_unsendrequest() const { - bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; PROTOBUF_ASSUME(!value || _impl_.unsendrequest_ != nullptr); return value; } @@ -6877,7 +7827,7 @@ inline bool Content::has_unsendrequest() const { } inline void Content::clear_unsendrequest() { if (_impl_.unsendrequest_ != nullptr) _impl_.unsendrequest_->Clear(); - _impl_._has_bits_[0] &= ~0x00000040u; + _impl_._has_bits_[0] &= ~0x00000020u; } inline const ::SessionProtos::UnsendRequest& Content::_internal_unsendrequest() const { const ::SessionProtos::UnsendRequest* p = _impl_.unsendrequest_; @@ -6895,14 +7845,14 @@ inline void Content::unsafe_arena_set_allocated_unsendrequest( } _impl_.unsendrequest_ = unsendrequest; if (unsendrequest) { - _impl_._has_bits_[0] |= 0x00000040u; + _impl_._has_bits_[0] |= 0x00000020u; } else { - _impl_._has_bits_[0] &= ~0x00000040u; + _impl_._has_bits_[0] &= ~0x00000020u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.unsendRequest) } inline ::SessionProtos::UnsendRequest* Content::release_unsendrequest() { - _impl_._has_bits_[0] &= ~0x00000040u; + _impl_._has_bits_[0] &= ~0x00000020u; ::SessionProtos::UnsendRequest* temp = _impl_.unsendrequest_; _impl_.unsendrequest_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE @@ -6918,13 +7868,13 @@ inline ::SessionProtos::UnsendRequest* Content::release_unsendrequest() { } inline ::SessionProtos::UnsendRequest* Content::unsafe_arena_release_unsendrequest() { // @@protoc_insertion_point(field_release:SessionProtos.Content.unsendRequest) - _impl_._has_bits_[0] &= ~0x00000040u; + _impl_._has_bits_[0] &= ~0x00000020u; ::SessionProtos::UnsendRequest* temp = _impl_.unsendrequest_; _impl_.unsendrequest_ = nullptr; return temp; } inline ::SessionProtos::UnsendRequest* Content::_internal_mutable_unsendrequest() { - _impl_._has_bits_[0] |= 0x00000040u; + _impl_._has_bits_[0] |= 0x00000020u; if (_impl_.unsendrequest_ == nullptr) { auto* p = CreateMaybeMessage<::SessionProtos::UnsendRequest>(GetArenaForAllocation()); _impl_.unsendrequest_ = p; @@ -6948,9 +7898,9 @@ inline void Content::set_allocated_unsendrequest(::SessionProtos::UnsendRequest* unsendrequest = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, unsendrequest, submessage_arena); } - _impl_._has_bits_[0] |= 0x00000040u; + _impl_._has_bits_[0] |= 0x00000020u; } else { - _impl_._has_bits_[0] &= ~0x00000040u; + _impl_._has_bits_[0] &= ~0x00000020u; } _impl_.unsendrequest_ = unsendrequest; // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.unsendRequest) @@ -6958,7 +7908,7 @@ inline void Content::set_allocated_unsendrequest(::SessionProtos::UnsendRequest* // optional .SessionProtos.MessageRequestResponse messageRequestResponse = 10; inline bool Content::_internal_has_messagerequestresponse() const { - bool value = (_impl_._has_bits_[0] & 0x00000080u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; PROTOBUF_ASSUME(!value || _impl_.messagerequestresponse_ != nullptr); return value; } @@ -6967,7 +7917,7 @@ inline bool Content::has_messagerequestresponse() const { } inline void Content::clear_messagerequestresponse() { if (_impl_.messagerequestresponse_ != nullptr) _impl_.messagerequestresponse_->Clear(); - _impl_._has_bits_[0] &= ~0x00000080u; + _impl_._has_bits_[0] &= ~0x00000040u; } inline const ::SessionProtos::MessageRequestResponse& Content::_internal_messagerequestresponse() const { const ::SessionProtos::MessageRequestResponse* p = _impl_.messagerequestresponse_; @@ -6985,14 +7935,14 @@ inline void Content::unsafe_arena_set_allocated_messagerequestresponse( } _impl_.messagerequestresponse_ = messagerequestresponse; if (messagerequestresponse) { - _impl_._has_bits_[0] |= 0x00000080u; + _impl_._has_bits_[0] |= 0x00000040u; } else { - _impl_._has_bits_[0] &= ~0x00000080u; + _impl_._has_bits_[0] &= ~0x00000040u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.messageRequestResponse) } inline ::SessionProtos::MessageRequestResponse* Content::release_messagerequestresponse() { - _impl_._has_bits_[0] &= ~0x00000080u; + _impl_._has_bits_[0] &= ~0x00000040u; ::SessionProtos::MessageRequestResponse* temp = _impl_.messagerequestresponse_; _impl_.messagerequestresponse_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE @@ -7008,13 +7958,13 @@ inline ::SessionProtos::MessageRequestResponse* Content::release_messagerequestr } inline ::SessionProtos::MessageRequestResponse* Content::unsafe_arena_release_messagerequestresponse() { // @@protoc_insertion_point(field_release:SessionProtos.Content.messageRequestResponse) - _impl_._has_bits_[0] &= ~0x00000080u; + _impl_._has_bits_[0] &= ~0x00000040u; ::SessionProtos::MessageRequestResponse* temp = _impl_.messagerequestresponse_; _impl_.messagerequestresponse_ = nullptr; return temp; } inline ::SessionProtos::MessageRequestResponse* Content::_internal_mutable_messagerequestresponse() { - _impl_._has_bits_[0] |= 0x00000080u; + _impl_._has_bits_[0] |= 0x00000040u; if (_impl_.messagerequestresponse_ == nullptr) { auto* p = CreateMaybeMessage<::SessionProtos::MessageRequestResponse>(GetArenaForAllocation()); _impl_.messagerequestresponse_ = p; @@ -7038,9 +7988,9 @@ inline void Content::set_allocated_messagerequestresponse(::SessionProtos::Messa messagerequestresponse = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, messagerequestresponse, submessage_arena); } - _impl_._has_bits_[0] |= 0x00000080u; + _impl_._has_bits_[0] |= 0x00000040u; } else { - _impl_._has_bits_[0] &= ~0x00000080u; + _impl_._has_bits_[0] &= ~0x00000040u; } _impl_.messagerequestresponse_ = messagerequestresponse; // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.messageRequestResponse) @@ -7048,7 +7998,7 @@ inline void Content::set_allocated_messagerequestresponse(::SessionProtos::Messa // optional .SessionProtos.SharedConfigMessage sharedConfigMessage = 11; inline bool Content::_internal_has_sharedconfigmessage() const { - bool value = (_impl_._has_bits_[0] & 0x00000100u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000080u) != 0; PROTOBUF_ASSUME(!value || _impl_.sharedconfigmessage_ != nullptr); return value; } @@ -7057,34 +8007,209 @@ inline bool Content::has_sharedconfigmessage() const { } inline void Content::clear_sharedconfigmessage() { if (_impl_.sharedconfigmessage_ != nullptr) _impl_.sharedconfigmessage_->Clear(); + _impl_._has_bits_[0] &= ~0x00000080u; +} +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] |= 0x00000080u; + } else { + _impl_._has_bits_[0] &= ~0x00000080u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.sharedConfigMessage) +} +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); + 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] &= ~0x00000080u; + ::SessionProtos::SharedConfigMessage* temp = _impl_.sharedconfigmessage_; + _impl_.sharedconfigmessage_ = nullptr; + return temp; +} +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_.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] |= 0x00000080u; + } else { + _impl_._has_bits_[0] &= ~0x00000080u; + } + _impl_.sharedconfigmessage_ = sharedconfigmessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.sharedConfigMessage) +} + +// optional .SessionProtos.Content.ExpirationType expirationType = 12; +inline bool Content::_internal_has_expirationtype() const { + bool value = (_impl_._has_bits_[0] & 0x00000200u) != 0; + return value; +} +inline bool Content::has_expirationtype() const { + return _internal_has_expirationtype(); +} +inline void Content::clear_expirationtype() { + _impl_.expirationtype_ = 0; + _impl_._has_bits_[0] &= ~0x00000200u; +} +inline ::SessionProtos::Content_ExpirationType Content::_internal_expirationtype() const { + return static_cast< ::SessionProtos::Content_ExpirationType >(_impl_.expirationtype_); +} +inline ::SessionProtos::Content_ExpirationType Content::expirationtype() const { + // @@protoc_insertion_point(field_get:SessionProtos.Content.expirationType) + return _internal_expirationtype(); +} +inline void Content::_internal_set_expirationtype(::SessionProtos::Content_ExpirationType value) { + assert(::SessionProtos::Content_ExpirationType_IsValid(value)); + _impl_._has_bits_[0] |= 0x00000200u; + _impl_.expirationtype_ = value; +} +inline void Content::set_expirationtype(::SessionProtos::Content_ExpirationType value) { + _internal_set_expirationtype(value); + // @@protoc_insertion_point(field_set:SessionProtos.Content.expirationType) +} + +// optional uint32 expirationTimer = 13; +inline bool Content::_internal_has_expirationtimer() const { + bool value = (_impl_._has_bits_[0] & 0x00000400u) != 0; + return value; +} +inline bool Content::has_expirationtimer() const { + return _internal_has_expirationtimer(); +} +inline void Content::clear_expirationtimer() { + _impl_.expirationtimer_ = 0u; + _impl_._has_bits_[0] &= ~0x00000400u; +} +inline uint32_t Content::_internal_expirationtimer() const { + return _impl_.expirationtimer_; +} +inline uint32_t Content::expirationtimer() const { + // @@protoc_insertion_point(field_get:SessionProtos.Content.expirationTimer) + return _internal_expirationtimer(); +} +inline void Content::_internal_set_expirationtimer(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000400u; + _impl_.expirationtimer_ = value; +} +inline void Content::set_expirationtimer(uint32_t value) { + _internal_set_expirationtimer(value); + // @@protoc_insertion_point(field_set:SessionProtos.Content.expirationTimer) +} + +// optional uint64 sigTimestamp = 15; +inline bool Content::_internal_has_sigtimestamp() const { + bool value = (_impl_._has_bits_[0] & 0x00000800u) != 0; + return value; +} +inline bool Content::has_sigtimestamp() const { + return _internal_has_sigtimestamp(); +} +inline void Content::clear_sigtimestamp() { + _impl_.sigtimestamp_ = uint64_t{0u}; + _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::SharedConfigMessage& Content::_internal_sharedconfigmessage() const { - const ::SessionProtos::SharedConfigMessage* p = _impl_.sharedconfigmessage_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_SharedConfigMessage_default_instance_); +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::SharedConfigMessage& Content::sharedconfigmessage() const { - // @@protoc_insertion_point(field_get:SessionProtos.Content.sharedConfigMessage) - return _internal_sharedconfigmessage(); +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_sharedconfigmessage( - ::SessionProtos::SharedConfigMessage* sharedconfigmessage) { +inline void Content::unsafe_arena_set_allocated_promessage( + ::SessionProtos::ProMessage* promessage) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.sharedconfigmessage_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.promessage_); } - _impl_.sharedconfigmessage_ = sharedconfigmessage; - if (sharedconfigmessage) { + _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.sharedConfigMessage) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.Content.proMessage) } -inline ::SessionProtos::SharedConfigMessage* Content::release_sharedconfigmessage() { +inline ::SessionProtos::ProMessage* Content::release_promessage() { _impl_._has_bits_[0] &= ~0x00000100u; - ::SessionProtos::SharedConfigMessage* temp = _impl_.sharedconfigmessage_; - _impl_.sharedconfigmessage_ = nullptr; + ::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); @@ -7096,44 +8221,44 @@ inline ::SessionProtos::SharedConfigMessage* Content::release_sharedconfigmessag #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::SessionProtos::SharedConfigMessage* Content::unsafe_arena_release_sharedconfigmessage() { - // @@protoc_insertion_point(field_release:SessionProtos.Content.sharedConfigMessage) +inline ::SessionProtos::ProMessage* Content::unsafe_arena_release_promessage() { + // @@protoc_insertion_point(field_release:SessionProtos.Content.proMessage) _impl_._has_bits_[0] &= ~0x00000100u; - ::SessionProtos::SharedConfigMessage* temp = _impl_.sharedconfigmessage_; - _impl_.sharedconfigmessage_ = nullptr; + ::SessionProtos::ProMessage* temp = _impl_.promessage_; + _impl_.promessage_ = nullptr; return temp; } -inline ::SessionProtos::SharedConfigMessage* Content::_internal_mutable_sharedconfigmessage() { +inline ::SessionProtos::ProMessage* Content::_internal_mutable_promessage() { _impl_._has_bits_[0] |= 0x00000100u; - if (_impl_.sharedconfigmessage_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::SharedConfigMessage>(GetArenaForAllocation()); - _impl_.sharedconfigmessage_ = p; + if (_impl_.promessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::ProMessage>(GetArenaForAllocation()); + _impl_.promessage_ = p; } - return _impl_.sharedconfigmessage_; + return _impl_.promessage_; } -inline ::SessionProtos::SharedConfigMessage* Content::mutable_sharedconfigmessage() { - ::SessionProtos::SharedConfigMessage* _msg = _internal_mutable_sharedconfigmessage(); - // @@protoc_insertion_point(field_mutable:SessionProtos.Content.sharedConfigMessage) +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_allocated_sharedconfigmessage(::SessionProtos::SharedConfigMessage* sharedconfigmessage) { +inline void Content::set_allocated_promessage(::SessionProtos::ProMessage* promessage) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.sharedconfigmessage_; + delete _impl_.promessage_; } - if (sharedconfigmessage) { + if (promessage) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(sharedconfigmessage); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(promessage); if (message_arena != submessage_arena) { - sharedconfigmessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, sharedconfigmessage, 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_.sharedconfigmessage_ = sharedconfigmessage; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.sharedConfigMessage) + _impl_.promessage_ = promessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.Content.proMessage) } // ------------------------------------------------------------------- @@ -7233,727 +8358,1193 @@ inline void CallMessage::add_sdps(const char* value, size_t size) { _impl_.sdps_.Add()->assign(reinterpret_cast(value), size); // @@protoc_insertion_point(field_add_pointer:SessionProtos.CallMessage.sdps) } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -CallMessage::sdps() const { - // @@protoc_insertion_point(field_list:SessionProtos.CallMessage.sdps) - return _impl_.sdps_; +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& +CallMessage::sdps() const { + // @@protoc_insertion_point(field_list:SessionProtos.CallMessage.sdps) + return _impl_.sdps_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* +CallMessage::mutable_sdps() { + // @@protoc_insertion_point(field_mutable_list:SessionProtos.CallMessage.sdps) + return &_impl_.sdps_; +} + +// repeated uint32 sdpMLineIndexes = 3; +inline int CallMessage::_internal_sdpmlineindexes_size() const { + return _impl_.sdpmlineindexes_.size(); +} +inline int CallMessage::sdpmlineindexes_size() const { + return _internal_sdpmlineindexes_size(); +} +inline void CallMessage::clear_sdpmlineindexes() { + _impl_.sdpmlineindexes_.Clear(); +} +inline uint32_t CallMessage::_internal_sdpmlineindexes(int index) const { + return _impl_.sdpmlineindexes_.Get(index); +} +inline uint32_t CallMessage::sdpmlineindexes(int index) const { + // @@protoc_insertion_point(field_get:SessionProtos.CallMessage.sdpMLineIndexes) + return _internal_sdpmlineindexes(index); +} +inline void CallMessage::set_sdpmlineindexes(int index, uint32_t value) { + _impl_.sdpmlineindexes_.Set(index, value); + // @@protoc_insertion_point(field_set:SessionProtos.CallMessage.sdpMLineIndexes) +} +inline void CallMessage::_internal_add_sdpmlineindexes(uint32_t value) { + _impl_.sdpmlineindexes_.Add(value); +} +inline void CallMessage::add_sdpmlineindexes(uint32_t value) { + _internal_add_sdpmlineindexes(value); + // @@protoc_insertion_point(field_add:SessionProtos.CallMessage.sdpMLineIndexes) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >& +CallMessage::_internal_sdpmlineindexes() const { + return _impl_.sdpmlineindexes_; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >& +CallMessage::sdpmlineindexes() const { + // @@protoc_insertion_point(field_list:SessionProtos.CallMessage.sdpMLineIndexes) + return _internal_sdpmlineindexes(); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >* +CallMessage::_internal_mutable_sdpmlineindexes() { + return &_impl_.sdpmlineindexes_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >* +CallMessage::mutable_sdpmlineindexes() { + // @@protoc_insertion_point(field_mutable_list:SessionProtos.CallMessage.sdpMLineIndexes) + return _internal_mutable_sdpmlineindexes(); +} + +// repeated string sdpMids = 4; +inline int CallMessage::_internal_sdpmids_size() const { + return _impl_.sdpmids_.size(); +} +inline int CallMessage::sdpmids_size() const { + return _internal_sdpmids_size(); +} +inline void CallMessage::clear_sdpmids() { + _impl_.sdpmids_.Clear(); +} +inline std::string* CallMessage::add_sdpmids() { + std::string* _s = _internal_add_sdpmids(); + // @@protoc_insertion_point(field_add_mutable:SessionProtos.CallMessage.sdpMids) + return _s; +} +inline const std::string& CallMessage::_internal_sdpmids(int index) const { + return _impl_.sdpmids_.Get(index); +} +inline const std::string& CallMessage::sdpmids(int index) const { + // @@protoc_insertion_point(field_get:SessionProtos.CallMessage.sdpMids) + return _internal_sdpmids(index); +} +inline std::string* CallMessage::mutable_sdpmids(int index) { + // @@protoc_insertion_point(field_mutable:SessionProtos.CallMessage.sdpMids) + return _impl_.sdpmids_.Mutable(index); +} +inline void CallMessage::set_sdpmids(int index, const std::string& value) { + _impl_.sdpmids_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set:SessionProtos.CallMessage.sdpMids) +} +inline void CallMessage::set_sdpmids(int index, std::string&& value) { + _impl_.sdpmids_.Mutable(index)->assign(std::move(value)); + // @@protoc_insertion_point(field_set:SessionProtos.CallMessage.sdpMids) +} +inline void CallMessage::set_sdpmids(int index, const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.sdpmids_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:SessionProtos.CallMessage.sdpMids) +} +inline void CallMessage::set_sdpmids(int index, const char* value, size_t size) { + _impl_.sdpmids_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:SessionProtos.CallMessage.sdpMids) +} +inline std::string* CallMessage::_internal_add_sdpmids() { + return _impl_.sdpmids_.Add(); +} +inline void CallMessage::add_sdpmids(const std::string& value) { + _impl_.sdpmids_.Add()->assign(value); + // @@protoc_insertion_point(field_add:SessionProtos.CallMessage.sdpMids) +} +inline void CallMessage::add_sdpmids(std::string&& value) { + _impl_.sdpmids_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:SessionProtos.CallMessage.sdpMids) +} +inline void CallMessage::add_sdpmids(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.sdpmids_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:SessionProtos.CallMessage.sdpMids) +} +inline void CallMessage::add_sdpmids(const char* value, size_t size) { + _impl_.sdpmids_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:SessionProtos.CallMessage.sdpMids) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& +CallMessage::sdpmids() const { + // @@protoc_insertion_point(field_list:SessionProtos.CallMessage.sdpMids) + return _impl_.sdpmids_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* +CallMessage::mutable_sdpmids() { + // @@protoc_insertion_point(field_mutable_list:SessionProtos.CallMessage.sdpMids) + return &_impl_.sdpmids_; +} + +// required string uuid = 5; +inline bool CallMessage::_internal_has_uuid() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool CallMessage::has_uuid() const { + return _internal_has_uuid(); +} +inline void CallMessage::clear_uuid() { + _impl_.uuid_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& CallMessage::uuid() const { + // @@protoc_insertion_point(field_get:SessionProtos.CallMessage.uuid) + return _internal_uuid(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void CallMessage::set_uuid(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.uuid_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.CallMessage.uuid) +} +inline std::string* CallMessage::mutable_uuid() { + std::string* _s = _internal_mutable_uuid(); + // @@protoc_insertion_point(field_mutable:SessionProtos.CallMessage.uuid) + return _s; +} +inline const std::string& CallMessage::_internal_uuid() const { + return _impl_.uuid_.Get(); +} +inline void CallMessage::_internal_set_uuid(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.uuid_.Set(value, GetArenaForAllocation()); +} +inline std::string* CallMessage::_internal_mutable_uuid() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.uuid_.Mutable(GetArenaForAllocation()); +} +inline std::string* CallMessage::release_uuid() { + // @@protoc_insertion_point(field_release:SessionProtos.CallMessage.uuid) + if (!_internal_has_uuid()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.uuid_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.uuid_.IsDefault()) { + _impl_.uuid_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void CallMessage::set_allocated_uuid(std::string* uuid) { + if (uuid != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.uuid_.SetAllocated(uuid, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.uuid_.IsDefault()) { + _impl_.uuid_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.CallMessage.uuid) +} + +// ------------------------------------------------------------------- + +// KeyPair + +// required bytes publicKey = 1; +inline bool KeyPair::_internal_has_publickey() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool KeyPair::has_publickey() const { + return _internal_has_publickey(); +} +inline void KeyPair::clear_publickey() { + _impl_.publickey_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& KeyPair::publickey() const { + // @@protoc_insertion_point(field_get:SessionProtos.KeyPair.publicKey) + return _internal_publickey(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void KeyPair::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.KeyPair.publicKey) } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -CallMessage::mutable_sdps() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.CallMessage.sdps) - return &_impl_.sdps_; +inline std::string* KeyPair::mutable_publickey() { + std::string* _s = _internal_mutable_publickey(); + // @@protoc_insertion_point(field_mutable:SessionProtos.KeyPair.publicKey) + return _s; } - -// repeated uint32 sdpMLineIndexes = 3; -inline int CallMessage::_internal_sdpmlineindexes_size() const { - return _impl_.sdpmlineindexes_.size(); +inline const std::string& KeyPair::_internal_publickey() const { + return _impl_.publickey_.Get(); } -inline int CallMessage::sdpmlineindexes_size() const { - return _internal_sdpmlineindexes_size(); +inline void KeyPair::_internal_set_publickey(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.publickey_.Set(value, GetArenaForAllocation()); } -inline void CallMessage::clear_sdpmlineindexes() { - _impl_.sdpmlineindexes_.Clear(); +inline std::string* KeyPair::_internal_mutable_publickey() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.publickey_.Mutable(GetArenaForAllocation()); } -inline uint32_t CallMessage::_internal_sdpmlineindexes(int index) const { - return _impl_.sdpmlineindexes_.Get(index); +inline std::string* KeyPair::release_publickey() { + // @@protoc_insertion_point(field_release:SessionProtos.KeyPair.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 uint32_t CallMessage::sdpmlineindexes(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.CallMessage.sdpMLineIndexes) - return _internal_sdpmlineindexes(index); +inline void KeyPair::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.KeyPair.publicKey) } -inline void CallMessage::set_sdpmlineindexes(int index, uint32_t value) { - _impl_.sdpmlineindexes_.Set(index, value); - // @@protoc_insertion_point(field_set:SessionProtos.CallMessage.sdpMLineIndexes) + +// required bytes privateKey = 2; +inline bool KeyPair::_internal_has_privatekey() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; } -inline void CallMessage::_internal_add_sdpmlineindexes(uint32_t value) { - _impl_.sdpmlineindexes_.Add(value); +inline bool KeyPair::has_privatekey() const { + return _internal_has_privatekey(); } -inline void CallMessage::add_sdpmlineindexes(uint32_t value) { - _internal_add_sdpmlineindexes(value); - // @@protoc_insertion_point(field_add:SessionProtos.CallMessage.sdpMLineIndexes) +inline void KeyPair::clear_privatekey() { + _impl_.privatekey_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >& -CallMessage::_internal_sdpmlineindexes() const { - return _impl_.sdpmlineindexes_; +inline const std::string& KeyPair::privatekey() const { + // @@protoc_insertion_point(field_get:SessionProtos.KeyPair.privateKey) + return _internal_privatekey(); } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >& -CallMessage::sdpmlineindexes() const { - // @@protoc_insertion_point(field_list:SessionProtos.CallMessage.sdpMLineIndexes) - return _internal_sdpmlineindexes(); +template +inline PROTOBUF_ALWAYS_INLINE +void KeyPair::set_privatekey(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.privatekey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.KeyPair.privateKey) } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >* -CallMessage::_internal_mutable_sdpmlineindexes() { - return &_impl_.sdpmlineindexes_; +inline std::string* KeyPair::mutable_privatekey() { + std::string* _s = _internal_mutable_privatekey(); + // @@protoc_insertion_point(field_mutable:SessionProtos.KeyPair.privateKey) + return _s; } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >* -CallMessage::mutable_sdpmlineindexes() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.CallMessage.sdpMLineIndexes) - return _internal_mutable_sdpmlineindexes(); +inline const std::string& KeyPair::_internal_privatekey() const { + return _impl_.privatekey_.Get(); } - -// repeated string sdpMids = 4; -inline int CallMessage::_internal_sdpmids_size() const { - return _impl_.sdpmids_.size(); +inline void KeyPair::_internal_set_privatekey(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.privatekey_.Set(value, GetArenaForAllocation()); } -inline int CallMessage::sdpmids_size() const { - return _internal_sdpmids_size(); +inline std::string* KeyPair::_internal_mutable_privatekey() { + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.privatekey_.Mutable(GetArenaForAllocation()); } -inline void CallMessage::clear_sdpmids() { - _impl_.sdpmids_.Clear(); +inline std::string* KeyPair::release_privatekey() { + // @@protoc_insertion_point(field_release:SessionProtos.KeyPair.privateKey) + if (!_internal_has_privatekey()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.privatekey_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.privatekey_.IsDefault()) { + _impl_.privatekey_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; } -inline std::string* CallMessage::add_sdpmids() { - std::string* _s = _internal_add_sdpmids(); - // @@protoc_insertion_point(field_add_mutable:SessionProtos.CallMessage.sdpMids) - return _s; +inline void KeyPair::set_allocated_privatekey(std::string* privatekey) { + if (privatekey != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + _impl_.privatekey_.SetAllocated(privatekey, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.privatekey_.IsDefault()) { + _impl_.privatekey_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.KeyPair.privateKey) } -inline const std::string& CallMessage::_internal_sdpmids(int index) const { - return _impl_.sdpmids_.Get(index); + +// ------------------------------------------------------------------- + +// DataExtractionNotification + +// required .SessionProtos.DataExtractionNotification.Type type = 1; +inline bool DataExtractionNotification::_internal_has_type() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; } -inline const std::string& CallMessage::sdpmids(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.CallMessage.sdpMids) - return _internal_sdpmids(index); +inline bool DataExtractionNotification::has_type() const { + return _internal_has_type(); } -inline std::string* CallMessage::mutable_sdpmids(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.CallMessage.sdpMids) - return _impl_.sdpmids_.Mutable(index); +inline void DataExtractionNotification::clear_type() { + _impl_.type_ = 1; + _impl_._has_bits_[0] &= ~0x00000002u; } -inline void CallMessage::set_sdpmids(int index, const std::string& value) { - _impl_.sdpmids_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set:SessionProtos.CallMessage.sdpMids) +inline ::SessionProtos::DataExtractionNotification_Type DataExtractionNotification::_internal_type() const { + return static_cast< ::SessionProtos::DataExtractionNotification_Type >(_impl_.type_); } -inline void CallMessage::set_sdpmids(int index, std::string&& value) { - _impl_.sdpmids_.Mutable(index)->assign(std::move(value)); - // @@protoc_insertion_point(field_set:SessionProtos.CallMessage.sdpMids) +inline ::SessionProtos::DataExtractionNotification_Type DataExtractionNotification::type() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataExtractionNotification.type) + return _internal_type(); } -inline void CallMessage::set_sdpmids(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.sdpmids_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:SessionProtos.CallMessage.sdpMids) +inline void DataExtractionNotification::_internal_set_type(::SessionProtos::DataExtractionNotification_Type value) { + assert(::SessionProtos::DataExtractionNotification_Type_IsValid(value)); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.type_ = value; } -inline void CallMessage::set_sdpmids(int index, const char* value, size_t size) { - _impl_.sdpmids_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:SessionProtos.CallMessage.sdpMids) +inline void DataExtractionNotification::set_type(::SessionProtos::DataExtractionNotification_Type value) { + _internal_set_type(value); + // @@protoc_insertion_point(field_set:SessionProtos.DataExtractionNotification.type) } -inline std::string* CallMessage::_internal_add_sdpmids() { - return _impl_.sdpmids_.Add(); + +// optional uint64 timestamp = 2; +inline bool DataExtractionNotification::_internal_has_timestamp() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; } -inline void CallMessage::add_sdpmids(const std::string& value) { - _impl_.sdpmids_.Add()->assign(value); - // @@protoc_insertion_point(field_add:SessionProtos.CallMessage.sdpMids) +inline bool DataExtractionNotification::has_timestamp() const { + return _internal_has_timestamp(); } -inline void CallMessage::add_sdpmids(std::string&& value) { - _impl_.sdpmids_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:SessionProtos.CallMessage.sdpMids) +inline void DataExtractionNotification::clear_timestamp() { + _impl_.timestamp_ = uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000001u; } -inline void CallMessage::add_sdpmids(const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.sdpmids_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:SessionProtos.CallMessage.sdpMids) +inline uint64_t DataExtractionNotification::_internal_timestamp() const { + return _impl_.timestamp_; } -inline void CallMessage::add_sdpmids(const char* value, size_t size) { - _impl_.sdpmids_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:SessionProtos.CallMessage.sdpMids) +inline uint64_t DataExtractionNotification::timestamp() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataExtractionNotification.timestamp) + return _internal_timestamp(); } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -CallMessage::sdpmids() const { - // @@protoc_insertion_point(field_list:SessionProtos.CallMessage.sdpMids) - return _impl_.sdpmids_; +inline void DataExtractionNotification::_internal_set_timestamp(uint64_t value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.timestamp_ = value; } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -CallMessage::mutable_sdpmids() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.CallMessage.sdpMids) - return &_impl_.sdpmids_; +inline void DataExtractionNotification::set_timestamp(uint64_t value) { + _internal_set_timestamp(value); + // @@protoc_insertion_point(field_set:SessionProtos.DataExtractionNotification.timestamp) } -// required string uuid = 5; -inline bool CallMessage::_internal_has_uuid() const { +// ------------------------------------------------------------------- + +// LokiProfile + +// optional string displayName = 1; +inline bool LokiProfile::_internal_has_displayname() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool CallMessage::has_uuid() const { - return _internal_has_uuid(); +inline bool LokiProfile::has_displayname() const { + return _internal_has_displayname(); } -inline void CallMessage::clear_uuid() { - _impl_.uuid_.ClearToEmpty(); +inline void LokiProfile::clear_displayname() { + _impl_.displayname_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& CallMessage::uuid() const { - // @@protoc_insertion_point(field_get:SessionProtos.CallMessage.uuid) - return _internal_uuid(); +inline const std::string& LokiProfile::displayname() const { + // @@protoc_insertion_point(field_get:SessionProtos.LokiProfile.displayName) + return _internal_displayname(); } template inline PROTOBUF_ALWAYS_INLINE -void CallMessage::set_uuid(ArgT0&& arg0, ArgT... args) { +void LokiProfile::set_displayname(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.uuid_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.CallMessage.uuid) + _impl_.displayname_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.LokiProfile.displayName) } -inline std::string* CallMessage::mutable_uuid() { - std::string* _s = _internal_mutable_uuid(); - // @@protoc_insertion_point(field_mutable:SessionProtos.CallMessage.uuid) +inline std::string* LokiProfile::mutable_displayname() { + std::string* _s = _internal_mutable_displayname(); + // @@protoc_insertion_point(field_mutable:SessionProtos.LokiProfile.displayName) return _s; } -inline const std::string& CallMessage::_internal_uuid() const { - return _impl_.uuid_.Get(); +inline const std::string& LokiProfile::_internal_displayname() const { + return _impl_.displayname_.Get(); } -inline void CallMessage::_internal_set_uuid(const std::string& value) { +inline void LokiProfile::_internal_set_displayname(const std::string& value) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.uuid_.Set(value, GetArenaForAllocation()); + _impl_.displayname_.Set(value, GetArenaForAllocation()); } -inline std::string* CallMessage::_internal_mutable_uuid() { +inline std::string* LokiProfile::_internal_mutable_displayname() { _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.uuid_.Mutable(GetArenaForAllocation()); + return _impl_.displayname_.Mutable(GetArenaForAllocation()); } -inline std::string* CallMessage::release_uuid() { - // @@protoc_insertion_point(field_release:SessionProtos.CallMessage.uuid) - if (!_internal_has_uuid()) { +inline std::string* LokiProfile::release_displayname() { + // @@protoc_insertion_point(field_release:SessionProtos.LokiProfile.displayName) + if (!_internal_has_displayname()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.uuid_.Release(); + auto* p = _impl_.displayname_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.uuid_.IsDefault()) { - _impl_.uuid_.Set("", GetArenaForAllocation()); + if (_impl_.displayname_.IsDefault()) { + _impl_.displayname_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void CallMessage::set_allocated_uuid(std::string* uuid) { - if (uuid != nullptr) { +inline void LokiProfile::set_allocated_displayname(std::string* displayname) { + if (displayname != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; } else { _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.uuid_.SetAllocated(uuid, GetArenaForAllocation()); + _impl_.displayname_.SetAllocated(displayname, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.uuid_.IsDefault()) { - _impl_.uuid_.Set("", GetArenaForAllocation()); + if (_impl_.displayname_.IsDefault()) { + _impl_.displayname_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.CallMessage.uuid) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.LokiProfile.displayName) +} + +// optional string profilePicture = 2; +inline bool LokiProfile::_internal_has_profilepicture() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool LokiProfile::has_profilepicture() const { + return _internal_has_profilepicture(); +} +inline void LokiProfile::clear_profilepicture() { + _impl_.profilepicture_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline const std::string& LokiProfile::profilepicture() const { + // @@protoc_insertion_point(field_get:SessionProtos.LokiProfile.profilePicture) + return _internal_profilepicture(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void LokiProfile::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.LokiProfile.profilePicture) +} +inline std::string* LokiProfile::mutable_profilepicture() { + std::string* _s = _internal_mutable_profilepicture(); + // @@protoc_insertion_point(field_mutable:SessionProtos.LokiProfile.profilePicture) + return _s; +} +inline const std::string& LokiProfile::_internal_profilepicture() const { + return _impl_.profilepicture_.Get(); +} +inline void LokiProfile::_internal_set_profilepicture(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.profilepicture_.Set(value, GetArenaForAllocation()); +} +inline std::string* LokiProfile::_internal_mutable_profilepicture() { + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.profilepicture_.Mutable(GetArenaForAllocation()); +} +inline std::string* LokiProfile::release_profilepicture() { + // @@protoc_insertion_point(field_release:SessionProtos.LokiProfile.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()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void LokiProfile::set_allocated_profilepicture(std::string* profilepicture) { + if (profilepicture != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + _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.LokiProfile.profilePicture) } // ------------------------------------------------------------------- -// KeyPair +// DataMessage_Quote_QuotedAttachment -// required bytes publicKey = 1; -inline bool KeyPair::_internal_has_publickey() const { +// optional string contentType = 1; +inline bool DataMessage_Quote_QuotedAttachment::_internal_has_contenttype() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool KeyPair::has_publickey() const { - return _internal_has_publickey(); +inline bool DataMessage_Quote_QuotedAttachment::has_contenttype() const { + return _internal_has_contenttype(); } -inline void KeyPair::clear_publickey() { - _impl_.publickey_.ClearToEmpty(); +inline void DataMessage_Quote_QuotedAttachment::clear_contenttype() { + _impl_.contenttype_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& KeyPair::publickey() const { - // @@protoc_insertion_point(field_get:SessionProtos.KeyPair.publicKey) - return _internal_publickey(); +inline const std::string& DataMessage_Quote_QuotedAttachment::contenttype() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Quote.QuotedAttachment.contentType) + return _internal_contenttype(); } template inline PROTOBUF_ALWAYS_INLINE -void KeyPair::set_publickey(ArgT0&& arg0, ArgT... args) { +void DataMessage_Quote_QuotedAttachment::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.KeyPair.publicKey) + _impl_.contenttype_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Quote.QuotedAttachment.contentType) } -inline std::string* KeyPair::mutable_publickey() { - std::string* _s = _internal_mutable_publickey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.KeyPair.publicKey) +inline std::string* DataMessage_Quote_QuotedAttachment::mutable_contenttype() { + std::string* _s = _internal_mutable_contenttype(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Quote.QuotedAttachment.contentType) return _s; } -inline const std::string& KeyPair::_internal_publickey() const { - return _impl_.publickey_.Get(); +inline const std::string& DataMessage_Quote_QuotedAttachment::_internal_contenttype() const { + return _impl_.contenttype_.Get(); } -inline void KeyPair::_internal_set_publickey(const std::string& value) { +inline void DataMessage_Quote_QuotedAttachment::_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* KeyPair::_internal_mutable_publickey() { +inline std::string* DataMessage_Quote_QuotedAttachment::_internal_mutable_contenttype() { _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.publickey_.Mutable(GetArenaForAllocation()); + return _impl_.contenttype_.Mutable(GetArenaForAllocation()); } -inline std::string* KeyPair::release_publickey() { - // @@protoc_insertion_point(field_release:SessionProtos.KeyPair.publicKey) - if (!_internal_has_publickey()) { +inline std::string* DataMessage_Quote_QuotedAttachment::release_contenttype() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Quote.QuotedAttachment.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 KeyPair::set_allocated_publickey(std::string* publickey) { - if (publickey != nullptr) { +inline void DataMessage_Quote_QuotedAttachment::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.KeyPair.publicKey) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Quote.QuotedAttachment.contentType) } -// required bytes privateKey = 2; -inline bool KeyPair::_internal_has_privatekey() const { +// optional string fileName = 2; +inline bool DataMessage_Quote_QuotedAttachment::_internal_has_filename() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } -inline bool KeyPair::has_privatekey() const { - return _internal_has_privatekey(); +inline bool DataMessage_Quote_QuotedAttachment::has_filename() const { + return _internal_has_filename(); } -inline void KeyPair::clear_privatekey() { - _impl_.privatekey_.ClearToEmpty(); +inline void DataMessage_Quote_QuotedAttachment::clear_filename() { + _impl_.filename_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000002u; } -inline const std::string& KeyPair::privatekey() const { - // @@protoc_insertion_point(field_get:SessionProtos.KeyPair.privateKey) - return _internal_privatekey(); +inline const std::string& DataMessage_Quote_QuotedAttachment::filename() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Quote.QuotedAttachment.fileName) + return _internal_filename(); } template inline PROTOBUF_ALWAYS_INLINE -void KeyPair::set_privatekey(ArgT0&& arg0, ArgT... args) { +void DataMessage_Quote_QuotedAttachment::set_filename(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.privatekey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.KeyPair.privateKey) + _impl_.filename_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Quote.QuotedAttachment.fileName) } -inline std::string* KeyPair::mutable_privatekey() { - std::string* _s = _internal_mutable_privatekey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.KeyPair.privateKey) +inline std::string* DataMessage_Quote_QuotedAttachment::mutable_filename() { + std::string* _s = _internal_mutable_filename(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Quote.QuotedAttachment.fileName) return _s; } -inline const std::string& KeyPair::_internal_privatekey() const { - return _impl_.privatekey_.Get(); +inline const std::string& DataMessage_Quote_QuotedAttachment::_internal_filename() const { + return _impl_.filename_.Get(); } -inline void KeyPair::_internal_set_privatekey(const std::string& value) { +inline void DataMessage_Quote_QuotedAttachment::_internal_set_filename(const std::string& value) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.privatekey_.Set(value, GetArenaForAllocation()); + _impl_.filename_.Set(value, GetArenaForAllocation()); } -inline std::string* KeyPair::_internal_mutable_privatekey() { +inline std::string* DataMessage_Quote_QuotedAttachment::_internal_mutable_filename() { _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.privatekey_.Mutable(GetArenaForAllocation()); + return _impl_.filename_.Mutable(GetArenaForAllocation()); } -inline std::string* KeyPair::release_privatekey() { - // @@protoc_insertion_point(field_release:SessionProtos.KeyPair.privateKey) - if (!_internal_has_privatekey()) { +inline std::string* DataMessage_Quote_QuotedAttachment::release_filename() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Quote.QuotedAttachment.fileName) + if (!_internal_has_filename()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.privatekey_.Release(); + auto* p = _impl_.filename_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.privatekey_.IsDefault()) { - _impl_.privatekey_.Set("", GetArenaForAllocation()); + if (_impl_.filename_.IsDefault()) { + _impl_.filename_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void KeyPair::set_allocated_privatekey(std::string* privatekey) { - if (privatekey != nullptr) { +inline void DataMessage_Quote_QuotedAttachment::set_allocated_filename(std::string* filename) { + if (filename != nullptr) { _impl_._has_bits_[0] |= 0x00000002u; } else { _impl_._has_bits_[0] &= ~0x00000002u; } - _impl_.privatekey_.SetAllocated(privatekey, GetArenaForAllocation()); + _impl_.filename_.SetAllocated(filename, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.privatekey_.IsDefault()) { - _impl_.privatekey_.Set("", GetArenaForAllocation()); + if (_impl_.filename_.IsDefault()) { + _impl_.filename_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.KeyPair.privateKey) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Quote.QuotedAttachment.fileName) } -// ------------------------------------------------------------------- - -// DataExtractionNotification - -// required .SessionProtos.DataExtractionNotification.Type type = 1; -inline bool DataExtractionNotification::_internal_has_type() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; +// optional .SessionProtos.AttachmentPointer thumbnail = 3; +inline bool DataMessage_Quote_QuotedAttachment::_internal_has_thumbnail() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + PROTOBUF_ASSUME(!value || _impl_.thumbnail_ != nullptr); return value; } -inline bool DataExtractionNotification::has_type() const { - return _internal_has_type(); +inline bool DataMessage_Quote_QuotedAttachment::has_thumbnail() const { + return _internal_has_thumbnail(); } -inline void DataExtractionNotification::clear_type() { - _impl_.type_ = 1; - _impl_._has_bits_[0] &= ~0x00000002u; +inline void DataMessage_Quote_QuotedAttachment::clear_thumbnail() { + if (_impl_.thumbnail_ != nullptr) _impl_.thumbnail_->Clear(); + _impl_._has_bits_[0] &= ~0x00000004u; } -inline ::SessionProtos::DataExtractionNotification_Type DataExtractionNotification::_internal_type() const { - return static_cast< ::SessionProtos::DataExtractionNotification_Type >(_impl_.type_); +inline const ::SessionProtos::AttachmentPointer& DataMessage_Quote_QuotedAttachment::_internal_thumbnail() const { + const ::SessionProtos::AttachmentPointer* p = _impl_.thumbnail_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_AttachmentPointer_default_instance_); } -inline ::SessionProtos::DataExtractionNotification_Type DataExtractionNotification::type() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataExtractionNotification.type) - return _internal_type(); +inline const ::SessionProtos::AttachmentPointer& DataMessage_Quote_QuotedAttachment::thumbnail() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Quote.QuotedAttachment.thumbnail) + return _internal_thumbnail(); } -inline void DataExtractionNotification::_internal_set_type(::SessionProtos::DataExtractionNotification_Type value) { - assert(::SessionProtos::DataExtractionNotification_Type_IsValid(value)); - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.type_ = value; +inline void DataMessage_Quote_QuotedAttachment::unsafe_arena_set_allocated_thumbnail( + ::SessionProtos::AttachmentPointer* thumbnail) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.thumbnail_); + } + _impl_.thumbnail_ = thumbnail; + if (thumbnail) { + _impl_._has_bits_[0] |= 0x00000004u; + } else { + _impl_._has_bits_[0] &= ~0x00000004u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.DataMessage.Quote.QuotedAttachment.thumbnail) } -inline void DataExtractionNotification::set_type(::SessionProtos::DataExtractionNotification_Type value) { - _internal_set_type(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataExtractionNotification.type) +inline ::SessionProtos::AttachmentPointer* DataMessage_Quote_QuotedAttachment::release_thumbnail() { + _impl_._has_bits_[0] &= ~0x00000004u; + ::SessionProtos::AttachmentPointer* temp = _impl_.thumbnail_; + _impl_.thumbnail_ = 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::AttachmentPointer* DataMessage_Quote_QuotedAttachment::unsafe_arena_release_thumbnail() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Quote.QuotedAttachment.thumbnail) + _impl_._has_bits_[0] &= ~0x00000004u; + ::SessionProtos::AttachmentPointer* temp = _impl_.thumbnail_; + _impl_.thumbnail_ = nullptr; + return temp; +} +inline ::SessionProtos::AttachmentPointer* DataMessage_Quote_QuotedAttachment::_internal_mutable_thumbnail() { + _impl_._has_bits_[0] |= 0x00000004u; + if (_impl_.thumbnail_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::AttachmentPointer>(GetArenaForAllocation()); + _impl_.thumbnail_ = p; + } + return _impl_.thumbnail_; +} +inline ::SessionProtos::AttachmentPointer* DataMessage_Quote_QuotedAttachment::mutable_thumbnail() { + ::SessionProtos::AttachmentPointer* _msg = _internal_mutable_thumbnail(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Quote.QuotedAttachment.thumbnail) + return _msg; +} +inline void DataMessage_Quote_QuotedAttachment::set_allocated_thumbnail(::SessionProtos::AttachmentPointer* thumbnail) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.thumbnail_; + } + if (thumbnail) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(thumbnail); + if (message_arena != submessage_arena) { + thumbnail = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, thumbnail, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000004u; + } else { + _impl_._has_bits_[0] &= ~0x00000004u; + } + _impl_.thumbnail_ = thumbnail; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Quote.QuotedAttachment.thumbnail) } -// optional uint64 timestamp = 2; -inline bool DataExtractionNotification::_internal_has_timestamp() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; +// optional uint32 flags = 4; +inline bool DataMessage_Quote_QuotedAttachment::_internal_has_flags() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; return value; } -inline bool DataExtractionNotification::has_timestamp() const { - return _internal_has_timestamp(); +inline bool DataMessage_Quote_QuotedAttachment::has_flags() const { + return _internal_has_flags(); } -inline void DataExtractionNotification::clear_timestamp() { - _impl_.timestamp_ = uint64_t{0u}; - _impl_._has_bits_[0] &= ~0x00000001u; +inline void DataMessage_Quote_QuotedAttachment::clear_flags() { + _impl_.flags_ = 0u; + _impl_._has_bits_[0] &= ~0x00000008u; } -inline uint64_t DataExtractionNotification::_internal_timestamp() const { - return _impl_.timestamp_; +inline uint32_t DataMessage_Quote_QuotedAttachment::_internal_flags() const { + return _impl_.flags_; } -inline uint64_t DataExtractionNotification::timestamp() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataExtractionNotification.timestamp) - return _internal_timestamp(); +inline uint32_t DataMessage_Quote_QuotedAttachment::flags() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Quote.QuotedAttachment.flags) + return _internal_flags(); } -inline void DataExtractionNotification::_internal_set_timestamp(uint64_t value) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.timestamp_ = value; +inline void DataMessage_Quote_QuotedAttachment::_internal_set_flags(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.flags_ = value; } -inline void DataExtractionNotification::set_timestamp(uint64_t value) { - _internal_set_timestamp(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataExtractionNotification.timestamp) +inline void DataMessage_Quote_QuotedAttachment::set_flags(uint32_t value) { + _internal_set_flags(value); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Quote.QuotedAttachment.flags) } // ------------------------------------------------------------------- -// LokiProfile +// DataMessage_Quote -// optional string displayName = 1; -inline bool LokiProfile::_internal_has_displayname() const { +// required uint64 id = 1; +inline bool DataMessage_Quote::_internal_has_id() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; +} +inline bool DataMessage_Quote::has_id() const { + return _internal_has_id(); +} +inline void DataMessage_Quote::clear_id() { + _impl_.id_ = uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000004u; +} +inline uint64_t DataMessage_Quote::_internal_id() const { + return _impl_.id_; +} +inline uint64_t DataMessage_Quote::id() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Quote.id) + return _internal_id(); +} +inline void DataMessage_Quote::_internal_set_id(uint64_t value) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.id_ = value; +} +inline void DataMessage_Quote::set_id(uint64_t value) { + _internal_set_id(value); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Quote.id) +} + +// required string author = 2; +inline bool DataMessage_Quote::_internal_has_author() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool LokiProfile::has_displayname() const { - return _internal_has_displayname(); +inline bool DataMessage_Quote::has_author() const { + return _internal_has_author(); } -inline void LokiProfile::clear_displayname() { - _impl_.displayname_.ClearToEmpty(); +inline void DataMessage_Quote::clear_author() { + _impl_.author_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& LokiProfile::displayname() const { - // @@protoc_insertion_point(field_get:SessionProtos.LokiProfile.displayName) - return _internal_displayname(); +inline const std::string& DataMessage_Quote::author() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Quote.author) + return _internal_author(); } template inline PROTOBUF_ALWAYS_INLINE -void LokiProfile::set_displayname(ArgT0&& arg0, ArgT... args) { +void DataMessage_Quote::set_author(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.displayname_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.LokiProfile.displayName) + _impl_.author_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Quote.author) } -inline std::string* LokiProfile::mutable_displayname() { - std::string* _s = _internal_mutable_displayname(); - // @@protoc_insertion_point(field_mutable:SessionProtos.LokiProfile.displayName) +inline std::string* DataMessage_Quote::mutable_author() { + std::string* _s = _internal_mutable_author(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Quote.author) return _s; } -inline const std::string& LokiProfile::_internal_displayname() const { - return _impl_.displayname_.Get(); +inline const std::string& DataMessage_Quote::_internal_author() const { + return _impl_.author_.Get(); } -inline void LokiProfile::_internal_set_displayname(const std::string& value) { +inline void DataMessage_Quote::_internal_set_author(const std::string& value) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.displayname_.Set(value, GetArenaForAllocation()); + _impl_.author_.Set(value, GetArenaForAllocation()); } -inline std::string* LokiProfile::_internal_mutable_displayname() { +inline std::string* DataMessage_Quote::_internal_mutable_author() { _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.displayname_.Mutable(GetArenaForAllocation()); + return _impl_.author_.Mutable(GetArenaForAllocation()); } -inline std::string* LokiProfile::release_displayname() { - // @@protoc_insertion_point(field_release:SessionProtos.LokiProfile.displayName) - if (!_internal_has_displayname()) { +inline std::string* DataMessage_Quote::release_author() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Quote.author) + if (!_internal_has_author()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.displayname_.Release(); + auto* p = _impl_.author_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.displayname_.IsDefault()) { - _impl_.displayname_.Set("", GetArenaForAllocation()); + if (_impl_.author_.IsDefault()) { + _impl_.author_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void LokiProfile::set_allocated_displayname(std::string* displayname) { - if (displayname != nullptr) { +inline void DataMessage_Quote::set_allocated_author(std::string* author) { + if (author != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; } else { _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.displayname_.SetAllocated(displayname, GetArenaForAllocation()); + _impl_.author_.SetAllocated(author, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.displayname_.IsDefault()) { - _impl_.displayname_.Set("", GetArenaForAllocation()); + if (_impl_.author_.IsDefault()) { + _impl_.author_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.LokiProfile.displayName) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Quote.author) } -// optional string profilePicture = 2; -inline bool LokiProfile::_internal_has_profilepicture() const { +// optional string text = 3; +inline bool DataMessage_Quote::_internal_has_text() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } -inline bool LokiProfile::has_profilepicture() const { - return _internal_has_profilepicture(); +inline bool DataMessage_Quote::has_text() const { + return _internal_has_text(); } -inline void LokiProfile::clear_profilepicture() { - _impl_.profilepicture_.ClearToEmpty(); +inline void DataMessage_Quote::clear_text() { + _impl_.text_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000002u; } -inline const std::string& LokiProfile::profilepicture() const { - // @@protoc_insertion_point(field_get:SessionProtos.LokiProfile.profilePicture) - return _internal_profilepicture(); +inline const std::string& DataMessage_Quote::text() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Quote.text) + return _internal_text(); } template inline PROTOBUF_ALWAYS_INLINE -void LokiProfile::set_profilepicture(ArgT0&& arg0, ArgT... args) { +void DataMessage_Quote::set_text(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.profilepicture_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.LokiProfile.profilePicture) + _impl_.text_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Quote.text) } -inline std::string* LokiProfile::mutable_profilepicture() { - std::string* _s = _internal_mutable_profilepicture(); - // @@protoc_insertion_point(field_mutable:SessionProtos.LokiProfile.profilePicture) +inline std::string* DataMessage_Quote::mutable_text() { + std::string* _s = _internal_mutable_text(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Quote.text) return _s; } -inline const std::string& LokiProfile::_internal_profilepicture() const { - return _impl_.profilepicture_.Get(); +inline const std::string& DataMessage_Quote::_internal_text() const { + return _impl_.text_.Get(); } -inline void LokiProfile::_internal_set_profilepicture(const std::string& value) { +inline void DataMessage_Quote::_internal_set_text(const std::string& value) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.profilepicture_.Set(value, GetArenaForAllocation()); + _impl_.text_.Set(value, GetArenaForAllocation()); } -inline std::string* LokiProfile::_internal_mutable_profilepicture() { +inline std::string* DataMessage_Quote::_internal_mutable_text() { _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.profilepicture_.Mutable(GetArenaForAllocation()); + return _impl_.text_.Mutable(GetArenaForAllocation()); } -inline std::string* LokiProfile::release_profilepicture() { - // @@protoc_insertion_point(field_release:SessionProtos.LokiProfile.profilePicture) - if (!_internal_has_profilepicture()) { +inline std::string* DataMessage_Quote::release_text() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Quote.text) + if (!_internal_has_text()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.profilepicture_.Release(); + auto* p = _impl_.text_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilepicture_.IsDefault()) { - _impl_.profilepicture_.Set("", GetArenaForAllocation()); + if (_impl_.text_.IsDefault()) { + _impl_.text_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void LokiProfile::set_allocated_profilepicture(std::string* profilepicture) { - if (profilepicture != nullptr) { +inline void DataMessage_Quote::set_allocated_text(std::string* text) { + if (text != nullptr) { _impl_._has_bits_[0] |= 0x00000002u; } else { _impl_._has_bits_[0] &= ~0x00000002u; } - _impl_.profilepicture_.SetAllocated(profilepicture, GetArenaForAllocation()); + _impl_.text_.SetAllocated(text, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilepicture_.IsDefault()) { - _impl_.profilepicture_.Set("", GetArenaForAllocation()); + if (_impl_.text_.IsDefault()) { + _impl_.text_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.LokiProfile.profilePicture) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Quote.text) +} + +// repeated .SessionProtos.DataMessage.Quote.QuotedAttachment attachments = 4; +inline int DataMessage_Quote::_internal_attachments_size() const { + return _impl_.attachments_.size(); +} +inline int DataMessage_Quote::attachments_size() const { + return _internal_attachments_size(); +} +inline void DataMessage_Quote::clear_attachments() { + _impl_.attachments_.Clear(); +} +inline ::SessionProtos::DataMessage_Quote_QuotedAttachment* DataMessage_Quote::mutable_attachments(int index) { + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Quote.attachments) + return _impl_.attachments_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Quote_QuotedAttachment >* +DataMessage_Quote::mutable_attachments() { + // @@protoc_insertion_point(field_mutable_list:SessionProtos.DataMessage.Quote.attachments) + return &_impl_.attachments_; +} +inline const ::SessionProtos::DataMessage_Quote_QuotedAttachment& DataMessage_Quote::_internal_attachments(int index) const { + return _impl_.attachments_.Get(index); +} +inline const ::SessionProtos::DataMessage_Quote_QuotedAttachment& DataMessage_Quote::attachments(int index) const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Quote.attachments) + return _internal_attachments(index); +} +inline ::SessionProtos::DataMessage_Quote_QuotedAttachment* DataMessage_Quote::_internal_add_attachments() { + return _impl_.attachments_.Add(); +} +inline ::SessionProtos::DataMessage_Quote_QuotedAttachment* DataMessage_Quote::add_attachments() { + ::SessionProtos::DataMessage_Quote_QuotedAttachment* _add = _internal_add_attachments(); + // @@protoc_insertion_point(field_add:SessionProtos.DataMessage.Quote.attachments) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Quote_QuotedAttachment >& +DataMessage_Quote::attachments() const { + // @@protoc_insertion_point(field_list:SessionProtos.DataMessage.Quote.attachments) + return _impl_.attachments_; } // ------------------------------------------------------------------- -// DataMessage_Quote_QuotedAttachment +// DataMessage_Preview -// optional string contentType = 1; -inline bool DataMessage_Quote_QuotedAttachment::_internal_has_contenttype() const { +// required string url = 1; +inline bool DataMessage_Preview::_internal_has_url() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool DataMessage_Quote_QuotedAttachment::has_contenttype() const { - return _internal_has_contenttype(); +inline bool DataMessage_Preview::has_url() const { + return _internal_has_url(); } -inline void DataMessage_Quote_QuotedAttachment::clear_contenttype() { - _impl_.contenttype_.ClearToEmpty(); +inline void DataMessage_Preview::clear_url() { + _impl_.url_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& DataMessage_Quote_QuotedAttachment::contenttype() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Quote.QuotedAttachment.contentType) - return _internal_contenttype(); +inline const std::string& DataMessage_Preview::url() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Preview.url) + return _internal_url(); } template inline PROTOBUF_ALWAYS_INLINE -void DataMessage_Quote_QuotedAttachment::set_contenttype(ArgT0&& arg0, ArgT... args) { +void DataMessage_Preview::set_url(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.contenttype_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Quote.QuotedAttachment.contentType) + _impl_.url_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Preview.url) } -inline std::string* DataMessage_Quote_QuotedAttachment::mutable_contenttype() { - std::string* _s = _internal_mutable_contenttype(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Quote.QuotedAttachment.contentType) +inline std::string* DataMessage_Preview::mutable_url() { + std::string* _s = _internal_mutable_url(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Preview.url) return _s; } -inline const std::string& DataMessage_Quote_QuotedAttachment::_internal_contenttype() const { - return _impl_.contenttype_.Get(); +inline const std::string& DataMessage_Preview::_internal_url() const { + return _impl_.url_.Get(); } -inline void DataMessage_Quote_QuotedAttachment::_internal_set_contenttype(const std::string& value) { +inline void DataMessage_Preview::_internal_set_url(const std::string& value) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.contenttype_.Set(value, GetArenaForAllocation()); + _impl_.url_.Set(value, GetArenaForAllocation()); } -inline std::string* DataMessage_Quote_QuotedAttachment::_internal_mutable_contenttype() { +inline std::string* DataMessage_Preview::_internal_mutable_url() { _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.contenttype_.Mutable(GetArenaForAllocation()); + return _impl_.url_.Mutable(GetArenaForAllocation()); } -inline std::string* DataMessage_Quote_QuotedAttachment::release_contenttype() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Quote.QuotedAttachment.contentType) - if (!_internal_has_contenttype()) { +inline std::string* DataMessage_Preview::release_url() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Preview.url) + if (!_internal_has_url()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.contenttype_.Release(); + auto* p = _impl_.url_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.contenttype_.IsDefault()) { - _impl_.contenttype_.Set("", GetArenaForAllocation()); + if (_impl_.url_.IsDefault()) { + _impl_.url_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void DataMessage_Quote_QuotedAttachment::set_allocated_contenttype(std::string* contenttype) { - if (contenttype != nullptr) { +inline void DataMessage_Preview::set_allocated_url(std::string* url) { + if (url != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; } else { _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.contenttype_.SetAllocated(contenttype, GetArenaForAllocation()); + _impl_.url_.SetAllocated(url, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.contenttype_.IsDefault()) { - _impl_.contenttype_.Set("", GetArenaForAllocation()); + if (_impl_.url_.IsDefault()) { + _impl_.url_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Quote.QuotedAttachment.contentType) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Preview.url) } -// optional string fileName = 2; -inline bool DataMessage_Quote_QuotedAttachment::_internal_has_filename() const { +// optional string title = 2; +inline bool DataMessage_Preview::_internal_has_title() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } -inline bool DataMessage_Quote_QuotedAttachment::has_filename() const { - return _internal_has_filename(); +inline bool DataMessage_Preview::has_title() const { + return _internal_has_title(); } -inline void DataMessage_Quote_QuotedAttachment::clear_filename() { - _impl_.filename_.ClearToEmpty(); +inline void DataMessage_Preview::clear_title() { + _impl_.title_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000002u; } -inline const std::string& DataMessage_Quote_QuotedAttachment::filename() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Quote.QuotedAttachment.fileName) - return _internal_filename(); +inline const std::string& DataMessage_Preview::title() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Preview.title) + return _internal_title(); } template inline PROTOBUF_ALWAYS_INLINE -void DataMessage_Quote_QuotedAttachment::set_filename(ArgT0&& arg0, ArgT... args) { +void DataMessage_Preview::set_title(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.filename_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Quote.QuotedAttachment.fileName) + _impl_.title_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Preview.title) } -inline std::string* DataMessage_Quote_QuotedAttachment::mutable_filename() { - std::string* _s = _internal_mutable_filename(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Quote.QuotedAttachment.fileName) +inline std::string* DataMessage_Preview::mutable_title() { + std::string* _s = _internal_mutable_title(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Preview.title) return _s; } -inline const std::string& DataMessage_Quote_QuotedAttachment::_internal_filename() const { - return _impl_.filename_.Get(); +inline const std::string& DataMessage_Preview::_internal_title() const { + return _impl_.title_.Get(); } -inline void DataMessage_Quote_QuotedAttachment::_internal_set_filename(const std::string& value) { +inline void DataMessage_Preview::_internal_set_title(const std::string& value) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.filename_.Set(value, GetArenaForAllocation()); + _impl_.title_.Set(value, GetArenaForAllocation()); } -inline std::string* DataMessage_Quote_QuotedAttachment::_internal_mutable_filename() { +inline std::string* DataMessage_Preview::_internal_mutable_title() { _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.filename_.Mutable(GetArenaForAllocation()); + return _impl_.title_.Mutable(GetArenaForAllocation()); } -inline std::string* DataMessage_Quote_QuotedAttachment::release_filename() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Quote.QuotedAttachment.fileName) - if (!_internal_has_filename()) { +inline std::string* DataMessage_Preview::release_title() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Preview.title) + if (!_internal_has_title()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.filename_.Release(); + auto* p = _impl_.title_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.filename_.IsDefault()) { - _impl_.filename_.Set("", GetArenaForAllocation()); + if (_impl_.title_.IsDefault()) { + _impl_.title_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void DataMessage_Quote_QuotedAttachment::set_allocated_filename(std::string* filename) { - if (filename != nullptr) { +inline void DataMessage_Preview::set_allocated_title(std::string* title) { + if (title != nullptr) { _impl_._has_bits_[0] |= 0x00000002u; } else { _impl_._has_bits_[0] &= ~0x00000002u; } - _impl_.filename_.SetAllocated(filename, GetArenaForAllocation()); + _impl_.title_.SetAllocated(title, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.filename_.IsDefault()) { - _impl_.filename_.Set("", GetArenaForAllocation()); + if (_impl_.title_.IsDefault()) { + _impl_.title_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Quote.QuotedAttachment.fileName) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Preview.title) } -// optional .SessionProtos.AttachmentPointer thumbnail = 3; -inline bool DataMessage_Quote_QuotedAttachment::_internal_has_thumbnail() const { +// optional .SessionProtos.AttachmentPointer image = 3; +inline bool DataMessage_Preview::_internal_has_image() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; - PROTOBUF_ASSUME(!value || _impl_.thumbnail_ != nullptr); + PROTOBUF_ASSUME(!value || _impl_.image_ != nullptr); return value; } -inline bool DataMessage_Quote_QuotedAttachment::has_thumbnail() const { - return _internal_has_thumbnail(); +inline bool DataMessage_Preview::has_image() const { + return _internal_has_image(); } -inline void DataMessage_Quote_QuotedAttachment::clear_thumbnail() { - if (_impl_.thumbnail_ != nullptr) _impl_.thumbnail_->Clear(); +inline void DataMessage_Preview::clear_image() { + if (_impl_.image_ != nullptr) _impl_.image_->Clear(); _impl_._has_bits_[0] &= ~0x00000004u; } -inline const ::SessionProtos::AttachmentPointer& DataMessage_Quote_QuotedAttachment::_internal_thumbnail() const { - const ::SessionProtos::AttachmentPointer* p = _impl_.thumbnail_; +inline const ::SessionProtos::AttachmentPointer& DataMessage_Preview::_internal_image() const { + const ::SessionProtos::AttachmentPointer* p = _impl_.image_; return p != nullptr ? *p : reinterpret_cast( ::SessionProtos::_AttachmentPointer_default_instance_); } -inline const ::SessionProtos::AttachmentPointer& DataMessage_Quote_QuotedAttachment::thumbnail() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Quote.QuotedAttachment.thumbnail) - return _internal_thumbnail(); +inline const ::SessionProtos::AttachmentPointer& DataMessage_Preview::image() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Preview.image) + return _internal_image(); } -inline void DataMessage_Quote_QuotedAttachment::unsafe_arena_set_allocated_thumbnail( - ::SessionProtos::AttachmentPointer* thumbnail) { +inline void DataMessage_Preview::unsafe_arena_set_allocated_image( + ::SessionProtos::AttachmentPointer* image) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.thumbnail_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.image_); } - _impl_.thumbnail_ = thumbnail; - if (thumbnail) { + _impl_.image_ = image; + if (image) { _impl_._has_bits_[0] |= 0x00000004u; } else { _impl_._has_bits_[0] &= ~0x00000004u; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.DataMessage.Quote.QuotedAttachment.thumbnail) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.DataMessage.Preview.image) } -inline ::SessionProtos::AttachmentPointer* DataMessage_Quote_QuotedAttachment::release_thumbnail() { +inline ::SessionProtos::AttachmentPointer* DataMessage_Preview::release_image() { _impl_._has_bits_[0] &= ~0x00000004u; - ::SessionProtos::AttachmentPointer* temp = _impl_.thumbnail_; - _impl_.thumbnail_ = nullptr; + ::SessionProtos::AttachmentPointer* temp = _impl_.image_; + _impl_.image_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -7965,147 +9556,119 @@ inline ::SessionProtos::AttachmentPointer* DataMessage_Quote_QuotedAttachment::r #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::SessionProtos::AttachmentPointer* DataMessage_Quote_QuotedAttachment::unsafe_arena_release_thumbnail() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Quote.QuotedAttachment.thumbnail) +inline ::SessionProtos::AttachmentPointer* DataMessage_Preview::unsafe_arena_release_image() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Preview.image) _impl_._has_bits_[0] &= ~0x00000004u; - ::SessionProtos::AttachmentPointer* temp = _impl_.thumbnail_; - _impl_.thumbnail_ = nullptr; + ::SessionProtos::AttachmentPointer* temp = _impl_.image_; + _impl_.image_ = nullptr; return temp; } -inline ::SessionProtos::AttachmentPointer* DataMessage_Quote_QuotedAttachment::_internal_mutable_thumbnail() { +inline ::SessionProtos::AttachmentPointer* DataMessage_Preview::_internal_mutable_image() { _impl_._has_bits_[0] |= 0x00000004u; - if (_impl_.thumbnail_ == nullptr) { + if (_impl_.image_ == nullptr) { auto* p = CreateMaybeMessage<::SessionProtos::AttachmentPointer>(GetArenaForAllocation()); - _impl_.thumbnail_ = p; + _impl_.image_ = p; } - return _impl_.thumbnail_; + return _impl_.image_; } -inline ::SessionProtos::AttachmentPointer* DataMessage_Quote_QuotedAttachment::mutable_thumbnail() { - ::SessionProtos::AttachmentPointer* _msg = _internal_mutable_thumbnail(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Quote.QuotedAttachment.thumbnail) +inline ::SessionProtos::AttachmentPointer* DataMessage_Preview::mutable_image() { + ::SessionProtos::AttachmentPointer* _msg = _internal_mutable_image(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Preview.image) return _msg; } -inline void DataMessage_Quote_QuotedAttachment::set_allocated_thumbnail(::SessionProtos::AttachmentPointer* thumbnail) { +inline void DataMessage_Preview::set_allocated_image(::SessionProtos::AttachmentPointer* image) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.thumbnail_; + delete _impl_.image_; } - if (thumbnail) { + if (image) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(thumbnail); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(image); if (message_arena != submessage_arena) { - thumbnail = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, thumbnail, submessage_arena); + image = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, image, submessage_arena); } _impl_._has_bits_[0] |= 0x00000004u; } else { _impl_._has_bits_[0] &= ~0x00000004u; } - _impl_.thumbnail_ = thumbnail; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Quote.QuotedAttachment.thumbnail) -} - -// optional uint32 flags = 4; -inline bool DataMessage_Quote_QuotedAttachment::_internal_has_flags() const { - bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; - return value; -} -inline bool DataMessage_Quote_QuotedAttachment::has_flags() const { - return _internal_has_flags(); -} -inline void DataMessage_Quote_QuotedAttachment::clear_flags() { - _impl_.flags_ = 0u; - _impl_._has_bits_[0] &= ~0x00000008u; -} -inline uint32_t DataMessage_Quote_QuotedAttachment::_internal_flags() const { - return _impl_.flags_; -} -inline uint32_t DataMessage_Quote_QuotedAttachment::flags() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Quote.QuotedAttachment.flags) - return _internal_flags(); -} -inline void DataMessage_Quote_QuotedAttachment::_internal_set_flags(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000008u; - _impl_.flags_ = value; -} -inline void DataMessage_Quote_QuotedAttachment::set_flags(uint32_t value) { - _internal_set_flags(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Quote.QuotedAttachment.flags) + _impl_.image_ = image; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Preview.image) } // ------------------------------------------------------------------- -// DataMessage_Quote +// DataMessage_Reaction // required uint64 id = 1; -inline bool DataMessage_Quote::_internal_has_id() const { +inline bool DataMessage_Reaction::_internal_has_id() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } -inline bool DataMessage_Quote::has_id() const { +inline bool DataMessage_Reaction::has_id() const { return _internal_has_id(); } -inline void DataMessage_Quote::clear_id() { +inline void DataMessage_Reaction::clear_id() { _impl_.id_ = uint64_t{0u}; _impl_._has_bits_[0] &= ~0x00000004u; } -inline uint64_t DataMessage_Quote::_internal_id() const { +inline uint64_t DataMessage_Reaction::_internal_id() const { return _impl_.id_; } -inline uint64_t DataMessage_Quote::id() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Quote.id) +inline uint64_t DataMessage_Reaction::id() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Reaction.id) return _internal_id(); } -inline void DataMessage_Quote::_internal_set_id(uint64_t value) { +inline void DataMessage_Reaction::_internal_set_id(uint64_t value) { _impl_._has_bits_[0] |= 0x00000004u; _impl_.id_ = value; } -inline void DataMessage_Quote::set_id(uint64_t value) { +inline void DataMessage_Reaction::set_id(uint64_t value) { _internal_set_id(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Quote.id) + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Reaction.id) } // required string author = 2; -inline bool DataMessage_Quote::_internal_has_author() const { +inline bool DataMessage_Reaction::_internal_has_author() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool DataMessage_Quote::has_author() const { +inline bool DataMessage_Reaction::has_author() const { return _internal_has_author(); } -inline void DataMessage_Quote::clear_author() { +inline void DataMessage_Reaction::clear_author() { _impl_.author_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& DataMessage_Quote::author() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Quote.author) +inline const std::string& DataMessage_Reaction::author() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Reaction.author) return _internal_author(); } template inline PROTOBUF_ALWAYS_INLINE -void DataMessage_Quote::set_author(ArgT0&& arg0, ArgT... args) { +void DataMessage_Reaction::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.DataMessage.Quote.author) + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Reaction.author) } -inline std::string* DataMessage_Quote::mutable_author() { +inline std::string* DataMessage_Reaction::mutable_author() { std::string* _s = _internal_mutable_author(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Quote.author) + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Reaction.author) return _s; } -inline const std::string& DataMessage_Quote::_internal_author() const { +inline const std::string& DataMessage_Reaction::_internal_author() const { return _impl_.author_.Get(); } -inline void DataMessage_Quote::_internal_set_author(const std::string& value) { +inline void DataMessage_Reaction::_internal_set_author(const std::string& value) { _impl_._has_bits_[0] |= 0x00000001u; _impl_.author_.Set(value, GetArenaForAllocation()); } -inline std::string* DataMessage_Quote::_internal_mutable_author() { +inline std::string* DataMessage_Reaction::_internal_mutable_author() { _impl_._has_bits_[0] |= 0x00000001u; return _impl_.author_.Mutable(GetArenaForAllocation()); } -inline std::string* DataMessage_Quote::release_author() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Quote.author) +inline std::string* DataMessage_Reaction::release_author() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Reaction.author) if (!_internal_has_author()) { return nullptr; } @@ -8118,7 +9681,7 @@ inline std::string* DataMessage_Quote::release_author() { #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void DataMessage_Quote::set_allocated_author(std::string* author) { +inline void DataMessage_Reaction::set_allocated_author(std::string* author) { if (author != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; } else { @@ -8130,162 +9693,151 @@ inline void DataMessage_Quote::set_allocated_author(std::string* author) { _impl_.author_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Quote.author) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Reaction.author) } -// optional string text = 3; -inline bool DataMessage_Quote::_internal_has_text() const { +// optional string emoji = 3; +inline bool DataMessage_Reaction::_internal_has_emoji() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } -inline bool DataMessage_Quote::has_text() const { - return _internal_has_text(); +inline bool DataMessage_Reaction::has_emoji() const { + return _internal_has_emoji(); } -inline void DataMessage_Quote::clear_text() { - _impl_.text_.ClearToEmpty(); +inline void DataMessage_Reaction::clear_emoji() { + _impl_.emoji_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000002u; } -inline const std::string& DataMessage_Quote::text() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Quote.text) - return _internal_text(); +inline const std::string& DataMessage_Reaction::emoji() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Reaction.emoji) + return _internal_emoji(); } template inline PROTOBUF_ALWAYS_INLINE -void DataMessage_Quote::set_text(ArgT0&& arg0, ArgT... args) { +void DataMessage_Reaction::set_emoji(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.text_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Quote.text) + _impl_.emoji_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Reaction.emoji) } -inline std::string* DataMessage_Quote::mutable_text() { - std::string* _s = _internal_mutable_text(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Quote.text) +inline std::string* DataMessage_Reaction::mutable_emoji() { + std::string* _s = _internal_mutable_emoji(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Reaction.emoji) return _s; } -inline const std::string& DataMessage_Quote::_internal_text() const { - return _impl_.text_.Get(); +inline const std::string& DataMessage_Reaction::_internal_emoji() const { + return _impl_.emoji_.Get(); } -inline void DataMessage_Quote::_internal_set_text(const std::string& value) { +inline void DataMessage_Reaction::_internal_set_emoji(const std::string& value) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.text_.Set(value, GetArenaForAllocation()); + _impl_.emoji_.Set(value, GetArenaForAllocation()); } -inline std::string* DataMessage_Quote::_internal_mutable_text() { +inline std::string* DataMessage_Reaction::_internal_mutable_emoji() { _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.text_.Mutable(GetArenaForAllocation()); + return _impl_.emoji_.Mutable(GetArenaForAllocation()); } -inline std::string* DataMessage_Quote::release_text() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Quote.text) - if (!_internal_has_text()) { +inline std::string* DataMessage_Reaction::release_emoji() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Reaction.emoji) + if (!_internal_has_emoji()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.text_.Release(); + auto* p = _impl_.emoji_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.text_.IsDefault()) { - _impl_.text_.Set("", GetArenaForAllocation()); + if (_impl_.emoji_.IsDefault()) { + _impl_.emoji_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void DataMessage_Quote::set_allocated_text(std::string* text) { - if (text != nullptr) { +inline void DataMessage_Reaction::set_allocated_emoji(std::string* emoji) { + if (emoji != nullptr) { _impl_._has_bits_[0] |= 0x00000002u; } else { _impl_._has_bits_[0] &= ~0x00000002u; } - _impl_.text_.SetAllocated(text, GetArenaForAllocation()); + _impl_.emoji_.SetAllocated(emoji, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.text_.IsDefault()) { - _impl_.text_.Set("", GetArenaForAllocation()); + if (_impl_.emoji_.IsDefault()) { + _impl_.emoji_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Quote.text) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Reaction.emoji) } -// repeated .SessionProtos.DataMessage.Quote.QuotedAttachment attachments = 4; -inline int DataMessage_Quote::_internal_attachments_size() const { - return _impl_.attachments_.size(); -} -inline int DataMessage_Quote::attachments_size() const { - return _internal_attachments_size(); -} -inline void DataMessage_Quote::clear_attachments() { - _impl_.attachments_.Clear(); -} -inline ::SessionProtos::DataMessage_Quote_QuotedAttachment* DataMessage_Quote::mutable_attachments(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Quote.attachments) - return _impl_.attachments_.Mutable(index); +// required .SessionProtos.DataMessage.Reaction.Action action = 4; +inline bool DataMessage_Reaction::_internal_has_action() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + return value; } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Quote_QuotedAttachment >* -DataMessage_Quote::mutable_attachments() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.DataMessage.Quote.attachments) - return &_impl_.attachments_; +inline bool DataMessage_Reaction::has_action() const { + return _internal_has_action(); } -inline const ::SessionProtos::DataMessage_Quote_QuotedAttachment& DataMessage_Quote::_internal_attachments(int index) const { - return _impl_.attachments_.Get(index); +inline void DataMessage_Reaction::clear_action() { + _impl_.action_ = 0; + _impl_._has_bits_[0] &= ~0x00000008u; } -inline const ::SessionProtos::DataMessage_Quote_QuotedAttachment& DataMessage_Quote::attachments(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Quote.attachments) - return _internal_attachments(index); +inline ::SessionProtos::DataMessage_Reaction_Action DataMessage_Reaction::_internal_action() const { + return static_cast< ::SessionProtos::DataMessage_Reaction_Action >(_impl_.action_); } -inline ::SessionProtos::DataMessage_Quote_QuotedAttachment* DataMessage_Quote::_internal_add_attachments() { - return _impl_.attachments_.Add(); +inline ::SessionProtos::DataMessage_Reaction_Action DataMessage_Reaction::action() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Reaction.action) + return _internal_action(); } -inline ::SessionProtos::DataMessage_Quote_QuotedAttachment* DataMessage_Quote::add_attachments() { - ::SessionProtos::DataMessage_Quote_QuotedAttachment* _add = _internal_add_attachments(); - // @@protoc_insertion_point(field_add:SessionProtos.DataMessage.Quote.attachments) - return _add; +inline void DataMessage_Reaction::_internal_set_action(::SessionProtos::DataMessage_Reaction_Action value) { + assert(::SessionProtos::DataMessage_Reaction_Action_IsValid(value)); + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.action_ = value; } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Quote_QuotedAttachment >& -DataMessage_Quote::attachments() const { - // @@protoc_insertion_point(field_list:SessionProtos.DataMessage.Quote.attachments) - return _impl_.attachments_; +inline void DataMessage_Reaction::set_action(::SessionProtos::DataMessage_Reaction_Action value) { + _internal_set_action(value); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Reaction.action) } // ------------------------------------------------------------------- -// DataMessage_Preview +// DataMessage_OpenGroupInvitation // required string url = 1; -inline bool DataMessage_Preview::_internal_has_url() const { +inline bool DataMessage_OpenGroupInvitation::_internal_has_url() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool DataMessage_Preview::has_url() const { +inline bool DataMessage_OpenGroupInvitation::has_url() const { return _internal_has_url(); } -inline void DataMessage_Preview::clear_url() { +inline void DataMessage_OpenGroupInvitation::clear_url() { _impl_.url_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& DataMessage_Preview::url() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Preview.url) +inline const std::string& DataMessage_OpenGroupInvitation::url() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.OpenGroupInvitation.url) return _internal_url(); } template inline PROTOBUF_ALWAYS_INLINE -void DataMessage_Preview::set_url(ArgT0&& arg0, ArgT... args) { +void DataMessage_OpenGroupInvitation::set_url(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000001u; _impl_.url_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Preview.url) + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.OpenGroupInvitation.url) } -inline std::string* DataMessage_Preview::mutable_url() { +inline std::string* DataMessage_OpenGroupInvitation::mutable_url() { std::string* _s = _internal_mutable_url(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Preview.url) + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.OpenGroupInvitation.url) return _s; } -inline const std::string& DataMessage_Preview::_internal_url() const { +inline const std::string& DataMessage_OpenGroupInvitation::_internal_url() const { return _impl_.url_.Get(); } -inline void DataMessage_Preview::_internal_set_url(const std::string& value) { +inline void DataMessage_OpenGroupInvitation::_internal_set_url(const std::string& value) { _impl_._has_bits_[0] |= 0x00000001u; _impl_.url_.Set(value, GetArenaForAllocation()); } -inline std::string* DataMessage_Preview::_internal_mutable_url() { +inline std::string* DataMessage_OpenGroupInvitation::_internal_mutable_url() { _impl_._has_bits_[0] |= 0x00000001u; return _impl_.url_.Mutable(GetArenaForAllocation()); } -inline std::string* DataMessage_Preview::release_url() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Preview.url) +inline std::string* DataMessage_OpenGroupInvitation::release_url() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.OpenGroupInvitation.url) if (!_internal_has_url()) { return nullptr; } @@ -8298,7 +9850,7 @@ inline std::string* DataMessage_Preview::release_url() { #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void DataMessage_Preview::set_allocated_url(std::string* url) { +inline void DataMessage_OpenGroupInvitation::set_allocated_url(std::string* url) { if (url != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; } else { @@ -8310,852 +9862,848 @@ inline void DataMessage_Preview::set_allocated_url(std::string* url) { _impl_.url_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Preview.url) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.OpenGroupInvitation.url) } -// optional string title = 2; -inline bool DataMessage_Preview::_internal_has_title() 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_Preview::has_title() const { - return _internal_has_title(); +inline bool DataMessage_OpenGroupInvitation::has_name() const { + return _internal_has_name(); } -inline void DataMessage_Preview::clear_title() { - _impl_.title_.ClearToEmpty(); +inline void DataMessage_OpenGroupInvitation::clear_name() { + _impl_.name_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000002u; } -inline const std::string& DataMessage_Preview::title() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Preview.title) - return _internal_title(); +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_Preview::set_title(ArgT0&& arg0, ArgT... args) { +void DataMessage_OpenGroupInvitation::set_name(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.title_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Preview.title) + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.OpenGroupInvitation.name) } -inline std::string* DataMessage_Preview::mutable_title() { - std::string* _s = _internal_mutable_title(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Preview.title) +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_Preview::_internal_title() const { - return _impl_.title_.Get(); +inline const std::string& DataMessage_OpenGroupInvitation::_internal_name() const { + return _impl_.name_.Get(); } -inline void DataMessage_Preview::_internal_set_title(const std::string& value) { +inline void DataMessage_OpenGroupInvitation::_internal_set_name(const std::string& value) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.title_.Set(value, GetArenaForAllocation()); + _impl_.name_.Set(value, GetArenaForAllocation()); } -inline std::string* DataMessage_Preview::_internal_mutable_title() { +inline std::string* DataMessage_OpenGroupInvitation::_internal_mutable_name() { _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.title_.Mutable(GetArenaForAllocation()); + return _impl_.name_.Mutable(GetArenaForAllocation()); } -inline std::string* DataMessage_Preview::release_title() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Preview.title) - if (!_internal_has_title()) { +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_.title_.Release(); + auto* p = _impl_.name_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.title_.IsDefault()) { - _impl_.title_.Set("", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void DataMessage_Preview::set_allocated_title(std::string* title) { - if (title != nullptr) { +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_.title_.SetAllocated(title, GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.title_.IsDefault()) { - _impl_.title_.Set("", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Preview.title) -} - -// optional .SessionProtos.AttachmentPointer image = 3; -inline bool DataMessage_Preview::_internal_has_image() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; - PROTOBUF_ASSUME(!value || _impl_.image_ != nullptr); - return value; -} -inline bool DataMessage_Preview::has_image() const { - return _internal_has_image(); -} -inline void DataMessage_Preview::clear_image() { - if (_impl_.image_ != nullptr) _impl_.image_->Clear(); - _impl_._has_bits_[0] &= ~0x00000004u; -} -inline const ::SessionProtos::AttachmentPointer& DataMessage_Preview::_internal_image() const { - const ::SessionProtos::AttachmentPointer* p = _impl_.image_; - return p != nullptr ? *p : reinterpret_cast( - ::SessionProtos::_AttachmentPointer_default_instance_); -} -inline const ::SessionProtos::AttachmentPointer& DataMessage_Preview::image() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Preview.image) - return _internal_image(); -} -inline void DataMessage_Preview::unsafe_arena_set_allocated_image( - ::SessionProtos::AttachmentPointer* image) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.image_); - } - _impl_.image_ = image; - if (image) { - _impl_._has_bits_[0] |= 0x00000004u; - } else { - _impl_._has_bits_[0] &= ~0x00000004u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.DataMessage.Preview.image) -} -inline ::SessionProtos::AttachmentPointer* DataMessage_Preview::release_image() { - _impl_._has_bits_[0] &= ~0x00000004u; - ::SessionProtos::AttachmentPointer* temp = _impl_.image_; - _impl_.image_ = 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::AttachmentPointer* DataMessage_Preview::unsafe_arena_release_image() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Preview.image) - _impl_._has_bits_[0] &= ~0x00000004u; - ::SessionProtos::AttachmentPointer* temp = _impl_.image_; - _impl_.image_ = nullptr; - return temp; -} -inline ::SessionProtos::AttachmentPointer* DataMessage_Preview::_internal_mutable_image() { - _impl_._has_bits_[0] |= 0x00000004u; - if (_impl_.image_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::AttachmentPointer>(GetArenaForAllocation()); - _impl_.image_ = p; - } - return _impl_.image_; -} -inline ::SessionProtos::AttachmentPointer* DataMessage_Preview::mutable_image() { - ::SessionProtos::AttachmentPointer* _msg = _internal_mutable_image(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Preview.image) - return _msg; -} -inline void DataMessage_Preview::set_allocated_image(::SessionProtos::AttachmentPointer* image) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete _impl_.image_; - } - if (image) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(image); - if (message_arena != submessage_arena) { - image = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, image, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000004u; - } else { - _impl_._has_bits_[0] &= ~0x00000004u; - } - _impl_.image_ = image; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Preview.image) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.OpenGroupInvitation.name) } // ------------------------------------------------------------------- -// DataMessage_Reaction - -// required uint64 id = 1; -inline bool DataMessage_Reaction::_internal_has_id() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; - return value; -} -inline bool DataMessage_Reaction::has_id() const { - return _internal_has_id(); -} -inline void DataMessage_Reaction::clear_id() { - _impl_.id_ = uint64_t{0u}; - _impl_._has_bits_[0] &= ~0x00000004u; -} -inline uint64_t DataMessage_Reaction::_internal_id() const { - return _impl_.id_; -} -inline uint64_t DataMessage_Reaction::id() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Reaction.id) - return _internal_id(); -} -inline void DataMessage_Reaction::_internal_set_id(uint64_t value) { - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.id_ = value; -} -inline void DataMessage_Reaction::set_id(uint64_t value) { - _internal_set_id(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Reaction.id) -} +// DataMessage -// required string author = 2; -inline bool DataMessage_Reaction::_internal_has_author() const { +// optional string body = 1; +inline bool DataMessage::_internal_has_body() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool DataMessage_Reaction::has_author() const { - return _internal_has_author(); +inline bool DataMessage::has_body() const { + return _internal_has_body(); } -inline void DataMessage_Reaction::clear_author() { - _impl_.author_.ClearToEmpty(); +inline void DataMessage::clear_body() { + _impl_.body_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& DataMessage_Reaction::author() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Reaction.author) - return _internal_author(); +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_Reaction::set_author(ArgT0&& arg0, ArgT... args) { +void DataMessage::set_body(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.author_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Reaction.author) + _impl_.body_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.body) } -inline std::string* DataMessage_Reaction::mutable_author() { - std::string* _s = _internal_mutable_author(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Reaction.author) +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_Reaction::_internal_author() const { - return _impl_.author_.Get(); +inline const std::string& DataMessage::_internal_body() const { + return _impl_.body_.Get(); } -inline void DataMessage_Reaction::_internal_set_author(const std::string& value) { +inline void DataMessage::_internal_set_body(const std::string& value) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.author_.Set(value, GetArenaForAllocation()); + _impl_.body_.Set(value, GetArenaForAllocation()); } -inline std::string* DataMessage_Reaction::_internal_mutable_author() { +inline std::string* DataMessage::_internal_mutable_body() { _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.author_.Mutable(GetArenaForAllocation()); + return _impl_.body_.Mutable(GetArenaForAllocation()); } -inline std::string* DataMessage_Reaction::release_author() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Reaction.author) - if (!_internal_has_author()) { +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_.author_.Release(); + auto* p = _impl_.body_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.author_.IsDefault()) { - _impl_.author_.Set("", GetArenaForAllocation()); + if (_impl_.body_.IsDefault()) { + _impl_.body_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void DataMessage_Reaction::set_allocated_author(std::string* author) { - if (author != nullptr) { +inline void DataMessage::set_allocated_body(std::string* body) { + if (body != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; } else { _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.author_.SetAllocated(author, GetArenaForAllocation()); + _impl_.body_.SetAllocated(body, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.author_.IsDefault()) { - _impl_.author_.Set("", GetArenaForAllocation()); + if (_impl_.body_.IsDefault()) { + _impl_.body_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Reaction.author) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.body) } -// optional string emoji = 3; -inline bool DataMessage_Reaction::_internal_has_emoji() const { +// 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] & 0x00000200u) != 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] &= ~0x00000200u; +} +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] |= 0x00000200u; + _impl_.flags_ = value; +} +inline void DataMessage::set_flags(uint32_t value) { + _internal_set_flags(value); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.flags) +} + +// optional bytes profileKey = 6; +inline bool DataMessage::_internal_has_profilekey() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } -inline bool DataMessage_Reaction::has_emoji() const { - return _internal_has_emoji(); +inline bool DataMessage::has_profilekey() const { + return _internal_has_profilekey(); } -inline void DataMessage_Reaction::clear_emoji() { - _impl_.emoji_.ClearToEmpty(); +inline void DataMessage::clear_profilekey() { + _impl_.profilekey_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000002u; } -inline const std::string& DataMessage_Reaction::emoji() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Reaction.emoji) - return _internal_emoji(); +inline const std::string& DataMessage::profilekey() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.profileKey) + return _internal_profilekey(); } template inline PROTOBUF_ALWAYS_INLINE -void DataMessage_Reaction::set_emoji(ArgT0&& arg0, ArgT... args) { +void DataMessage::set_profilekey(ArgT0&& arg0, ArgT... args) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.emoji_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Reaction.emoji) + _impl_.profilekey_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.profileKey) } -inline std::string* DataMessage_Reaction::mutable_emoji() { - std::string* _s = _internal_mutable_emoji(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.Reaction.emoji) +inline std::string* DataMessage::mutable_profilekey() { + std::string* _s = _internal_mutable_profilekey(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.profileKey) return _s; } -inline const std::string& DataMessage_Reaction::_internal_emoji() const { - return _impl_.emoji_.Get(); +inline const std::string& DataMessage::_internal_profilekey() const { + return _impl_.profilekey_.Get(); } -inline void DataMessage_Reaction::_internal_set_emoji(const std::string& value) { +inline void DataMessage::_internal_set_profilekey(const std::string& value) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.emoji_.Set(value, GetArenaForAllocation()); + _impl_.profilekey_.Set(value, GetArenaForAllocation()); } -inline std::string* DataMessage_Reaction::_internal_mutable_emoji() { +inline std::string* DataMessage::_internal_mutable_profilekey() { _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.emoji_.Mutable(GetArenaForAllocation()); + return _impl_.profilekey_.Mutable(GetArenaForAllocation()); } -inline std::string* DataMessage_Reaction::release_emoji() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.Reaction.emoji) - if (!_internal_has_emoji()) { +inline std::string* DataMessage::release_profilekey() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.profileKey) + if (!_internal_has_profilekey()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.emoji_.Release(); + auto* p = _impl_.profilekey_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.emoji_.IsDefault()) { - _impl_.emoji_.Set("", GetArenaForAllocation()); + if (_impl_.profilekey_.IsDefault()) { + _impl_.profilekey_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void DataMessage_Reaction::set_allocated_emoji(std::string* emoji) { - if (emoji != nullptr) { +inline void DataMessage::set_allocated_profilekey(std::string* profilekey) { + if (profilekey != nullptr) { _impl_._has_bits_[0] |= 0x00000002u; } else { _impl_._has_bits_[0] &= ~0x00000002u; } - _impl_.emoji_.SetAllocated(emoji, GetArenaForAllocation()); + _impl_.profilekey_.SetAllocated(profilekey, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.emoji_.IsDefault()) { - _impl_.emoji_.Set("", GetArenaForAllocation()); + if (_impl_.profilekey_.IsDefault()) { + _impl_.profilekey_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.Reaction.emoji) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.profileKey) } -// required .SessionProtos.DataMessage.Reaction.Action action = 4; -inline bool DataMessage_Reaction::_internal_has_action() const { - bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; +// optional uint64 timestamp = 7; +inline bool DataMessage::_internal_has_timestamp() const { + bool value = (_impl_._has_bits_[0] & 0x00000100u) != 0; return value; } -inline bool DataMessage_Reaction::has_action() const { - return _internal_has_action(); +inline bool DataMessage::has_timestamp() const { + return _internal_has_timestamp(); } -inline void DataMessage_Reaction::clear_action() { - _impl_.action_ = 0; - _impl_._has_bits_[0] &= ~0x00000008u; +inline void DataMessage::clear_timestamp() { + _impl_.timestamp_ = uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000100u; } -inline ::SessionProtos::DataMessage_Reaction_Action DataMessage_Reaction::_internal_action() const { - return static_cast< ::SessionProtos::DataMessage_Reaction_Action >(_impl_.action_); +inline uint64_t DataMessage::_internal_timestamp() const { + return _impl_.timestamp_; } -inline ::SessionProtos::DataMessage_Reaction_Action DataMessage_Reaction::action() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.Reaction.action) - return _internal_action(); +inline uint64_t DataMessage::timestamp() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.timestamp) + return _internal_timestamp(); } -inline void DataMessage_Reaction::_internal_set_action(::SessionProtos::DataMessage_Reaction_Action value) { - assert(::SessionProtos::DataMessage_Reaction_Action_IsValid(value)); - _impl_._has_bits_[0] |= 0x00000008u; - _impl_.action_ = value; +inline void DataMessage::_internal_set_timestamp(uint64_t value) { + _impl_._has_bits_[0] |= 0x00000100u; + _impl_.timestamp_ = value; } -inline void DataMessage_Reaction::set_action(::SessionProtos::DataMessage_Reaction_Action value) { - _internal_set_action(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.Reaction.action) +inline void DataMessage::set_timestamp(uint64_t value) { + _internal_set_timestamp(value); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.timestamp) } -// ------------------------------------------------------------------- - -// DataMessage_OpenGroupInvitation - -// required string url = 1; -inline bool DataMessage_OpenGroupInvitation::_internal_has_url() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; +// 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_OpenGroupInvitation::has_url() const { - return _internal_has_url(); -} -inline void DataMessage_OpenGroupInvitation::clear_url() { - _impl_.url_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000001u; +inline bool DataMessage::has_quote() const { + return _internal_has_quote(); } -inline const std::string& DataMessage_OpenGroupInvitation::url() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.OpenGroupInvitation.url) - return _internal_url(); +inline void DataMessage::clear_quote() { + if (_impl_.quote_ != nullptr) _impl_.quote_->Clear(); + _impl_._has_bits_[0] &= ~0x00000008u; } -template -inline PROTOBUF_ALWAYS_INLINE -void DataMessage_OpenGroupInvitation::set_url(ArgT0&& arg0, ArgT... args) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.url_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.OpenGroupInvitation.url) +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 std::string* DataMessage_OpenGroupInvitation::mutable_url() { - std::string* _s = _internal_mutable_url(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.OpenGroupInvitation.url) - return _s; +inline const ::SessionProtos::DataMessage_Quote& DataMessage::quote() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.quote) + return _internal_quote(); } -inline const std::string& DataMessage_OpenGroupInvitation::_internal_url() const { - return _impl_.url_.Get(); +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 void DataMessage_OpenGroupInvitation::_internal_set_url(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.url_.Set(value, GetArenaForAllocation()); +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 std::string* DataMessage_OpenGroupInvitation::_internal_mutable_url() { - _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.url_.Mutable(GetArenaForAllocation()); +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 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()); +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; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; + return _impl_.quote_; } -inline void DataMessage_OpenGroupInvitation::set_allocated_url(std::string* url) { - if (url != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; +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_; } - _impl_.url_.SetAllocated(url, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.url_.IsDefault()) { - _impl_.url_.Set("", GetArenaForAllocation()); + 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; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.OpenGroupInvitation.url) + _impl_.quote_ = quote; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.quote) } -// 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(); +// repeated .SessionProtos.DataMessage.Preview preview = 10; +inline int DataMessage::_internal_preview_size() const { + return _impl_.preview_.size(); } -inline void DataMessage_OpenGroupInvitation::clear_name() { - _impl_.name_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000002u; +inline int DataMessage::preview_size() const { + return _internal_preview_size(); } -inline const std::string& DataMessage_OpenGroupInvitation::name() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.OpenGroupInvitation.name) - return _internal_name(); +inline void DataMessage::clear_preview() { + _impl_.preview_.Clear(); } -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 ::SessionProtos::DataMessage_Preview* DataMessage::mutable_preview(int index) { + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.preview) + return _impl_.preview_.Mutable(index); } -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 ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview >* +DataMessage::mutable_preview() { + // @@protoc_insertion_point(field_mutable_list:SessionProtos.DataMessage.preview) + return &_impl_.preview_; } -inline const std::string& DataMessage_OpenGroupInvitation::_internal_name() const { - return _impl_.name_.Get(); +inline const ::SessionProtos::DataMessage_Preview& DataMessage::_internal_preview(int index) const { + return _impl_.preview_.Get(index); } -inline void DataMessage_OpenGroupInvitation::_internal_set_name(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.name_.Set(value, GetArenaForAllocation()); +inline const ::SessionProtos::DataMessage_Preview& DataMessage::preview(int index) const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.preview) + return _internal_preview(index); } -inline std::string* DataMessage_OpenGroupInvitation::_internal_mutable_name() { - _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.name_.Mutable(GetArenaForAllocation()); +inline ::SessionProtos::DataMessage_Preview* DataMessage::_internal_add_preview() { + return _impl_.preview_.Add(); } -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 ::SessionProtos::DataMessage_Preview* DataMessage::add_preview() { + ::SessionProtos::DataMessage_Preview* _add = _internal_add_preview(); + // @@protoc_insertion_point(field_add:SessionProtos.DataMessage.preview) + return _add; } -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) +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview >& +DataMessage::preview() const { + // @@protoc_insertion_point(field_list:SessionProtos.DataMessage.preview) + return _impl_.preview_; } -// ------------------------------------------------------------------- - -// DataMessage_ClosedGroupControlMessage_KeyPairWrapper - -// required bytes publicKey = 1; -inline bool DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_internal_has_publickey() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; +// 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 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 bool DataMessage::has_reaction() const { + return _internal_has_reaction(); } -inline const std::string& DataMessage_ClosedGroupControlMessage_KeyPairWrapper::publickey() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper.publicKey) - return _internal_publickey(); +inline void DataMessage::clear_reaction() { + if (_impl_.reaction_ != nullptr) _impl_.reaction_->Clear(); + _impl_._has_bits_[0] &= ~0x00000010u; } -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 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* 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 ::SessionProtos::DataMessage_Reaction& DataMessage::reaction() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.reaction) + return _internal_reaction(); } -inline const std::string& DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_internal_publickey() const { - return _impl_.publickey_.Get(); +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_ClosedGroupControlMessage_KeyPairWrapper::_internal_set_publickey(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.publickey_.Set(value, GetArenaForAllocation()); +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 std::string* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_internal_mutable_publickey() { - _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.publickey_.Mutable(GetArenaForAllocation()); +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 std::string* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::release_publickey() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.ClosedGroupControlMessage.KeyPairWrapper.publicKey) - if (!_internal_has_publickey()) { - return nullptr; +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; } - _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.publickey_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.publickey_.IsDefault()) { - _impl_.publickey_.Set("", GetArenaForAllocation()); + return _impl_.reaction_; +} +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::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 DataMessage_ClosedGroupControlMessage_KeyPairWrapper::set_allocated_publickey(std::string* publickey) { - if (publickey != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; + 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] &= ~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.DataMessage.ClosedGroupControlMessage.KeyPairWrapper.publicKey) + _impl_.reaction_ = reaction; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.reaction) } -// required bytes encryptedKeyPair = 2; -inline bool DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_internal_has_encryptedkeypair() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; +// 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 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 bool DataMessage::has_profile() const { + return _internal_has_profile(); } -inline const std::string& DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_internal_encryptedkeypair() const { - return _impl_.encryptedkeypair_.Get(); +inline void DataMessage::clear_profile() { + if (_impl_.profile_ != nullptr) _impl_.profile_->Clear(); + _impl_._has_bits_[0] &= ~0x00000020u; } -inline void DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_internal_set_encryptedkeypair(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.encryptedkeypair_.Set(value, GetArenaForAllocation()); +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 std::string* DataMessage_ClosedGroupControlMessage_KeyPairWrapper::_internal_mutable_encryptedkeypair() { - _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.encryptedkeypair_.Mutable(GetArenaForAllocation()); +inline const ::SessionProtos::LokiProfile& DataMessage::profile() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.profile) + return _internal_profile(); } -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()); +inline void DataMessage::unsafe_arena_set_allocated_profile( + ::SessionProtos::LokiProfile* profile) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.profile_); } -#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; + _impl_.profile_ = profile; + if (profile) { + _impl_._has_bits_[0] |= 0x00000020u; } 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()); + _impl_._has_bits_[0] &= ~0x00000020u; } -#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(); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.DataMessage.profile) } -inline void DataMessage_ClosedGroupControlMessage::clear_type() { - _impl_.type_ = 1; - _impl_._has_bits_[0] &= ~0x00000010u; +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 ::SessionProtos::DataMessage_ClosedGroupControlMessage_Type DataMessage_ClosedGroupControlMessage::_internal_type() const { - return static_cast< ::SessionProtos::DataMessage_ClosedGroupControlMessage_Type >(_impl_.type_); +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::DataMessage_ClosedGroupControlMessage_Type DataMessage_ClosedGroupControlMessage::type() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.ClosedGroupControlMessage.type) - return _internal_type(); +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_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 ::SessionProtos::LokiProfile* DataMessage::mutable_profile() { + ::SessionProtos::LokiProfile* _msg = _internal_mutable_profile(); + // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.profile) + return _msg; } -inline void DataMessage_ClosedGroupControlMessage::set_type(::SessionProtos::DataMessage_ClosedGroupControlMessage_Type value) { - _internal_set_type(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.ClosedGroupControlMessage.type) +inline void DataMessage::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] |= 0x00000020u; + } else { + _impl_._has_bits_[0] &= ~0x00000020u; + } + _impl_.profile_ = profile; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.profile) } -// optional bytes publicKey = 2; -inline bool DataMessage_ClosedGroupControlMessage::_internal_has_publickey() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; +// 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 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 bool DataMessage::has_opengroupinvitation() const { + return _internal_has_opengroupinvitation(); } -inline const std::string& DataMessage_ClosedGroupControlMessage::publickey() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.ClosedGroupControlMessage.publicKey) - return _internal_publickey(); +inline void DataMessage::clear_opengroupinvitation() { + if (_impl_.opengroupinvitation_ != nullptr) _impl_.opengroupinvitation_->Clear(); + _impl_._has_bits_[0] &= ~0x00000040u; } -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 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 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 ::SessionProtos::DataMessage_OpenGroupInvitation& DataMessage::opengroupinvitation() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.openGroupInvitation) + return _internal_opengroupinvitation(); } -inline const std::string& DataMessage_ClosedGroupControlMessage::_internal_publickey() const { - return _impl_.publickey_.Get(); +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 DataMessage_ClosedGroupControlMessage::_internal_set_publickey(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.publickey_.Set(value, GetArenaForAllocation()); +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* DataMessage_ClosedGroupControlMessage::_internal_mutable_publickey() { - _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.publickey_.Mutable(GetArenaForAllocation()); +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 std::string* DataMessage_ClosedGroupControlMessage::release_publickey() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.ClosedGroupControlMessage.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 ::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; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; + return _impl_.opengroupinvitation_; } -inline void DataMessage_ClosedGroupControlMessage::set_allocated_publickey(std::string* publickey) { - if (publickey != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; +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_; } - _impl_.publickey_.SetAllocated(publickey, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.publickey_.IsDefault()) { - _impl_.publickey_.Set("", GetArenaForAllocation()); + 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; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.ClosedGroupControlMessage.publicKey) + _impl_.opengroupinvitation_ = opengroupinvitation; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.openGroupInvitation) } -// optional string name = 3; -inline bool DataMessage_ClosedGroupControlMessage::_internal_has_name() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; +// optional string syncTarget = 105; +inline bool DataMessage::_internal_has_synctarget() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } -inline bool DataMessage_ClosedGroupControlMessage::has_name() const { - return _internal_has_name(); +inline bool DataMessage::has_synctarget() const { + return _internal_has_synctarget(); } -inline void DataMessage_ClosedGroupControlMessage::clear_name() { - _impl_.name_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000002u; +inline void DataMessage::clear_synctarget() { + _impl_.synctarget_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000004u; } -inline const std::string& DataMessage_ClosedGroupControlMessage::name() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.ClosedGroupControlMessage.name) - return _internal_name(); +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_ClosedGroupControlMessage::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) +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_ClosedGroupControlMessage::mutable_name() { - std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.ClosedGroupControlMessage.name) +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_ClosedGroupControlMessage::_internal_name() const { - return _impl_.name_.Get(); +inline const std::string& DataMessage::_internal_synctarget() const { + return _impl_.synctarget_.Get(); } -inline void DataMessage_ClosedGroupControlMessage::_internal_set_name(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.name_.Set(value, GetArenaForAllocation()); +inline void DataMessage::_internal_set_synctarget(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.synctarget_.Set(value, GetArenaForAllocation()); } -inline std::string* DataMessage_ClosedGroupControlMessage::_internal_mutable_name() { - _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.name_.Mutable(GetArenaForAllocation()); +inline std::string* DataMessage::_internal_mutable_synctarget() { + _impl_._has_bits_[0] |= 0x00000004u; + return _impl_.synctarget_.Mutable(GetArenaForAllocation()); } -inline std::string* DataMessage_ClosedGroupControlMessage::release_name() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.ClosedGroupControlMessage.name) - if (!_internal_has_name()) { +inline std::string* DataMessage::release_synctarget() { + // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.syncTarget) + if (!_internal_has_synctarget()) { return nullptr; } - _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.name_.Release(); + _impl_._has_bits_[0] &= ~0x00000004u; + auto* p = _impl_.synctarget_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.name_.IsDefault()) { - _impl_.name_.Set("", GetArenaForAllocation()); + if (_impl_.synctarget_.IsDefault()) { + _impl_.synctarget_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void DataMessage_ClosedGroupControlMessage::set_allocated_name(std::string* name) { - if (name != nullptr) { - _impl_._has_bits_[0] |= 0x00000002u; +inline void DataMessage::set_allocated_synctarget(std::string* synctarget) { + if (synctarget != nullptr) { + _impl_._has_bits_[0] |= 0x00000004u; } else { - _impl_._has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000004u; } - _impl_.name_.SetAllocated(name, GetArenaForAllocation()); + _impl_.synctarget_.SetAllocated(synctarget, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.name_.IsDefault()) { - _impl_.name_.Set("", GetArenaForAllocation()); + if (_impl_.synctarget_.IsDefault()) { + _impl_.synctarget_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.ClosedGroupControlMessage.name) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.syncTarget) } -// 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); +// optional bool blocksCommunityMessageRequests = 106; +inline bool DataMessage::_internal_has_blockscommunitymessagerequests() const { + bool value = (_impl_._has_bits_[0] & 0x00000400u) != 0; return value; } -inline bool DataMessage_ClosedGroupControlMessage::has_encryptionkeypair() const { - return _internal_has_encryptionkeypair(); +inline bool DataMessage::has_blockscommunitymessagerequests() const { + return _internal_has_blockscommunitymessagerequests(); } -inline void DataMessage_ClosedGroupControlMessage::clear_encryptionkeypair() { - if (_impl_.encryptionkeypair_ != nullptr) _impl_.encryptionkeypair_->Clear(); - _impl_._has_bits_[0] &= ~0x00000004u; +inline void DataMessage::clear_blockscommunitymessagerequests() { + _impl_.blockscommunitymessagerequests_ = false; + _impl_._has_bits_[0] &= ~0x00000400u; +} +inline bool DataMessage::_internal_blockscommunitymessagerequests() const { + return _impl_.blockscommunitymessagerequests_; +} +inline bool DataMessage::blockscommunitymessagerequests() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.blocksCommunityMessageRequests) + return _internal_blockscommunitymessagerequests(); +} +inline void DataMessage::_internal_set_blockscommunitymessagerequests(bool value) { + _impl_._has_bits_[0] |= 0x00000400u; + _impl_.blockscommunitymessagerequests_ = value; +} +inline void DataMessage::set_blockscommunitymessagerequests(bool value) { + _internal_set_blockscommunitymessagerequests(value); + // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.blocksCommunityMessageRequests) +} + +// 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 DataMessage::has_groupupdatemessage() const { + return _internal_has_groupupdatemessage(); +} +inline void DataMessage::clear_groupupdatemessage() { + if (_impl_.groupupdatemessage_ != nullptr) _impl_.groupupdatemessage_->Clear(); + _impl_._has_bits_[0] &= ~0x00000080u; } -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::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& DataMessage_ClosedGroupControlMessage::encryptionkeypair() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.ClosedGroupControlMessage.encryptionKeyPair) - return _internal_encryptionkeypair(); +inline const ::SessionProtos::GroupUpdateMessage& DataMessage::groupupdatemessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.groupUpdateMessage) + return _internal_groupupdatemessage(); } -inline void DataMessage_ClosedGroupControlMessage::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.DataMessage.ClosedGroupControlMessage.encryptionKeyPair) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.DataMessage.groupUpdateMessage) } -inline ::SessionProtos::KeyPair* DataMessage_ClosedGroupControlMessage::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); @@ -9167,1293 +10715,918 @@ inline ::SessionProtos::KeyPair* DataMessage_ClosedGroupControlMessage::release_ #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; +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* DataMessage_ClosedGroupControlMessage::_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* DataMessage_ClosedGroupControlMessage::mutable_encryptionkeypair() { - ::SessionProtos::KeyPair* _msg = _internal_mutable_encryptionkeypair(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.ClosedGroupControlMessage.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 DataMessage_ClosedGroupControlMessage::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.DataMessage.ClosedGroupControlMessage.encryptionKeyPair) + _impl_.groupupdatemessage_ = groupupdatemessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.groupUpdateMessage) } -// 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(); +// ------------------------------------------------------------------- + +// 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 DataMessage_ClosedGroupControlMessage::add_members(const std::string& value) { - _impl_.members_.Add()->assign(value); - // @@protoc_insertion_point(field_add:SessionProtos.DataMessage.ClosedGroupControlMessage.members) +inline bool ReceiptMessage::has_type() const { + return _internal_has_type(); } -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 ReceiptMessage::clear_type() { + _impl_.type_ = 0; + _impl_._has_bits_[0] &= ~0x00000001u; } -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 ::SessionProtos::ReceiptMessage_Type ReceiptMessage::_internal_type() const { + return static_cast< ::SessionProtos::ReceiptMessage_Type >(_impl_.type_); } -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 ::SessionProtos::ReceiptMessage_Type ReceiptMessage::type() const { + // @@protoc_insertion_point(field_get:SessionProtos.ReceiptMessage.type) + return _internal_type(); } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -DataMessage_ClosedGroupControlMessage::members() const { - // @@protoc_insertion_point(field_list:SessionProtos.DataMessage.ClosedGroupControlMessage.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* -DataMessage_ClosedGroupControlMessage::mutable_members() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.DataMessage.ClosedGroupControlMessage.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 = 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); +// repeated uint64 timestamp = 2; +inline int ReceiptMessage::_internal_timestamp_size() const { + return _impl_.timestamp_.size(); } -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 int ReceiptMessage::timestamp_size() const { + return _internal_timestamp_size(); } -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 ReceiptMessage::clear_timestamp() { + _impl_.timestamp_.Clear(); } -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 uint64_t ReceiptMessage::_internal_timestamp(int index) const { + return _impl_.timestamp_.Get(index); } -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 uint64_t ReceiptMessage::timestamp(int index) const { + // @@protoc_insertion_point(field_get:SessionProtos.ReceiptMessage.timestamp) + return _internal_timestamp(index); } -inline std::string* DataMessage_ClosedGroupControlMessage::_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 DataMessage_ClosedGroupControlMessage::add_admins(const std::string& value) { - _impl_.admins_.Add()->assign(value); - // @@protoc_insertion_point(field_add:SessionProtos.DataMessage.ClosedGroupControlMessage.admins) +inline void ReceiptMessage::_internal_add_timestamp(uint64_t value) { + _impl_.timestamp_.Add(value); } -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 ReceiptMessage::add_timestamp(uint64_t value) { + _internal_add_timestamp(value); + // @@protoc_insertion_point(field_add:SessionProtos.ReceiptMessage.timestamp) } -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 const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& +ReceiptMessage::_internal_timestamp() const { + return _impl_.timestamp_; } -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::RepeatedField< uint64_t >& +ReceiptMessage::timestamp() const { + // @@protoc_insertion_point(field_list:SessionProtos.ReceiptMessage.timestamp) + return _internal_timestamp(); } -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::RepeatedField< uint64_t >* +ReceiptMessage::_internal_mutable_timestamp() { + return &_impl_.timestamp_; } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -DataMessage_ClosedGroupControlMessage::mutable_admins() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.DataMessage.ClosedGroupControlMessage.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(); } -// 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; +// AttachmentPointer + +// required fixed64 id = 1; +inline bool AttachmentPointer::_internal_has_id() const { + bool value = (_impl_._has_bits_[0] & 0x00000080u) != 0; return value; } -inline bool DataMessage_ClosedGroupControlMessage::has_expirationtimer() const { - return _internal_has_expirationtimer(); +inline bool AttachmentPointer::has_id() const { + return _internal_has_id(); } -inline void DataMessage_ClosedGroupControlMessage::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 DataMessage_ClosedGroupControlMessage::_internal_expirationtimer() const { - return _impl_.expirationtimer_; +inline uint64_t AttachmentPointer::_internal_id() const { + return _impl_.id_; } -inline uint32_t DataMessage_ClosedGroupControlMessage::expirationtimer() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.ClosedGroupControlMessage.expirationTimer) - return _internal_expirationtimer(); +inline uint64_t AttachmentPointer::id() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.id) + return _internal_id(); } -inline void DataMessage_ClosedGroupControlMessage::_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 DataMessage_ClosedGroupControlMessage::set_expirationtimer(uint32_t value) { - _internal_set_expirationtimer(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.ClosedGroupControlMessage.expirationTimer) +inline void AttachmentPointer::set_id(uint64_t value) { + _internal_set_id(value); + // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.id) } -// ------------------------------------------------------------------- - -// DataMessage - -// optional string body = 1; -inline bool DataMessage::_internal_has_body() const { +// optional string contentType = 2; +inline bool AttachmentPointer::_internal_has_contenttype() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool DataMessage::has_body() const { - return _internal_has_body(); +inline bool AttachmentPointer::has_contenttype() const { + return _internal_has_contenttype(); } -inline void DataMessage::clear_body() { - _impl_.body_.ClearToEmpty(); +inline void AttachmentPointer::clear_contenttype() { + _impl_.contenttype_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& DataMessage::body() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.body) - return _internal_body(); +inline const std::string& AttachmentPointer::contenttype() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.contentType) + return _internal_contenttype(); } template inline PROTOBUF_ALWAYS_INLINE -void DataMessage::set_body(ArgT0&& arg0, ArgT... args) { +void AttachmentPointer::set_contenttype(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) + _impl_.contenttype_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.contentType) } -inline std::string* DataMessage::mutable_body() { - std::string* _s = _internal_mutable_body(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.body) +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& DataMessage::_internal_body() const { - return _impl_.body_.Get(); +inline const std::string& AttachmentPointer::_internal_contenttype() const { + return _impl_.contenttype_.Get(); } -inline void DataMessage::_internal_set_body(const std::string& value) { +inline void AttachmentPointer::_internal_set_contenttype(const std::string& value) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.body_.Set(value, GetArenaForAllocation()); + _impl_.contenttype_.Set(value, GetArenaForAllocation()); } -inline std::string* DataMessage::_internal_mutable_body() { +inline std::string* AttachmentPointer::_internal_mutable_contenttype() { _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.body_.Mutable(GetArenaForAllocation()); + return _impl_.contenttype_.Mutable(GetArenaForAllocation()); } -inline std::string* DataMessage::release_body() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.body) - if (!_internal_has_body()) { +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_.body_.Release(); + auto* p = _impl_.contenttype_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.body_.IsDefault()) { - _impl_.body_.Set("", GetArenaForAllocation()); + if (_impl_.contenttype_.IsDefault()) { + _impl_.contenttype_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void DataMessage::set_allocated_body(std::string* body) { - if (body != 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_.body_.SetAllocated(body, GetArenaForAllocation()); + _impl_.contenttype_.SetAllocated(contenttype, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.body_.IsDefault()) { - _impl_.body_.Set("", GetArenaForAllocation()); + if (_impl_.contenttype_.IsDefault()) { + _impl_.contenttype_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.body) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.contentType) } -// repeated .SessionProtos.AttachmentPointer attachments = 2; -inline int DataMessage::_internal_attachments_size() const { - return _impl_.attachments_.size(); +// optional bytes key = 3; +inline bool AttachmentPointer::_internal_has_key() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; } -inline int DataMessage::attachments_size() const { - return _internal_attachments_size(); +inline bool AttachmentPointer::has_key() const { + return _internal_has_key(); } -inline void DataMessage::clear_attachments() { - _impl_.attachments_.Clear(); +inline void AttachmentPointer::clear_key() { + _impl_.key_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; } -inline ::SessionProtos::AttachmentPointer* DataMessage::mutable_attachments(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.attachments) - return _impl_.attachments_.Mutable(index); +inline const std::string& AttachmentPointer::key() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.key) + return _internal_key(); } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer >* -DataMessage::mutable_attachments() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.DataMessage.attachments) - return &_impl_.attachments_; +template +inline PROTOBUF_ALWAYS_INLINE +void AttachmentPointer::set_key(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) } -inline const ::SessionProtos::AttachmentPointer& DataMessage::_internal_attachments(int index) const { - return _impl_.attachments_.Get(index); +inline std::string* AttachmentPointer::mutable_key() { + std::string* _s = _internal_mutable_key(); + // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.key) + return _s; } -inline const ::SessionProtos::AttachmentPointer& DataMessage::attachments(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.attachments) - return _internal_attachments(index); +inline const std::string& AttachmentPointer::_internal_key() const { + return _impl_.key_.Get(); } -inline ::SessionProtos::AttachmentPointer* DataMessage::_internal_add_attachments() { - return _impl_.attachments_.Add(); +inline void AttachmentPointer::_internal_set_key(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.key_.Set(value, GetArenaForAllocation()); } -inline ::SessionProtos::AttachmentPointer* DataMessage::add_attachments() { - ::SessionProtos::AttachmentPointer* _add = _internal_add_attachments(); - // @@protoc_insertion_point(field_add:SessionProtos.DataMessage.attachments) - return _add; +inline std::string* AttachmentPointer::_internal_mutable_key() { + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.key_.Mutable(GetArenaForAllocation()); } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::AttachmentPointer >& -DataMessage::attachments() const { - // @@protoc_insertion_point(field_list:SessionProtos.DataMessage.attachments) - return _impl_.attachments_; +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_.key_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.key_.IsDefault()) { + _impl_.key_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void AttachmentPointer::set_allocated_key(std::string* key) { + if (key != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + _impl_.key_.SetAllocated(key, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.key_.IsDefault()) { + _impl_.key_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.key) } -// optional uint32 flags = 4; -inline bool DataMessage::_internal_has_flags() const { +// optional uint32 size = 4; +inline bool AttachmentPointer::_internal_has_size() const { bool value = (_impl_._has_bits_[0] & 0x00000100u) != 0; return value; } -inline bool DataMessage::has_flags() const { - return _internal_has_flags(); +inline bool AttachmentPointer::has_size() const { + return _internal_has_size(); } -inline void DataMessage::clear_flags() { - _impl_.flags_ = 0u; +inline void AttachmentPointer::clear_size() { + _impl_.size_ = 0u; _impl_._has_bits_[0] &= ~0x00000100u; } -inline uint32_t DataMessage::_internal_flags() const { - return _impl_.flags_; +inline uint32_t AttachmentPointer::_internal_size() const { + return _impl_.size_; } -inline uint32_t DataMessage::flags() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.flags) - return _internal_flags(); +inline uint32_t AttachmentPointer::size() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.size) + return _internal_size(); } -inline void DataMessage::_internal_set_flags(uint32_t value) { +inline void AttachmentPointer::_internal_set_size(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_.size_ = value; } -inline void DataMessage::set_expiretimer(uint32_t value) { - _internal_set_expiretimer(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.expireTimer) +inline void AttachmentPointer::set_size(uint32_t value) { + _internal_set_size(value); + // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.size) } -// optional bytes profileKey = 6; -inline bool DataMessage::_internal_has_profilekey() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; +// optional bytes thumbnail = 5; +inline bool AttachmentPointer::_internal_has_thumbnail() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } -inline bool DataMessage::has_profilekey() const { - return _internal_has_profilekey(); +inline bool AttachmentPointer::has_thumbnail() const { + return _internal_has_thumbnail(); } -inline void DataMessage::clear_profilekey() { - _impl_.profilekey_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000002u; +inline void AttachmentPointer::clear_thumbnail() { + _impl_.thumbnail_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000004u; } -inline const std::string& DataMessage::profilekey() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.profileKey) - return _internal_profilekey(); +inline const std::string& AttachmentPointer::thumbnail() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.thumbnail) + return _internal_thumbnail(); } 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 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) } -inline std::string* DataMessage::mutable_profilekey() { - std::string* _s = _internal_mutable_profilekey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.profileKey) +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& DataMessage::_internal_profilekey() const { - return _impl_.profilekey_.Get(); +inline const std::string& AttachmentPointer::_internal_thumbnail() const { + return _impl_.thumbnail_.Get(); } -inline void DataMessage::_internal_set_profilekey(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.profilekey_.Set(value, GetArenaForAllocation()); +inline void AttachmentPointer::_internal_set_thumbnail(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.thumbnail_.Set(value, GetArenaForAllocation()); } -inline std::string* DataMessage::_internal_mutable_profilekey() { - _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.profilekey_.Mutable(GetArenaForAllocation()); +inline std::string* AttachmentPointer::_internal_mutable_thumbnail() { + _impl_._has_bits_[0] |= 0x00000004u; + return _impl_.thumbnail_.Mutable(GetArenaForAllocation()); } -inline std::string* DataMessage::release_profilekey() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.profileKey) - if (!_internal_has_profilekey()) { +inline std::string* AttachmentPointer::release_thumbnail() { + // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.thumbnail) + if (!_internal_has_thumbnail()) { return nullptr; } - _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.profilekey_.Release(); + _impl_._has_bits_[0] &= ~0x00000004u; + auto* p = _impl_.thumbnail_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilekey_.IsDefault()) { - _impl_.profilekey_.Set("", GetArenaForAllocation()); + if (_impl_.thumbnail_.IsDefault()) { + _impl_.thumbnail_.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 AttachmentPointer::set_allocated_thumbnail(std::string* thumbnail) { + if (thumbnail != nullptr) { + _impl_._has_bits_[0] |= 0x00000004u; } else { - _impl_._has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000004u; } - _impl_.profilekey_.SetAllocated(profilekey, GetArenaForAllocation()); + _impl_.thumbnail_.SetAllocated(thumbnail, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilekey_.IsDefault()) { - _impl_.profilekey_.Set("", GetArenaForAllocation()); + if (_impl_.thumbnail_.IsDefault()) { + _impl_.thumbnail_.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) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.thumbnail) } -// optional .SessionProtos.DataMessage.Quote quote = 8; -inline bool DataMessage::_internal_has_quote() const { +// optional bytes digest = 6; +inline bool AttachmentPointer::_internal_has_digest() 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 bool AttachmentPointer::has_digest() const { + return _internal_has_digest(); } -inline void DataMessage::clear_quote() { - if (_impl_.quote_ != nullptr) _impl_.quote_->Clear(); +inline void AttachmentPointer::clear_digest() { + _impl_.digest_.ClearToEmpty(); _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 const std::string& AttachmentPointer::digest() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.digest) + return _internal_digest(); } -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) +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 ::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 std::string* AttachmentPointer::mutable_digest() { + std::string* _s = _internal_mutable_digest(); + // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.digest) + return _s; } -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 const std::string& AttachmentPointer::_internal_digest() const { + return _impl_.digest_.Get(); } -inline ::SessionProtos::DataMessage_Quote* DataMessage::_internal_mutable_quote() { +inline void AttachmentPointer::_internal_set_digest(const std::string& value) { _impl_._has_bits_[0] |= 0x00000008u; - if (_impl_.quote_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::DataMessage_Quote>(GetArenaForAllocation()); - _impl_.quote_ = p; - } - return _impl_.quote_; + _impl_.digest_.Set(value, GetArenaForAllocation()); } -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 std::string* AttachmentPointer::_internal_mutable_digest() { + _impl_._has_bits_[0] |= 0x00000008u; + return _impl_.digest_.Mutable(GetArenaForAllocation()); } -inline void DataMessage::set_allocated_quote(::SessionProtos::DataMessage_Quote* quote) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete _impl_.quote_; +inline std::string* AttachmentPointer::release_digest() { + // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.digest) + if (!_internal_has_digest()) { + return nullptr; } - 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; + 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 AttachmentPointer::set_allocated_digest(std::string* digest) { + if (digest != nullptr) { _impl_._has_bits_[0] |= 0x00000008u; } else { _impl_._has_bits_[0] &= ~0x00000008u; } - _impl_.quote_ = quote; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.quote) -} - -// repeated .SessionProtos.DataMessage.Preview preview = 10; -inline int DataMessage::_internal_preview_size() const { - return _impl_.preview_.size(); -} -inline int DataMessage::preview_size() const { - return _internal_preview_size(); -} -inline void DataMessage::clear_preview() { - _impl_.preview_.Clear(); -} -inline ::SessionProtos::DataMessage_Preview* DataMessage::mutable_preview(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.preview) - return _impl_.preview_.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 const ::SessionProtos::DataMessage_Preview& DataMessage::_internal_preview(int index) const { - return _impl_.preview_.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 ::SessionProtos::DataMessage_Preview* DataMessage::_internal_add_preview() { - return _impl_.preview_.Add(); -} -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 ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::DataMessage_Preview >& -DataMessage::preview() const { - // @@protoc_insertion_point(field_list:SessionProtos.DataMessage.preview) - return _impl_.preview_; + _impl_.digest_.SetAllocated(digest, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.digest_.IsDefault()) { + _impl_.digest_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.digest) } -// optional .SessionProtos.DataMessage.Reaction reaction = 11; -inline bool DataMessage::_internal_has_reaction() const { +// optional string fileName = 7; +inline bool AttachmentPointer::_internal_has_filename() const { bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; - PROTOBUF_ASSUME(!value || _impl_.reaction_ != nullptr); return value; } -inline bool DataMessage::has_reaction() const { - return _internal_has_reaction(); +inline bool AttachmentPointer::has_filename() const { + return _internal_has_filename(); } -inline void DataMessage::clear_reaction() { - if (_impl_.reaction_ != nullptr) _impl_.reaction_->Clear(); +inline void AttachmentPointer::clear_filename() { + _impl_.filename_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000010u; } -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 const ::SessionProtos::DataMessage_Reaction& DataMessage::reaction() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.reaction) - return _internal_reaction(); +inline const std::string& AttachmentPointer::filename() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.fileName) + return _internal_filename(); } -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) +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) } -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 std::string* AttachmentPointer::mutable_filename() { + std::string* _s = _internal_mutable_filename(); + // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.fileName) + return _s; } -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 const std::string& AttachmentPointer::_internal_filename() const { + return _impl_.filename_.Get(); } -inline ::SessionProtos::DataMessage_Reaction* DataMessage::_internal_mutable_reaction() { +inline void AttachmentPointer::_internal_set_filename(const std::string& value) { _impl_._has_bits_[0] |= 0x00000010u; - if (_impl_.reaction_ == nullptr) { - auto* p = CreateMaybeMessage<::SessionProtos::DataMessage_Reaction>(GetArenaForAllocation()); - _impl_.reaction_ = p; - } - return _impl_.reaction_; + _impl_.filename_.Set(value, 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* AttachmentPointer::_internal_mutable_filename() { + _impl_._has_bits_[0] |= 0x00000010u; + return _impl_.filename_.Mutable(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_; +inline std::string* AttachmentPointer::release_filename() { + // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.fileName) + if (!_internal_has_filename()) { + return nullptr; } - 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; + auto* p = _impl_.filename_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.filename_.IsDefault()) { + _impl_.filename_.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; } else { _impl_._has_bits_[0] &= ~0x00000010u; } - _impl_.reaction_ = reaction; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.reaction) + _impl_.filename_.SetAllocated(filename, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.filename_.IsDefault()) { + _impl_.filename_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.fileName) } -// 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 uint32 flags = 8; +inline bool AttachmentPointer::_internal_has_flags() const { + bool value = (_impl_._has_bits_[0] & 0x00000200u) != 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 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::LokiProfile& DataMessage::profile() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.profile) - return _internal_profile(); -} -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) +inline bool AttachmentPointer::has_flags() const { + return _internal_has_flags(); } -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 void AttachmentPointer::clear_flags() { + _impl_.flags_ = 0u; + _impl_._has_bits_[0] &= ~0x00000200u; } -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 uint32_t AttachmentPointer::_internal_flags() const { + return _impl_.flags_; } -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 uint32_t AttachmentPointer::flags() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.flags) + return _internal_flags(); } -inline ::SessionProtos::LokiProfile* DataMessage::mutable_profile() { - ::SessionProtos::LokiProfile* _msg = _internal_mutable_profile(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.profile) - return _msg; +inline void AttachmentPointer::_internal_set_flags(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000200u; + _impl_.flags_ = value; } -inline void DataMessage::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] |= 0x00000020u; - } else { - _impl_._has_bits_[0] &= ~0x00000020u; - } - _impl_.profile_ = profile; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.profile) +inline void AttachmentPointer::set_flags(uint32_t value) { + _internal_set_flags(value); + // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.flags) } -// 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 uint32 width = 9; +inline bool AttachmentPointer::_internal_has_width() 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 bool AttachmentPointer::has_width() const { + return _internal_has_width(); } -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 AttachmentPointer::clear_width() { + _impl_.width_ = 0u; + _impl_._has_bits_[0] &= ~0x00000400u; } -inline const ::SessionProtos::DataMessage_OpenGroupInvitation& DataMessage::opengroupinvitation() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.openGroupInvitation) - return _internal_opengroupinvitation(); +inline uint32_t AttachmentPointer::_internal_width() const { + return _impl_.width_; } -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 uint32_t AttachmentPointer::width() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.width) + return _internal_width(); } -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 AttachmentPointer::_internal_set_width(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000400u; + _impl_.width_ = value; } -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 AttachmentPointer::set_width(uint32_t value) { + _internal_set_width(value); + // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.width) } -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_; + +// optional uint32 height = 10; +inline bool AttachmentPointer::_internal_has_height() const { + bool value = (_impl_._has_bits_[0] & 0x00000800u) != 0; + return value; } -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 bool AttachmentPointer::has_height() const { + return _internal_has_height(); } -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 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 .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 string caption = 11; +inline bool AttachmentPointer::_internal_has_caption() const { + bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; 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 bool AttachmentPointer::has_caption() const { + return _internal_has_caption(); } -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 void AttachmentPointer::clear_caption() { + _impl_.caption_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000020u; } -inline const ::SessionProtos::DataMessage_ClosedGroupControlMessage& DataMessage::closedgroupcontrolmessage() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.closedGroupControlMessage) - return _internal_closedgroupcontrolmessage(); +inline const std::string& AttachmentPointer::caption() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.caption) + return _internal_caption(); } -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) +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 ::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 std::string* AttachmentPointer::mutable_caption() { + std::string* _s = _internal_mutable_caption(); + // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.caption) + return _s; } -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& AttachmentPointer::_internal_caption() const { + return _impl_.caption_.Get(); } -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 void AttachmentPointer::_internal_set_caption(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000020u; + _impl_.caption_.Set(value, GetArenaForAllocation()); } -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 std::string* AttachmentPointer::_internal_mutable_caption() { + _impl_._has_bits_[0] |= 0x00000020u; + return _impl_.caption_.Mutable(GetArenaForAllocation()); } -inline void DataMessage::set_allocated_closedgroupcontrolmessage(::SessionProtos::DataMessage_ClosedGroupControlMessage* closedgroupcontrolmessage) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete _impl_.closedgroupcontrolmessage_; +inline std::string* AttachmentPointer::release_caption() { + // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.caption) + if (!_internal_has_caption()) { + return nullptr; } - 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; + _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 AttachmentPointer::set_allocated_caption(std::string* caption) { + if (caption != nullptr) { + _impl_._has_bits_[0] |= 0x00000020u; } else { - _impl_._has_bits_[0] &= ~0x00000080u; + _impl_._has_bits_[0] &= ~0x00000020u; + } + _impl_.caption_.SetAllocated(caption, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.caption_.IsDefault()) { + _impl_.caption_.Set("", GetArenaForAllocation()); } - _impl_.closedgroupcontrolmessage_ = closedgroupcontrolmessage; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.closedGroupControlMessage) +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.caption) } -// optional string syncTarget = 105; -inline bool DataMessage::_internal_has_synctarget() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; +// optional string url = 101; +inline bool AttachmentPointer::_internal_has_url() const { + bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; return value; } -inline bool DataMessage::has_synctarget() const { - return _internal_has_synctarget(); +inline bool AttachmentPointer::has_url() const { + return _internal_has_url(); } -inline void DataMessage::clear_synctarget() { - _impl_.synctarget_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000004u; +inline void AttachmentPointer::clear_url() { + _impl_.url_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000040u; } -inline const std::string& DataMessage::synctarget() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.syncTarget) - return _internal_synctarget(); +inline const std::string& AttachmentPointer::url() const { + // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.url) + return _internal_url(); } 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) +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* DataMessage::mutable_synctarget() { - std::string* _s = _internal_mutable_synctarget(); - // @@protoc_insertion_point(field_mutable:SessionProtos.DataMessage.syncTarget) +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& DataMessage::_internal_synctarget() const { - return _impl_.synctarget_.Get(); +inline const std::string& AttachmentPointer::_internal_url() const { + return _impl_.url_.Get(); } -inline void DataMessage::_internal_set_synctarget(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.synctarget_.Set(value, GetArenaForAllocation()); +inline void AttachmentPointer::_internal_set_url(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000040u; + _impl_.url_.Set(value, GetArenaForAllocation()); } -inline std::string* DataMessage::_internal_mutable_synctarget() { - _impl_._has_bits_[0] |= 0x00000004u; - return _impl_.synctarget_.Mutable(GetArenaForAllocation()); +inline std::string* AttachmentPointer::_internal_mutable_url() { + _impl_._has_bits_[0] |= 0x00000040u; + return _impl_.url_.Mutable(GetArenaForAllocation()); } -inline std::string* DataMessage::release_synctarget() { - // @@protoc_insertion_point(field_release:SessionProtos.DataMessage.syncTarget) - if (!_internal_has_synctarget()) { +inline std::string* AttachmentPointer::release_url() { + // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.url) + if (!_internal_has_url()) { return nullptr; } - _impl_._has_bits_[0] &= ~0x00000004u; - auto* p = _impl_.synctarget_.Release(); + _impl_._has_bits_[0] &= ~0x00000040u; + auto* p = _impl_.url_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.synctarget_.IsDefault()) { - _impl_.synctarget_.Set("", GetArenaForAllocation()); + if (_impl_.url_.IsDefault()) { + _impl_.url_.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; +inline void AttachmentPointer::set_allocated_url(std::string* url) { + if (url != nullptr) { + _impl_._has_bits_[0] |= 0x00000040u; } else { - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000040u; } - _impl_.synctarget_.SetAllocated(synctarget, GetArenaForAllocation()); + _impl_.url_.SetAllocated(url, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.synctarget_.IsDefault()) { - _impl_.synctarget_.Set("", GetArenaForAllocation()); + if (_impl_.url_.IsDefault()) { + _impl_.url_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.DataMessage.syncTarget) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.url) } -// optional bool blocksCommunityMessageRequests = 106; -inline bool DataMessage::_internal_has_blockscommunitymessagerequests() const { - bool value = (_impl_._has_bits_[0] & 0x00000800u) != 0; +// ------------------------------------------------------------------- + +// 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 bool DataMessage::has_blockscommunitymessagerequests() const { - return _internal_has_blockscommunitymessagerequests(); +inline bool SharedConfigMessage::has_kind() const { + return _internal_has_kind(); } -inline void DataMessage::clear_blockscommunitymessagerequests() { - _impl_.blockscommunitymessagerequests_ = false; - _impl_._has_bits_[0] &= ~0x00000800u; +inline void SharedConfigMessage::clear_kind() { + _impl_.kind_ = 1; + _impl_._has_bits_[0] &= ~0x00000004u; } -inline bool DataMessage::_internal_blockscommunitymessagerequests() const { - return _impl_.blockscommunitymessagerequests_; +inline ::SessionProtos::SharedConfigMessage_Kind SharedConfigMessage::_internal_kind() const { + return static_cast< ::SessionProtos::SharedConfigMessage_Kind >(_impl_.kind_); } -inline bool DataMessage::blockscommunitymessagerequests() const { - // @@protoc_insertion_point(field_get:SessionProtos.DataMessage.blocksCommunityMessageRequests) - return _internal_blockscommunitymessagerequests(); +inline ::SessionProtos::SharedConfigMessage_Kind SharedConfigMessage::kind() const { + // @@protoc_insertion_point(field_get:SessionProtos.SharedConfigMessage.kind) + return _internal_kind(); } -inline void DataMessage::_internal_set_blockscommunitymessagerequests(bool value) { - _impl_._has_bits_[0] |= 0x00000800u; - _impl_.blockscommunitymessagerequests_ = value; +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 DataMessage::set_blockscommunitymessagerequests(bool value) { - _internal_set_blockscommunitymessagerequests(value); - // @@protoc_insertion_point(field_set:SessionProtos.DataMessage.blocksCommunityMessageRequests) +inline void SharedConfigMessage::set_kind(::SessionProtos::SharedConfigMessage_Kind value) { + _internal_set_kind(value); + // @@protoc_insertion_point(field_set:SessionProtos.SharedConfigMessage.kind) } -// ------------------------------------------------------------------- - -// ConfigurationMessage_ClosedGroup +// required int64 seqno = 2; +inline bool SharedConfigMessage::_internal_has_seqno() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool SharedConfigMessage::has_seqno() const { + return _internal_has_seqno(); +} +inline void SharedConfigMessage::clear_seqno() { + _impl_.seqno_ = int64_t{0}; + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline int64_t SharedConfigMessage::_internal_seqno() const { + return _impl_.seqno_; +} +inline int64_t SharedConfigMessage::seqno() const { + // @@protoc_insertion_point(field_get:SessionProtos.SharedConfigMessage.seqno) + return _internal_seqno(); +} +inline void SharedConfigMessage::_internal_set_seqno(int64_t value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.seqno_ = value; +} +inline void SharedConfigMessage::set_seqno(int64_t value) { + _internal_set_seqno(value); + // @@protoc_insertion_point(field_set:SessionProtos.SharedConfigMessage.seqno) +} -// optional bytes publicKey = 1; -inline bool ConfigurationMessage_ClosedGroup::_internal_has_publickey() 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_ClosedGroup::has_publickey() const { - return _internal_has_publickey(); +inline bool SharedConfigMessage::has_data() const { + return _internal_has_data(); } -inline void ConfigurationMessage_ClosedGroup::clear_publickey() { - _impl_.publickey_.ClearToEmpty(); +inline void SharedConfigMessage::clear_data() { + _impl_.data_.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(); +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_ClosedGroup::set_publickey(ArgT0&& arg0, ArgT... args) { +void SharedConfigMessage::set_data(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) + _impl_.data_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.SharedConfigMessage.data) } -inline std::string* ConfigurationMessage_ClosedGroup::mutable_publickey() { - std::string* _s = _internal_mutable_publickey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.publicKey) +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_ClosedGroup::_internal_publickey() const { - return _impl_.publickey_.Get(); +inline const std::string& SharedConfigMessage::_internal_data() const { + return _impl_.data_.Get(); } -inline void ConfigurationMessage_ClosedGroup::_internal_set_publickey(const std::string& value) { +inline void SharedConfigMessage::_internal_set_data(const std::string& value) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.publickey_.Set(value, GetArenaForAllocation()); + _impl_.data_.Set(value, GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_ClosedGroup::_internal_mutable_publickey() { +inline std::string* SharedConfigMessage::_internal_mutable_data() { _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.publickey_.Mutable(GetArenaForAllocation()); + return _impl_.data_.Mutable(GetArenaForAllocation()); } -inline std::string* ConfigurationMessage_ClosedGroup::release_publickey() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.ClosedGroup.publicKey) - if (!_internal_has_publickey()) { +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_.publickey_.Release(); + auto* p = _impl_.data_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.publickey_.IsDefault()) { - _impl_.publickey_.Set("", GetArenaForAllocation()); + if (_impl_.data_.IsDefault()) { + _impl_.data_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void ConfigurationMessage_ClosedGroup::set_allocated_publickey(std::string* publickey) { - if (publickey != 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_.publickey_.SetAllocated(publickey, GetArenaForAllocation()); + _impl_.data_.SetAllocated(data, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.publickey_.IsDefault()) { - _impl_.publickey_.Set("", GetArenaForAllocation()); + if (_impl_.data_.IsDefault()) { + _impl_.data_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.ClosedGroup.publicKey) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.SharedConfigMessage.data) } -// 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); +// 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_ClosedGroup::has_encryptionkeypair() const { - return _internal_has_encryptionkeypair(); +inline bool GroupUpdateMessage::has_invitemessage() const { + return _internal_has_invitemessage(); } -inline void ConfigurationMessage_ClosedGroup::clear_encryptionkeypair() { - if (_impl_.encryptionkeypair_ != nullptr) _impl_.encryptionkeypair_->Clear(); - _impl_._has_bits_[0] &= ~0x00000004u; +inline void GroupUpdateMessage::clear_invitemessage() { + if (_impl_.invitemessage_ != nullptr) _impl_.invitemessage_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; } -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::GroupUpdateInviteMessage& GroupUpdateMessage::_internal_invitemessage() const { + const ::SessionProtos::GroupUpdateInviteMessage* p = _impl_.invitemessage_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_GroupUpdateInviteMessage_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::GroupUpdateInviteMessage& GroupUpdateMessage::invitemessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMessage.inviteMessage) + return _internal_invitemessage(); } -inline void ConfigurationMessage_ClosedGroup::unsafe_arena_set_allocated_encryptionkeypair( - ::SessionProtos::KeyPair* encryptionkeypair) { +inline void GroupUpdateMessage::unsafe_arena_set_allocated_invitemessage( + ::SessionProtos::GroupUpdateInviteMessage* invitemessage) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.encryptionkeypair_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.invitemessage_); } - _impl_.encryptionkeypair_ = encryptionkeypair; - if (encryptionkeypair) { - _impl_._has_bits_[0] |= 0x00000004u; + _impl_.invitemessage_ = invitemessage; + if (invitemessage) { + _impl_._has_bits_[0] |= 0x00000001u; } else { - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000001u; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.ConfigurationMessage.ClosedGroup.encryptionKeyPair) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.GroupUpdateMessage.inviteMessage) } -inline ::SessionProtos::KeyPair* ConfigurationMessage_ClosedGroup::release_encryptionkeypair() { - _impl_._has_bits_[0] &= ~0x00000004u; - ::SessionProtos::KeyPair* temp = _impl_.encryptionkeypair_; - _impl_.encryptionkeypair_ = nullptr; +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); @@ -10465,1774 +11638,2139 @@ 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::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 ::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::GroupUpdateInviteMessage* GroupUpdateMessage::_internal_mutable_invitemessage() { + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.invitemessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::GroupUpdateInviteMessage>(GetArenaForAllocation()); + _impl_.invitemessage_ = p; } - return _impl_.encryptionkeypair_; + return _impl_.invitemessage_; } -inline ::SessionProtos::KeyPair* ConfigurationMessage_ClosedGroup::mutable_encryptionkeypair() { - ::SessionProtos::KeyPair* _msg = _internal_mutable_encryptionkeypair(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.ClosedGroup.encryptionKeyPair) +inline ::SessionProtos::GroupUpdateInviteMessage* GroupUpdateMessage::mutable_invitemessage() { + ::SessionProtos::GroupUpdateInviteMessage* _msg = _internal_mutable_invitemessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateMessage.inviteMessage) return _msg; } -inline void ConfigurationMessage_ClosedGroup::set_allocated_encryptionkeypair(::SessionProtos::KeyPair* encryptionkeypair) { +inline void GroupUpdateMessage::set_allocated_invitemessage(::SessionProtos::GroupUpdateInviteMessage* invitemessage) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.encryptionkeypair_; + delete _impl_.invitemessage_; } - if (encryptionkeypair) { + if (invitemessage) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(encryptionkeypair); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(invitemessage); if (message_arena != submessage_arena) { - encryptionkeypair = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, encryptionkeypair, submessage_arena); + invitemessage = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, invitemessage, submessage_arena); } - _impl_._has_bits_[0] |= 0x00000004u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.encryptionkeypair_ = encryptionkeypair; - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.ClosedGroup.encryptionKeyPair) -} - -// 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) + _impl_.invitemessage_ = invitemessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateMessage.inviteMessage) } -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(); -} -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 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 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_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 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_; -} - -// 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); -} -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 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_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 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 std::string* ConfigurationMessage_ClosedGroup::_internal_add_admins() { - return _impl_.admins_.Add(); -} -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_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_; -} - -// 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_ClosedGroup::has_expirationtimer() const { - return _internal_has_expirationtimer(); -} -inline void ConfigurationMessage_ClosedGroup::clear_expirationtimer() { - _impl_.expirationtimer_ = 0u; - _impl_._has_bits_[0] &= ~0x00000008u; -} -inline uint32_t ConfigurationMessage_ClosedGroup::_internal_expirationtimer() const { - return _impl_.expirationtimer_; -} -inline uint32_t ConfigurationMessage_ClosedGroup::expirationtimer() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.ClosedGroup.expirationTimer) - return _internal_expirationtimer(); -} -inline void ConfigurationMessage_ClosedGroup::_internal_set_expirationtimer(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000008u; - _impl_.expirationtimer_ = value; -} -inline void ConfigurationMessage_ClosedGroup::set_expirationtimer(uint32_t value) { - _internal_set_expirationtimer(value); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.ClosedGroup.expirationTimer) -} - -// ------------------------------------------------------------------- -// ConfigurationMessage_Contact - -// required bytes publicKey = 1; -inline bool ConfigurationMessage_Contact::_internal_has_publickey() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 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_Contact::has_publickey() const { - return _internal_has_publickey(); -} -inline void ConfigurationMessage_Contact::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) - return _internal_publickey(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage_Contact::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) -} -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 bool GroupUpdateMessage::has_infochangemessage() const { + return _internal_has_infochangemessage(); } -inline const std::string& ConfigurationMessage_Contact::_internal_publickey() const { - return _impl_.publickey_.Get(); +inline void GroupUpdateMessage::clear_infochangemessage() { + if (_impl_.infochangemessage_ != nullptr) _impl_.infochangemessage_->Clear(); + _impl_._has_bits_[0] &= ~0x00000002u; } -inline void ConfigurationMessage_Contact::_internal_set_publickey(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.publickey_.Set(value, GetArenaForAllocation()); +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_Contact::_internal_mutable_publickey() { - _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.publickey_.Mutable(GetArenaForAllocation()); +inline const ::SessionProtos::GroupUpdateInfoChangeMessage& GroupUpdateMessage::infochangemessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMessage.infoChangeMessage) + return _internal_infochangemessage(); } -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_.publickey_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.publickey_.IsDefault()) { - _impl_.publickey_.Set("", GetArenaForAllocation()); +inline void GroupUpdateMessage::unsafe_arena_set_allocated_infochangemessage( + ::SessionProtos::GroupUpdateInfoChangeMessage* infochangemessage) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.infochangemessage_); } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void ConfigurationMessage_Contact::set_allocated_publickey(std::string* publickey) { - if (publickey != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; + _impl_.infochangemessage_ = infochangemessage; + if (infochangemessage) { + _impl_._has_bits_[0] |= 0x00000002u; } 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] &= ~0x00000002u; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.Contact.publicKey) -} - -// required string name = 2; -inline bool ConfigurationMessage_Contact::_internal_has_name() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - return value; + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:SessionProtos.GroupUpdateMessage.infoChangeMessage) } -inline bool ConfigurationMessage_Contact::has_name() const { - return _internal_has_name(); -} -inline void ConfigurationMessage_Contact::clear_name() { - _impl_.name_.ClearToEmpty(); +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 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_Contact::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) -} -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_Contact::_internal_name() const { - return _impl_.name_.Get(); +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 void ConfigurationMessage_Contact::_internal_set_name(const std::string& value) { +inline ::SessionProtos::GroupUpdateInfoChangeMessage* GroupUpdateMessage::_internal_mutable_infochangemessage() { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.name_.Set(value, GetArenaForAllocation()); + if (_impl_.infochangemessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::GroupUpdateInfoChangeMessage>(GetArenaForAllocation()); + _impl_.infochangemessage_ = p; + } + return _impl_.infochangemessage_; } -inline std::string* ConfigurationMessage_Contact::_internal_mutable_name() { - _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.name_.Mutable(GetArenaForAllocation()); +inline ::SessionProtos::GroupUpdateInfoChangeMessage* GroupUpdateMessage::mutable_infochangemessage() { + ::SessionProtos::GroupUpdateInfoChangeMessage* _msg = _internal_mutable_infochangemessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateMessage.infoChangeMessage) + return _msg; } -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_.name_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.name_.IsDefault()) { - _impl_.name_.Set("", GetArenaForAllocation()); +inline void GroupUpdateMessage::set_allocated_infochangemessage(::SessionProtos::GroupUpdateInfoChangeMessage* infochangemessage) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.infochangemessage_; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void ConfigurationMessage_Contact::set_allocated_name(std::string* name) { - if (name != nullptr) { + 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; } - _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.Contact.name) + _impl_.infochangemessage_ = infochangemessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateMessage.infoChangeMessage) } -// optional string profilePicture = 3; -inline bool ConfigurationMessage_Contact::_internal_has_profilepicture() const { +// 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 ConfigurationMessage_Contact::has_profilepicture() const { - return _internal_has_profilepicture(); +inline bool GroupUpdateMessage::has_memberchangemessage() const { + return _internal_has_memberchangemessage(); } -inline void ConfigurationMessage_Contact::clear_profilepicture() { - _impl_.profilepicture_.ClearToEmpty(); +inline void GroupUpdateMessage::clear_memberchangemessage() { + if (_impl_.memberchangemessage_ != nullptr) _impl_.memberchangemessage_->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::GroupUpdateMemberChangeMessage& GroupUpdateMessage::_internal_memberchangemessage() const { + const ::SessionProtos::GroupUpdateMemberChangeMessage* p = _impl_.memberchangemessage_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_GroupUpdateMemberChangeMessage_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::GroupUpdateMemberChangeMessage& GroupUpdateMessage::memberchangemessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMessage.memberChangeMessage) + return _internal_memberchangemessage(); } -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 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 std::string& ConfigurationMessage_Contact::_internal_profilepicture() const { - return _impl_.profilepicture_.Get(); +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 void ConfigurationMessage_Contact::_internal_set_profilepicture(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.profilepicture_.Set(value, GetArenaForAllocation()); +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 std::string* ConfigurationMessage_Contact::_internal_mutable_profilepicture() { +inline ::SessionProtos::GroupUpdateMemberChangeMessage* GroupUpdateMessage::_internal_mutable_memberchangemessage() { _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_.memberchangemessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::GroupUpdateMemberChangeMessage>(GetArenaForAllocation()); + _impl_.memberchangemessage_ = p; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; + return _impl_.memberchangemessage_; } -inline void ConfigurationMessage_Contact::set_allocated_profilepicture(std::string* profilepicture) { - if (profilepicture != nullptr) { +inline ::SessionProtos::GroupUpdateMemberChangeMessage* GroupUpdateMessage::mutable_memberchangemessage() { + ::SessionProtos::GroupUpdateMemberChangeMessage* _msg = _internal_mutable_memberchangemessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateMessage.memberChangeMessage) + return _msg; +} +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_.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_.memberchangemessage_ = memberchangemessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateMessage.memberChangeMessage) } -// optional bytes profileKey = 4; -inline bool ConfigurationMessage_Contact::_internal_has_profilekey() 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_.promotemessage_ != nullptr); return value; } -inline bool ConfigurationMessage_Contact::has_profilekey() const { - return _internal_has_profilekey(); +inline bool GroupUpdateMessage::has_promotemessage() const { + return _internal_has_promotemessage(); } -inline void ConfigurationMessage_Contact::clear_profilekey() { - _impl_.profilekey_.ClearToEmpty(); +inline void GroupUpdateMessage::clear_promotemessage() { + if (_impl_.promotemessage_ != nullptr) _impl_.promotemessage_->Clear(); _impl_._has_bits_[0] &= ~0x00000008u; } -inline const std::string& ConfigurationMessage_Contact::profilekey() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.profileKey) - return _internal_profilekey(); +inline const ::SessionProtos::GroupUpdatePromoteMessage& GroupUpdateMessage::_internal_promotemessage() const { + const ::SessionProtos::GroupUpdatePromoteMessage* p = _impl_.promotemessage_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_GroupUpdatePromoteMessage_default_instance_); } -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 const ::SessionProtos::GroupUpdatePromoteMessage& GroupUpdateMessage::promotemessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMessage.promoteMessage) + return _internal_promotemessage(); } -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 void GroupUpdateMessage::unsafe_arena_set_allocated_promotemessage( + ::SessionProtos::GroupUpdatePromoteMessage* promotemessage) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.promotemessage_); + } + _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.GroupUpdateMessage.promoteMessage) } -inline const std::string& ConfigurationMessage_Contact::_internal_profilekey() const { - return _impl_.profilekey_.Get(); +inline ::SessionProtos::GroupUpdatePromoteMessage* GroupUpdateMessage::release_promotemessage() { + _impl_._has_bits_[0] &= ~0x00000008u; + ::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); + 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_profilekey(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000008u; - _impl_.profilekey_.Set(value, GetArenaForAllocation()); +inline ::SessionProtos::GroupUpdatePromoteMessage* GroupUpdateMessage::unsafe_arena_release_promotemessage() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateMessage.promoteMessage) + _impl_._has_bits_[0] &= ~0x00000008u; + ::SessionProtos::GroupUpdatePromoteMessage* temp = _impl_.promotemessage_; + _impl_.promotemessage_ = nullptr; + return temp; } -inline std::string* ConfigurationMessage_Contact::_internal_mutable_profilekey() { +inline ::SessionProtos::GroupUpdatePromoteMessage* GroupUpdateMessage::_internal_mutable_promotemessage() { _impl_._has_bits_[0] |= 0x00000008u; - return _impl_.profilekey_.Mutable(GetArenaForAllocation()); -} -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()); + if (_impl_.promotemessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::GroupUpdatePromoteMessage>(GetArenaForAllocation()); + _impl_.promotemessage_ = p; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; + return _impl_.promotemessage_; } -inline void ConfigurationMessage_Contact::set_allocated_profilekey(std::string* profilekey) { - if (profilekey != nullptr) { +inline ::SessionProtos::GroupUpdatePromoteMessage* GroupUpdateMessage::mutable_promotemessage() { + ::SessionProtos::GroupUpdatePromoteMessage* _msg = _internal_mutable_promotemessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateMessage.promoteMessage) + return _msg; +} +inline void GroupUpdateMessage::set_allocated_promotemessage(::SessionProtos::GroupUpdatePromoteMessage* promotemessage) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.promotemessage_; + } + if (promotemessage) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(promotemessage); + if (message_arena != 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_.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) + _impl_.promotemessage_ = promotemessage; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateMessage.promoteMessage) } -// optional bool isApproved = 5; -inline bool ConfigurationMessage_Contact::_internal_has_isapproved() const { +// 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 ConfigurationMessage_Contact::has_isapproved() const { - return _internal_has_isapproved(); +inline bool GroupUpdateMessage::has_memberleftmessage() const { + return _internal_has_memberleftmessage(); } -inline void ConfigurationMessage_Contact::clear_isapproved() { - _impl_.isapproved_ = false; +inline void GroupUpdateMessage::clear_memberleftmessage() { + if (_impl_.memberleftmessage_ != nullptr) _impl_.memberleftmessage_->Clear(); _impl_._has_bits_[0] &= ~0x00000010u; } -inline bool ConfigurationMessage_Contact::_internal_isapproved() const { - return _impl_.isapproved_; -} -inline bool ConfigurationMessage_Contact::isapproved() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.isApproved) - return _internal_isapproved(); -} -inline void ConfigurationMessage_Contact::_internal_set_isapproved(bool value) { - _impl_._has_bits_[0] |= 0x00000010u; - _impl_.isapproved_ = value; -} -inline void ConfigurationMessage_Contact::set_isapproved(bool value) { - _internal_set_isapproved(value); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.isApproved) +inline const ::SessionProtos::GroupUpdateMemberLeftMessage& GroupUpdateMessage::_internal_memberleftmessage() const { + const ::SessionProtos::GroupUpdateMemberLeftMessage* p = _impl_.memberleftmessage_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_GroupUpdateMemberLeftMessage_default_instance_); } - -// optional bool isBlocked = 6; -inline bool ConfigurationMessage_Contact::_internal_has_isblocked() const { - bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; - return value; +inline const ::SessionProtos::GroupUpdateMemberLeftMessage& GroupUpdateMessage::memberleftmessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMessage.memberLeftMessage) + return _internal_memberleftmessage(); } -inline bool ConfigurationMessage_Contact::has_isblocked() const { - return _internal_has_isblocked(); +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 ConfigurationMessage_Contact::clear_isblocked() { - _impl_.isblocked_ = false; - _impl_._has_bits_[0] &= ~0x00000020u; +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; } -inline bool ConfigurationMessage_Contact::_internal_isblocked() const { - return _impl_.isblocked_; +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 bool ConfigurationMessage_Contact::isblocked() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.isBlocked) - return _internal_isblocked(); +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 ConfigurationMessage_Contact::_internal_set_isblocked(bool value) { - _impl_._has_bits_[0] |= 0x00000020u; - _impl_.isblocked_ = value; +inline ::SessionProtos::GroupUpdateMemberLeftMessage* GroupUpdateMessage::mutable_memberleftmessage() { + ::SessionProtos::GroupUpdateMemberLeftMessage* _msg = _internal_mutable_memberleftmessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateMessage.memberLeftMessage) + return _msg; } -inline void ConfigurationMessage_Contact::set_isblocked(bool value) { - _internal_set_isblocked(value); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.isBlocked) +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) } -// optional bool didApproveMe = 7; -inline bool ConfigurationMessage_Contact::_internal_has_didapproveme() const { - bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; +// 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 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 GroupUpdateMessage::has_inviteresponse() const { + return _internal_has_inviteresponse(); } -inline bool ConfigurationMessage_Contact::didapproveme() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.Contact.didApproveMe) - return _internal_didapproveme(); +inline void GroupUpdateMessage::clear_inviteresponse() { + if (_impl_.inviteresponse_ != nullptr) _impl_.inviteresponse_->Clear(); + _impl_._has_bits_[0] &= ~0x00000020u; } -inline void ConfigurationMessage_Contact::_internal_set_didapproveme(bool value) { - _impl_._has_bits_[0] |= 0x00000040u; - _impl_.didapproveme_ = value; +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 void ConfigurationMessage_Contact::set_didapproveme(bool value) { - _internal_set_didapproveme(value); - // @@protoc_insertion_point(field_set:SessionProtos.ConfigurationMessage.Contact.didApproveMe) +inline const ::SessionProtos::GroupUpdateInviteResponseMessage& GroupUpdateMessage::inviteresponse() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMessage.inviteResponse) + return _internal_inviteresponse(); } - -// ------------------------------------------------------------------- - -// ConfigurationMessage - -// repeated .SessionProtos.ConfigurationMessage.ClosedGroup closedGroups = 1; -inline int ConfigurationMessage::_internal_closedgroups_size() const { - return _impl_.closedgroups_.size(); +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 int ConfigurationMessage::closedgroups_size() const { - return _internal_closedgroups_size(); +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 void ConfigurationMessage::clear_closedgroups() { - _impl_.closedgroups_.Clear(); +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::ConfigurationMessage_ClosedGroup* ConfigurationMessage::mutable_closedgroups(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.closedGroups) - return _impl_.closedgroups_.Mutable(index); +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 ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_ClosedGroup >* -ConfigurationMessage::mutable_closedgroups() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.ConfigurationMessage.closedGroups) - return &_impl_.closedgroups_; +inline ::SessionProtos::GroupUpdateInviteResponseMessage* GroupUpdateMessage::mutable_inviteresponse() { + ::SessionProtos::GroupUpdateInviteResponseMessage* _msg = _internal_mutable_inviteresponse(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateMessage.inviteResponse) + return _msg; } -inline const ::SessionProtos::ConfigurationMessage_ClosedGroup& ConfigurationMessage::_internal_closedgroups(int index) const { - return _impl_.closedgroups_.Get(index); +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) } -inline const ::SessionProtos::ConfigurationMessage_ClosedGroup& ConfigurationMessage::closedgroups(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.closedGroups) - return _internal_closedgroups(index); + +// 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 ::SessionProtos::ConfigurationMessage_ClosedGroup* ConfigurationMessage::_internal_add_closedgroups() { - return _impl_.closedgroups_.Add(); +inline bool GroupUpdateMessage::has_deletemembercontent() const { + return _internal_has_deletemembercontent(); } -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 GroupUpdateMessage::clear_deletemembercontent() { + if (_impl_.deletemembercontent_ != nullptr) _impl_.deletemembercontent_->Clear(); + _impl_._has_bits_[0] &= ~0x00000040u; } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_ClosedGroup >& -ConfigurationMessage::closedgroups() const { - // @@protoc_insertion_point(field_list:SessionProtos.ConfigurationMessage.closedGroups) - return _impl_.closedgroups_; +inline const ::SessionProtos::GroupUpdateDeleteMemberContentMessage& GroupUpdateMessage::_internal_deletemembercontent() const { + const ::SessionProtos::GroupUpdateDeleteMemberContentMessage* p = _impl_.deletemembercontent_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_GroupUpdateDeleteMemberContentMessage_default_instance_); } - -// repeated string openGroups = 2; -inline int ConfigurationMessage::_internal_opengroups_size() const { - return _impl_.opengroups_.size(); +inline const ::SessionProtos::GroupUpdateDeleteMemberContentMessage& GroupUpdateMessage::deletemembercontent() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMessage.deleteMemberContent) + return _internal_deletemembercontent(); } -inline int ConfigurationMessage::opengroups_size() const { - return _internal_opengroups_size(); +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 void ConfigurationMessage::clear_opengroups() { - _impl_.opengroups_.Clear(); +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 std::string* ConfigurationMessage::add_opengroups() { - std::string* _s = _internal_add_opengroups(); - // @@protoc_insertion_point(field_add_mutable:SessionProtos.ConfigurationMessage.openGroups) - return _s; +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 const std::string& ConfigurationMessage::_internal_opengroups(int index) const { - return _impl_.opengroups_.Get(index); +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 const std::string& ConfigurationMessage::opengroups(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.openGroups) - return _internal_opengroups(index); +inline ::SessionProtos::GroupUpdateDeleteMemberContentMessage* GroupUpdateMessage::mutable_deletemembercontent() { + ::SessionProtos::GroupUpdateDeleteMemberContentMessage* _msg = _internal_mutable_deletemembercontent(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateMessage.deleteMemberContent) + return _msg; } -inline std::string* ConfigurationMessage::mutable_opengroups(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.openGroups) - return _impl_.opengroups_.Mutable(index); +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) } -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) + +// 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 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 bool GroupUpdateMessage::has_memberleftnotificationmessage() const { + return _internal_has_memberleftnotificationmessage(); } -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 GroupUpdateMessage::clear_memberleftnotificationmessage() { + if (_impl_.memberleftnotificationmessage_ != nullptr) _impl_.memberleftnotificationmessage_->Clear(); + _impl_._has_bits_[0] &= ~0x00000080u; } -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 const ::SessionProtos::GroupUpdateMemberLeftNotificationMessage& GroupUpdateMessage::_internal_memberleftnotificationmessage() const { + const ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* p = _impl_.memberleftnotificationmessage_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_GroupUpdateMemberLeftNotificationMessage_default_instance_); } -inline std::string* ConfigurationMessage::_internal_add_opengroups() { - return _impl_.opengroups_.Add(); +inline const ::SessionProtos::GroupUpdateMemberLeftNotificationMessage& GroupUpdateMessage::memberleftnotificationmessage() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMessage.memberLeftNotificationMessage) + return _internal_memberleftnotificationmessage(); } -inline void ConfigurationMessage::add_opengroups(const std::string& value) { - _impl_.opengroups_.Add()->assign(value); - // @@protoc_insertion_point(field_add:SessionProtos.ConfigurationMessage.openGroups) +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 void ConfigurationMessage::add_opengroups(std::string&& value) { - _impl_.opengroups_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:SessionProtos.ConfigurationMessage.openGroups) +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 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 ::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 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 ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* GroupUpdateMessage::_internal_mutable_memberleftnotificationmessage() { + _impl_._has_bits_[0] |= 0x00000080u; + if (_impl_.memberleftnotificationmessage_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::GroupUpdateMemberLeftNotificationMessage>(GetArenaForAllocation()); + _impl_.memberleftnotificationmessage_ = p; + } + return _impl_.memberleftnotificationmessage_; } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -ConfigurationMessage::opengroups() const { - // @@protoc_insertion_point(field_list:SessionProtos.ConfigurationMessage.openGroups) - return _impl_.opengroups_; +inline ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* GroupUpdateMessage::mutable_memberleftnotificationmessage() { + ::SessionProtos::GroupUpdateMemberLeftNotificationMessage* _msg = _internal_mutable_memberleftnotificationmessage(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateMessage.memberLeftNotificationMessage) + return _msg; } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -ConfigurationMessage::mutable_opengroups() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.ConfigurationMessage.openGroups) - return &_impl_.opengroups_; +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 displayName = 3; -inline bool ConfigurationMessage::_internal_has_displayname() 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 ConfigurationMessage::has_displayname() const { - return _internal_has_displayname(); +inline bool GroupUpdateInviteMessage::has_groupsessionid() const { + return _internal_has_groupsessionid(); } -inline void ConfigurationMessage::clear_displayname() { - _impl_.displayname_.ClearToEmpty(); +inline void GroupUpdateInviteMessage::clear_groupsessionid() { + _impl_.groupsessionid_.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& GroupUpdateInviteMessage::groupsessionid() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateInviteMessage.groupSessionId) + return _internal_groupsessionid(); } template inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage::set_displayname(ArgT0&& arg0, ArgT... args) { +void GroupUpdateInviteMessage::set_groupsessionid(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_.groupsessionid_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateInviteMessage.groupSessionId) } -inline std::string* ConfigurationMessage::mutable_displayname() { - std::string* _s = _internal_mutable_displayname(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.displayName) +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& ConfigurationMessage::_internal_displayname() const { - return _impl_.displayname_.Get(); +inline const std::string& GroupUpdateInviteMessage::_internal_groupsessionid() const { + return _impl_.groupsessionid_.Get(); } -inline void ConfigurationMessage::_internal_set_displayname(const std::string& value) { +inline void GroupUpdateInviteMessage::_internal_set_groupsessionid(const std::string& value) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.displayname_.Set(value, GetArenaForAllocation()); + _impl_.groupsessionid_.Set(value, GetArenaForAllocation()); } -inline std::string* ConfigurationMessage::_internal_mutable_displayname() { +inline std::string* GroupUpdateInviteMessage::_internal_mutable_groupsessionid() { _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.displayname_.Mutable(GetArenaForAllocation()); + return _impl_.groupsessionid_.Mutable(GetArenaForAllocation()); } -inline std::string* ConfigurationMessage::release_displayname() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.displayName) - if (!_internal_has_displayname()) { +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_.displayname_.Release(); + auto* p = _impl_.groupsessionid_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.displayname_.IsDefault()) { - _impl_.displayname_.Set("", GetArenaForAllocation()); + if (_impl_.groupsessionid_.IsDefault()) { + _impl_.groupsessionid_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void ConfigurationMessage::set_allocated_displayname(std::string* displayname) { - if (displayname != 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_.displayname_.SetAllocated(displayname, GetArenaForAllocation()); + _impl_.groupsessionid_.SetAllocated(groupsessionid, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.displayname_.IsDefault()) { - _impl_.displayname_.Set("", GetArenaForAllocation()); + if (_impl_.groupsessionid_.IsDefault()) { + _impl_.groupsessionid_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.displayName) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateInviteMessage.groupSessionId) } -// optional string profilePicture = 4; -inline bool ConfigurationMessage::_internal_has_profilepicture() const { +// required string name = 2; +inline bool GroupUpdateInviteMessage::_internal_has_name() const { bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } -inline bool ConfigurationMessage::has_profilepicture() const { - return _internal_has_profilepicture(); +inline bool GroupUpdateInviteMessage::has_name() const { + return _internal_has_name(); } -inline void ConfigurationMessage::clear_profilepicture() { - _impl_.profilepicture_.ClearToEmpty(); +inline void GroupUpdateInviteMessage::clear_name() { + _impl_.name_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000002u; } -inline const std::string& ConfigurationMessage::profilepicture() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.profilePicture) - return _internal_profilepicture(); +inline const std::string& GroupUpdateInviteMessage::name() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateInviteMessage.name) + return _internal_name(); } template inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage::set_profilepicture(ArgT0&& arg0, ArgT... args) { +void GroupUpdateInviteMessage::set_name(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) + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateInviteMessage.name) } -inline std::string* ConfigurationMessage::mutable_profilepicture() { - std::string* _s = _internal_mutable_profilepicture(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.profilePicture) +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& ConfigurationMessage::_internal_profilepicture() const { - return _impl_.profilepicture_.Get(); +inline const std::string& GroupUpdateInviteMessage::_internal_name() const { + return _impl_.name_.Get(); } -inline void ConfigurationMessage::_internal_set_profilepicture(const std::string& value) { +inline void GroupUpdateInviteMessage::_internal_set_name(const std::string& value) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.profilepicture_.Set(value, GetArenaForAllocation()); + _impl_.name_.Set(value, GetArenaForAllocation()); } -inline std::string* ConfigurationMessage::_internal_mutable_profilepicture() { +inline std::string* GroupUpdateInviteMessage::_internal_mutable_name() { _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.profilepicture_.Mutable(GetArenaForAllocation()); + return _impl_.name_.Mutable(GetArenaForAllocation()); } -inline std::string* ConfigurationMessage::release_profilepicture() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.profilePicture) - if (!_internal_has_profilepicture()) { +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_.profilepicture_.Release(); + auto* p = _impl_.name_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilepicture_.IsDefault()) { - _impl_.profilepicture_.Set("", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void ConfigurationMessage::set_allocated_profilepicture(std::string* profilepicture) { - if (profilepicture != 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_.profilepicture_.SetAllocated(profilepicture, GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilepicture_.IsDefault()) { - _impl_.profilepicture_.Set("", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.profilePicture) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateInviteMessage.name) } -// optional bytes profileKey = 5; -inline bool ConfigurationMessage::_internal_has_profilekey() const { +// required bytes memberAuthData = 3; +inline bool GroupUpdateInviteMessage::_internal_has_memberauthdata() const { bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } -inline bool ConfigurationMessage::has_profilekey() const { - return _internal_has_profilekey(); +inline bool GroupUpdateInviteMessage::has_memberauthdata() const { + return _internal_has_memberauthdata(); } -inline void ConfigurationMessage::clear_profilekey() { - _impl_.profilekey_.ClearToEmpty(); +inline void GroupUpdateInviteMessage::clear_memberauthdata() { + _impl_.memberauthdata_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000004u; } -inline const std::string& ConfigurationMessage::profilekey() const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.profileKey) - return _internal_profilekey(); +inline const std::string& GroupUpdateInviteMessage::memberauthdata() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateInviteMessage.memberAuthData) + return _internal_memberauthdata(); } template inline PROTOBUF_ALWAYS_INLINE -void ConfigurationMessage::set_profilekey(ArgT0&& arg0, ArgT... args) { +void GroupUpdateInviteMessage::set_memberauthdata(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) + _impl_.memberauthdata_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateInviteMessage.memberAuthData) } -inline std::string* ConfigurationMessage::mutable_profilekey() { - std::string* _s = _internal_mutable_profilekey(); - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.profileKey) +inline std::string* GroupUpdateInviteMessage::mutable_memberauthdata() { + std::string* _s = _internal_mutable_memberauthdata(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateInviteMessage.memberAuthData) return _s; } -inline const std::string& ConfigurationMessage::_internal_profilekey() const { - return _impl_.profilekey_.Get(); +inline const std::string& GroupUpdateInviteMessage::_internal_memberauthdata() const { + return _impl_.memberauthdata_.Get(); } -inline void ConfigurationMessage::_internal_set_profilekey(const std::string& value) { +inline void GroupUpdateInviteMessage::_internal_set_memberauthdata(const std::string& value) { _impl_._has_bits_[0] |= 0x00000004u; - _impl_.profilekey_.Set(value, GetArenaForAllocation()); + _impl_.memberauthdata_.Set(value, GetArenaForAllocation()); } -inline std::string* ConfigurationMessage::_internal_mutable_profilekey() { +inline std::string* GroupUpdateInviteMessage::_internal_mutable_memberauthdata() { _impl_._has_bits_[0] |= 0x00000004u; - return _impl_.profilekey_.Mutable(GetArenaForAllocation()); + return _impl_.memberauthdata_.Mutable(GetArenaForAllocation()); } -inline std::string* ConfigurationMessage::release_profilekey() { - // @@protoc_insertion_point(field_release:SessionProtos.ConfigurationMessage.profileKey) - if (!_internal_has_profilekey()) { +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_.profilekey_.Release(); + auto* p = _impl_.memberauthdata_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilekey_.IsDefault()) { - _impl_.profilekey_.Set("", GetArenaForAllocation()); + if (_impl_.memberauthdata_.IsDefault()) { + _impl_.memberauthdata_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void ConfigurationMessage::set_allocated_profilekey(std::string* profilekey) { - if (profilekey != nullptr) { +inline void GroupUpdateInviteMessage::set_allocated_memberauthdata(std::string* memberauthdata) { + if (memberauthdata != nullptr) { _impl_._has_bits_[0] |= 0x00000004u; } else { _impl_._has_bits_[0] &= ~0x00000004u; } - _impl_.profilekey_.SetAllocated(profilekey, GetArenaForAllocation()); + _impl_.memberauthdata_.SetAllocated(memberauthdata, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.profilekey_.IsDefault()) { - _impl_.profilekey_.Set("", GetArenaForAllocation()); + if (_impl_.memberauthdata_.IsDefault()) { + _impl_.memberauthdata_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.ConfigurationMessage.profileKey) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateInviteMessage.memberAuthData) } -// repeated .SessionProtos.ConfigurationMessage.Contact contacts = 6; -inline int ConfigurationMessage::_internal_contacts_size() const { - return _impl_.contacts_.size(); +// required bytes adminSignature = 4; +inline bool GroupUpdateInviteMessage::_internal_has_adminsignature() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + return value; } -inline int ConfigurationMessage::contacts_size() const { - return _internal_contacts_size(); +inline bool GroupUpdateInviteMessage::has_adminsignature() const { + return _internal_has_adminsignature(); +} +inline void GroupUpdateInviteMessage::clear_adminsignature() { + _impl_.adminsignature_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000008u; } -inline void ConfigurationMessage::clear_contacts() { - _impl_.contacts_.Clear(); +inline const std::string& GroupUpdateInviteMessage::adminsignature() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateInviteMessage.adminSignature) + return _internal_adminsignature(); } -inline ::SessionProtos::ConfigurationMessage_Contact* ConfigurationMessage::mutable_contacts(int index) { - // @@protoc_insertion_point(field_mutable:SessionProtos.ConfigurationMessage.contacts) - return _impl_.contacts_.Mutable(index); +template +inline PROTOBUF_ALWAYS_INLINE +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 ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_Contact >* -ConfigurationMessage::mutable_contacts() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.ConfigurationMessage.contacts) - return &_impl_.contacts_; +inline std::string* GroupUpdateInviteMessage::mutable_adminsignature() { + std::string* _s = _internal_mutable_adminsignature(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateInviteMessage.adminSignature) + return _s; } -inline const ::SessionProtos::ConfigurationMessage_Contact& ConfigurationMessage::_internal_contacts(int index) const { - return _impl_.contacts_.Get(index); +inline const std::string& GroupUpdateInviteMessage::_internal_adminsignature() const { + return _impl_.adminsignature_.Get(); } -inline const ::SessionProtos::ConfigurationMessage_Contact& ConfigurationMessage::contacts(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.ConfigurationMessage.contacts) - return _internal_contacts(index); +inline void GroupUpdateInviteMessage::_internal_set_adminsignature(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.adminsignature_.Set(value, GetArenaForAllocation()); } -inline ::SessionProtos::ConfigurationMessage_Contact* ConfigurationMessage::_internal_add_contacts() { - return _impl_.contacts_.Add(); +inline std::string* GroupUpdateInviteMessage::_internal_mutable_adminsignature() { + _impl_._has_bits_[0] |= 0x00000008u; + return _impl_.adminsignature_.Mutable(GetArenaForAllocation()); } -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 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 const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::SessionProtos::ConfigurationMessage_Contact >& -ConfigurationMessage::contacts() const { - // @@protoc_insertion_point(field_list:SessionProtos.ConfigurationMessage.contacts) - return _impl_.contacts_; +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) } // ------------------------------------------------------------------- -// ReceiptMessage +// GroupUpdatePromoteMessage -// required .SessionProtos.ReceiptMessage.Type type = 1; -inline bool ReceiptMessage::_internal_has_type() const { +// required bytes groupIdentitySeed = 1; +inline bool GroupUpdatePromoteMessage::_internal_has_groupidentityseed() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool ReceiptMessage::has_type() const { - return _internal_has_type(); +inline bool GroupUpdatePromoteMessage::has_groupidentityseed() const { + return _internal_has_groupidentityseed(); } -inline void ReceiptMessage::clear_type() { - _impl_.type_ = 0; +inline void GroupUpdatePromoteMessage::clear_groupidentityseed() { + _impl_.groupidentityseed_.ClearToEmpty(); _impl_._has_bits_[0] &= ~0x00000001u; } -inline ::SessionProtos::ReceiptMessage_Type ReceiptMessage::_internal_type() const { - return static_cast< ::SessionProtos::ReceiptMessage_Type >(_impl_.type_); +inline const std::string& GroupUpdatePromoteMessage::groupidentityseed() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdatePromoteMessage.groupIdentitySeed) + return _internal_groupidentityseed(); } -inline ::SessionProtos::ReceiptMessage_Type ReceiptMessage::type() const { - // @@protoc_insertion_point(field_get:SessionProtos.ReceiptMessage.type) - return _internal_type(); +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 void ReceiptMessage::_internal_set_type(::SessionProtos::ReceiptMessage_Type value) { - assert(::SessionProtos::ReceiptMessage_Type_IsValid(value)); +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_.type_ = value; + _impl_.groupidentityseed_.Set(value, GetArenaForAllocation()); } -inline void ReceiptMessage::set_type(::SessionProtos::ReceiptMessage_Type value) { - _internal_set_type(value); - // @@protoc_insertion_point(field_set:SessionProtos.ReceiptMessage.type) +inline std::string* GroupUpdatePromoteMessage::_internal_mutable_groupidentityseed() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.groupidentityseed_.Mutable(GetArenaForAllocation()); } - -// repeated uint64 timestamp = 2; -inline int ReceiptMessage::_internal_timestamp_size() const { - return _impl_.timestamp_.size(); +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 int ReceiptMessage::timestamp_size() const { - return _internal_timestamp_size(); +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) } -inline void ReceiptMessage::clear_timestamp() { - _impl_.timestamp_.Clear(); + +// required string name = 2; +inline bool GroupUpdatePromoteMessage::_internal_has_name() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; } -inline uint64_t ReceiptMessage::_internal_timestamp(int index) const { - return _impl_.timestamp_.Get(index); +inline bool GroupUpdatePromoteMessage::has_name() const { + return _internal_has_name(); } -inline uint64_t ReceiptMessage::timestamp(int index) const { - // @@protoc_insertion_point(field_get:SessionProtos.ReceiptMessage.timestamp) - return _internal_timestamp(index); +inline void GroupUpdatePromoteMessage::clear_name() { + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; } -inline void ReceiptMessage::set_timestamp(int index, uint64_t value) { - _impl_.timestamp_.Set(index, value); - // @@protoc_insertion_point(field_set:SessionProtos.ReceiptMessage.timestamp) +inline const std::string& GroupUpdatePromoteMessage::name() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdatePromoteMessage.name) + return _internal_name(); } -inline void ReceiptMessage::_internal_add_timestamp(uint64_t value) { - _impl_.timestamp_.Add(value); +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 void ReceiptMessage::add_timestamp(uint64_t value) { - _internal_add_timestamp(value); - // @@protoc_insertion_point(field_add:SessionProtos.ReceiptMessage.timestamp) +inline std::string* GroupUpdatePromoteMessage::mutable_name() { + std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdatePromoteMessage.name) + return _s; } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& -ReceiptMessage::_internal_timestamp() const { - return _impl_.timestamp_; +inline const std::string& GroupUpdatePromoteMessage::_internal_name() const { + return _impl_.name_.Get(); } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& -ReceiptMessage::timestamp() const { - // @@protoc_insertion_point(field_list:SessionProtos.ReceiptMessage.timestamp) - return _internal_timestamp(); +inline void GroupUpdatePromoteMessage::_internal_set_name(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.name_.Set(value, GetArenaForAllocation()); } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* -ReceiptMessage::_internal_mutable_timestamp() { - return &_impl_.timestamp_; +inline std::string* GroupUpdatePromoteMessage::_internal_mutable_name() { + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.name_.Mutable(GetArenaForAllocation()); +} +inline std::string* GroupUpdatePromoteMessage::release_name() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdatePromoteMessage.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 ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* -ReceiptMessage::mutable_timestamp() { - // @@protoc_insertion_point(field_mutable_list:SessionProtos.ReceiptMessage.timestamp) - return _internal_mutable_timestamp(); +inline void GroupUpdatePromoteMessage::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.GroupUpdatePromoteMessage.name) } // ------------------------------------------------------------------- -// AttachmentPointer +// GroupUpdateInfoChangeMessage -// required fixed64 id = 1; -inline bool AttachmentPointer::_internal_has_id() const { - bool value = (_impl_._has_bits_[0] & 0x00000080u) != 0; +// 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_id() const { - return _internal_has_id(); +inline bool GroupUpdateInfoChangeMessage::has_type() const { + return _internal_has_type(); } -inline void AttachmentPointer::clear_id() { - _impl_.id_ = uint64_t{0u}; - _impl_._has_bits_[0] &= ~0x00000080u; +inline void GroupUpdateInfoChangeMessage::clear_type() { + _impl_.type_ = 1; + _impl_._has_bits_[0] &= ~0x00000008u; } -inline uint64_t AttachmentPointer::_internal_id() const { - return _impl_.id_; +inline ::SessionProtos::GroupUpdateInfoChangeMessage_Type GroupUpdateInfoChangeMessage::_internal_type() const { + return static_cast< ::SessionProtos::GroupUpdateInfoChangeMessage_Type >(_impl_.type_); } -inline uint64_t AttachmentPointer::id() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.id) - return _internal_id(); +inline ::SessionProtos::GroupUpdateInfoChangeMessage_Type GroupUpdateInfoChangeMessage::type() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateInfoChangeMessage.type) + return _internal_type(); } -inline void AttachmentPointer::_internal_set_id(uint64_t value) { - _impl_._has_bits_[0] |= 0x00000080u; - _impl_.id_ = value; +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 AttachmentPointer::set_id(uint64_t value) { - _internal_set_id(value); - // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.id) +inline void GroupUpdateInfoChangeMessage::set_type(::SessionProtos::GroupUpdateInfoChangeMessage_Type value) { + _internal_set_type(value); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateInfoChangeMessage.type) } -// optional string contentType = 2; -inline bool AttachmentPointer::_internal_has_contenttype() const { +// optional string updatedName = 2; +inline bool GroupUpdateInfoChangeMessage::_internal_has_updatedname() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool AttachmentPointer::has_contenttype() const { - return _internal_has_contenttype(); +inline bool GroupUpdateInfoChangeMessage::has_updatedname() const { + return _internal_has_updatedname(); } -inline void AttachmentPointer::clear_contenttype() { - _impl_.contenttype_.ClearToEmpty(); +inline void GroupUpdateInfoChangeMessage::clear_updatedname() { + _impl_.updatedname_.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& GroupUpdateInfoChangeMessage::updatedname() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateInfoChangeMessage.updatedName) + return _internal_updatedname(); } template inline PROTOBUF_ALWAYS_INLINE -void AttachmentPointer::set_contenttype(ArgT0&& arg0, ArgT... args) { +void GroupUpdateInfoChangeMessage::set_updatedname(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_.updatedname_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateInfoChangeMessage.updatedName) } -inline std::string* AttachmentPointer::mutable_contenttype() { - std::string* _s = _internal_mutable_contenttype(); - // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.contentType) +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_contenttype() const { - return _impl_.contenttype_.Get(); +inline const std::string& GroupUpdateInfoChangeMessage::_internal_updatedname() const { + return _impl_.updatedname_.Get(); } -inline void AttachmentPointer::_internal_set_contenttype(const std::string& value) { +inline void GroupUpdateInfoChangeMessage::_internal_set_updatedname(const std::string& value) { _impl_._has_bits_[0] |= 0x00000001u; - _impl_.contenttype_.Set(value, GetArenaForAllocation()); + _impl_.updatedname_.Set(value, GetArenaForAllocation()); } -inline std::string* AttachmentPointer::_internal_mutable_contenttype() { +inline std::string* GroupUpdateInfoChangeMessage::_internal_mutable_updatedname() { _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.contenttype_.Mutable(GetArenaForAllocation()); + return _impl_.updatedname_.Mutable(GetArenaForAllocation()); } -inline std::string* AttachmentPointer::release_contenttype() { - // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.contentType) - if (!_internal_has_contenttype()) { +inline std::string* GroupUpdateInfoChangeMessage::release_updatedname() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateInfoChangeMessage.updatedName) + if (!_internal_has_updatedname()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000001u; - auto* p = _impl_.contenttype_.Release(); + auto* p = _impl_.updatedname_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.contenttype_.IsDefault()) { - _impl_.contenttype_.Set("", GetArenaForAllocation()); + if (_impl_.updatedname_.IsDefault()) { + _impl_.updatedname_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void AttachmentPointer::set_allocated_contenttype(std::string* contenttype) { - if (contenttype != nullptr) { +inline void GroupUpdateInfoChangeMessage::set_allocated_updatedname(std::string* updatedname) { + if (updatedname != nullptr) { _impl_._has_bits_[0] |= 0x00000001u; } else { _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.contenttype_.SetAllocated(contenttype, GetArenaForAllocation()); + _impl_.updatedname_.SetAllocated(updatedname, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.contenttype_.IsDefault()) { - _impl_.contenttype_.Set("", GetArenaForAllocation()); + if (_impl_.updatedname_.IsDefault()) { + _impl_.updatedname_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.contentType) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateInfoChangeMessage.updatedName) } -// optional bytes key = 3; -inline bool AttachmentPointer::_internal_has_key() const { +// optional uint32 updatedExpiration = 3; +inline bool GroupUpdateInfoChangeMessage::_internal_has_updatedexpiration() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; +} +inline bool GroupUpdateInfoChangeMessage::has_updatedexpiration() const { + return _internal_has_updatedexpiration(); +} +inline void GroupUpdateInfoChangeMessage::clear_updatedexpiration() { + _impl_.updatedexpiration_ = 0u; + _impl_._has_bits_[0] &= ~0x00000004u; +} +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 AttachmentPointer::has_key() const { - return _internal_has_key(); +inline bool GroupUpdateInfoChangeMessage::has_adminsignature() const { + return _internal_has_adminsignature(); } -inline void AttachmentPointer::clear_key() { - _impl_.key_.ClearToEmpty(); +inline void GroupUpdateInfoChangeMessage::clear_adminsignature() { + _impl_.adminsignature_.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& GroupUpdateInfoChangeMessage::adminsignature() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateInfoChangeMessage.adminSignature) + return _internal_adminsignature(); } template inline PROTOBUF_ALWAYS_INLINE -void AttachmentPointer::set_key(ArgT0&& arg0, ArgT... args) { +void GroupUpdateInfoChangeMessage::set_adminsignature(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_.adminsignature_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateInfoChangeMessage.adminSignature) } -inline std::string* AttachmentPointer::mutable_key() { - std::string* _s = _internal_mutable_key(); - // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.key) +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_key() const { - return _impl_.key_.Get(); +inline const std::string& GroupUpdateInfoChangeMessage::_internal_adminsignature() const { + return _impl_.adminsignature_.Get(); } -inline void AttachmentPointer::_internal_set_key(const std::string& value) { +inline void GroupUpdateInfoChangeMessage::_internal_set_adminsignature(const std::string& value) { _impl_._has_bits_[0] |= 0x00000002u; - _impl_.key_.Set(value, GetArenaForAllocation()); + _impl_.adminsignature_.Set(value, GetArenaForAllocation()); } -inline std::string* AttachmentPointer::_internal_mutable_key() { +inline std::string* GroupUpdateInfoChangeMessage::_internal_mutable_adminsignature() { _impl_._has_bits_[0] |= 0x00000002u; - return _impl_.key_.Mutable(GetArenaForAllocation()); + return _impl_.adminsignature_.Mutable(GetArenaForAllocation()); } -inline std::string* AttachmentPointer::release_key() { - // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.key) - if (!_internal_has_key()) { +inline std::string* GroupUpdateInfoChangeMessage::release_adminsignature() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateInfoChangeMessage.adminSignature) + if (!_internal_has_adminsignature()) { return nullptr; } _impl_._has_bits_[0] &= ~0x00000002u; - auto* p = _impl_.key_.Release(); + auto* p = _impl_.adminsignature_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.key_.IsDefault()) { - _impl_.key_.Set("", GetArenaForAllocation()); + if (_impl_.adminsignature_.IsDefault()) { + _impl_.adminsignature_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void AttachmentPointer::set_allocated_key(std::string* key) { - if (key != nullptr) { +inline void GroupUpdateInfoChangeMessage::set_allocated_adminsignature(std::string* adminsignature) { + if (adminsignature != nullptr) { _impl_._has_bits_[0] |= 0x00000002u; } else { _impl_._has_bits_[0] &= ~0x00000002u; } - _impl_.key_.SetAllocated(key, GetArenaForAllocation()); + _impl_.adminsignature_.SetAllocated(adminsignature, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.key_.IsDefault()) { - _impl_.key_.Set("", GetArenaForAllocation()); + if (_impl_.adminsignature_.IsDefault()) { + _impl_.adminsignature_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.key) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateInfoChangeMessage.adminSignature) } -// optional uint32 size = 4; -inline bool AttachmentPointer::_internal_has_size() const { - bool value = (_impl_._has_bits_[0] & 0x00000100u) != 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_size() const { - return _internal_has_size(); +inline bool GroupUpdateMemberChangeMessage::has_type() const { + return _internal_has_type(); } -inline void AttachmentPointer::clear_size() { - _impl_.size_ = 0u; - _impl_._has_bits_[0] &= ~0x00000100u; +inline void GroupUpdateMemberChangeMessage::clear_type() { + _impl_.type_ = 1; + _impl_._has_bits_[0] &= ~0x00000004u; } -inline uint32_t AttachmentPointer::_internal_size() const { - return _impl_.size_; +inline ::SessionProtos::GroupUpdateMemberChangeMessage_Type GroupUpdateMemberChangeMessage::_internal_type() const { + return static_cast< ::SessionProtos::GroupUpdateMemberChangeMessage_Type >(_impl_.type_); } -inline uint32_t AttachmentPointer::size() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.size) - return _internal_size(); +inline ::SessionProtos::GroupUpdateMemberChangeMessage_Type GroupUpdateMemberChangeMessage::type() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMemberChangeMessage.type) + return _internal_type(); } -inline void AttachmentPointer::_internal_set_size(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000100u; - _impl_.size_ = 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_size(uint32_t value) { - _internal_set_size(value); - // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.size) +inline void GroupUpdateMemberChangeMessage::set_type(::SessionProtos::GroupUpdateMemberChangeMessage_Type value) { + _internal_set_type(value); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateMemberChangeMessage.type) } -// optional bytes thumbnail = 5; -inline bool AttachmentPointer::_internal_has_thumbnail() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; - return value; +// repeated string memberSessionIds = 2; +inline int GroupUpdateMemberChangeMessage::_internal_membersessionids_size() const { + return _impl_.membersessionids_.size(); } -inline bool AttachmentPointer::has_thumbnail() const { - return _internal_has_thumbnail(); +inline int GroupUpdateMemberChangeMessage::membersessionids_size() const { + return _internal_membersessionids_size(); } -inline void AttachmentPointer::clear_thumbnail() { - _impl_.thumbnail_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000004u; +inline void GroupUpdateMemberChangeMessage::clear_membersessionids() { + _impl_.membersessionids_.Clear(); } -inline const std::string& AttachmentPointer::thumbnail() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.thumbnail) - return _internal_thumbnail(); +inline std::string* GroupUpdateMemberChangeMessage::add_membersessionids() { + std::string* _s = _internal_add_membersessionids(); + // @@protoc_insertion_point(field_add_mutable:SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds) + return _s; } -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) +inline const std::string& GroupUpdateMemberChangeMessage::_internal_membersessionids(int index) const { + return _impl_.membersessionids_.Get(index); } -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& GroupUpdateMemberChangeMessage::membersessionids(int index) const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds) + return _internal_membersessionids(index); } -inline const std::string& AttachmentPointer::_internal_thumbnail() const { - return _impl_.thumbnail_.Get(); +inline std::string* GroupUpdateMemberChangeMessage::mutable_membersessionids(int index) { + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateMemberChangeMessage.memberSessionIds) + return _impl_.membersessionids_.Mutable(index); } -inline void AttachmentPointer::_internal_set_thumbnail(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000004u; - _impl_.thumbnail_.Set(value, GetArenaForAllocation()); +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 std::string* AttachmentPointer::_internal_mutable_thumbnail() { - _impl_._has_bits_[0] |= 0x00000004u; - return _impl_.thumbnail_.Mutable(GetArenaForAllocation()); +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 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_.thumbnail_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.thumbnail_.IsDefault()) { - _impl_.thumbnail_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; +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 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) +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 bytes digest = 6; -inline bool AttachmentPointer::_internal_has_digest() const { - bool value = (_impl_._has_bits_[0] & 0x00000008u) != 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_digest() const { - return _internal_has_digest(); +inline bool GroupUpdateMemberChangeMessage::has_historyshared() const { + return _internal_has_historyshared(); } -inline void AttachmentPointer::clear_digest() { - _impl_.digest_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000008u; +inline void GroupUpdateMemberChangeMessage::clear_historyshared() { + _impl_.historyshared_ = false; + _impl_._has_bits_[0] &= ~0x00000002u; } -inline const std::string& AttachmentPointer::digest() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.digest) - return _internal_digest(); +inline bool GroupUpdateMemberChangeMessage::_internal_historyshared() const { + return _impl_.historyshared_; } -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 bool GroupUpdateMemberChangeMessage::historyshared() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMemberChangeMessage.historyShared) + return _internal_historyshared(); +} +inline void GroupUpdateMemberChangeMessage::_internal_set_historyshared(bool value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.historyshared_ = value; +} +inline void GroupUpdateMemberChangeMessage::set_historyshared(bool value) { + _internal_set_historyshared(value); + // @@protoc_insertion_point(field_set:SessionProtos.GroupUpdateMemberChangeMessage.historyShared) +} + +// required bytes adminSignature = 4; +inline bool GroupUpdateMemberChangeMessage::_internal_has_adminsignature() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool GroupUpdateMemberChangeMessage::has_adminsignature() const { + return _internal_has_adminsignature(); +} +inline void GroupUpdateMemberChangeMessage::clear_adminsignature() { + _impl_.adminsignature_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& GroupUpdateMemberChangeMessage::adminsignature() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateMemberChangeMessage.adminSignature) + return _internal_adminsignature(); } -inline std::string* AttachmentPointer::mutable_digest() { - std::string* _s = _internal_mutable_digest(); - // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.digest) +template +inline PROTOBUF_ALWAYS_INLINE +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* 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_digest() const { - return _impl_.digest_.Get(); +inline const std::string& GroupUpdateMemberChangeMessage::_internal_adminsignature() const { + return _impl_.adminsignature_.Get(); } -inline void AttachmentPointer::_internal_set_digest(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000008u; - _impl_.digest_.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_digest() { - _impl_._has_bits_[0] |= 0x00000008u; - return _impl_.digest_.Mutable(GetArenaForAllocation()); +inline std::string* GroupUpdateMemberChangeMessage::_internal_mutable_adminsignature() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.adminsignature_.Mutable(GetArenaForAllocation()); } -inline std::string* AttachmentPointer::release_digest() { - // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.digest) - if (!_internal_has_digest()) { +inline std::string* GroupUpdateMemberChangeMessage::release_adminsignature() { + // @@protoc_insertion_point(field_release:SessionProtos.GroupUpdateMemberChangeMessage.adminSignature) + if (!_internal_has_adminsignature()) { return nullptr; } - _impl_._has_bits_[0] &= ~0x00000008u; - auto* p = _impl_.digest_.Release(); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.adminsignature_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.digest_.IsDefault()) { - _impl_.digest_.Set("", GetArenaForAllocation()); + if (_impl_.adminsignature_.IsDefault()) { + _impl_.adminsignature_.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 GroupUpdateMemberChangeMessage::set_allocated_adminsignature(std::string* adminsignature) { + if (adminsignature != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; } else { - _impl_._has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.digest_.SetAllocated(digest, GetArenaForAllocation()); + _impl_.adminsignature_.SetAllocated(adminsignature, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.digest_.IsDefault()) { - _impl_.digest_.Set("", GetArenaForAllocation()); + if (_impl_.adminsignature_.IsDefault()) { + _impl_.adminsignature_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.digest) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.GroupUpdateMemberChangeMessage.adminSignature) } -// optional string fileName = 7; -inline bool AttachmentPointer::_internal_has_filename() const { - bool value = (_impl_._has_bits_[0] & 0x00000010u) != 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_filename() const { - return _internal_has_filename(); +inline bool GroupUpdateInviteResponseMessage::has_isapproved() const { + return _internal_has_isapproved(); } -inline void AttachmentPointer::clear_filename() { - _impl_.filename_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000010u; +inline void GroupUpdateInviteResponseMessage::clear_isapproved() { + _impl_.isapproved_ = false; + _impl_._has_bits_[0] &= ~0x00000001u; } -inline const std::string& AttachmentPointer::filename() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.fileName) - return _internal_filename(); +inline bool GroupUpdateInviteResponseMessage::_internal_isapproved() const { + return _impl_.isapproved_; } -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) +inline bool GroupUpdateInviteResponseMessage::isapproved() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateInviteResponseMessage.isApproved) + return _internal_isapproved(); } -inline std::string* AttachmentPointer::mutable_filename() { - std::string* _s = _internal_mutable_filename(); - // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.fileName) +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_filename() const { - return _impl_.filename_.Get(); +inline const std::string& GroupUpdateDeleteMemberContentMessage::_internal_membersessionids(int index) const { + return _impl_.membersessionids_.Get(index); } -inline void AttachmentPointer::_internal_set_filename(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000010u; - _impl_.filename_.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_filename() { - _impl_._has_bits_[0] |= 0x00000010u; - return _impl_.filename_.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_filename() { - // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.fileName) - if (!_internal_has_filename()) { - return nullptr; - } - _impl_._has_bits_[0] &= ~0x00000010u; - auto* p = _impl_.filename_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.filename_.IsDefault()) { - _impl_.filename_.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_filename(std::string* filename) { - if (filename != nullptr) { - _impl_._has_bits_[0] |= 0x00000010u; - } else { - _impl_._has_bits_[0] &= ~0x00000010u; - } - _impl_.filename_.SetAllocated(filename, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.filename_.IsDefault()) { - _impl_.filename_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.fileName) +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) +} +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 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 std::string* GroupUpdateDeleteMemberContentMessage::_internal_add_membersessionids() { + return _impl_.membersessionids_.Add(); +} +inline void GroupUpdateDeleteMemberContentMessage::add_membersessionids(const std::string& value) { + _impl_.membersessionids_.Add()->assign(value); + // @@protoc_insertion_point(field_add:SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds) +} +inline void GroupUpdateDeleteMemberContentMessage::add_membersessionids(std::string&& value) { + _impl_.membersessionids_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:SessionProtos.GroupUpdateDeleteMemberContentMessage.memberSessionIds) +} +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 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_; } -// optional uint32 flags = 8; -inline bool AttachmentPointer::_internal_has_flags() const { - bool value = (_impl_._has_bits_[0] & 0x00000200u) != 0; - return value; +// repeated string messageHashes = 2; +inline int GroupUpdateDeleteMemberContentMessage::_internal_messagehashes_size() const { + return _impl_.messagehashes_.size(); } -inline bool AttachmentPointer::has_flags() const { - return _internal_has_flags(); +inline int GroupUpdateDeleteMemberContentMessage::messagehashes_size() const { + return _internal_messagehashes_size(); } -inline void AttachmentPointer::clear_flags() { - _impl_.flags_ = 0u; - _impl_._has_bits_[0] &= ~0x00000200u; +inline void GroupUpdateDeleteMemberContentMessage::clear_messagehashes() { + _impl_.messagehashes_.Clear(); } -inline uint32_t AttachmentPointer::_internal_flags() const { - return _impl_.flags_; +inline std::string* GroupUpdateDeleteMemberContentMessage::add_messagehashes() { + std::string* _s = _internal_add_messagehashes(); + // @@protoc_insertion_point(field_add_mutable:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) + return _s; } -inline uint32_t AttachmentPointer::flags() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.flags) - return _internal_flags(); +inline const std::string& GroupUpdateDeleteMemberContentMessage::_internal_messagehashes(int index) const { + return _impl_.messagehashes_.Get(index); } -inline void AttachmentPointer::_internal_set_flags(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000200u; - _impl_.flags_ = value; +inline const std::string& GroupUpdateDeleteMemberContentMessage::messagehashes(int index) const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateDeleteMemberContentMessage.messageHashes) + return _internal_messagehashes(index); } -inline void AttachmentPointer::set_flags(uint32_t value) { - _internal_set_flags(value); - // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.flags) +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 uint32 width = 9; -inline bool AttachmentPointer::_internal_has_width() const { - bool value = (_impl_._has_bits_[0] & 0x00000400u) != 0; +// optional bytes adminSignature = 3; +inline bool GroupUpdateDeleteMemberContentMessage::_internal_has_adminsignature() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool AttachmentPointer::has_width() const { - return _internal_has_width(); +inline bool GroupUpdateDeleteMemberContentMessage::has_adminsignature() const { + return _internal_has_adminsignature(); } -inline void AttachmentPointer::clear_width() { - _impl_.width_ = 0u; - _impl_._has_bits_[0] &= ~0x00000400u; +inline void GroupUpdateDeleteMemberContentMessage::clear_adminsignature() { + _impl_.adminsignature_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } -inline uint32_t AttachmentPointer::_internal_width() const { - return _impl_.width_; +inline const std::string& GroupUpdateDeleteMemberContentMessage::adminsignature() const { + // @@protoc_insertion_point(field_get:SessionProtos.GroupUpdateDeleteMemberContentMessage.adminSignature) + return _internal_adminsignature(); } -inline uint32_t AttachmentPointer::width() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.width) - return _internal_width(); +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 void AttachmentPointer::_internal_set_width(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000400u; - _impl_.width_ = value; +inline std::string* GroupUpdateDeleteMemberContentMessage::mutable_adminsignature() { + std::string* _s = _internal_mutable_adminsignature(); + // @@protoc_insertion_point(field_mutable:SessionProtos.GroupUpdateDeleteMemberContentMessage.adminSignature) + return _s; } -inline void AttachmentPointer::set_width(uint32_t value) { - _internal_set_width(value); - // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.width) +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) } -// optional uint32 height = 10; -inline bool AttachmentPointer::_internal_has_height() const { - bool value = (_impl_._has_bits_[0] & 0x00000800u) != 0; +// ------------------------------------------------------------------- + +// ProProof + +// optional uint32 version = 1; +inline bool ProProof::_internal_has_version() const { + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; return value; } -inline bool AttachmentPointer::has_height() const { - return _internal_has_height(); +inline bool ProProof::has_version() const { + return _internal_has_version(); } -inline void AttachmentPointer::clear_height() { - _impl_.height_ = 0u; - _impl_._has_bits_[0] &= ~0x00000800u; +inline void ProProof::clear_version() { + _impl_.version_ = 0u; + _impl_._has_bits_[0] &= ~0x00000010u; } -inline uint32_t AttachmentPointer::_internal_height() const { - return _impl_.height_; +inline uint32_t ProProof::_internal_version() const { + return _impl_.version_; } -inline uint32_t AttachmentPointer::height() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.height) - return _internal_height(); +inline uint32_t ProProof::version() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProProof.version) + return _internal_version(); } -inline void AttachmentPointer::_internal_set_height(uint32_t value) { - _impl_._has_bits_[0] |= 0x00000800u; - _impl_.height_ = value; +inline void ProProof::_internal_set_version(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.version_ = value; } -inline void AttachmentPointer::set_height(uint32_t value) { - _internal_set_height(value); - // @@protoc_insertion_point(field_set:SessionProtos.AttachmentPointer.height) +inline void ProProof::set_version(uint32_t value) { + _internal_set_version(value); + // @@protoc_insertion_point(field_set:SessionProtos.ProProof.version) } -// optional string caption = 11; -inline bool AttachmentPointer::_internal_has_caption() const { - bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; +// optional bytes genIndexHash = 2; +inline bool ProProof::_internal_has_genindexhash() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } -inline bool AttachmentPointer::has_caption() const { - return _internal_has_caption(); +inline bool ProProof::has_genindexhash() const { + return _internal_has_genindexhash(); } -inline void AttachmentPointer::clear_caption() { - _impl_.caption_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000020u; +inline void ProProof::clear_genindexhash() { + _impl_.genindexhash_.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& ProProof::genindexhash() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProProof.genIndexHash) + return _internal_genindexhash(); } 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 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* AttachmentPointer::mutable_caption() { - std::string* _s = _internal_mutable_caption(); - // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.caption) +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& AttachmentPointer::_internal_caption() const { - return _impl_.caption_.Get(); +inline const std::string& ProProof::_internal_genindexhash() const { + return _impl_.genindexhash_.Get(); } -inline void AttachmentPointer::_internal_set_caption(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000020u; - _impl_.caption_.Set(value, GetArenaForAllocation()); +inline void ProProof::_internal_set_genindexhash(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.genindexhash_.Set(value, GetArenaForAllocation()); } -inline std::string* AttachmentPointer::_internal_mutable_caption() { - _impl_._has_bits_[0] |= 0x00000020u; - return _impl_.caption_.Mutable(GetArenaForAllocation()); +inline std::string* ProProof::_internal_mutable_genindexhash() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.genindexhash_.Mutable(GetArenaForAllocation()); } -inline std::string* AttachmentPointer::release_caption() { - // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.caption) - if (!_internal_has_caption()) { +inline std::string* ProProof::release_genindexhash() { + // @@protoc_insertion_point(field_release:SessionProtos.ProProof.genIndexHash) + if (!_internal_has_genindexhash()) { return nullptr; } - _impl_._has_bits_[0] &= ~0x00000020u; - auto* p = _impl_.caption_.Release(); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.genindexhash_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.caption_.IsDefault()) { - _impl_.caption_.Set("", GetArenaForAllocation()); + if (_impl_.genindexhash_.IsDefault()) { + _impl_.genindexhash_.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 ProProof::set_allocated_genindexhash(std::string* genindexhash) { + if (genindexhash != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; } else { - _impl_._has_bits_[0] &= ~0x00000020u; + _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.caption_.SetAllocated(caption, GetArenaForAllocation()); + _impl_.genindexhash_.SetAllocated(genindexhash, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.caption_.IsDefault()) { - _impl_.caption_.Set("", GetArenaForAllocation()); + if (_impl_.genindexhash_.IsDefault()) { + _impl_.genindexhash_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.caption) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProProof.genIndexHash) } -// optional string url = 101; -inline bool AttachmentPointer::_internal_has_url() const { - bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; +// optional bytes rotatingPublicKey = 3; +inline bool ProProof::_internal_has_rotatingpublickey() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } -inline bool AttachmentPointer::has_url() const { - return _internal_has_url(); +inline bool ProProof::has_rotatingpublickey() const { + return _internal_has_rotatingpublickey(); } -inline void AttachmentPointer::clear_url() { - _impl_.url_.ClearToEmpty(); - _impl_._has_bits_[0] &= ~0x00000040u; +inline void ProProof::clear_rotatingpublickey() { + _impl_.rotatingpublickey_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; } -inline const std::string& AttachmentPointer::url() const { - // @@protoc_insertion_point(field_get:SessionProtos.AttachmentPointer.url) - return _internal_url(); +inline const std::string& ProProof::rotatingpublickey() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProProof.rotatingPublicKey) + return _internal_rotatingpublickey(); } 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) +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* AttachmentPointer::mutable_url() { - std::string* _s = _internal_mutable_url(); - // @@protoc_insertion_point(field_mutable:SessionProtos.AttachmentPointer.url) +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& AttachmentPointer::_internal_url() const { - return _impl_.url_.Get(); +inline const std::string& ProProof::_internal_rotatingpublickey() const { + return _impl_.rotatingpublickey_.Get(); } -inline void AttachmentPointer::_internal_set_url(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000040u; - _impl_.url_.Set(value, GetArenaForAllocation()); +inline void ProProof::_internal_set_rotatingpublickey(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.rotatingpublickey_.Set(value, GetArenaForAllocation()); } -inline std::string* AttachmentPointer::_internal_mutable_url() { - _impl_._has_bits_[0] |= 0x00000040u; - return _impl_.url_.Mutable(GetArenaForAllocation()); +inline std::string* ProProof::_internal_mutable_rotatingpublickey() { + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.rotatingpublickey_.Mutable(GetArenaForAllocation()); } -inline std::string* AttachmentPointer::release_url() { - // @@protoc_insertion_point(field_release:SessionProtos.AttachmentPointer.url) - if (!_internal_has_url()) { +inline std::string* ProProof::release_rotatingpublickey() { + // @@protoc_insertion_point(field_release:SessionProtos.ProProof.rotatingPublicKey) + if (!_internal_has_rotatingpublickey()) { return nullptr; } - _impl_._has_bits_[0] &= ~0x00000040u; - auto* p = _impl_.url_.Release(); + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.rotatingpublickey_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.url_.IsDefault()) { - _impl_.url_.Set("", GetArenaForAllocation()); + if (_impl_.rotatingpublickey_.IsDefault()) { + _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } -inline void AttachmentPointer::set_allocated_url(std::string* url) { - if (url != nullptr) { - _impl_._has_bits_[0] |= 0x00000040u; +inline void ProProof::set_allocated_rotatingpublickey(std::string* rotatingpublickey) { + if (rotatingpublickey != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; } else { - _impl_._has_bits_[0] &= ~0x00000040u; + _impl_._has_bits_[0] &= ~0x00000002u; } - _impl_.url_.SetAllocated(url, GetArenaForAllocation()); + _impl_.rotatingpublickey_.SetAllocated(rotatingpublickey, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.url_.IsDefault()) { - _impl_.url_.Set("", GetArenaForAllocation()); + if (_impl_.rotatingpublickey_.IsDefault()) { + _impl_.rotatingpublickey_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.AttachmentPointer.url) + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProProof.rotatingPublicKey) } -// ------------------------------------------------------------------- - -// SharedConfigMessage - -// required .SessionProtos.SharedConfigMessage.Kind kind = 1; -inline bool SharedConfigMessage::_internal_has_kind() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; +// optional uint64 expiryUnixTs = 4; +inline bool ProProof::_internal_has_expiryunixts() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; return value; } -inline bool SharedConfigMessage::has_kind() const { - return _internal_has_kind(); +inline bool ProProof::has_expiryunixts() const { + return _internal_has_expiryunixts(); } -inline void SharedConfigMessage::clear_kind() { - _impl_.kind_ = 1; - _impl_._has_bits_[0] &= ~0x00000004u; +inline void ProProof::clear_expiryunixts() { + _impl_.expiryunixts_ = uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000008u; } -inline ::SessionProtos::SharedConfigMessage_Kind SharedConfigMessage::_internal_kind() const { - return static_cast< ::SessionProtos::SharedConfigMessage_Kind >(_impl_.kind_); +inline uint64_t ProProof::_internal_expiryunixts() const { + return _impl_.expiryunixts_; } -inline ::SessionProtos::SharedConfigMessage_Kind SharedConfigMessage::kind() const { - // @@protoc_insertion_point(field_get:SessionProtos.SharedConfigMessage.kind) - return _internal_kind(); +inline uint64_t ProProof::expiryunixts() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProProof.expiryUnixTs) + return _internal_expiryunixts(); } -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 ProProof::_internal_set_expiryunixts(uint64_t value) { + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.expiryunixts_ = value; } -inline void SharedConfigMessage::set_kind(::SessionProtos::SharedConfigMessage_Kind value) { - _internal_set_kind(value); - // @@protoc_insertion_point(field_set:SessionProtos.SharedConfigMessage.kind) +inline void ProProof::set_expiryunixts(uint64_t value) { + _internal_set_expiryunixts(value); + // @@protoc_insertion_point(field_set:SessionProtos.ProProof.expiryUnixTs) } -// required int64 seqno = 2; -inline bool SharedConfigMessage::_internal_has_seqno() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; +// optional bytes sig = 5; +inline bool ProProof::_internal_has_sig() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } -inline bool SharedConfigMessage::has_seqno() const { - return _internal_has_seqno(); +inline bool ProProof::has_sig() const { + return _internal_has_sig(); } -inline void SharedConfigMessage::clear_seqno() { - _impl_.seqno_ = int64_t{0}; - _impl_._has_bits_[0] &= ~0x00000002u; +inline void ProProof::clear_sig() { + _impl_.sig_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000004u; } -inline int64_t SharedConfigMessage::_internal_seqno() const { - return _impl_.seqno_; +inline const std::string& ProProof::sig() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProProof.sig) + return _internal_sig(); } -inline int64_t SharedConfigMessage::seqno() const { - // @@protoc_insertion_point(field_get:SessionProtos.SharedConfigMessage.seqno) - return _internal_seqno(); +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 SharedConfigMessage::_internal_set_seqno(int64_t value) { - _impl_._has_bits_[0] |= 0x00000002u; - _impl_.seqno_ = value; +inline std::string* ProProof::mutable_sig() { + std::string* _s = _internal_mutable_sig(); + // @@protoc_insertion_point(field_mutable:SessionProtos.ProProof.sig) + return _s; } -inline void SharedConfigMessage::set_seqno(int64_t value) { - _internal_set_seqno(value); - // @@protoc_insertion_point(field_set:SessionProtos.SharedConfigMessage.seqno) +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) } -// required bytes data = 3; -inline bool SharedConfigMessage::_internal_has_data() const { +// ------------------------------------------------------------------- + +// ProMessage + +// 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); return value; } -inline bool SharedConfigMessage::has_data() const { - return _internal_has_data(); +inline bool ProMessage::has_proof() const { + return _internal_has_proof(); } -inline void SharedConfigMessage::clear_data() { - _impl_.data_.ClearToEmpty(); +inline void ProMessage::clear_proof() { + if (_impl_.proof_ != nullptr) _impl_.proof_->Clear(); _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 ::SessionProtos::ProProof& ProMessage::_internal_proof() const { + const ::SessionProtos::ProProof* p = _impl_.proof_; + return p != nullptr ? *p : reinterpret_cast( + ::SessionProtos::_ProProof_default_instance_); } -template -inline PROTOBUF_ALWAYS_INLINE -void SharedConfigMessage::set_data(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) +inline const ::SessionProtos::ProProof& ProMessage::proof() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProMessage.proof) + return _internal_proof(); } -inline std::string* SharedConfigMessage::mutable_data() { - std::string* _s = _internal_mutable_data(); - // @@protoc_insertion_point(field_mutable:SessionProtos.SharedConfigMessage.data) - return _s; +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 const std::string& SharedConfigMessage::_internal_data() const { - return _impl_.data_.Get(); +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 void SharedConfigMessage::_internal_set_data(const std::string& value) { - _impl_._has_bits_[0] |= 0x00000001u; - _impl_.data_.Set(value, GetArenaForAllocation()); +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 std::string* SharedConfigMessage::_internal_mutable_data() { +inline ::SessionProtos::ProProof* ProMessage::_internal_mutable_proof() { _impl_._has_bits_[0] |= 0x00000001u; - return _impl_.data_.Mutable(GetArenaForAllocation()); -} -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_.data_.Release(); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.data_.IsDefault()) { - _impl_.data_.Set("", GetArenaForAllocation()); + if (_impl_.proof_ == nullptr) { + auto* p = CreateMaybeMessage<::SessionProtos::ProProof>(GetArenaForAllocation()); + _impl_.proof_ = p; } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; + return _impl_.proof_; } -inline void SharedConfigMessage::set_allocated_data(std::string* data) { - if (data != nullptr) { +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_.data_.SetAllocated(data, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.data_.IsDefault()) { - _impl_.data_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:SessionProtos.SharedConfigMessage.data) + _impl_.proof_ = proof; + // @@protoc_insertion_point(field_set_allocated:SessionProtos.ProMessage.proof) +} + +// 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_features() const { + return _internal_has_features(); +} +inline void ProMessage::clear_features() { + _impl_.features_ = uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline uint64_t ProMessage::_internal_features() const { + return _impl_.features_; +} +inline uint64_t ProMessage::features() const { + // @@protoc_insertion_point(field_get:SessionProtos.ProMessage.features) + return _internal_features(); +} +inline void ProMessage::_internal_set_features(uint64_t value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.features_ = value; +} +inline void ProMessage::set_features(uint64_t value) { + _internal_set_features(value); + // @@protoc_insertion_point(field_set:SessionProtos.ProMessage.features) } #ifdef __GNUC__ @@ -12282,6 +13820,18 @@ inline void SharedConfigMessage::set_allocated_data(std::string* data) { // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) @@ -12291,15 +13841,17 @@ PROTOBUF_NAMESPACE_OPEN template <> struct is_proto_enum< ::SessionProtos::Envelope_Type> : ::std::true_type {}; template <> struct is_proto_enum< ::SessionProtos::TypingMessage_Action> : ::std::true_type {}; +template <> struct is_proto_enum< ::SessionProtos::Content_ExpirationType> : ::std::true_type {}; template <> struct is_proto_enum< ::SessionProtos::CallMessage_Type> : ::std::true_type {}; template <> struct is_proto_enum< ::SessionProtos::DataExtractionNotification_Type> : ::std::true_type {}; template <> struct is_proto_enum< ::SessionProtos::DataMessage_Quote_QuotedAttachment_Flags> : ::std::true_type {}; 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 <> struct is_proto_enum< ::SessionProtos::DataMessage_Flags> : ::std::true_type {}; template <> struct is_proto_enum< ::SessionProtos::ReceiptMessage_Type> : ::std::true_type {}; template <> struct is_proto_enum< ::SessionProtos::AttachmentPointer_Flags> : ::std::true_type {}; template <> struct is_proto_enum< ::SessionProtos::SharedConfigMessage_Kind> : ::std::true_type {}; +template <> struct is_proto_enum< ::SessionProtos::GroupUpdateInfoChangeMessage_Type> : ::std::true_type {}; +template <> struct is_proto_enum< ::SessionProtos::GroupUpdateMemberChangeMessage_Type> : ::std::true_type {}; PROTOBUF_NAMESPACE_CLOSE diff --git a/proto/SessionProtos.proto b/proto/SessionProtos.proto index d112322b..a6db5ee1 100644 --- a/proto/SessionProtos.proto +++ b/proto/SessionProtos.proto @@ -21,6 +21,7 @@ message Envelope { required uint64 timestamp = 5; optional bytes content = 8; optional uint64 serverTimestamp = 10; + optional bytes proSig = 11; } message TypingMessage { @@ -51,15 +52,28 @@ message MessageRequestResponse { } 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; + + 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; + optional ProMessage proMessage = 16; } message CallMessage { @@ -163,42 +177,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; @@ -206,40 +195,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 GroupUpdateMessage groupUpdateMessage = 120; } message ReceiptMessage { @@ -284,9 +242,102 @@ 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 group encryption logic (senderIdentity on desktop) +} + +message GroupUpdateMemberLeftNotificationMessage { + // the pubkey of the member left is included as part of the 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; +} + +message ProProof { + optional uint32 version = 1; + optional bytes genIndexHash = 2; + optional bytes rotatingPublicKey = 3; + optional uint64 expiryUnixTs = 4; + optional bytes sig = 5; +} + +message ProMessage { + optional ProProof proof = 1; + optional uint64 features = 2; } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1e4ad566..10ea8eef 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -50,8 +50,11 @@ add_libsession_util_library(crypto multi_encrypt.cpp random.cpp session_encrypt.cpp + session_protocol.cpp sodium_array.cpp xed25519.cpp + pro_backend.cpp + types.cpp ) add_libsession_util_library(config @@ -69,6 +72,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 @@ -80,6 +84,7 @@ target_link_libraries(util PUBLIC common oxen::logging + libzstd::static ) target_link_libraries(crypto @@ -87,6 +92,7 @@ target_link_libraries(crypto util PRIVATE libsodium::sodium-internal + libsession::protos ) target_link_libraries(config @@ -95,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..a09c8d88 100644 --- a/src/config/groups/keys.cpp +++ b/src/config/groups/keys.cpp @@ -22,6 +22,7 @@ #include "session/config/groups/keys.h" #include "session/config/groups/members.hpp" #include "session/multi_encrypt.hpp" +#include "session/session_encrypt.hpp" #include "session/xed25519.hpp" using namespace std::literals; @@ -1201,203 +1202,51 @@ 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); // // 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_decrypting(plain.data(), ciphertext, nonce, *pending)) { - decrypt_success = true; - } else { + if (auto pending = pending_key(); pending) { + try { + std::span> key_list = {&(*pending), 1}; + decrypt = decrypt_group_message(key_list, *_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 { + 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&) { } } } 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)"}; + 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; - 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()); - + result.first = std::move(decrypt.session_id); + result.second = std::move(decrypt.plaintext); return result; } @@ -1508,13 +1357,25 @@ 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/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 3466a37a..26d02f18 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; @@ -160,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); @@ -263,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/config/pro.cpp b/src/config/pro.cpp new file mode 100644 index 00000000..66e92156 --- /dev/null +++ b/src/config/pro.cpp @@ -0,0 +1,109 @@ +#include +#include +#include + +#include + +#include "internal.hpp" + +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; + [[maybe_unused]] session::cleared_uc64 rederived_sk; + crypto_sign_ed25519_seed_keypair( + rederived_pk.data(), rederived_sk.data(), rotating_privkey.data()); + + bool result = false; + if (rederived_pk.size() == proof.rotating_pubkey.size()) + result = std::memcmp( + rederived_pk.data(), proof.rotating_pubkey.data(), rederived_pk.size()) == + 0; + return result; +} + +bool ProConfig::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; + + // 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; +} + +}; // 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_config*)0)->rotating_privkey) == crypto_sign_ed25519_SECRETKEYBYTES); + +LIBSESSION_C_API bool pro_config_verify_signature( + pro_pro_config const* pro, uint8_t const* verify_pubkey, size_t verify_pubkey_len) { + 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, + 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/config/user_profile.cpp b/src/config/user_profile.cpp index 5adaf110..486d6a28 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,6 +121,29 @@ std::chrono::sys_seconds UserProfile::get_profile_updated() const { return std::chrono::sys_seconds{}; } +std::optional UserProfile::get_pro_config() const { + std::optional result = {}; + if (const config::dict* s = data["s"].dict(); s) { + ProConfig pro = {}; + if (pro.load(*s)) + result = std::move(pro); + } + return result; +} + +void UserProfile::set_pro_config(ProConfig const& pro) { + auto root = data["s"]; + root["r"] = pro.rotating_privkey; + + const ProProof& pro_proof = pro.proof; + auto proof_dict = root["p"]; + 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(); + proof_dict["s"] = pro_proof.sig; +} + extern "C" { using namespace session; @@ -225,4 +250,42 @@ 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_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)); + 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_config(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/ed25519.cpp b/src/ed25519.cpp index 0cde00e3..3cc5dc17 100644 --- a/src/ed25519.cpp +++ b/src/ed25519.cpp @@ -1,5 +1,6 @@ #include "session/ed25519.hpp" +#include #include #include @@ -8,13 +9,35 @@ #include "session/export.h" #include "session/sodium_array.hpp" -namespace session::ed25519 { - template -using cleared_array = sodium_cleared>; - using uc32 = std::array; -using cleared_uc64 = cleared_array<64>; +using uc64 = std::array; + +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) + session::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 + +namespace session::ed25519 { std::pair, std::array> ed25519_key_pair() { std::array ed_pk; @@ -86,6 +109,11 @@ bool verify( crypto_sign_ed25519_verify_detached(sig.data(), msg.data(), msg.size(), pubkey.data())); } +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; @@ -157,3 +185,15 @@ 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_sk_out) { + try { + auto seed = std::span(ed25519_seed, 32); + 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/src/pro_backend.cpp b/src/pro_backend.cpp new file mode 100644 index 00000000..f54d5bf8 --- /dev/null +++ b/src/pro_backend.cpp @@ -0,0 +1,129 @@ +#include +#include +#include +#include + +#include +#include +#include + +namespace session::pro_backend { +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 + 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(); + 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)); + 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( + 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 + 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; + 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)); + 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_backend diff --git a/src/session_encrypt.cpp b/src/session_encrypt.cpp index b1003d66..feb28a99 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,6 +16,7 @@ #include #include #include +#include #include #include @@ -360,6 +363,119 @@ 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); @@ -436,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( - buf.data(), - ciphertext.data(), - ciphertext.size(), - x25519_pubkey.data(), - x25519_seckey.data())) + int opened = crypto_box_seal_open( + buf.data(), + ciphertext.data(), + ciphertext.size(), + x25519_pubkey.data(), + x25519_seckey.data()); + if (opened != 0) throw std::runtime_error{"Decryption failed"}; uc64 sig; @@ -566,6 +683,141 @@ std::pair, std::string> decrypt_from_blinded_recipien return result; } +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 (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); + + 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"}; + + // + // 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)"}; + + 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, @@ -842,14 +1094,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}); @@ -862,6 +1114,42 @@ 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, + char* error, + size_t error_len) { + 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 (const std::exception& e) { + std::string error_cpp = e.what(); + result.error_len_incl_null_terminator = + snprintf_bytes_written_clamped( + error, error_len, "%.*s", (int)error_cpp.size(), error_cpp.data()) + + 1; + } + return result; +} + LIBSESSION_C_API bool session_decrypt_incoming( const unsigned char* ciphertext_in, size_t ciphertext_len, @@ -914,7 +1202,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, @@ -923,7 +1211,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}); @@ -939,6 +1227,46 @@ 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, + 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 = { + 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 (const std::exception& e) { + std::string error_cpp = e.what(); + result.error_len_incl_null_terminator = + snprintf_bytes_written_clamped( + error, error_len, "%.*s", (int)error_cpp.size(), error_cpp.data()) + + 1; + } + } + return result; +} + LIBSESSION_C_API bool session_decrypt_ons_response( const char* name_in, const unsigned char* ciphertext_in, @@ -1033,4 +1361,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..4153187d --- /dev/null +++ b/src/session_protocol.cpp @@ -0,0 +1,1020 @@ +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "SessionProtos.pb.h" +#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; + + if (msg_size > PRO_STANDARD_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; +} + +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) { + Destination dest = {}; + dest.type = DestinationType::ContactOrSyncMessage; + dest.pro_sig = pro_sig; + dest.sent_timestamp_ms = sent_timestamp; + dest.recipient_pubkey = recipient_pubkey; + std::vector result = encrypt_for_destination(plaintext, ed25519_privkey, dest); + return result; +} + +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) { + 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; + std::vector result = encrypt_for_destination(plaintext, ed25519_privkey, dest); + return result; +} + +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) { + 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; + std::vector result = encrypt_for_destination(plaintext, ed25519_privkey, dest); + 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`. +struct EncryptedForDestinationInternal { + std::vector ciphertext_cpp; + span_u8 ciphertext_c; +}; + +enum class UseMalloc { No, Yes }; +static EncryptedForDestinationInternal encrypt_for_destination_internal( + std::span plaintext, + std::span ed25519_privkey, + DestinationType dest_type, + std::span dest_pro_sig, + std::span dest_recipient_pubkey, + std::chrono::milliseconds dest_sent_timestamp_ms, + std::span dest_community_inbox_server_pubkey, + std::span dest_group_ed25519_pubkey, + std::span dest_group_ed25519_privkey, + 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_community_inbox_server_pubkey.size() == 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 + // throw if these sizes are wrong. It being wrong would be a development error. + + EncryptedForDestinationInternal result = {}; + enum class Mode { + Envelope, + 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 + 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; + + // 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 + EncodeContext enc = {}; + switch (dest_type) { + case DestinationType::Group: { + bool has_03_prefix = + dest_group_ed25519_pubkey[0] == static_cast(SessionIDPrefix::group); + if (has_03_prefix) { + 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{ + "Unsupported configuration, encrypting for a legacy group (0x05 prefix) is " + "no longer supported"}; + } + } break; + + 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::CommunityInbox: { + enc.mode = Mode::EncryptForBlindedRecipient; + } break; + } + + // Do the encryption work + switch (enc.mode) { + case Mode::Envelope: { + assert(enc.envelope_type.has_value()); + 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, content); + content = 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(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.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()); + } + + 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; + + case Mode::EncryptForBlindedRecipient: { + std::vector ciphertext = encrypt_for_blinded_recipient( + ed25519_privkey, + dest_community_inbox_server_pubkey, + dest_recipient_pubkey, // 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; +} + +std::vector encrypt_for_destination( + std::span plaintext, + std::span ed25519_privkey, + const Destination& dest) { + + 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 : std::span(), + /*dest_recipient_pubkey=*/dest.recipient_pubkey, + /*dest_sent_timestamp_ms=*/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, + /*use_malloc=*/UseMalloc::No); + + std::vector result = std::move(result_internal.ciphertext_cpp); + return result; +} + +DecryptedEnvelope decrypt_envelope( + 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 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( + 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 session ID was wrong size: " + "{}", + decrypt.session_id.size())}; + + // Update the plaintext to use the decrypted envelope + envelope_from_decrypted_groups = std::move(decrypt.plaintext); + envelope_plaintext = envelope_from_decrypted_groups; + + // Copy keys out + 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()); + } 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())) + throw std::runtime_error{"Parse envelope from plaintext failed"}; + + // 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()) { + // 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_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 |= ENVELOPE_FLAGS_SOURCE; + } + + // Parse source device (optional) + if (envelope.has_sourcedevice()) { + result.envelope.source_device = envelope.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 |= ENVELOPE_FLAGS_SERVER_TIMESTAMP; + } + + // Parse content + if (!envelope.has_content()) + throw std::runtime_error{"Parse decrypted message failed, missing content"}; + + // Decrypt content + // The envelope is encrypted in GroupsV2, contents unencrypted. In 1o1 and legacy groups, the + // envelope is encrypted, contents is encrypted. + 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 { + 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, to_span(content)); + assert(result.sender_ed25519_pubkey.size() == crypto_sign_ed25519_PUBLICKEYBYTES); + decrypt_success = true; + break; + } catch (...) { + } + } + + 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( + 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."); + } + + // 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 (!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 + // be set but will be ignored. So in all instances a signature must be attached (real or + // dummy). + // + // 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; + DecryptedPro& pro = result.pro.emplace(); + + // 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::ProProof& proof = pro.proof; + // clang-format off + size_t proof_errors = 0; + 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(); + 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"); + + // 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()); + + 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()); + + // Evaluate the pro status given the extracted components (was it signed, is it expired, + // was the message signed validly?) + 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; +} +} // namespace session + +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); + return result; +} + +LIBSESSION_C_API +session_protocol_encrypted_for_destination session_protocol_encrypt_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_OR_SYNC_MESSAGE; + 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, + error, + error_len); + return result; +} + +LIBSESSION_C_API +session_protocol_encrypted_for_destination session_protocol_encrypt_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, + error, + error_len); + return result; +} + +LIBSESSION_C_API +session_protocol_encrypted_for_destination session_protocol_encrypt_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, + error, + error_len); + return result; +} + +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, + char* error, + size_t error_len) { + session_protocol_encrypted_for_destination result = {}; + try { + EncryptedForDestinationInternal result_internal = encrypt_for_destination_internal( + /*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->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.data, + /*dest_group_ed25519_pubkey=*/dest->group_ed25519_pubkey.data, + /*dest_group_ed25519_privkey=*/dest->group_ed25519_privkey.data, + /*use_malloc=*/UseMalloc::Yes); + + result = { + .success = true, + .ciphertext = result_internal.ciphertext_c, + }; + } catch (const std::exception& e) { + std::string error_cpp = e.what(); + result.error_len_incl_null_terminator = snprintf_bytes_written_clamped( + error, + error_len, + "%.*s", + static_cast(error_cpp.size()), + error_cpp.data()) + + 1; + } + + 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, + const void* envelope_plaintext, + size_t envelope_plaintext_len, + uint64_t unix_ts, + const void* pro_backend_pubkey, + size_t pro_backend_pubkey_len, + char* error, + size_t error_len) { + session_protocol_decrypted_envelope result = {}; + + // Setup the pro backend pubkey + 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 = snprintf_bytes_written_clamped( + 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 = {}; + 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); + result.success = true; + break; + } catch (const std::exception& e) { + std::string error_cpp = e.what(); + result.error_len_incl_null_terminator = snprintf_bytes_written_clamped( + error, + error_len, + "%.*s", + static_cast(error_cpp.size()), + error_cpp.data()) + + 1; + } + } + + if (keys->ed25519_privkeys_len == 0) { + result.error_len_incl_null_terminator = + snprintf_bytes_written_clamped( + error, error_len, "No keys ed25519_privkeys were provided") + + 1; + } + + // 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 = snprintf_bytes_written_clamped( + error, + error_len, + "%.*s", + static_cast(error_cpp.size()), + error_cpp.data()) + + 1; + } + + result.envelope.flags = result_cpp.envelope.flags; + 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; + + 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 when the function actually + // succeeded. + if (result.success) + result.error_len_incl_null_terminator = 0; + + std::memcpy( + result.envelope.source.data, + result_cpp.envelope.source.data(), + sizeof(result.envelope.source.data)); + std::memcpy( + result.envelope.pro_sig.data, + result_cpp.envelope.pro_sig.data(), + sizeof(result.envelope.pro_sig.data)); + + std::memcpy( + result.sender_ed25519_pubkey.data, + result_cpp.sender_ed25519_pubkey.data(), + sizeof(result.sender_ed25519_pubkey.data)); + std::memcpy( + result.sender_x25519_pubkey.data, + result_cpp.sender_x25519_pubkey.data(), + sizeof(result.sender_x25519_pubkey.data)); + + 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/src/types.cpp b/src/types.cpp new file mode 100644 index 00000000..c8dc8c23 --- /dev/null +++ b/src/types.cpp @@ -0,0 +1,32 @@ +#include +#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; +} + +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 && size && bytes_required_not_incl_null >= (size - 1)) + result = size - 1; + return result; +} diff --git a/src/util.cpp b/src/util.cpp index 60409c58..30bc4dcc 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,4 +1,7 @@ +#include + #include +#include #include namespace session { @@ -91,4 +94,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 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b436795f..9243fe11 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 @@ -27,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_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_pro.cpp b/tests/test_config_pro.cpp new file mode 100644 index 00000000..eb98ece2 --- /dev/null +++ b/tests/test_config_pro.cpp @@ -0,0 +1,161 @@ +#include +#include +#include + +#include +#include + +using namespace oxenc::literals; + +TEST_CASE("Pro", "[config][pro]") { + // Setup keys + std::array rotating_pk, signing_pk; + 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()); + } + + // Setup the Pro data structure + session::config::ProConfig pro_cpp = {}; + pro_config pro = {}; + { + // 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_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()); + } + + // Generate and write the hashes that are signed by the faux pro backend into the proof + { + // 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_cpp.proof.sig.data(), + nullptr, + 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 signature in the proof was signed by the faux pro backend key "signing_sk" + { + 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::ProProof& proof = pro_cpp.proof; + good_dict = { + {"r", std::string(reinterpret_cast(rotating_sk.data()), rotating_sk.size())}, + {"p", session::config::dict{ + /*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()}, + /*signature*/ {"s", std::string{reinterpret_cast(proof.sig.data()), proof.sig.size()}}, + }} + }; + // clang-format on + + session::config::ProConfig loaded_pro = {}; + CHECK(loaded_pro.load(good_dict)); + 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_cpp.proof.sig; + broken_sig[0] = ~broken_sig[0]; // Break the sig + + // clang-format off + const session::ProProof& proof = pro_cpp.proof; + bad_dict = { + {"r", std::string(reinterpret_cast(rotating_sk.data()), rotating_sk.size())}, + {"p", session::config::dict{ + /*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()}, + /*signature*/ {"s", std::string{reinterpret_cast(broken_sig.data()), broken_sig.size()}}, + }} + }; + // clang-format on + + session::config::ProConfig loaded_pro = {}; + CHECK(loaded_pro.load(bad_dict)); + CHECK_FALSE(loaded_pro.verify_signature(signing_pk)); + } +} 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_config_userprofile.cpp b/tests/test_config_userprofile.cpp index 66a169b5..17ba0cd6 100644 --- a/tests/test_config_userprofile.cpp +++ b/tests/test_config_userprofile.cpp @@ -65,26 +65,22 @@ TEST_CASE("UserProfile", "[config][user_profile]") { CHECK_THROWS( profile.set_name("123456789012345678901234567890123456789012345678901234567890123456789" - "01" - "23456789012345678901234567890A")); + "0123456789012345678901234567890A")); CHECK_NOTHROW( profile.set_name_truncated("12345678901234567890123456789012345678901234567890123456789" - "01" - "234567890123456789012345678901234567890A")); + "01234567890123456789012345678901234567890A")); CHECK(profile.get_name() == "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" "901234567890"); CHECK_NOTHROW( profile.set_name_truncated("12345678901234567890123456789012345678901234567890123456789" - "01" - "234567890123456789012345678901234567🎂")); + "01234567890123456789012345678901234567🎂")); CHECK(profile.get_name() == "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" "901234567"); CHECK_NOTHROW( profile.set_name_truncated("12345678901234567890123456789012345678901234567890123456789" - "01" - "2345678901234567890123456789012345🎂🎂")); + "012345678901234567890123456789012345🎂🎂")); CHECK(profile.get_name() == "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" "9012345🎂"); diff --git a/tests/test_ed25519.cpp b/tests/test_ed25519.cpp index fa715b27..c04bf2cb 100644 --- a/tests/test_ed25519.cpp +++ b/tests/test_ed25519.cpp @@ -3,40 +3,38 @@ #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,43 +42,96 @@ 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"); } +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'Seed0: {seed0.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 + + constexpr auto seed1 = "e5481635020d6f7b327e94e6d63e33a431fccabc4d2775845c43a8486a9f2884"_hex_u; + constexpr auto seed2 = "743d646706b6b04b97b752036dd6cf5f2adc4b339fcfdfb4b496f0764bb93a84"_hex_u; + constexpr auto seed_invalid = "010203040506070809"_hex_u; + + 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(sk1.size() == 64); + CHECK(sk1 != sk2); + + auto kp_sk1 = + "a4ec87e2346b25ee6394211cb682640a09dd8d297016fe241fe5b06fefef416c" + "b6d20c075eddd2edb69d4d7da9b7e580f187ce0537585da2b5e454b77980d0c8"; + auto kp_sk2 = + "7da256ba427cf5419cefea81f8ebb3395c261e4dfc2c91ee4d3ce9def67aa21c" + "539d0a3be9658ebb6ba3ce97b25d4f6b716f7ef6d6ae6343bd0733519f5a51e8"; + + CHECK(oxenc::to_hex(sk1) == kp_sk1); + CHECK(oxenc::to_hex(sk2) == kp_sk2); +} + 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"))); 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 new file mode 100644 index 00000000..5e3e2bec --- /dev/null +++ b/tests/test_session_protocol.cpp @@ -0,0 +1,685 @@ +#include + +#include +#include +#include +#include +#include +#include + +#include "SessionProtos.pb.h" +#include "WebSocketResources.pb.h" +#include "utils.hpp" + +using namespace session; + +struct SerialisedProtobufContentWithProForTesting { + ProProof proof; + 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( + 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()); + + // 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; +} + +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. + bytes33 recipient_pubkey = {}; + std::memcpy(recipient_pubkey.data, keys.session_pk1.data(), sizeof(recipient_pubkey.data)); + + // Withhold the pro signature + char error[256]; + session_protocol_encrypted_for_destination encrypt_without_pro_sig = + session_protocol_encrypt_for_1o1( + data_body.data(), + data_body.size(), + keys.ed_sk0.data(), + keys.ed_sk0.size(), + 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 + bytes64 pro_sig = {}; + session_protocol_encrypted_for_destination encrypt_with_pro_sig = + session_protocol_encrypt_for_1o1( + data_body.data(), + data_body.size(), + keys.ed_sk0.data(), + keys.ed_sk0.size(), + timestamp_ms.count(), + &recipient_pubkey, + &pro_sig, + error, + sizeof(error)); + REQUIRE(encrypt_with_pro_sig.error_len_incl_null_terminator == 0); + + // 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); + session_protocol_encrypt_for_destination_free(&encrypt_with_pro_sig); + } + + // 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 = {}; + { + 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_1o1( + plaintext.data(), + plaintext.size(), + keys.ed_sk0.data(), + keys.ed_sk0.size(), + timestamp_ms.count(), + &recipient_pubkey, + pro_sig, + error, + sizeof(error)); + 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); + session_protocol_encrypt_for_destination_free(&encrypt_result); + + // Verify pro + 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); + session_protocol_decrypt_envelope_free(&decrypt_result); + } + + // 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 + bytes64 base_pro_sig = {}; + std::memcpy( + base_pro_sig.data, + protobuf_content_with_pro.sig_over_plaintext_with_user_pro_key.data(), + sizeof(base_pro_sig.data)); + + 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 = { + DESTINATION_TYPE_COMMUNITY_INBOX, DESTINATION_TYPE_CONTACT_OR_SYNC_MESSAGE}; + + for (auto dest_type : dest_list) { + 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; + 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; + std::memcpy(dest.recipient_pubkey.data + 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, + error, + sizeof(error)); + + REQUIRE(encrypt_result.ciphertext.size > 0); + REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); + session_protocol_encrypt_for_destination_free(&encrypt_result); + } + } + + SECTION("Encrypt/decrypt for contact in default namespace with Pro") { + // Encrypt content + session_protocol_encrypted_for_destination encrypt_result = + session_protocol_encrypt_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.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); + session_protocol_encrypt_for_destination_free(&encrypt_result); + + // 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 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_encrypt_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.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); + session_protocol_encrypt_for_destination_free(&encrypt_result); + + // 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); + session_protocol_decrypt_envelope_free(&decrypt_result); + } + + SECTION("Encrypt/decrypt for legacy groups is rejected") { + session_protocol_destination dest = base_dest; + dest.type = DESTINATION_TYPE_GROUP; + assert(dest.recipient_pubkey.data[0] == 0x05); + + 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, + 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); + session_protocol_encrypt_for_destination_free(&encrypt_result); + } + + 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()); + + // Encrypt + session_protocol_encrypted_for_destination encrypt_result = {}; + { + 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( + group_v2_session_sk.data, group_v2_sk.data(), sizeof(group_v2_session_sk.data)); + + encrypt_result = session_protocol_encrypt_for_group( + 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, + &group_v2_session_pk, + &group_v2_session_sk, + base_dest.pro_sig, + error, + sizeof(error)); + INFO("Encrypt for group error: " << error); + REQUIRE(encrypt_result.success); + REQUIRE(encrypt_result.error_len_incl_null_terminator == 0); + } + + // Decrypt envelope + 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. + 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); + + session_protocol_encrypt_for_destination_free(&encrypt_result); + session_protocol_decrypt_envelope_free(&decrypt_result); + } + + SECTION("Encrypt/decrypt for sync messages with Pro") { + // Encrypt + session_protocol_encrypted_for_destination encrypt_result = + session_protocol_encrypt_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.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); + session_protocol_decrypt_envelope_free(&decrypt_result); + } + + // 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); + session_protocol_decrypt_envelope_free(&decrypt_result); + } + + // 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); + session_protocol_decrypt_envelope_free(&decrypt_result); + } + + // 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)); + session_protocol_decrypt_envelope_free(&decrypt_result); + } + + // 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); + session_protocol_decrypt_envelope_free(&decrypt_result); + } + session_protocol_encrypt_for_destination_free(&encrypt_result); + } + + SECTION("Encrypt/decrypt for sync messages with Pro and bad rotating signature") { + session_protocol_encrypted_for_destination encrypt_result = {}; + { + bytes64 pro_sig = base_pro_sig; + pro_sig.data[0] ^= 1; // Break the sig by flipping a bit + + encrypt_result = session_protocol_encrypt_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, + &pro_sig, + error, + sizeof(error)); + 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); + session_protocol_encrypt_for_destination_free(&encrypt_result); + session_protocol_decrypt_envelope_free(&decrypt_result); + } +} diff --git a/tests/utils.hpp b/tests/utils.hpp index cf4d70cd..ce801905 100644 --- a/tests/utils.hpp +++ b/tests/utils.hpp @@ -2,8 +2,8 @@ #include #include +#include -#include #include #include #include @@ -11,10 +11,8 @@ #include #include #include -#include #include -#include "session/config/base.h" #include "session/types.hpp" #include "session/util.hpp" @@ -125,3 +123,70 @@ 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 + bool converted = crypto_sign_ed25519_pk_to_curve25519(result.curve_pk0.data(), result.ed_pk0.data()) == 0; + assert(converted); + + // 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 + bool converted = crypto_sign_ed25519_pk_to_curve25519(result.curve_pk1.data(), result.ed_pk1.data()) == 0; + assert(converted); + + // 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; +}