diff --git a/r2/r2/controllers/api.py b/r2/r2/controllers/api.py index 6aad18272b..10cb03ca69 100644 --- a/r2/r2/controllers/api.py +++ b/r2/r2/controllers/api.py @@ -1615,9 +1615,10 @@ def POST_editusertext(self, form, jquery, item, text): return removed_mentions = None + original_text = item.body if isinstance(item, Comment): kind = 'comment' - removed_mentions = set(extract_user_mentions(item.body)) - \ + removed_mentions = set(extract_user_mentions(original_text)) - \ set(extract_user_mentions(text)) item.body = text elif isinstance(item, Link): @@ -1648,6 +1649,9 @@ def POST_editusertext(self, form, jquery, item, text): amqp.add_item('usertext_edited', item._fullname) + hooks.get_hook("thing.edit").call( + thing=item, original_text=original_text) + # new mentions are subject to more constraints, handled in butler_q if removed_mentions: queries.unnotify(item, list(Account._names_to_ids( diff --git a/r2/r2/public/static/js/ui.js b/r2/r2/public/static/js/ui.js index ef8ee761b5..b17167ff02 100644 --- a/r2/r2/public/static/js/ui.js +++ b/r2/r2/public/static/js/ui.js @@ -10,9 +10,7 @@ r.ui.init = function() { } // mobile suggest infobar - var smallScreen = window.matchMedia - ? matchMedia('(max-device-width: 700px)').matches - : $(window).width() < 700, + var smallScreen = r.ui.isSmallScreen(), onFrontPage = $.url().attr('path') == '/' if (smallScreen && onFrontPage && r.config.renderstyle != 'compact') { var infobar = $('