config.attachment.process_links controls if we follow redirects for linkify?
$longurl_data = File_redirection::where($canon, common_config('attachments', 'process_links'));
Why does a config in the attachments namespace control if we bother to resolve redirects for linkifying notice contents? Why would you even want to disable this? In case it's really expensive, I guess. Alternatively, do we need to do this at all or could we just always put the URL the user actually put? I guess that interacts poorly with the way shortening currently works, we basically do this to re-expand our own shortened links.
This currently follows all kinds of redirects. It should probably only follow permanent redirects, and record the earliest non-permanent redirect otherwise (since a non-permanent redirect means the first URL is actually the canonical URL).