raw is not cloned in XMLElement::clone()

Michael Scherer misc at mandriva.org
Mon Feb 5 13:34:07 UTC 2007


Le lundi 05 février 2007 13:49, Pedro Melo a écrit :
> Hi,
>
> the raw field is not cloned by XMLElement::clone. Shouldn't it be?
>
> Case in point: hooking PresenceCheck, created presence stanza with
> DJabberd::Presence->available($from) and then used set_raw() to add
> capability child (XEP-0115).
>
> When the fallback runs in DJabberd::Presence::_process_inbound_probe
> (), the clone() will not copy the capabilities.
>
> For now, I've added the a
>
>      $clone->{raw}      = $self->{raw};
>
> to XMLElement::clone(), but I'm not sure if this breaks something. I
> think it doesn't.

I would also expect clone to do complete copy of the object.

-- 
Michael Scherer


More information about the Djabberd mailing list