From 474b94fc21afc070848b811d2875e0540864e626 Mon Sep 17 00:00:00 2001 From: Kartik Suthar Date: Thu, 2 Jan 2025 13:09:39 +0530 Subject: [PATCH] WIP - Messages --- src/bp-messages/bp-messages-functions.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bp-messages/bp-messages-functions.php b/src/bp-messages/bp-messages-functions.php index c4e8c9c07d..9315a25229 100644 --- a/src/bp-messages/bp-messages-functions.php +++ b/src/bp-messages/bp-messages-functions.php @@ -1379,7 +1379,6 @@ function bb_messages_is_group_thread( $thread_id ) { * @return bool */ function bb_messages_thread_group_id( $thread_id ) { - if ( ! $thread_id || ! bp_is_active( 'messages' ) ) { return 0; } @@ -1391,8 +1390,8 @@ function bb_messages_thread_group_id( $thread_id ) { $message_from = bp_messages_get_meta( $first_message->id, 'message_from', true ); // group. $group_id = 0; - if ( 'group' === $message_from && $thread_id === (int) $group_message_thread_id && 'all' === $message_users && 'open' === $message_type ) { - $group_id = ( isset( $first_message_id ) ) ? (int) bp_messages_get_meta( $first_message_id, 'group_id', true ) : 0; + if ( 'group' === $message_from && (int) $thread_id === (int) $group_message_thread_id && 'all' === $message_users && 'open' === $message_type ) { + $group_id = ( isset( $first_message->id ) ) ? (int) bp_messages_get_meta( $first_message->id, 'group_id', true ) : 0; } return $group_id;