+
+#[async_trait::async_trait(?Send)]
+impl Perform for CommunityJoin {
+ type Response = CommunityJoinResponse;
+
+ async fn perform(
+ &self,
+ context: &Data<LemmyContext>,
+ websocket_id: Option<ConnectionId>,
+ ) -> Result<CommunityJoinResponse, LemmyError> {
+ let data: &CommunityJoin = &self;
+
+ if let Some(ws_id) = websocket_id {
+ context.chat_server().do_send(JoinCommunityRoom {
+ community_id: data.community_id,
+ id: ws_id,
+ });
+ }
+
+ Ok(CommunityJoinResponse { joined: true })
+ }
+}