If a crossposted entry is deleted on the remote site, and then edited, 
the
         no-longer-relevant crosspost metadata is deleted, and the user is told 
to
         recheck the crosspost ticky if they want to recreate the crosspost.

        Patch by catness. 

diffs (48 lines):

diff -r 6d0952de71cd -r c0bc4044e818 bin/upgrading/en.dat
--- a/bin/upgrading/en.dat      Thu Jun 24 18:20:14 2010 -0500
+++ b/bin/upgrading/en.dat      Thu Jun 24 18:41:59 2010 -0500
@@ -4932,6 +4932,8 @@ xpost.delete.success=Crossposted entry a
 
 xpost.edit.error=Failed to update crossposted entry at 
[[usernam...@[[server]]:  [[error]]
 
+xpost.edit.error.deleted=Failed to update crossposted entry at 
[[usernam...@[[server]]:  the entry has been deleted on [[server]]. Select the 
cross-post checkbox for this account again if you want to recreate it.
+
 xpost.edit.success=Update of crosspost at [[usernam...@[[server]] successful.  
You can view this edited entry <a href="[[xpostlink]]">here</a>.
 
 xpost.error=Failed to crosspost entry to [[usernam...@[[server]]:  [[error]]
diff -r 6d0952de71cd -r c0bc4044e818 cgi-bin/DW/External/Account.pm
--- a/cgi-bin/DW/External/Account.pm    Thu Jun 24 18:20:14 2010 -0500
+++ b/cgi-bin/DW/External/Account.pm    Thu Jun 24 18:41:59 2010 -0500
@@ -283,9 +283,18 @@ sub crosspost {
                 message => LJ::Lang::ml($action_key . ".success", { username 
=> $self->username, server => $self->servername, xpostlink => $result->{url} })
             };
         } else {
+            my $message = $action_key . ".error";
+            if ( $result->{code} eq 'entry_deleted' ) {
+                undef ( $xpost_mapping->{$self->acctid} );
+                $self->record_xpost( $entry, $xpost_mapping );
+                my $xpost_detail_mapping = $self->xpost_string_to_hash ( 
$entry->prop('xpostdetail') );
+                undef ( $xpost_detail_mapping->{$self->acctid} );
+                $self->record_xpost_detail( $entry, $xpost_detail_mapping );
+                $message .= '.deleted';
+            }
             return {
                 success => 0,
-                error => LJ::Lang::ml($action_key . ".error", { username => 
$self->username, server => $self->servername, error => $result->{error} })
+                error => LJ::Lang::ml($message, { username => $self->username, 
server => $self->servername, error => $result->{error} })
             };
         }
     } else {
diff -r 6d0952de71cd -r c0bc4044e818 
cgi-bin/DW/External/XPostProtocol/LJXMLRPC.pm
--- a/cgi-bin/DW/External/XPostProtocol/LJXMLRPC.pm     Thu Jun 24 18:20:14 
2010 -0500
+++ b/cgi-bin/DW/External/XPostProtocol/LJXMLRPC.pm     Thu Jun 24 18:41:59 
2010 -0500
@@ -52,7 +52,8 @@ sub _call_xmlrpc {
             # error from server
             return {
                 success => 0,
-                error => $result->faultstring
+                error => $result->faultstring,
+                code => $result->faultcode == 302 ? 'entry_deleted' : ''
             }
         } else {
             # success
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to