Navigation Menu

Skip to content

Commit

Permalink
Add XEP-0300 plugin for hash agility support
Browse files Browse the repository at this point in the history
  • Loading branch information
legastero committed Nov 12, 2013
1 parent 55e759b commit 2994f2d
Show file tree
Hide file tree
Showing 8 changed files with 154 additions and 118 deletions.
2 changes: 1 addition & 1 deletion .jshintignore
@@ -1,3 +1,3 @@
node_modules
vendor
stanzaio.bundle.js
build
3 changes: 2 additions & 1 deletion build.js
Expand Up @@ -6,6 +6,7 @@ var fs = require('fs');
var bundle = browserify();
bundle.add('./index');
bundle.bundle({standalone: 'XMPP'}, function (err, js) {
//var result = UglifyJS.minify(js, {fromString: true}).code;
fs.writeFileSync('stanzaio.bundle.js', js);
var min = UglifyJS.minify(js, {fromString: true}).code;
fs.writeFileSync('stanzaio.bundle.min.js', min);
});
239 changes: 124 additions & 115 deletions stanzaio.bundle.js → build/stanzaio.bundle.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions build/stanzaio.bundle.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions index.js
Expand Up @@ -28,6 +28,7 @@ exports.createClient = function (opts) {
client.use(require('./lib/plugins/bookmarks'));
client.use(require('./lib/plugins/jingle'));
client.use(require('./lib/plugins/json'));
client.use(require('./lib/plugins/hashes'));

return client;
};
6 changes: 6 additions & 0 deletions lib/plugins/hashes.js
@@ -0,0 +1,6 @@
module.exports = function (client) {
client.disco.addFeature('urn:xmpp:hashes:1');
client.disco.addFeature('urn:xmpp:hash-function-text-names:md5');
client.disco.addFeature('urn:xmpp:hash-function-text-names:sha-1');
client.disco.addFeature('urn:xmpp:hash-function-text-names:sha-256');
};
11 changes: 11 additions & 0 deletions lib/stanza/hash.js
@@ -0,0 +1,11 @@
var stanza = require('jxt');

var Hash = module.exports = stanza.define({
name: 'hash',
namespace: 'urn:xmpp:hashes:1',
element: 'hash',
fields: {
algo: stanza.attribute('algo'),
value: stanza.text()
}
});
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "stanza.io",
"version": "2.5.15",
"version": "2.6.0",
"description": "XMPP + WebSocket",
"browserify": "index.js",
"dependencies": {
Expand Down

0 comments on commit 2994f2d

Please sign in to comment.