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)?;
}
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);
}
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);