mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 12:56:30 +03:00
fix: Make newlines work in chat descriptions (#8012)
This fixes a bug: If there is a multi-line chat description, only the first line was shown on recipient devices. Credits to @lk108 for noticing!
This commit is contained in:
@@ -3335,7 +3335,12 @@ async fn test_chat_description(
|
|||||||
initial_description
|
initial_description
|
||||||
);
|
);
|
||||||
|
|
||||||
for description in ["This is a cool chat", "", "ä ẟ 😂"] {
|
for description in [
|
||||||
|
&"This<>is 'a' \"cool\" chat:/\\|?*".repeat(50),
|
||||||
|
"multiple\nline\n\nbreaks\n\n\r\n.",
|
||||||
|
"",
|
||||||
|
"ä ẟ 😂",
|
||||||
|
] {
|
||||||
tcm.section(&format!(
|
tcm.section(&format!(
|
||||||
"Alice sets the chat description to '{description}'"
|
"Alice sets the chat description to '{description}'"
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -1525,7 +1525,7 @@ impl MimeFactory {
|
|||||||
let description = chat::get_chat_description(context, chat.id).await?;
|
let description = chat::get_chat_description(context, chat.id).await?;
|
||||||
headers.push((
|
headers.push((
|
||||||
"Chat-Group-Description",
|
"Chat-Group-Description",
|
||||||
mail_builder::headers::text::Text::new(description.clone()).into(),
|
mail_builder::headers::raw::Raw::new(b_encode(&description)).into(),
|
||||||
));
|
));
|
||||||
if let Some(ts) = chat.param.get_i64(Param::GroupDescriptionTimestamp) {
|
if let Some(ts) = chat.param.get_i64(Param::GroupDescriptionTimestamp) {
|
||||||
headers.push((
|
headers.push((
|
||||||
|
|||||||
Reference in New Issue
Block a user