add get_webxdc_memberlist

This commit is contained in:
Simon Laux
2025-01-12 05:38:13 +01:00
committed by Simon Laux
parent a6a733c636
commit 07225c825b
3 changed files with 56 additions and 4 deletions

View File

@@ -2250,6 +2250,20 @@ impl CommandApi {
WebxdcMessageInfo::get_for_message(&ctx, MsgId::new(instance_msg_id)).await
}
/// Returns webxdc memberlist, each member is a tuple (private user id, display_name)
/// Only includes members that have a known public key in the database
async fn get_webxdc_memberlist(
&self,
account_id: u32,
instance_msg_id: u32,
) -> Result<Vec<(String, String)>> {
let ctx = self.get_context(account_id).await?;
Message::load_from_db(&ctx, MsgId::new(instance_msg_id))
.await?
.get_webxdc_memberlist(&ctx)
.await
}
/// Get href from a WebxdcInfoMessage which might include a hash holding
/// information about a specific position or state in a webxdc app (optional)
async fn get_webxdc_href(&self, account_id: u32, info_msg_id: u32) -> Result<Option<String>> {