add get_webxdc_memberlist

This commit is contained in:
Simon Laux
2025-01-12 05:38:13 +01:00
parent 187274d7b7
commit b2911fe159
3 changed files with 65 additions and 6 deletions

View File

@@ -1829,6 +1829,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(