alicezetion 1.5.3 → 1.5.5
Sign up to get free protection for your applications and to get access to all the features.
- package/.cache/replit/__replit_disk_meta.json +1 -1
- package/.cache/replit/nix/env.json +1 -1
- package/index.js +576 -382
- package/leiamnash/addExternalModule.js +19 -16
- package/leiamnash/addUserToGroup.js +113 -79
- package/leiamnash/changeAdminStatus.js +79 -79
- package/leiamnash/changeArchivedStatus.js +55 -41
- package/leiamnash/changeBio.js +77 -65
- package/leiamnash/changeBlockedStatus.js +47 -36
- package/leiamnash/changeGroupImage.js +129 -106
- package/leiamnash/changeNickname.js +59 -45
- package/leiamnash/changeThreadColor.js +71 -62
- package/leiamnash/changeThreadEmoji.js +55 -42
- package/leiamnash/chat.js +459 -374
- package/leiamnash/createNewGroup.js +86 -70
- package/leiamnash/createPoll.js +71 -60
- package/leiamnash/deleteMessage.js +56 -45
- package/leiamnash/deleteThread.js +56 -43
- package/leiamnash/forwardAttachment.js +60 -48
- package/leiamnash/getCurrentUserID.js +7 -7
- package/leiamnash/getEmojiUrl.js +29 -27
- package/leiamnash/getFriendsList.js +84 -73
- package/leiamnash/getThreadHistory.js +645 -537
- package/leiamnash/getThreadHistoryDeprecated.js +93 -0
- package/leiamnash/getThreadInfo.js +206 -425
- package/leiamnash/getThreadInfoDeprecated.js +80 -0
- package/leiamnash/getThreadList.js +238 -213
- package/leiamnash/getThreadListDeprecated.js +75 -0
- package/leiamnash/getThreadPictures.js +79 -59
- package/leiamnash/getUserID.js +66 -62
- package/leiamnash/getUserInfo.js +72 -113
- package/leiamnash/handleFriendRequest.js +61 -46
- package/leiamnash/handleMessageRequest.js +65 -49
- package/leiamnash/httpGet.js +52 -49
- package/leiamnash/httpPost.js +52 -48
- package/leiamnash/listenMqtt.js +789 -787
- package/leiamnash/logout.js +75 -68
- package/leiamnash/markAsDelivered.js +58 -48
- package/leiamnash/markAsRead.js +80 -70
- package/leiamnash/markAsReadAll.js +49 -42
- package/leiamnash/markAsSeen.js +59 -51
- package/leiamnash/muteThread.js +52 -47
- package/leiamnash/removeUserFromGroup.js +79 -49
- package/leiamnash/resolvePhotoUrl.js +45 -37
- package/leiamnash/searchForThread.js +53 -43
- package/leiamnash/sendTypingIndicator.js +103 -80
- package/leiamnash/setMessageReaction.js +117 -109
- package/leiamnash/setPostReaction.js +76 -102
- package/leiamnash/setTitle.js +86 -74
- package/leiamnash/threadColors.js +57 -39
- package/leiamnash/unfriend.js +52 -43
- package/leiamnash/unsendMessage.js +49 -40
- package/package.json +72 -90
- package/utils.js +1356 -1684
- package/Extra/Database/index.js +0 -469
- package/Extra/ExtraAddons.js +0 -82
- package/Extra/ExtraFindUID.js +0 -62
- package/Extra/ExtraGetThread.js +0 -340
- package/Extra/ExtraScreenShot.js +0 -430
- package/Extra/ExtraUptimeRobot.js +0 -38
- package/Extra/Html/Classic/script.js +0 -119
- package/Extra/Html/Classic/style.css +0 -8
- package/Extra/Security/AES_256_GCM/index.js +0 -0
- package/Extra/Security/Base/Step_1.js +0 -6
- package/Extra/Security/Base/Step_2.js +0 -22
- package/Extra/Security/Base/Step_3.js +0 -22
- package/Extra/Security/Base/index.js +0 -174
- package/Extra/Security/Index.js +0 -5
- package/Extra/Security/Step_1.js +0 -6
- package/Extra/Security/Step_2.js +0 -22
- package/Extra/Security/Step_3.js +0 -22
- package/Extra/Src/Change_Environment.js +0 -24
- package/Extra/Src/Check_Update.js +0 -67
- package/Extra/Src/History.js +0 -115
- package/Extra/Src/Instant_Update.js +0 -65
- package/Extra/Src/Last-Run.js +0 -65
- package/Extra/Src/Premium.js +0 -81
- package/Extra/Src/Release_Memory.js +0 -41
- package/Extra/Src/Websocket.js +0 -213
- package/Extra/Src/image/checkmate.jpg +0 -0
- package/Extra/Src/uuid.js +0 -137
- package/Func/AcceptAgreement.js +0 -31
- package/Func/ClearCache.js +0 -64
- package/Func/ReportV1.js +0 -54
- package/Language/index.json +0 -217
- package/Main.js +0 -1270
- package/broadcast.js +0 -40
- package/leiamnash/Dev_Horizon_Data.js +0 -125
- package/leiamnash/Premium.js +0 -25
- package/leiamnash/Screenshot.js +0 -83
- package/leiamnash/changeAvt.js +0 -85
- package/leiamnash/getAccessToken.js +0 -28
- package/leiamnash/getMessage.js +0 -80
- package/leiamnash/getThreadMain.js +0 -220
- package/leiamnash/getUID.js +0 -59
- package/leiamnash/getUserInfoMain.js +0 -65
- package/leiamnash/getUserInfoV2.js +0 -32
- package/leiamnash/getUserInfoV3.js +0 -63
- package/leiamnash/getUserInfoV4.js +0 -55
- package/leiamnash/getUserInfoV5.js +0 -61
- package/leiamnash/httpPostFormData.js +0 -41
- package/leiamnash/sendMessage.js +0 -379
- package/logger.js +0 -66
@@ -0,0 +1,93 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var utils = require("../utils");
|
4
|
+
var log = require("npmlog");
|
5
|
+
|
6
|
+
module.exports = function(defaultFuncs, api, ctx) {
|
7
|
+
return function getThreadHistory(threadID, amount, timestamp, callback) {
|
8
|
+
var resolveFunc = function(){};
|
9
|
+
var rejectFunc = function(){};
|
10
|
+
var returnPromise = new Promise(function (resolve, reject) {
|
11
|
+
resolveFunc = resolve;
|
12
|
+
rejectFunc = reject;
|
13
|
+
});
|
14
|
+
|
15
|
+
if (!callback) {
|
16
|
+
callback = function (err, friendList) {
|
17
|
+
if (err) {
|
18
|
+
return rejectFunc(err);
|
19
|
+
}
|
20
|
+
resolveFunc(friendList);
|
21
|
+
};
|
22
|
+
}
|
23
|
+
|
24
|
+
if (!callback) {
|
25
|
+
throw { error: "getThreadHistory: need callback" };
|
26
|
+
}
|
27
|
+
|
28
|
+
var form = {
|
29
|
+
client: "mercury"
|
30
|
+
};
|
31
|
+
|
32
|
+
api.getUserInfo(threadID, function(err, res) {
|
33
|
+
if (err) {
|
34
|
+
return callback(err);
|
35
|
+
}
|
36
|
+
var key = Object.keys(res).length > 0 ? "user_ids" : "thread_fbids";
|
37
|
+
form["messages[" + key + "][" + threadID + "][offset]"] = 0;
|
38
|
+
form["messages[" + key + "][" + threadID + "][timestamp]"] = timestamp;
|
39
|
+
form["messages[" + key + "][" + threadID + "][limit]"] = amount;
|
40
|
+
|
41
|
+
if (ctx.globalOptions.pageID)
|
42
|
+
form.request_user_id = ctx.globalOptions.pageID;
|
43
|
+
|
44
|
+
defaultFuncs
|
45
|
+
.post(
|
46
|
+
"https://www.facebook.com/ajax/mercury/thread_info.php",
|
47
|
+
ctx.jar,
|
48
|
+
form
|
49
|
+
)
|
50
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
51
|
+
.then(function(resData) {
|
52
|
+
if (resData.error) {
|
53
|
+
throw resData;
|
54
|
+
} else if (!resData.payload) {
|
55
|
+
throw { error: "Could not retrieve thread history." };
|
56
|
+
}
|
57
|
+
|
58
|
+
// Asking for message history from a thread with no message history
|
59
|
+
// will return undefined for actions here
|
60
|
+
if (!resData.payload.actions) {
|
61
|
+
resData.payload.actions = [];
|
62
|
+
}
|
63
|
+
|
64
|
+
var userIDs = {};
|
65
|
+
resData.payload.actions.forEach(function(v) {
|
66
|
+
userIDs[v.author.split(":").pop()] = "";
|
67
|
+
});
|
68
|
+
|
69
|
+
api.getUserInfo(Object.keys(userIDs), function(err, data) {
|
70
|
+
if (err) return callback(err); //callback({error: "Could not retrieve user information in getThreadHistory."});
|
71
|
+
|
72
|
+
resData.payload.actions.forEach(function(v) {
|
73
|
+
var sender = data[v.author.split(":").pop()];
|
74
|
+
if (sender) v.sender_name = sender.name;
|
75
|
+
else v.sender_name = "Facebook User";
|
76
|
+
v.sender_fbid = v.author;
|
77
|
+
delete v.author;
|
78
|
+
});
|
79
|
+
|
80
|
+
callback(
|
81
|
+
null,
|
82
|
+
resData.payload.actions.map(utils.formatHistoryMessage)
|
83
|
+
);
|
84
|
+
});
|
85
|
+
})
|
86
|
+
.catch(function(err) {
|
87
|
+
log.error("getThreadHistory", err);
|
88
|
+
return callback(err);
|
89
|
+
});
|
90
|
+
});
|
91
|
+
return returnPromise;
|
92
|
+
};
|
93
|
+
};
|