mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 14:56:33 +03:00
fix: Message::get_summary() must not return reaction summary
This commit is contained in:
@@ -416,7 +416,7 @@ impl Chatlist {
|
|||||||
if chat.id.is_archived_link() {
|
if chat.id.is_archived_link() {
|
||||||
Ok(Default::default())
|
Ok(Default::default())
|
||||||
} else if let Some(lastmsg) = lastmsg.filter(|msg| msg.from_id != ContactId::UNDEFINED) {
|
} else if let Some(lastmsg) = lastmsg.filter(|msg| msg.from_id != ContactId::UNDEFINED) {
|
||||||
Summary::new(context, &lastmsg, chat, lastcontact.as_ref()).await
|
Summary::new_with_reaction_details(context, &lastmsg, chat, lastcontact.as_ref()).await
|
||||||
} else {
|
} else {
|
||||||
Ok(Summary {
|
Ok(Summary {
|
||||||
text: stock_str::no_messages(context).await,
|
text: stock_str::no_messages(context).await,
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ pub struct Summary {
|
|||||||
impl Summary {
|
impl Summary {
|
||||||
/// Constructs chatlist summary
|
/// Constructs chatlist summary
|
||||||
/// from the provided message, chat and message author contact snapshots.
|
/// from the provided message, chat and message author contact snapshots.
|
||||||
pub async fn new(
|
pub async fn new_with_reaction_details(
|
||||||
context: &Context,
|
context: &Context,
|
||||||
msg: &Message,
|
msg: &Message,
|
||||||
chat: &Chat,
|
chat: &Chat,
|
||||||
@@ -81,7 +81,17 @@ impl Summary {
|
|||||||
thumbnail_path: None,
|
thumbnail_path: None,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Self::new(context, msg, chat, contact).await
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Constructs search result summary
|
||||||
|
/// from the provided message, chat and message author contact snapshots.
|
||||||
|
pub async fn new(
|
||||||
|
context: &Context,
|
||||||
|
msg: &Message,
|
||||||
|
chat: &Chat,
|
||||||
|
contact: Option<&Contact>,
|
||||||
|
) -> Result<Summary> {
|
||||||
let prefix = if msg.state == MessageState::OutDraft {
|
let prefix = if msg.state == MessageState::OutDraft {
|
||||||
Some(SummaryPrefix::Draft(stock_str::draft(context).await))
|
Some(SummaryPrefix::Draft(stock_str::draft(context).await))
|
||||||
} else if msg.from_id == ContactId::SELF {
|
} else if msg.from_id == ContactId::SELF {
|
||||||
|
|||||||
Reference in New Issue
Block a user