Changeset d2ba33c for perl/lib/BarnOwl/Message/Zephyr.pm
- Timestamp:
- Aug 16, 2017, 12:53:41 PM (7 years ago)
- Branches:
- master
- Children:
- 5dee79a
- Parents:
- 47225c9
- git-author:
- Jason Gross <jgross@mit.edu> (01/01/14 20:59:51)
- git-committer:
- Jason Gross <jasongross9@gmail.com> (08/16/17 12:53:41)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/lib/BarnOwl/Message/Zephyr.pm
rdce72c1 rd2ba33c 9 9 10 10 use base qw( BarnOwl::Message ); 11 use Unicode::Normalize qw( NFKC );12 11 13 12 sub strip_realm { … … 22 21 my ($user, $realm) = split(/@/,$principal); 23 22 return $realm; 23 } 24 25 sub casefold_principal { 26 my $principal = shift; 27 # split the principal right after the final @, without eating any 28 # characters; this way, we always get at least '@' in $user 29 my ($user, $realm) = split(/(?<=@)(?=[^@]+$)/, $principal); 30 return lc($user) . uc($realm); 24 31 } 25 32 … … 261 268 my $realm = ''; 262 269 $realm .= '@' . $m->realm if $m->realm ne BarnOwl::zephyr_getrealm(); 263 return ( lc(NFKC($m->class)) . $realm);270 return (BarnOwl::compat_casefold($m->class) . uc($realm)); 264 271 } 265 272 } else { 266 273 push @filenames, $m->recipient; 267 274 } 268 return map { lc(NFKC(BarnOwl::zephyr_smartstrip_user(strip_realm($_)))) } @filenames;275 return map { casefold_principal(BarnOwl::zephyr_smartstrip_user(strip_realm($_))) } @filenames; 269 276 } 270 277
Note: See TracChangeset
for help on using the changeset viewer.