Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/08/2023 11:12:01 PM (21 months ago)
Author:
espellcaste
Message:

BP_Messages_Thread: return the *right* latest message.

Introducing a new method get_latest_thread_message() to the BP_Messages_Thread class which returns the latest message of a thread.

Closes https://github.com/buddypress/buddypress/pull/52
Fixes #8696

File:
1 edited

Legend:

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

    r13401 r13402  
    6666    }
    6767
     68    // Delete thread latest message cached data.
     69    wp_cache_delete( "{$message->thread_id}_bp_messages_thread_latest_message", 'bp_messages_threads' );
     70
    6871    // Delete thread recipient cache.
    6972    wp_cache_delete( 'thread_recipients_' . $message->thread_id, 'bp_messages' );
     
    8588        wp_cache_delete( $thread_id, 'bp_messages_threads' );
    8689        wp_cache_delete( "thread_recipients_{$thread_id}", 'bp_messages' );
     90
     91        // Delete thread latest message cached data.
     92        wp_cache_delete( "{$thread_id}_bp_messages_thread_latest_message", 'bp_messages_threads' );
    8793
    8894        // Delete thread messages count.
Note: See TracChangeset for help on using the changeset viewer.