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

[dw-free] Implement v-gifts

[commit: http://hg.dwscoalition.org/dw-free/rev/690e8610d403]

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

Reverse the effect of the checkbox; logic was wrong.

Patch by [personal profile] kareila.

Files modified:
  • cgi-bin/DW/Setting/AllowVgiftsFrom.pm
--------------------------------------------------------------------------------
diff -r 8b4914e597b4 -r 690e8610d403 cgi-bin/DW/Setting/AllowVgiftsFrom.pm
--- a/cgi-bin/DW/Setting/AllowVgiftsFrom.pm	Fri Oct 29 19:36:06 2010 +0800
+++ b/cgi-bin/DW/Setting/AllowVgiftsFrom.pm	Sat Oct 30 11:45:56 2010 +0800
@@ -38,7 +38,7 @@ sub option {
     my $allowed = $class->get_arg( $args, "allowvgiftsfrom" )
                || $u->prop( 'opt_allowvgiftsfrom' ) || 'all';
     my $anonopt = $class->get_arg( $args, "anonvgift_optout" )
-               || $u->prop( 'opt_anonvgift_optout' ) || 0;
+               || ! $u->prop( 'opt_anonvgift_optout' );
 
     my %menu_items = (
         all         => [ qw( all a ) ],
@@ -79,7 +79,6 @@ sub option {
 
     $ret .= "<br />\n";
     # anonymous optout
-    $ret .= '&nbsp;';
     $ret .= LJ::html_check( { name => "${key}anonvgift_optout",
                               id   => "${key}anonvgift_optout",
                               label => $class->ml( 'setting.allowvgiftsfrom.anon' ),
@@ -105,7 +104,7 @@ sub save {
     my $anonopt = $class->get_arg( $args, "anonvgift_optout" );
 
     $u->set_prop( 'opt_allowvgiftsfrom' => $allowed ) if $allowed;
-    $u->set_prop( 'opt_anonvgift_optout' => $anonopt ? 1 : 0 );
+    $u->set_prop( 'opt_anonvgift_optout' => $anonopt ? 0 : 1 );
 
     return 1;
 }
--------------------------------------------------------------------------------