mirror of https://github.com/LemmyNet/lemmy.git
remove unused code
parent
f129cd51b8
commit
89853e6707
|
@ -108,8 +108,8 @@ impl GetCommunity for AnnouncableActivities {
|
||||||
UndoBlockUserFromCommunity(a) => a.get_community(context, request_counter).await?,
|
UndoBlockUserFromCommunity(a) => a.get_community(context, request_counter).await?,
|
||||||
AddMod(a) => a.get_community(context, request_counter).await?,
|
AddMod(a) => a.get_community(context, request_counter).await?,
|
||||||
RemoveMod(a) => a.get_community(context, request_counter).await?,
|
RemoveMod(a) => a.get_community(context, request_counter).await?,
|
||||||
Page(a) => a.get_community(context, request_counter).await?,
|
Page(_) => unimplemented!(),
|
||||||
Note(a) => a.get_community(context, request_counter).await?,
|
Note(_) => unimplemented!(),
|
||||||
};
|
};
|
||||||
Ok(community)
|
Ok(community)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
activities::community::announce::GetCommunity,
|
|
||||||
fetcher::post_or_comment::PostOrComment,
|
fetcher::post_or_comment::PostOrComment,
|
||||||
objects::{comment::ApubComment, community::ApubCommunity, person::ApubPerson, post::ApubPost},
|
objects::{comment::ApubComment, person::ApubPerson, post::ApubPost},
|
||||||
protocol::Source,
|
protocol::Source,
|
||||||
};
|
};
|
||||||
use activitystreams::{object::kind::NoteType, unparsed::Unparsed};
|
use activitystreams::{object::kind::NoteType, unparsed::Unparsed};
|
||||||
|
@ -14,11 +13,7 @@ use lemmy_apub_lib::{
|
||||||
traits::ActivityHandler,
|
traits::ActivityHandler,
|
||||||
values::MediaTypeHtml,
|
values::MediaTypeHtml,
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{newtypes::CommentId, source::post::Post, traits::Crud};
|
||||||
newtypes::CommentId,
|
|
||||||
source::{community::Community, post::Post},
|
|
||||||
traits::Crud,
|
|
||||||
};
|
|
||||||
use lemmy_utils::LemmyError;
|
use lemmy_utils::LemmyError;
|
||||||
use lemmy_websocket::LemmyContext;
|
use lemmy_websocket::LemmyContext;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
@ -101,24 +96,6 @@ impl ActivityHandler for Note {
|
||||||
Err(anyhow!("Announce/Page can only be sent, not received").into())
|
Err(anyhow!("Announce/Page can only be sent, not received").into())
|
||||||
}
|
}
|
||||||
async fn receive(self, _: &Data<Self::DataType>, _: &mut i32) -> Result<(), LemmyError> {
|
async fn receive(self, _: &Data<Self::DataType>, _: &mut i32) -> Result<(), LemmyError> {
|
||||||
Ok(())
|
unimplemented!()
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[async_trait::async_trait(?Send)]
|
|
||||||
impl GetCommunity for Note {
|
|
||||||
async fn get_community(
|
|
||||||
&self,
|
|
||||||
context: &LemmyContext,
|
|
||||||
request_counter: &mut i32,
|
|
||||||
) -> Result<ApubCommunity, LemmyError> {
|
|
||||||
let post = self.get_parents(context, request_counter).await?.0;
|
|
||||||
Ok(
|
|
||||||
blocking(context.pool(), move |conn| {
|
|
||||||
Community::read(conn, post.community_id)
|
|
||||||
})
|
|
||||||
.await??
|
|
||||||
.into(),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
activities::community::announce::GetCommunity,
|
|
||||||
objects::{community::ApubCommunity, person::ApubPerson, post::ApubPost},
|
objects::{community::ApubCommunity, person::ApubPerson, post::ApubPost},
|
||||||
protocol::{ImageObject, Source},
|
protocol::{ImageObject, Source},
|
||||||
};
|
};
|
||||||
|
@ -88,17 +87,6 @@ impl ActivityHandler for Page {
|
||||||
Err(anyhow!("Announce/Page can only be sent, not received").into())
|
Err(anyhow!("Announce/Page can only be sent, not received").into())
|
||||||
}
|
}
|
||||||
async fn receive(self, _: &Data<Self::DataType>, _: &mut i32) -> Result<(), LemmyError> {
|
async fn receive(self, _: &Data<Self::DataType>, _: &mut i32) -> Result<(), LemmyError> {
|
||||||
Ok(())
|
unimplemented!()
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[async_trait::async_trait(?Send)]
|
|
||||||
impl GetCommunity for Page {
|
|
||||||
async fn get_community(
|
|
||||||
&self,
|
|
||||||
context: &LemmyContext,
|
|
||||||
request_counter: &mut i32,
|
|
||||||
) -> Result<ApubCommunity, LemmyError> {
|
|
||||||
self.extract_community(context, request_counter).await
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue