feat: add link embed generation

This commit is contained in:
Paul Makles
2022-04-14 20:46:46 +01:00
parent d2f0fb3414
commit 87391a49a5
7 changed files with 170 additions and 25 deletions

View File

@@ -166,11 +166,20 @@ pub async fn message_send(
}
// 6. Set content
message.content = Content::Text(data.content);
message.content = Content::Text(data.content.clone());
// 7. Pass-through nonce value for clients
message.nonce = Some(idempotency.into_key());
message.create(db).await?;
// Queue up a task for processing embeds
crate::tasks::process_embeds::queue(
channel.id().to_string(),
message.id.to_string(),
data.content,
)
.await;
Ok(Json(message))
}