Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/28/2024 05:27:43 PM (5 months ago)
Author:
espellcaste
Message:

Improve deleted-user private messages in the web and REST API.

Private messages from a deleted user are properly anonymized in both the web and REST API.

Props imath, niftythree.

Closes https://github.com/buddypress/buddypress/pull/384
Fixes #9160

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/classes/class-bp-messages-rest-controller.php

    r14058 r14061  
    158158        $retval = array();
    159159        foreach ( (array) $messages_box->threads as $thread ) {
     160            $messages_box->the_message_thread();
     161
    160162            $retval[] = $this->prepare_response_for_collection(
    161163                $this->prepare_item_for_response( $thread, $request )
     
    167169
    168170        /**
    169          * Fires after a thread is fetched via the REST API.
    170          *
    171          * @since 15.0.0
    172          *
    173          * @param BP_Messages_Box_Template  $messages_box Fetched thread.
     171         * Fires after threads are fetched via the REST API.
     172         *
     173         * @since 15.0.0
     174         *
     175         * @param BP_Messages_Box_Template  $messages_box Messages box
    174176         * @param WP_REST_Response          $response     The response data.
    175177         * @param WP_REST_Request           $request      The request sent to the API.
Note: See TracChangeset for help on using the changeset viewer.