mirror of
https://github.com/youwen5/iamb.git
synced 2025-06-20 05:39:52 -07:00
parent
a1574c6b8d
commit
1d93461183
5 changed files with 96 additions and 24 deletions
18
src/base.rs
18
src/base.rs
|
@ -81,9 +81,9 @@ pub enum MessageAction {
|
|||
|
||||
/// Download an attachment to the given path.
|
||||
///
|
||||
/// The [bool] argument controls whether to overwrite any already existing file at the
|
||||
/// destination path.
|
||||
Download(Option<String>, bool),
|
||||
/// The second argument controls whether to overwrite any already existing file at the
|
||||
/// destination path, or to open the attachment after downloading.
|
||||
Download(Option<String>, DownloadFlags),
|
||||
|
||||
/// Edit a sent message.
|
||||
Edit,
|
||||
|
@ -95,6 +95,18 @@ pub enum MessageAction {
|
|||
Reply,
|
||||
}
|
||||
|
||||
bitflags::bitflags! {
|
||||
pub struct DownloadFlags: u32 {
|
||||
const NONE = 0b00000000;
|
||||
|
||||
/// Overwrite file if it already exists.
|
||||
const FORCE = 0b00000001;
|
||||
|
||||
/// Open file after downloading.
|
||||
const OPEN = 0b00000010;
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub enum RoomField {
|
||||
Name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue