Skip to content
Browse files

Exposing stream obj to the lookup service so

that users of nxb can use other info based on
their requirements in their own lookup-service.
  • Loading branch information...
1 parent 3a081ca commit 2e862a000d95eb7ad50a3e6111996e068ca2ab9a @satyamshekhar satyamshekhar committed Mar 21, 2012
Showing with 6 additions and 6 deletions.
  1. +5 −5 src/lookup-service.js
  2. +1 −1 src/xmpp-proxy-connector.js
View
10 src/lookup-service.js
@@ -45,21 +45,21 @@ var log = require('./log.js').getLogger(filename);
* If all attempts fail, an 'error' event is raised on the 'socket'.
*
*/
-function XMPPLookupService(domain_name, port, route) {
- this._domain_name = domain_name;
+function XMPPLookupService(stream, port) {
+ this._domain_name = stream.to;
this._port = port;
- this._route = route;
+ this._route = stream.route;
var _special = {
"gmail.com": "talk.google.com",
"chat.facebook.com": "chat.facebook.com"
};
- if (_special.hasOwnProperty(domain_name)) {
+ if (_special.hasOwnProperty(this._domain_name)) {
if (!this._route) {
this._route = {
protocol: "xmpp",
- host: _special[domain_name],
+ host: _special[this._domain_name],
port: this._port
};
}
View
2 src/xmpp-proxy-connector.js
@@ -145,7 +145,7 @@ XMPPProxyConnector.prototype = {
//log.trace("%s %s stream_add", sstate.session.sid, sstate.name);
var _ls_ctor = this.options.lookup_service || lookup.LookupService;
- var _ls = new _ls_ctor(sstate.to, DEFAULT_XMPP_PORT, sstate.route);
+ var _ls = new _ls_ctor(sstate, DEFAULT_XMPP_PORT);
// Create a new stream.
var proxy = new this.Proxy(sstate.to, _ls, stream_start_attrs,

0 comments on commit 2e862a0

Please sign in to comment.
Something went wrong with that request. Please try again.