Hi,
after spending some time reading part of the code of Agent.pm, I am puzzled by
this :
sub handle_iq {
my ($self, $vhost, $stanza) = @_;
my $sig = $stanza->signature;
if ($self->{djabberd_agent_iqcb} && $self->{djabberd_agent_iqcb}{$sig}) {
return $self->{djabberd_agent_iqcb}{$sig}->($vhost, $stanza);
}
....
}
and
sub register_iq_handler {
my ($self, $signature, $handler) = @_;
$self->{easier_node_iqcb} ||= {};
$self->{easier_node_iqcb}{$signature} = $handler;
}
This part is not working, or there is something very subtle I missed ?
register_iq_handler should use djabberd_agent_iqcb, not easier_node_iqcb as a
memeber, as this is the only occurence in the source code.
Here is a patch that correct it. With it, register_iq_handler should work as
intended.
--
Michael Scherer
=== lib/DJabberd/Agent.pm
==================================================================
--- lib/DJabberd/Agent.pm (revision 1101)
+++ lib/DJabberd/Agent.pm (local)
@@ -81,8 +81,8 @@
sub register_iq_handler {
my ($self, $signature, $handler) = @_;
- $self->{easier_node_iqcb} ||= {};
- $self->{easier_node_iqcb}{$signature} = $handler;
+ $self->{djabberd_agent_iqcb} ||= {};
+ $self->{djabberd_agent_iqcb}{$signature} = $handler;
}
sub handle_iq_vcard {