Add 'link_title' for comment/post replies in API

This commit is contained in:
Chad Birch
2013-04-09 23:59:25 -06:00
parent af88ac3719
commit 886226995b

View File

@@ -495,6 +495,12 @@ class MessageJsonTemplate(ThingJsonTemplate):
return make_fullname(Message, thing.first_message)
return ThingJsonTemplate.thing_attr(self, thing, attr)
def raw_data(self, thing):
d = ThingJsonTemplate.raw_data(self, thing)
if thing.was_comment:
d['link_title'] = thing.link_title
return d
def rendered_data(self, wrapped):
from r2.models import Message
parent_id = wrapped.parent_id