mirror of
https://github.com/chatmail/core.git
synced 2026-04-27 10:26:29 +03:00
Move ContactId constants to struct.
This makes the APIs much more Rust-like and keep contact IDs clearer and in one place.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
//! # Message summary for chatlist.
|
||||
|
||||
use crate::chat::Chat;
|
||||
use crate::constants::{Chattype, DC_CONTACT_ID_SELF};
|
||||
use crate::contact::Contact;
|
||||
use crate::constants::Chattype;
|
||||
use crate::contact::{Contact, ContactId};
|
||||
use crate::context::Context;
|
||||
use crate::dc_tools::dc_truncate;
|
||||
use crate::message::{Message, MessageState, Viewtype};
|
||||
@@ -60,7 +60,7 @@ impl Summary {
|
||||
) -> Self {
|
||||
let prefix = if msg.state == MessageState::OutDraft {
|
||||
Some(SummaryPrefix::Draft(stock_str::draft(context).await))
|
||||
} else if msg.from_id == DC_CONTACT_ID_SELF {
|
||||
} else if msg.from_id == ContactId::SELF {
|
||||
if msg.is_info() || chat.is_self_talk() {
|
||||
None
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user