mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-04-22 05:11 am

[dw-free] include crosspost option on update.bml

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

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

Fix embedded media, UTF8 content, and moods in crossposter.

Patch by [personal profile] allen.

Files modified:
  • cgi-bin/DW/External/XPostProtocol.pm
  • cgi-bin/DW/External/XPostProtocol/LJXMLRPC.pm
--------------------------------------------------------------------------------
diff -r a34fd5617470 -r a74da125f02d cgi-bin/DW/External/XPostProtocol.pm
--- a/cgi-bin/DW/External/XPostProtocol.pm	Wed Apr 22 05:04:06 2009 +0000
+++ b/cgi-bin/DW/External/XPostProtocol.pm	Wed Apr 22 05:11:42 2009 +0000
@@ -54,7 +54,13 @@ sub clean_entry_text {
 sub clean_entry_text {
     my ($self, $entry) = @_;
 
-    return $self->scrub_polls($entry->event_text);
+    my $event_text = $entry->event_text;
+    
+    # clean up any embedded objects
+    LJ::EmbedModule->expand_entry($entry->journal, \$event_text, expand_full => 1);
+    
+    # remove polls, then return the text
+    return $self->scrub_polls($event_text);
 }
 
 # replaces <poll> tags with a link to the original poll
diff -r a34fd5617470 -r a74da125f02d cgi-bin/DW/External/XPostProtocol/LJXMLRPC.pm
--- a/cgi-bin/DW/External/XPostProtocol/LJXMLRPC.pm	Wed Apr 22 05:04:06 2009 +0000
+++ b/cgi-bin/DW/External/XPostProtocol/LJXMLRPC.pm	Wed Apr 22 05:11:42 2009 +0000
@@ -111,6 +111,7 @@ sub crosspost {
     $req->{auth_method} = 'challenge';
     $req->{auth_challenge} = $challenge;
     $req->{auth_response} = $response;
+    $req->{ver} = 1;
 
     # get the correct itemid for edit
     $req->{itemid} = $itemid if $itemid;
@@ -199,6 +200,12 @@ sub entry_to_req {
     for my $entrykey (qw ( adult_content current_coords current_location current_mood current_music opt_backdated opt_nocomments opt_noemail opt_preformatted opt_screening picture_keyword qotdid taglist used_rte pingback )) {
         $req->{props}->{$entrykey} = $entryprops->{$entrykey} if defined $entryprops->{$entrykey};
     }
+    # the current_mood above handles custom moods; for standard moods we
+    # use current_moodid
+    if ($entryprops->{current_moodid}) {
+        my $mood = LJ::mood_name($entryprops->{current_moodid});
+        $req->{props}->{current_mood} = $mood if $mood;
+    }
 
     # and set the useragent - FIXME put this somewhere else?
     $req->{props}->{useragent} = "Dreamwidth Crossposter";
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org