Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/07/2015 02:07:41 PM (9 years ago)
Author:
boonebgorges
Message:

BP_Messages_Thread objects should always have last_message_* properties set.

Previously, they were only set in the context of a template loop.

Props jdgrimes.
Fixes #6580.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/bp-messages-template.php

    r9946 r10038  
    18471847        $this->thread        = new BP_Messages_Thread( $thread_id, $order, $args );
    18481848        $this->message_count = count( $this->thread->messages );
    1849 
    1850         $last_message_index                 = $this->message_count - 1;
    1851         $this->thread->last_message_id      = $this->thread->messages[ $last_message_index ]->id;
    1852         $this->thread->last_message_date    = $this->thread->messages[ $last_message_index ]->date_sent;
    1853         $this->thread->last_sender_id       = $this->thread->messages[ $last_message_index ]->sender_id;
    1854         $this->thread->last_message_subject = $this->thread->messages[ $last_message_index ]->subject;
    1855         $this->thread->last_message_content = $this->thread->messages[ $last_message_index ]->message;
    18561849    }
    18571850
Note: See TracChangeset for help on using the changeset viewer.