Skip to content

Commit

Permalink
feat: support EncodedContent and transcript messages
Browse files Browse the repository at this point in the history
  • Loading branch information
neekolas committed Nov 28, 2023
1 parent 8060216 commit 74ccc3c
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
42 changes: 42 additions & 0 deletions proto/mls/message_contents/content.proto
Original file line number Diff line number Diff line change
@@ -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<string, string> 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;
}
21 changes: 21 additions & 0 deletions proto/mls/message_contents/transcript_messages.proto
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 74ccc3c

Please sign in to comment.