]> Untitled Git - lemmy.git/blobdiff - server/src/websocket/server.rs
Merge branch 'dev' into federation
[lemmy.git] / server / src / websocket / server.rs
index 0f2d2d26fdb4d89700e1c34efcb9738eed8a6f6d..faa8041cea2d60ace233d074397516a2bbc428d6 100644 (file)
@@ -505,9 +505,6 @@ fn parse_json_message(chat: &mut ChatServer, msg: StandardMessage) -> Result<Str
 
   let user_operation: UserOperation = UserOperation::from_str(&op)?;
 
-  // TODO: none of the chat messages are going to work if stuff is submitted via http api,
-  //       need to move that handling elsewhere
-
   // A DDOS check
   chat.check_rate_limit_message(msg.id, false)?;
 
@@ -554,7 +551,9 @@ fn parse_json_message(chat: &mut ChatServer, msg: StandardMessage) -> Result<Str
     }
     UserOperation::GetCommunity => {
       let get_community: GetCommunity = serde_json::from_str(data)?;
+
       let mut res = Oper::new(get_community).perform(&conn)?;
+
       let community_id = res.community.id;
 
       chat.join_community_room(community_id, msg.id);
@@ -629,6 +628,7 @@ fn parse_json_message(chat: &mut ChatServer, msg: StandardMessage) -> Result<Str
     }
     UserOperation::GetPosts => {
       let get_posts: GetPosts = serde_json::from_str(data)?;
+
       if get_posts.community_id.is_none() {
         // 0 is the "all" community
         chat.join_community_room(0, msg.id);