Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/06/2017 05:46:21 PM (7 years ago)
Author:
dcavins
Message:

Show displayed user's messages on messages screens.

When a site administrator visits another user’s messages, she is shown
her own messages because the display logic for messages refers to the
logged-in user rather than the displayed user. This changeset updates
the logic to allow the site admin to view and interact with another
user’s messages.

Fixes #7096.

File:
1 edited

Legend:

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

    r10417 r11578  
    4242function bp_messages_is_message_starred( $mid = 0, $user_id = 0 ) {
    4343    if ( empty( $user_id ) ) {
    44         $user_id = bp_loggedin_user_id();
     44        $user_id = bp_displayed_user_id();
    4545    }
    4646
     
    255255        'thread_id'  => 0,
    256256        'message_id' => 0,
    257         'user_id'    => bp_loggedin_user_id(),
     257        'user_id'    => bp_displayed_user_id(),
    258258        'bulk'       => false
    259259    ) );
     
    398398
    399399    // Redirect back to previous screen.
    400     $redirect = wp_get_referer() ? wp_get_referer() : bp_loggedin_user_domain() . bp_get_messages_slug();
     400    $redirect = wp_get_referer() ? wp_get_referer() : bp_displayed_user_domain() . bp_get_messages_slug();
    401401    bp_core_redirect( $redirect );
    402402    die();
Note: See TracChangeset for help on using the changeset viewer.