diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-04-25 17:10:42 +0200 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-04-25 17:10:42 +0200 |
| commit | 564fdd5bd5c600439f42b188b49b7cde90334f2d (patch) | |
| tree | d0229b8f1c3d11fe74a6a900b67be6e1fefc65ca /notmuch | |
| parent | b174ce8e5a113d30f0cd5471237d052ac7370150 (diff) | |
| download | mail-564fdd5bd5c600439f42b188b49b7cde90334f2d.tar.gz | |
thread: split matched/unmatched authors
Diffstat (limited to 'notmuch')
| -rw-r--r-- | notmuch/src/thread.rs | 8 |
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() } |
