Servers: Fix create / leave.

Prevent removal of self / owner.
This commit is contained in:
Paul
2021-06-07 16:14:48 +01:00
parent 4e90cf1f58
commit fce92382bf
4 changed files with 14 additions and 22 deletions

View File

@@ -57,8 +57,6 @@ pub async fn req(user: User, info: Json<Data>) -> Result<JsonValue> {
banner: None,
};
server.join_member(&user.id).await?;
Channel::TextChannel {
id: cid,
server: id,
@@ -71,6 +69,7 @@ pub async fn req(user: User, info: Json<Data>) -> Result<JsonValue> {
.await?;
server.clone().publish().await?;
server.join_member(&user.id).await?;
Ok(json!(server))
}