Commit Graph

6109 Commits

Author SHA1 Message Date
Matt Lee
c20aef70ca Sharing: Force links to include the feature flag in the cache key. 2015-06-08 15:31:28 -07:00
Matt Lee
20bdb3bbd1 Sharing: Move feature check to view model. 2015-06-08 15:31:28 -07:00
Matt Lee
a1faad17b3 Sharing: Add the improved sharing UI.
Conflicts:
	r2/r2/public/static/css/reddit.less
2015-06-08 15:31:25 -07:00
Matt Lee
2776b306a7 ReadNext: Don't show score if score should be hidden. 2015-06-08 15:30:25 -07:00
MelissaCole
31b9c8c9c0 Fix gold infobar when not viewing self and gold expired
When pref_show_gold_expiration=True and the user doesn't have gold, the gold expiration
bar shows but is empty.
2015-06-08 11:42:51 -07:00
xiongchiamiov
457e9645db Share dialog: revamp throttling
Our throttling on the share dialog has been a bit odd.  We didn't allow you to
share more than once every `RL_RESET_MINUTES`, **unless** you have at least
`MIN_RATE_LIMIT_KARMA` in the subreddit you're sharing from.  Why was this tied
to the subreddit?  Who knows!

Rather than having a draconian limit and exempting some users from it, the rate
limits on sharing should now be at a reasonable level for everyone (and
configurable as we go with `RL_SHARE_AVG_PER_SEC`).  In addition, we're now
using the fairly new ratelimit library, which allows for burstable usage, so a
user who wants to share several things in a row but then goes back to normal
browsing is much less likely to get throttled.
2015-06-05 11:21:01 -07:00
xiongchiamiov
d945164b5d POST_share: refactor a little bit
Rather than have most of the body of the function inside an `else` block, let's
return on errors and make it a little bit flatter.
2015-06-05 11:19:03 -07:00
xiongchiamiov
98a92c975c Image previews: update censoring for nsfw variant
As we tried this out a bit, we found that the amount of pixellation we were
using wasn't really enough.  This should be better.
2015-06-04 10:58:07 -07:00
Chad Birch
869a3d2ee5 Improve the message sent for subreddit bans
This commit contains a number of improvements for the message sent to
users when they are banned from a subreddit:

* Message is different for temporary bans, and includes duration
* Includes information about being able to reply to the message, and the
  fact that circumventing a ban is considered a site rules violation
* Nicer formatting by blockquoting the note from the moderators
* Fixes the "phantom modmail notification" when someone is banned
* Refactored into separate function, which cleans up notify_user_added
2015-06-04 11:53:39 -06:00
Brian Simpson
5f38ad9079 CommentJsonTemplate: use new rendering technique.
This also changes MoreCommentJsonTemplate which was inherting from
CommentJsonTemplate.
2015-06-03 18:50:12 -04:00
Brian Simpson
e233058f07 Add new ThingTemplate base class.
This will be used to convert templates that inherit from
ThingJsonTemplate to do explicit (non looping) rendering that is
much faster.
2015-06-03 18:50:07 -04:00
Chad Birch
0236f5fd18 extract_user_mentions: return unique mentions only
This change was intended primarily to address an issue related to
duplicate username mentions - each individual mention was being counted
towards the per-comment limit, instead of it only counting mentions of
different users. So mentioning the same user 4 times in a comment would
cause butler to bail out instead of sending a mention to that user.

So this makes it so that extract_user_mentions now returns the
mentioned usernames as a set instead of a list, and also removes the
support inside the function itself for only returning up to a maximum
number of mentions. It is now up to the caller to worry about handling
the number of mentions returned (which actually simplifies things almost
everywhere this is currently being used).
2015-06-03 11:01:15 -06:00
zeantsoi
6c1b7c2093 Add query param for v on defenestration request 2015-06-02 12:12:59 -07:00
Chad Birch
909496cff3 AutoMod: don't approve things removed by mods
This was mostly already covered by the check in should_check_item that
makes AutoMod skip over items that have been removed by moderators, but
it didn't cover rules that triggered on a comment and used that to
approve the parent submission. Rules using that sort of check/action
would cause parent submissions that had previously been removed by
moderators to be re-approved, which isn't desirable.
2015-06-01 16:27:14 -06:00
Chad Birch
085ebb7f38 AutoMod: fix bug with "skipped" search checks
The variable that holds the result of attempting to match the search
check was not being reset for each individual check, so if a check was
skipped due to its fields being discarded, it would keep the same value
it had from a previous check.

In practice, this means that a check like this will not match on a link
submission to baddomain.com:

    url+body: "baddomain.com"
    ~body: "I'm an exception"

The match from the url check would still be present after the ~body
check was skipped, so this would end up causing the rule to be
considered unsatisfied, since the ~body check would seem to have matched
successfully.
2015-06-01 16:27:08 -06:00
Chris Stephens
e9d33b0d7e api: Allow multiple things to be passed to hide/unhide 2015-06-01 14:42:39 -07:00
MelissaCole
8e5a90741e Stripe: Add customer.source.updated event type
No further processing is needed for this type of event
2015-06-01 13:38:27 -07:00
xiongchiamiov
e150c1e2e9 Comment embeds: protect against empty "created" timestamp
[A BuzzFeed article][0] with a bunch of comment embeds has been causing
difficulty for the data team, since none of the embeds have the
`data-embed-created` field in the embed.

Figuring out why that's happening is another issue we should tackle, but in the
meantime, let's avoid sending a nonsense value if we don't have something
useful.

[0]: http://www.buzzfeed.com/sarahgalo/books-according-to-reddit
2015-06-01 13:28:52 -07:00
umbrae
22f64446e3 Mobile banner: only show on front page 2015-06-01 12:34:22 -07:00
umbrae
80c5dfac62 Mobile suggest: replace with mweb beta banner 2015-06-01 11:55:04 -07:00
umbrae
390e6ea962 OEmbed: provide author_url if author exists 2015-06-01 10:59:18 -07:00
xiongchiamiov
fa63e43055 Q&A sort: always show OP replies
As a few users have pointed out, it doesn't make much sense for OP replies to
be hidden in Q&A sort due to downvotes, since the entire point of the sort is
to make it easier to find what they're saying.

So now we'll override the comment score threshold for those particular comments
while in Q&A sort.
2015-06-01 10:51:39 -07:00
xiongchiamiov
f07095d9f5 scraper_q: look for og:image:url
This is another way of specifying thumbnails, and one we've even used - so we
should look for it when scraping other sites.
2015-06-01 10:36:40 -07:00
xiongchiamiov
f4cc22f8b4 Open graph: use more common image syntax
From experimentation, it appears Facebook is taking `og:image:url` as only a
suggestion (as opposed to `og:image`, which it always uses), and thus people
posting reddit links on Facebook are ending up with thumbnails from other
submissions, courtesy of the read next box.

So, let's hack it back to the way it was before reddit/reddit@9470bb87.

Also, to note, currently reddit's scraper *also* ignores `og:image:url`.  So,
yeah, there's blame to share around.
2015-05-29 12:04:56 -07:00
xiongchiamiov
86057391cd Share button: record basic stats
We'd like to know how many emails and PMs are actually getting sent by the
share system.
2015-05-28 12:22:14 -07:00
xiongchiamiov
071b5fe520 Force default og:image to https (mark 2)
Some scrapers don't like relative urls in the Open Graph tags.  We fixed this
most places in reddit/reddit@c1e2796da, but forgot one place: subreddit listing
pages.  Now they should all be good.
2015-05-28 10:44:52 -07:00
Florence Yeun
c6f9595044 Search: Backfill subreddits
For combined search, if there are no subreddit search results, backfill
with subreddit facets from the link search results.
2015-05-27 14:10:14 -07:00
Florence Yeun
c7d6c8f469 Search: Log event for search timeout
Log a simple event when there is a CloudSearch timeout or other
socket error.
2015-05-27 14:03:46 -07:00
Florence Yeun
85ecd17ea5 Fix too big error for multiple image upload forms
There was a hardcoded form id in the "413 Too Big" error response,
which was causing the error message to be rendered next to the wrong
upload form if the page contained multiple image upload forms.
2015-05-27 14:02:28 -07:00
Matt Lee
bad27475a5 Sharing: Don't include user message when formatting strings. 2015-05-26 16:09:29 -07:00
Matt Lee
93495a5f56 Keep query parameters when redirecting from toolbar endpoint. 2015-05-26 16:09:29 -07:00
Matt Lee
5d9ec8db76 Sharing: Add ref tags to links in share message. 2015-05-26 16:09:29 -07:00
Matt Lee
8b8c27222a Cleanup: Remove old button files. 2015-05-26 16:09:29 -07:00
Matt Lee
626222482e Add 'loggedin' and 'loggedout' feature flags. 2015-05-26 16:09:29 -07:00
Matt Lee
106a84aef9 Analytics: Add ref_source to list of stripped params. 2015-05-26 16:09:28 -07:00
Matt Lee
b2444da1ab Bugfix: Fix broken 'buttons' link in footer.
The 'buttons' link breaks on the /subreddits page.  Since the only place on
the page it appears to be being used it the header, just setting the
sr_path param to False looks like the easiest fix.
2015-05-26 16:01:15 -07:00
Matt Lee
1b98136268 FullContext: Fix display of vote arrows.
Conflicts:
	r2/r2/public/static/css/reddit.less
2015-05-26 16:01:15 -07:00
Matt Lee
197b1776e8 Cleanup: Remove feature flag check for 'old_markdown' feature. 2015-05-26 16:01:15 -07:00
Matt Lee
937b775294 ReadNext: Reduce number of links to 10. 2015-05-26 16:01:14 -07:00
Matt Lee
69f6c18e89 ReadNext: Make dismiss action expire after two weeks. 2015-05-26 16:01:14 -07:00
Matt Lee
f1d034789d ReadNext: Add relative position to ref tags. 2015-05-26 16:01:14 -07:00
Matt Lee
392b19a7df ReadNext: Fix incorrect selector used to find starting link. 2015-05-26 16:01:14 -07:00
Matt Lee
399dff4d6a ReadNext: Increase number of links shown to 25. 2015-05-26 16:01:14 -07:00
Matt Lee
74b405a56e ReadNext: Start on the next link after the current one. 2015-05-26 16:01:14 -07:00
Matt Lee
aae83adf84 ReadNext: Disable fixed positioning on mobile. 2015-05-26 16:01:14 -07:00
Matt Lee
d23130a772 ReadNext: Make non-selectable cross-browser. 2015-05-26 16:01:14 -07:00
Matt Lee
9d744c5cec ReadNext: Respect 'open links in new window' preference. 2015-05-26 16:01:14 -07:00
Matt Lee
820594902c ReadNext: Fix incorrect positioning on page load. 2015-05-26 16:01:14 -07:00
Matt Lee
ed843b1c0e ReadNext: Make dismiss action session based. 2015-05-26 16:01:13 -07:00
Matt Lee
7802955c2c ReadNext: Updates for beta launch.
* add ref tag to links
* add GA events.
* reduce thumbnail size to prevent cropping
* prepend title with NSFW stamp if NSFW.
* change 'also in' to 'discussions in'.
* Move nav arrows to left side.
2015-05-26 16:01:13 -07:00