fca-nx 7.5.0 → 7.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +21 -15
- package/src/api/socket/core/connectMqtt.js +10 -0
package/package.json
CHANGED
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fca-nx",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.5",
|
|
4
4
|
"description": "Facebook Messenger API for Node.js — Fast, Secure, and Feature-Rich",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"facebook",
|
|
7
|
+
"chat",
|
|
8
|
+
"api",
|
|
9
|
+
"messenger",
|
|
10
|
+
"bot",
|
|
11
|
+
"unofficial",
|
|
12
|
+
"fca",
|
|
13
|
+
"fca-nx",
|
|
14
|
+
"xalman",
|
|
15
|
+
"messenger-bot",
|
|
16
|
+
"chatbot",
|
|
17
|
+
"facebook-api",
|
|
18
|
+
"messenger-chat",
|
|
19
|
+
"mqtt",
|
|
20
|
+
"e2ee",
|
|
21
|
+
"goatbot",
|
|
22
|
+
"unofficial-api",
|
|
23
|
+
"facebook-chat"
|
|
24
|
+
],
|
|
5
25
|
"main": "index.js",
|
|
6
26
|
"types": "index.d.ts",
|
|
7
27
|
"exports": {
|
|
@@ -27,20 +47,6 @@
|
|
|
27
47
|
"type": "git",
|
|
28
48
|
"url": "git+https://github.com/xalmandevv/fca-nx.git"
|
|
29
49
|
},
|
|
30
|
-
"keywords": [
|
|
31
|
-
"facebook",
|
|
32
|
-
"chat",
|
|
33
|
-
"api",
|
|
34
|
-
"messenger",
|
|
35
|
-
"bot",
|
|
36
|
-
"unofficial",
|
|
37
|
-
"fca",
|
|
38
|
-
"fca-nx",
|
|
39
|
-
"xalman",
|
|
40
|
-
"messenger-bot",
|
|
41
|
-
"chatbot",
|
|
42
|
-
"facebook-api"
|
|
43
|
-
],
|
|
44
50
|
"author": {
|
|
45
51
|
"name": "XALMAN",
|
|
46
52
|
"url": "https://github.com/xalmandevv"
|
|
@@ -38,6 +38,7 @@ module.exports = function createListenMqtt(deps) {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
function scheduleReconnect(delayMs) {
|
|
41
|
+
if (ctx._stoppedForLogin) return;
|
|
41
42
|
const base = (ctx._mqttOpt && ctx._mqttOpt.reconnectDelayMs) || DEFAULT_RECONNECT_DELAY_MS;
|
|
42
43
|
if (ctx._reconnectTimer) {
|
|
43
44
|
logger("mqtt reconnect already scheduled", "warn");
|
|
@@ -72,8 +73,17 @@ module.exports = function createListenMqtt(deps) {
|
|
|
72
73
|
ctx._forceFreshLogin = false;
|
|
73
74
|
}
|
|
74
75
|
if (ok && !ctx._ending) {
|
|
76
|
+
ctx._stoppedForLogin = false;
|
|
75
77
|
listenMqtt(defaultFuncs, api, ctx, globalCallback);
|
|
76
78
|
} else {
|
|
79
|
+
ctx._stoppedForLogin = true;
|
|
80
|
+
ctx._ending = true;
|
|
81
|
+
clearTimeout(ctx._reconnectTimer);
|
|
82
|
+
ctx._reconnectTimer = null;
|
|
83
|
+
try {
|
|
84
|
+
if (ctx.mqttClient) ctx.mqttClient.end(true);
|
|
85
|
+
} catch (_) { }
|
|
86
|
+
logger("mqtt stopped: fresh login is not available for this cookie session (no credentials). Refresh appstate and restart the bot.", "error");
|
|
77
87
|
globalCallback({ type: "stop_listen", error: "Fresh login failed after reconnect checks" }, null);
|
|
78
88
|
}
|
|
79
89
|
}, 0);
|