Servers: Add TextChannel.

This commit is contained in:
Paul
2021-06-01 20:38:35 +01:00
parent 6bb4501c52
commit 46bf5fcdd1
6 changed files with 45 additions and 3 deletions

View File

@@ -108,5 +108,6 @@ pub async fn req(user: User, target: Ref) -> Result<()> {
Ok(())
}
Channel::TextChannel { .. } => unimplemented!()
}
}

View File

@@ -39,13 +39,24 @@ pub async fn req(user: User, info: Json<Data>) -> Result<JsonValue> {
}
let id = Ulid::new().to_string();
let cid = Ulid::new().to_string();
Channel::TextChannel {
id: cid.clone(),
server: id.clone(),
nonce: Some(info.nonce.clone()),
name: "general".to_string(),
description: None,
icon: None,
}.publish().await?;
let server = Server {
id: id.clone(),
nonce: Some(info.nonce.clone()),
owner: user.id.clone(),
name: info.name.clone(),
channels: vec![],
channels: vec![ cid ],
icon: None,
banner: None,