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-04 12:44 am

[dw-free] rename @LJ::INITIAL_FRIENDS

[commit: http://hg.dwscoalition.org/dw-free/rev/7331658fe761]

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

Rename variable.

Patch by [personal profile] kareila.

Files modified:
  • cgi-bin/DW/Logic/LogItems.pm
  • cgi-bin/DW/User/Edges/WatchTrust.pm
  • cgi-bin/LJ/ConfCheck/General.pm
  • cgi-bin/LJ/User.pm
  • cgi-bin/LJ/Userpic.pm
  • etc/config.pl
--------------------------------------------------------------------------------
diff -r 5899499b8c7a -r 7331658fe761 cgi-bin/DW/Logic/LogItems.pm
--- a/cgi-bin/DW/Logic/LogItems.pm	Mon Oct 04 08:24:37 2010 +0800
+++ b/cgi-bin/DW/Logic/LogItems.pm	Mon Oct 04 08:43:41 2010 +0800
@@ -44,7 +44,7 @@ sub watch_items
     $u = LJ::want_user( $u ) or confess 'invalid user object';
 
     # bail very, very early for accounts that are too big for a reading page
-    return () if $LJ::FORCE_EMPTY_FRIENDS{$u->id};
+    return () if $LJ::FORCE_EMPTY_SUBSCRIPTIONS{$u->id};
 
     # not sure where best to do this, so we're doing it here: don't allow
     # content filters for community reading pages.
diff -r 5899499b8c7a -r 7331658fe761 cgi-bin/DW/User/Edges/WatchTrust.pm
--- a/cgi-bin/DW/User/Edges/WatchTrust.pm	Mon Oct 04 08:24:37 2010 +0800
+++ b/cgi-bin/DW/User/Edges/WatchTrust.pm	Mon Oct 04 08:43:41 2010 +0800
@@ -581,7 +581,7 @@ sub trust_list {
 
     # special case, we can disable loading friends for a user if there is a site
     # problem or some other issue with this codebranch
-    return undef if $LJ::FORCE_EMPTY_FRIENDS{ $u->id };
+    return undef if $LJ::FORCE_EMPTY_SUBSCRIPTIONS{ $u->id };
 
     # attempt memcache if allowed
     unless ( $db_only ) {
@@ -627,7 +627,7 @@ sub trust_group_members {
 
     # special case, we can disable loading friends for a user if there is a site
     # problem or some other issue with this codebranch
-    return undef if $LJ::FORCE_EMPTY_FRIENDS{ $u->id };
+    return undef if $LJ::FORCE_EMPTY_SUBSCRIPTIONS{ $u->id };
 
     # load the user's groups
     my $grp = $u->trust_groups( id => $id, name => $name );
@@ -674,7 +674,7 @@ sub watch_list {
 
     # special case, we can disable loading friends for a user if there is a site
     # problem or some other issue with this codebranch
-    return undef if $LJ::FORCE_EMPTY_FRIENDS{ $u->id };
+    return undef if $LJ::FORCE_EMPTY_SUBSCRIPTIONS{ $u->id };
 
     # attempt memcache if allowed
     unless ( $db_only ) {
diff -r 5899499b8c7a -r 7331658fe761 cgi-bin/LJ/ConfCheck/General.pm
--- a/cgi-bin/LJ/ConfCheck/General.pm	Mon Oct 04 08:24:37 2010 +0800
+++ b/cgi-bin/LJ/ConfCheck/General.pm	Mon Oct 04 08:43:41 2010 +0800
@@ -460,7 +460,7 @@ add_conf('%COMMON_CODE',
 add_conf('%COMMON_CODE',
          type => '',
          des => "");
-add_conf('%FORCE_EMPTY_FRIENDS',
+add_conf('%FORCE_EMPTY_SUBSCRIPTIONS',
          type => '',
          des => "");
 add_conf('@CLEANUP_HANDLERS',
@@ -583,7 +583,7 @@ add_conf('%HELP_URL',
 add_conf('%HELP_URL',
          type => '',
          des => "");
-add_conf('@INITIAL_FRIENDS',
+add_conf('@INITIAL_SUBSCRIPTIONS',
          type => '',
          des => "");
 add_conf('%DBCACHE',
@@ -631,7 +631,7 @@ add_conf('@RBL_LIST',
 add_conf('@RBL_LIST',
          type => '',
          des => "");
-add_conf('@INITIAL_OPTOUT_FRIENDS',
+add_conf('@INITIAL_OPTOUT_SUBSCRIPTIONS',
          type => '',
          des => "");
 add_conf('%CAP_DEF',
@@ -643,7 +643,7 @@ add_conf('%HELPURL',
 add_conf('%HELPURL',
          type => '',
          des => "");
-add_conf('@INITIAL_OPTIONAL_FRIENDS',
+add_conf('@INITIAL_OPTIONAL_SUBSCRIPTIONS',
          type => '',
          des => "");
 add_conf('%FILEEDIT_VIA_DB',
diff -r 5899499b8c7a -r 7331658fe761 cgi-bin/LJ/User.pm
--- a/cgi-bin/LJ/User.pm	Mon Oct 04 08:24:37 2010 +0800
+++ b/cgi-bin/LJ/User.pm	Mon Oct 04 08:43:41 2010 +0800
@@ -239,12 +239,11 @@ sub create_personal {
             }
         }
     }
-    # if we have initial friends for new accounts, add them.
-    # FIXME(mark): INITIAL_FRIENDS should be moved/renamed.
-    foreach my $friend ( @LJ::INITIAL_FRIENDS ) {
-        my $friendid = LJ::get_userid( $friend )
+    # if we have initial subscriptions for new accounts, add them.
+    foreach my $user ( @LJ::INITIAL_SUBSCRIPTIONS ) {
+        my $userid = LJ::get_userid( $user )
             or next;
-        $u->add_edge( $friendid, watch => {} );
+        $u->add_edge( $userid, watch => {} );
     }
 
     # apply any paid time that this account should get
diff -r 5899499b8c7a -r 7331658fe761 cgi-bin/LJ/Userpic.pm
--- a/cgi-bin/LJ/Userpic.pm	Mon Oct 04 08:24:37 2010 +0800
+++ b/cgi-bin/LJ/Userpic.pm	Mon Oct 04 08:43:41 2010 +0800
@@ -1043,7 +1043,7 @@ sub set_keywords {
     my $dbh;
 
     if ( $have_mapid ) {
-        $sth = $u->prepare( "SELECT kwid FROM userpicmap3 WHERE userid=? AND picid=? AND kwid NOT NULL" );
+        $sth = $u->prepare( "SELECT kwid FROM userpicmap3 WHERE userid=? AND picid=? AND kwid IS NOT NULL" );
     } else {
         $sth = $u->prepare( "SELECT kwid FROM userpicmap2 WHERE userid=? AND picid=?" );
     }
@@ -1056,7 +1056,7 @@ sub set_keywords {
 
     my %kwid_to_mapid;
     if ( $have_mapid ) {
-        $sth = $u->prepare( "SELECT mapid, kwid FROM userpicmap3 WHERE userid=? AND kwid NOT NULL" );
+        $sth = $u->prepare( "SELECT mapid, kwid FROM userpicmap3 WHERE userid=? AND kwid IS NOT NULL" );
         $sth->execute( $u->userid );
 
         while (my ($mapid, $kwid) = $sth->fetchrow_array) {
diff -r 5899499b8c7a -r 7331658fe761 etc/config.pl
--- a/etc/config.pl	Mon Oct 04 08:24:37 2010 +0800
+++ b/etc/config.pl	Mon Oct 04 08:43:41 2010 +0800
@@ -228,19 +228,19 @@
 
     # initial friends for new accounts.
     # leave undefined if you don't want to use it.
-    @INITIAL_FRIENDS = qw(news);
+    @INITIAL_SUBSCRIPTIONS = qw(news);
 
     # initial optional friends
-    #@LJ::INITIAL_OPTIONAL_FRIENDS = qw(news);
+    #@LJ::INITIAL_OPTIONAL_SUBSCRIPTIONS = qw(news);
 
     # initial friends checked by default on create.bml
-    #@LJ::INITIAL_OPTOUT_FRIENDS = qw(news);
+    #@LJ::INITIAL_OPTOUT_SUBSCRIPTIONS = qw(news);
 
     # some system accounts have so many friends it is harmful to display
     # them.  list these accounts here.
-    #%FORCE_EMPTY_FRIENDS = (
-    #                        '81752' => 'paidmembers'
-    #                        );
+    #%FORCE_EMPTY_SUBSCRIPTIONS = (
+     #                             '81752' => 'paidmembers'
+    #                             );
 
 
     # test accounts are special
--------------------------------------------------------------------------------