[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,
Description:
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
(http://code.sixapart.com/trac/djabberd/browser/trunk/DJabberd/lib/DJabberd/VHost.pm#L86)
adds to the vhost array of 'features'
So let's make Connection: on_stream_start
(http://code.sixapart.com/trac/djabberd/browser/trunk/DJabberd/lib/DJabberd/Connection.pm#L572)
pull the elements from this array and insert them into the returned
<stream:features>
Please review this at http://codereview.appspot.com/7915
Affected files:
lib/DJabberd/Connection.pm
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