Strict typing for system messages; add a way to rename group.

This commit is contained in:
Paul
2021-03-31 20:54:47 +01:00
parent 60731e1c70
commit 32cd9d8a13
11 changed files with 147 additions and 30 deletions

View File

@@ -102,8 +102,7 @@ pub async fn req(user: User, target: Ref) -> Result<()> {
Message::create(
"00000000000000000000000000".to_string(),
id.clone(),
// ! FIXME: make a schema for this
format!("{{\"type\":\"user_left\",\"id\":\"{}\"}}", user.id),
Content::SystemMessage(SystemMessage::UserLeft { id: user.id })
)
.publish(&target)
.await