fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-08-28 07:53 am

[dw-free] clean up error logs

[commit: http://hg.dwscoalition.org/dw-free/rev/4601594f5a34]

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

Refactor.

Patch by [personal profile] kareila.

Files modified:
  • cgi-bin/DW/Logic/UserLinkBar.pm
--------------------------------------------------------------------------------
diff -r 8c33e8a914f5 -r 4601594f5a34 cgi-bin/DW/Logic/UserLinkBar.pm
--- a/cgi-bin/DW/Logic/UserLinkBar.pm	Sat Aug 28 14:11:23 2010 +0800
+++ b/cgi-bin/DW/Logic/UserLinkBar.pm	Sat Aug 28 15:53:09 2010 +0800
@@ -150,14 +150,15 @@ sub manage_membership {
         # if logged out, OR, not a member
         } else {
             my @comm_settings = LJ::get_comm_settings($u);
+            my $closed = ( $comm_settings[0] && $comm_settings[0] eq 'closed' ) ? 1 : 0;
 
             my $link = {
                 text_ml => 'userlinkbar.joincomm',
             };
 
             # if they're not allowed to join at this moment (many reasons)
-            if ($comm_settings[0] eq 'closed' || !$remote || !$u->is_visible) {
-                $link->{title_ml} = $comm_settings[0] eq 'closed' ?
+            if ( $closed || !$remote || !$u->is_visible ) {
+                $link->{title_ml} = $closed ?
                                         'userlinkbar.joincomm.title.closed' :
                                         'userlinkbar.joincomm.title.loggedout';
                 $link->{image}    = 'community_join_disabled.png';
--------------------------------------------------------------------------------