meta-horizonn 1.3.1 → 1.3.3

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/Main.js CHANGED
@@ -156,7 +156,7 @@ if (global.Fca.Require.FastConfig.HTML.HTML) Server= express.listen(express.get(
156
156
  // WSS.handleUpgrade(escapedReq, escapedSocket, escapedHead, (wss) => {
157
157
  // const escapedWss = escapeHTML(wss);
158
158
  // const escapedReq = escapeHTML(req);
159
-
159
+
160
160
  // escapedWss.emit('connection', escapedWss, escapedReq);
161
161
  // });
162
162
  // });
@@ -207,7 +207,7 @@ if (global.Fca.Require.FastConfig.HTML.HTML) Server= express.listen(express.get(
207
207
  // }
208
208
  // }
209
209
  // }
210
-
210
+
211
211
  // }
212
212
 
213
213
  /!-[ Function setOptions ]-!/
@@ -338,7 +338,7 @@ else userID = maybeUser[0].cookieString().split("=")[1].toString();
338
338
  }
339
339
 
340
340
  let Slot = Object.keys(CHECK_MQTT);
341
-
341
+
342
342
  var mqttEndpoint, region, irisSeqID;
343
343
  Object.keys(CHECK_MQTT).map(function(MQTT) {
344
344
  if (CHECK_MQTT[MQTT] && !region) {
@@ -645,7 +645,7 @@ function makeLogin(jar, email, password, loginOptions, callback, prCallback) {
645
645
  .then(function(res) {
646
646
  var headers = res.headers;
647
647
  if (!headers.location && res.headers['set-cookie'][0].includes('checkpoint')) throw { error: "wtf ??:D" };
648
- var appState = utils.getAppState(jar,false);
648
+ var appState = utils.getAppState(jar, false);
649
649
  Database().set('Through2Fa', appState);
650
650
  return loginHelper(appState, email, password, loginOptions, callback);
651
651
  })
@@ -731,8 +731,9 @@ function makeLogin(jar, email, password, loginOptions, callback, prCallback) {
731
731
  }
732
732
  })
733
733
  .then(function() {
734
- delete form.no_fido;delete form.approvals_code;
735
- form.name_action_selected = 'dont_save'; //'save_device' || 'dont_save;
734
+ delete form.no_fido;
735
+ delete form.approvals_code;
736
+ form.name_action_selected = 'dont_save'; // 'save_device' || 'dont_save;
736
737
  return utils.post(nextURL, jar, form, loginOptions).then(utils.saveCookies(jar));
737
738
  })
738
739
  .then(function(res) {
@@ -968,7 +969,7 @@ try {
968
969
  });
969
970
  Database().set('Backup', appState);
970
971
  mainPromise = utils.get('https://www.facebook.com/', jar, null, globalOptions, { noRef: true }).then(utils.saveCookies(jar));
971
- }
972
+ }
972
973
  catch (e) {
973
974
  try {
974
975
  if (Database().has('Backup')) {
@@ -1190,7 +1191,7 @@ function login(loginData, options, callback) {
1190
1191
  emitReady: false,
1191
1192
  userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8"
1192
1193
  };
1193
-
1194
+
1194
1195
  var prCallback = null;
1195
1196
  if (utils.getType(callback) !== "Function" && utils.getType(callback) !== "AsyncFunction") {
1196
1197
  var rejectFunc = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meta-horizonn",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "Facebook-Chat-API Protect and Deploy by Kanzu and HZI Team. Kem is redeveloped. Rename package is Meta Horizonn and package supported ChatBot Messenger.",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/listenMqtt.js CHANGED
@@ -799,16 +799,22 @@ function parseDelta(defaultFuncs, api, ctx, globalCallback, {
799
799
  break;
800
800
  }
801
801
  case 'NewMessage': {
802
- if (delta.attachments !== undefined && delta.attachments.length === 1 && delta.attachments[0].mercury.extensible_attachment !== undefined && delta.attachments[0].mercury.extensible_attachment.story_attachment.style_list != null && delta.attachments[0].mercury.extensible_attachment.story_attachment.style_list.includes('message_live_location')) {
802
+ const hasLiveLocation = (delta) => {
803
+ const attachment = delta.attachments?.[0]?.mercury?.extensible_attachment;
804
+ const storyAttachment = attachment?.story_attachment;
805
+ return storyAttachment?.style_list?.includes('message_live_location');
806
+ };
807
+
808
+ if (delta.attachments?.length === 1 && hasLiveLocation(delta)) {
803
809
  delta.class = 'UserLocation';
804
- let fmtMsg;
810
+
805
811
  try {
806
- fmtMsg = utils.formatDeltaEvent(delta);
812
+ const fmtMsg = utils.formatDeltaEvent(delta);
813
+ globalCallback(null, fmtMsg);
807
814
  } catch (err) {
808
815
  console.log(delta);
809
- return log.error('Lỗi Nhẹ', err);
816
+ log.error('Lỗi Nhẹ', err);
810
817
  }
811
- globalCallback(null, fmtMsg);
812
818
  }
813
819
  break;
814
820
  }