diff --git a/src/firehose.rs b/src/firehose.rs index 0285306..a298769 100644 --- a/src/firehose.rs +++ b/src/firehose.rs @@ -1,6 +1,6 @@ use crate::Cid; use crate::firehose::frames::Frame; -use crate::models::{Did, Embed, Label, Post, Uri}; +use crate::models::{Did, Embed, Label, Post, ReplyRef, Uri}; use crate::update_counter::UpdatesCounter; use atrium_api::app::bsky::feed::{self, Like}; use atrium_api::com::atproto::sync::subscribe_repos::{Commit, NSID}; @@ -417,6 +417,10 @@ impl FirehoseConnector { .iter() .filter_map(|lang| serde_json::to_string(&lang).ok()) .collect(), + reply: record.reply.as_ref().map(|r| ReplyRef { + parent: Uri(r.parent.uri.clone()), + root: Uri(r.root.uri.clone()), + }), }; let _ = tx.send_async(FirehoseEvent::Post(Box::new(post))).await; } diff --git a/src/lib.rs b/src/lib.rs index fffcf82..20ca389 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,5 +12,5 @@ pub use config::Config; pub use feed::{FeedHandler, start}; pub use models::{ Cid, Did, Embed, ExternalEmbed, FeedRequest, FeedResult, ImageEmbed, Label, MediaEmbed, Post, - QuoteEmbed, Uri, VideoEmbed, + QuoteEmbed, ReplyRef, Uri, VideoEmbed, }; diff --git a/src/models.rs b/src/models.rs index d7fbf09..393640f 100644 --- a/src/models.rs +++ b/src/models.rs @@ -25,6 +25,13 @@ pub struct Post { pub langs: Vec, pub timestamp: DateTime, pub embed: Option, + pub reply: Option, +} + +#[derive(Debug, Clone)] +pub struct ReplyRef { + pub parent: Uri, + pub root: Uri, } #[derive(Debug, Clone)] diff --git a/src/snapshots/skyfeed__public_api_test__public_api.snap b/src/snapshots/skyfeed__public_api_test__public_api.snap index 2ebdffe..24ea8ef 100644 --- a/src/snapshots/skyfeed__public_api_test__public_api.snap +++ b/src/snapshots/skyfeed__public_api_test__public_api.snap @@ -569,6 +569,7 @@ pub skyfeed::Post::cid: skyfeed::Cid pub skyfeed::Post::embed: core::option::Option pub skyfeed::Post::labels: alloc::vec::Vec pub skyfeed::Post::langs: alloc::vec::Vec +pub skyfeed::Post::reply: core::option::Option pub skyfeed::Post::text: alloc::string::String pub skyfeed::Post::timestamp: chrono::datetime::DateTime pub skyfeed::Post::uri: skyfeed::Uri @@ -677,6 +678,60 @@ impl typenum::type_operators::Same for skyfeed::QuoteEmbed pub type skyfeed::QuoteEmbed::Output = T impl ppv_lite86::types::VZip for skyfeed::QuoteEmbed where V: ppv_lite86::types::MultiLane pub fn skyfeed::QuoteEmbed::vzip(self) -> V +pub struct skyfeed::ReplyRef +pub skyfeed::ReplyRef::parent: skyfeed::Uri +pub skyfeed::ReplyRef::root: skyfeed::Uri +impl core::clone::Clone for skyfeed::ReplyRef +pub fn skyfeed::ReplyRef::clone(&self) -> skyfeed::ReplyRef +impl core::fmt::Debug for skyfeed::ReplyRef +pub fn skyfeed::ReplyRef::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::marker::Freeze for skyfeed::ReplyRef +impl core::marker::Send for skyfeed::ReplyRef +impl core::marker::Sync for skyfeed::ReplyRef +impl core::marker::Unpin for skyfeed::ReplyRef +impl core::panic::unwind_safe::RefUnwindSafe for skyfeed::ReplyRef +impl core::panic::unwind_safe::UnwindSafe for skyfeed::ReplyRef +impl atrium_common::types::throttled::Throttleable

