forked from jmug/stoatchat
chore(core/models): truncate the rest of the embed fields
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user