Returns number of messages in a chat.
(self, context: &Context)
| 890 | |
| 891 | /// Returns number of messages in a chat. |
| 892 | pub async fn get_msg_cnt(self, context: &Context) -> Result<usize> { |
| 893 | let count = context |
| 894 | .sql |
| 895 | .count( |
| 896 | "SELECT COUNT(*) FROM msgs WHERE hidden=0 AND chat_id=?", |
| 897 | (self,), |
| 898 | ) |
| 899 | .await?; |
| 900 | Ok(count) |
| 901 | } |
| 902 | |
| 903 | /// Returns the number of fresh messages in the chat. |
| 904 | pub async fn get_fresh_msg_cnt(self, context: &Context) -> Result<usize> { |