From 564fdd5bd5c600439f42b188b49b7cde90334f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Sun, 25 Apr 2021 17:10:42 +0200 Subject: thread: split matched/unmatched authors --- notmuch/src/thread.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'notmuch') diff --git a/notmuch/src/thread.rs b/notmuch/src/thread.rs index ffc1f2f..962b17d 100644 --- a/notmuch/src/thread.rs +++ b/notmuch/src/thread.rs @@ -81,13 +81,17 @@ where sub.to_string_lossy() } + //TODO Mark matched/unmatched authors. pub fn authors(self: &Self) -> Vec { let athrs = unsafe { ffi::notmuch_thread_get_authors(self.ptr) }; + // Authors to messages that matched the query are located before the '|' + // while other authors are located after. athrs .to_string_lossy() - .split(',') - .map(|s| s.to_string()) + .split('|') + .flat_map(|s| s.split(',')) + .map(|s| s.trim().to_string()) .collect() } -- cgit v1.2.1