summaryrefslogtreecommitdiff
path: root/src/channel/app.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/channel/app.rs')
-rw-r--r--src/channel/app.rs48
1 files changed, 1 insertions, 47 deletions
diff --git a/src/channel/app.rs b/src/channel/app.rs
index 1b2cc48..a9a9e84 100644
--- a/src/channel/app.rs
+++ b/src/channel/app.rs
@@ -7,7 +7,7 @@ use crate::{
clock::DateTime,
db::NotFound,
event::{broadcaster::Broadcaster, repo::Provider as _, Event, Sequence},
- message::{repo::Provider as _, Message},
+ message::repo::Provider as _,
};
pub struct Channels<'a> {
@@ -36,52 +36,6 @@ impl<'a> Channels<'a> {
Ok(channel.as_created())
}
- pub async fn all(&self, resume_point: Option<Sequence>) -> Result<Vec<Channel>, InternalError> {
- let mut tx = self.db.begin().await?;
- let channels = tx.channels().all(resume_point).await?;
- tx.commit().await?;
-
- let channels = channels
- .into_iter()
- .filter_map(|channel| {
- channel
- .events()
- .filter(Sequence::up_to(resume_point))
- .collect()
- })
- .collect();
-
- Ok(channels)
- }
-
- pub async fn messages(
- &self,
- channel: &Id,
- resume_point: Option<Sequence>,
- ) -> Result<Vec<Message>, Error> {
- let mut tx = self.db.begin().await?;
- let channel = tx
- .channels()
- .by_id(channel)
- .await
- .not_found(|| Error::NotFound(channel.clone()))?;
-
- let messages = tx
- .messages()
- .in_channel(&channel, resume_point)
- .await?
- .into_iter()
- .filter_map(|message| {
- message
- .events()
- .filter(Sequence::up_to(resume_point))
- .collect()
- })
- .collect();
-
- Ok(messages)
- }
-
pub async fn delete(&self, channel: &Id, deleted_at: &DateTime) -> Result<(), Error> {
let mut tx = self.db.begin().await?;