Changeset 978a164 for perl/lib/BarnOwl/Message/Zephyr.pm
- Timestamp:
- Aug 5, 2017, 11:23:03 PM (7 years ago)
- Children:
- 7a240b5
- Parents:
- 9410677
- git-author:
- Jason Gross <jgross@mit.edu> (07/12/11 14:42:39)
- git-committer:
- Jason Gross <jgross@mit.edu> (08/05/17 23:23:03)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/lib/BarnOwl/Message/Zephyr.pm
re08487a r978a164 9 9 10 10 use base qw( BarnOwl::Message ); 11 use Unicode::Normalize qw( NFKC ); 11 12 12 13 sub strip_realm { … … 132 133 return $1 if $self->body =~ /^\s*cc:\s+([^\n]+)/i; 133 134 return undef; 135 } 136 137 sub zephyr_cc_without_recipient { 138 my $self = shift; 139 my $recipient = lc(strip_realm($self->recipient)); 140 my $cc = $self->zephyr_cc; 141 return grep { lc(strip_realm($_)) ne $recipient } split(/\s+/, $cc) if defined $cc; 142 return (); 134 143 } 135 144 … … 240 249 } 241 250 251 sub log_filenames { 252 my ($m) = @_; 253 my @filenames = (); 254 if ($m->is_personal) { 255 @filenames = $m->zephyr_cc_without_recipient; 256 } 257 if ($m->is_incoming) { 258 if ($m->is_personal) { 259 push @filenames, $m->sender; 260 } else { 261 return (lc(NFKC($m->class))); 262 } 263 } else { 264 push @filenames, $m->recipient; 265 } 266 return map { lc(NFKC(strip_realm($_))) } @filenames; 267 } 268 269 sub log_to_class_file { 270 my ($m) = @_; 271 return !$m->is_personal; 272 } 273 274 sub log_base_path { 275 my ($m) = @_; 276 if ($m->log_to_class_file) { 277 return BarnOwl::getvar('classlogpath'); 278 } else { 279 return BarnOwl::getvar('logpath'); 280 } 281 } 282 242 283 1;
Note: See TracChangeset
for help on using the changeset viewer.