aboutsummaryrefslogtreecommitdiffstats
path: root/notmuch/src/thread.rs
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-04-25 17:10:42 +0200
committerGustav Sörnäs <gustav@sornas.net>2021-04-25 17:10:42 +0200
commit564fdd5bd5c600439f42b188b49b7cde90334f2d (patch)
treed0229b8f1c3d11fe74a6a900b67be6e1fefc65ca /notmuch/src/thread.rs
parentb174ce8e5a113d30f0cd5471237d052ac7370150 (diff)
downloadmail-564fdd5bd5c600439f42b188b49b7cde90334f2d.tar.gz
thread: split matched/unmatched authors
Diffstat (limited to 'notmuch/src/thread.rs')
-rw-r--r--notmuch/src/thread.rs8
1 files changed, 6 insertions, 2 deletions
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<String> {
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()
}