File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ sub RecentPage {
223223
224224 $opts -> {cut_disable } = ( $remote && $remote -> prop(' opt_cut_disable_journal' ) );
225225
226- my $sticky_entries = $ u-> sticky_entries_lookup ;
226+ my $sticky_entries = { map { $_ => 1 } $ u-> sticky_entry_active_ids } ;
227227
228228ENTRY:
229229 foreach my $item (@items ) {
Original file line number Diff line number Diff line change @@ -1411,13 +1411,23 @@ sub sticky_entries {
14111411 return @entries ;
14121412}
14131413
1414- # returns a list of sticky entry ids
1414+ # returns a list of all sticky entry ids
14151415sub sticky_entry_ids {
14161416 my $prop = $_ [0]-> prop(' sticky_entry' );
14171417 return unless defined $prop ;
14181418 return split /,/, $prop ;
14191419}
14201420
1421+ # returns a list of active sticky entry ids
1422+ sub sticky_entry_active_ids {
1423+ my ($u ) = @_ ;
1424+ my $max = $u -> count_max_stickies || 0;
1425+ my @ids = $u -> sticky_entry_ids;
1426+ return unless @ids ;
1427+ @ids = @ids [ 0 .. $max - 1 ] if scalar @ids > $max ;
1428+ return @ids ;
1429+ }
1430+
14211431# returns a map of ditemid => 1 of the sticky entries
14221432sub sticky_entries_lookup {
14231433 return { map { $_ => 1 } $_ [0]-> sticky_entry_ids };
You can’t perform that action at this time.
0 commit comments