diff --git a/bindings_ffi/src/mls.rs b/bindings_ffi/src/mls.rs index 4ac46b3c1..3eb4a7d98 100644 --- a/bindings_ffi/src/mls.rs +++ b/bindings_ffi/src/mls.rs @@ -1258,6 +1258,7 @@ pub struct FfiListMessagesOptions { pub limit: Option, pub delivery_status: Option, pub direction: Option, + pub content_types: Option>, } #[derive(uniffi::Record, Clone, Default)] diff --git a/xmtp_mls/src/storage/encrypted_store/group_message.rs b/xmtp_mls/src/storage/encrypted_store/group_message.rs index 9d4178ea2..550edb752 100644 --- a/xmtp_mls/src/storage/encrypted_store/group_message.rs +++ b/xmtp_mls/src/storage/encrypted_store/group_message.rs @@ -186,6 +186,7 @@ pub struct MsgQueryArgs { delivery_status: Option, limit: Option, direction: Option, + content_types: Option>, } impl MsgQueryArgs { @@ -273,6 +274,10 @@ impl DbConnection { query = query.filter(dsl::delivery_status.eq(status)); } + if let Some(content_types) = &args.content_types { + query = query.filter(dsl::content_type.eq_any(content_types)); + } + query = match args.direction.as_ref().unwrap_or(&SortDirection::Ascending) { SortDirection::Ascending => query.order(dsl::sent_at_ns.asc()), SortDirection::Descending => query.order(dsl::sent_at_ns.desc()),