aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk Van Haerenborgh <vhdirk@gmail.com>2018-12-17 18:37:01 +0100
committerDirk Van Haerenborgh <vhdirk@gmail.com>2018-12-17 18:37:01 +0100
commite5a7acf1a0ced9b9d5ccfef79c46579f359fac94 (patch)
tree6baf056863df0e7bef1a5ff7cbdd34a5b6f0f99e
parentd74e6fee5dc34e8015f4d9699b5624d7a60a3c8a (diff)
downloadmail-e5a7acf1a0ced9b9d5ccfef79c46579f359fac94.tar.gz
messages may depend on thread, not just query. But never on other messages
-rw-r--r--src/message.rs29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/message.rs b/src/message.rs
index 8cc7af2..bf46a4e 100644
--- a/src/message.rs
+++ b/src/message.rs
@@ -35,7 +35,7 @@ impl<'o, O> Message<'o, O>
where
O: MessageOwner + 'o,
{
- pub fn from_ptr<P>(ptr: *mut ffi::notmuch_message_t, owner: P) -> Message<'o, O>
+ pub(crate) fn from_ptr<P>(ptr: *mut ffi::notmuch_message_t, owner: P) -> Message<'o, O>
where
P: Into<ScopedPhantomcow<'o, O>>,
{
@@ -55,8 +55,11 @@ where
tid.to_str().unwrap().to_string()
}
- pub fn replies(self: &Self) -> Messages<Self> {
- <Self as MessageExt<'o, O>>::replies(self)
+ pub fn replies(self: &mut Self) -> Messages<'o, O> {
+ Messages::<'o, O>::from_ptr(
+ unsafe { ffi::notmuch_message_get_replies(self.handle.ptr) },
+ ScopedPhantomcow::<'o, O>::share(&mut self.marker)
+ )
}
#[cfg(feature = "v0_26")]
@@ -127,16 +130,16 @@ where
)
}
- fn replies<'s, S>(message: S) -> Messages<'s, Message<'o, O>>
- where
- S: Into<ScopedSupercow<'s, Message<'o, O>>>,
- {
- let messageref = message.into();
- Messages::from_ptr(
- unsafe { ffi::notmuch_message_get_replies(messageref.handle.ptr) },
- Supercow::phantom(messageref),
- )
- }
+ // fn replies<'s, S>(message: S) -> Messages<'s, Message<'o, O>>
+ // where
+ // S: Into<ScopedSupercow<'s, Message<'o, O>>>,
+ // {
+ // let messageref = message.into();
+ // Messages::from_ptr(
+ // unsafe { ffi::notmuch_message_get_replies(messageref.handle.ptr) },
+ // Supercow::phantom(messageref),
+ // )
+ // }
fn filenames<'s, S>(message: S) -> Filenames<'s, Message<'o, O>>
where