[ejabberd] Shared_roster, mod_vcard_ldap and nicknames from others domains.

Thomas Martin tmartincpp at gmail.com
Tue Oct 11 12:05:18 MSD 2011


Le 10/10/2011 14:20, Thomas Martin a écrit :
> Hi Badlop,
>
> Le 10/10/2011 11:58, Badlop a écrit :
>   
>> Oh, the error report isn't informative enough, and I don't have
>> mod_vcard_ldap working for tring myself.
>>
>> Apply this patch to get more details about the error, maybe they point
>> to the source of the problem:
>> --- a/src/mod_shared_roster.erl
>> +++ b/src/mod_shared_roster.erl
>> @@ -194,7 +194,8 @@ get_rosteritem_name([ModVcard], U, S) ->
>>      try get_rosteritem_name_vcard(IQ_Vcard#iq.sub_el)
>>      catch E1:E2 ->
>>             ?ERROR_MSG("Error ~p found when trying to get the vCard of ~s@~s "
>> -                      "in ~p:~n ~p", [E1, U, S, ModVcard, E2]),
>> +                      "in ~p: ~p~nStacktrace: ~p",
>> +                      [E1, U, S, ModVcard, E2, erlang:get_stacktrace()]),
>>             ""
>>      end.
>>   
>>     
> Here is my results with the modification applied:
>
> =INFO REPORT==== 10-Oct-2011::14:14:56 ===
> D(<5354.895.0>:ejabberd_commands:314) : Executing command
> mod_admin_extra:get_roster with Args=["user1",
>                                                                                                
> "domain1"]
> ** at node ejabberd at jabber1.domain1 **
>
> =ERROR REPORT==== 10-Oct-2011::14:14:56 ===
> E(<5354.895.0>:mod_shared_roster:191) : Error error found when trying to
> get the vCard of user1 at domain2 in mod_vcard_ldap: function_clause
> Stacktrace: [{mod_shared_roster,get_rosteritem_name_vcard,
>                  [[{xmlelement,"vCard",[{"xmlns","vcard-temp"}],[]},
>                    {xmlelement,"error",
>                        [{"code","500"},{"type","wait"}],
>                        [{xmlelement,"internal-server-error",
>                            
> [{"xmlns","urn:ietf:params:xml:ns:xmpp-stanzas"}],
>                             []}]}]]},
>              {mod_shared_roster,get_rosteritem_name,3},
>              {mod_shared_roster,'-get_user_roster/2-lc$^0/1-0-',5},
>              {mod_shared_roster,get_user_roster,2},
>              {ejabberd_hooks,run_fold1,4},
>              {mod_admin_extra,get_roster,2},
>              {ejabberd_ctl,call_command,3},
>              {ejabberd_ctl,try_call_command,3}]
> ** at node ejabberd at jabber1.domain1 **
>
> =ERROR REPORT==== 10-Oct-2011::14:14:56 ===
> E(<5354.895.0>:mod_shared_roster:191) : Error error found when trying to
> get the vCard of user2 at domain2 in mod_vcard_ldap: function_clause
> Stacktrace: [{mod_shared_roster,get_rosteritem_name_vcard,
>                  [[{xmlelement,"vCard",[{"xmlns","vcard-temp"}],[]},
>                    {xmlelement,"error",
>                        [{"code","500"},{"type","wait"}],
>                        [{xmlelement,"internal-server-error",
>                            
> [{"xmlns","urn:ietf:params:xml:ns:xmpp-stanzas"}],
>                             []}]}]]},
>              {mod_shared_roster,get_rosteritem_name,3},
>              {mod_shared_roster,'-get_user_roster/2-lc$^0/1-0-',5},
>              {mod_shared_roster,'-get_user_roster/2-lc$^0/1-0-',5},
>              {mod_shared_roster,get_user_roster,2},
>              {ejabberd_hooks,run_fold1,4},
>              {mod_admin_extra,get_roster,2},
>              {ejabberd_ctl,call_command,3}]
> ** at node ejabberd at jabber1.domain1 **
>
>
> FYI I'm using ejabberd 2.1.5, if you want I can try with the last one
> 2.1.9 of course.
>
> Thanks.
>   

I talked to badlop on ejabberd at conference.jabber.ru.

After some investigations we concluded that mod_shared_roster is simply
not using s2s to find users nicknames; he is only looking for local domains.
mod_vcard_ldap is using s2s to find informations of distant domains.

So now I have to adapt the s2s part of mod_vcard_ldap's code into
mod_shared_roster...
I never did any erlang in my life, that will be very difficult for me.
If I will successfully modify the code I will be really really lucky... !


Thanks again to badlop to investigate this with me.


More information about the ejabberd mailing list