[ejabberd] Roster Subscription Problem

Jorge Guntanis jorge at guntanis.com
Fri Mar 9 03:09:29 MSK 2007


This is the fix for the problem described on my first email.

mod_roster.erl
Current Code:
-ifdef(PSI_ROSTER_WORKAROUND).

process_iq(From, To, IQ) ->
#iq{sub_el = SubEl} = IQ,
#jid{lserver = LServer} = From,
case lists:member(LServer, ?MYHOSTS) of
true ->
ResIQ = process_local_iq(From, To, IQ),
ejabberd_router:route(From, From,
jlib:iq_to_xml(ResIQ)),
ignore;
_ ->
IQ#iq{type = error, sub_el = [SubEl, ?ERR_ITEM_NOT_FOUND]}
end.

-else.

CODE THAT FIX THE BEHAVIOR DESCRIBED IN THE LAST POST

-ifdef(PSI_ROSTER_WORKAROUND).

process_iq(From, To, IQ) ->
#iq{sub_el = SubEl} = IQ,
#jid{lserver = LServer} = From,
case lists:member(LServer, ?MYHOSTS) of
true ->
ResIQ = process_local_iq(From, To, IQ),
ejabberd_router:route(From, To,
jlib:iq_to_xml(ResIQ)),
ignore;
_ ->
IQ#iq{type = error, sub_el = [SubEl, ?ERR_ITEM_NOT_FOUND]}
end.

-else.

This might help someone in the future, I don't know if psi will behave
correctly, but this will make it RFC compliant.

Cheers!
Jorge Guntanis


On 3/8/07, Jorge Guntanis <guntanis at gmail.com> wrote:
>
>
> There is a problem on the way ejabberd manages subscriptions, and it
> doesn't seems like it's really RFC3921 compliant, so I'd catalog it as a
> bug. I tested this behavior with other jabber flavors and I couldn't
> recreate ejabberd's.
>
> When I add a buddy, it gets added in both, my roster and his roster, with
> subscription none. Even if I haven't accepted him or even if I declined his
> request. While the correct behavior should be that the user gets added after
> I accepted him.
>
> Is there a reason for this behavior, is there a way to fix this behavior?
>
> I've been looking on the config files and I've googled this problem out
> for a while now, without any luck, I'd appreciate all the help/guidance you
> can provide me on this.
>
> Thanks
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jabber.ru/pipermail/ejabberd/attachments/20070308/1d46f6cf/attachment.htm 


More information about the ejabberd mailing list