Hi. I have a user relationship called "chatlist" that does not require approval. This never gets added to the roster, because dxmpp_user_relationships() has a switch only for 'approve' and 'remove'. In this case, for my two-way relationship that does not require approval the $op is 'request'.

To fix this, it should have a $op for 'request', so the final function looks like this:

function dxmpp_user_relationships($op, &$relationship) {
  switch ($op) {
    case 'approve':
      dxmpp_roster_add($relationship->requester_id, $relationship->requestee_id);
      break;
    case 'request':
      if ($relationship->type->requires_approval == 0) {
        dxmpp_roster_add($relationship->requester_id, $relationship->requestee_id);
      }
      break;
    case 'remove':
      dxmpp_roster_remove($relationship->requester_id, $relationship->requestee_id);
      break;
  }
}

I can roll a patch if you like, but it's 5 lines so I figured it might be easier just to paste it in.

Comments

rjbrown99’s picture

Status: Active » Needs review

It's sort of a patch, so I'll change the status.

darklrd’s picture

Status: Needs review » Fixed

Hey rjbrown99,

Thanks for the code. It has been committed to the dev.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.