fca-smart-shankar 12.0.0 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.replit +12 -3
- package/.upm/store.json +1 -0
- package/CHANGELOG.md +2 -0
- package/README.md +0 -1
- package/generated-icon.png +0 -0
- package/index.js +507 -437
- package/package.json +378 -42
- package/replit.nix +3 -1
- package/shankar-fca.json +4 -0
- package/src/addUserToGroup.js +3 -3
- package/src/changeAdminStatus.js +2 -2
- package/src/changeArchivedStatus.js +2 -2
- package/src/changeAvatar.js +8 -8
- package/src/changeAvatarV2.js +1 -1
- package/src/changeBio.js +4 -4
- package/src/changeBlockedStatus.js +2 -2
- package/src/changeCover.js +2 -2
- package/src/changeGroupImage.js +4 -4
- package/src/changeName.js +2 -2
- package/src/changeNickname.js +2 -2
- package/src/changeThreadColor.js +3 -3
- package/src/changeThreadEmoji.js +2 -2
- package/src/changeUsername.js +3 -3
- package/src/createCommentPost.js +5 -5
- package/src/createNewGroup.js +5 -5
- package/src/createPoll.js +2 -2
- package/src/createPost.js +6 -5
- package/src/deleteMessage.js +2 -2
- package/src/deleteThread.js +2 -2
- package/src/editMessage.js +30 -18
- package/src/follow.js +8 -8
- package/src/forwardAttachment.js +2 -2
- package/src/getAccess.js +2 -2
- package/src/getAvatarUser.js +2 -2
- package/src/getCurrentUserID.js +4 -4
- package/src/getFriendsList.js +3 -3
- package/src/getMessage.js +2 -2
- package/src/getThreadHistory.js +2 -2
- package/src/getThreadHistoryDeprecated.js +2 -2
- package/src/getThreadInfo.js +1 -1
- package/src/getThreadInfoDeprecated.js +2 -2
- package/src/getThreadList.js +3 -3
- package/src/getThreadListDeprecated.js +3 -3
- package/src/getThreadPictures.js +2 -2
- package/src/getUID.js +4 -4
- package/src/getUserID.js +3 -3
- package/src/getUserInfo.js +52 -18
- package/src/handleFriendRequest.js +5 -5
- package/src/handleMessageRequest.js +2 -2
- package/src/httpGet.js +3 -3
- package/src/httpPost.js +3 -3
- package/src/httpPostFormData.js +3 -3
- package/src/listenMqtt.js +648 -659
- package/src/listenNotification.js +1 -1
- package/src/logout.js +3 -3
- package/src/markAsDelivered.js +5 -2
- package/src/markAsRead.js +5 -2
- package/src/markAsReadAll.js +2 -2
- package/src/markAsSeen.js +2 -2
- package/src/muteThread.js +2 -2
- package/src/refreshFb_dtsg.js +3 -3
- package/src/removeUserFromGroup.js +2 -2
- package/src/resolvePhotoUrl.js +2 -2
- package/src/searchStickers.js +1 -1
- package/src/sendMessage.js +11 -8
- package/src/sendMessageMqtt.js +4 -4
- package/src/sendTypingIndicator.js +14 -5
- package/src/sendTypingIndicatorV2.js +1 -1
- package/src/setMessageReaction.js +3 -3
- package/src/setPostReaction.js +4 -4
- package/src/setProfileGuard.js +3 -3
- package/src/setStoryReaction.js +1 -1
- package/src/setTitle.js +3 -3
- package/src/shareContact.js +1 -1
- package/src/shareLink.js +1 -1
- package/src/stopListenMqtt.js +5 -2
- package/src/unfriend.js +2 -2
- package/src/unsendMessage.js +2 -2
- package/src/uploadAttachment.js +2 -2
- package/test/data/shareAttach.js +146 -0
- package/test/data/something.mov +0 -0
- package/test/data/test.png +0 -0
- package/test/data/test.txt +7 -0
- package/test/test-page.js +1 -1
- package/utils.js +564 -391
- package/.cache/nix/binary-cache-v6.sqlite +0 -0
- package/.cache/nix/binary-cache-v6.sqlite-journal +0 -0
- package/.cache/replit/env/latest +0 -125
- package/.cache/replit/env/latest.json +0 -1
- package/.cache/replit/modules/nix.res +0 -1
- package/.cache/replit/modules/nodejs-20.res +0 -1
- package/.cache/replit/modules/replit.res +0 -1
- package/.cache/replit/modules.stamp +0 -0
- package/.cache/replit/nix/env.json +0 -1
- package/.cache/typescript/5.6/node_modules/.package-lock.json +0 -171
- package/.cache/typescript/5.6/node_modules/@types/bluebird/LICENSE +0 -21
- package/.cache/typescript/5.6/node_modules/@types/bluebird/README.md +0 -15
- package/.cache/typescript/5.6/node_modules/@types/bluebird/index.d.ts +0 -1365
- package/.cache/typescript/5.6/node_modules/@types/bluebird/package.json +0 -25
- package/.cache/typescript/5.6/node_modules/@types/caseless/LICENSE +0 -21
- package/.cache/typescript/5.6/node_modules/@types/caseless/README.md +0 -48
- package/.cache/typescript/5.6/node_modules/@types/caseless/index.d.ts +0 -29
- package/.cache/typescript/5.6/node_modules/@types/caseless/package.json +0 -35
- package/.cache/typescript/5.6/node_modules/@types/cheerio/LICENSE +0 -21
- package/.cache/typescript/5.6/node_modules/@types/cheerio/README.md +0 -15
- package/.cache/typescript/5.6/node_modules/@types/cheerio/index.d.ts +0 -318
- package/.cache/typescript/5.6/node_modules/@types/cheerio/package.json +0 -71
- package/.cache/typescript/5.6/node_modules/@types/mocha/LICENSE +0 -21
- package/.cache/typescript/5.6/node_modules/@types/mocha/README.md +0 -15
- package/.cache/typescript/5.6/node_modules/@types/mocha/index.d.ts +0 -2929
- package/.cache/typescript/5.6/node_modules/@types/mocha/package.json +0 -56
- package/.cache/typescript/5.6/node_modules/@types/node/LICENSE +0 -21
- package/.cache/typescript/5.6/node_modules/@types/node/README.md +0 -15
- package/.cache/typescript/5.6/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/.cache/typescript/5.6/node_modules/@types/node/assert.d.ts +0 -1040
- package/.cache/typescript/5.6/node_modules/@types/node/async_hooks.d.ts +0 -541
- package/.cache/typescript/5.6/node_modules/@types/node/buffer.buffer.d.ts +0 -385
- package/.cache/typescript/5.6/node_modules/@types/node/buffer.d.ts +0 -1933
- package/.cache/typescript/5.6/node_modules/@types/node/child_process.d.ts +0 -1549
- package/.cache/typescript/5.6/node_modules/@types/node/cluster.d.ts +0 -579
- package/.cache/typescript/5.6/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
- package/.cache/typescript/5.6/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/.cache/typescript/5.6/node_modules/@types/node/compatibility/indexable.d.ts +0 -23
- package/.cache/typescript/5.6/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
- package/.cache/typescript/5.6/node_modules/@types/node/console.d.ts +0 -452
- package/.cache/typescript/5.6/node_modules/@types/node/constants.d.ts +0 -19
- package/.cache/typescript/5.6/node_modules/@types/node/crypto.d.ts +0 -4475
- package/.cache/typescript/5.6/node_modules/@types/node/dgram.d.ts +0 -596
- package/.cache/typescript/5.6/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
- package/.cache/typescript/5.6/node_modules/@types/node/dns/promises.d.ts +0 -476
- package/.cache/typescript/5.6/node_modules/@types/node/dns.d.ts +0 -865
- package/.cache/typescript/5.6/node_modules/@types/node/dom-events.d.ts +0 -124
- package/.cache/typescript/5.6/node_modules/@types/node/domain.d.ts +0 -170
- package/.cache/typescript/5.6/node_modules/@types/node/events.d.ts +0 -931
- package/.cache/typescript/5.6/node_modules/@types/node/fs/promises.d.ts +0 -1275
- package/.cache/typescript/5.6/node_modules/@types/node/fs.d.ts +0 -4396
- package/.cache/typescript/5.6/node_modules/@types/node/globals.d.ts +0 -566
- package/.cache/typescript/5.6/node_modules/@types/node/globals.typedarray.d.ts +0 -21
- package/.cache/typescript/5.6/node_modules/@types/node/http.d.ts +0 -1958
- package/.cache/typescript/5.6/node_modules/@types/node/http2.d.ts +0 -2558
- package/.cache/typescript/5.6/node_modules/@types/node/https.d.ts +0 -543
- package/.cache/typescript/5.6/node_modules/@types/node/index.d.ts +0 -92
- package/.cache/typescript/5.6/node_modules/@types/node/inspector.d.ts +0 -3966
- package/.cache/typescript/5.6/node_modules/@types/node/module.d.ts +0 -402
- package/.cache/typescript/5.6/node_modules/@types/node/net.d.ts +0 -1001
- package/.cache/typescript/5.6/node_modules/@types/node/os.d.ts +0 -495
- package/.cache/typescript/5.6/node_modules/@types/node/package.json +0 -220
- package/.cache/typescript/5.6/node_modules/@types/node/path.d.ts +0 -200
- package/.cache/typescript/5.6/node_modules/@types/node/perf_hooks.d.ts +0 -965
- package/.cache/typescript/5.6/node_modules/@types/node/process.d.ts +0 -1963
- package/.cache/typescript/5.6/node_modules/@types/node/punycode.d.ts +0 -117
- package/.cache/typescript/5.6/node_modules/@types/node/querystring.d.ts +0 -153
- package/.cache/typescript/5.6/node_modules/@types/node/readline/promises.d.ts +0 -162
- package/.cache/typescript/5.6/node_modules/@types/node/readline.d.ts +0 -589
- package/.cache/typescript/5.6/node_modules/@types/node/repl.d.ts +0 -430
- package/.cache/typescript/5.6/node_modules/@types/node/sea.d.ts +0 -153
- package/.cache/typescript/5.6/node_modules/@types/node/sqlite.d.ts +0 -213
- package/.cache/typescript/5.6/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/.cache/typescript/5.6/node_modules/@types/node/stream/promises.d.ts +0 -90
- package/.cache/typescript/5.6/node_modules/@types/node/stream/web.d.ts +0 -609
- package/.cache/typescript/5.6/node_modules/@types/node/stream.d.ts +0 -1726
- package/.cache/typescript/5.6/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/.cache/typescript/5.6/node_modules/@types/node/test.d.ts +0 -2248
- package/.cache/typescript/5.6/node_modules/@types/node/timers/promises.d.ts +0 -97
- package/.cache/typescript/5.6/node_modules/@types/node/timers.d.ts +0 -240
- package/.cache/typescript/5.6/node_modules/@types/node/tls.d.ts +0 -1226
- package/.cache/typescript/5.6/node_modules/@types/node/trace_events.d.ts +0 -197
- package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -385
- package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
- package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/index.d.ts +0 -92
- package/.cache/typescript/5.6/node_modules/@types/node/tty.d.ts +0 -208
- package/.cache/typescript/5.6/node_modules/@types/node/url.d.ts +0 -972
- package/.cache/typescript/5.6/node_modules/@types/node/util.d.ts +0 -2371
- package/.cache/typescript/5.6/node_modules/@types/node/v8.d.ts +0 -808
- package/.cache/typescript/5.6/node_modules/@types/node/vm.d.ts +0 -976
- package/.cache/typescript/5.6/node_modules/@types/node/wasi.d.ts +0 -181
- package/.cache/typescript/5.6/node_modules/@types/node/worker_threads.d.ts +0 -745
- package/.cache/typescript/5.6/node_modules/@types/node/zlib.d.ts +0 -539
- package/.cache/typescript/5.6/node_modules/@types/request/LICENSE +0 -21
- package/.cache/typescript/5.6/node_modules/@types/request/README.md +0 -15
- package/.cache/typescript/5.6/node_modules/@types/request/index.d.ts +0 -395
- package/.cache/typescript/5.6/node_modules/@types/request/package.json +0 -70
- package/.cache/typescript/5.6/node_modules/@types/tough-cookie/LICENSE +0 -21
- package/.cache/typescript/5.6/node_modules/@types/tough-cookie/README.md +0 -15
- package/.cache/typescript/5.6/node_modules/@types/tough-cookie/index.d.ts +0 -321
- package/.cache/typescript/5.6/node_modules/@types/tough-cookie/package.json +0 -35
- package/.cache/typescript/5.6/node_modules/asynckit/LICENSE +0 -21
- package/.cache/typescript/5.6/node_modules/asynckit/README.md +0 -233
- package/.cache/typescript/5.6/node_modules/asynckit/bench.js +0 -76
- package/.cache/typescript/5.6/node_modules/asynckit/index.js +0 -6
- package/.cache/typescript/5.6/node_modules/asynckit/lib/abort.js +0 -29
- package/.cache/typescript/5.6/node_modules/asynckit/lib/async.js +0 -34
- package/.cache/typescript/5.6/node_modules/asynckit/lib/defer.js +0 -26
- package/.cache/typescript/5.6/node_modules/asynckit/lib/iterate.js +0 -75
- package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_asynckit.js +0 -91
- package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_parallel.js +0 -25
- package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_serial.js +0 -25
- package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_serial_ordered.js +0 -29
- package/.cache/typescript/5.6/node_modules/asynckit/lib/state.js +0 -37
- package/.cache/typescript/5.6/node_modules/asynckit/lib/streamify.js +0 -141
- package/.cache/typescript/5.6/node_modules/asynckit/lib/terminator.js +0 -29
- package/.cache/typescript/5.6/node_modules/asynckit/package.json +0 -63
- package/.cache/typescript/5.6/node_modules/asynckit/parallel.js +0 -43
- package/.cache/typescript/5.6/node_modules/asynckit/serial.js +0 -17
- package/.cache/typescript/5.6/node_modules/asynckit/serialOrdered.js +0 -75
- package/.cache/typescript/5.6/node_modules/asynckit/stream.js +0 -21
- package/.cache/typescript/5.6/node_modules/combined-stream/License +0 -19
- package/.cache/typescript/5.6/node_modules/combined-stream/Readme.md +0 -138
- package/.cache/typescript/5.6/node_modules/combined-stream/lib/combined_stream.js +0 -208
- package/.cache/typescript/5.6/node_modules/combined-stream/package.json +0 -25
- package/.cache/typescript/5.6/node_modules/combined-stream/yarn.lock +0 -17
- package/.cache/typescript/5.6/node_modules/delayed-stream/License +0 -19
- package/.cache/typescript/5.6/node_modules/delayed-stream/Makefile +0 -7
- package/.cache/typescript/5.6/node_modules/delayed-stream/Readme.md +0 -141
- package/.cache/typescript/5.6/node_modules/delayed-stream/lib/delayed_stream.js +0 -107
- package/.cache/typescript/5.6/node_modules/delayed-stream/package.json +0 -27
- package/.cache/typescript/5.6/node_modules/form-data/License +0 -19
- package/.cache/typescript/5.6/node_modules/form-data/Readme.md +0 -350
- package/.cache/typescript/5.6/node_modules/form-data/index.d.ts +0 -51
- package/.cache/typescript/5.6/node_modules/form-data/lib/browser.js +0 -2
- package/.cache/typescript/5.6/node_modules/form-data/lib/form_data.js +0 -484
- package/.cache/typescript/5.6/node_modules/form-data/lib/populate.js +0 -10
- package/.cache/typescript/5.6/node_modules/form-data/package.json +0 -72
- package/.cache/typescript/5.6/node_modules/mime-db/HISTORY.md +0 -507
- package/.cache/typescript/5.6/node_modules/mime-db/LICENSE +0 -23
- package/.cache/typescript/5.6/node_modules/mime-db/README.md +0 -100
- package/.cache/typescript/5.6/node_modules/mime-db/db.json +0 -8519
- package/.cache/typescript/5.6/node_modules/mime-db/index.js +0 -12
- package/.cache/typescript/5.6/node_modules/mime-db/package.json +0 -60
- package/.cache/typescript/5.6/node_modules/mime-types/HISTORY.md +0 -397
- package/.cache/typescript/5.6/node_modules/mime-types/LICENSE +0 -23
- package/.cache/typescript/5.6/node_modules/mime-types/README.md +0 -113
- package/.cache/typescript/5.6/node_modules/mime-types/index.js +0 -188
- package/.cache/typescript/5.6/node_modules/mime-types/package.json +0 -44
- package/.cache/typescript/5.6/node_modules/safe-buffer/LICENSE +0 -21
- package/.cache/typescript/5.6/node_modules/safe-buffer/README.md +0 -584
- package/.cache/typescript/5.6/node_modules/safe-buffer/index.d.ts +0 -187
- package/.cache/typescript/5.6/node_modules/safe-buffer/index.js +0 -65
- package/.cache/typescript/5.6/node_modules/safe-buffer/package.json +0 -51
- package/.cache/typescript/5.6/node_modules/types-registry/README.md +0 -2
- package/.cache/typescript/5.6/node_modules/types-registry/index.json +0 -1
- package/.cache/typescript/5.6/node_modules/types-registry/package.json +0 -20
- package/.cache/typescript/5.6/node_modules/undici-types/LICENSE +0 -21
- package/.cache/typescript/5.6/node_modules/undici-types/README.md +0 -6
- package/.cache/typescript/5.6/node_modules/undici-types/agent.d.ts +0 -31
- package/.cache/typescript/5.6/node_modules/undici-types/api.d.ts +0 -43
- package/.cache/typescript/5.6/node_modules/undici-types/balanced-pool.d.ts +0 -29
- package/.cache/typescript/5.6/node_modules/undici-types/cache.d.ts +0 -36
- package/.cache/typescript/5.6/node_modules/undici-types/client.d.ts +0 -108
- package/.cache/typescript/5.6/node_modules/undici-types/connector.d.ts +0 -34
- package/.cache/typescript/5.6/node_modules/undici-types/content-type.d.ts +0 -21
- package/.cache/typescript/5.6/node_modules/undici-types/cookies.d.ts +0 -28
- package/.cache/typescript/5.6/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
- package/.cache/typescript/5.6/node_modules/undici-types/dispatcher.d.ts +0 -255
- package/.cache/typescript/5.6/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
- package/.cache/typescript/5.6/node_modules/undici-types/errors.d.ts +0 -149
- package/.cache/typescript/5.6/node_modules/undici-types/eventsource.d.ts +0 -61
- package/.cache/typescript/5.6/node_modules/undici-types/fetch.d.ts +0 -209
- package/.cache/typescript/5.6/node_modules/undici-types/file.d.ts +0 -39
- package/.cache/typescript/5.6/node_modules/undici-types/filereader.d.ts +0 -54
- package/.cache/typescript/5.6/node_modules/undici-types/formdata.d.ts +0 -108
- package/.cache/typescript/5.6/node_modules/undici-types/global-dispatcher.d.ts +0 -9
- package/.cache/typescript/5.6/node_modules/undici-types/global-origin.d.ts +0 -7
- package/.cache/typescript/5.6/node_modules/undici-types/handlers.d.ts +0 -15
- package/.cache/typescript/5.6/node_modules/undici-types/header.d.ts +0 -4
- package/.cache/typescript/5.6/node_modules/undici-types/index.d.ts +0 -71
- package/.cache/typescript/5.6/node_modules/undici-types/interceptors.d.ts +0 -17
- package/.cache/typescript/5.6/node_modules/undici-types/mock-agent.d.ts +0 -50
- package/.cache/typescript/5.6/node_modules/undici-types/mock-client.d.ts +0 -25
- package/.cache/typescript/5.6/node_modules/undici-types/mock-errors.d.ts +0 -12
- package/.cache/typescript/5.6/node_modules/undici-types/mock-interceptor.d.ts +0 -93
- package/.cache/typescript/5.6/node_modules/undici-types/mock-pool.d.ts +0 -25
- package/.cache/typescript/5.6/node_modules/undici-types/package.json +0 -55
- package/.cache/typescript/5.6/node_modules/undici-types/patch.d.ts +0 -33
- package/.cache/typescript/5.6/node_modules/undici-types/pool-stats.d.ts +0 -19
- package/.cache/typescript/5.6/node_modules/undici-types/pool.d.ts +0 -39
- package/.cache/typescript/5.6/node_modules/undici-types/proxy-agent.d.ts +0 -28
- package/.cache/typescript/5.6/node_modules/undici-types/readable.d.ts +0 -60
- package/.cache/typescript/5.6/node_modules/undici-types/retry-agent.d.ts +0 -8
- package/.cache/typescript/5.6/node_modules/undici-types/retry-handler.d.ts +0 -116
- package/.cache/typescript/5.6/node_modules/undici-types/util.d.ts +0 -18
- package/.cache/typescript/5.6/node_modules/undici-types/webidl.d.ts +0 -222
- package/.cache/typescript/5.6/node_modules/undici-types/websocket.d.ts +0 -150
- package/.cache/typescript/5.6/package-lock.json +0 -183
- package/.cache/typescript/5.6/package.json +0 -1
package/src/changeGroupImage.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
const utils = require("../utils");
|
4
|
-
|
4
|
+
const log = require("npmlog");
|
5
5
|
|
6
6
|
module.exports = function (defaultFuncs, api, ctx) {
|
7
7
|
function handleUpload(image, callback) {
|
@@ -36,7 +36,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
36
36
|
callback(null, resData);
|
37
37
|
})
|
38
38
|
.catch(function (err) {
|
39
|
-
|
39
|
+
log.error("handleUpload", err);
|
40
40
|
return callback(err);
|
41
41
|
});
|
42
42
|
}
|
@@ -74,7 +74,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
74
74
|
const form = {
|
75
75
|
client: "mercury",
|
76
76
|
action_type: "ma-type:log-message",
|
77
|
-
author: "fbid:" + (ctx.userID),
|
77
|
+
author: "fbid:" + (ctx.i_userID || ctx.userID),
|
78
78
|
author_email: "",
|
79
79
|
ephemeral_ttl_mode: "0",
|
80
80
|
is_filtered_content: false,
|
@@ -125,7 +125,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
125
125
|
return callback();
|
126
126
|
})
|
127
127
|
.catch(function (err) {
|
128
|
-
|
128
|
+
log.error("changeGroupImage", err);
|
129
129
|
return callback(err);
|
130
130
|
});
|
131
131
|
});
|
package/src/changeName.js
CHANGED
@@ -27,7 +27,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
27
27
|
|
28
28
|
var { first_name, middle_name, last_name } = input;
|
29
29
|
if (!first_name || !last_name) {
|
30
|
-
|
30
|
+
log.error('changeName', 'name is not be accepted');
|
31
31
|
return cb('name is not be accepted');
|
32
32
|
}
|
33
33
|
|
@@ -70,7 +70,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
70
70
|
return cb();
|
71
71
|
})
|
72
72
|
.catch(function (err) {
|
73
|
-
|
73
|
+
log.error('changeName', err);
|
74
74
|
return cb(err);
|
75
75
|
});
|
76
76
|
|
package/src/changeNickname.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
const utils = require("../utils");
|
4
|
-
|
4
|
+
const log = require("npmlog");
|
5
5
|
|
6
6
|
module.exports = function (defaultFuncs, api, ctx) {
|
7
7
|
return function changeNickname(nickname, threadID, participantID, callback) {
|
@@ -50,7 +50,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
50
50
|
return callback();
|
51
51
|
})
|
52
52
|
.catch(function (err) {
|
53
|
-
|
53
|
+
log.error("changeNickname", err);
|
54
54
|
return callback(err);
|
55
55
|
});
|
56
56
|
|
package/src/changeThreadColor.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
const utils = require("../utils");
|
4
|
-
|
4
|
+
const log = require("npmlog");
|
5
5
|
|
6
6
|
module.exports = function (defaultFuncs, api, ctx) {
|
7
7
|
return function changeThreadColor(color, threadID, callback) {
|
@@ -34,7 +34,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
34
34
|
doc_id: "1727493033983591",
|
35
35
|
query_params: {
|
36
36
|
data: {
|
37
|
-
actor_id: ctx.userID,
|
37
|
+
actor_id: ctx.i_userID || ctx.userID,
|
38
38
|
client_mutation_id: "0",
|
39
39
|
source: "SETTINGS",
|
40
40
|
theme_id: validatedColor,
|
@@ -56,7 +56,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
56
56
|
return callback();
|
57
57
|
})
|
58
58
|
.catch(function (err) {
|
59
|
-
|
59
|
+
log.error("changeThreadColor", err);
|
60
60
|
return callback(err);
|
61
61
|
});
|
62
62
|
|
package/src/changeThreadEmoji.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
const utils = require("../utils");
|
4
|
-
|
4
|
+
const log = require("npmlog");
|
5
5
|
|
6
6
|
module.exports = function (defaultFuncs, api, ctx) {
|
7
7
|
return function changeThreadEmoji(emoji, threadID, callback) {
|
@@ -46,7 +46,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
46
46
|
return callback();
|
47
47
|
})
|
48
48
|
.catch(function (err) {
|
49
|
-
|
49
|
+
log.error("changeThreadEmoji", err);
|
50
50
|
return callback(err);
|
51
51
|
});
|
52
52
|
|
package/src/changeUsername.js
CHANGED
@@ -12,13 +12,13 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
12
12
|
|
13
13
|
if (typeof username == 'function') {
|
14
14
|
var error = 'username must be a string, and not ' + utils.getType(username);
|
15
|
-
|
15
|
+
log.error('changeUsername', error);
|
16
16
|
return username(error);
|
17
17
|
}
|
18
18
|
if (typeof callback == 'function') cb = callback;
|
19
19
|
if (typeof username != 'string') {
|
20
20
|
var error = 'username must be a string, and not ' + utils.getType(username);
|
21
|
-
|
21
|
+
log.error('changeUsername', error);
|
22
22
|
return cb(error);
|
23
23
|
}
|
24
24
|
|
@@ -50,7 +50,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
50
50
|
return cb();
|
51
51
|
})
|
52
52
|
.catch(function (err) {
|
53
|
-
|
53
|
+
log.error('changeUsername', err);
|
54
54
|
return cb(err);
|
55
55
|
});
|
56
56
|
|
package/src/createCommentPost.js
CHANGED
@@ -135,12 +135,12 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
135
135
|
|
136
136
|
if (typeof msg == 'function') {
|
137
137
|
var error = 'Message must be a string or object!!';
|
138
|
-
|
138
|
+
log.error('createCommentPost', error);
|
139
139
|
return msg(error);
|
140
140
|
}
|
141
141
|
if (typeof postID == 'function') {
|
142
142
|
var error = 'postID must be a string!!';
|
143
|
-
|
143
|
+
log.error('createCommentPost', error);
|
144
144
|
return postID(error);
|
145
145
|
}
|
146
146
|
if (typeof callback == 'string') {
|
@@ -167,12 +167,12 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
167
167
|
msg.body ? typeof msg.body == 'object' ? msg.body = JSON.stringify(msg.body) : null : msg.body = '';
|
168
168
|
} else {
|
169
169
|
var error = 'Message must be a string or object!!';
|
170
|
-
|
170
|
+
log.error('createCommentPost', error);
|
171
171
|
return cb(error);
|
172
172
|
}
|
173
173
|
if (typeof postID != 'string') {
|
174
174
|
var error = 'postID must be a string!!';
|
175
|
-
|
175
|
+
log.error('createCommentPost', error);
|
176
176
|
return cb(error);
|
177
177
|
}
|
178
178
|
|
@@ -221,7 +221,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
221
221
|
.then(_ => createContent(form))
|
222
222
|
.then(info => cb(null, info))
|
223
223
|
.catch(function (err) {
|
224
|
-
|
224
|
+
log.error('createCommentPost', err);
|
225
225
|
return cb(null, err);
|
226
226
|
})
|
227
227
|
|
package/src/createNewGroup.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
const utils = require("../utils");
|
4
|
-
|
4
|
+
const log = require("npmlog");
|
5
5
|
|
6
6
|
module.exports = function (defaultFuncs, api, ctx) {
|
7
7
|
return function createNewGroup(participantIDs, groupTitle, callback) {
|
@@ -42,18 +42,18 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
42
42
|
fbid: participantIDs[n],
|
43
43
|
});
|
44
44
|
}
|
45
|
-
pids.push({ fbid: ctx.userID });
|
45
|
+
pids.push({ fbid: ctx.i_userID || ctx.userID });
|
46
46
|
|
47
47
|
const form = {
|
48
48
|
fb_api_caller_class: "RelayModern",
|
49
49
|
fb_api_req_friendly_name: "MessengerGroupCreateMutation",
|
50
|
-
av: ctx.userID,
|
50
|
+
av: ctx.i_userID || ctx.userID,
|
51
51
|
//This doc_id is valid as of January 11th, 2020
|
52
52
|
doc_id: "577041672419534",
|
53
53
|
variables: JSON.stringify({
|
54
54
|
input: {
|
55
55
|
entry_point: "jewel_new_group",
|
56
|
-
actor_id: ctx.userID,
|
56
|
+
actor_id: ctx.i_userID || ctx.userID,
|
57
57
|
participants: pids,
|
58
58
|
client_mutation_id: Math.round(Math.random() * 1024).toString(),
|
59
59
|
thread_settings: {
|
@@ -79,7 +79,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
79
79
|
);
|
80
80
|
})
|
81
81
|
.catch(function (err) {
|
82
|
-
|
82
|
+
log.error("createNewGroup", err);
|
83
83
|
return callback(err);
|
84
84
|
});
|
85
85
|
|
package/src/createPoll.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
const utils = require("../utils");
|
4
|
-
|
4
|
+
const log = require("npmlog");
|
5
5
|
|
6
6
|
module.exports = function (defaultFuncs, api, ctx) {
|
7
7
|
return function createPoll(title, threadID, options, callback) {
|
@@ -62,7 +62,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
62
62
|
return callback();
|
63
63
|
})
|
64
64
|
.catch(function (err) {
|
65
|
-
|
65
|
+
log.error("createPoll", err);
|
66
66
|
return callback(err);
|
67
67
|
});
|
68
68
|
|
package/src/createPost.js
CHANGED
@@ -164,7 +164,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
164
164
|
|
165
165
|
if (typeof msg == 'function') {
|
166
166
|
var error = 'Msg must be a string or object and not function';
|
167
|
-
|
167
|
+
log.error('createPost', error);
|
168
168
|
return msg(error);
|
169
169
|
}
|
170
170
|
if (typeof callback == 'function') cb = callback;
|
@@ -172,7 +172,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
172
172
|
var typeMsg = utils.getType(msg);
|
173
173
|
if (!['Object', 'String'].includes(typeMsg)) {
|
174
174
|
var error = 'Msg must be a string or object and not ' + typeMsg;
|
175
|
-
|
175
|
+
log.error('createPost', error);
|
176
176
|
return cb(error);
|
177
177
|
} else if (typeMsg == 'String') msg = { body: msg };
|
178
178
|
msg.allowUserID = msg.allowUserID ? !Array.isArray(msg.allowUserID) ? [msg.allowUserID] : msg.allowUserID : null;
|
@@ -262,12 +262,13 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
262
262
|
.then(_ => handleUrl(msg, form))
|
263
263
|
.then(_ => handleMention(msg, form))
|
264
264
|
.then(_ => createContent(form))
|
265
|
-
.then((res)
|
265
|
+
.then(function (res) {
|
266
266
|
if (res.error || res.errors) throw res;
|
267
|
+
|
267
268
|
return cb(null, (res[0] || res).data.story_create.story.url);
|
268
269
|
})
|
269
|
-
.catch((err)
|
270
|
-
|
270
|
+
.catch(function (err) {
|
271
|
+
log.error('createPost', err);
|
271
272
|
return cb(err);
|
272
273
|
});
|
273
274
|
|
package/src/deleteMessage.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
const utils = require("../utils");
|
4
|
-
|
4
|
+
const log = require("npmlog");
|
5
5
|
|
6
6
|
module.exports = function (defaultFuncs, api, ctx) {
|
7
7
|
return function deleteMessage(messageOrMessages, callback) {
|
@@ -47,7 +47,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
47
47
|
return callback();
|
48
48
|
})
|
49
49
|
.catch(function (err) {
|
50
|
-
|
50
|
+
log.error("deleteMessage", err);
|
51
51
|
return callback(err);
|
52
52
|
});
|
53
53
|
|
package/src/deleteThread.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
const utils = require("../utils");
|
4
|
-
|
4
|
+
const log = require("npmlog");
|
5
5
|
|
6
6
|
module.exports = function (defaultFuncs, api, ctx) {
|
7
7
|
return function deleteThread(threadOrThreads, callback) {
|
@@ -47,7 +47,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
47
47
|
return callback();
|
48
48
|
})
|
49
49
|
.catch(function (err) {
|
50
|
-
|
50
|
+
log.error("deleteThread", err);
|
51
51
|
return callback(err);
|
52
52
|
});
|
53
53
|
|
package/src/editMessage.js
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
"use_strict";
|
2
|
+
/**
|
3
|
+
* @author RFS-ADRENO
|
4
|
+
* @rewrittenBy Isai Ivanov
|
5
|
+
*/
|
6
|
+
const generateOfflineThreadingId = require('../utils');
|
2
7
|
|
3
|
-
|
4
|
-
|
5
|
-
function isCallable(func) {
|
8
|
+
function canBeCalled(func) {
|
6
9
|
try {
|
7
10
|
Reflect.apply(func, null, []);
|
8
11
|
return true;
|
@@ -11,49 +14,58 @@ function isCallable(func) {
|
|
11
14
|
}
|
12
15
|
}
|
13
16
|
|
14
|
-
|
17
|
+
/**
|
18
|
+
* A function for editing bot's messages.
|
19
|
+
* @param {string} text - The text with which the bot will edit its messages.
|
20
|
+
* @param {string} messageID - The message ID of the message the bot will edit.
|
21
|
+
* @param {Object} callback - Callback for the function.
|
22
|
+
*/
|
15
23
|
|
24
|
+
module.exports = function(defaultFuncs, api, ctx) {
|
16
25
|
return function editMessage(text, messageID, callback) {
|
17
|
-
|
18
|
-
|
19
26
|
if (!ctx.mqttClient) {
|
20
27
|
throw new Error('Not connected to MQTT');
|
21
28
|
}
|
29
|
+
|
30
|
+
// modified and fix by kenneth panio the edit now works on secondary profile accounts
|
22
31
|
|
23
32
|
ctx.wsReqNumber ??= 0;
|
24
33
|
ctx.wsTaskNumber ??= 0;
|
34
|
+
|
25
35
|
ctx.wsReqNumber += 1;
|
26
36
|
ctx.wsTaskNumber += 1;
|
27
37
|
|
28
|
-
const
|
38
|
+
const queryPayload = {
|
29
39
|
message_id: messageID,
|
30
40
|
text: text,
|
31
41
|
};
|
32
42
|
|
33
|
-
const
|
43
|
+
const query = {
|
34
44
|
failure_count: null,
|
35
45
|
label: '742',
|
36
|
-
payload: JSON.stringify(
|
46
|
+
payload: JSON.stringify(queryPayload),
|
37
47
|
queue_name: 'edit_message',
|
38
48
|
task_id: ctx.wsTaskNumber,
|
39
49
|
};
|
40
50
|
|
41
|
-
const
|
51
|
+
const context = {
|
42
52
|
app_id: '2220391788200892',
|
43
53
|
payload: {
|
44
54
|
data_trace_id: null,
|
45
|
-
epoch_id: parseInt(
|
46
|
-
tasks: [],
|
55
|
+
epoch_id: parseInt(generateOfflineThreadingId),
|
56
|
+
tasks: [query],
|
47
57
|
version_id: '6903494529735864',
|
48
58
|
},
|
49
59
|
request_id: ctx.wsReqNumber,
|
50
60
|
type: 3,
|
51
61
|
};
|
52
62
|
|
53
|
-
|
54
|
-
content.payload = JSON.stringify(content.payload);
|
63
|
+
context.payload = JSON.stringify(context.payload);
|
55
64
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
65
|
+
if (canBeCalled(callback)) {
|
66
|
+
ctx.reqCallbacks[ctx.wsReqNumber] = callback;
|
67
|
+
}
|
68
|
+
|
69
|
+
ctx.mqttClient.publish('/ls_req', JSON.stringify(context), { qos: 1, retain: false });
|
70
|
+
}
|
71
|
+
}
|
package/src/follow.js
CHANGED
@@ -7,18 +7,18 @@
|
|
7
7
|
* Example:
|
8
8
|
* api.follow("100090794779367", true); // Set true to follow, false if otherwise.
|
9
9
|
*/
|
10
|
-
|
11
|
-
//Fixed by Neth
|
12
10
|
|
13
11
|
module.exports = function (defaultFuncs, api, ctx) {
|
14
12
|
return function follow(senderID, boolean, callback) {
|
15
|
-
|
13
|
+
if (!ctx.mqttClient) {
|
16
14
|
throw new Error("Not connected to MQTT");
|
17
|
-
}
|
15
|
+
}
|
16
|
+
|
18
17
|
let form;
|
18
|
+
|
19
19
|
if (boolean) {
|
20
20
|
form = {
|
21
|
-
av: ctx.userID,
|
21
|
+
av: ctx.userID || ctx.i_userID,
|
22
22
|
fb_api_req_friendly_name: "CometUserFollowMutation",
|
23
23
|
fb_api_caller_class: "RelayModern",
|
24
24
|
doc_id: "25472099855769847",
|
@@ -30,7 +30,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
30
30
|
subscribe_location: "PROFILE",
|
31
31
|
subscribee_id: senderID,
|
32
32
|
tracking: null,
|
33
|
-
actor_id: ctx.userID,
|
33
|
+
actor_id: ctx.userID || ctx.i_userID,
|
34
34
|
client_mutation_id: "1",
|
35
35
|
},
|
36
36
|
scale: 1,
|
@@ -38,7 +38,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
38
38
|
};
|
39
39
|
} else {
|
40
40
|
form = {
|
41
|
-
av: ctx.userID,
|
41
|
+
av: ctx.userID || ctx.i_userID,
|
42
42
|
fb_api_req_friendly_name: "CometUserUnfollowMutation",
|
43
43
|
fb_api_caller_class: "RelayModern",
|
44
44
|
doc_id: "25472099855769847",
|
@@ -51,7 +51,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
51
51
|
subscribe_location: "PROFILE",
|
52
52
|
tracking: null,
|
53
53
|
unsubscribee_id: senderID,
|
54
|
-
actor_id: ctx.userID,
|
54
|
+
actor_id: ctx.userID || ctx.i_userID,
|
55
55
|
client_mutation_id: "10",
|
56
56
|
},
|
57
57
|
scale: 1,
|
package/src/forwardAttachment.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
const utils = require("../utils");
|
4
|
-
|
4
|
+
const log = require("npmlog");
|
5
5
|
|
6
6
|
module.exports = function (defaultFuncs, api, ctx) {
|
7
7
|
return function forwardAttachment(attachmentID, userOrUsers, callback) {
|
@@ -51,7 +51,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
51
51
|
return callback();
|
52
52
|
})
|
53
53
|
.catch(function (err) {
|
54
|
-
|
54
|
+
log.error("forwardAttachment", err);
|
55
55
|
return callback(err);
|
56
56
|
});
|
57
57
|
|
package/src/getAccess.js
CHANGED
@@ -83,7 +83,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
83
83
|
return pCb(null, res[1][1]);
|
84
84
|
})
|
85
85
|
.catch(function (err) {
|
86
|
-
|
86
|
+
log.error('getAccess', err.error || err);
|
87
87
|
return pCb(err);
|
88
88
|
});
|
89
89
|
|
@@ -103,7 +103,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
103
103
|
}
|
104
104
|
})
|
105
105
|
.catch(function (err) {
|
106
|
-
|
106
|
+
log.error('getAccess', typeof callback == 'function' ? (err.error || err) : err);
|
107
107
|
return cb(err);
|
108
108
|
});
|
109
109
|
|
package/src/getAvatarUser.js
CHANGED
@@ -60,7 +60,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
60
60
|
if (!Array.isArray(userIDs)) userIDs = [userIDs];
|
61
61
|
var [height, width] = size;
|
62
62
|
if (!ctx.access_token) {
|
63
|
-
|
63
|
+
log.error('getAvatarUser', 'Cant get access_token');
|
64
64
|
return cb('Cant get access_token');
|
65
65
|
};
|
66
66
|
|
@@ -69,7 +69,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
69
69
|
return cb(null, res);
|
70
70
|
})
|
71
71
|
.catch(function (err) {
|
72
|
-
|
72
|
+
log.error('getAvatarUser', err);
|
73
73
|
return cb(err);
|
74
74
|
});
|
75
75
|
|
package/src/getCurrentUserID.js
CHANGED
package/src/getFriendsList.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
const utils = require("../utils");
|
4
|
-
|
4
|
+
const log = require("npmlog");
|
5
5
|
|
6
6
|
// [almost] copy pasted from one of FB's minified file (GenderConst)
|
7
7
|
const GENDERS = {
|
@@ -61,7 +61,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
61
61
|
"https://www.facebook.com/chat/user_info_all",
|
62
62
|
ctx.jar,
|
63
63
|
{},
|
64
|
-
{ viewer: ctx.userID },
|
64
|
+
{ viewer: ctx.i_userID || ctx.userID },
|
65
65
|
)
|
66
66
|
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
67
67
|
.then(function (resData) {
|
@@ -74,7 +74,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
74
74
|
callback(null, formatData(resData.payload));
|
75
75
|
})
|
76
76
|
.catch(function (err) {
|
77
|
-
|
77
|
+
log.error("getFriendsList", err);
|
78
78
|
return callback(err);
|
79
79
|
});
|
80
80
|
|
package/src/getMessage.js
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
const utils = require("../utils");
|
9
|
-
|
9
|
+
const log = require("npmlog");
|
10
10
|
|
11
11
|
function formatMessage(threadID, data) {
|
12
12
|
switch (data.__typename) {
|
@@ -294,7 +294,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
294
294
|
}
|
295
295
|
})
|
296
296
|
.catch((err) => {
|
297
|
-
|
297
|
+
log.error("getMessage", err);
|
298
298
|
callback(err);
|
299
299
|
});
|
300
300
|
|
package/src/getThreadHistory.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
const utils = require("../utils");
|
4
|
-
|
4
|
+
const log = require("npmlog");
|
5
5
|
|
6
6
|
function getExtension(original_extension, filename = "") {
|
7
7
|
if (original_extension) {
|
@@ -671,7 +671,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
671
671
|
callback(null, formatMessagesGraphQLResponse(resData[0]));
|
672
672
|
})
|
673
673
|
.catch(function (err) {
|
674
|
-
|
674
|
+
log.error("getThreadHistoryGraphQL", err);
|
675
675
|
return callback(err);
|
676
676
|
});
|
677
677
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var utils = require("../utils");
|
4
|
-
|
4
|
+
var log = require("npmlog");
|
5
5
|
|
6
6
|
module.exports = function(defaultFuncs, api, ctx) {
|
7
7
|
return function getThreadHistory(threadID, amount, timestamp, callback) {
|
@@ -84,7 +84,7 @@ module.exports = function(defaultFuncs, api, ctx) {
|
|
84
84
|
});
|
85
85
|
})
|
86
86
|
.catch(function(err) {
|
87
|
-
|
87
|
+
log.error("getThreadHistory", err);
|
88
88
|
return callback(err);
|
89
89
|
});
|
90
90
|
});
|
package/src/getThreadInfo.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var utils = require("../utils");
|
4
|
-
|
4
|
+
var log = require("npmlog");
|
5
5
|
|
6
6
|
module.exports = function(defaultFuncs, api, ctx) {
|
7
7
|
return function getThreadInfo(threadID, callback) {
|
@@ -71,7 +71,7 @@ module.exports = function(defaultFuncs, api, ctx) {
|
|
71
71
|
callback(null, utils.formatThread(threadData));
|
72
72
|
})
|
73
73
|
.catch(function(err) {
|
74
|
-
|
74
|
+
log.error("getThreadInfo", err);
|
75
75
|
return callback(err);
|
76
76
|
});
|
77
77
|
});
|
package/src/getThreadList.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
const utils = require("../utils");
|
4
|
-
|
4
|
+
const log = require("npmlog");
|
5
5
|
|
6
6
|
function formatEventReminders(reminder) {
|
7
7
|
return {
|
@@ -213,7 +213,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
213
213
|
}
|
214
214
|
|
215
215
|
const form = {
|
216
|
-
av: ctx.userID,
|
216
|
+
av: ctx.i_userID || ctx.userID,
|
217
217
|
queries: JSON.stringify({
|
218
218
|
o0: {
|
219
219
|
// This doc_id was valid on 2020-07-20
|
@@ -261,7 +261,7 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
261
261
|
);
|
262
262
|
})
|
263
263
|
.catch((err) => {
|
264
|
-
|
264
|
+
log.error("getThreadList", err);
|
265
265
|
return callback(err);
|
266
266
|
});
|
267
267
|
|