]> Untitled Git - lemmy.git/blob - crates/db_schema/src/source/private_message.rs
Allow filtering out of deleted and removed comments when getting person details ...
[lemmy.git] / crates / db_schema / src / source / private_message.rs
1 use crate::newtypes::{DbUrl, PersonId, PrivateMessageId};
2 use serde::{Deserialize, Serialize};
3
4 #[cfg(feature = "full")]
5 use crate::schema::private_message;
6
7 #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
8 #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
9 #[cfg_attr(feature = "full", table_name = "private_message")]
10 pub struct PrivateMessage {
11   pub id: PrivateMessageId,
12   pub creator_id: PersonId,
13   pub recipient_id: PersonId,
14   pub content: String,
15   pub deleted: bool,
16   pub read: bool,
17   pub published: chrono::NaiveDateTime,
18   pub updated: Option<chrono::NaiveDateTime>,
19   pub ap_id: DbUrl,
20   pub local: bool,
21 }
22
23 #[derive(Default)]
24 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
25 #[cfg_attr(feature = "full", table_name = "private_message")]
26 pub struct PrivateMessageForm {
27   pub creator_id: PersonId,
28   pub recipient_id: PersonId,
29   pub content: String,
30   pub deleted: Option<bool>,
31   pub read: Option<bool>,
32   pub published: Option<chrono::NaiveDateTime>,
33   pub updated: Option<chrono::NaiveDateTime>,
34   pub ap_id: Option<DbUrl>,
35   pub local: Option<bool>,
36 }