aboutsummaryrefslogtreecommitdiffstats
path: root/src/thread.rs
diff options
context:
space:
mode:
authorDirk Van Haerenborgh <vhdirk@gmail.com>2018-03-23 20:51:21 +0100
committerDirk Van Haerenborgh <vhdirk@gmail.com>2018-03-23 20:51:21 +0100
commitc522a72b61c943841da9ba8324694af8ffbce1dc (patch)
tree3e9a9c5b06ae766dd663c6762421c9a17eb633ff /src/thread.rs
parent42c5b215ddcc154d647ec268d4da044f32948227 (diff)
downloadmail-c522a72b61c943841da9ba8324694af8ffbce1dc.tar.gz
threads: oldest and newest date
Diffstat (limited to 'src/thread.rs')
-rw-r--r--src/thread.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/thread.rs b/src/thread.rs
index 2182d69..9148c44 100644
--- a/src/thread.rs
+++ b/src/thread.rs
@@ -5,6 +5,7 @@ use std::{
str,
result
};
+
use std::ffi::{CString, CStr};
use error::Result;
@@ -90,8 +91,19 @@ impl<'q, 'd> Thread<'q, 'd>{
athrs.to_str().unwrap().split(",").map(|s| s.to_string()).collect()
}
+ /// Get the date of the oldest message in 'thread' as a time_t value.
+ pub fn oldest_date(self: &Self) -> i64 {
+ unsafe {
+ ffi::notmuch_thread_get_oldest_date(self.0)
+ }
+ }
-
+ /// Get the date of the newest message in 'thread' as a time_t value.
+ pub fn newest_date(self: &Self) -> i64 {
+ unsafe {
+ ffi::notmuch_thread_get_newest_date(self.0)
+ }
+ }
}