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
@@ -1,59 +1,79 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var utils = require("../utils");
|
4
|
-
var log = require("npmlog");
|
5
|
-
|
6
|
-
module.exports = function
|
7
|
-
return function getThreadPictures(threadID, offset, limit, 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,
|
17
|
-
if (err)
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
.
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
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 getThreadPictures(threadID, offset, limit, 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
|
+
var form = {
|
25
|
+
thread_id: threadID,
|
26
|
+
offset: offset,
|
27
|
+
limit: limit
|
28
|
+
};
|
29
|
+
|
30
|
+
defaultFuncs
|
31
|
+
.post(
|
32
|
+
"https://www.facebook.com/ajax/messaging/attachments/sharedphotos.php",
|
33
|
+
ctx.jar,
|
34
|
+
form
|
35
|
+
)
|
36
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
37
|
+
.then(function(resData) {
|
38
|
+
if (resData.error) {
|
39
|
+
throw resData;
|
40
|
+
}
|
41
|
+
return Promise.all(
|
42
|
+
resData.payload.imagesData.map(function(image) {
|
43
|
+
form = {
|
44
|
+
thread_id: threadID,
|
45
|
+
image_id: image.fbid
|
46
|
+
};
|
47
|
+
return defaultFuncs
|
48
|
+
.post(
|
49
|
+
"https://www.facebook.com/ajax/messaging/attachments/sharedphotos.php",
|
50
|
+
ctx.jar,
|
51
|
+
form
|
52
|
+
)
|
53
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
54
|
+
.then(function(resData) {
|
55
|
+
if (resData.error) {
|
56
|
+
throw resData;
|
57
|
+
}
|
58
|
+
// the response is pretty messy
|
59
|
+
var queryThreadID =
|
60
|
+
resData.jsmods.require[0][3][1].query_metadata.query_path[0]
|
61
|
+
.message_thread;
|
62
|
+
var imageData =
|
63
|
+
resData.jsmods.require[0][3][1].query_results[queryThreadID]
|
64
|
+
.message_images.edges[0].node.image2;
|
65
|
+
return imageData;
|
66
|
+
});
|
67
|
+
})
|
68
|
+
);
|
69
|
+
})
|
70
|
+
.then(function(resData) {
|
71
|
+
callback(null, resData);
|
72
|
+
})
|
73
|
+
.catch(function(err) {
|
74
|
+
log.error("Error in getThreadPictures", err);
|
75
|
+
callback(err);
|
76
|
+
});
|
77
|
+
return returnPromise;
|
78
|
+
};
|
79
|
+
};
|
package/leiamnash/getUserID.js
CHANGED
@@ -1,62 +1,66 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var utils = require("../utils");
|
4
|
-
var log = require("npmlog");
|
5
|
-
|
6
|
-
function formatData(data) {
|
7
|
-
return {
|
8
|
-
userID: utils.formatID(data.uid.toString()),
|
9
|
-
photoUrl: data.photo,
|
10
|
-
indexRank: data.index_rank,
|
11
|
-
name: data.text,
|
12
|
-
isVerified: data.is_verified,
|
13
|
-
profileUrl: data.path,
|
14
|
-
category: data.category,
|
15
|
-
score: data.score,
|
16
|
-
type: data.type
|
17
|
-
};
|
18
|
-
}
|
19
|
-
|
20
|
-
module.exports = function
|
21
|
-
return function getUserID(name, callback) {
|
22
|
-
var resolveFunc = function
|
23
|
-
var rejectFunc = function
|
24
|
-
var returnPromise = new Promise(function (resolve, reject) {
|
25
|
-
resolveFunc = resolve;
|
26
|
-
rejectFunc = reject;
|
27
|
-
});
|
28
|
-
|
29
|
-
if (!callback) {
|
30
|
-
callback = function (err,
|
31
|
-
if (err)
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
.
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
})
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
};
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var utils = require("../utils");
|
4
|
+
var log = require("npmlog");
|
5
|
+
|
6
|
+
function formatData(data) {
|
7
|
+
return {
|
8
|
+
userID: utils.formatID(data.uid.toString()),
|
9
|
+
photoUrl: data.photo,
|
10
|
+
indexRank: data.index_rank,
|
11
|
+
name: data.text,
|
12
|
+
isVerified: data.is_verified,
|
13
|
+
profileUrl: data.path,
|
14
|
+
category: data.category,
|
15
|
+
score: data.score,
|
16
|
+
type: data.type
|
17
|
+
};
|
18
|
+
}
|
19
|
+
|
20
|
+
module.exports = function(defaultFuncs, api, ctx) {
|
21
|
+
return function getUserID(name, callback) {
|
22
|
+
var resolveFunc = function(){};
|
23
|
+
var rejectFunc = function(){};
|
24
|
+
var returnPromise = new Promise(function (resolve, reject) {
|
25
|
+
resolveFunc = resolve;
|
26
|
+
rejectFunc = reject;
|
27
|
+
});
|
28
|
+
|
29
|
+
if (!callback) {
|
30
|
+
callback = function (err, friendList) {
|
31
|
+
if (err) {
|
32
|
+
return rejectFunc(err);
|
33
|
+
}
|
34
|
+
resolveFunc(friendList);
|
35
|
+
};
|
36
|
+
}
|
37
|
+
|
38
|
+
var form = {
|
39
|
+
value: name.toLowerCase(),
|
40
|
+
viewer: ctx.userID,
|
41
|
+
rsp: "search",
|
42
|
+
context: "search",
|
43
|
+
path: "/home.php",
|
44
|
+
request_id: utils.getGUID()
|
45
|
+
};
|
46
|
+
|
47
|
+
defaultFuncs
|
48
|
+
.get("https://www.facebook.com/ajax/typeahead/search.php", ctx.jar, form)
|
49
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
50
|
+
.then(function(resData) {
|
51
|
+
if (resData.error) {
|
52
|
+
throw resData;
|
53
|
+
}
|
54
|
+
|
55
|
+
var data = resData.payload.entries;
|
56
|
+
|
57
|
+
callback(null, data.map(formatData));
|
58
|
+
})
|
59
|
+
.catch(function(err) {
|
60
|
+
log.error("getUserID", err);
|
61
|
+
return callback(err);
|
62
|
+
});
|
63
|
+
|
64
|
+
return returnPromise;
|
65
|
+
};
|
66
|
+
};
|
package/leiamnash/getUserInfo.js
CHANGED
@@ -1,113 +1,72 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var utils = require("../utils");
|
4
|
-
var log = require("npmlog");
|
5
|
-
|
6
|
-
function formatData(data) {
|
7
|
-
var retObj = {};
|
8
|
-
|
9
|
-
for (var prop in data) {
|
10
|
-
// eslint-disable-next-line no-prototype-builtins
|
11
|
-
if (data.hasOwnProperty(prop)) {
|
12
|
-
var innerObj = data[prop];
|
13
|
-
retObj[prop] = {
|
14
|
-
name: innerObj.name,
|
15
|
-
firstName: innerObj.firstName,
|
16
|
-
vanity: innerObj.vanity,
|
17
|
-
thumbSrc: innerObj.thumbSrc,
|
18
|
-
profileUrl: innerObj.uri,
|
19
|
-
gender: innerObj.gender,
|
20
|
-
type: innerObj.type,
|
21
|
-
isFriend: innerObj.is_friend,
|
22
|
-
isBirthday: !!innerObj.is_birthday
|
23
|
-
};
|
24
|
-
}
|
25
|
-
}
|
26
|
-
|
27
|
-
return retObj;
|
28
|
-
}
|
29
|
-
|
30
|
-
module.exports = function
|
31
|
-
|
32
|
-
|
33
|
-
var
|
34
|
-
var
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
if (
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
if (
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
NeedGet.push(i);
|
74
|
-
}
|
75
|
-
}
|
76
|
-
}
|
77
|
-
}
|
78
|
-
|
79
|
-
if (NeedGet.length > 0) {
|
80
|
-
let form = {};
|
81
|
-
NeedGet.map(function (v, i) {
|
82
|
-
form["ids[" + i + "]"] = v;
|
83
|
-
});
|
84
|
-
defaultFuncs
|
85
|
-
.post("https://www.facebook.com/chat/user_info/", ctx.jar, form)
|
86
|
-
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
87
|
-
.then(function (resData) {
|
88
|
-
if (resData.error) throw resData;
|
89
|
-
if (AlreadyGet.length > 0) {
|
90
|
-
AlreadyGet.push(formatData(resData.payload.profiles));
|
91
|
-
}
|
92
|
-
else if (AlreadyGet.length <= 0 && NeedGet.length == 1) {
|
93
|
-
AlreadyGet = formatData(resData.payload.profiles);
|
94
|
-
}
|
95
|
-
else {
|
96
|
-
AlreadyGet.push(formatData(resData.payload.profiles));
|
97
|
-
}
|
98
|
-
callback(null, AlreadyGet);
|
99
|
-
})
|
100
|
-
.catch(function (err) {
|
101
|
-
log.error("getUserInfo", "Lỗi: getUserInfo Có Thể Do Bạn Spam Quá Nhiều !,Hãy Thử Lại !");
|
102
|
-
callback(err, null);
|
103
|
-
});
|
104
|
-
}
|
105
|
-
else if (AlreadyGet.length == 1) {
|
106
|
-
callback(null,AlreadyGet[0]);
|
107
|
-
}
|
108
|
-
else if (AlreadyGet.length > 1) {
|
109
|
-
callback(null, AlreadyGet);
|
110
|
-
}
|
111
|
-
return returnPromise;
|
112
|
-
};
|
113
|
-
};
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var utils = require("../utils");
|
4
|
+
var log = require("npmlog");
|
5
|
+
|
6
|
+
function formatData(data) {
|
7
|
+
var retObj = {};
|
8
|
+
|
9
|
+
for (var prop in data) {
|
10
|
+
// eslint-disable-next-line no-prototype-builtins
|
11
|
+
if (data.hasOwnProperty(prop)) {
|
12
|
+
var innerObj = data[prop];
|
13
|
+
retObj[prop] = {
|
14
|
+
name: innerObj.name,
|
15
|
+
firstName: innerObj.firstName,
|
16
|
+
vanity: innerObj.vanity,
|
17
|
+
thumbSrc: innerObj.thumbSrc,
|
18
|
+
profileUrl: innerObj.uri,
|
19
|
+
gender: innerObj.gender,
|
20
|
+
type: innerObj.type,
|
21
|
+
isFriend: innerObj.is_friend,
|
22
|
+
isBirthday: !!innerObj.is_birthday
|
23
|
+
};
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
return retObj;
|
28
|
+
}
|
29
|
+
|
30
|
+
module.exports = function(defaultFuncs, api, ctx) {
|
31
|
+
return function getUserInfo(id, callback) {
|
32
|
+
var resolveFunc = function(){};
|
33
|
+
var rejectFunc = function(){};
|
34
|
+
var returnPromise = new Promise(function (resolve, reject) {
|
35
|
+
resolveFunc = resolve;
|
36
|
+
rejectFunc = reject;
|
37
|
+
});
|
38
|
+
|
39
|
+
if (!callback) {
|
40
|
+
callback = function (err, friendList) {
|
41
|
+
if (err) {
|
42
|
+
return rejectFunc(err);
|
43
|
+
}
|
44
|
+
resolveFunc(friendList);
|
45
|
+
};
|
46
|
+
}
|
47
|
+
|
48
|
+
if (utils.getType(id) !== "Array") {
|
49
|
+
id = [id];
|
50
|
+
}
|
51
|
+
|
52
|
+
var form = {};
|
53
|
+
id.map(function(v, i) {
|
54
|
+
form["ids[" + i + "]"] = v;
|
55
|
+
});
|
56
|
+
defaultFuncs
|
57
|
+
.post("https://www.facebook.com/chat/user_info/", ctx.jar, form)
|
58
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
59
|
+
.then(function(resData) {
|
60
|
+
if (resData.error) {
|
61
|
+
throw resData;
|
62
|
+
}
|
63
|
+
return callback(null, formatData(resData.payload.profiles));
|
64
|
+
})
|
65
|
+
.catch(function(err) {
|
66
|
+
log.error("getUserInfo", err);
|
67
|
+
return callback(err);
|
68
|
+
});
|
69
|
+
|
70
|
+
return returnPromise;
|
71
|
+
};
|
72
|
+
};
|
@@ -1,46 +1,61 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var utils = require("../utils");
|
4
|
-
var log = require("npmlog");
|
5
|
-
|
6
|
-
module.exports = function
|
7
|
-
return function handleFriendRequest(userID, accept, callback) {
|
8
|
-
if (utils.getType(accept) !== "Boolean")
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
}
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
.
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
.
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
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
|
+
};
|