From a51b2fa75136abef982b084a07394174fc9a47d0 Mon Sep 17 00:00:00 2001 From: Hocuri Date: Fri, 21 Mar 2025 15:06:06 +0100 Subject: [PATCH] refactor: Use created_timestamp() instead of duplicating its code (#6692) --- src/chat.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/chat.rs b/src/chat.rs index 6eb090d7b..121875984 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -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?) } }