mirror of
https://github.com/chatmail/core.git
synced 2026-05-09 01:46:30 +03:00
refactor: Use created_timestamp() instead of duplicating its code (#6692)
This commit is contained in:
@@ -1989,13 +1989,7 @@ impl Chat {
|
|||||||
if let Some(member_list_timestamp) = self.param.get_i64(Param::MemberListTimestamp) {
|
if let Some(member_list_timestamp) = self.param.get_i64(Param::MemberListTimestamp) {
|
||||||
Ok(member_list_timestamp)
|
Ok(member_list_timestamp)
|
||||||
} else {
|
} else {
|
||||||
let creation_timestamp: i64 = context
|
Ok(self.id.created_timestamp(context).await?)
|
||||||
.sql
|
|
||||||
.query_get_value("SELECT created_timestamp FROM chats WHERE id=?", (self.id,))
|
|
||||||
.await
|
|
||||||
.context("SQL error querying created_timestamp")?
|
|
||||||
.context("Chat not found")?;
|
|
||||||
Ok(creation_timestamp)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user