mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 23:39:11 -05:00
Convert to use '/r/<reddit>' syntax for messages
This commit is contained in:
@@ -1013,9 +1013,16 @@ class VMessageRecipient(VExistingUname):
|
||||
def run(self, name):
|
||||
if not name:
|
||||
return self.error()
|
||||
if name.startswith('#'):
|
||||
is_subreddit = False
|
||||
if name.startswith('/r/'):
|
||||
name = name[3:]
|
||||
is_subreddit = True
|
||||
elif name.startswith('#'):
|
||||
name = name[1:]
|
||||
is_subreddit = True
|
||||
if is_subreddit:
|
||||
try:
|
||||
s = Subreddit._by_name(name.strip('#'))
|
||||
s = Subreddit._by_name(name)
|
||||
if isinstance(s, FakeSubreddit):
|
||||
raise NotFound, "fake subreddit"
|
||||
if s._spam:
|
||||
|
||||
@@ -279,7 +279,7 @@ class Reddit(Templated):
|
||||
if total > len(moderators):
|
||||
more_text = "...and %d more" % (total - len(moderators))
|
||||
mod_href = "http://%s/about/moderators" % get_domain()
|
||||
helplink = ("/message/compose?to=%%23%s" % c.site.name,
|
||||
helplink = ("/message/compose?to=%%2Fr%%2F%s" % c.site.name,
|
||||
"message the moderators")
|
||||
ps.append(SideContentBox(_('moderators'), moderators,
|
||||
helplink = helplink,
|
||||
|
||||
@@ -77,7 +77,7 @@ ${parent.thing_css_class(what)} ${"new" if thing.new else ""} ${"was-comment" if
|
||||
%if thing.sr_id:
|
||||
<span class="correspondent reddit rounded">
|
||||
<a href="${thing.subreddit.path}message/moderator/inbox">
|
||||
#${thing.subreddit.name}
|
||||
/r/${thing.subreddit.name}
|
||||
</a>
|
||||
</span>
|
||||
%else:
|
||||
|
||||
Reference in New Issue
Block a user