We were trying to link to each media item using its
`url`/`expanded_url`. But there is only one of these, shared across
all of a tweet's media items. So attempting to put it in several times,
in the same location, was a bit of a mess!
So it now only puts the `url`/`expanded_url` in once, no matter
how many media items there are.
If a tweet was a reply, then when `html_for_tweet()` tried to turn
the initial "@username" into a link, there was:
> NameError: name 'sub_expr' is not defined
This is now fixed, with a test to ensure the "@username" becomes
a link.
If a tweet has no `symbols` in its `entities` then `html_for_tweet()`
was failing.
I'm not sure how common this is but, for example, tweets in a downloaded
archive do not have `symbols` for some reason.
The previous change (b366ab5) fixed this, but I'm adding a test
for this case.
I've re-written the parts of `html_for_tweet()` so that it handles
all the replacements of URLs, mentions, symbols and hashtags better.
Mainly to fix#447 but it should be a little more robust generally.
Shamelessly cribbed from https://stackoverflow.com/a/25514650/250962
Passes all tests, but I haven't checked it beyond that.
Fixes#447
I should have checked for this earlier, ah well, 'tis here now.
Again, basically a copy of the blocking code updated for muting.
Excellent target to test it on too.
update_profile_background_image has been in endpoints.py twice for a
bit, my bad.
Using update_profile_banner_image for the function name to update
profile banner image (that's what it was called previously)