mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 13:36:59 +00:00
Join with newlines for embed generation.
Server January URL endpoint on server configuration.
This commit is contained in:
@@ -107,9 +107,8 @@ impl Embed {
|
||||
|
||||
v
|
||||
})
|
||||
// This will also remove newlines, but
|
||||
// that isn't important here.
|
||||
.collect::<String>();
|
||||
.collect::<Vec<&str>>()
|
||||
.join("\n");
|
||||
|
||||
// ! FIXME: allow multiple links
|
||||
// ! FIXME: prevent generation if link is surrounded with < >
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::util::variables::VAPID_PRIVATE_KEY;
|
||||
use crate::util::variables::{VAPID_PRIVATE_KEY, USE_JANUARY};
|
||||
use crate::{
|
||||
database::*,
|
||||
notifications::{events::ClientboundNotification, websocket::is_online},
|
||||
@@ -231,6 +231,10 @@ impl Message {
|
||||
}
|
||||
|
||||
pub fn process_embed(&self) {
|
||||
if !*USE_JANUARY {
|
||||
return;
|
||||
}
|
||||
|
||||
if let Content::Text(text) = &self.content {
|
||||
let id = self.id.clone();
|
||||
let content = text.clone();
|
||||
|
||||
Reference in New Issue
Block a user