Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[livejournal] r19029: LJSUP-8741 (OMG tags posts)

Committer: ailyin
LJSUP-8741 (OMG tags posts)
U   trunk/cgi-bin/LJ/Entry.pm
Modified: trunk/cgi-bin/LJ/Entry.pm
===================================================================
--- trunk/cgi-bin/LJ/Entry.pm	2011-05-05 08:33:28 UTC (rev 19028)
+++ trunk/cgi-bin/LJ/Entry.pm	2011-05-06 01:51:19 UTC (rev 19029)
@@ -385,19 +385,12 @@
     return values %$entry_taginfo;
 }
 
-# returns true if loaded, zero if not.
-# also sets _loaded_text and subject and event.
-sub _load_text {
-    my $self = shift;
-    return 1 if $self->{_loaded_text};
+sub handle_prefetched_text {
+    my ( $self, $subject, $event ) = @_;
 
-    my $ret = LJ::get_logtext2($self->{'u'}, $self->{'jitemid'});
-    my $lt = $ret->{$self->{jitemid}};
-    return 0 unless $lt;
+    $self->{subject}      = $subject;
+    $self->{event}        = $event;
 
-    $self->{subject}      = $lt->[0];
-    $self->{event}        = $lt->[1];
-
     if ($self->prop("unknown8bit")) {
         # save the old ones away, so we can get back at them if we really need to
         $self->{subject_orig}  = $self->{subject};
@@ -408,6 +401,20 @@
     }
 
     $self->{_loaded_text} = 1;
+}
+
+# returns true if loaded, zero if not.
+# also sets _loaded_text and subject and event.
+sub _load_text {
+    my $self = shift;
+    return 1 if $self->{_loaded_text};
+
+    my $ret = LJ::get_logtext2($self->{'u'}, $self->{'jitemid'});
+    my $lt = $ret->{$self->{jitemid}};
+    return 0 unless $lt;
+
+    $self->handle_prefetched_text( $lt->[0], $lt->[1] );
+
     return 1;
 }
 

Tags: andy, livejournal, pm
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments