mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 00:07:57 -05:00
Add hook for triggering actions upon distinguish.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user