X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fapi%2Fcomment.rs;fp=server%2Fsrc%2Fapi%2Fcomment.rs;h=68481a40a4e38513a173bad9a2c7c64044ed7dc4;hb=5c6258390c46159c16f49295314c6519215fc6ae;hp=dd1970393187a99dd9f3646e87ebfb653f38d9d4;hpb=b69524b498983da636b3a31f5acb74fbb1f13ab4;p=lemmy.git diff --git a/server/src/api/comment.rs b/src/api/comment.rs similarity index 97% rename from server/src/api/comment.rs rename to src/api/comment.rs index dd197039..68481a40 100644 --- a/server/src/api/comment.rs +++ b/src/api/comment.rs @@ -8,10 +8,7 @@ use crate::{ Perform, }, apub::{ApubLikeableType, ApubObjectType}, - websocket::{ - messages::{JoinCommunityRoom, SendComment}, - UserOperation, - }, + websocket::{messages::SendComment, UserOperation}, LemmyContext, }; use actix_web::web::Data; @@ -655,7 +652,7 @@ impl Perform for GetComments { async fn perform( &self, context: &Data, - websocket_id: Option, + _websocket_id: Option, ) -> Result { let data: &GetComments = &self; let user = get_user_from_jwt_opt(&data.auth, context.pool()).await?; @@ -665,6 +662,7 @@ impl Perform for GetComments { let sort = SortType::from_str(&data.sort)?; let community_id = data.community_id; + let community_name = data.community_name.to_owned(); let page = data.page; let limit = data.limit; let comments = blocking(context.pool(), move |conn| { @@ -672,6 +670,7 @@ impl Perform for GetComments { .listing_type(type_) .sort(&sort) .for_community_id(community_id) + .for_community_name(community_name) .my_user_id(user_id) .page(page) .limit(limit) @@ -683,18 +682,6 @@ impl Perform for GetComments { Err(_) => return Err(APIError::err("couldnt_get_comments").into()), }; - if let Some(id) = websocket_id { - // You don't need to join the specific community room, bc this is already handled by - // GetCommunity - if data.community_id.is_none() { - // 0 is the "all" community - context.chat_server().do_send(JoinCommunityRoom { - community_id: 0, - id, - }); - } - } - Ok(GetCommentsResponse { comments }) } }