kareila: (Default)
kareila ([personal profile] kareila) wrote in [site community profile] changelog2009-10-20 12:48 pm

[dw-free] create function for creating s2 entry objects

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

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

Include ?style=mine when displaying cut links on pages that use it.

Patch by [personal profile] yvi.

Files modified:
  • cgi-bin/LJ/S2.pm
--------------------------------------------------------------------------------
diff -r 1a7ff043f228 -r 7ebaade65094 cgi-bin/LJ/S2.pm
--- a/cgi-bin/LJ/S2.pm	Tue Oct 20 02:49:59 2009 +0000
+++ b/cgi-bin/LJ/S2.pm	Tue Oct 20 07:48:39 2009 -0500
@@ -1849,6 +1849,14 @@ sub Entry_from_entryobj
     my $journalid = $entry_obj->journalid;
     my $journal = LJ::load_userid( $journalid );
 
+    # is style=mine used?  or if remote has it on and this entry is not part of
+    # their journal.  if either are yes, it needs to be added to comment links
+    my $stylemine = "";
+    $stylemine .= "style=mine"
+        if $get->{style} eq 'mine' ||
+            ( $remote && $remote->prop( 'opt_stylemine' ) &&
+              $remote->id != $journalid );
+
     #load and prepare subject and text of entry
     my $subject = $entry_obj->subject_html;
     my $text = $entry_obj->event_raw;
@@ -1863,7 +1871,7 @@ sub Entry_from_entryobj
     my $suspend_msg = $entry_obj && $entry_obj->should_show_suspend_msg_to( $remote ) ? 1 : 0;
     # cleaning the entry text: cuts and such
     my $cut_disable = $opts->{cut_disable};
-    my $cleanhtml_opts = { cuturl => LJ::item_link( $journal, $jitemid, $anum ),
+    my $cleanhtml_opts = { cuturl => LJ::item_link( $journal, $jitemid, $anum, $stylemine ),
         ljcut_disable => $cut_disable,
         suspend_msg => $suspend_msg,
         unsuspend_supportid => $suspend_msg ? $entry_obj->prop( 'unsuspend_supportid' ) : 0,
@@ -1922,14 +1930,6 @@ sub Entry_from_entryobj
     if ( $opts->{enable_tags_compatibility} && @taglist ) {
             $text .= LJ::S2::get_tags_text($opts->{ctx}, \@taglist);
     }
-
-    # is style=mine used?  or if remote has it on and this entry is not part of
-    # their journal.  if either are yes, it needs to be added to comment links
-    my $stylemine = "";
-    $stylemine .= "style=mine"
-        if $get->{style} eq 'mine' ||
-            ( $remote && $remote->prop( 'opt_stylemine' ) &&
-              $remote->id != $journal->id );
 
     # comment information
     my $permalink = $entry_obj->url;
--------------------------------------------------------------------------------

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