alicezetion 1.6.6 → 1.6.8
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 +804 -381
- package/leiamnash/addExternalModule.js +19 -19
- package/leiamnash/addUserToGroup.js +113 -113
- package/leiamnash/changeAdminStatus.js +79 -79
- package/leiamnash/changeApprovalMode.js +80 -0
- package/leiamnash/changeArchivedStatus.js +55 -55
- package/leiamnash/changeBio.js +77 -77
- package/leiamnash/changeBlockedStatus.js +47 -47
- package/leiamnash/changeGroupImage.js +129 -129
- package/leiamnash/changeNickname.js +59 -59
- package/leiamnash/changeThreadColor.js +71 -71
- package/leiamnash/changeThreadEmoji.js +55 -55
- package/leiamnash/chat.js +447 -459
- package/leiamnash/createNewGroup.js +86 -86
- package/leiamnash/createPoll.js +71 -71
- package/leiamnash/deleteMessage.js +56 -56
- package/leiamnash/deleteThread.js +56 -56
- package/leiamnash/forwardAttachment.js +60 -60
- package/leiamnash/getCurrentUserID.js +7 -7
- package/leiamnash/getEmojiUrl.js +29 -29
- package/leiamnash/getFriendsList.js +84 -84
- package/leiamnash/getThreadHistory.js +645 -645
- package/leiamnash/getThreadHistoryDeprecated.js +93 -93
- package/leiamnash/getThreadInfo.js +212 -206
- package/leiamnash/getThreadInfoDeprecated.js +80 -80
- package/leiamnash/getThreadList.js +238 -238
- package/leiamnash/getThreadListDeprecated.js +75 -75
- package/leiamnash/getThreadPictures.js +79 -79
- package/leiamnash/getUserID.js +66 -66
- package/leiamnash/getUserInfo.js +72 -72
- package/leiamnash/handleFriendRequest.js +61 -61
- package/leiamnash/handleMessageRequest.js +65 -65
- package/leiamnash/httpGet.js +52 -52
- package/leiamnash/httpPost.js +52 -52
- package/leiamnash/listenMqtt.js +1129 -789
- package/leiamnash/logout.js +75 -75
- package/leiamnash/markAsDelivered.js +58 -58
- package/leiamnash/markAsRead.js +80 -80
- package/leiamnash/markAsReadAll.js +49 -49
- package/leiamnash/markAsSeen.js +59 -59
- package/leiamnash/muteThread.js +52 -52
- package/leiamnash/removeUserFromGroup.js +79 -79
- package/leiamnash/resolvePhotoUrl.js +45 -45
- package/leiamnash/searchForThread.js +53 -53
- package/leiamnash/sendTypingIndicator.js +103 -103
- package/leiamnash/setMessageReaction.js +117 -117
- package/leiamnash/setPostReaction.js +76 -76
- package/leiamnash/setTitle.js +86 -86
- package/leiamnash/threadColors.js +57 -57
- package/leiamnash/unfriend.js +52 -52
- package/leiamnash/unsendMessage.js +49 -49
- package/package.json +72 -72
- package/replit.nix +3 -0
- package/utils.js +196 -71
- package/leiamnash/listen.js +0 -553
package/leiamnash/getEmojiUrl.js
CHANGED
@@ -1,29 +1,29 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
const util = require("util");
|
4
|
-
|
5
|
-
module.exports = function() {
|
6
|
-
return function getEmojiUrl(c, size, pixelRatio) {
|
7
|
-
/*
|
8
|
-
Resolves Facebook Messenger emoji image asset URL for an emoji character.
|
9
|
-
Supported sizes are 32, 64, and 128.
|
10
|
-
Supported pixel ratios are '1.0' and '1.5' (possibly more; haven't tested)
|
11
|
-
*/
|
12
|
-
const baseUrl = "https://static.xx.fbcdn.net/images/emoji.php/v8/z%s/%s";
|
13
|
-
pixelRatio = pixelRatio || "1.0";
|
14
|
-
|
15
|
-
let ending = util.format(
|
16
|
-
"%s/%s/%s.png",
|
17
|
-
pixelRatio,
|
18
|
-
size,
|
19
|
-
c.codePointAt(0).toString(16)
|
20
|
-
);
|
21
|
-
let base = 317426846;
|
22
|
-
for (let i = 0; i < ending.length; i++) {
|
23
|
-
base = (base << 5) - base + ending.charCodeAt(i);
|
24
|
-
}
|
25
|
-
|
26
|
-
let hashed = (base & 255).toString(16);
|
27
|
-
return util.format(baseUrl, hashed, ending);
|
28
|
-
};
|
29
|
-
};
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
const util = require("util");
|
4
|
+
|
5
|
+
module.exports = function() {
|
6
|
+
return function getEmojiUrl(c, size, pixelRatio) {
|
7
|
+
/*
|
8
|
+
Resolves Facebook Messenger emoji image asset URL for an emoji character.
|
9
|
+
Supported sizes are 32, 64, and 128.
|
10
|
+
Supported pixel ratios are '1.0' and '1.5' (possibly more; haven't tested)
|
11
|
+
*/
|
12
|
+
const baseUrl = "https://static.xx.fbcdn.net/images/emoji.php/v8/z%s/%s";
|
13
|
+
pixelRatio = pixelRatio || "1.0";
|
14
|
+
|
15
|
+
let ending = util.format(
|
16
|
+
"%s/%s/%s.png",
|
17
|
+
pixelRatio,
|
18
|
+
size,
|
19
|
+
c.codePointAt(0).toString(16)
|
20
|
+
);
|
21
|
+
let base = 317426846;
|
22
|
+
for (let i = 0; i < ending.length; i++) {
|
23
|
+
base = (base << 5) - base + ending.charCodeAt(i);
|
24
|
+
}
|
25
|
+
|
26
|
+
let hashed = (base & 255).toString(16);
|
27
|
+
return util.format(baseUrl, hashed, ending);
|
28
|
+
};
|
29
|
+
};
|
@@ -1,84 +1,84 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
//var cheerio = require("cheerio");
|
4
|
-
var utils = require("../utils");
|
5
|
-
var log = require("npmlog");
|
6
|
-
|
7
|
-
// [almost] copy pasted from one of FB's minified file (GenderConst)
|
8
|
-
var GENDERS = {
|
9
|
-
0: "unknown",
|
10
|
-
1: "female_singular",
|
11
|
-
2: "male_singular",
|
12
|
-
3: "female_singular_guess",
|
13
|
-
4: "male_singular_guess",
|
14
|
-
5: "mixed",
|
15
|
-
6: "neuter_singular",
|
16
|
-
7: "unknown_singular",
|
17
|
-
8: "female_plural",
|
18
|
-
9: "male_plural",
|
19
|
-
10: "neuter_plural",
|
20
|
-
11: "unknown_plural"
|
21
|
-
};
|
22
|
-
|
23
|
-
function formatData(obj) {
|
24
|
-
return Object.keys(obj).map(function(key) {
|
25
|
-
var user = obj[key];
|
26
|
-
return {
|
27
|
-
alternateName: user.alternateName,
|
28
|
-
firstName: user.firstName,
|
29
|
-
gender: GENDERS[user.gender],
|
30
|
-
userID: utils.formatID(user.id.toString()),
|
31
|
-
isFriend: user.is_friend != null && user.is_friend ? true : false,
|
32
|
-
fullName: user.name,
|
33
|
-
profilePicture: user.thumbSrc,
|
34
|
-
type: user.type,
|
35
|
-
profileUrl: user.uri,
|
36
|
-
vanity: user.vanity,
|
37
|
-
isBirthday: !!user.is_birthday
|
38
|
-
};
|
39
|
-
});
|
40
|
-
}
|
41
|
-
|
42
|
-
module.exports = function(defaultFuncs, api, ctx) {
|
43
|
-
return function getFriendsList(callback) {
|
44
|
-
var resolveFunc = function(){};
|
45
|
-
var rejectFunc = function(){};
|
46
|
-
var returnPromise = new Promise(function (resolve, reject) {
|
47
|
-
resolveFunc = resolve;
|
48
|
-
rejectFunc = reject;
|
49
|
-
});
|
50
|
-
|
51
|
-
if (!callback) {
|
52
|
-
callback = function (err, friendList) {
|
53
|
-
if (err) {
|
54
|
-
return rejectFunc(err);
|
55
|
-
}
|
56
|
-
resolveFunc(friendList);
|
57
|
-
};
|
58
|
-
}
|
59
|
-
|
60
|
-
defaultFuncs
|
61
|
-
.postFormData(
|
62
|
-
"https://www.facebook.com/chat/user_info_all",
|
63
|
-
ctx.jar,
|
64
|
-
{},
|
65
|
-
{ viewer: ctx.userID }
|
66
|
-
)
|
67
|
-
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
68
|
-
.then(function(resData) {
|
69
|
-
if (!resData) {
|
70
|
-
throw { error: "getFriendsList returned empty object." };
|
71
|
-
}
|
72
|
-
if (resData.error) {
|
73
|
-
throw resData;
|
74
|
-
}
|
75
|
-
callback(null, formatData(resData.payload));
|
76
|
-
})
|
77
|
-
.catch(function(err) {
|
78
|
-
log.error("getFriendsList", err);
|
79
|
-
return callback(err);
|
80
|
-
});
|
81
|
-
|
82
|
-
return returnPromise;
|
83
|
-
};
|
84
|
-
};
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
//var cheerio = require("cheerio");
|
4
|
+
var utils = require("../utils");
|
5
|
+
var log = require("npmlog");
|
6
|
+
|
7
|
+
// [almost] copy pasted from one of FB's minified file (GenderConst)
|
8
|
+
var GENDERS = {
|
9
|
+
0: "unknown",
|
10
|
+
1: "female_singular",
|
11
|
+
2: "male_singular",
|
12
|
+
3: "female_singular_guess",
|
13
|
+
4: "male_singular_guess",
|
14
|
+
5: "mixed",
|
15
|
+
6: "neuter_singular",
|
16
|
+
7: "unknown_singular",
|
17
|
+
8: "female_plural",
|
18
|
+
9: "male_plural",
|
19
|
+
10: "neuter_plural",
|
20
|
+
11: "unknown_plural"
|
21
|
+
};
|
22
|
+
|
23
|
+
function formatData(obj) {
|
24
|
+
return Object.keys(obj).map(function(key) {
|
25
|
+
var user = obj[key];
|
26
|
+
return {
|
27
|
+
alternateName: user.alternateName,
|
28
|
+
firstName: user.firstName,
|
29
|
+
gender: GENDERS[user.gender],
|
30
|
+
userID: utils.formatID(user.id.toString()),
|
31
|
+
isFriend: user.is_friend != null && user.is_friend ? true : false,
|
32
|
+
fullName: user.name,
|
33
|
+
profilePicture: user.thumbSrc,
|
34
|
+
type: user.type,
|
35
|
+
profileUrl: user.uri,
|
36
|
+
vanity: user.vanity,
|
37
|
+
isBirthday: !!user.is_birthday
|
38
|
+
};
|
39
|
+
});
|
40
|
+
}
|
41
|
+
|
42
|
+
module.exports = function(defaultFuncs, api, ctx) {
|
43
|
+
return function getFriendsList(callback) {
|
44
|
+
var resolveFunc = function(){};
|
45
|
+
var rejectFunc = function(){};
|
46
|
+
var returnPromise = new Promise(function (resolve, reject) {
|
47
|
+
resolveFunc = resolve;
|
48
|
+
rejectFunc = reject;
|
49
|
+
});
|
50
|
+
|
51
|
+
if (!callback) {
|
52
|
+
callback = function (err, friendList) {
|
53
|
+
if (err) {
|
54
|
+
return rejectFunc(err);
|
55
|
+
}
|
56
|
+
resolveFunc(friendList);
|
57
|
+
};
|
58
|
+
}
|
59
|
+
|
60
|
+
defaultFuncs
|
61
|
+
.postFormData(
|
62
|
+
"https://www.facebook.com/chat/user_info_all",
|
63
|
+
ctx.jar,
|
64
|
+
{},
|
65
|
+
{ viewer: ctx.userID }
|
66
|
+
)
|
67
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
68
|
+
.then(function(resData) {
|
69
|
+
if (!resData) {
|
70
|
+
throw { error: "getFriendsList returned empty object." };
|
71
|
+
}
|
72
|
+
if (resData.error) {
|
73
|
+
throw resData;
|
74
|
+
}
|
75
|
+
callback(null, formatData(resData.payload));
|
76
|
+
})
|
77
|
+
.catch(function(err) {
|
78
|
+
log.error("getFriendsList", err);
|
79
|
+
return callback(err);
|
80
|
+
});
|
81
|
+
|
82
|
+
return returnPromise;
|
83
|
+
};
|
84
|
+
};
|