chore(core/models): truncate the rest of the embed fields

This commit is contained in:
Paul Makles
2024-10-02 11:35:37 +01:00
parent 530d68fe89
commit 25fc692dc1

View File

@@ -168,6 +168,14 @@ auto_derived!(
impl WebsiteMetadata {
/// Truncate strings in metadata
pub fn truncate(&mut self) {
if let Some(s) = self.url.as_mut() {
s.truncate(256);
}
if let Some(s) = self.original_url.as_mut() {
s.truncate(256);
}
if let Some(s) = self.title.as_mut() {
s.truncate(100);
}
@@ -180,6 +188,10 @@ impl WebsiteMetadata {
s.truncate(32);
}
if let Some(s) = self.icon_url.as_mut() {
s.truncate(256);
}
if let Some(s) = self.colour.as_mut() {
s.truncate(32);
}