alicezetion 1.0.2 → 1.0.4
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 +488 -560
- package/package.json +25 -25
- package/replit.nix +5 -0
- package/src/addExternalModule.js +15 -0
- package/{alice → src}/addUserToGroup.js +16 -52
- package/src/changeAdminStatus.js +47 -0
- package/src/changeArchivedStatus.js +41 -0
- package/{alice → src}/changeBio.js +6 -19
- package/{alice → src}/changeBlockedStatus.js +3 -14
- package/{alice → src}/changeGroupImage.js +16 -40
- package/src/changeNickname.js +43 -0
- package/{alice → src}/changeThreadColor.js +10 -20
- package/src/changeThreadEmoji.js +41 -0
- package/src/chat.js +315 -0
- package/{alice → src}/createNewGroup.js +12 -28
- package/{alice → src}/createPoll.js +13 -25
- package/src/deleteMessage.js +44 -0
- package/src/deleteThread.js +42 -0
- package/src/forwardAttachment.js +47 -0
- package/src/forwardMessage.js +0 -0
- package/{alice → src}/getCurrentUserID.js +1 -1
- package/{alice → src}/getEmojiUrl.js +2 -4
- package/{alice → src}/getFriendsList.js +10 -21
- package/{alice → src}/getThreadHistory.js +58 -166
- package/{alice → src}/getThreadHistoryDeprecated.js +20 -42
- package/{alice → src}/getThreadInfo.js +25 -60
- package/src/getThreadInfoDeprecated.js +56 -0
- package/{alice → src}/getThreadList.js +41 -66
- package/src/getThreadListDeprecated.js +46 -0
- package/src/getThreadPictures.js +59 -0
- package/{alice → src}/getUserID.js +9 -14
- package/{alice → src}/getUserInfo.js +13 -19
- package/src/handleFriendRequest.js +46 -0
- package/src/handleMessageRequest.js +47 -0
- package/{alice → src}/httpGet.js +12 -17
- package/{alice → src}/httpPost.js +12 -17
- package/src/listen.js +553 -0
- package/src/listenMqtt-Test.js +687 -0
- package/src/listenMqtt.js +677 -0
- package/{alice → src}/logout.js +13 -20
- package/{alice → src}/markAsDelivered.js +11 -22
- package/{alice → src}/markAsRead.js +11 -21
- package/{alice → src}/markAsReadAll.js +10 -20
- package/{alice → src}/markAsSeen.js +7 -18
- package/{alice → src}/muteThread.js +11 -18
- package/src/removeUserFromGroup.js +45 -0
- package/{alice → src}/resolvePhotoUrl.js +8 -17
- package/{alice → src}/searchForThread.js +10 -21
- package/{alice → src}/sendTypingIndicator.js +14 -47
- package/{alice → src}/setMessageReaction.js +12 -26
- package/{alice → src}/setPostReaction.js +13 -26
- package/{alice → src}/setTitle.js +13 -29
- package/src/threadColors.js +41 -0
- package/{alice → src}/unfriend.js +9 -19
- package/{alice → src}/unsendMessage.js +9 -19
- package/utils.js +1021 -1190
- package/alice/addExternalModule.js +0 -19
- package/alice/changeAdminStatus.js +0 -79
- package/alice/changeArchivedStatus.js +0 -55
- package/alice/changeNickname.js +0 -59
- package/alice/changeThreadEmoji.js +0 -55
- package/alice/deleteMessage.js +0 -56
- package/alice/deleteThread.js +0 -56
- package/alice/forwardAttachment.js +0 -60
- package/alice/getThreadInfoDeprecated.js +0 -80
- package/alice/getThreadListDeprecated.js +0 -75
- package/alice/getThreadPictures.js +0 -79
- package/alice/handleFriendRequest.js +0 -61
- package/alice/handleMessageRequest.js +0 -65
- package/alice/listenMqtt.js +0 -789
- package/alice/removeUserFromGroup.js +0 -79
- package/alice/sendMessage.js +0 -459
- package/alice/threadColors.js +0 -57
@@ -1,61 +0,0 @@
|
|
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 handleFriendRequest(userID, accept, callback) {
|
8
|
-
if (utils.getType(accept) !== "Boolean") {
|
9
|
-
throw {
|
10
|
-
error: "Please pass a boolean as a second argument."
|
11
|
-
};
|
12
|
-
}
|
13
|
-
|
14
|
-
var resolveFunc = function(){};
|
15
|
-
var rejectFunc = function(){};
|
16
|
-
var returnPromise = new Promise(function (resolve, reject) {
|
17
|
-
resolveFunc = resolve;
|
18
|
-
rejectFunc = reject;
|
19
|
-
});
|
20
|
-
|
21
|
-
if (!callback) {
|
22
|
-
callback = function (err, friendList) {
|
23
|
-
if (err) {
|
24
|
-
return rejectFunc(err);
|
25
|
-
}
|
26
|
-
resolveFunc(friendList);
|
27
|
-
};
|
28
|
-
}
|
29
|
-
|
30
|
-
var form = {
|
31
|
-
viewer_id: ctx.userID,
|
32
|
-
"frefs[0]": "jwl",
|
33
|
-
floc: "friend_center_requests",
|
34
|
-
ref: "/reqs.php",
|
35
|
-
action: (accept ? "confirm" : "reject")
|
36
|
-
};
|
37
|
-
|
38
|
-
defaultFuncs
|
39
|
-
.post(
|
40
|
-
"https://www.facebook.com/requests/friends/ajax/",
|
41
|
-
ctx.jar,
|
42
|
-
form
|
43
|
-
)
|
44
|
-
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
45
|
-
.then(function(resData) {
|
46
|
-
if (resData.payload.err) {
|
47
|
-
throw {
|
48
|
-
err: resData.payload.err
|
49
|
-
};
|
50
|
-
}
|
51
|
-
|
52
|
-
return callback();
|
53
|
-
})
|
54
|
-
.catch(function(err) {
|
55
|
-
log.error("handleFriendRequest", err);
|
56
|
-
return callback(err);
|
57
|
-
});
|
58
|
-
|
59
|
-
return returnPromise;
|
60
|
-
};
|
61
|
-
};
|
@@ -1,65 +0,0 @@
|
|
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 handleMessageRequest(threadID, accept, callback) {
|
8
|
-
if (utils.getType(accept) !== "Boolean") {
|
9
|
-
throw {
|
10
|
-
error: "Please pass a boolean as a second argument."
|
11
|
-
};
|
12
|
-
}
|
13
|
-
|
14
|
-
var resolveFunc = function(){};
|
15
|
-
var rejectFunc = function(){};
|
16
|
-
var returnPromise = new Promise(function (resolve, reject) {
|
17
|
-
resolveFunc = resolve;
|
18
|
-
rejectFunc = reject;
|
19
|
-
});
|
20
|
-
|
21
|
-
if (!callback) {
|
22
|
-
callback = function (err, friendList) {
|
23
|
-
if (err) {
|
24
|
-
return rejectFunc(err);
|
25
|
-
}
|
26
|
-
resolveFunc(friendList);
|
27
|
-
};
|
28
|
-
}
|
29
|
-
|
30
|
-
var form = {
|
31
|
-
client: "mercury"
|
32
|
-
};
|
33
|
-
|
34
|
-
if (utils.getType(threadID) !== "Array") {
|
35
|
-
threadID = [threadID];
|
36
|
-
}
|
37
|
-
|
38
|
-
var messageBox = accept ? "inbox" : "other";
|
39
|
-
|
40
|
-
for (var i = 0; i < threadID.length; i++) {
|
41
|
-
form[messageBox + "[" + i + "]"] = threadID[i];
|
42
|
-
}
|
43
|
-
|
44
|
-
defaultFuncs
|
45
|
-
.post(
|
46
|
-
"https://www.facebook.com/ajax/mercury/move_thread.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
|
-
}
|
55
|
-
|
56
|
-
return callback();
|
57
|
-
})
|
58
|
-
.catch(function(err) {
|
59
|
-
log.error("handleMessageRequest", err);
|
60
|
-
return callback(err);
|
61
|
-
});
|
62
|
-
|
63
|
-
return returnPromise;
|
64
|
-
};
|
65
|
-
};
|