fca-unofficial
Advanced tools
Comparing version 1.2.7 to 1.2.8
{ | ||
"name": "fca-unofficial", | ||
"version": "1.2.7", | ||
"version": "1.2.8", | ||
"description": "A Facebook chat API that doesn't rely on XMPP. Will NOT be deprecated after April 30th 2015.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -7,3 +7,3 @@ "use strict"; | ||
module.exports = function(defaultFuncs, api, ctx) { | ||
return function httpGet(url, form, callback) { | ||
return function httpGet(url, form, callback, notAPI) { | ||
var resolveFunc = function(){}; | ||
@@ -29,11 +29,23 @@ var rejectFunc = function(){}; | ||
defaultFuncs | ||
.get(url, ctx.jar, form, {}) | ||
.then(function(resData) { | ||
callback(null, resData.body.toString()); | ||
}) | ||
.catch(function(err) { | ||
log.error("httpGet", err); | ||
return callback(err); | ||
}); | ||
if (notAPI) { | ||
utils | ||
.get(url, ctx.jar, form, ctx.globalOptions) | ||
.then(function(resData) { | ||
callback(null, resData.body.toString()); | ||
}) | ||
.catch(function(err) { | ||
log.error("httpGet", err); | ||
return callback(err); | ||
}); | ||
} else { | ||
defaultFuncs | ||
.get(url, ctx.jar, form) | ||
.then(function(resData) { | ||
callback(null, resData.body.toString()); | ||
}) | ||
.catch(function(err) { | ||
log.error("httpGet", err); | ||
return callback(err); | ||
}); | ||
} | ||
@@ -40,0 +52,0 @@ return returnPromise; |
@@ -7,3 +7,3 @@ "use strict"; | ||
module.exports = function(defaultFuncs, api, ctx) { | ||
return function httpGet(url, form, callback) { | ||
return function httpGet(url, form, callback, notAPI) { | ||
var resolveFunc = function(){}; | ||
@@ -29,11 +29,23 @@ var rejectFunc = function(){}; | ||
defaultFuncs | ||
.post(url, ctx.jar, form, {}) | ||
.then(function(resData) { | ||
callback(null, resData.body.toString()); | ||
}) | ||
.catch(function(err) { | ||
log.error("httpPost", err); | ||
return callback(err); | ||
}); | ||
if (notAPI) { | ||
utils | ||
.post(url, ctx.jar, form, ctx.globalOptions) | ||
.then(function(resData) { | ||
callback(null, resData.body.toString()); | ||
}) | ||
.catch(function(err) { | ||
log.error("httpPost", err); | ||
return callback(err); | ||
}); | ||
} else { | ||
defaultFuncs | ||
.post(url, ctx.jar, form, {}) | ||
.then(function(resData) { | ||
callback(null, resData.body.toString()); | ||
}) | ||
.catch(function(err) { | ||
log.error("httpPost", err); | ||
return callback(err); | ||
}); | ||
} | ||
@@ -40,0 +52,0 @@ return returnPromise; |
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
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
552756
7065