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:
Floris Bruynooghe
2022-04-03 14:08:27 +02:00
parent 918ee47c79
commit 35c0434dc7
20 changed files with 243 additions and 267 deletions

View File

@@ -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 {