refactor: Use created_timestamp() instead of duplicating its code (#6692)

This commit is contained in:
Hocuri
2025-03-21 15:06:06 +01:00
committed by GitHub
parent 4c4646e72c
commit a51b2fa751

View File

@@ -1989,13 +1989,7 @@ impl Chat {
if let Some(member_list_timestamp) = self.param.get_i64(Param::MemberListTimestamp) {
Ok(member_list_timestamp)
} else {
let creation_timestamp: i64 = context
.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)
Ok(self.id.created_timestamp(context).await?)
}
}