Permalink
Browse files

Add XEP-0300 plugin for hash agility support

  • Loading branch information...
legastero committed Nov 12, 2013
1 parent 55e759b commit 2994f2df7e44a06a5046059c873cb04930372fa3
Showing with 154 additions and 118 deletions.
  1. +1 −1 .jshintignore
  2. +2 −1 build.js
  3. +124 −115 { → build}/stanzaio.bundle.js
  4. +8 −0 build/stanzaio.bundle.min.js
  5. +1 −0 index.js
  6. +6 −0 lib/plugins/hashes.js
  7. +11 −0 lib/stanza/hash.js
  8. +1 −1 package.json
View
@@ -1,3 +1,3 @@
node_modules
vendor
-stanzaio.bundle.js
+build
View
@@ -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);
});

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -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;
};
View
@@ -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');
+};
View
@@ -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()
+ }
+});
View
@@ -1,6 +1,6 @@
{
"name": "stanza.io",
- "version": "2.5.15",
+ "version": "2.6.0",
"description": "XMPP + WebSocket",
"browserify": "index.js",
"dependencies": {

0 comments on commit 2994f2d

Please sign in to comment.