是否有可能知道接收者是否使用BuddyPress线程ID读取消息?



使用线程 ID 检查接收方是否在好友新闻中阅读消息。

如果有可能这样做?此功能类似于whatsapp滴答功能。

请参阅下面的解决方案,这是我在收件箱循环中使用的。

<?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>');
}
}
?>

最新更新