diff --git a/xmtp_content_types/src/lib.rs b/xmtp_content_types/src/lib.rs index b0c1b609e..95042313b 100644 --- a/xmtp_content_types/src/lib.rs +++ b/xmtp_content_types/src/lib.rs @@ -1,6 +1,11 @@ pub mod group_updated; pub mod membership_change; +pub mod reaction; +pub mod reply; +pub mod read_receipt; +pub mod remote_attachment; pub mod text; +pub mod transaction_reference; use diesel::{ backend::Backend, @@ -38,11 +43,11 @@ impl ContentType { text::TextCodec::TYPE_ID => Self::Text, membership_change::GroupMembershipChangeCodec::TYPE_ID => Self::GroupMembershipChange, group_updated::GroupUpdatedCodec::TYPE_ID => Self::GroupUpdated, - "reaction" => Self::Reaction, - "reply" => Self::Reply, - "read_receipt" => Self::ReadReceipt, - "remote_attachment" => Self::RemoteAttachment, - "transaction_reference" => Self::TransactionReference, + reaction::ReactionCodec::TYPE_ID => Self::Reaction, + reply::ReplyCodec::TYPE_ID => Self::Reply, + read_receipt::ReadReceiptCodec::TYPE_ID => Self::ReadReceipt, + remote_attachment::RemoteAttachmentCodec::TYPE_ID => Self::RemoteAttachment, + transaction_reference::TransactionReferenceCodec::TYPE_ID => Self::TransactionReference, _ => Self::Unknown, } } @@ -53,11 +58,11 @@ impl ContentType { Self::Text => text::TextCodec::TYPE_ID, Self::GroupMembershipChange => membership_change::GroupMembershipChangeCodec::TYPE_ID, Self::GroupUpdated => group_updated::GroupUpdatedCodec::TYPE_ID, - Self::Reaction => "reaction", - Self::Reply => "reply", - Self::ReadReceipt => "read_receipt", - Self::RemoteAttachment => "remote_attachment", - Self::TransactionReference => "transaction_reference", + Self::Reaction => reaction::ReactionCodec::TYPE_ID, + Self::Reply => reply::ReplyCodec::TYPE_ID, + Self::ReadReceipt => read_receipt::ReadReceiptCodec::TYPE_ID, + Self::RemoteAttachment => remote_attachment::RemoteAttachmentCodec::TYPE_ID, + Self::TransactionReference => transaction_reference::TransactionReferenceCodec::TYPE_ID, } } } diff --git a/xmtp_content_types/src/reaction.rs b/xmtp_content_types/src/reaction.rs new file mode 100644 index 000000000..50a89ebce --- /dev/null +++ b/xmtp_content_types/src/reaction.rs @@ -0,0 +1,6 @@ +pub struct ReactionCodec {} + +impl ReactionCodec { + const AUTHORITY_ID: &'static str = "xmtp.org"; + pub const TYPE_ID: &'static str = "reaction"; +} diff --git a/xmtp_content_types/src/read_receipt.rs b/xmtp_content_types/src/read_receipt.rs new file mode 100644 index 000000000..a81a2b7ad --- /dev/null +++ b/xmtp_content_types/src/read_receipt.rs @@ -0,0 +1,6 @@ +pub struct ReadReceiptCodec {} + +impl ReadReceiptCodec { + const AUTHORITY_ID: &'static str = "xmtp.org"; + pub const TYPE_ID: &'static str = "read_receipt"; +} diff --git a/xmtp_content_types/src/remote_attachment.rs b/xmtp_content_types/src/remote_attachment.rs new file mode 100644 index 000000000..77680aefe --- /dev/null +++ b/xmtp_content_types/src/remote_attachment.rs @@ -0,0 +1,6 @@ +pub struct RemoteAttachmentCodec {} + +impl RemoteAttachmentCodec { + const AUTHORITY_ID: &'static str = "xmtp.org"; + pub const TYPE_ID: &'static str = "remote_attachment"; +} diff --git a/xmtp_content_types/src/reply.rs b/xmtp_content_types/src/reply.rs new file mode 100644 index 000000000..6f8ba32f3 --- /dev/null +++ b/xmtp_content_types/src/reply.rs @@ -0,0 +1,6 @@ +pub struct ReplyCodec {} + +impl ReplyCodec { + const AUTHORITY_ID: &'static str = "xmtp.org"; + pub const TYPE_ID: &'static str = "reply"; +} diff --git a/xmtp_content_types/src/transaction_reference.rs b/xmtp_content_types/src/transaction_reference.rs new file mode 100644 index 000000000..c7060dc88 --- /dev/null +++ b/xmtp_content_types/src/transaction_reference.rs @@ -0,0 +1,6 @@ +pub struct TransactionReferenceCodec {} + +impl TransactionReferenceCodec { + const AUTHORITY_ID: &'static str = "xmtp.org"; + pub const TYPE_ID: &'static str = "transaction_reference"; +}