MCPcopy Create free account
hub / github.com/chatmail/core / get_msg_cnt

Method get_msg_cnt

src/chat.rs:892–901  ·  view source on GitHub ↗

Returns number of messages in a chat.

(self, context: &Context)

Source from the content-addressed store, hash-verified

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> {

Callers 3

dc_get_msg_cntFunction · 0.80
test_forward_msgs_2ctxFunction · 0.80
test_post_msg_bad_senderFunction · 0.80

Calls 1

countMethod · 0.80

Tested by 2

test_forward_msgs_2ctxFunction · 0.64
test_post_msg_bad_senderFunction · 0.64