node-ainzfb-new 1.6.32-stable → 1.6.2210-test

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. package/index.js +1 -1
  2. package/package.json +3 -3
  3. package/src/addExternalModule.js +6 -13
  4. package/src/addUserToGroup.js +12 -35
  5. package/src/changeAdminStatus.js +16 -32
  6. package/src/changeArchivedStatus.js +9 -15
  7. package/src/changeBio.js +8 -12
  8. package/src/changeBlockedStatus.js +8 -14
  9. package/src/changeGroupImage.js +13 -27
  10. package/src/changeNickname.js +10 -19
  11. package/src/changeThreadColor.js +10 -15
  12. package/src/changeThreadEmoji.js +9 -17
  13. package/src/createNewGroup.js +10 -18
  14. package/src/createPoll.js +11 -16
  15. package/src/deleteMessage.js +10 -16
  16. package/src/deleteThread.js +10 -16
  17. package/src/forwardAttachment.js +9 -14
  18. package/src/getCurrentUserID.js +1 -1
  19. package/src/getEmojiUrl.js +2 -3
  20. package/src/getFriendsList.js +10 -18
  21. package/src/getMessage.js +48 -52
  22. package/src/getThreadHistory.js +59 -156
  23. package/src/getThreadHistoryDeprecated.js +15 -26
  24. package/src/getThreadInfoDeprecated.js +13 -25
  25. package/src/getThreadList.js +53 -112
  26. package/src/getThreadListDeprecated.js +12 -30
  27. package/src/getThreadPictures.js +13 -25
  28. package/src/getUserID.js +7 -8
  29. package/src/getUserInfo.js +9 -12
  30. package/src/handleFriendRequest.js +9 -10
  31. package/src/handleMessageRequest.js +10 -16
  32. package/src/httpGet.js +13 -18
  33. package/src/httpPost.js +13 -18
  34. package/src/httpPostFormData.js +9 -14
  35. package/src/listenMqtt.js +571 -1218
  36. package/src/logout.js +13 -18
  37. package/src/markAsDelivered.js +10 -16
  38. package/src/markAsRead.js +24 -36
  39. package/src/markAsReadAll.js +10 -14
  40. package/src/markAsSeen.js +11 -18
  41. package/src/muteThread.js +8 -12
  42. package/src/removeUserFromGroup.js +10 -33
  43. package/src/resolvePhotoUrl.js +6 -8
  44. package/src/searchForThread.js +8 -13
  45. package/src/sendMessage.js +78 -172
  46. package/src/sendTypingIndicator.js +14 -29
  47. package/src/setMessageReaction.js +8 -13
  48. package/src/setPostReaction.js +95 -97
  49. package/src/setTitle.js +12 -18
  50. package/src/threadColors.js +17 -17
  51. package/src/unfriend.js +9 -14
  52. package/src/unsendMessage.js +7 -7
  53. package/utils.js +19 -18
  54. package/src/changeAvt.js +0 -91
package/src/httpGet.js CHANGED
@@ -3,47 +3,42 @@
3
3
  var utils = require("../utils");
4
4
  var log = require("npmlog");
5
5
 
