mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-17 18:04:01 +00:00
parent
aa2344bc10
commit
ed5043cd84
1 changed files with 4 additions and 9 deletions
|
@ -233,14 +233,6 @@ impl Handler<Connect> for ChatServer {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// for (k,v) in &self.rate_limits {
|
|
||||||
// println!("{}: {:?}", k,v);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// auto join session to Main room
|
|
||||||
// self.rooms.get_mut(&"Main".to_owned()).unwrap().insert(id);
|
|
||||||
|
|
||||||
// send id back
|
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -285,7 +277,10 @@ fn parse_json_message(chat: &mut ChatServer, msg: StandardMessage) -> Result<Str
|
||||||
|
|
||||||
let json: Value = serde_json::from_str(&msg.msg)?;
|
let json: Value = serde_json::from_str(&msg.msg)?;
|
||||||
let data = &json["data"].to_string();
|
let data = &json["data"].to_string();
|
||||||
let op = &json["op"].as_str().unwrap();
|
let op = &json["op"].as_str().ok_or(APIError {
|
||||||
|
op: "Unknown op type".to_string(),
|
||||||
|
message: format!("Unknown op type"),
|
||||||
|
})?;
|
||||||
|
|
||||||
let user_operation: UserOperation = UserOperation::from_str(&op)?;
|
let user_operation: UserOperation = UserOperation::from_str(&op)?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue