Closed (fixed)
Project:
DXMPP
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Nov 2010 at 19:35 UTC
Updated:
26 Dec 2010 at 07:10 UTC
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
Comment #1
rjbrown99 commentedIt's sort of a patch, so I'll change the status.
Comment #2
darklrd commentedHey rjbrown99,
Thanks for the code. It has been committed to the dev.