Check the receiver read the message or not in buddypress message using thread id.
If there is any possibility to do this? This functionality like whatsapp tick functionality.
Check the receiver read the message or not in buddypress message using thread id.
If there is any possibility to do this? This functionality like whatsapp tick functionality.
Refer below solution, This I used in inbox loop.
<?php
// check message is reply and read
$thread = new BP_Messages_Thread( bp_get_message_thread_id() );
$user = wp_get_current_user();
foreach ( $thread->sender_ids as $key => $value ) {
if ( $value != $user->ID ) {
$recipient_id = $value;
}
}
if ( $thread->last_sender_id == $user->ID ) {
if( $thread->recipients[$recipient_id]->unread_count > 0 ){
echo('<i class="fa fa-reply" aria-hidden="true"></i>');
}else{
echo('<i class="fa fa-check" aria-hidden="true"></i>');
}
}
?>