Skip to content

Commit

Permalink
Support "in:public" search filter (mastodon#26976)
Browse files Browse the repository at this point in the history
  • Loading branch information
tribela authored Oct 17, 2023
1 parent 2528a07 commit ad44d83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Search extends PureComponent {
{ label: <><mark>before:</mark> <FormattedMessage id='search_popout.specific_date' defaultMessage='specific date' /></>, action: e => { e.preventDefault(); this._insertText('before:'); } },
{ label: <><mark>during:</mark> <FormattedMessage id='search_popout.specific_date' defaultMessage='specific date' /></>, action: e => { e.preventDefault(); this._insertText('during:'); } },
{ label: <><mark>after:</mark> <FormattedMessage id='search_popout.specific_date' defaultMessage='specific date' /></>, action: e => { e.preventDefault(); this._insertText('after:'); } },
{ label: <><mark>in:</mark> <FormattedList type='disjunction' value={['all', 'library']} /></>, action: e => { e.preventDefault(); this._insertText('in:'); } }
{ label: <><mark>in:</mark> <FormattedList type='disjunction' value={['all', 'library', 'public']} /></>, action: e => { e.preventDefault(); this._insertText('in:'); } }
];

setRef = c => {
Expand Down
2 changes: 2 additions & 0 deletions app/lib/search_query_transformer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def indexes
case @flags['in']
when 'library'
[StatusesIndex]
when 'public'
[PublicStatusesIndex]
else
[PublicStatusesIndex, StatusesIndex]
end
Expand Down

0 comments on commit ad44d83

Please sign in to comment.