Skip to content

Commit

Permalink
Exposing stream obj to the lookup service so
Browse files Browse the repository at this point in the history
that users of nxb can use other info based on
their requirements in their own lookup-service.
  • Loading branch information
satyamshekhar committed Mar 21, 2012
1 parent 3a081ca commit 2e862a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/lookup-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/xmpp-proxy-connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2e862a0

Please sign in to comment.