|
|
|
@ -271,6 +271,12 @@ pub struct ConnectToPeerResponse { |
|
|
|
pub is_privileged: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<ConnectToPeerResponse> for ServerResponse {
|
|
|
|
fn from(response: ConnectToPeerResponse) -> Self {
|
|
|
|
Self::ConnectToPeerResponse(response)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ReadFromPacket for ConnectToPeerResponse {
|
|
|
|
fn read_from_packet(packet: &mut Packet) -> Result<Self, PacketReadError> {
|
|
|
|
let user_name = packet.read_value()?;
|
|
|
|
@ -333,6 +339,12 @@ pub struct FileSearchResponse { |
|
|
|
pub query: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<FileSearchResponse> for ServerResponse {
|
|
|
|
fn from(response: FileSearchResponse) -> Self {
|
|
|
|
Self::FileSearchResponse(response)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ReadFromPacket for FileSearchResponse {
|
|
|
|
fn read_from_packet(packet: &mut Packet) -> Result<Self, PacketReadError> {
|
|
|
|
let user_name = packet.read_value()?;
|
|
|
|
@ -385,6 +397,12 @@ pub enum LoginResponse { |
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<LoginResponse> for ServerResponse {
|
|
|
|
fn from(response: LoginResponse) -> Self {
|
|
|
|
Self::LoginResponse(response)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ReadFromPacket for LoginResponse {
|
|
|
|
fn read_from_packet(packet: &mut Packet) -> Result<Self, PacketReadError> {
|
|
|
|
let ok = packet.read_value()?;
|
|
|
|
@ -465,6 +483,12 @@ pub struct ParentMinSpeedResponse { |
|
|
|
pub value: u32,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<ParentMinSpeedResponse> for ServerResponse {
|
|
|
|
fn from(response: ParentMinSpeedResponse) -> Self {
|
|
|
|
Self::ParentMinSpeedResponse(response)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ReadFromPacket for ParentMinSpeedResponse {
|
|
|
|
fn read_from_packet(packet: &mut Packet) -> Result<Self, PacketReadError> {
|
|
|
|
let value = packet.read_value()?;
|
|
|
|
@ -494,6 +518,12 @@ pub struct ParentSpeedRatioResponse { |
|
|
|
pub value: u32,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<ParentSpeedRatioResponse> for ServerResponse {
|
|
|
|
fn from(response: ParentSpeedRatioResponse) -> Self {
|
|
|
|
Self::ParentSpeedRatioResponse(response)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ReadFromPacket for ParentSpeedRatioResponse {
|
|
|
|
fn read_from_packet(packet: &mut Packet) -> Result<Self, PacketReadError> {
|
|
|
|
let value = packet.read_value()?;
|
|
|
|
@ -525,6 +555,12 @@ pub struct PeerAddressResponse { |
|
|
|
port: u16,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<PeerAddressResponse> for ServerResponse {
|
|
|
|
fn from(response: PeerAddressResponse) -> Self {
|
|
|
|
Self::PeerAddressResponse(response)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ReadFromPacket for PeerAddressResponse {
|
|
|
|
fn read_from_packet(packet: &mut Packet) -> Result<Self, PacketReadError> {
|
|
|
|
let user_name = packet.read_value()?;
|
|
|
|
@ -569,6 +605,12 @@ pub struct PrivilegedUsersResponse { |
|
|
|
pub users: Vec<String>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<PrivilegedUsersResponse> for ServerResponse {
|
|
|
|
fn from(response: PrivilegedUsersResponse) -> Self {
|
|
|
|
Self::PrivilegedUsersResponse(response)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ReadFromPacket for PrivilegedUsersResponse {
|
|
|
|
fn read_from_packet(packet: &mut Packet) -> Result<Self, PacketReadError> {
|
|
|
|
let users = packet.read_value()?;
|
|
|
|
@ -601,6 +643,12 @@ pub struct RoomJoinResponse { |
|
|
|
pub operators: Vec<String>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<RoomJoinResponse> for ServerResponse {
|
|
|
|
fn from(response: RoomJoinResponse) -> Self {
|
|
|
|
Self::RoomJoinResponse(response)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ReadFromPacket for RoomJoinResponse {
|
|
|
|
fn read_from_packet(packet: &mut Packet) -> Result<Self, PacketReadError> {
|
|
|
|
let mut response = RoomJoinResponse {
|
|
|
|
@ -864,6 +912,12 @@ pub struct RoomLeaveResponse { |
|
|
|
pub room_name: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<RoomLeaveResponse> for ServerResponse {
|
|
|
|
fn from(response: RoomLeaveResponse) -> Self {
|
|
|
|
Self::RoomLeaveResponse(response)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ReadFromPacket for RoomLeaveResponse {
|
|
|
|
fn read_from_packet(packet: &mut Packet) -> Result<Self, PacketReadError> {
|
|
|
|
Ok(RoomLeaveResponse {
|
|
|
|
@ -897,6 +951,12 @@ pub struct RoomListResponse { |
|
|
|
pub operated_private_room_names: Vec<String>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<RoomListResponse> for ServerResponse {
|
|
|
|
fn from(response: RoomListResponse) -> Self {
|
|
|
|
Self::RoomListResponse(response)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ReadFromPacket for RoomListResponse {
|
|
|
|
fn read_from_packet(packet: &mut Packet) -> Result<Self, PacketReadError> {
|
|
|
|
let rooms = Self::read_rooms(packet)?;
|
|
|
|
@ -1026,6 +1086,12 @@ pub struct RoomMessageResponse { |
|
|
|
pub message: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<RoomMessageResponse> for ServerResponse {
|
|
|
|
fn from(response: RoomMessageResponse) -> Self {
|
|
|
|
Self::RoomMessageResponse(response)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ReadFromPacket for RoomMessageResponse {
|
|
|
|
fn read_from_packet(packet: &mut Packet) -> Result<Self, PacketReadError> {
|
|
|
|
let room_name = packet.read_value()?;
|
|
|
|
@ -1070,6 +1136,12 @@ pub struct RoomTickersResponse { |
|
|
|
pub tickers: Vec<(String, String)>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<RoomTickersResponse> for ServerResponse {
|
|
|
|
fn from(response: RoomTickersResponse) -> Self {
|
|
|
|
Self::RoomTickersResponse(response)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ReadFromPacket for RoomTickersResponse {
|
|
|
|
fn read_from_packet(packet: &mut Packet) -> Result<Self, PacketReadError> {
|
|
|
|
let room_name = packet.read_value()?;
|
|
|
|
@ -1111,6 +1183,12 @@ pub struct RoomUserJoinedResponse { |
|
|
|
pub user: User,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<RoomUserJoinedResponse> for ServerResponse {
|
|
|
|
fn from(response: RoomUserJoinedResponse) -> Self {
|
|
|
|
Self::RoomUserJoinedResponse(response)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ReadFromPacket for RoomUserJoinedResponse {
|
|
|
|
fn read_from_packet(packet: &mut Packet) -> Result<Self, PacketReadError> {
|
|
|
|
let room_name = packet.read_value()?;
|
|
|
|
@ -1180,6 +1258,12 @@ pub struct RoomUserLeftResponse { |
|
|
|
pub user_name: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<RoomUserLeftResponse> for ServerResponse {
|
|
|
|
fn from(response: RoomUserLeftResponse) -> Self {
|
|
|
|
Self::RoomUserLeftResponse(response)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ReadFromPacket for RoomUserLeftResponse {
|
|
|
|
fn read_from_packet(packet: &mut Packet) -> Result<Self, PacketReadError> {
|
|
|
|
let room_name = packet.read_value()?;
|
|
|
|
@ -1222,6 +1306,12 @@ pub struct UserInfoResponse { |
|
|
|
pub num_folders: usize,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<UserInfoResponse> for ServerResponse {
|
|
|
|
fn from(response: UserInfoResponse) -> Self {
|
|
|
|
Self::UserInfoResponse(response)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ReadFromPacket for UserInfoResponse {
|
|
|
|
fn read_from_packet(packet: &mut Packet) -> Result<Self, PacketReadError> {
|
|
|
|
let user_name = packet.read_value()?;
|
|
|
|
@ -1277,6 +1367,12 @@ pub struct UserStatusResponse { |
|
|
|
pub is_privileged: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<UserStatusResponse> for ServerResponse {
|
|
|
|
fn from(response: UserStatusResponse) -> Self {
|
|
|
|
Self::UserStatusResponse(response)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ReadFromPacket for UserStatusResponse {
|
|
|
|
fn read_from_packet(packet: &mut Packet) -> Result<Self, PacketReadError> {
|
|
|
|
let user_name = packet.read_value()?;
|
|
|
|
@ -1320,6 +1416,12 @@ pub struct WishlistIntervalResponse { |
|
|
|
pub seconds: u32,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<WishlistIntervalResponse> for ServerResponse {
|
|
|
|
fn from(response: WishlistIntervalResponse) -> Self {
|
|
|
|
Self::WishlistIntervalResponse(response)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ReadFromPacket for WishlistIntervalResponse {
|
|
|
|
fn read_from_packet(packet: &mut Packet) -> Result<Self, PacketReadError> {
|
|
|
|
let seconds = packet.read_value()?;
|
|
|
|
|