Skip to content

Commit

Permalink
email: Add activation_token
Browse files Browse the repository at this point in the history
Requires version 4.
  • Loading branch information
A6GibKm committed Sep 2, 2023
1 parent 14d89c1 commit 14d4c01
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/desktop/email.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ struct EmailOptions {
subject: Option<String>,
body: Option<String>,
attachment_fds: Option<Vec<Fd>>,
// TODO Expose activation_token in the api
activation_token: Option<String>,
}

#[derive(Debug)]
Expand Down Expand Up @@ -167,6 +169,15 @@ impl EmailRequest {
self
}

// TODO Added in version 4 of the interface.
/// Sets the activation token.
#[allow(dead_code)]
#[must_use]
fn activation_token<'a>(mut self, activation_token: impl Into<Option<&'a str>>) -> Self {
self.options.activation_token = activation_token.into().map(ToOwned::to_owned);
self
}

/// A different variant of [`Self::attach`].
pub fn add_attachment(&mut self, attachment: &impl AsRawFd) {
let attachment = Fd::from(attachment.as_raw_fd());
Expand Down

0 comments on commit 14d4c01

Please sign in to comment.