diff options
author | Matěj Cepl <mcepl@redhat.com> | 2011-08-04 01:23:31 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2011-08-04 01:23:31 +0200 |
commit | a49dcef3b2e386179115605fd4b37f7f4ce02fb5 (patch) | |
tree | 1e9272cb3981d29881dc486e6aefa2479189ee4e | |
parent | d75f36db36c442ae9621dc128fbd916c25d5735f (diff) | |
download | bugzilla-triage-a49dcef3b2e386179115605fd4b37f7f4ce02fb5.tar.gz |
Just reformatting and more debug logging.
-rw-r--r-- | lib/libbugzilla.js | 30 | ||||
-rw-r--r-- | lib/main.js | 1 |
2 files changed, 17 insertions, 14 deletions
diff --git a/lib/libbugzilla.js b/lib/libbugzilla.js index 2dc1dc5..145332a 100644 --- a/lib/libbugzilla.js +++ b/lib/libbugzilla.js @@ -124,7 +124,6 @@ function getPassword(login, domain, callback) { else { // We don't have password, and user haven't entered one? // Does he want to live passwordless? - // FIXME should we call the callback at all? var switchOff = prompts.promptYesNoCancel(switchPrompt); if (switchOff) { preferences.set(prefName,true); @@ -137,6 +136,7 @@ function getPassword(login, domain, callback) { }); } +// Change URL of the configuration JSON file exports.changeJSONURL = function changeJSONURL() { var prfNm = BTSPrefNS+"JSONURL"; var url = preferences.get(prfNm, JSONURLDefault); @@ -329,24 +329,26 @@ exports.makeXMLRPCCall = function makeXMLRPCCall(url, login, method, params, cal ); }; -exports.makeJSONRPCCallWithLogin = function makeJSONRPCCallWithLogin(url, method, params, - login, callback) { +exports.makeJSONRPCCallWithLogin = function makeJSONRPCCallWithLogin(url, method, + params, login, callback) { var urlObj = urlMod.URL(url); getPassword(login, urlObj.scheme + "://" + urlObj.host, function (passObj) { - if (!passObj.password) { - return; - } + if (!passObj.password) { + return; + } - makeJSONRPCCall(url, "User.login", { - login: login, - password: passObj.password, - remember: false - }, function(logResult) { - makeJSONRPCCall(url, method, params, callback); - }); - } + console.myDebug("makeJSONRPCCallWithLogin: passObj = " + + passObj.toSource()); + makeJSONRPCCall(url, "User.login", { + login: login, + password: passObj.password, + remember: false + }, function(logResult) { + makeJSONRPCCall(url, method, params, callback); + }); + } ); }; diff --git a/lib/main.js b/lib/main.js index 4db620a..9c42166 100644 --- a/lib/main.js +++ b/lib/main.js @@ -94,6 +94,7 @@ var messageHandler = exports.messageHandler = function messageHandler( break; case "MakeJSONRPCall": // url, login, method, params, callback + console.myDebug("messageHandler: msg = " + msg.toSource()); if (msg.data.login) { libbz .makeJSONRPCCallWithLogin(msg.data.url, |