mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-27 07:48:16 -05:00
Add ability to distinguish between when comments have zero replies, and when their reply tree wasn't built.
This commit is contained in:
@@ -487,6 +487,11 @@ class FrontController(RedditController):
|
||||
listing = LinkListing(builder)
|
||||
pane = listing.listing()
|
||||
|
||||
# Indicate that the comment tree wasn't built for comments
|
||||
for i in pane.things:
|
||||
if hasattr(i, 'body'):
|
||||
i.child = None
|
||||
|
||||
return pane
|
||||
|
||||
def _edit_modcontrib_reddit(self, location, num, after, reverse, count, created):
|
||||
|
||||
@@ -708,7 +708,14 @@ class MessageController(ListingController):
|
||||
if (self.where == 'messages' and
|
||||
(c.user.pref_threaded_messages or self.message)):
|
||||
return Listing(self.builder_obj).listing()
|
||||
return ListingController.listing(self)
|
||||
pane = ListingController.listing(self)
|
||||
|
||||
# Indicate that the comment tree wasn't built for comments
|
||||
for i in pane.things:
|
||||
if i.was_comment:
|
||||
i.child = None
|
||||
|
||||
return pane
|
||||
|
||||
def query(self):
|
||||
if self.where == 'messages':
|
||||
|
||||
@@ -186,10 +186,15 @@ def replace_render(listing, item, render_func):
|
||||
style = style or c.render_style or 'html'
|
||||
replacements = {}
|
||||
|
||||
child_txt = ( hasattr(item, "child") and item.child )\
|
||||
and item.child.render(style = style) or ""
|
||||
replacements["childlisting"] = child_txt
|
||||
|
||||
if hasattr(item, 'child'):
|
||||
if item.child:
|
||||
replacements['childlisting'] = item.child.render(style=style)
|
||||
else:
|
||||
# Special case for when the comment tree wasn't built which
|
||||
# occurs both in the inbox and spam page view of comments.
|
||||
replacements['childlisting'] = None
|
||||
else:
|
||||
replacements['childlisting'] = ''
|
||||
|
||||
#only LinkListing has a show_nums attribute
|
||||
if listing:
|
||||
|
||||
Reference in New Issue
Block a user