fca-nx 6.6.6
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/LICENCE +21 -0
- package/README.md +446 -0
- package/e2ee/config.json +0 -0
- package/e2ee/crypto.js +173 -0
- package/e2ee/index.js +1032 -0
- package/e2ee/proto/ArmadilloApplication.proto +281 -0
- package/e2ee/proto/ArmadilloICDC.proto +14 -0
- package/e2ee/proto/ConsumerApplication.proto +232 -0
- package/e2ee/proto/MessageApplication.proto +82 -0
- package/e2ee/proto/MessageTransport.proto +77 -0
- package/e2ee/proto/WACommon.proto +66 -0
- package/e2ee/proto/WAMediaTransport.proto +176 -0
- package/e2ee/protocol.js +196 -0
- package/e2ee/ratchet.js +219 -0
- package/e2ee/store.js +182 -0
- package/e2ee/vendor/fb-e2ee.cjs +9159 -0
- package/e2ee/vendor/proto/ArmadilloApplication.proto +281 -0
- package/e2ee/vendor/proto/ArmadilloICDC.proto +14 -0
- package/e2ee/vendor/proto/ConsumerApplication.proto +232 -0
- package/e2ee/vendor/proto/MessageApplication.proto +82 -0
- package/e2ee/vendor/proto/MessageTransport.proto +77 -0
- package/e2ee/vendor/proto/WACommon.proto +66 -0
- package/e2ee/vendor/proto/WAMediaTransport.proto +176 -0
- package/func/checkUpdate.js +7 -0
- package/func/logAdapter.js +33 -0
- package/func/logger.js +134 -0
- package/index.js +22 -0
- package/module/config.js +45 -0
- package/module/login.js +183 -0
- package/module/loginHelper.js +1382 -0
- package/module/options.js +52 -0
- package/package.json +101 -0
- package/src/api/action/addExternalModule.js +25 -0
- package/src/api/action/addFriend.js +145 -0
- package/src/api/action/changeAvatar.js +137 -0
- package/src/api/action/changeBio.js +75 -0
- package/src/api/action/changeCover.js +277 -0
- package/src/api/action/enableAutoSaveAppState.js +73 -0
- package/src/api/action/getCurrentUserID.js +7 -0
- package/src/api/action/handleFriendRequest.js +57 -0
- package/src/api/action/logout.js +76 -0
- package/src/api/action/refreshFb_dtsg.js +48 -0
- package/src/api/action/setPostReaction.js +106 -0
- package/src/api/action/unfriend.js +54 -0
- package/src/api/http/httpGet.js +46 -0
- package/src/api/http/httpPost.js +52 -0
- package/src/api/http/postFormData.js +47 -0
- package/src/api/messaging/addUserToGroup.js +68 -0
- package/src/api/messaging/changeAdminStatus.js +126 -0
- package/src/api/messaging/changeArchivedStatus.js +55 -0
- package/src/api/messaging/changeBlockedStatus.js +48 -0
- package/src/api/messaging/changeGroupImage.js +91 -0
- package/src/api/messaging/changeNickname.js +70 -0
- package/src/api/messaging/changeThreadColor.js +79 -0
- package/src/api/messaging/changeThreadEmoji.js +111 -0
- package/src/api/messaging/createNewGroup.js +88 -0
- package/src/api/messaging/createPoll.js +46 -0
- package/src/api/messaging/createThemeAI.js +98 -0
- package/src/api/messaging/deleteMessage.js +136 -0
- package/src/api/messaging/deleteThread.js +56 -0
- package/src/api/messaging/editMessage.js +90 -0
- package/src/api/messaging/forwardAttachment.js +57 -0
- package/src/api/messaging/forwardMessage.js +134 -0
- package/src/api/messaging/getEmojiUrl.js +29 -0
- package/src/api/messaging/getFriendsList.js +82 -0
- package/src/api/messaging/getMessage.js +829 -0
- package/src/api/messaging/getThemePictures.js +62 -0
- package/src/api/messaging/handleMessageRequest.js +65 -0
- package/src/api/messaging/markAsDelivered.js +57 -0
- package/src/api/messaging/markAsRead.js +88 -0
- package/src/api/messaging/markAsReadAll.js +49 -0
- package/src/api/messaging/markAsSeen.js +61 -0
- package/src/api/messaging/muteThread.js +50 -0
- package/src/api/messaging/pinMessage.js +115 -0
- package/src/api/messaging/removeUserFromGroup.js +62 -0
- package/src/api/messaging/resolvePhotoUrl.js +43 -0
- package/src/api/messaging/scheduler.js +264 -0
- package/src/api/messaging/searchForThread.js +53 -0
- package/src/api/messaging/sendBroadcast.js +93 -0
- package/src/api/messaging/sendMessage.js +269 -0
- package/src/api/messaging/sendTypingIndicator.js +74 -0
- package/src/api/messaging/sessionGuard.js +208 -0
- package/src/api/messaging/setMessageReaction.js +95 -0
- package/src/api/messaging/setTitle.js +124 -0
- package/src/api/messaging/shareContact.js +49 -0
- package/src/api/messaging/threadColors.js +128 -0
- package/src/api/messaging/unsendMessage.js +81 -0
- package/src/api/messaging/uploadAttachment.js +523 -0
- package/src/api/socket/OldMessage.js +186 -0
- package/src/api/socket/core/connectMqtt.js +320 -0
- package/src/api/socket/core/emitAuth.js +103 -0
- package/src/api/socket/core/getSeqID.js +338 -0
- package/src/api/socket/core/getTaskResponseData.js +25 -0
- package/src/api/socket/core/parseDelta.js +387 -0
- package/src/api/socket/detail/buildStream.js +215 -0
- package/src/api/socket/detail/constants.js +28 -0
- package/src/api/socket/e2ee/crypto.js +173 -0
- package/src/api/socket/e2ee/e2ee/crypto.js +173 -0
- package/src/api/socket/e2ee/e2ee/index.js +421 -0
- package/src/api/socket/e2ee/e2ee/proto/ArmadilloApplication.proto +281 -0
- package/src/api/socket/e2ee/e2ee/proto/ArmadilloICDC.proto +14 -0
- package/src/api/socket/e2ee/e2ee/proto/ConsumerApplication.proto +232 -0
- package/src/api/socket/e2ee/e2ee/proto/MessageApplication.proto +82 -0
- package/src/api/socket/e2ee/e2ee/proto/MessageTransport.proto +77 -0
- package/src/api/socket/e2ee/e2ee/proto/WACommon.proto +66 -0
- package/src/api/socket/e2ee/e2ee/proto/WAMediaTransport.proto +176 -0
- package/src/api/socket/e2ee/e2ee/protocol.js +196 -0
- package/src/api/socket/e2ee/e2ee/ratchet.js +219 -0
- package/src/api/socket/e2ee/e2ee/store.js +182 -0
- package/src/api/socket/e2ee/e2ee/vendor/fb-e2ee.cjs +9162 -0
- package/src/api/socket/e2ee/e2ee/vendor/proto/ArmadilloApplication.proto +281 -0
- package/src/api/socket/e2ee/e2ee/vendor/proto/ArmadilloICDC.proto +14 -0
- package/src/api/socket/e2ee/e2ee/vendor/proto/ConsumerApplication.proto +232 -0
- package/src/api/socket/e2ee/e2ee/vendor/proto/MessageApplication.proto +82 -0
- package/src/api/socket/e2ee/e2ee/vendor/proto/MessageTransport.proto +77 -0
- package/src/api/socket/e2ee/e2ee/vendor/proto/WACommon.proto +66 -0
- package/src/api/socket/e2ee/e2ee/vendor/proto/WAMediaTransport.proto +176 -0
- package/src/api/socket/e2ee/index.js +437 -0
- package/src/api/socket/e2ee/proto/ArmadilloApplication.proto +281 -0
- package/src/api/socket/e2ee/proto/ArmadilloICDC.proto +14 -0
- package/src/api/socket/e2ee/proto/ConsumerApplication.proto +232 -0
- package/src/api/socket/e2ee/proto/MessageApplication.proto +82 -0
- package/src/api/socket/e2ee/proto/MessageTransport.proto +77 -0
- package/src/api/socket/e2ee/proto/WACommon.proto +66 -0
- package/src/api/socket/e2ee/proto/WAMediaTransport.proto +176 -0
- package/src/api/socket/e2ee/protocol.js +196 -0
- package/src/api/socket/e2ee/ratchet.js +219 -0
- package/src/api/socket/e2ee/store.js +182 -0
- package/src/api/socket/e2ee/vendor/fb-e2ee.cjs +9162 -0
- package/src/api/socket/e2ee/vendor/proto/ArmadilloApplication.proto +281 -0
- package/src/api/socket/e2ee/vendor/proto/ArmadilloICDC.proto +14 -0
- package/src/api/socket/e2ee/vendor/proto/ConsumerApplication.proto +232 -0
- package/src/api/socket/e2ee/vendor/proto/MessageApplication.proto +82 -0
- package/src/api/socket/e2ee/vendor/proto/MessageTransport.proto +77 -0
- package/src/api/socket/e2ee/vendor/proto/WACommon.proto +66 -0
- package/src/api/socket/e2ee/vendor/proto/WAMediaTransport.proto +176 -0
- package/src/api/socket/listenE2EE.js +75 -0
- package/src/api/socket/listenMqtt.js +551 -0
- package/src/api/socket/middleware/index.js +216 -0
- package/src/api/socket/sendMessage.js +309 -0
- package/src/api/socket/sendMessageMqtt.js +69 -0
- package/src/api/threads/getThreadHistory.js +664 -0
- package/src/api/threads/getThreadInfo.js +296 -0
- package/src/api/threads/getThreadList.js +293 -0
- package/src/api/threads/getThreadPictures.js +78 -0
- package/src/api/users/getUserID.js +65 -0
- package/src/api/users/getUserInfo.js +402 -0
- package/src/api/users/getUserInfoV2.js +911 -0
- package/src/app/MessengerBot.js +209 -0
- package/src/app/MessengerContext.js +32 -0
- package/src/app/createFcaClient.js +139 -0
- package/src/app/threadInfoRealtimeSync.js +284 -0
- package/src/core/sendReqMqtt.js +96 -0
- package/src/database/helpers.js +53 -0
- package/src/database/models/index.js +88 -0
- package/src/database/models/thread.js +50 -0
- package/src/database/models/user.js +46 -0
- package/src/database/threadData.js +94 -0
- package/src/database/userData.js +98 -0
- package/src/remote/remoteClient.js +123 -0
- package/src/utils/broadcast.js +51 -0
- package/src/utils/client.js +10 -0
- package/src/utils/clientIdentity.js +118 -0
- package/src/utils/constants.js +23 -0
- package/src/utils/cookies.js +68 -0
- package/src/utils/format/attachment.js +357 -0
- package/src/utils/format/cookie.js +9 -0
- package/src/utils/format/date.js +50 -0
- package/src/utils/format/decode.js +44 -0
- package/src/utils/format/delta.js +194 -0
- package/src/utils/format/ids.js +64 -0
- package/src/utils/format/index.js +64 -0
- package/src/utils/format/message.js +88 -0
- package/src/utils/format/presence.js +132 -0
- package/src/utils/format/readTyp.js +44 -0
- package/src/utils/format/thread.js +42 -0
- package/src/utils/format/utils.js +141 -0
- package/src/utils/headers.js +124 -0
- package/src/utils/logger.js +144 -0
- package/src/utils/loginParser/autoLogin.js +125 -0
- package/src/utils/loginParser/helpers.js +43 -0
- package/src/utils/loginParser/index.js +10 -0
- package/src/utils/loginParser/parseAndCheckLogin.js +220 -0
- package/src/utils/loginParser/textUtils.js +28 -0
- package/src/utils/request/client.js +26 -0
- package/src/utils/request/config.js +29 -0
- package/src/utils/request/defaults.js +46 -0
- package/src/utils/request/helpers.js +46 -0
- package/src/utils/request/index.js +17 -0
- package/src/utils/request/methods.js +163 -0
- package/src/utils/request/proxy.js +46 -0
- package/src/utils/request/retry.js +77 -0
- package/src/utils/request/sanitize.js +49 -0
- package/src/utils/utils.js +686 -0
- package/src/utils/versionCheck.js +47 -0
- package/src/vendor/fca-unofficial/index.js +11 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var utils = require("../../utils/utils");
|
|
4
|
+
var logger = require("../../utils/logger");
|
|
5
|
+
var bluebird = require("bluebird");
|
|
6
|
+
|
|
7
|
+
var allowedProperties = {
|
|
8
|
+
attachment: true, url: true, sticker: true, emoji: true,
|
|
9
|
+
emojiSize: true, body: true, mentions: true, location: true,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
module.exports = function (defaultFuncs, api, ctx) {
|
|
13
|
+
|
|
14
|
+
function uploadAttachment(attachments, callback) {
|
|
15
|
+
var uploads = [];
|
|
16
|
+
for (var i = 0; i < attachments.length; i++) {
|
|
17
|
+
if (!utils.isReadableStream(attachments[i])) {
|
|
18
|
+
return callback({ error: "Attachment must be a readable stream." });
|
|
19
|
+
}
|
|
20
|
+
uploads.push(
|
|
21
|
+
defaultFuncs.postFormData("https://upload.facebook.com/ajax/mercury/upload.php", ctx.jar, {
|
|
22
|
+
upload_1024: attachments[i],
|
|
23
|
+
voice_clip: "true"
|
|
24
|
+
})
|
|
25
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
|
26
|
+
.then(resData => {
|
|
27
|
+
if (resData.error) throw resData;
|
|
28
|
+
return resData.payload.metadata[0];
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
bluebird.all(uploads)
|
|
33
|
+
.then(resData => callback(null, resData))
|
|
34
|
+
.catch(err => { logger.error("OldMessage.upload", err); callback(err); });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function getUrl(url, callback) {
|
|
38
|
+
defaultFuncs.post("https://www.facebook.com/message_share_attachment/fromURI/", ctx.jar, {
|
|
39
|
+
image_height: 960, image_width: 960, uri: url
|
|
40
|
+
})
|
|
41
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
|
42
|
+
.then(resData => {
|
|
43
|
+
if (resData.error) return callback(resData);
|
|
44
|
+
if (!resData.payload) return callback({ error: "Invalid URL" });
|
|
45
|
+
callback(null, resData.payload.share_data.share_params);
|
|
46
|
+
})
|
|
47
|
+
.catch(err => { logger.error("OldMessage.getUrl", err); callback(err); });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function sendContent(form, threadID, isSingleUser, messageAndOTID, callback) {
|
|
51
|
+
if (utils.getType(threadID) === "Array") {
|
|
52
|
+
for (var i = 0; i < threadID.length; i++) form["specific_to_list[" + i + "]"] = "fbid:" + threadID[i];
|
|
53
|
+
form["specific_to_list[" + threadID.length + "]"] = "fbid:" + ctx.userID;
|
|
54
|
+
form["client_thread_id"] = "root:" + messageAndOTID;
|
|
55
|
+
} else {
|
|
56
|
+
if (isSingleUser) {
|
|
57
|
+
form["specific_to_list[0]"] = "fbid:" + threadID;
|
|
58
|
+
form["specific_to_list[1]"] = "fbid:" + ctx.userID;
|
|
59
|
+
form["other_user_fbid"] = threadID;
|
|
60
|
+
} else {
|
|
61
|
+
form["thread_fbid"] = threadID;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (ctx.globalOptions.pageID) {
|
|
66
|
+
form["author"] = "fbid:" + ctx.globalOptions.pageID;
|
|
67
|
+
form["specific_to_list[1]"] = "fbid:" + ctx.globalOptions.pageID;
|
|
68
|
+
form["creator_info[creatorID]"] = ctx.userID;
|
|
69
|
+
form["creator_info[creatorType]"] = "direct_admin";
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
defaultFuncs.post("https://www.facebook.com/messaging/send/", ctx.jar, form)
|
|
73
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
|
74
|
+
.then(resData => {
|
|
75
|
+
if (!resData.payload) throw resData;
|
|
76
|
+
var messageID = (resData.payload.actions && resData.payload.actions[0] &&
|
|
77
|
+
resData.payload.actions[0].message_id) || null;
|
|
78
|
+
var threadID2 = resData.payload.thread_fbid ||
|
|
79
|
+
(resData.payload.actions && resData.payload.actions[0] && resData.payload.actions[0].thread_fbid);
|
|
80
|
+
callback(null, {
|
|
81
|
+
threadID: threadID2 ? String(threadID2) : String(threadID),
|
|
82
|
+
messageID: messageID ? String(messageID) : null,
|
|
83
|
+
timestamp: resData.payload.timestamp
|
|
84
|
+
});
|
|
85
|
+
})
|
|
86
|
+
.catch(err => { logger.error("OldMessage.send", err); callback(err); });
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function send(form, threadID, isSingleUser, callback) {
|
|
90
|
+
var messageAndOTID = utils.generateOfflineThreadingID();
|
|
91
|
+
form.client = "mercury";
|
|
92
|
+
form.action_type = "ma-type:user-generated-message";
|
|
93
|
+
form.timestamp = Date.now();
|
|
94
|
+
form.timestamp_absolute = "Today";
|
|
95
|
+
form.timestamp_relative = "12:00";
|
|
96
|
+
form.timestamp_time_passed = "0";
|
|
97
|
+
form.is_unread = false;
|
|
98
|
+
form.is_cleared = false;
|
|
99
|
+
form.is_forward = false;
|
|
100
|
+
form.is_filtered_content = false;
|
|
101
|
+
form.is_filtered_content_bec = false;
|
|
102
|
+
form.is_filtered_content_account = false;
|
|
103
|
+
form.is_filtered_content_quasar = false;
|
|
104
|
+
form.is_filtered_content_invalid_app = false;
|
|
105
|
+
form.is_not_supported = false;
|
|
106
|
+
form.message_id = messageAndOTID;
|
|
107
|
+
form.offline_threading_id = messageAndOTID;
|
|
108
|
+
form.ephemeral_ttl_mode = 0;
|
|
109
|
+
form.manual_retry_cnt = 0;
|
|
110
|
+
form.has_attachment = false;
|
|
111
|
+
form.signatureID = utils.getGUID().replace(/-/g, "").slice(0, 8);
|
|
112
|
+
sendContent(form, threadID, isSingleUser, messageAndOTID, callback);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return function OldMessage(msg, threadID, callback, replyToMessage, isSingleUser) {
|
|
116
|
+
if (typeof msg === "string") msg = { body: msg };
|
|
117
|
+
|
|
118
|
+
if (msg.body && /(https?:\/\/|www\.|t\.me\/|fb\.me\/|youtu\.be\/|facebook\.com\/|youtube\.com\/)/i.test(msg.body)) {
|
|
119
|
+
return require('./sendMessage')(defaultFuncs, api, ctx)(msg, threadID, callback, replyToMessage, false);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
var resolveFunc = () => { };
|
|
123
|
+
var rejectFunc = () => { };
|
|
124
|
+
var promise = new Promise((res, rej) => { resolveFunc = res; rejectFunc = rej; });
|
|
125
|
+
if (!callback) {
|
|
126
|
+
callback = (err, data) => err ? rejectFunc(err) : resolveFunc(data);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
for (var key in msg) {
|
|
130
|
+
if (!allowedProperties[key]) {
|
|
131
|
+
return callback({ error: "OldMessage: Unknown property '" + key + "'" });
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
var form = {};
|
|
136
|
+
if (msg.body) form.body = msg.body;
|
|
137
|
+
|
|
138
|
+
if (msg.mentions && Array.isArray(msg.mentions)) {
|
|
139
|
+
form.body = msg.body || "";
|
|
140
|
+
form['profile_to_mention[0]'] = msg.mentions.map(m => m.id).join(",");
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (replyToMessage) form.replied_to_message_id = replyToMessage;
|
|
144
|
+
|
|
145
|
+
if (msg.sticker) {
|
|
146
|
+
form["has_attachment"] = true;
|
|
147
|
+
form["sticker_id"] = msg.sticker;
|
|
148
|
+
return send(form, threadID, isSingleUser, callback);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (msg.emoji) {
|
|
152
|
+
form.body = msg.emoji;
|
|
153
|
+
var size = msg.emojiSize || "small";
|
|
154
|
+
form["emoji_size"] = size;
|
|
155
|
+
return send(form, threadID, isSingleUser, callback);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (msg.url) {
|
|
159
|
+
return getUrl(msg.url, (err, shareData) => {
|
|
160
|
+
if (err) return callback(err);
|
|
161
|
+
form["has_attachment"] = true;
|
|
162
|
+
form["image_ids[0]"] = shareData.image_ids && shareData.image_ids[0];
|
|
163
|
+
form["share_params"] = JSON.stringify(shareData);
|
|
164
|
+
send(form, threadID, isSingleUser, callback);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (msg.attachment) {
|
|
169
|
+
var attachments = Array.isArray(msg.attachment) ? msg.attachment : [msg.attachment];
|
|
170
|
+
return uploadAttachment(attachments, (err, uploaded) => {
|
|
171
|
+
if (err) return callback(err);
|
|
172
|
+
form["has_attachment"] = true;
|
|
173
|
+
uploaded.forEach((u, i) => {
|
|
174
|
+
if (u.image_id) form["image_ids[" + i + "]"] = u.image_id;
|
|
175
|
+
else if (u.video_id) form["video_ids[" + i + "]"] = u.video_id;
|
|
176
|
+
else if (u.file_id) form["file_ids[" + i + "]"] = u.file_id;
|
|
177
|
+
else if (u.audio_id) form["audio_ids[" + i + "]"] = u.audio_id;
|
|
178
|
+
});
|
|
179
|
+
send(form, threadID, isSingleUser, callback);
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
send(form, threadID, isSingleUser, callback);
|
|
184
|
+
return promise;
|
|
185
|
+
};
|
|
186
|
+
};
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MQTT/WebSocket listener for Facebook Messenger real-time events.
|
|
4
|
+
* Connects to edge-chat.facebook.com, subscribes to topics, parses deltas and typing/presence.
|
|
5
|
+
*/
|
|
6
|
+
const { formatID } = require("../../../utils/format");
|
|
7
|
+
const { getSessionIdentity } = require("../../../utils/clientIdentity");
|
|
8
|
+
|
|
9
|
+
const DEFAULT_RECONNECT_DELAY_MS = 2000;
|
|
10
|
+
const MAX_RECONNECT_DELAY_MS = 60000;
|
|
11
|
+
const MAX_RECONNECT_ATTEMPTS = 10; // cap consecutive network-failure reconnects; does not apply to confirmed auth failures (those never reconnect)
|
|
12
|
+
const T_MS_WAIT_TIMEOUT_MS = 5000;
|
|
13
|
+
|
|
14
|
+
// Exponential backoff with jitter, based on how many *consecutive* reconnect
|
|
15
|
+
// attempts have happened for this session (reset to 0 on a successful
|
|
16
|
+
// "connect" event). This replaces the old fixed 2s-every-time behavior,
|
|
17
|
+
// which could hammer the endpoint in a tight loop during real outages.
|
|
18
|
+
function computeBackoff(ctx, baseMs) {
|
|
19
|
+
const attempt = (ctx._reconnectAttempts || 0);
|
|
20
|
+
const exp = Math.min(baseMs * Math.pow(2, attempt), MAX_RECONNECT_DELAY_MS);
|
|
21
|
+
const jitter = Math.floor(Math.random() * Math.min(1000, exp * 0.2));
|
|
22
|
+
return Math.min(exp + jitter, MAX_RECONNECT_DELAY_MS);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
module.exports = function createListenMqtt(deps) {
|
|
26
|
+
const { WebSocket, mqtt, HttpsProxyAgent, buildStream, buildProxy,
|
|
27
|
+
topics, parseDelta, getTaskResponseData, logger, emitAuth
|
|
28
|
+
} = deps;
|
|
29
|
+
|
|
30
|
+
return function listenMqtt(defaultFuncs, api, ctx, globalCallback) {
|
|
31
|
+
|
|
32
|
+
function scheduleReconnect(delayMs) {
|
|
33
|
+
const base = (ctx._mqttOpt && ctx._mqttOpt.reconnectDelayMs) || DEFAULT_RECONNECT_DELAY_MS;
|
|
34
|
+
if (ctx._reconnectTimer) {
|
|
35
|
+
logger("mqtt reconnect already scheduled", "warn");
|
|
36
|
+
return; // debounce
|
|
37
|
+
}
|
|
38
|
+
if (ctx._ending) {
|
|
39
|
+
// Covers confirmed logout/checkpoint/blocked-login/invalid-session:
|
|
40
|
+
// emitAuth() sets ctx._ending = true before this is ever reached for
|
|
41
|
+
// those cases, so we never auto-reconnect after a confirmed auth failure.
|
|
42
|
+
logger("mqtt reconnect skipped - ending", "warn");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
ctx._reconnectAttempts = (ctx._reconnectAttempts || 0) + 1;
|
|
46
|
+
if (ctx._reconnectAttempts > MAX_RECONNECT_ATTEMPTS) {
|
|
47
|
+
logger(`mqtt reconnect attempts exceeded (${MAX_RECONNECT_ATTEMPTS}); giving up and surfacing error`, "error");
|
|
48
|
+
globalCallback({ type: "stop_listen", error: "Max reconnect attempts exceeded" }, null);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const ms = typeof delayMs === "number" ? delayMs : computeBackoff(ctx, base);
|
|
52
|
+
logger(`mqtt will reconnect in ${ms}ms (attempt ${ctx._reconnectAttempts}/${MAX_RECONNECT_ATTEMPTS})`, "warn");
|
|
53
|
+
ctx._reconnectTimer = setTimeout(() => {
|
|
54
|
+
ctx._reconnectTimer = null;
|
|
55
|
+
if (!ctx._ending) {
|
|
56
|
+
listenMqtt(defaultFuncs, api, ctx, globalCallback);
|
|
57
|
+
}
|
|
58
|
+
}, ms);
|
|
59
|
+
}
|
|
60
|
+
function isEndingLikeError(msg) {
|
|
61
|
+
return /No subscription existed|client disconnecting|socket hang up|ECONNRESET/i.test(msg || "");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Ensure only one MQTT connection exists for this session, and that any
|
|
65
|
+
// previous connection is fully closed (listeners removed, socket ended)
|
|
66
|
+
// before a new one is opened. Without this, a reconnect racing with a
|
|
67
|
+
// still-live prior connection could leave two live sockets publishing/
|
|
68
|
+
// subscribing under the same session, which looks like an invalid/
|
|
69
|
+
// duplicate session to the server.
|
|
70
|
+
if (ctx.mqttClient) {
|
|
71
|
+
try {
|
|
72
|
+
ctx.mqttClient.removeAllListeners();
|
|
73
|
+
if (ctx.mqttClient.connected) ctx.mqttClient.end(true);
|
|
74
|
+
} catch (_) { }
|
|
75
|
+
ctx.mqttClient = undefined;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Resolve the identity ONCE per session (cached on ctx) so MQTT and HTTP
|
|
79
|
+
// never disagree about User-Agent / Accept-Language mid-session.
|
|
80
|
+
const identity = getSessionIdentity(ctx);
|
|
81
|
+
|
|
82
|
+
const chatOn = ctx.globalOptions.online;
|
|
83
|
+
const sessionID = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER) + 1;
|
|
84
|
+
const username = {
|
|
85
|
+
u: ctx.userID, s: sessionID, chat_on: chatOn, fg: false, d: ctx.clientId,
|
|
86
|
+
ct: "websocket", aid: 219994525426954, aids: null, mqtt_sid: "",
|
|
87
|
+
cp: 3, ecp: 10, st: [], pm: [], dc: "", no_auto_fg: true, gas: null, pack: [], p: null, php_override: ""
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const cookies = api.getCookies();
|
|
91
|
+
let host;
|
|
92
|
+
if (ctx.mqttEndpoint) host = `${ctx.mqttEndpoint}&sid=${sessionID}&cid=${ctx.clientId}`;
|
|
93
|
+
else if (ctx.region) host = `wss://edge-chat.facebook.com/chat?region=${ctx.region.toLowerCase()}&sid=${sessionID}&cid=${ctx.clientId}`;
|
|
94
|
+
else host = `wss://edge-chat.facebook.com/chat?sid=${sessionID}&cid=${ctx.clientId}`;
|
|
95
|
+
|
|
96
|
+
const options = {
|
|
97
|
+
clientId: "mqttwsclient",
|
|
98
|
+
protocolId: "MQIsdp",
|
|
99
|
+
protocolVersion: 3,
|
|
100
|
+
username: JSON.stringify(username),
|
|
101
|
+
clean: true,
|
|
102
|
+
wsOptions: {
|
|
103
|
+
headers: {
|
|
104
|
+
Cookie: cookies,
|
|
105
|
+
Origin: "https://www.facebook.com",
|
|
106
|
+
"User-Agent": identity.userAgent,
|
|
107
|
+
Referer: "https://www.facebook.com/",
|
|
108
|
+
Host: "edge-chat.facebook.com",
|
|
109
|
+
Connection: "Upgrade",
|
|
110
|
+
Pragma: "no-cache",
|
|
111
|
+
"Cache-Control": "no-cache",
|
|
112
|
+
Upgrade: "websocket",
|
|
113
|
+
"Sec-WebSocket-Version": "13",
|
|
114
|
+
"Accept-Encoding": "gzip, deflate, br",
|
|
115
|
+
// Must match the Accept-Language used for HTTP requests in this same
|
|
116
|
+
// session (src/utils/headers.js) - it previously hard-coded "vi,en;q=0.9"
|
|
117
|
+
// here while HTTP requests defaulted to "en-US,en;q=0.9,vi;q=0.8",
|
|
118
|
+
// which is a contradictory-client signal between the two channels.
|
|
119
|
+
"Accept-Language": identity.acceptLanguage,
|
|
120
|
+
"Sec-WebSocket-Extensions": "permessage-deflate; client_max_window_bits"
|
|
121
|
+
},
|
|
122
|
+
origin: "https://www.facebook.com",
|
|
123
|
+
protocolVersion: 13,
|
|
124
|
+
binaryType: "arraybuffer"
|
|
125
|
+
},
|
|
126
|
+
keepalive: 30,
|
|
127
|
+
reschedulePings: true,
|
|
128
|
+
reconnectPeriod: 0,
|
|
129
|
+
connectTimeout: 5000
|
|
130
|
+
};
|
|
131
|
+
if (ctx.globalOptions.proxy !== undefined) {
|
|
132
|
+
const agent = new HttpsProxyAgent(ctx.globalOptions.proxy);
|
|
133
|
+
options.wsOptions.agent = agent;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
ctx.mqttClient = new mqtt.Client(
|
|
137
|
+
() => buildStream(options, new WebSocket(host, options.wsOptions), buildProxy()),
|
|
138
|
+
options
|
|
139
|
+
);
|
|
140
|
+
const mqttClient = ctx.mqttClient;
|
|
141
|
+
|
|
142
|
+
mqttClient.on("error", function (err) {
|
|
143
|
+
const msg = String(err && err.message ? err.message : err || "");
|
|
144
|
+
if ((ctx._ending || ctx._cycling) && /No subscription existed|client disconnecting/i.test(msg)) {
|
|
145
|
+
logger(`mqtt expected during shutdown: ${msg}`, "info");
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (/Invalid header flag bits|must be 0x0 for puback/i.test(msg)) {
|
|
150
|
+
logger(`mqtt puback ignored: ${msg}`, "warn");
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (/Not logged in|Not logged in.|blocked the login|401|403/i.test(msg)) {
|
|
155
|
+
try {
|
|
156
|
+
if (mqttClient && mqttClient.connected) {
|
|
157
|
+
mqttClient.end(true);
|
|
158
|
+
}
|
|
159
|
+
} catch (_) { }
|
|
160
|
+
return emitAuth(ctx, api, globalCallback,
|
|
161
|
+
/blocked/i.test(msg) ? "login_blocked" : "not_logged_in",
|
|
162
|
+
msg
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
logger(`mqtt error: ${msg}`, "error");
|
|
166
|
+
try {
|
|
167
|
+
if (mqttClient && mqttClient.connected) {
|
|
168
|
+
mqttClient.end(true);
|
|
169
|
+
}
|
|
170
|
+
} catch (_) { }
|
|
171
|
+
if (ctx._ending || ctx._cycling) return;
|
|
172
|
+
|
|
173
|
+
if (ctx.globalOptions.autoReconnect && !ctx._ending) {
|
|
174
|
+
// Let scheduleReconnect() compute the exponential-backoff delay
|
|
175
|
+
// itself (instead of always passing the same fixed base delay),
|
|
176
|
+
// so repeated network failures back off instead of retrying every
|
|
177
|
+
// ~2s indefinitely.
|
|
178
|
+
scheduleReconnect();
|
|
179
|
+
} else {
|
|
180
|
+
globalCallback({ type: "stop_listen", error: msg || "Connection refused" }, null);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
mqttClient.on("connect", function () {
|
|
185
|
+
if (process.env.OnStatus === undefined) {
|
|
186
|
+
logger("fca-unofficial", "info");
|
|
187
|
+
process.env.OnStatus = true;
|
|
188
|
+
}
|
|
189
|
+
ctx._cycling = false;
|
|
190
|
+
// A successful connect means the session/identity/network are fine -
|
|
191
|
+
// reset the backoff counter so a later transient failure starts a
|
|
192
|
+
// fresh backoff sequence instead of inheriting a long delay from an
|
|
193
|
+
// unrelated earlier outage.
|
|
194
|
+
ctx._reconnectAttempts = 0;
|
|
195
|
+
|
|
196
|
+
topics.forEach(t => mqttClient.subscribe(t));
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
const queue = {
|
|
200
|
+
sync_api_version: 11, max_deltas_able_to_process: 100, delta_batch_size: 500,
|
|
201
|
+
encoding: "JSON", entity_fbid: ctx.userID, initial_titan_sequence_id: ctx.lastSeqId, device_params: null
|
|
202
|
+
};
|
|
203
|
+
const topic = ctx.syncToken ? "/messenger_sync_get_diffs" : "/messenger_sync_create_queue";
|
|
204
|
+
if (ctx.syncToken) { queue.last_seq_id = ctx.lastSeqId; queue.sync_token = ctx.syncToken; }
|
|
205
|
+
mqttClient.publish(topic, JSON.stringify(queue), { qos: 1, retain: false });
|
|
206
|
+
mqttClient.publish("/foreground_state", JSON.stringify({ foreground: chatOn }), { qos: 1 });
|
|
207
|
+
mqttClient.publish("/set_client_settings", JSON.stringify({ make_user_available_when_in_foreground: true }), { qos: 1 });
|
|
208
|
+
let rTimeout = setTimeout(function () {
|
|
209
|
+
rTimeout = null;
|
|
210
|
+
if (ctx._ending) {
|
|
211
|
+
logger("mqtt t_ms timeout skipped - ending", "warn");
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
logger("mqtt t_ms timeout, cycling", "warn");
|
|
215
|
+
try {
|
|
216
|
+
if (mqttClient && mqttClient.connected) {
|
|
217
|
+
mqttClient.end(true);
|
|
218
|
+
}
|
|
219
|
+
} catch (_) { }
|
|
220
|
+
scheduleReconnect();
|
|
221
|
+
}, T_MS_WAIT_TIMEOUT_MS);
|
|
222
|
+
|
|
223
|
+
// Store timeout reference for cleanup
|
|
224
|
+
ctx._rTimeout = rTimeout;
|
|
225
|
+
|
|
226
|
+
ctx.tmsWait = function () {
|
|
227
|
+
if (rTimeout) {
|
|
228
|
+
clearTimeout(rTimeout);
|
|
229
|
+
rTimeout = null;
|
|
230
|
+
}
|
|
231
|
+
if (ctx._rTimeout) {
|
|
232
|
+
delete ctx._rTimeout;
|
|
233
|
+
}
|
|
234
|
+
if (ctx.globalOptions.emitReady) globalCallback({ type: "ready", error: null });
|
|
235
|
+
delete ctx.tmsWait;
|
|
236
|
+
};
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
mqttClient.on("message", function (topic, message) {
|
|
240
|
+
if (ctx._ending) return; // Ignore messages if ending
|
|
241
|
+
try {
|
|
242
|
+
let jsonMessage = Buffer.isBuffer(message) ? Buffer.from(message).toString() : message;
|
|
243
|
+
try {
|
|
244
|
+
jsonMessage = JSON.parse(jsonMessage);
|
|
245
|
+
} catch (parseErr) {
|
|
246
|
+
logger(`mqtt message parse error for topic ${topic}: ${parseErr && parseErr.message ? parseErr.message : String(parseErr)}`, "warn");
|
|
247
|
+
jsonMessage = {};
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (jsonMessage.type === "jewel_requests_add") {
|
|
251
|
+
globalCallback(null, { type: "friend_request_received", actorFbId: jsonMessage.from.toString(), timestamp: Date.now().toString() });
|
|
252
|
+
} else if (jsonMessage.type === "jewel_requests_remove_old") {
|
|
253
|
+
globalCallback(null, { type: "friend_request_cancel", actorFbId: jsonMessage.from.toString(), timestamp: Date.now().toString() });
|
|
254
|
+
} else if (topic === "/t_ms") {
|
|
255
|
+
if (ctx.tmsWait && typeof ctx.tmsWait == "function") ctx.tmsWait();
|
|
256
|
+
if (jsonMessage.firstDeltaSeqId && jsonMessage.syncToken) {
|
|
257
|
+
ctx.lastSeqId = jsonMessage.firstDeltaSeqId;
|
|
258
|
+
ctx.syncToken = jsonMessage.syncToken;
|
|
259
|
+
}
|
|
260
|
+
if (jsonMessage.lastIssuedSeqId) ctx.lastSeqId = parseInt(jsonMessage.lastIssuedSeqId);
|
|
261
|
+
for (const dlt of (jsonMessage.deltas || [])) {
|
|
262
|
+
parseDelta(defaultFuncs, api, ctx, globalCallback, { delta: dlt });
|
|
263
|
+
}
|
|
264
|
+
} else if (topic === "/thread_typing" || topic === "/orca_typing_notifications") {
|
|
265
|
+
const typ = {
|
|
266
|
+
type: "typ",
|
|
267
|
+
isTyping: !!jsonMessage.state,
|
|
268
|
+
from: jsonMessage.sender_fbid.toString(),
|
|
269
|
+
threadID: formatID((jsonMessage.thread || jsonMessage.sender_fbid).toString())
|
|
270
|
+
};
|
|
271
|
+
globalCallback(null, typ);
|
|
272
|
+
} else if (topic === "/orca_presence") {
|
|
273
|
+
if (!ctx.globalOptions.updatePresence) {
|
|
274
|
+
for (const data of (jsonMessage.list || [])) {
|
|
275
|
+
const presence = { type: "presence", userID: String(data.u), timestamp: data.l * 1000, statuses: data.p };
|
|
276
|
+
globalCallback(null, presence);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
} else if (topic === "/ls_resp") {
|
|
280
|
+
const parsedPayload = JSON.parse(jsonMessage.payload);
|
|
281
|
+
const reqID = jsonMessage.request_id;
|
|
282
|
+
const tasks = ctx.tasks;
|
|
283
|
+
if (tasks && tasks instanceof Map && tasks.has(reqID)) {
|
|
284
|
+
const taskData = tasks.get(reqID);
|
|
285
|
+
const { type: taskType, callback: taskCallback } = taskData;
|
|
286
|
+
const taskRespData = getTaskResponseData(taskType, parsedPayload);
|
|
287
|
+
if (taskRespData == null) taskCallback("error", null);
|
|
288
|
+
else taskCallback(null, Object.assign({ type: taskType, reqID }, taskRespData));
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
} catch (ex) {
|
|
292
|
+
const errMsg = ex && ex.message ? ex.message : String(ex || "Unknown error");
|
|
293
|
+
logger(`mqtt message handler error: ${errMsg}`, "error");
|
|
294
|
+
// Don't crash on message parsing errors, just log and continue
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
mqttClient.on("close", function () {
|
|
299
|
+
if (ctx._ending || ctx._cycling) {
|
|
300
|
+
logger("mqtt close expected", "info");
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
logger("mqtt connection closed", "warn");
|
|
304
|
+
if (ctx.globalOptions.autoReconnect && !ctx._ending) {
|
|
305
|
+
scheduleReconnect();
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
mqttClient.on("disconnect", () => {
|
|
310
|
+
if (ctx._ending || ctx._cycling) {
|
|
311
|
+
logger("mqtt disconnect expected", "info");
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
logger("mqtt disconnected", "warn");
|
|
315
|
+
if (ctx.globalOptions.autoReconnect && !ctx._ending) {
|
|
316
|
+
scheduleReconnect();
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
};
|
|
320
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Emits account_inactive to the global callback and cleans up MQTT/timers/scheduler.
|
|
4
|
+
* Used when login is invalid, blocked, or session is lost.
|
|
5
|
+
*/
|
|
6
|
+
module.exports = function createEmitAuth({ logger }) {
|
|
7
|
+
return function emitAuth(ctx, api, globalCallback, reason, detail) {
|
|
8
|
+
// Clean up all timers
|
|
9
|
+
try {
|
|
10
|
+
if (ctx._autoCycleTimer) {
|
|
11
|
+
clearInterval(ctx._autoCycleTimer);
|
|
12
|
+
ctx._autoCycleTimer = null;
|
|
13
|
+
}
|
|
14
|
+
} catch (_) { }
|
|
15
|
+
try {
|
|
16
|
+
if (ctx._reconnectTimer) {
|
|
17
|
+
clearTimeout(ctx._reconnectTimer);
|
|
18
|
+
ctx._reconnectTimer = null;
|
|
19
|
+
}
|
|
20
|
+
} catch (_) { }
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
ctx._ending = true;
|
|
24
|
+
ctx._cycling = false;
|
|
25
|
+
} catch (_) { }
|
|
26
|
+
|
|
27
|
+
// Clean up MQTT client
|
|
28
|
+
try {
|
|
29
|
+
if (ctx.mqttClient) {
|
|
30
|
+
ctx.mqttClient.removeAllListeners();
|
|
31
|
+
if (ctx.mqttClient.connected) {
|
|
32
|
+
ctx.mqttClient.end(true);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
} catch (_) { }
|
|
36
|
+
|
|
37
|
+
ctx.mqttClient = undefined;
|
|
38
|
+
ctx.loggedIn = false;
|
|
39
|
+
|
|
40
|
+
// Clean up timeout references
|
|
41
|
+
try {
|
|
42
|
+
if (ctx._rTimeout) {
|
|
43
|
+
clearTimeout(ctx._rTimeout);
|
|
44
|
+
ctx._rTimeout = null;
|
|
45
|
+
}
|
|
46
|
+
} catch (_) { }
|
|
47
|
+
|
|
48
|
+
// Clean up tasks Map to prevent memory leak
|
|
49
|
+
try {
|
|
50
|
+
if (ctx.tasks && ctx.tasks instanceof Map) {
|
|
51
|
+
ctx.tasks.clear();
|
|
52
|
+
}
|
|
53
|
+
} catch (_) { }
|
|
54
|
+
|
|
55
|
+
// Clean up userInfo intervals
|
|
56
|
+
try {
|
|
57
|
+
if (ctx._userInfoIntervals && Array.isArray(ctx._userInfoIntervals)) {
|
|
58
|
+
ctx._userInfoIntervals.forEach(interval => {
|
|
59
|
+
try {
|
|
60
|
+
clearInterval(interval);
|
|
61
|
+
} catch (_) { }
|
|
62
|
+
});
|
|
63
|
+
ctx._userInfoIntervals = [];
|
|
64
|
+
}
|
|
65
|
+
} catch (_) { }
|
|
66
|
+
|
|
67
|
+
// Clean up autoSave intervals
|
|
68
|
+
try {
|
|
69
|
+
if (ctx._autoSaveInterval && Array.isArray(ctx._autoSaveInterval)) {
|
|
70
|
+
ctx._autoSaveInterval.forEach(interval => {
|
|
71
|
+
try {
|
|
72
|
+
clearInterval(interval);
|
|
73
|
+
} catch (_) { }
|
|
74
|
+
});
|
|
75
|
+
ctx._autoSaveInterval = [];
|
|
76
|
+
}
|
|
77
|
+
} catch (_) { }
|
|
78
|
+
|
|
79
|
+
// Clean up scheduler
|
|
80
|
+
try {
|
|
81
|
+
if (ctx._scheduler && typeof ctx._scheduler.destroy === "function") {
|
|
82
|
+
ctx._scheduler.destroy();
|
|
83
|
+
ctx._scheduler = undefined;
|
|
84
|
+
}
|
|
85
|
+
} catch (_) { }
|
|
86
|
+
|
|
87
|
+
const msg = detail || reason;
|
|
88
|
+
logger(`auth change -> ${reason}: ${msg}`, "error");
|
|
89
|
+
|
|
90
|
+
if (typeof globalCallback === "function") {
|
|
91
|
+
try {
|
|
92
|
+
globalCallback({
|
|
93
|
+
type: "account_inactive",
|
|
94
|
+
reason,
|
|
95
|
+
error: msg,
|
|
96
|
+
timestamp: Date.now()
|
|
97
|
+
}, null);
|
|
98
|
+
} catch (cbErr) {
|
|
99
|
+
logger(`emitAuth callback error: ${cbErr && cbErr.message ? cbErr.message : String(cbErr)}`, "error");
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
};
|