forked from jmug/stoatchat
JSON system messages.
This commit is contained in:
@@ -102,7 +102,8 @@ pub async fn req(user: User, target: Ref) -> Result<()> {
|
|||||||
Message::create(
|
Message::create(
|
||||||
"00000000000000000000000000".to_string(),
|
"00000000000000000000000000".to_string(),
|
||||||
id.clone(),
|
id.clone(),
|
||||||
format!("<@{}> left the group.", user.id),
|
// ! FIXME: make a schema for this
|
||||||
|
format!("{{\"type\":\"user_left\",\"id\":\"{}\"}}", user.id),
|
||||||
)
|
)
|
||||||
.publish(&target)
|
.publish(&target)
|
||||||
.await
|
.await
|
||||||
|
|||||||
@@ -59,7 +59,8 @@ pub async fn req(user: User, target: Ref, member: Ref) -> Result<()> {
|
|||||||
Message::create(
|
Message::create(
|
||||||
"00000000000000000000000000".to_string(),
|
"00000000000000000000000000".to_string(),
|
||||||
id.clone(),
|
id.clone(),
|
||||||
format!("<@{}> added <@{}> to the group.", user.id, member.id),
|
// ! FIXME: make a schema for this
|
||||||
|
format!("{{\"type\":\"user_added\",\"id\":\"{}\",\"by\":\"{}\"}}", member.id, user.id),
|
||||||
)
|
)
|
||||||
.publish(&channel)
|
.publish(&channel)
|
||||||
.await
|
.await
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ pub async fn req(user: User, target: Ref, member: Ref) -> Result<()> {
|
|||||||
Message::create(
|
Message::create(
|
||||||
"00000000000000000000000000".to_string(),
|
"00000000000000000000000000".to_string(),
|
||||||
id.clone(),
|
id.clone(),
|
||||||
format!("<@{}> removed <@{}> from the group.", user.id, member.id),
|
// ! FIXME: make a schema for this
|
||||||
|
format!("{{\"type\":\"user_remove\",\"id\":\"{}\",\"by\":\"{}\"}}", member.id, user.id),
|
||||||
)
|
)
|
||||||
.publish(&channel)
|
.publish(&channel)
|
||||||
.await
|
.await
|
||||||
|
|||||||
Reference in New Issue
Block a user