Committer: ailyin
LJSUP-8985 (nctalklinks disappeared)U trunk/cgi-bin/LJ/S2/FriendsPage.pm U trunk/cgi-bin/ljviews.pl
Modified: trunk/cgi-bin/LJ/S2/FriendsPage.pm =================================================================== --- trunk/cgi-bin/LJ/S2/FriendsPage.pm 2011-06-03 07:32:25 UTC (rev 19220) +++ trunk/cgi-bin/LJ/S2/FriendsPage.pm 2011-06-03 07:46:20 UTC (rev 19221) @@ -251,16 +251,21 @@ my $ditemid = $itemid * 256 + $item->{'anum'}; my $entry_obj = LJ::Entry->new($friends{$friendid}, ditemid => $ditemid); - my %urlopts; + my %urlopts_style; if ( $remote && $remote->{'opt_stylemine'} && $remote->{'userid'} != $friendid ) { - $urlopts{'style'} = 'mine'; + $urlopts_style{'style'} = 'mine'; } + my %urlopts_nc; + if ( if $replycount && $remote && $remote->{'opt_nctalklinks'} ) { + $urlopts_nc{'nc'} .= $replycount; + } + my $suspend_msg = $entry_obj && $entry_obj->should_show_suspend_msg_to($remote) ? 1 : 0; LJ::CleanHTML::clean_event(\$text, { 'preformatted' => $logprops{$datakey}->{'opt_preformatted'}, - 'cuturl' => $entry_obj->prop('reposted_from') || $entry_obj->url(%urlopts), + 'cuturl' => $entry_obj->prop('reposted_from') || $entry_obj->url(%urlopts_style), 'entry_url' => $entry_obj->prop('reposted_from') || $entry_obj->url, 'maximgwidth' => $maximgwidth, 'maximgheight' => $maximgheight, @@ -322,13 +327,10 @@ $picid = $eobj->userpic ? $eobj->userpic->picid : 0; } - my $nc = ""; - $nc .= "nc=$replycount" if $replycount && $remote && $remote->{'opt_nctalklinks'}; - my $journalbase = LJ::journal_base($friends{$friendid}); my $permalink = $eobj->url; - my $readurl = $eobj->url( %urlopts ); - my $posturl = $eobj->url( %urlopts, 'mode' => 'reply' ); + my $readurl = $eobj->url( %urlopts_style, %urlopts_nc ); + my $posturl = $eobj->url( %urlopts_style, 'mode' => 'reply' ); my $comments = CommentInfo({ 'read_url' => $readurl, Modified: trunk/cgi-bin/ljviews.pl =================================================================== --- trunk/cgi-bin/ljviews.pl 2011-06-03 07:32:25 UTC (rev 19220) +++ trunk/cgi-bin/ljviews.pl 2011-06-03 07:46:20 UTC (rev 19221) @@ -1867,16 +1867,16 @@ my $itemargs = "journal=$friend&itemid=$ditemid"; $friends_event{'itemargs'} = $itemargs; - my %urlopts; + my %urlopts_style; if ( $remote && $remote->{'opt_stylemine'} && $remote->{'userid'} != $friendid ) { - $urlopts{'style'} = 'mine'; + $urlopts_style{'style'} = 'mine'; } my $suspend_msg = $entry_obj && $entry_obj->should_show_suspend_msg_to($remote) ? 1 : 0; LJ::CleanHTML::clean_event(\$event, { 'preformatted' => $logprops{$datakey}->{'opt_preformatted'}, - 'cuturl' => $entry_obj->prop('reposted_from') || $entry_obj->url(%urlopts), + 'cuturl' => $entry_obj->prop('reposted_from') || $entry_obj->url(%urlopts_style), 'entry_url' => $entry_obj->prop('reposted_from') || $entry_obj->url, 'maximgwidth' => $maximgwidth, 'maximgheight' => $maximgheight, @@ -1948,11 +1948,13 @@ my $dispreadlink = $replycount || ($logprops{$datakey}->{'hasscreened'} && $remote && $remote->can_manage($friendid)); - my $nc = ""; - $nc .= "nc=$replycount" if $replycount && $remote && $remote->{'opt_nctalklinks'}; + my %urlopts_nc; + if ( $replycount && $remote && $remote->{'opt_nctalklinks'} ) { + $urlopts_nc{'nc'} = $replycount; + } - my $readurl = $entry_obj->url(%urlopts); - my $posturl = $entry_obj->url( %urlopts, 'mode' => 'reply' ); + my $readurl = $entry_obj->url( %urlopts_style, %urlopts_nc ); + my $posturl = $entry_obj->url( %urlopts_style, 'mode' => 'reply' ); $friends_event{'talklinks'} = LJ::fill_var_props($vars, 'FRIENDS_TALK_LINKS', { 'itemid' => $ditemid,