fca-unofficial
Advanced tools
Comparing version 1.2.6 to 1.2.7
18
index.js
@@ -82,3 +82,3 @@ "use strict"; | ||
var mqttData = html.match(/(\["MqttWebConfig",\[\],{fbid:")(.*)(",appID:219994525426954,endpoint:")(.*)(",pollingEndpoint:")(.*)(3790])/g)[0]; | ||
var mqttData = html.match(/(\["MqttWebConfig",\[\],{fbid:")(.+?)(",appID:219994525426954,endpoint:")(.+?)(",pollingEndpoint:")(.+?)(3790])/g)[0]; | ||
var mqttEndpoint = null; | ||
@@ -89,8 +89,12 @@ var region = null; | ||
} else { | ||
var mqttDataParsed = JSON.parse(mqttData)[2]; | ||
mqttEndpoint = mqttDataParsed.endpoint; | ||
region = new URL(mqttEndpoint).searchParams.get("region").toLocaleUpperCase(); | ||
log.info("login", `Got this account's message region: ${region}`); | ||
log.verbose("login", `MQTT endpoint: ${mqttEndpoint}`); | ||
log.verbose("login", `Polling endpoint: ${mqttDataParsed.pollingEndpoint} (unused)`); | ||
try { | ||
var mqttDataParsed = eval(mqttData)[2]; | ||
mqttEndpoint = mqttDataParsed.endpoint; | ||
region = new URL(mqttEndpoint).searchParams.get("region").toLocaleUpperCase(); | ||
log.info("login", `Got this account's message region: ${region}`); | ||
log.verbose("login", `MQTT endpoint: ${mqttEndpoint}`); | ||
log.verbose("login", `Polling endpoint: ${mqttDataParsed.pollingEndpoint} (unused)`); | ||
} catch (ex) { | ||
log.error("login", ex.toString()); | ||
} | ||
} | ||
@@ -97,0 +101,0 @@ |
{ | ||
"name": "fca-unofficial", | ||
"version": "1.2.6", | ||
"version": "1.2.7", | ||
"description": "A Facebook chat API that doesn't rely on XMPP. Will NOT be deprecated after April 30th 2015.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -29,3 +29,3 @@ "use strict"; | ||
defaultFuncs | ||
.get(url, ctx.jar, form) | ||
.get(url, ctx.jar, form, {}) | ||
.then(function(resData) { | ||
@@ -32,0 +32,0 @@ callback(null, resData.body.toString()); |
@@ -29,3 +29,3 @@ "use strict"; | ||
defaultFuncs | ||
.post(url, ctx.jar, form) | ||
.post(url, ctx.jar, form, {}) | ||
.then(function(resData) { | ||
@@ -32,0 +32,0 @@ callback(null, resData.body.toString()); |
12
utils.js
@@ -974,11 +974,11 @@ "use strict"; | ||
function postWithDefaults(url, jar, form) { | ||
return post(url, jar, mergeWithDefaults(form), ctx.globalOptions, ctx); | ||
function postWithDefaults(url, jar, form, ctxx) { | ||
return post(url, jar, mergeWithDefaults(form), ctx.globalOptions, ctxx || ctx); | ||
} | ||
function getWithDefaults(url, jar, qs) { | ||
return get(url, jar, mergeWithDefaults(qs), ctx.globalOptions, ctx); | ||
function getWithDefaults(url, jar, qs, ctxx) { | ||
return get(url, jar, mergeWithDefaults(qs), ctx.globalOptions, ctxx || ctx); | ||
} | ||
function postFormDataWithDefault(url, jar, form, qs) { | ||
function postFormDataWithDefault(url, jar, form, qs, ctxx) { | ||
return postFormData( | ||
@@ -990,3 +990,3 @@ url, | ||
ctx.globalOptions, | ||
ctx | ||
ctxx || ctx | ||
); | ||
@@ -993,0 +993,0 @@ } |
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
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
552088
7041
2