From c0a5264023a868cb243dd8373633df0cf931cb82 Mon Sep 17 00:00:00 2001 From: Max Goodman Date: Fri, 25 Oct 2013 02:19:20 -0700 Subject: [PATCH] Add hook for triggering actions upon distinguish. --- r2/r2/controllers/api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/r2/r2/controllers/api.py b/r2/r2/controllers/api.py index 59df52e96..e951d4a75 100755 --- a/r2/r2/controllers/api.py +++ b/r2/r2/controllers/api.py @@ -39,6 +39,7 @@ from r2.models import * from r2.lib import amqp from r2.lib import recommender +from r2.lib import hooks from r2.lib.utils import get_title, sanitize_url, timeuntil, set_last_modified from r2.lib.utils import query_string, timefromnow, randstr @@ -2237,6 +2238,8 @@ class ApiController(RedditController, OAuth2ResourceController): thing.distinguished = how thing._commit() + hooks.get_hook("thing.distinguish").call(thing=thing) + wrapper = default_thing_wrapper(expand_children = True) w = wrap_links(thing, wrapper) jquery(".content").replace_things(w, True, True)