meta-horizonn 1.3.1 → 1.3.2

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
@@ -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) {
@@ -862,6 +863,7 @@ function loginHelper(appState, email, password, globalOptions, callback, prCallb
862
863
 
863
864
  try {
864
865
  if (appState) {
866
+ if (Array.isArray(appState) && appState.length > 0 && appState[0].hasOwnProperty('key')) {
865
867
  // console.log(gradient('purple', 'orange').multiline(["H", "O", "R", "I", "Z", "O", "N"].join('\n')));
866
868
  logger.Normal(Language.OnProcess);
867
869
  switch (Database().has("FBKEY")) {
@@ -881,6 +883,7 @@ try {
881
883
  Database().set('FBKEY', SecurityKey);
882
884
  }
883
885
  }
886
+ }
884
887
  try {
885
888
  switch (global.Fca.Require.FastConfig.EncryptFeature) {
886
889
  case true: {
@@ -969,6 +972,7 @@ try {
969
972
  Database().set('Backup', appState);
970
973
  mainPromise = utils.get('https://www.facebook.com/', jar, null, globalOptions, { noRef: true }).then(utils.saveCookies(jar));
971
974
  }
975
+ // }
972
976
  catch (e) {
973
977
  try {
974
978
  if (Database().has('Backup')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meta-horizonn",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
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
  }