X-Git-Url: https://git.p6c8.net/selfforum.git/blobdiff_plain/1972da7ade862ee58c54513e0c651de07d0e11bc..cd70ccb79697cf5a16df1dda1063e0c0a36e17cb:/selfforum-cgi/shared/Posting/Handle.pm diff --git a/selfforum-cgi/shared/Posting/Handle.pm b/selfforum-cgi/shared/Posting/Handle.pm index 27c211b..11ec9aa 100644 --- a/selfforum-cgi/shared/Posting/Handle.pm +++ b/selfforum-cgi/shared/Posting/Handle.pm @@ -17,7 +17,7 @@ use base qw(Exporter); @EXPORT = qw(hide_posting recover_posting); -use Posting::_lib; +use Posting::_lib qw(get_message_node); use XML::DOM; @@ -80,9 +80,16 @@ sub change_posting_visibility($$$) my $parser = new XML::DOM::Parser; my $xml = $parser->parsefile($fname); + # Set flag in given msg my $mnode = get_message_node($xml, $tid, $mid); $mnode->setAttribute('invisible', $invisible); + # Set flag in sub nodes + for ($mnode->getElementsByTagName('Message')) + { + $_->setAttribute('invisible', $invisible); + } + $xml->printToFile($fname.'.temp'); rename $fname.'.temp', $fname; }