mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 23:39:11 -05:00
JSON fixes to restore the iPhone app to normal working order
This commit is contained in:
@@ -26,6 +26,7 @@ from r2 import config
|
||||
from r2.models import *
|
||||
from r2.lib.pages import *
|
||||
from r2.lib.pages.things import wrap_links
|
||||
from r2.lib.jsontemplates import is_api
|
||||
from r2.lib.menus import *
|
||||
from r2.lib.utils import to36, sanitize_url, check_cheating, title_to_url
|
||||
from r2.lib.utils import query_string, UrlParser, link_from_url, link_duplicates
|
||||
@@ -179,7 +180,8 @@ class FrontController(RedditController):
|
||||
displayPane.append(PermalinkMessage(article.make_permalink_slow()))
|
||||
|
||||
# insert reply box only for logged in user
|
||||
if c.user_is_loggedin and article.subreddit_slow.can_comment(c.user):
|
||||
if c.user_is_loggedin and article.subreddit_slow.can_comment(c.user)\
|
||||
and not is_api():
|
||||
#no comment box for permalinks
|
||||
displayPane.append(UserText(item = article, creating = True,
|
||||
post_form = 'comment',
|
||||
|
||||
@@ -116,7 +116,7 @@ class Reddit(Templated):
|
||||
if not c.cname:
|
||||
self.srtopbar = SubredditTopBar()
|
||||
|
||||
if c.user_is_loggedin and self.show_sidebar:
|
||||
if c.user_is_loggedin and self.show_sidebar and not is_api():
|
||||
self._content = PaneStack([ShareLink(), content])
|
||||
else:
|
||||
self._content = content
|
||||
@@ -450,9 +450,13 @@ class MessagePage(Reddit):
|
||||
if not kw.has_key('show_sidebar'):
|
||||
kw['show_sidebar'] = False
|
||||
Reddit.__init__(self, *a, **kw)
|
||||
self.replybox = UserText(item = None, creating = True,
|
||||
post_form = 'comment', display = False,
|
||||
cloneable = True)
|
||||
if is_api():
|
||||
self.replybox = None
|
||||
else:
|
||||
self.replybox = UserText(item = None, creating = True,
|
||||
post_form = 'comment', display = False,
|
||||
cloneable = True)
|
||||
|
||||
|
||||
def content(self):
|
||||
return self.content_stack((self.replybox,
|
||||
|
||||
Reference in New Issue
Block a user