Index: DJabberd/Agent.pm
===================================================================
--- DJabberd/Agent.pm (revision 848)
+++ DJabberd/Agent.pm (working copy)
@@ -98,15 +98,26 @@
sub handle_iq_disco_info {
my ($self, $vhost, $stanza) = @_;
- my $features = $self->features($stanza->from_jid);
- my $identities = $self->identities($stanza->from_jid);
+ my $query = $stanza->first_element();
+ my $disco_node = $query && $query->attr('{}node');
+
+ my $features = $self->features($stanza->from_jid, $disco_node);
+ my $identities = $self->identities($stanza->from_jid, $disco_node);
my $response = $stanza->make_response();
- my $xml = "" .
- join('',map({ "" } @$identities)) .
- join('',map({ "" } @$features)) .
- "";
+ my $xml = "" } @$identities))
+ . join('',map({ "" } @$features))
+ . "";
+ }
+ else {
+ $xml .= ' />';
+ }
+
$response->set_raw($xml);
$response->deliver($vhost);
}
@@ -114,13 +125,25 @@
sub handle_iq_disco_items {
my ($self, $vhost, $stanza) = @_;
- my $items = $self->child_services($stanza->from_jid);
+ my $query = $stanza->first_element();
+ my $disco_node = $query && $query->attr('{}node');
+
+ my $items = $self->child_services($stanza->from_jid, $disco_node);
my $response = $stanza->make_response();
- my $xml = "" .
- join('',map({ " " } @$items)) .
- "";
+ my $xml = "" } @$items))
+ . "";
+ }
+ else {
+ $xml .= ' />';
+ }
+
$response->set_raw($xml);
$response->deliver($vhost);
}