Reply To: How to access other members messages ?
The problem may be that bp_message_thread_has_unread() is hard-coded to check based on the loggedin_user.
See bp-messages\classes\class-bp_messages-thread.php
If you remove your $unread conditional, you will see all the messages for $UID.
To only get unread messages, you may need to use custom sql that starts with the bp_messages_recipients table and queries based on the unread_count field.