From 74ccc3c910ce9012b89553a736cc08bf3d0a466e Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Tue, 28 Nov 2023 14:38:01 -0800 Subject: [PATCH] feat: support EncodedContent and transcript messages --- proto/mls/message_contents/content.proto | 42 +++++++++++++++++++ .../transcript_messages.proto | 21 ++++++++++ 2 files changed, 63 insertions(+) create mode 100644 proto/mls/message_contents/content.proto create mode 100644 proto/mls/message_contents/transcript_messages.proto diff --git a/proto/mls/message_contents/content.proto b/proto/mls/message_contents/content.proto new file mode 100644 index 00000000..f6757b97 --- /dev/null +++ b/proto/mls/message_contents/content.proto @@ -0,0 +1,42 @@ +// Message content encoding structures +// Copied from V2 code so that we can eventually retire all V2 message content +syntax = "proto3"; + +package xmtp.mls.message_contents; + +option go_package = "github.com/xmtp/proto/v3/go/mls/message_contents"; +option java_package = "org.xmtp.proto.mls.message.contents"; + +// ContentTypeId is used to identify the type of content stored in a Message. +message ContentTypeId { + string authority_id = 1; // authority governing this content type + string type_id = 2; // type identifier + uint32 version_major = 3; // major version of the type + uint32 version_minor = 4; // minor version of the type +} + +// Recognized compression algorithms +// protolint:disable ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH +enum Compression { + COMPRESSION_DEFLATE = 0; + COMPRESSION_GZIP = 1; +} +// protolint:enable ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH + +// EncodedContent bundles the content with metadata identifying its type +// and parameters required for correct decoding and presentation of the content. +message EncodedContent { + // content type identifier used to match the payload with + // the correct decoding machinery + ContentTypeId type = 1; + // optional encoding parameters required to correctly decode the content + map parameters = 2; + // optional fallback description of the content that can be used in case + // the client cannot decode or render the content + optional string fallback = 3; + // optional compression; the value indicates algorithm used to + // compress the encoded content bytes + optional Compression compression = 5; + // encoded content itself + bytes content = 4; +} \ No newline at end of file diff --git a/proto/mls/message_contents/transcript_messages.proto b/proto/mls/message_contents/transcript_messages.proto new file mode 100644 index 00000000..e7c7a1f1 --- /dev/null +++ b/proto/mls/message_contents/transcript_messages.proto @@ -0,0 +1,21 @@ +// Message content encoding structures +syntax = "proto3"; + +package xmtp.mls.message_contents; + +option go_package = "github.com/xmtp/proto/v3/go/mls/message_contents"; +option java_package = "org.xmtp.proto.mls.message.contents"; + +// A group member and affected installation IDs +message Member { + repeated bytes installation_ids = 1; + string wallet_address = 2; +} + +// The group membership change proto +message GroupMembershipChange { + repeated Member members_added = 1; + repeated Member members_removed = 2; + repeated Member installations_added = 3; + repeated Member installations_removed = 4; +} \ No newline at end of file