- Timestamp:
- Feb 23, 2011, 9:25:56 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- 7659079
- Parents:
- 259e0475
- git-author:
- Nelson Elhage <nelhage@mit.edu> (06/17/10 09:41:34)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (02/23/11 21:25:56)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm
rc6adf17 rfb6e8e3 260 260 } 261 261 262 sub cmp_user { 263 my ($lhs, $rhs) = @_; 264 my ($sigil_l) = ($lhs =~ m{^([+@]?)}); 265 my ($sigil_r) = ($rhs =~ m{^([+@]?)}); 266 my %rank = ('@' => 1, '+' => 2, '' => 3); 267 return ($rank{$sigil_l} <=> $rank{$sigil_r}) || 268 $lhs cmp $rhs; 269 } 270 262 271 sub on_endofnames { 263 272 my ($self, $evt) = @_; 264 273 return unless $self->names_tmp; 265 274 my $names = BarnOwl::Style::boldify("Members of " . [$evt->args]->[1] . ":\n"); 266 for my $name ( @{$self->names_tmp}) {275 for my $name (sort {cmp_user($a, $b)} @{$self->names_tmp}) { 267 276 $names .= " $name\n"; 268 277 }
Note: See TracChangeset
for help on using the changeset viewer.