[ejabberd] external component "route" element from mod_service_log

Daniel Dormont dan at greywallsoftware.com
Thu Mar 17 18:58:29 MSK 2011


Thanks, I think I can figure out from there what I need. 

One related question while I'm at it: is there a way to subscribe an external component to a MUC? Specifically what I'd like is to have all packets that are sent to the MUC's participants (presence and message specifically) also sent to the external component - but only once, not once for each user.

Dan

On Mar 17, 2011, at 6:51 AM, Badlop wrote:

> 2011/3/16 Daniel Dormont <dan at greywallsoftware.com>:
>> I have managed to register the component using the service listener and I have it configured as a "logger" under mod_service_log. Packets are being delivered correctly, but I see that the packet is enclosed in a "route" tag before it's sent out. May I ask why that's done?
>> 
>> I'm asking because as best I can tell this "route" tag isn't part of the XMPP standard and the Java APIs choke on the packet.
> 
> 
> I guess you refer to this line in mod_service_log.erl
>                {xmlelement, "route", [], [FixedPacket]})
> 
> That line is there since the first version of the module, seven years ago.
> And that module was intended to be used with Bandersnatch,
> so it had to send the stanza inside that Route element as expected by
> that program.
> There may be other programs compatible with that one, that also use that.
> 
> 
>> I'm working on modifying them to unwrap the "route" tag but I was wondering if there's a way to tell mod_service_log not to send it in the first place.
> 
> You can try to customize the code like this:
> --- a/src/mod_service_log.erl
> +++ b/src/mod_service_log.erl
> @@ -72,6 +72,6 @@ log_packet(From, To, {xmlelement, Name, Attrs, Els}, Host) ->
>                ServerJID,
>                #jid{user = "", server = Logger, resource = "",
>                     luser = "", lserver = Logger, lresource = ""},
> -               {xmlelement, "route", [], [FixedPacket]})
> +               FixedPacket
>       end, Loggers).
> 
> 
> ---
> Badlop
> ProcessOne
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd



More information about the ejabberd mailing list