alicezetion 1.6.7 → 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 +1078 -509
- 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
@@ -1,117 +1,117 @@
|
|
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 setMessageReaction(reaction, messageID, callback, forceCustomReaction) {
|
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
|
-
switch (reaction) {
|
25
|
-
case "\uD83D\uDE0D": //:heart_eyes:
|
26
|
-
case "\uD83D\uDE06": //:laughing:
|
27
|
-
case "\uD83D\uDE2E": //:open_mouth:
|
28
|
-
case "\uD83D\uDE22": //:cry:
|
29
|
-
case "\uD83D\uDE20": //:angry:
|
30
|
-
case "\uD83D\uDC4D": //:thumbsup:
|
31
|
-
case "\uD83D\uDC4E": //:thumbsdown:
|
32
|
-
case "\u2764": //:heart:
|
33
|
-
case "\uD83D\uDC97": //:glowingheart:
|
34
|
-
case "":
|
35
|
-
//valid
|
36
|
-
break;
|
37
|
-
case ":heart_eyes:":
|
38
|
-
case ":love:":
|
39
|
-
reaction = "\uD83D\uDE0D";
|
40
|
-
break;
|
41
|
-
case ":laughing:":
|
42
|
-
case ":haha:":
|
43
|
-
reaction = "\uD83D\uDE06";
|
44
|
-
break;
|
45
|
-
case ":open_mouth:":
|
46
|
-
case ":wow:":
|
47
|
-
reaction = "\uD83D\uDE2E";
|
48
|
-
break;
|
49
|
-
case ":cry:":
|
50
|
-
case ":sad:":
|
51
|
-
reaction = "\uD83D\uDE22";
|
52
|
-
break;
|
53
|
-
case ":angry:":
|
54
|
-
reaction = "\uD83D\uDE20";
|
55
|
-
break;
|
56
|
-
case ":thumbsup:":
|
57
|
-
case ":like:":
|
58
|
-
reaction = "\uD83D\uDC4D";
|
59
|
-
break;
|
60
|
-
case ":thumbsdown:":
|
61
|
-
case ":dislike:":
|
62
|
-
reaction = "\uD83D\uDC4E";
|
63
|
-
break;
|
64
|
-
case ":heart:":
|
65
|
-
reaction = "\u2764";
|
66
|
-
break;
|
67
|
-
case ":glowingheart:":
|
68
|
-
reaction = "\uD83D\uDC97";
|
69
|
-
break;
|
70
|
-
default:
|
71
|
-
if (forceCustomReaction) {
|
72
|
-
break;
|
73
|
-
}
|
74
|
-
return callback({ error: "Reaction is not a valid emoji." });
|
75
|
-
}
|
76
|
-
|
77
|
-
var variables = {
|
78
|
-
data: {
|
79
|
-
client_mutation_id: ctx.clientMutationId++,
|
80
|
-
actor_id: ctx.userID,
|
81
|
-
action: reaction == "" ? "REMOVE_REACTION" : "ADD_REACTION",
|
82
|
-
message_id: messageID,
|
83
|
-
reaction: reaction
|
84
|
-
}
|
85
|
-
};
|
86
|
-
|
87
|
-
var qs = {
|
88
|
-
doc_id: "1491398900900362",
|
89
|
-
variables: JSON.stringify(variables),
|
90
|
-
dpr: 1
|
91
|
-
};
|
92
|
-
|
93
|
-
defaultFuncs
|
94
|
-
.postFormData(
|
95
|
-
"https://www.facebook.com/webgraphql/mutation/",
|
96
|
-
ctx.jar,
|
97
|
-
{},
|
98
|
-
qs
|
99
|
-
)
|
100
|
-
.then(utils.parseAndCheckLogin(ctx.jar, defaultFuncs))
|
101
|
-
.then(function(resData) {
|
102
|
-
if (!resData) {
|
103
|
-
throw { error: "setReaction returned empty object." };
|
104
|
-
}
|
105
|
-
if (resData.error) {
|
106
|
-
throw resData;
|
107
|
-
}
|
108
|
-
callback(null);
|
109
|
-
})
|
110
|
-
.catch(function(err) {
|
111
|
-
log.error("setReaction", err);
|
112
|
-
return callback(err);
|
113
|
-
});
|
114
|
-
|
115
|
-
return returnPromise;
|
116
|
-
};
|
117
|
-
};
|
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 setMessageReaction(reaction, messageID, callback, forceCustomReaction) {
|
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
|
+
switch (reaction) {
|
25
|
+
case "\uD83D\uDE0D": //:heart_eyes:
|
26
|
+
case "\uD83D\uDE06": //:laughing:
|
27
|
+
case "\uD83D\uDE2E": //:open_mouth:
|
28
|
+
case "\uD83D\uDE22": //:cry:
|
29
|
+
case "\uD83D\uDE20": //:angry:
|
30
|
+
case "\uD83D\uDC4D": //:thumbsup:
|
31
|
+
case "\uD83D\uDC4E": //:thumbsdown:
|
32
|
+
case "\u2764": //:heart:
|
33
|
+
case "\uD83D\uDC97": //:glowingheart:
|
34
|
+
case "":
|
35
|
+
//valid
|
36
|
+
break;
|
37
|
+
case ":heart_eyes:":
|
38
|
+
case ":love:":
|
39
|
+
reaction = "\uD83D\uDE0D";
|
40
|
+
break;
|
41
|
+
case ":laughing:":
|
42
|
+
case ":haha:":
|
43
|
+
reaction = "\uD83D\uDE06";
|
44
|
+
break;
|
45
|
+
case ":open_mouth:":
|
46
|
+
case ":wow:":
|
47
|
+
reaction = "\uD83D\uDE2E";
|
48
|
+
break;
|
49
|
+
case ":cry:":
|
50
|
+
case ":sad:":
|
51
|
+
reaction = "\uD83D\uDE22";
|
52
|
+
break;
|
53
|
+
case ":angry:":
|
54
|
+
reaction = "\uD83D\uDE20";
|
55
|
+
break;
|
56
|
+
case ":thumbsup:":
|
57
|
+
case ":like:":
|
58
|
+
reaction = "\uD83D\uDC4D";
|
59
|
+
break;
|
60
|
+
case ":thumbsdown:":
|
61
|
+
case ":dislike:":
|
62
|
+
reaction = "\uD83D\uDC4E";
|
63
|
+
break;
|
64
|
+
case ":heart:":
|
65
|
+
reaction = "\u2764";
|
66
|
+
break;
|
67
|
+
case ":glowingheart:":
|
68
|
+
reaction = "\uD83D\uDC97";
|
69
|
+
break;
|
70
|
+
default:
|
71
|
+
if (forceCustomReaction) {
|
72
|
+
break;
|
73
|
+
}
|
74
|
+
return callback({ error: "Reaction is not a valid emoji." });
|
75
|
+
}
|
76
|
+
|
77
|
+
var variables = {
|
78
|
+
data: {
|
79
|
+
client_mutation_id: ctx.clientMutationId++,
|
80
|
+
actor_id: ctx.userID,
|
81
|
+
action: reaction == "" ? "REMOVE_REACTION" : "ADD_REACTION",
|
82
|
+
message_id: messageID,
|
83
|
+
reaction: reaction
|
84
|
+
}
|
85
|
+
};
|
86
|
+
|
87
|
+
var qs = {
|
88
|
+
doc_id: "1491398900900362",
|
89
|
+
variables: JSON.stringify(variables),
|
90
|
+
dpr: 1
|
91
|
+
};
|
92
|
+
|
93
|
+
defaultFuncs
|
94
|
+
.postFormData(
|
95
|
+
"https://www.facebook.com/webgraphql/mutation/",
|
96
|
+
ctx.jar,
|
97
|
+
{},
|
98
|
+
qs
|
99
|
+
)
|
100
|
+
.then(utils.parseAndCheckLogin(ctx.jar, defaultFuncs))
|
101
|
+
.then(function(resData) {
|
102
|
+
if (!resData) {
|
103
|
+
throw { error: "setReaction returned empty object." };
|
104
|
+
}
|
105
|
+
if (resData.error) {
|
106
|
+
throw resData;
|
107
|
+
}
|
108
|
+
callback(null);
|
109
|
+
})
|
110
|
+
.catch(function(err) {
|
111
|
+
log.error("setReaction", err);
|
112
|
+
return callback(err);
|
113
|
+
});
|
114
|
+
|
115
|
+
return returnPromise;
|
116
|
+
};
|
117
|
+
};
|
@@ -1,76 +1,76 @@
|
|
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 unsendMessage(postID, type, 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 map = {
|
25
|
-
like: 1,
|
26
|
-
heart: 2,
|
27
|
-
wow: 3,
|
28
|
-
haha: 4,
|
29
|
-
sad: 7,
|
30
|
-
angry: 8
|
31
|
-
};
|
32
|
-
if (typeof type != "number") {
|
33
|
-
type = map[type.toLocaleLowerCase()];
|
34
|
-
if (!type) {
|
35
|
-
type = 1;
|
36
|
-
}
|
37
|
-
}
|
38
|
-
var form = {
|
39
|
-
av: ctx.userID,
|
40
|
-
fb_api_caller_class: "RelayModern",
|
41
|
-
fb_api_req_friendly_name: "UFI2FeedbackReactMutation",
|
42
|
-
//This doc_id is valid as of January 17th, 2020
|
43
|
-
doc_id: "2580813318646067",
|
44
|
-
variables: JSON.stringify({
|
45
|
-
input: {
|
46
|
-
client_mutation_id: "7",
|
47
|
-
actor_id: ctx.userID,
|
48
|
-
feedback_reaction: type,
|
49
|
-
|
50
|
-
},
|
51
|
-
useDefaultActor: true
|
52
|
-
})
|
53
|
-
};
|
54
|
-
|
55
|
-
defaultFuncs
|
56
|
-
.post(
|
57
|
-
"https://www.facebook.com/api/graphql/",
|
58
|
-
ctx.jar,
|
59
|
-
form
|
60
|
-
)
|
61
|
-
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
62
|
-
.then(function(resData) {
|
63
|
-
if (resData.error) {
|
64
|
-
throw resData;
|
65
|
-
}
|
66
|
-
|
67
|
-
return callback();
|
68
|
-
})
|
69
|
-
.catch(function(err) {
|
70
|
-
log.error("setPostReaction", err);
|
71
|
-
return callback(err);
|
72
|
-
});
|
73
|
-
|
74
|
-
return returnPromise;
|
75
|
-
};
|
76
|
-
};
|
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 unsendMessage(postID, type, 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 map = {
|
25
|
+
like: 1,
|
26
|
+
heart: 2,
|
27
|
+
wow: 3,
|
28
|
+
haha: 4,
|
29
|
+
sad: 7,
|
30
|
+
angry: 8
|
31
|
+
};
|
32
|
+
if (typeof type != "number") {
|
33
|
+
type = map[type.toLocaleLowerCase()];
|
34
|
+
if (!type) {
|
35
|
+
type = 1;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
var form = {
|
39
|
+
av: ctx.userID,
|
40
|
+
fb_api_caller_class: "RelayModern",
|
41
|
+
fb_api_req_friendly_name: "UFI2FeedbackReactMutation",
|
42
|
+
//This doc_id is valid as of January 17th, 2020
|
43
|
+
doc_id: "2580813318646067",
|
44
|
+
variables: JSON.stringify({
|
45
|
+
input: {
|
46
|
+
client_mutation_id: "7",
|
47
|
+
actor_id: ctx.userID,
|
48
|
+
feedback_reaction: type,
|
49
|
+
|
50
|
+
},
|
51
|
+
useDefaultActor: true
|
52
|
+
})
|
53
|
+
};
|
54
|
+
|
55
|
+
defaultFuncs
|
56
|
+
.post(
|
57
|
+
"https://www.facebook.com/api/graphql/",
|
58
|
+
ctx.jar,
|
59
|
+
form
|
60
|
+
)
|
61
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
62
|
+
.then(function(resData) {
|
63
|
+
if (resData.error) {
|
64
|
+
throw resData;
|
65
|
+
}
|
66
|
+
|
67
|
+
return callback();
|
68
|
+
})
|
69
|
+
.catch(function(err) {
|
70
|
+
log.error("setPostReaction", err);
|
71
|
+
return callback(err);
|
72
|
+
});
|
73
|
+
|
74
|
+
return returnPromise;
|
75
|
+
};
|
76
|
+
};
|
package/leiamnash/setTitle.js
CHANGED
@@ -1,86 +1,86 @@
|
|
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 setTitle(newTitle, threadID, callback) {
|
8
|
-
if (
|
9
|
-
!callback &&
|
10
|
-
(utils.getType(threadID) === "Function" ||
|
11
|
-
utils.getType(threadID) === "AsyncFunction")
|
12
|
-
) {
|
13
|
-
throw { error: "please pass a threadID as a second argument." };
|
14
|
-
}
|
15
|
-
|
16
|
-
var resolveFunc = function(){};
|
17
|
-
var rejectFunc = function(){};
|
18
|
-
var returnPromise = new Promise(function (resolve, reject) {
|
19
|
-
resolveFunc = resolve;
|
20
|
-
rejectFunc = reject;
|
21
|
-
});
|
22
|
-
|
23
|
-
if (!callback) {
|
24
|
-
callback = function (err, friendList) {
|
25
|
-
if (err) {
|
26
|
-
return rejectFunc(err);
|
27
|
-
}
|
28
|
-
resolveFunc(friendList);
|
29
|
-
};
|
30
|
-
}
|
31
|
-
|
32
|
-
var messageAndOTID = utils.generateOfflineThreadingID();
|
33
|
-
var form = {
|
34
|
-
client: "mercury",
|
35
|
-
action_type: "ma-type:log-message",
|
36
|
-
author: "fbid:" + ctx.userID,
|
37
|
-
author_email: "",
|
38
|
-
coordinates: "",
|
39
|
-
timestamp: Date.now(),
|
40
|
-
timestamp_absolute: "Today",
|
41
|
-
timestamp_relative: utils.generateTimestampRelative(),
|
42
|
-
timestamp_time_passed: "0",
|
43
|
-
is_unread: false,
|
44
|
-
is_cleared: false,
|
45
|
-
is_forward: false,
|
46
|
-
is_filtered_content: false,
|
47
|
-
is_spoof_warning: false,
|
48
|
-
source: "source:chat:web",
|
49
|
-
"source_tags[0]": "source:chat",
|
50
|
-
status: "0",
|
51
|
-
offline_threading_id: messageAndOTID,
|
52
|
-
message_id: messageAndOTID,
|
53
|
-
threading_id: utils.generateThreadingID(ctx.clientID),
|
54
|
-
manual_retry_cnt: "0",
|
55
|
-
thread_fbid: threadID,
|
56
|
-
thread_name: newTitle,
|
57
|
-
thread_id: threadID,
|
58
|
-
log_message_type: "log:thread-name"
|
59
|
-
};
|
60
|
-
|
61
|
-
defaultFuncs
|
62
|
-
.post("https://www.facebook.com/messaging/set_thread_name/", ctx.jar, form)
|
63
|
-
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
64
|
-
.then(function(resData) {
|
65
|
-
if (resData.error && resData.error === 1545012) {
|
66
|
-
throw { error: "Cannot change chat title: Not member of chat." };
|
67
|
-
}
|
68
|
-
|
69
|
-
if (resData.error && resData.error === 1545003) {
|
70
|
-
throw { error: "Cannot set title of single-user chat." };
|
71
|
-
}
|
72
|
-
|
73
|
-
if (resData.error) {
|
74
|
-
throw resData;
|
75
|
-
}
|
76
|
-
|
77
|
-
return callback();
|
78
|
-
})
|
79
|
-
.catch(function(err) {
|
80
|
-
log.error("setTitle", err);
|
81
|
-
return callback(err);
|
82
|
-
});
|
83
|
-
|
84
|
-
return returnPromise;
|
85
|
-
};
|
86
|
-
};
|
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 setTitle(newTitle, threadID, callback) {
|
8
|
+
if (
|
9
|
+
!callback &&
|
10
|
+
(utils.getType(threadID) === "Function" ||
|
11
|
+
utils.getType(threadID) === "AsyncFunction")
|
12
|
+
) {
|
13
|
+
throw { error: "please pass a threadID as a second argument." };
|
14
|
+
}
|
15
|
+
|
16
|
+
var resolveFunc = function(){};
|
17
|
+
var rejectFunc = function(){};
|
18
|
+
var returnPromise = new Promise(function (resolve, reject) {
|
19
|
+
resolveFunc = resolve;
|
20
|
+
rejectFunc = reject;
|
21
|
+
});
|
22
|
+
|
23
|
+
if (!callback) {
|
24
|
+
callback = function (err, friendList) {
|
25
|
+
if (err) {
|
26
|
+
return rejectFunc(err);
|
27
|
+
}
|
28
|
+
resolveFunc(friendList);
|
29
|
+
};
|
30
|
+
}
|
31
|
+
|
32
|
+
var messageAndOTID = utils.generateOfflineThreadingID();
|
33
|
+
var form = {
|
34
|
+
client: "mercury",
|
35
|
+
action_type: "ma-type:log-message",
|
36
|
+
author: "fbid:" + ctx.userID,
|
37
|
+
author_email: "",
|
38
|
+
coordinates: "",
|
39
|
+
timestamp: Date.now(),
|
40
|
+
timestamp_absolute: "Today",
|
41
|
+
timestamp_relative: utils.generateTimestampRelative(),
|
42
|
+
timestamp_time_passed: "0",
|
43
|
+
is_unread: false,
|
44
|
+
is_cleared: false,
|
45
|
+
is_forward: false,
|
46
|
+
is_filtered_content: false,
|
47
|
+
is_spoof_warning: false,
|
48
|
+
source: "source:chat:web",
|
49
|
+
"source_tags[0]": "source:chat",
|
50
|
+
status: "0",
|
51
|
+
offline_threading_id: messageAndOTID,
|
52
|
+
message_id: messageAndOTID,
|
53
|
+
threading_id: utils.generateThreadingID(ctx.clientID),
|
54
|
+
manual_retry_cnt: "0",
|
55
|
+
thread_fbid: threadID,
|
56
|
+
thread_name: newTitle,
|
57
|
+
thread_id: threadID,
|
58
|
+
log_message_type: "log:thread-name"
|
59
|
+
};
|
60
|
+
|
61
|
+
defaultFuncs
|
62
|
+
.post("https://www.facebook.com/messaging/set_thread_name/", ctx.jar, form)
|
63
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
64
|
+
.then(function(resData) {
|
65
|
+
if (resData.error && resData.error === 1545012) {
|
66
|
+
throw { error: "Cannot change chat title: Not member of chat." };
|
67
|
+
}
|
68
|
+
|
69
|
+
if (resData.error && resData.error === 1545003) {
|
70
|
+
throw { error: "Cannot set title of single-user chat." };
|
71
|
+
}
|
72
|
+
|
73
|
+
if (resData.error) {
|
74
|
+
throw resData;
|
75
|
+
}
|
76
|
+
|
77
|
+
return callback();
|
78
|
+
})
|
79
|
+
.catch(function(err) {
|
80
|
+
log.error("setTitle", err);
|
81
|
+
return callback(err);
|
82
|
+
});
|
83
|
+
|
84
|
+
return returnPromise;
|
85
|
+
};
|
86
|
+
};
|
@@ -1,57 +1,57 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
module.exports = function(_defaultFuncs, _api, _ctx) {
|
4
|
-
// Currently the only colors that can be passed to api.changeThreadColor(); may change if Facebook adds more
|
5
|
-
return {
|
6
|
-
//Old hex colors.
|
7
|
-
////MessengerBlue: null,
|
8
|
-
////Viking: "#44bec7",
|
9
|
-
////GoldenPoppy: "#ffc300",
|
10
|
-
////RadicalRed: "#fa3c4c",
|
11
|
-
////Shocking: "#d696bb",
|
12
|
-
////PictonBlue: "#6699cc",
|
13
|
-
////FreeSpeechGreen: "#13cf13",
|
14
|
-
////Pumpkin: "#ff7e29",
|
15
|
-
////LightCoral: "#e68585",
|
16
|
-
////MediumSlateBlue: "#7646ff",
|
17
|
-
////DeepSkyBlue: "#20cef5",
|
18
|
-
////Fern: "#67b868",
|
19
|
-
////Cameo: "#d4a88c",
|
20
|
-
////BrilliantRose: "#ff5ca1",
|
21
|
-
////BilobaFlower: "#a695c7"
|
22
|
-
|
23
|
-
//#region This part is for backward compatibly
|
24
|
-
//trying to match the color one-by-one. kill me plz
|
25
|
-
MessengerBlue: "196241301102133", //DefaultBlue
|
26
|
-
Viking: "1928399724138152", //TealBlue
|
27
|
-
GoldenPoppy: "174636906462322", //Yellow
|
28
|
-
RadicalRed: "2129984390566328", //Red
|
29
|
-
Shocking: "2058653964378557", //LavenderPurple
|
30
|
-
FreeSpeechGreen: "2136751179887052", //Green
|
31
|
-
Pumpkin: "175615189761153", //Orange
|
32
|
-
LightCoral: "980963458735625", //CoralPink
|
33
|
-
MediumSlateBlue: "234137870477637", //BrightPurple
|
34
|
-
DeepSkyBlue: "2442142322678320", //AquaBlue
|
35
|
-
BrilliantRose: "169463077092846", //HotPink
|
36
|
-
//i've tried my best, everything else can't be mapped. (or is it?) -UIRI 2020
|
37
|
-
//#endregion
|
38
|
-
|
39
|
-
DefaultBlue: "196241301102133",
|
40
|
-
HotPink: "169463077092846",
|
41
|
-
AquaBlue: "2442142322678320",
|
42
|
-
BrightPurple: "234137870477637",
|
43
|
-
CoralPink: "980963458735625",
|
44
|
-
Orange: "175615189761153",
|
45
|
-
Green: "2136751179887052",
|
46
|
-
LavenderPurple: "2058653964378557",
|
47
|
-
Red: "2129984390566328",
|
48
|
-
Yellow: "174636906462322",
|
49
|
-
TealBlue: "1928399724138152",
|
50
|
-
Aqua: "417639218648241",
|
51
|
-
Mango: "930060997172551",
|
52
|
-
Berry: "164535220883264",
|
53
|
-
Citrus: "370940413392601",
|
54
|
-
Candy: "205488546921017",
|
55
|
-
//StarWars: "809305022860427" Removed.
|
56
|
-
};
|
57
|
-
};
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
module.exports = function(_defaultFuncs, _api, _ctx) {
|
4
|
+
// Currently the only colors that can be passed to api.changeThreadColor(); may change if Facebook adds more
|
5
|
+
return {
|
6
|
+
//Old hex colors.
|
7
|
+
////MessengerBlue: null,
|
8
|
+
////Viking: "#44bec7",
|
9
|
+
////GoldenPoppy: "#ffc300",
|
10
|
+
////RadicalRed: "#fa3c4c",
|
11
|
+
////Shocking: "#d696bb",
|
12
|
+
////PictonBlue: "#6699cc",
|
13
|
+
////FreeSpeechGreen: "#13cf13",
|
14
|
+
////Pumpkin: "#ff7e29",
|
15
|
+
////LightCoral: "#e68585",
|
16
|
+
////MediumSlateBlue: "#7646ff",
|
17
|
+
////DeepSkyBlue: "#20cef5",
|
18
|
+
////Fern: "#67b868",
|
19
|
+
////Cameo: "#d4a88c",
|
20
|
+
////BrilliantRose: "#ff5ca1",
|
21
|
+
////BilobaFlower: "#a695c7"
|
22
|
+
|
23
|
+
//#region This part is for backward compatibly
|
24
|
+
//trying to match the color one-by-one. kill me plz
|
25
|
+
MessengerBlue: "196241301102133", //DefaultBlue
|
26
|
+
Viking: "1928399724138152", //TealBlue
|
27
|
+
GoldenPoppy: "174636906462322", //Yellow
|
28
|
+
RadicalRed: "2129984390566328", //Red
|
29
|
+
Shocking: "2058653964378557", //LavenderPurple
|
30
|
+
FreeSpeechGreen: "2136751179887052", //Green
|
31
|
+
Pumpkin: "175615189761153", //Orange
|
32
|
+
LightCoral: "980963458735625", //CoralPink
|
33
|
+
MediumSlateBlue: "234137870477637", //BrightPurple
|
34
|
+
DeepSkyBlue: "2442142322678320", //AquaBlue
|
35
|
+
BrilliantRose: "169463077092846", //HotPink
|
36
|
+
//i've tried my best, everything else can't be mapped. (or is it?) -UIRI 2020
|
37
|
+
//#endregion
|
38
|
+
|
39
|
+
DefaultBlue: "196241301102133",
|
40
|
+
HotPink: "169463077092846",
|
41
|
+
AquaBlue: "2442142322678320",
|
42
|
+
BrightPurple: "234137870477637",
|
43
|
+
CoralPink: "980963458735625",
|
44
|
+
Orange: "175615189761153",
|
45
|
+
Green: "2136751179887052",
|
46
|
+
LavenderPurple: "2058653964378557",
|
47
|
+
Red: "2129984390566328",
|
48
|
+
Yellow: "174636906462322",
|
49
|
+
TealBlue: "1928399724138152",
|
50
|
+
Aqua: "417639218648241",
|
51
|
+
Mango: "930060997172551",
|
52
|
+
Berry: "164535220883264",
|
53
|
+
Citrus: "370940413392601",
|
54
|
+
Candy: "205488546921017",
|
55
|
+
//StarWars: "809305022860427" Removed.
|
56
|
+
};
|
57
|
+
};
|