* Make `from` search prefix more robust (addresses mastodon/mastodon#17941)
* Improve robustness for account string validation
Using unsupported prefixes now reports a 422; searching for posts from an
account the instance is not aware of reports a 404. TODO: The UI for this
on the front end is abysmal.
Searching `from:username@domain` now succeeds when `domain` is the local
domain; searching `from:@username(@domain)?` now works as expected.
* Satisfy upstream rubcocp
* Unbreak upstream tests
* Make account string validation consistent with mention processing
We previously matched on one-character domains and domains ending with
`[\.-]`, allowing `from:@a@a` and `from:@a@a-` searches to cause an
account lookup. This commit will raise a syntax error in both cases, as
MENTION_RE would never match them.
* Refactor `from` prefix error handling.
Incorporates changes suggested in #37. In doing so, adopts an error
handling style more consistent with the existing codebase (for which I
must thank @ClearlyClaire).