Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing group name and participants #257

Open
Rahmican opened this issue Aug 22, 2024 · 4 comments
Open

Parsing group name and participants #257

Rahmican opened this issue Aug 22, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@Rahmican
Copy link

Rahmican commented Aug 22, 2024

Hi,

We want to use this library but we also need the following information.

{
+   groupName: 'blablabla',
+   participants: [ 'Rahmican','Mehmet','Loris'],
    date: 2019-06-20T13:44:58.000Z,
    author: 'Loris',
    message: 'I hope you like whatsapp-chat-parser'
}

Could you make the relevant changes? :)
Regards,
Rahmican.

@Pustur Pustur added the enhancement New feature or request label Aug 23, 2024
@Pustur Pustur self-assigned this Aug 23, 2024
@Pustur
Copy link
Owner

Pustur commented Aug 23, 2024

Hi @Rahmican,

For the participants you could already get that information by doing the following:

const messages = wcp.parseString(chatLog);
const participants = new Set(messages.map(m => m.author));

console.log(participants); // Set(5) { 'Person1', 'Person2', 'Person3', 'Person4', 'Person5'}

For the group name, seems like we can extract it from the first message, but I have to do some testing


If i decide to add these properties however, it would make sense to change the returned structure like this:

{
  groupName: 'My Group Name',
  participants: [
    'Person1',
    'Person2',
  ],
  messages: [
    {
      date: 2024-08-14T19:00:10.000Z,
      author: null,
      message: '‎Messages and calls are end-to-end encrypted. No one outside of this chat, not even WhatsApp, can read or listen to them.'
    },
    {
      date: 2024-08-14T19:00:10.000Z,
      author: 'Person1',
      message: '‎Hi all bla bla bla'
    }
    // ...
  ]
}

@Rahmican
Copy link
Author

Hi @Pustur ,

Thank you for your quick response and support.

@Rahmican
Copy link
Author

Rahmican commented Sep 3, 2024

Hi Loris, what's your decide on this? :)

@Pustur
Copy link
Owner

Pustur commented Sep 3, 2024

@Rahmican This issue is blocked by #258, once that is resolved I can go ahead an release a new major version that changes the output as shown above.

The problem is that I am currently very busy with my job and other stuff, so I don't know when I'll be able to get to these issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants