freedom-social-xmpp
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -1,2 +0,2 @@ | ||
/*globals freedom:true,setTimeout,console,VCardStore */ | ||
/*globals freedom:true,setTimeout,console,VCardStore,global */ | ||
/*jslint indent:2,white:true,sloppy:true */ | ||
@@ -9,4 +9,9 @@ | ||
var window = {}; | ||
// Global declarations for node.js | ||
if (typeof window === 'undefined') { | ||
global.window = {}; | ||
global.XMLHttpRequest = {}; | ||
} | ||
/** | ||
@@ -199,3 +204,3 @@ * The SocialProvider implements the freedom.js social API | ||
// will be broadcast to all clients. | ||
var messageType = (this.vCardStore.getClient(to).status == 'ONLINE') ? | ||
var messageType = (this.vCardStore.getClient(to).status === 'ONLINE') ? | ||
'normal' : 'chat'; | ||
@@ -202,0 +207,0 @@ |
@@ -1,5 +0,5 @@ | ||
/*globals freedom:true,setTimeout,window */ | ||
/*globals freedom:true,setTimeout,window,VCardStore:true */ | ||
/*jslint indent:2,white:true,sloppy:true */ | ||
var VCardStore = function () { | ||
VCardStore = function () { | ||
if (freedom && freedom['core.storage']) { | ||
@@ -6,0 +6,0 @@ this.storage = freedom['core.storage'](); |
@@ -29,3 +29,3 @@ var FILES = {}, | ||
alias : ['browser-request:request', 'lib/dns.js:dns', 'lib/net.js:net', 'lib/stringprep.js:node-stringprep'], | ||
ignore : ['faye-websocket', 'tls'] | ||
ignore : ['faye-websocket', 'tls', './websockets'] | ||
} | ||
@@ -103,3 +103,7 @@ } | ||
]); | ||
grunt.registerTask('travis', [ | ||
'compile', | ||
'jasmine_node' | ||
]); | ||
grunt.registerTask('default', ['compile']); | ||
}; |
{ | ||
"name": "freedom-social-xmpp", | ||
"description": "XMPP Social provider for freedomjs", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"homepage": "http://freedomjs.org", | ||
@@ -18,2 +18,5 @@ "bugs": { | ||
}, | ||
"scripts": { | ||
"test": "grunt travis" | ||
}, | ||
"devDependencies": { | ||
@@ -25,11 +28,11 @@ "node-xmpp-client": "~0.4.0", | ||
"grunt-contrib-copy": "~0.5.0", | ||
"freedom-for-chrome": "~0.1.6", | ||
"freedom-for-chrome": "~0.1.7", | ||
"grunt-contrib-jasmine": "^0.6.1", | ||
"es5-shim": "^2.3.0", | ||
"freedom-for-node": "~0.0.6", | ||
"freedom-for-node": "~0.0.8", | ||
"grunt-jasmine-node": "~0.2.1" | ||
}, | ||
"peerDependencies": { | ||
"freedom": "^0.4.6" | ||
"freedom": "~0.4.12" | ||
} | ||
} |
@@ -5,5 +5,5 @@ var social = freedom.socialprovider(); | ||
if (tag == 'relay') { | ||
social.on(tag, function(tag, resp) { | ||
social.on(msg, function(tag, resp) { | ||
freedom.emit(tag, resp); | ||
}.bind({}, tag)); | ||
}.bind({}, msg)); | ||
} else { | ||
@@ -10,0 +10,0 @@ social[tag].apply(social, msg).then(function(tag, resp) { |
@@ -0,12 +1,45 @@ | ||
var credentials = []; | ||
var CredentializingView = function(caller, dispatch) { | ||
this.dispatchEvent = dispatch; | ||
}; | ||
CredentializingView.prototype.open = function(view, opts, continuation) { | ||
continuation(); | ||
}; | ||
CredentializingView.prototype.show = function(continuation) { | ||
continuation(); | ||
if (credentials.length) { | ||
this.dispatchEvent('message', credentials.pop()); | ||
} | ||
}; | ||
CredentializingView.prototype.close = function(continuation) { | ||
continuation(); | ||
}; | ||
describe('Login integration', function() { | ||
var freedom; | ||
var freedom, acct; | ||
beforeEach(function() { | ||
freedom = require('freedom-for-node').freedom; | ||
expect(freedom).toBeDefined(); | ||
fdom.apis.register('core.view', CredentializingView); | ||
var credential = (process.env.XMPPACCT || "alice:hiimalice").split(":"); | ||
acct = { | ||
userId: credential[0] + '@xmpp.uproxy.org', | ||
password: credential[1] | ||
}; | ||
}); | ||
it('sees presence between two friends', function(done) { | ||
it('logs in', function(done) { | ||
var socialClient = freedom('freedom.json', {debug:true}); | ||
socialClient.emit('relay', 'onUserProfile'); | ||
socialClient.emit('relay', 'onClientState'); | ||
credentials.push({ | ||
cmd: 'auth', | ||
message: acct | ||
}); | ||
socialClient.emit('login', [{ | ||
@@ -20,3 +53,4 @@ agent: 'integration', | ||
socialClient.on('onUserProfile', function(prof) { | ||
socialClient.on('onClientState', function(prof) { | ||
expect(prof.status).toEqual('ONLINE'); | ||
done(); | ||
@@ -23,0 +57,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
/*globals freedom:true,setTimeout,console,VCardStore */ | ||
/*globals freedom:true,setTimeout,console,VCardStore,global */ | ||
/*jslint indent:2,white:true,sloppy:true */ | ||
@@ -9,4 +9,9 @@ | ||
var window = {}; | ||
// Global declarations for node.js | ||
if (typeof window === 'undefined') { | ||
global.window = {}; | ||
global.XMLHttpRequest = {}; | ||
} | ||
/** | ||
@@ -199,3 +204,3 @@ * The SocialProvider implements the freedom.js social API | ||
// will be broadcast to all clients. | ||
var messageType = (this.vCardStore.getClient(to).status == 'ONLINE') ? | ||
var messageType = (this.vCardStore.getClient(to).status === 'ONLINE') ? | ||
'normal' : 'chat'; | ||
@@ -202,0 +207,0 @@ |
@@ -1,5 +0,5 @@ | ||
/*globals freedom:true,setTimeout,window */ | ||
/*globals freedom:true,setTimeout,window,VCardStore:true */ | ||
/*jslint indent:2,white:true,sloppy:true */ | ||
var VCardStore = function () { | ||
VCardStore = function () { | ||
if (freedom && freedom['core.storage']) { | ||
@@ -6,0 +6,0 @@ this.storage = freedom['core.storage'](); |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8
10
510021
42
15179