@vielhuber/wahelper 1.8.1 → 1.8.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vielhuber/wahelper",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "description": "Lightweight whatsapp integration layer.",
5
5
  "main": "wahelper.js",
6
6
  "files": [
@@ -306,6 +306,13 @@ export default class wahelperDaemon {
306
306
  fromMe = messages__value.key?.fromMe ? 1 : 0,
307
307
  timestamp = messages__value.messageTimestamp;
308
308
 
309
+ // status posts and newsletter items are not conversations. they carry
310
+ // their author in remoteJidAlt, so without this they would be stored
311
+ // as a regular one-to-one message from that contact.
312
+ if (chatId === 'status@broadcast' || chatId?.endsWith('@newsletter')) {
313
+ continue;
314
+ }
315
+
309
316
  if (timestamp !== undefined && timestamp !== null) {
310
317
  timestamp = Number(timestamp);
311
318
  if (isNaN(timestamp)) {
@@ -352,9 +359,6 @@ export default class wahelperDaemon {
352
359
  this.log(messages__value);
353
360
  continue;
354
361
  }
355
- if (from === 'status') {
356
- continue;
357
- }
358
362
 
359
363
  let content = null,
360
364
  mediaFilename = null,