api(rust, jsonrpc): add get_message_read_receipt_count method (#7732)

closes #7728
This commit is contained in:
Simon Laux
2026-01-19 11:37:10 +00:00
committed by GitHub
parent 29c57ad065
commit b2f31c8148
4 changed files with 35 additions and 2 deletions

View File

@@ -1506,6 +1506,16 @@ pub async fn get_msg_read_receipts(
.await
}
/// Returns count of read receipts on message.
///
/// This view count is meant as a feedback measure for the channel owner only.
pub async fn get_msg_read_receipt_count(context: &Context, msg_id: MsgId) -> Result<usize> {
context
.sql
.count("SELECT COUNT(*) FROM msgs_mdns WHERE msg_id=?", (msg_id,))
.await
}
pub(crate) fn guess_msgtype_from_suffix(msg: &Message) -> Option<(Viewtype, &'static str)> {
msg.param
.get(Param::Filename)