for skyfeed::ReplyRef where P: core::default::Default +pub fn skyfeed::ReplyRef::throttled(self) -> atrium_common::types::throttled::Throttled +impl atrium_common::types::cached::Cacheable for skyfeed::ReplyRef +pub fn skyfeed::ReplyRef::cached(self, cache: C) -> atrium_common::types::cached::Cached +impl core::convert::Into for skyfeed::ReplyRef where U: core::convert::From +pub fn skyfeed::ReplyRef::into(self) -> U +impl core::convert::TryFrom for skyfeed::ReplyRef where U: core::convert::Into +pub type skyfeed::ReplyRef::Error = core::convert::Infallible +pub fn skyfeed::ReplyRef::try_from(value: U) -> core::result::Result>::Error> +impl core::convert::TryInto for skyfeed::ReplyRef where U: core::convert::TryFrom +pub type skyfeed::ReplyRef::Error = >::Error +pub fn skyfeed::ReplyRef::try_into(self) -> core::result::Result>::Error> +impl alloc::borrow::ToOwned for skyfeed::ReplyRef where T: core::clone::Clone +pub type skyfeed::ReplyRef::Owned = T +pub fn skyfeed::ReplyRef::clone_into(&self, target: &mut T) +pub fn skyfeed::ReplyRef::to_owned(&self) -> T +impl core::any::Any for skyfeed::ReplyRef where T: 'static + ?core::marker::Sized +pub fn skyfeed::ReplyRef::type_id(&self) -> core::any::TypeId +impl core::borrow::Borrow for skyfeed::ReplyRef where T: ?core::marker::Sized +pub fn skyfeed::ReplyRef::borrow(&self) -> &T +impl core::borrow::BorrowMut for skyfeed::ReplyRef where T: ?core::marker::Sized +pub fn skyfeed::ReplyRef::borrow_mut(&mut self) -> &mut T +impl core::clone::CloneToUninit for skyfeed::ReplyRef where T: core::clone::Clone +pub unsafe fn skyfeed::ReplyRef::clone_to_uninit(&self, dest: *mut u8) +impl core::convert::From for skyfeed::ReplyRef +pub fn skyfeed::ReplyRef::from(t: T) -> T +impl crossbeam_epoch::atomic::Pointable for skyfeed::ReplyRef +pub type skyfeed::ReplyRef::Init = T +pub const skyfeed::ReplyRef::ALIGN: usize +pub unsafe fn skyfeed::ReplyRef::deref<'a>(ptr: usize) -> &'a T +pub unsafe fn skyfeed::ReplyRef::deref_mut<'a>(ptr: usize) -> &'a mut T +pub unsafe fn skyfeed::ReplyRef::drop(ptr: usize) +pub unsafe fn skyfeed::ReplyRef::init(init: ::Init) -> usize +impl libipld_core::codec::References for skyfeed::ReplyRef +pub fn skyfeed::ReplyRef::references(_c: libipld_core::raw::RawCodec, _r: &mut R, _set: &mut E) -> core::result::Result<(), anyhow::Error> where R: std::io::Read, E: core::iter::traits::collect::Extend> +impl tracing::instrument::Instrument for skyfeed::ReplyRef +impl tracing::instrument::WithSubscriber for skyfeed::ReplyRef +impl typenum::type_operators::Same for skyfeed::ReplyRef +pub type skyfeed::ReplyRef::Output = T +impl ppv_lite86::types::VZip for skyfeed::ReplyRef where V: ppv_lite86::types::MultiLane +pub fn skyfeed::ReplyRef::vzip(self) -> V pub struct skyfeed::Uri(pub alloc::string::String) impl core::clone::Clone for skyfeed::Uri pub fn skyfeed::Uri::clone(&self) -> skyfeed::Uri