[PATCH] send additional features from vhost in stream:features

igotimac at gmail.com igotimac at gmail.com
Mon Nov 3 19:10:32 UTC 2008

Reviewers: djabberd,

It seems there are some methods on VHost for adding features, but
there's no mechanism to actually send them during feature negotiation.

VHost : add_feature

adds to the vhost array of 'features'

So let's make Connection: on_stream_start

pull the elements from this array and insert them into the returned

Please review this at http://codereview.appspot.com/7915

Affected files:

Index: lib/DJabberd/Connection.pm
--- lib/DJabberd/Connection.pm	(revision 819)
+++ lib/DJabberd/Connection.pm	(working copy)
@@ -650,6 +650,9 @@
              && !$self->isa("DJabberd::Connection::ServerIn")) {
              $features_body .= "<starttls  
xmlns='urn:ietf:params:xml:ns:xmpp-tls' />";
+        foreach my $feature_stanza ($self->{vhost}->features) {
+          $features_body .= $feature_stanza;
+        }
          $features = qq{<stream:features>$features_body</stream:features>};

More information about the Djabberd mailing list