Changeset fd79497 for perl/modules/Jabber
- Timestamp:
- Jul 22, 2009, 1:07:41 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 029a8b5
- Parents:
- 0bf6757
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm
r96f7b07 rfd79497 186 186 } 187 187 188 # Sort, ignoring markup. 189 sub blistSort { 190 return uc(BarnOwl::ztext_stylestrip($a)) cmp uc(BarnOwl::ztext_stylestrip($b)); 191 } 192 188 193 sub getSingleBuddyList { 189 194 my $jid = shift; … … 195 200 $blist .= "\n" . BarnOwl::Style::boldify("Jabber Roster for $jid\n"); 196 201 202 my @gTexts = (); 197 203 foreach my $group ( $roster->groups() ) { 198 $blist .= " Group: $group\n";199 204 my @buddies = $roster->jids( 'group', $group ); 205 my @bTexts = (); 200 206 foreach my $buddy ( @buddies ) { 201 $blist .= blist_listBuddy( $roster, $buddy);207 push(@bTexts, blist_listBuddy( $roster, $buddy )); 202 208 } 203 } 209 push(@gTexts, " Group: $group\n".join('',sort blistSort @bTexts)); 210 } 211 # Sort groups before adding ungrouped entries. 212 @gTexts = sort blistSort @gTexts; 204 213 205 214 my @unsorted = $roster->jids('nogroup'); 206 215 if (@unsorted) { 207 $blist .= " [unsorted]\n";216 my @bTexts = (); 208 217 foreach my $buddy (@unsorted) { 209 $blist .= blist_listBuddy( $roster, $buddy);218 push(@bTexts, blist_listBuddy( $roster, $buddy )); 210 219 } 211 } 220 push(@gTexts, " [unsorted]\n".join('',sort blistSort @bTexts)); 221 } 222 $blist .= join('', @gTexts); 212 223 } 213 224 return $blist;
Note: See TracChangeset
for help on using the changeset viewer.