mirror of
https://github.com/soywod/himalaya.git
synced 2024-07-05 09:05:13 +00:00
update docs+tests about idle command
This commit is contained in:
parent
66abac61fa
commit
9125b3e869
|
@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Get signature from file [#135]
|
- Get signature from file [#135]
|
||||||
|
- [**BREAKING**] Split `idle` command into two commands:
|
||||||
|
- `notify`: Runs `notify-cmd` when a new message arrives to the server
|
||||||
|
- `watch`: Runs `watch-cmds` when any change occurs on the server
|
||||||
|
|
||||||
## [0.3.1] - 2021-05-04
|
## [0.3.1] - 2021-05-04
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ fn get_account(addr: &str) -> Account {
|
||||||
default_page_size: None,
|
default_page_size: None,
|
||||||
default: Some(true),
|
default: Some(true),
|
||||||
email: addr.into(),
|
email: addr.into(),
|
||||||
|
watch_cmds: None,
|
||||||
imap_host: String::from("localhost"),
|
imap_host: String::from("localhost"),
|
||||||
imap_port: 3993,
|
imap_port: 3993,
|
||||||
imap_starttls: Some(false),
|
imap_starttls: Some(false),
|
||||||
|
@ -73,7 +74,11 @@ fn msg() {
|
||||||
// List messages
|
// List messages
|
||||||
// TODO: check non-existance of \Seen flag
|
// TODO: check non-existance of \Seen flag
|
||||||
let msgs = imap_conn.list_msgs("INBOX", &10, &0).unwrap();
|
let msgs = imap_conn.list_msgs("INBOX", &10, &0).unwrap();
|
||||||
let msgs = Msgs::from(&msgs);
|
let msgs = if let Some(ref fetches) = msgs {
|
||||||
|
Msgs::from(fetches)
|
||||||
|
} else {
|
||||||
|
Msgs::new()
|
||||||
|
};
|
||||||
assert_eq!(msgs.0.len(), 2);
|
assert_eq!(msgs.0.len(), 2);
|
||||||
|
|
||||||
let msg_a = msgs
|
let msg_a = msgs
|
||||||
|
@ -105,10 +110,7 @@ fn msg() {
|
||||||
.add_flags("INBOX", &msg_b.uid.to_string(), "\\Deleted")
|
.add_flags("INBOX", &msg_b.uid.to_string(), "\\Deleted")
|
||||||
.unwrap();
|
.unwrap();
|
||||||
imap_conn.expunge("INBOX").unwrap();
|
imap_conn.expunge("INBOX").unwrap();
|
||||||
assert!(match imap_conn.list_msgs("INBOX", &10, &0) {
|
assert!(imap_conn.list_msgs("INBOX", &10, &0).unwrap().is_none());
|
||||||
Err(err) => err.to_string() == "The `INBOX` mailbox is empty",
|
|
||||||
Ok(_) => false,
|
|
||||||
});
|
|
||||||
|
|
||||||
// Logout
|
// Logout
|
||||||
imap_conn.logout();
|
imap_conn.logout();
|
||||||
|
|
2
wiki
2
wiki
|
@ -1 +1 @@
|
||||||
Subproject commit 230c6d79386947e7bf731a82492ada642100afde
|
Subproject commit c71c5474fa53632757a90831b22ee1897f394035
|
Loading…
Reference in a new issue