aboutsummaryrefslogtreecommitdiff
path: root/src/server/cmd/commands/room_id_request.rs
blob: cc8dbeb9fec0a8e098ee39e0e6f4b250aa257ccb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyleft (ɔ) 2021-2021 The Whirlsplash Collective
// SPDX-License-Identifier: GPL-3.0-only

use std::str::from_utf8;

use crate::server::cmd::extendable::Parsable;

#[derive(Debug)]
pub struct RoomIdRequest {
  pub room_name: String,
}
impl Parsable for RoomIdRequest {
  fn parse(data: Vec<u8>) -> Self {
    Self {
      room_name: from_utf8(&data[4..data[0] as usize]).unwrap().to_string(),
    }
  }
}