@dongdev/fca-unofficial 1.0.18 → 1.0.20

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/CHANGELOG.md CHANGED
@@ -23,3 +23,9 @@ Too lazy to write changelog, sorry! (will write changelog in the next release, t
23
23
 
24
24
  ## v1.0.17 - 2025-05-07
25
25
  - Hotfix / auto bump
26
+
27
+ ## v1.0.18 - 2025-05-22
28
+ - Hotfix / auto bump
29
+
30
+ ## v1.0.19 - 2025-05-23
31
+ - Hotfix / auto bump
package/index.js CHANGED
@@ -279,40 +279,40 @@ function loginHelper(appState, email, password, globalOptions, callback, prCallb
279
279
 
280
280
  mainPromise
281
281
  .then(async () => {
282
- if (global.fca.config.autoUpdate) {
283
- try {
284
- exec('npm view @dongdev/fca-unofficial version', async (error, stdout, stderr) => {
285
- if (error) {
286
- logger('Error checking version: ' + error, 'error');
287
- return;
288
- }
289
- const npmVersion = stdout.trim();
290
- const localbrand = JSON.parse(readFileSync('./node_modules/@dongdev/fca-unofficial/package.json')).version;
291
- if (localbrand !== npmVersion) {
292
- logger(`New Version Published: ${localbrand} => ${npmVersion}`, 'warn');
293
- logger(`Perform Automatic Update to the Latest Version !`, 'warn');
294
- try {
295
- execSync('npm install @dongdev/fca-unofficial@latest', { stdio: 'inherit' });
296
- logger("Upgrade Version Successfully!", "[ FCA-UNO ] >")
297
- logger('Restarting...', '[ FCA-UNO ] >');
298
- await new Promise(resolve => setTimeout(resolve, 5 * 1000));
299
- console.clear();
300
- process.exit(1);
301
- } catch (err) {
302
- logger('Error Auto Update ! ' + err, 'error');
303
- }
304
- } else {
305
- logger(`You Are Currently Using Version: ${localbrand} !`, "[ FCA-UNO ] >");
306
- logger(`Have a good day !`, "[ FCA-UNO ] >")
307
- await new Promise(resolve => setTimeout(resolve, 5 * 1000));
308
- callback(null, api);
309
- }
310
- });
311
- } catch (err) {
312
- logger('Error checking for updates: ' + err, 'error');
313
- callback(null, api);
314
- }
315
- }
282
+ // if (global.fca.config.autoUpdate) {
283
+ // try {
284
+ // exec('npm view @dongdev/fca-unofficial version', async (error, stdout, stderr) => {
285
+ // if (error) {
286
+ // logger('Error checking version: ' + error, 'error');
287
+ // return;
288
+ // }
289
+ // const npmVersion = stdout.trim();
290
+ // const localbrand = JSON.parse(readFileSync('./node_modules/@dongdev/fca-unofficial/package.json')).version;
291
+ // if (localbrand !== npmVersion) {
292
+ // logger(`New Version Published: ${localbrand} => ${npmVersion}`, 'warn');
293
+ // logger(`Perform Automatic Update to the Latest Version !`, 'warn');
294
+ // try {
295
+ // execSync('npm install @dongdev/fca-unofficial@latest', { stdio: 'inherit' });
296
+ // logger("Upgrade Version Successfully!", "[ FCA-UNO ] >")
297
+ // logger('Restarting...', '[ FCA-UNO ] >');
298
+ // await new Promise(resolve => setTimeout(resolve, 5 * 1000));
299
+ // console.clear();
300
+ // process.exit(1);
301
+ // } catch (err) {
302
+ // logger('Error Auto Update ! ' + err, 'error');
303
+ // }
304
+ // } else {
305
+ // logger(`You Are Currently Using Version: ${localbrand} !`, "[ FCA-UNO ] >");
306
+ // logger(`Have a good day !`, "[ FCA-UNO ] >")
307
+ // await new Promise(resolve => setTimeout(resolve, 5 * 1000));
308
+ // callback(null, api);
309
+ // }
310
+ // });
311
+ // } catch (err) {
312
+ // logger('Error checking for updates: ' + err, 'error');
313
+ // callback(null, api);
314
+ // }
315
+ // }
316
316
  logger('Login successful!', '[ FCA-UNO ] >');
317
317
  callback(null, api);
318
318
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dongdev/fca-unofficial",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "description": "A Facebook chat API without XMPP, will not be deprecated after April 30th, 2015.",
5
5
  "main": "index.js",
6
6
  "repository": {
package/src/listenMqtt.js CHANGED
@@ -229,56 +229,56 @@ function listenMqtt(defaultFuncs, api, ctx, globalCallback) {
229
229
  }
230
230
  });
231
231
  mqttClient.on("connect", function () {
232
- let StopProcessin = true;
233
- mqttReconnectCount = 0;
234
- setInterval(() => {
235
- console.log('Đang chuẩn bị ngắt kết nối MQTT...');
236
- StopProcessin = true;
237
- if (ctx.mqttClient) {
238
- topics.forEach((topic) => {
239
- try {
240
- ctx.mqttClient.unsubscribe(topic);
241
- } catch (e) { }
242
- });
243
- try {
244
- ctx.mqttClient.publish("/browser_close", "{}");
245
- } catch (e) { }
246
- ctx.mqttClient.removeAllListeners();
247
- console.log('Ngắt Kết Nối MQTT...');
248
- let connectionClosed = false;
249
- const afterConnectionClosed = () => {
250
- if (connectionClosed) return;
251
- connectionClosed = true;
252
- ctx.lastSeqId = null;
253
- ctx.syncToken = undefined;
254
- ctx.t_mqttCalled = false;
255
- mqttReconnectCount = 0;
256
- StopProcessing = false;
257
- console.log('Đang Kết Nối Lại MQTT...');
258
- setTimeout(() => {
259
- getSeqID();
260
- console.log('Kết Nối Lại MQTT Thành Công');
261
- }, 1000);
262
- };
263
- try {
264
- ctx.mqttClient.end(false, afterConnectionClosed);
265
- setTimeout(() => {
266
- if (!connectionClosed) {
267
- console.warn('Đóng kết nối MQTT bằng timeout');
268
- ctx.mqttClient = undefined;
269
- afterConnectionClosed();
270
- }
271
- }, 5000);
272
- } catch (e) {
273
- console.error('Lỗi khi đóng kết nối MQTT:', e);
274
- ctx.mqttClient = undefined;
275
- afterConnectionClosed();
276
- }
277
- } else {
278
- getSeqID();
279
- console.log('Kết Nối Lại MQTT Thành Công');
280
- }
281
- }, 60 * 60 * 1000);
232
+ // let StopProcessing = true;
233
+ // mqttReconnectCount = 0;
234
+ // setInterval(() => {
235
+ // console.log('Đang chuẩn bị ngắt kết nối MQTT...');
236
+ // StopProcessing = true;
237
+ // if (ctx.mqttClient) {
238
+ // topics.forEach((topic) => {
239
+ // try {
240
+ // ctx.mqttClient.unsubscribe(topic);
241
+ // } catch (e) { }
242
+ // });
243
+ // try {
244
+ // ctx.mqttClient.publish("/browser_close", "{}");
245
+ // } catch (e) { }
246
+ // ctx.mqttClient.removeAllListeners();
247
+ // console.log('Ngắt Kết Nối MQTT...');
248
+ // let connectionClosed = false;
249
+ // const afterConnectionClosed = () => {
250
+ // if (connectionClosed) return;
251
+ // connectionClosed = true;
252
+ // ctx.lastSeqId = null;
253
+ // ctx.syncToken = undefined;
254
+ // ctx.t_mqttCalled = false;
255
+ // mqttReconnectCount = 0;
256
+ // StopProcessing = false;
257
+ // console.log('Đang Kết Nối Lại MQTT...');
258
+ // setTimeout(() => {
259
+ // getSeqID();
260
+ // console.log('Kết Nối Lại MQTT Thành Công');
261
+ // }, 1000);
262
+ // };
263
+ // try {
264
+ // ctx.mqttClient.end(false, afterConnectionClosed);
265
+ // setTimeout(() => {
266
+ // if (!connectionClosed) {
267
+ // console.warn('Đóng kết nối MQTT bằng timeout');
268
+ // ctx.mqttClient = undefined;
269
+ // afterConnectionClosed();
270
+ // }
271
+ // }, 5000);
272
+ // } catch (e) {
273
+ // console.error('Lỗi khi đóng kết nối MQTT:', e);
274
+ // ctx.mqttClient = undefined;
275
+ // afterConnectionClosed();
276
+ // }
277
+ // } else {
278
+ // getSeqID();
279
+ // console.log('Kết Nối Lại MQTT Thành Công');
280
+ // }
281
+ // }, 60 * 60 * 1000);
282
282
  if (process.env.OnStatus === undefined) {
283
283
  logger("fca-unoffcial premium", "info");
284
284
  process.env.OnStatus = true;