Changeset 1357

Show
Ignore:
Timestamp:
02/12/08 02:39:11 (5 months ago)
Author:
mpaschal
Message:

Watch the sum total of visibility changes across the lifetime of a comment instance, not just what happened the last time we called visible()
Forget visibility changes once the comment was saved
BugzID: 66909

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-29/lib/MT/Comment.pm

    r1174 r1357  
    268268    $comment->junk_log(join "\n", @{$comment->{__junk_log}}) 
    269269        if ref $comment->{__junk_log} eq 'ARRAY'; 
    270     $comment->SUPER::save(); 
     270    my $ret = $comment->SUPER::save(); 
     271    delete $comment->{__changed}{visibility} if $ret; 
     272    return $ret; 
    271273} 
    272274 
     
    323325        $vis_delta = -1; 
    324326    } 
    325     $comment->{__changed}{visibility} = $vis_delta; 
     327    $comment->{__changed}{visibility} ||= 0; 
     328    $comment->{__changed}{visibility} += $vis_delta; 
    326329 
    327330    return $comment->SUPER::visible($is_visible);