6
- module.exports = function(defaultFuncs, api, ctx) {
6
+ module.exports = function (defaultFuncs, api, ctx) {
7
7
  return function httpGet(url, form, callback, notAPI) {
8
- var resolveFunc = function() {};
9
- var rejectFunc = function() {};
8
+ var resolveFunc = function () { };
9
+ var rejectFunc = function () { };
10
10
 
11
- var returnPromise = new Promise(function(resolve, reject) {
11
+ var returnPromise = new Promise(function (resolve, reject) {
12
12
  resolveFunc = resolve;
13
13
  rejectFunc = reject;
14
14
  });
15
15
 
16
- if (
17
- !callback &&
18
- (utils.getType(form) == "Function" ||
19
- utils.getType(form) == "AsyncFunction")
20
- ) {
16
+ if (!callback && (utils.getType(form) == "Function" || utils.getType(form) == "AsyncFunction")) {
21
17
  callback = form;
22
18
  form = {};
23
19
  }
24
20
 
25
21
  form = form || {};
26
22
 
27
- callback =
28
- callback ||
29
- function(err, data) {
30
- if (err) return rejectFunc(err);
31
- resolveFunc(data);
32
- };
23
+ callback = callback || function (err, data) {
24
+ if (err) return rejectFunc(err);
25
+ resolveFunc(data);
26
+ };
33
27
 
34
28
  if (notAPI) {
35
29
  utils
36
30
  .get(url, ctx.jar, form, ctx.globalOptions)
37
31
  .then(resData => callback(null, resData.body.toString()))
38
- .catch(function(err) {
32
+ .catch(function (err) {
39
33
  log.error("httpGet", err);
40
34
  return callback(err);
41
35
  });
42
- } else {
36
+ }
37
+ else {
43
38
  defaultFuncs
44
39
  .get(url, ctx.jar, form)
45
40
  .then(resData => callback(null, resData.body.toString()))
46
- .catch(function(err) {
41
+ .catch(function (err) {
47
42
  log.error("httpGet", err);
48
43
  return callback(err);
49
44
  });
package/src/httpPost.js CHANGED
@@ -3,47 +3,42 @@
3
3
  var utils = require("../utils");
4
4
  var log = require("npmlog");
5
5
 
6
- module.exports = function(defaultFuncs, api, ctx) {
6
+ module.exports = function (defaultFuncs, api, ctx) {
7
7
  return function httpGet(url, form, callback, notAPI) {
8
- var resolveFunc = function() {};
9
- var rejectFunc = function() {};
8
+ var resolveFunc = function () { };
9
+ var rejectFunc = function () { };
10
10
 
11
- var returnPromise = new Promise(function(resolve, reject) {
11
+ var returnPromise = new Promise(function (resolve, reject) {
12
12
  resolveFunc = resolve;
13
13
  rejectFunc = reject;
14
14
  });
15
15
 
16
- if (
17
- !callback &&
18
- (utils.getType(form) == "Function" ||
19
- utils.getType(form) == "AsyncFunction")
20
- ) {
16
+ if (!callback && (utils.getType(form) == "Function" || utils.getType(form) == "AsyncFunction")) {
21
17
  callback = form;
22
18
  form = {};
23
19
  }
24
20
 
25
21
  form = form || {};
26
22
 
27
- callback =
28
- callback ||
29
- function(err, data) {
30
- if (err) return rejectFunc(err);
31
- resolveFunc(data);
32
- };
23
+ callback = callback || function (err, data) {
24
+ if (err) return rejectFunc(err);
25
+ resolveFunc(data);
26
+ };
33
27
 
34
28
  if (notAPI) {
35
29
  utils
36
30
  .post(url, ctx.jar, form, ctx.globalOptions)
37
31
  .then(resData => callback(null, resData.body.toString()))
38
- .catch(function(err) {
32
+ .catch(function (err) {
39
33
  log.error("httpPost", err);
40
34
  return callback(err);
41
35
  });
42
- } else {
36
+ }
37
+ else {
43
38
  defaultFuncs
44
39
  .post(url, ctx.jar, form, {})
45
40
  .then(resData => callback(null, resData.body.toString()))
46
- .catch(function(err) {
41
+ .catch(function (err) {
47
42
  log.error("httpPost", err);
48
43
  return callback(err);
49
44
  });
@@ -5,31 +5,26 @@ var log = require("npmlog");
5
5
 
6
6
  module.exports = function(defaultFuncs, api, ctx) {
7
7
  return function httpPostFormData(url, form, callback) {
8
- var resolveFunc = function() {};
9
- var rejectFunc = function() {};
8
+ var resolveFunc = function(){};
9
+ var rejectFunc = function(){};
10
10
 
11
- var returnPromise = new Promise(function(resolve, reject) {
11
+ var returnPromise = new Promise(function (resolve, reject) {
12
12
  resolveFunc = resolve;
13
13
  rejectFunc = reject;
14
14
  });
15
15
 
16
- if (
17
- !callback &&
18
- (utils.getType(form) == "Function" ||
19
- utils.getType(form) == "AsyncFunction")
20
- ) {
16
+ if (!callback && (utils.getType(form) == "Function" || utils.getType(form) == "AsyncFunction")) {
21
17
  callback = form;
22
18
  form = {};
23
19
  }
24
20
 
25
21
  form = form || {};
26
-
27
- callback =
28
- callback ||
29
- function(err, data) {
22
+
23
+
24
+ callback = callback || function(err, data) {
30
25
  if (err) return rejectFunc(err);
31
26
  resolveFunc(data);
32
- };
27
+ };
33
28
 
34
29
  defaultFuncs
35
30
  .postFormData(url, ctx.jar, form)
@@ -43,4 +38,4 @@ module.exports = function(defaultFuncs, api, ctx) {
43
38
 
44
39
  return returnPromise;
45
40
  };
46
- };
41
+ };