Skip to content

Commit

Permalink
refine rust documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
r10s committed Apr 16, 2024
1 parent 0044d25 commit 39880d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ pub enum Param {
/// For Webxdc Message Instances: Webxdc is an integration, see init_webxdc_integration()
WebxdcIntegration = b'3',

/// For Webxdc Message Instances: Chat to integrate in.
/// For Webxdc Message Instances: Chat to integrate the Webxdc for.
WebxdcIntegrateFor = b'2',

/// For messages: Whether [crate::message::Viewtype::Sticker] should be forced.
Expand Down
5 changes: 4 additions & 1 deletion src/webxdc/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use anyhow::Result;

impl Context {
/// Set Webxdc file as integration.
/// @param file The .xdc file to use as Webxdc integration.
pub async fn set_webxdc_integration(&self, file: &str) -> Result<()> {
let chat_id = ChatId::create_for_contact(self, ContactId::SELF).await?;
let mut msg = Message::new(Viewtype::Webxdc);
Expand All @@ -21,7 +22,9 @@ impl Context {
}

/// Get Webxdc instance used for optional integrations.
/// If there is no integration, the caller may decide to add a default one.
/// @param integrate_for The chat to get the integration for.
/// @return Message ID that refers to the Webxdc instance; UI can open the Webxdc as usual.
/// `None` if there is no integration; the caller can add one using `set_webxdc_integration` then.
pub async fn init_webxdc_integration(
&self,
integrate_for: Option<ChatId>,
Expand Down

0 comments on commit 39880d3

Please sign in to comment.