Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
So I have some rather simple code that I use to display a privatemsg link on a particular node. It works OK except it seems to only check if a friend request has been sent or not, so even if the two users are in pending status it would still display the link. What would be the most efficient way to check that they're in an actual relationship?
if ($relationships = user_relationships_load(array('between' => array($user->uid, $node->uid)))) {
$url = privatemsg_get_link(array(user_load($node->uid)));
print bla bla