From 956c422482b2ec540cf38b94234505fbacfca3a2 Mon Sep 17 00:00:00 2001 From: cameronvoell Date: Fri, 22 Nov 2024 14:57:56 -0800 Subject: [PATCH 1/2] feat: new content types folder with reaction proto --- .../content_types/reaction.proto | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 proto/message_contents/content_types/reaction.proto diff --git a/proto/message_contents/content_types/reaction.proto b/proto/message_contents/content_types/reaction.proto new file mode 100644 index 0000000..8516311 --- /dev/null +++ b/proto/message_contents/content_types/reaction.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package xmtp.reactions; + +option go_package = "github.com/xmtp/proto/v3/go/reactions"; +option java_package = "org.xmtp.proto.reactions"; + +// Reaction message type +message Reaction { + // The message ID being reacted to + string reference = 1; + + // The inbox ID of the user who sent the message being reacted to + // Optional for group messages + string reference_inbox_id = 2; + + // The action of the reaction (e.g., "added" or "removed") + string action = 3; + + // The content of the reaction + string content = 4; + + // The schema of the reaction content (e.g., "unicode", "shortcode", "custom") + string schema = 5; +} From 149ee31c32af199539f66bc859adbb6f9a073dad Mon Sep 17 00:00:00 2001 From: cameronvoell Date: Sun, 24 Nov 2024 16:45:51 -0800 Subject: [PATCH 2/2] feat: make reaction action and schema into enums --- .../content_types/reaction.proto | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/proto/message_contents/content_types/reaction.proto b/proto/message_contents/content_types/reaction.proto index 8516311..db93c1d 100644 --- a/proto/message_contents/content_types/reaction.proto +++ b/proto/message_contents/content_types/reaction.proto @@ -5,6 +5,21 @@ package xmtp.reactions; option go_package = "github.com/xmtp/proto/v3/go/reactions"; option java_package = "org.xmtp.proto.reactions"; +// Action enum to represent reaction states +enum ReactionAction { + ACTION_UNSPECIFIED = 0; + ACTION_ADDED = 1; + ACTION_REMOVED = 2; +} + +// Schema enum to represent reaction content types +enum ReactionSchema { + SCHEMA_UNSPECIFIED = 0; + SCHEMA_UNICODE = 1; + SCHEMA_SHORTCODE = 2; + SCHEMA_CUSTOM = 3; +} + // Reaction message type message Reaction { // The message ID being reacted to @@ -14,12 +29,12 @@ message Reaction { // Optional for group messages string reference_inbox_id = 2; - // The action of the reaction (e.g., "added" or "removed") - string action = 3; + // The action of the reaction (added or removed) + ReactionAction action = 3; // The content of the reaction string content = 4; - // The schema of the reaction content (e.g., "unicode", "shortcode", "custom") - string schema = 5; + // The schema of the reaction content + ReactionSchema schema = 5; }