blob: f5d1c3992a8004f5ea576b22fc62ffa4c910efb6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
use v6.d.PREVIEW; unit class MaildirIndexer::Email; has %!headers; has $!body; method BUILD(:%!headers,:$!body) { } method message-id { split-refs(%!headers<message-id>)[0] } method refs { return |( split-refs(%!headers<in-reply-to>), split-refs(%!headers<references>).reverse, ); } multi split-refs(Any) { return (); } multi split-refs(Str:D $str) { return $/<refs>».Str if $str ~~ m{'<' $<refs> = (<-[<>]>+)+ % [ '>' .*? '<' ] '>' }; return (); }
|