afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] changelog2009-07-20 06:28 pm

[dw-free] Remove remnants of shared journal support

[commit: http://hg.dwscoalition.org/dw-free/rev/180e258eb1b7]

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

Stomp out the embers.

Patch by [personal profile] afuna.

Files modified:
  • bin/worker/update-fb-friends
  • cgi-bin/LJ/Console/Command/Shared.pm
  • cgi-bin/ljprotocol.pl
--------------------------------------------------------------------------------
diff -r 2c494fd4d32b -r 180e258eb1b7 bin/worker/update-fb-friends
--- a/bin/worker/update-fb-friends	Mon Jul 20 18:15:43 2009 +0000
+++ b/bin/worker/update-fb-friends	Mon Jul 20 18:28:09 2009 +0000
@@ -33,9 +33,9 @@ sub work {
     my $u = LJ::load_userid($uid)
         or die "no userid";
 
-    # fotobilder won't autovivify communities/shared, so it won't accept
+    # fotobilder won't autovivify communities so it won't accept
     # friends update pushes.
-    if ($u->is_community || $u->is_shared) {
+    if ( $u->is_community ) {
         $job->completed;
         return;
     }
diff -r 2c494fd4d32b -r 180e258eb1b7 cgi-bin/LJ/Console/Command/Shared.pm
--- a/cgi-bin/LJ/Console/Command/Shared.pm	Mon Jul 20 18:15:43 2009 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-package LJ::Console::Command::Shared;
-
-use strict;
-use base qw(LJ::Console::Command);
-use Carp qw(croak);
-
-sub cmd { "shared" }
-
-sub desc { "Add or remove posting access in a shared journal." }
-
-sub args_desc { [
-                 'sharedjournal' => "The username of the shared journal.",
-                 'action' => "Either 'add' or 'remove'.",
-                 'user' => "The user you want to add or remove from posting in the shared journal.",
-                 ] }
-
-sub usage { '<sharedjournal> <action> <user>' }
-
-sub can_execute { 1 }
-
-sub execute {
-    my ($self, $shared_user, $action, $target_user, @args) = @_;
-
-    return $self->error("This command takes exactly three arguments. Consult the reference.")
-        unless $shared_user && $action && $target_user && scalar(@args) == 0;
-
-    my $shared = LJ::load_user($shared_user);
-    my $target = LJ::load_user($target_user);
-
-    return $self->error("Invalid shared journal $shared_user")
-        unless $shared && $shared->is_shared;
-
-    return $self->error("Invalid user $target_user")
-        unless $target && $target->is_person;
-
-    my $remote = LJ::get_remote();
-    return $self->error("You don't have access to manage this shared journal.")
-        unless LJ::can_manage($remote, $shared) || LJ::check_priv($remote, "sharedjournal", "*");
-
-    if ($action eq "add") {
-        return $self->error("User $target_user already has posting access to this shared journal.")
-            if LJ::check_rel($shared, $target, 'P');
-
-        # don't send request if the admin is giving themselves posting access
-        if (LJ::u_equals($target, $remote)) {
-            LJ::set_rel($shared, $target, 'P');
-            return $self->print("User $target_user has been given posting access to $shared_user.");
-        } else {
-            my $res = LJ::shared_member_request($shared, $target);
-            return $self->error("Could not add user.")
-                unless $res;
-
-            return $self->error("User $target_user already invited to join on: $res->{'datecreate'}")
-                if $res->{'datecreate'};
-
-            return $self->print("User $target_user has been sent a confirmation email, and will be able to post "
-                                  . "in $shared_user when they confirm this action.");
-        }
-
-    } elsif ($action eq "remove") {
-        LJ::clear_rel($shared, $target, 'P');
-        return $self->print("User $target_user can no longer post in $shared_user.");
-
-    } else {
-        return $self->error("Invalid action. Must be either 'add' or 'remove'.");
-    }
-
-}
-
-1;
diff -r 2c494fd4d32b -r 180e258eb1b7 cgi-bin/ljprotocol.pl
--- a/cgi-bin/ljprotocol.pl	Mon Jul 20 18:15:43 2009 +0000
+++ b/cgi-bin/ljprotocol.pl	Mon Jul 20 18:28:09 2009 +0000
@@ -1018,9 +1018,7 @@ sub postevent
     return fail($err,306) unless $dbh && $dbcm && $uowner->writer;
     return fail($err,200) unless $req->{'event'} =~ /\S/;
 
-    ### make sure community or shared journals don't post
-    ### note: shared journals are deprecated.  every shared journal
-    ##        should one day be a community journal, of some form.
+    ### make sure community or identity journals don't post
     return fail($err,150) if ($u->{'journaltype'} eq "C" ||
                               $u->{'journaltype'} eq "I");
 
@@ -2360,7 +2358,6 @@ sub list_friends
         $r->{"type"} = {
             'C' => 'community',
             'Y' => 'syndicated',
-            'S' => 'shared',
             'I' => 'identity',
         }->{$u->{'journaltype'}} if $u->{'journaltype'} ne 'P';
 
--------------------------------------------------------------------------------