fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-05-03 03:19 am

[dw-free] Move manage/subscriptions/user.bml to use "tracking"

[commit: http://hg.dwscoalition.org/dw-free/rev/61e82aece0c1]

http://bugs.dwscoalition.org/show_bug.cgi?id=2718

Move files over; edit redirects and URLs. /manage/subscriptions/user(or
comment or entry) now goes to /manage/tracking/...
/manage/subscriptions/filters is still in the same place.
/manage/subscriptions/ now points to /manage/subscriptions/filters

Patch by [personal profile] ninetydegrees.

Files modified:
  • bin/upgrading/en.dat
  • bin/upgrading/s2layers/siteviews/layout.s2
  • cgi-bin/DW/Logic/UserLinkBar.pm
  • cgi-bin/LJ/NotificationMethod/Email.pm
  • cgi-bin/LJ/S2.pm
  • cgi-bin/LJ/Talk.pm
  • cgi-bin/LJ/Widget/FriendUpdates.pm
  • cgi-bin/redirect.dat
  • cgi-bin/weblib.pl
  • htdocs/community/manage.bml
  • htdocs/inbox/index.bml
  • htdocs/manage/index.bml
  • htdocs/manage/subscriptions/comments.bml
  • htdocs/manage/subscriptions/comments.bml.text
  • htdocs/manage/subscriptions/entry.bml
  • htdocs/manage/subscriptions/user.bml
  • htdocs/manage/tracking/comments.bml
  • htdocs/manage/tracking/comments.bml.text
  • htdocs/manage/tracking/entry.bml
  • htdocs/manage/tracking/user.bml
  • htdocs/profile.bml
  • htdocs/talkread.bml
--------------------------------------------------------------------------------
diff -r 4cf824f91dc2 -r 61e82aece0c1 bin/upgrading/en.dat
--- a/bin/upgrading/en.dat	Mon May 02 21:13:34 2011 +0800
+++ b/bin/upgrading/en.dat	Tue May 03 11:18:42 2011 +0800
@@ -1099,13 +1099,13 @@ Or you can:
 Or you can:
 .
 
-esn.footer.text<<
+esn.footer.text2<<
 --
 [[sitenameshort]] Team
 [[sitename]]
 [[hook]]
 
-If you'd rather not get these updates, you can change your preferences at [[siteroot]]/manage/subscriptions/
+If you'd rather not get these updates, you can change your preferences at [[siteroot]]/manage/settings/?cat=notifications
 .
 
 esn.here_you_can=From here you can:
diff -r 4cf824f91dc2 -r 61e82aece0c1 bin/upgrading/s2layers/siteviews/layout.s2
--- a/bin/upgrading/s2layers/siteviews/layout.s2	Mon May 02 21:13:34 2011 +0800
+++ b/bin/upgrading/s2layers/siteviews/layout.s2	Tue May 03 11:18:42 2011 +0800
@@ -73,7 +73,7 @@ function IconsPage::print_body() {
         if ( $.can_manage ) {
             """Would you like to <a href="$*SITEROOT/editpics">upload a new icon or edit your icon keywords, comments, and descriptions</a>?""";
         } else {
-            """We can <a href="$*SITEROOT/manage/subscriptions/user?journal=$.journal.username">notify</a> you when this account uploads a new one.""";
+            """We can <a href="$*SITEROOT/manage/tracking/user?journal=$.journal.username">notify</a> you when this account uploads a new one.""";
         }
         """</p><p>""";
         var int sort_ct = 0;
diff -r 4cf824f91dc2 -r 61e82aece0c1 cgi-bin/DW/Logic/UserLinkBar.pm
--- a/cgi-bin/DW/Logic/UserLinkBar.pm	Mon May 02 21:13:34 2011 +0800
+++ b/cgi-bin/DW/Logic/UserLinkBar.pm	Tue May 03 11:18:42 2011 +0800
@@ -351,7 +351,7 @@ sub track {
         }
 
         if ( $remote && $remote->can_use_esn ) {
-            $link->{url} = "manage/subscriptions/user?journal=$user";
+            $link->{url} = "manage/tracking/user?journal=$user";
             $link->{class} = "trackuser";
             $link->{image} = 'track.png';
         } else {
diff -r 4cf824f91dc2 -r 61e82aece0c1 cgi-bin/LJ/NotificationMethod/Email.pm
--- a/cgi-bin/LJ/NotificationMethod/Email.pm	Mon May 02 21:13:34 2011 +0800
+++ b/cgi-bin/LJ/NotificationMethod/Email.pm	Tue May 03 11:18:42 2011 +0800
@@ -81,7 +81,7 @@ sub notify {
         croak "invalid event passed" unless ref $ev;
 
         $vars->{'hook'} = LJ::Hooks::run_hook("esn_email_footer", $ev, $u);
-        my $footer = LJ::Lang::get_text($lang, 'esn.footer.text', undef, $vars);
+        my $footer = LJ::Lang::get_text($lang, 'esn.footer.text2', undef, $vars);
 
         my $plain_body = LJ::Hooks::run_hook("esn_email_plaintext", $ev, $u);
         unless ($plain_body) {
diff -r 4cf824f91dc2 -r 61e82aece0c1 cgi-bin/LJ/S2.pm
--- a/cgi-bin/LJ/S2.pm	Mon May 02 21:13:34 2011 +0800
+++ b/cgi-bin/LJ/S2.pm	Tue May 03 11:18:42 2011 +0800
@@ -3251,7 +3251,7 @@ sub _Comment__get_link
 
             my $etypeid = 'LJ::Event::JournalNewComment'->etypeid;
 
-            return LJ::S2::Link( "$LJ::SITEROOT/manage/subscriptions/comments?journal=$u->{'user'}&amp;talkid=" . $comment->dtalkid,
+            return LJ::S2::Link( "$LJ::SITEROOT/manage/tracking/comments?journal=$u->{'user'}&amp;talkid=" . $comment->dtalkid,
                                 $ctx->[S2::PROPS]->{"text_multiform_opt_untrack"},
                                 LJ::S2::Image_std( 'untrack' ),
                                 'lj_etypeid'    => $etypeid,
@@ -3308,12 +3308,12 @@ sub _Comment__get_link
         $btn_params{'js_swapname'}   = $ctx->[S2::PROPS]->{text_multiform_opt_untrack};
 
         if ($key eq "watch_thread" && !$watching_parent) {
-            return LJ::S2::Link( "$LJ::SITEROOT/manage/subscriptions/comments?journal=$u->{'user'}&amp;talkid=$dtalkid",
+            return LJ::S2::Link( "$LJ::SITEROOT/manage/tracking/comments?journal=$u->{'user'}&amp;talkid=$dtalkid",
                                 $ctx->[S2::PROPS]->{"text_multiform_opt_track"},
                                 LJ::S2::Image_std( 'track' ), %btn_params );
         }
         if ($key eq "watching_parent" && $watching_parent) {
-            return LJ::S2::Link( "$LJ::SITEROOT/manage/subscriptions/comments?journal=$u->{'user'}&amp;talkid=$dtalkid",
+            return LJ::S2::Link( "$LJ::SITEROOT/manage/tracking/comments?journal=$u->{'user'}&amp;talkid=$dtalkid",
                                 $ctx->[S2::PROPS]->{"text_multiform_opt_track"},
                                 LJ::S2::Image_std( 'untrack' ), %btn_params );
         }
@@ -3901,7 +3901,7 @@ sub _Entry__get_link
                                                    arg1      => $this->{itemid},
                                                    );
 
-        return LJ::S2::Link( "$LJ::SITEROOT/manage/subscriptions/entry?journal=$journal&amp;itemid=$this->{'itemid'}",
+        return LJ::S2::Link( "$LJ::SITEROOT/manage/tracking/entry?journal=$journal&amp;itemid=$this->{'itemid'}",
                             $ctx->[S2::PROPS]->{"text_watch_comments"},
                             LJ::S2::Image_std( 'track' ),
                             'lj_journalid'        => $journalu->id,
@@ -3933,7 +3933,7 @@ sub _Entry__get_link
                                                    subid  => $subscr->id,
                                                    action => 'delsub' );
 
-        return LJ::S2::Link( "$LJ::SITEROOT/manage/subscriptions/entry?journal=$journal&amp;itemid=$this->{'itemid'}",
+        return LJ::S2::Link( "$LJ::SITEROOT/manage/tracking/entry?journal=$journal&amp;itemid=$this->{'itemid'}",
                             $ctx->[S2::PROPS]->{"text_unwatch_comments"},
                             LJ::S2::Image_std( 'untrack' ),
                             'lj_journalid'        => $journalu->id,
diff -r 4cf824f91dc2 -r 61e82aece0c1 cgi-bin/LJ/Talk.pm
--- a/cgi-bin/LJ/Talk.pm	Mon May 02 21:13:34 2011 +0800
+++ b/cgi-bin/LJ/Talk.pm	Tue May 03 11:18:42 2011 +0800
@@ -166,7 +166,7 @@ sub link_bar
     if ($remote && $remote->can_use_esn) {
         my $img_key = $remote->has_subscription(journal => $u, event => "JournalNewComment", arg1 => $itemid, require_active => 1) ?
             "track_active" : "track";
-        push @linkele, $mlink->("$LJ::SITEROOT/manage/subscriptions/entry?${jargent}itemid=$itemid", $img_key);
+        push @linkele, $mlink->("$LJ::SITEROOT/manage/tracking/entry?${jargent}itemid=$itemid", $img_key);
     }
 
 
diff -r 4cf824f91dc2 -r 61e82aece0c1 cgi-bin/LJ/Widget/FriendUpdates.pm
--- a/cgi-bin/LJ/Widget/FriendUpdates.pm	Mon May 02 21:13:34 2011 +0800
+++ b/cgi-bin/LJ/Widget/FriendUpdates.pm	Tue May 03 11:18:42 2011 +0800
@@ -47,7 +47,7 @@ sub render_body {
 
     unless (@notifications) {
         $ret .= $class->ml('widget.friendupdates.noupdates');
-        $ret .= "<p class='detail'>" . $class->ml('widget.friendupdates.noupdates.setup', {'aopts' => "href='$LJ::SITEROOT/manage/subscriptions/'"}) . "</p>";
+        $ret .= "<p class='detail'>" . $class->ml('widget.friendupdates.noupdates.setup', {'aopts' => "href='$LJ::SITEROOT/manage/settings/?cat=notifications'"}) . "</p>";
         return $ret;
     }
 
diff -r 4cf824f91dc2 -r 61e82aece0c1 cgi-bin/redirect.dat
--- a/cgi-bin/redirect.dat	Mon May 02 21:13:34 2011 +0800
+++ b/cgi-bin/redirect.dat	Tue May 03 11:18:42 2011 +0800
@@ -39,9 +39,9 @@
 /manage/comments                    /manage/settings/?cat=privacy
 /manage/comments/                   /manage/settings/?cat=privacy
 /manage/comments/index.bml          /manage/settings/?cat=privacy
-/manage/subscriptions               /manage/settings/?cat=notifications
-/manage/subscriptions/              /manage/settings/?cat=notifications
-/manage/subscriptions/index.bml     /manage/settings/?cat=notifications
+/manage/subscriptions               /manage/subscriptions/filters
+/manage/subscriptions/              /manage/subscriptions/filters
+/manage/subscriptions/index.bml     /manage/subscriptions/filters
 /mobile/friends.bml                 /mobile/read
 /misc/import                        /tools/importer
 /misc/import.bml                    /tools/importer
diff -r 4cf824f91dc2 -r 61e82aece0c1 cgi-bin/weblib.pl
--- a/cgi-bin/weblib.pl	Mon May 02 21:13:34 2011 +0800
+++ b/cgi-bin/weblib.pl	Tue May 03 11:18:42 2011 +0800
@@ -2757,7 +2757,7 @@ sub control_strip
         $links{'view_friends_page'} = "<a href='" . $remote->journal_base . "/read'>$BML::ML{'web.controlstrip.links.viewreadingpage'}</a>";
         $links{'add_friend'} = "<a href='$LJ::SITEROOT/manage/circle/add?user=$journal->{user}'>$BML::ML{'web.controlstrip.links.addtocircle'}</a>";
         $links{'edit_friend'} = "<a href='$LJ::SITEROOT/manage/circle/add?user=$journal->{user}'>$BML::ML{'web.controlstrip.links.modifycircle'}</a>";
-        $links{'track_user'} = "<a href='$LJ::SITEROOT/manage/subscriptions/user?journal=$journal->{user}'>$BML::ML{'web.controlstrip.links.trackuser'}</a>";
+        $links{'track_user'} = "<a href='$LJ::SITEROOT/manage/tracking/user?journal=$journal->{user}'>$BML::ML{'web.controlstrip.links.trackuser'}</a>";
         if ($journal->is_syndicated ) {
             $links{'add_friend'} = "<a href='$LJ::SITEROOT/manage/circle/add?user=$journal->{user}&action=subscribe'>$BML::ML{'web.controlstrip.links.addfeed'}</a>";
             $links{'remove_friend'} = "<a href='$LJ::SITEROOT/manage/circle/add?user=$journal->{user}&action=remove'>$BML::ML{'web.controlstrip.links.removefeed'}</a>";
@@ -2772,7 +2772,7 @@ sub control_strip
             $links{'edit_community_profile'} = "<a href='$LJ::SITEROOT/manage/profile/?authas=$journal->{user}'>$BML::ML{'web.controlstrip.links.editcommprofile'}</a>";
             $links{'edit_community_invites'} = "<a href='$LJ::SITEROOT/community/sentinvites?authas=$journal->{user}'>$BML::ML{'web.controlstrip.links.managecomminvites'}</a>";
             $links{'edit_community_members'} = "<a href='$LJ::SITEROOT/community/members?authas=$journal->{user}'>$BML::ML{'web.controlstrip.links.editcommmembers'}</a>";
-            $links{'track_community'} = "<a href='$LJ::SITEROOT/manage/subscriptions/user?journal=$journal->{user}'>$BML::ML{'web.controlstrip.links.trackcomm'}</a>";
+            $links{'track_community'} = "<a href='$LJ::SITEROOT/manage/tracking/user?journal=$journal->{user}'>$BML::ML{'web.controlstrip.links.trackcomm'}</a>";
             $links{'queue'} = "<a href='$LJ::SITEROOT/community/moderate?authas=$journal->{user}'>$BML::ML{'web.controlstrip.links.queue'}</a>";
         }
     }
@@ -3276,7 +3276,7 @@ sub subscribe_interface {
     if ($post_to_settings_page) {
         $ret .= "<form method='POST' action='$LJ::SITEROOT/manage/settings/?cat=notifications'>$formauth";
     } elsif (!$settings_page) {
-        $ret .= "<form method='POST' action='$LJ::SITEROOT/manage/subscriptions/$getextra'>$formauth";
+        $ret .= "<form method='POST' action='$LJ::SITEROOT/manage/tracking/$getextra'>$formauth";
     }
 
     my $events_table = $settings_page ? '<table class="Subscribe" style="clear: none;" cellpadding="0" cellspacing="0">' : '<table class="Subscribe" cellpadding="0" cellspacing="0">';
diff -r 4cf824f91dc2 -r 61e82aece0c1 htdocs/community/manage.bml
--- a/htdocs/community/manage.bml	Mon May 02 21:13:34 2011 +0800
+++ b/htdocs/community/manage.bml	Tue May 03 11:18:42 2011 +0800
@@ -135,7 +135,7 @@ body<=
                $ret .= BML::ml('Actionlink', {
                    'link'=>"<a href='/manage/tags?authas=$user'>$ML{'.commlist.tags'}</a>"}) . "&nbsp;&nbsp;";
                $ret .= BML::ml('Actionlink', {
-                   'link'=>"<a href='/manage/subscriptions/user?journal=$user'>$ML{'.commlist.tracking'}</a>"}) . "&nbsp;&nbsp;";
+                   'link'=>"<a href='/manage/tracking/user?journal=$user'>$ML{'.commlist.tracking'}</a>"}) . "&nbsp;&nbsp;";
            }
            $ret .= "</td><td align='center'>";
            if ($mods{$id}) {
@@ -175,7 +175,7 @@ body<=
     $ret .= "<div class='columns-2-left'>\n";
     # form for setting email option
     $ret .= "<?h1 $ML{'.joinmail.title'} h1?>\n";
-    $ret .= "<?p " . BML::ml('.joinmail.body2', { aopts=>"href='$LJ::SITEROOT/manage/subscriptions/'" }). " p?>\n";
+    $ret .= "<?p " . BML::ml('.joinmail.body2', { aopts=>"href='$LJ::SITEROOT/manage/settings/?cat=notifications'" }). " p?>\n";
     $ret .= "<form method='post' action='manage'>\n";
     $ret .= LJ::form_auth();
     # options for getting moderation emails
diff -r 4cf824f91dc2 -r 61e82aece0c1 htdocs/inbox/index.bml
--- a/htdocs/inbox/index.bml	Mon May 02 21:13:34 2011 +0800
+++ b/htdocs/inbox/index.bml	Tue May 03 11:18:42 2011 +0800
@@ -149,7 +149,7 @@ body<=
         <td id="table_inbox_messages" valign="top" style="padding-left: 10px; width: 100%;">
             <div class="inbox_newitems pkg">
                 <span class="esnlinks" style="float: left"><a href="$LJ::SITEROOT/inbox/?page=$page$viewarg$itemidarg" id="RefreshLink"><?_ml inbox.refresh _ml?></a> |
-                    <a href="$LJ::SITEROOT/manage/subscriptions/"><?_ml inbox.manage_settings _ml?></a></span>
+                    <a href="$LJ::SITEROOT/manage/settings/?cat=notifications"><?_ml inbox.manage_settings _ml?></a></span>
             </div>
 
     };
@@ -189,7 +189,7 @@ body<=
     $body .= qq{
             <div class="inbox_newitems pkg">
                 <span class="esnlinks" style="float: left"><a href="$LJ::SITEROOT/inbox/?page=$page$viewarg$itemidarg"><?_ml inbox.refresh _ml?></a> |
-                    <a href="$LJ::SITEROOT/manage/subscriptions/"><?_ml inbox.manage_settings _ml?></a></span>
+                    <a href="$LJ::SITEROOT/manage/settings/?cat=notifications"><?_ml inbox.manage_settings _ml?></a></span>
             </div>
     } if $itemcount > 10;
 
diff -r 4cf824f91dc2 -r 61e82aece0c1 htdocs/manage/index.bml
--- a/htdocs/manage/index.bml	Mon May 02 21:13:34 2011 +0800
+++ b/htdocs/manage/index.bml	Tue May 03 11:18:42 2011 +0800
@@ -147,7 +147,7 @@ _code?>
     my $remote = LJ::get_remote();
 
     if ($remote && $remote->can_use_esn) {
-        return '<li><a href="/manage/subscriptions/" title="<?_ml .manage.notifications.about _ml?>"><?_ml .manage.notifications _ml?></a></li>';
+        return '<li><a href="/manage/settings/?cat=notifications" title="<?_ml .manage.notifications.about _ml?>"><?_ml .manage.notifications _ml?></a></li>';
     } else {
         return '';
     }
diff -r 4cf824f91dc2 -r 61e82aece0c1 htdocs/manage/subscriptions/comments.bml
--- a/htdocs/manage/subscriptions/comments.bml	Mon May 02 21:13:34 2011 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-<?_c
-# This code was forked from the LiveJournal project owned and operated
-# by Live Journal, Inc. The code has been modified and expanded by
-# Dreamwidth Studios, LLC. These files were originally licensed under
-# the terms of the license supplied by Live Journal, Inc, which can
-# currently be found at:
-#
-# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
-#
-# In accordance with the original license, this code and all its
-# modifications are provided under the GNU General Public License.
-# A copy of that license can be found in the LICENSE file included as
-# part of this distribution.
-_c?>
-<?page
-body<=
-<?_code
-{
-    use strict;
-    use vars qw (%POST %GET $body $title $headextra @errors);
-    use Carp qw(croak);
-    use LJ::Subscription;
-    use LJ::NotificationMethod;
-    use LJ::Event;
-    use LJ::Comment;
-
-    $title = 'Manage Message Settings';
-
-    return "Not ready" unless LJ::is_enabled('esn');
-
-    BML::decl_params(
-                     lj_form_auth => qr/./,
-                     journal      => 'word',
-                     dtalkid     => 'digits',
-                     ditemid     => 'digits',
-                     talkid      => 'digits',
-                     itemid      => 'digits',
-                     );
-
-    my $remote = LJ::get_remote();
-    return "<?needlogin?>" unless $remote;
-
-    my $ditemid = $POST{'itemid'} || $GET{'itemid'} || $POST{'ditemid'} || $GET{'ditemid'};
-    my $dtalkid = $POST{'talkid'} || $GET{'talkid'} || $POST{'dtalkid'} || $POST{'dtalkid'};
-    my $journal = $POST{'journal'} || $GET{'journal'};
-
-    return LJ::error_list( "No journal specified" ) unless $journal;
-    $journal = LJ::load_user($journal) or return LJ::error_list("Invalid journal '$journal'");
-
-    return LJ::error_list("No talkid specified") unless $dtalkid;
-
-    my $comment = LJ::Comment->new($journal, dtalkid => $dtalkid);
-
-    return LJ::error_list("Invalid comment") unless $comment && $comment->visible_to($remote);
-    return LJ::error_list("This comment has been deleted.") if $comment->is_deleted;
-
-    my $entry = $comment->entry;
-    $ditemid ||= $entry->ditemid;
-
-    my $thread_sub = LJ::Subscription::Pending->new(
-                                                    $remote,
-                                                    journal          => $journal,
-                                                    event            => 'JournalNewComment',
-                                                    arg2             => $comment && $comment->jtalkid,
-                                                    default_selected => 1,
-                                                    flags            => LJ::Subscription::TRACKING,
-                                                    );
-
-    my $can_watch = $thread_sub->available_for_user;
-
-    push @errors, $ML{'.error.threads'}
-        unless $can_watch;
-
-    my @pending = $thread_sub;
-
-    push @pending, LJ::Subscription::Pending->new(
-                                                  $remote,
-                                                  journal => $journal,
-                                                  event   => 'JournalNewComment',
-                                                  arg1    => $ditemid,
-                                                  # select by default only if they can't watch the subthread above
-                                                  default_selected => $can_watch ? 0 : 1,
-                                                  flags   => LJ::Subscription::TRACKING,
-                                                  );
-
-    push @pending,
-        LJ::Subscription::Pending->new(
-                                       $remote,
-                                       event   => "JournalNewComment",
-                                       journal => $journal,
-                                       flags   => LJ::Subscription::TRACKING,
-                                       ) if $remote->can_track_all_community_comments ( $journal );
-
-    my $categories = [ { 'Track Comments' => [ @pending ] } ];
-
-    my $referer = BML::get_client_header('Referer');
-    my ( $style ) = ( $referer =~ /\b(style=\w+)/ );
-    $style = LJ::viewing_style_args( split( /=/, $style ) );
-
-    return LJ::subscribe_interface(
-                                   $remote,
-                                   categories => $categories,
-                                   journal => $journal,
-                                   ret_url => ($can_watch ? $comment->url( $style ) : $entry->url . "?$style" ),
-                                   default_selected_notifications => ['LJ::NotificationMethod::Email'],
-                                   post_to_settings_page => 1,
-                                   );
-
-}
-_code?>
-<=body
-title=><?_code return $title; _code?>
-head<=
-<style type='text/css'>
-</style>
-<?_code return $headextra; _code?>
-<=head
-<=body
-page?>
-
diff -r 4cf824f91dc2 -r 61e82aece0c1 htdocs/manage/subscriptions/comments.bml.text
--- a/htdocs/manage/subscriptions/comments.bml.text	Mon May 02 21:13:34 2011 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-;; -*- coding: utf-8 -*-
-.error.threads=Your account level doesn't allow watching threads, but you can watch the entire entry by clicking below.
-
diff -r 4cf824f91dc2 -r 61e82aece0c1 htdocs/manage/subscriptions/entry.bml
--- a/htdocs/manage/subscriptions/entry.bml	Mon May 02 21:13:34 2011 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-<?_c
-# This code was forked from the LiveJournal project owned and operated
-# by Live Journal, Inc. The code has been modified and expanded by
-# Dreamwidth Studios, LLC. These files were originally licensed under
-# the terms of the license supplied by Live Journal, Inc, which can
-# currently be found at:
-#
-# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
-#
-# In accordance with the original license, this code and all its
-# modifications are provided under the GNU General Public License.
-# A copy of that license can be found in the LICENSE file included as
-# part of this distribution.
-_c?>
-<?page
-body<=
-<?_code
-{
-    use strict;
-    use vars qw (%POST %GET $body $title $headextra);
-    use Carp qw(croak);
-    use LJ::NotificationMethod;
-    use LJ::Event;
-
-    $title = 'Manage Message Settings';
-
-    return "Not ready" unless LJ::is_enabled('esn');
-
-    BML::decl_params(
-                     lj_form_auth => qr/./,
-                     journal      => 'word',
-                     ditemid     => 'digits',
-                     itemid      => 'digits',
-                     );
-
-    my $remote = LJ::get_remote();
-    return "<?needlogin?>" unless $remote;
-
-    my $ditemid = $POST{'itemid'} || $GET{'itemid'} || $POST{'ditemid'} || $GET{'ditemid'};
-    my $journal = $POST{'journal'} || $GET{'journal'};
-    my $ntypeid = int($POST{'ntypeid'});
-
-    return LJ::error_list( "No journal specified" ) unless $journal;
-    $journal = LJ::load_user($journal) or return LJ::error_list("Invalid journal '$journal'");
-
-    return LJ::error_list("No entry specified") unless $ditemid;
-
-    my $entry = LJ::Entry->new($journal, ditemid => $ditemid);
-
-    return LJ::error_list("Invalid entry") unless $entry && $entry->valid;
-    return LJ::error_list("You are not authorized to subscribe to this entry.") unless $entry->visible_to($remote);
-
-    my $cat_title = 'Track Entry';
-    my $categories =
-        [
-            { $cat_title =>
-                [
-                    LJ::Subscription::Pending->new( $remote,
-                        event   => "JournalNewComment",
-                        arg1    => $ditemid,
-                        journal => $journal,
-                        default_selected => 1,
-                        flags   => LJ::Subscription::TRACKING,
-                    ),
-
-                    LJ::Subscription::Pending->new( $remote,
-                        event   => "JournalNewComment::TopLevel",
-                        arg1    => $ditemid,
-                        journal => $journal,
-                        default_selected => 0,
-                        flags   => LJ::Subscription::TRACKING,
-                    ),
-                ],
-            }
-        ];
-
-    push @{ @$categories[0]->{$cat_title} },
-        LJ::Subscription::Pending->new( $remote,
-            event   => "JournalNewComment",
-            journal => $journal,
-            flags   => LJ::Subscription::TRACKING,
-        ) if $remote->can_track_all_community_comments( $journal );
-
-    push @{ @$categories[0]->{$cat_title} },
-        LJ::Subscription::Pending->new( $remote,
-            event   => "JournalNewEntry",
-            arg1    => '?',
-            journal => $journal,
-            entry   => $entry,
-            flags   => LJ::Subscription::TRACKING,
-        ),
-        LJ::Subscription::Pending->new( $remote,
-            event   => "JournalNewEntry",
-            journal => $journal,
-            flags   => LJ::Subscription::TRACKING,
-        );
-
-    my $referer = BML::get_client_header('Referer');
-    my ( $style ) = ( $referer =~ /\b(style=\w+)/ );
-    $style = LJ::viewing_style_args( split( /=/, $style ) );
-
-    $body .= LJ::subscribe_interface( $remote,
-                 journal      => $journal,
-                 categories   => $categories,
-                 ret_url      => $entry->url . "?$style",
-                 default_selected_notifications => ['LJ::NotificationMethod::Email'],
-                 post_to_settings_page => 1,
-             );
-
-    return $body;
-}
-_code?>
-<=body
-title=><?_code return $title; _code?>
-head<=
-<style type='text/css'>
-</style>
-<?_code return $headextra; _code?>
-<=head
-<=body
-page?>
-
diff -r 4cf824f91dc2 -r 61e82aece0c1 htdocs/manage/subscriptions/user.bml
--- a/htdocs/manage/subscriptions/user.bml	Mon May 02 21:13:34 2011 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-<?_c
-# This code was forked from the LiveJournal project owned and operated
-# by Live Journal, Inc. The code has been modified and expanded by
-# Dreamwidth Studios, LLC. These files were originally licensed under
-# the terms of the license supplied by Live Journal, Inc, which can
-# currently be found at:
-#
-# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
-#
-# In accordance with the original license, this code and all its
-# modifications are provided under the GNU General Public License.
-# A copy of that license can be found in the LICENSE file included as
-# part of this distribution.
-_c?>
-<?page
-body<=
-<?_code
-{
-    use strict;
-    use vars qw (%POST %GET $body $title $headextra);
-    use Carp qw(croak);
-    use LJ::NotificationMethod;
-    use LJ::Event;
-
-    $title = 'Manage Message Settings';
-
-    return "Not ready" unless LJ::is_enabled('esn');
-
-    BML::decl_params(
-                     lj_form_auth => qr/./,
-                     journal      => 'word',
-                     _default     => qr/./,
-                     );
-
-    my $remote = LJ::get_remote();
-    return "<?needlogin?>" unless $remote;
-
-    my $journal = LJ::load_user($GET{journal}) or return LJ::bad_input("No journal specified");
-
-    return BML::redirect("$LJ::SITEROOT/manage/subscriptions/") if $remote->equals( $journal );
-
-    # what classes to display on this page
-    my $cat_title = 'Track User';
-    my $categories =
-        [
-            { $cat_title =>
-                [
-                    LJ::Subscription::Pending->new( $remote,
-                        event   => "JournalNewEntry",
-                        arg1    => '?',
-                        journal => $journal,
-                        flags   => LJ::Subscription::TRACKING,
-                    ),
-                    LJ::Subscription::Pending->new( $remote,
-                        event   => "JournalNewEntry",
-                        journal => $journal,
-                        flags   => LJ::Subscription::TRACKING,
-                    ),
-                ]
-            },
-        ];
-
-    push @{ @$categories[0]->{$cat_title} },
-        LJ::Subscription::Pending->new( $remote,
-            event   => "UserExpunged",
-            journal => $journal,
-            flags   => LJ::Subscription::TRACKING,
-        ) unless LJ::User->is_protected_username( $journal->user );
-
-    push @{ @$categories[0]->{$cat_title} },
-        LJ::Subscription::Pending->new( $remote,
-            event   => "JournalNewComment",
-            journal => $journal,
-            flags   => LJ::Subscription::TRACKING,
-        ) if $remote->can_track_all_community_comments( $journal );
-    
-    push @{ @$categories[0]->{$cat_title} },
-        LJ::Subscription::Pending->new( $remote,
-            event    => "NewUserpic",
-            journal  => $journal,
-            flags    => LJ::Subscription::TRACKING,
-            disabled => ! $remote->can_track_new_userpic,
-        ),
-        LJ::Subscription::Pending->new( $remote,
-            event   => "Birthday",
-            journal => $journal,
-            flags   => LJ::Subscription::TRACKING,
-        );
-
-    # validate referer for ret_url
-    my $referer = BML::get_client_header('Referer');
-    $referer = $LJ::SITEROOT . $referer if $referer =~ /^\//;
-    if ( DW::Controller::validate_redirect_url( $referer ) ) {
-        # validate args
-        my ( $url, $args ) = ( $referer =~ /^(.*)\?(.*)$/ );
-        if ( $url && $args ) {
-            my %args = map { split( /=/, $_ ) } split( /&/, $args );
-            $args = LJ::viewing_style_args( %args );
-            $referer = $args ? "$url?$args" : $url;
-        }
-    } else {
-        $referer = undef;  # invalid redirect
-    }
-
-    return LJ::subscribe_interface( $remote,
-        categories => $categories,
-        journal    => $journal,
-        ret_url    => $referer,
-        post_to_settings_page => 1,
-    );
-
-}
-_code?>
-<=body
-title=><?_code return $title; _code?>
-head<=
-<?_code return $headextra; _code?>
-<=head
-<=body
-page?>
-
diff -r 4cf824f91dc2 -r 61e82aece0c1 htdocs/manage/tracking/comments.bml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htdocs/manage/tracking/comments.bml	Tue May 03 11:18:42 2011 +0800
@@ -0,0 +1,120 @@
+<?_c
+# This code was forked from the LiveJournal project owned and operated
+# by Live Journal, Inc. The code has been modified and expanded by
+# Dreamwidth Studios, LLC. These files were originally licensed under
+# the terms of the license supplied by Live Journal, Inc, which can
+# currently be found at:
+#
+# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
+#
+# In accordance with the original license, this code and all its
+# modifications are provided under the GNU General Public License.
+# A copy of that license can be found in the LICENSE file included as
+# part of this distribution.
+_c?>
+<?page
+body<=
+<?_code
+{
+    use strict;
+    use vars qw (%POST %GET $body $title $headextra @errors);
+    use Carp qw(croak);
+    use LJ::Subscription;
+    use LJ::NotificationMethod;
+    use LJ::Event;
+    use LJ::Comment;
+
+    $title = 'Manage Message Settings';
+
+    return "Not ready" unless LJ::is_enabled('esn');
+
+    BML::decl_params(
+                     lj_form_auth => qr/./,
+                     journal      => 'word',
+                     dtalkid     => 'digits',
+                     ditemid     => 'digits',
+                     talkid      => 'digits',
+                     itemid      => 'digits',
+                     );
+
+    my $remote = LJ::get_remote();
+    return "<?needlogin?>" unless $remote;
+
+    my $ditemid = $POST{'itemid'} || $GET{'itemid'} || $POST{'ditemid'} || $GET{'ditemid'};
+    my $dtalkid = $POST{'talkid'} || $GET{'talkid'} || $POST{'dtalkid'} || $POST{'dtalkid'};
+    my $journal = $POST{'journal'} || $GET{'journal'};
+
+    return LJ::error_list( "No journal specified" ) unless $journal;
+    $journal = LJ::load_user($journal) or return LJ::error_list("Invalid journal '$journal'");
+
+    return LJ::error_list("No talkid specified") unless $dtalkid;
+
+    my $comment = LJ::Comment->new($journal, dtalkid => $dtalkid);
+
+    return LJ::error_list("Invalid comment") unless $comment && $comment->visible_to($remote);
+    return LJ::error_list("This comment has been deleted.") if $comment->is_deleted;
+
+    my $entry = $comment->entry;
+    $ditemid ||= $entry->ditemid;
+
+    my $thread_sub = LJ::Subscription::Pending->new(
+                                                    $remote,
+                                                    journal          => $journal,
+                                                    event            => 'JournalNewComment',
+                                                    arg2             => $comment && $comment->jtalkid,
+                                                    default_selected => 1,
+                                                    flags            => LJ::Subscription::TRACKING,
+                                                    );
+
+    my $can_watch = $thread_sub->available_for_user;
+
+    push @errors, $ML{'.error.threads'}
+        unless $can_watch;
+
+    my @pending = $thread_sub;
+
+    push @pending, LJ::Subscription::Pending->new(
+                                                  $remote,
+                                                  journal => $journal,
+                                                  event   => 'JournalNewComment',
+                                                  arg1    => $ditemid,
+                                                  # select by default only if they can't watch the subthread above
+                                                  default_selected => $can_watch ? 0 : 1,
+                                                  flags   => LJ::Subscription::TRACKING,
+                                                  );
+
+    push @pending,
+        LJ::Subscription::Pending->new(
+                                       $remote,
+                                       event   => "JournalNewComment",
+                                       journal => $journal,
+                                       flags   => LJ::Subscription::TRACKING,
+                                       ) if $remote->can_track_all_community_comments ( $journal );
+
+    my $categories = [ { 'Track Comments' => [ @pending ] } ];
+
+    my $referer = BML::get_client_header('Referer');
+    my ( $style ) = ( $referer =~ /\b(style=\w+)/ );
+    $style = LJ::viewing_style_args( split( /=/, $style ) );
+
+    return LJ::subscribe_interface(
+                                   $remote,
+                                   categories => $categories,
+                                   journal => $journal,
+                                   ret_url => ($can_watch ? $comment->url( $style ) : $entry->url . "?$style" ),
+                                   default_selected_notifications => ['LJ::NotificationMethod::Email'],
+                                   post_to_settings_page => 1,
+                                   );
+
+}
+_code?>
+<=body
+title=><?_code return $title; _code?>
+head<=
+<style type='text/css'>
+</style>
+<?_code return $headextra; _code?>
+<=head
+<=body
+page?>
+
diff -r 4cf824f91dc2 -r 61e82aece0c1 htdocs/manage/tracking/comments.bml.text
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htdocs/manage/tracking/comments.bml.text	Tue May 03 11:18:42 2011 +0800
@@ -0,0 +1,3 @@
+;; -*- coding: utf-8 -*-
+.error.threads=Your account level doesn't allow watching threads, but you can watch the entire entry by clicking below.
+
diff -r 4cf824f91dc2 -r 61e82aece0c1 htdocs/manage/tracking/entry.bml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htdocs/manage/tracking/entry.bml	Tue May 03 11:18:42 2011 +0800
@@ -0,0 +1,122 @@
+<?_c
+# This code was forked from the LiveJournal project owned and operated
+# by Live Journal, Inc. The code has been modified and expanded by
+# Dreamwidth Studios, LLC. These files were originally licensed under
+# the terms of the license supplied by Live Journal, Inc, which can
+# currently be found at:
+#
+# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
+#
+# In accordance with the original license, this code and all its
+# modifications are provided under the GNU General Public License.
+# A copy of that license can be found in the LICENSE file included as
+# part of this distribution.
+_c?>
+<?page
+body<=
+<?_code
+{
+    use strict;
+    use vars qw (%POST %GET $body $title $headextra);
+    use Carp qw(croak);
+    use LJ::NotificationMethod;
+    use LJ::Event;
+
+    $title = 'Manage Message Settings';
+
+    return "Not ready" unless LJ::is_enabled('esn');
+
+    BML::decl_params(
+                     lj_form_auth => qr/./,
+                     journal      => 'word',
+                     ditemid     => 'digits',
+                     itemid      => 'digits',
+                     );
+
+    my $remote = LJ::get_remote();
+    return "<?needlogin?>" unless $remote;
+
+    my $ditemid = $POST{'itemid'} || $GET{'itemid'} || $POST{'ditemid'} || $GET{'ditemid'};
+    my $journal = $POST{'journal'} || $GET{'journal'};
+    my $ntypeid = int($POST{'ntypeid'});
+
+    return LJ::error_list( "No journal specified" ) unless $journal;
+    $journal = LJ::load_user($journal) or return LJ::error_list("Invalid journal '$journal'");
+
+    return LJ::error_list("No entry specified") unless $ditemid;
+
+    my $entry = LJ::Entry->new($journal, ditemid => $ditemid);
+
+    return LJ::error_list("Invalid entry") unless $entry && $entry->valid;
+    return LJ::error_list("You are not authorized to subscribe to this entry.") unless $entry->visible_to($remote);
+
+    my $cat_title = 'Track Entry';
+    my $categories =
+        [
+            { $cat_title =>
+                [
+                    LJ::Subscription::Pending->new( $remote,
+                        event   => "JournalNewComment",
+                        arg1    => $ditemid,
+                        journal => $journal,
+                        default_selected => 1,
+                        flags   => LJ::Subscription::TRACKING,
+                    ),
+
+                    LJ::Subscription::Pending->new( $remote,
+                        event   => "JournalNewComment::TopLevel",
+                        arg1    => $ditemid,
+                        journal => $journal,
+                        default_selected => 0,
+                        flags   => LJ::Subscription::TRACKING,
+                    ),
+                ],
+            }
+        ];
+
+    push @{ @$categories[0]->{$cat_title} },
+        LJ::Subscription::Pending->new( $remote,
+            event   => "JournalNewComment",
+            journal => $journal,
+            flags   => LJ::Subscription::TRACKING,
+        ) if $remote->can_track_all_community_comments( $journal );
+
+    push @{ @$categories[0]->{$cat_title} },
+        LJ::Subscription::Pending->new( $remote,
+            event   => "JournalNewEntry",
+            arg1    => '?',
+            journal => $journal,
+            entry   => $entry,
+            flags   => LJ::Subscription::TRACKING,
+        ),
+        LJ::Subscription::Pending->new( $remote,
+            event   => "JournalNewEntry",
+            journal => $journal,
+            flags   => LJ::Subscription::TRACKING,
+        );
+
+    my $referer = BML::get_client_header('Referer');
+    my ( $style ) = ( $referer =~ /\b(style=\w+)/ );
+    $style = LJ::viewing_style_args( split( /=/, $style ) );
+
+    $body .= LJ::subscribe_interface( $remote,
+                 journal      => $journal,
+                 categories   => $categories,
+                 ret_url      => $entry->url . "?$style",
+                 default_selected_notifications => ['LJ::NotificationMethod::Email'],
+                 post_to_settings_page => 1,
+             );
+
+    return $body;
+}
+_code?>
+<=body
+title=><?_code return $title; _code?>
+head<=
+<style type='text/css'>
+</style>
+<?_code return $headextra; _code?>
+<=head
+<=body
+page?>
+
diff -r 4cf824f91dc2 -r 61e82aece0c1 htdocs/manage/tracking/user.bml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htdocs/manage/tracking/user.bml	Tue May 03 11:18:42 2011 +0800
@@ -0,0 +1,121 @@
+<?_c
+# This code was forked from the LiveJournal project owned and operated
+# by Live Journal, Inc. The code has been modified and expanded by
+# Dreamwidth Studios, LLC. These files were originally licensed under
+# the terms of the license supplied by Live Journal, Inc, which can
+# currently be found at:
+#
+# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
+#
+# In accordance with the original license, this code and all its
+# modifications are provided under the GNU General Public License.
+# A copy of that license can be found in the LICENSE file included as
+# part of this distribution.
+_c?>
+<?page
+body<=
+<?_code
+{
+    use strict;
+    use vars qw (%POST %GET $body $title $headextra);
+    use Carp qw(croak);
+    use LJ::NotificationMethod;
+    use LJ::Event;
+
+    $title = 'Manage Message Settings';
+
+    return "Not ready" unless LJ::is_enabled('esn');
+
+    BML::decl_params(
+                     lj_form_auth => qr/./,
+                     journal      => 'word',
+                     _default     => qr/./,
+                     );
+
+    my $remote = LJ::get_remote();
+    return "<?needlogin?>" unless $remote;
+
+    my $journal = LJ::load_user($GET{journal}) or return LJ::bad_input("No journal specified");
+
+    return BML::redirect("$LJ::SITEROOT/manage/settings/?cat=notifications") if $remote->equals( $journal );
+
+    # what classes to display on this page
+    my $cat_title = 'Track User';
+    my $categories =
+        [
+            { $cat_title =>
+                [
+                    LJ::Subscription::Pending->new( $remote,
+                        event   => "JournalNewEntry",
+                        arg1    => '?',
+                        journal => $journal,
+                        flags   => LJ::Subscription::TRACKING,
+                    ),
+                    LJ::Subscription::Pending->new( $remote,
+                        event   => "JournalNewEntry",
+                        journal => $journal,
+                        flags   => LJ::Subscription::TRACKING,
+                    ),
+                ]
+            },
+        ];
+
+    push @{ @$categories[0]->{$cat_title} },
+        LJ::Subscription::Pending->new( $remote,
+            event   => "UserExpunged",
+            journal => $journal,
+            flags   => LJ::Subscription::TRACKING,
+        ) unless LJ::User->is_protected_username( $journal->user );
+
+    push @{ @$categories[0]->{$cat_title} },
+        LJ::Subscription::Pending->new( $remote,
+            event   => "JournalNewComment",
+            journal => $journal,
+            flags   => LJ::Subscription::TRACKING,
+        ) if $remote->can_track_all_community_comments( $journal );
+    
+    push @{ @$categories[0]->{$cat_title} },
+        LJ::Subscription::Pending->new( $remote,
+            event    => "NewUserpic",
+            journal  => $journal,
+            flags    => LJ::Subscription::TRACKING,
+            disabled => ! $remote->can_track_new_userpic,
+        ),
+        LJ::Subscription::Pending->new( $remote,
+            event   => "Birthday",
+            journal => $journal,
+            flags   => LJ::Subscription::TRACKING,
+        );
+
+    # validate referer for ret_url
+    my $referer = BML::get_client_header('Referer');
+    $referer = $LJ::SITEROOT . $referer if $referer =~ /^\//;
+    if ( DW::Controller::validate_redirect_url( $referer ) ) {
+        # validate args
+        my ( $url, $args ) = ( $referer =~ /^(.*)\?(.*)$/ );
+        if ( $url && $args ) {
+            my %args = map { split( /=/, $_ ) } split( /&/, $args );
+            $args = LJ::viewing_style_args( %args );
+            $referer = $args ? "$url?$args" : $url;
+        }
+    } else {
+        $referer = undef;  # invalid redirect
+    }
+
+    return LJ::subscribe_interface( $remote,
+        categories => $categories,
+        journal    => $journal,
+        ret_url    => $referer,
+        post_to_settings_page => 1,
+    );
+
+}
+_code?>
+<=body
+title=><?_code return $title; _code?>
+head<=
+<?_code return $headextra; _code?>
+<=head
+<=body
+page?>
+
diff -r 4cf824f91dc2 -r 61e82aece0c1 htdocs/profile.bml
--- a/htdocs/profile.bml	Mon May 02 21:13:34 2011 +0800
+++ b/htdocs/profile.bml	Tue May 03 11:18:42 2011 +0800
@@ -149,7 +149,7 @@ body<=
             $del_body .= "&nbsp;" . BML::ml( 'error.deleted.leavecomm', { aopts => "href='$LJ::SITEROOT/community/leave?comm=" . $u->user . "'" } ) if $u->is_community && $u->trusts_or_has_member( $remote );
 
             $del_body .= " p?>";
-            $del_body .= BML::ml( '.error.deleted.purgenotification', { aopts => "href='$LJ::SITEROOT/manage/subscriptions/user?journal=" . $u->user . "'" } )
+            $del_body .= BML::ml( '.error.deleted.purgenotification', { aopts => "href='$LJ::SITEROOT/manage/tracking/user?journal=" . $u->user . "'" } )
                 unless LJ::User->is_protected_username( $u->user );
             return $del_body;
         }
diff -r 4cf824f91dc2 -r 61e82aece0c1 htdocs/talkread.bml
--- a/htdocs/talkread.bml	Mon May 02 21:13:34 2011 +0800
+++ b/htdocs/talkread.bml	Tue May 03 11:18:42 2011 +0800
@@ -557,7 +557,7 @@ body<=
                         }
                     }
 
-                    my $track_url = "$LJ::SITEROOT/manage/subscriptions/comments?journal=$u->{'user'}&amp;talkid=$dtid";
+                    my $track_url = "$LJ::SITEROOT/manage/tracking/comments?journal=$u->{'user'}&amp;talkid=$dtid";
                     $ret .= "<a href='$track_url'>" . LJ::img($track_img, '', {'align' => 'absmiddle'}) . "</a>";
                 }
 
--------------------------------------------------------------------------------