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

Some of attributes of chat.list are returning undefined #2491

Closed
bracketsApps007 opened this issue Nov 14, 2024 · 15 comments
Closed

Some of attributes of chat.list are returning undefined #2491

bracketsApps007 opened this issue Nov 14, 2024 · 15 comments

Comments

@bracketsApps007
Copy link

WA-JS Version

3.14.2-alpha.0

WhatsApp Version

2.3000.1018197845

Browser Version

Chrome 130

Operation System

Window 11

Steps to reproduce

let a  = WPP.whatsapp.ChatStore._models;
undefined
a[0].kind
undefined
a[0].isUser
undefined
a[0].isPSA
undefined
a[0].isParentGroup
undefined
a[0].shouldAppearInList
undefined
a[0].previewMessage
undefined
a[0].showChangeNumberNotification
undefined
a[0].shouldShowUnreadInTitle
undefined

image

What is expected?

return proper output

What is actually happening?

undefined

Any additional comments?

No response

@kakaPup
Copy link

kakaPup commented Nov 14, 2024

I have the same problem, please help.

@matias-carpintini
Copy link

@bracketsApps007 have you found something?

@dllsystem
Copy link

same problem here

@matias-carpintini
Copy link

@icleitoncosta i still can't filter chats with that patch. any ideas?

@icleitoncosta
Copy link
Contributor

@icleitoncosta i still can't filter chats with that patch. any ideas?
What is the function you are calling?

@matias-carpintini
Copy link

@icleitoncosta i'm trying this:

window.Store.Chat._models.forEach(function (chatModel) {
      Object.defineProperty(chatModel, "shouldAppearInList", {
        get: function () {
          return chats.includes(chatModel.id._serialized);
        },
        configurable: true,
      });
    });
    window.Store.Chat._models[0].t = window.Store.Chat._models[0].t + 1;

@icleitoncosta
Copy link
Contributor

I've just released the corrected version; please test it out

@sagardewan
Copy link

Filtering chats is still not working with the patch for me. @icleitoncosta

@bracketsApps007
Copy link
Author

To filter only unread messages WPP.whatsapp.Cmd.setActiveFilter('unread')
to filter only groups WPP.whatsapp.Cmd.setActiveFilter('group')
Show all WPP.whatsapp.Cmd.setActiveFilter('')

only working this pre defined lists.. No any way to filter custom chats

@Khushal-Batham
Copy link

@bracketsApps007 @icleitoncosta ,

I want to create a custome filters like "friends", "office colleagues", "leads", etc. How can i create one?
Is there any method in WPP from which I can create a custome filters?

@marcelo386
Copy link
Contributor

image

WPP.chat.list({onlyUsers:true, onlyWithUnreadMessage: true});

onlyWithUnreadMessage not working

@erSurajMahajan
Copy link

To filter only unread messages WPP.whatsapp.Cmd.setActiveFilter('unread') to filter only groups WPP.whatsapp.Cmd.setActiveFilter('group') Show all WPP.whatsapp.Cmd.setActiveFilter('')

only working this pre defined lists.. No any way to filter custom chats

filter chats using pre-defined SearchFilters

WPP.whatsapp.Cmd.setActiveFilter('assigned_to_you')
WPP.whatsapp.Cmd.setActiveFilter('broadcast')
WPP.whatsapp.Cmd.setActiveFilter('business')
WPP.whatsapp.Cmd.setActiveFilter('contact')
WPP.whatsapp.Cmd.setActiveFilter('favorites')
WPP.whatsapp.Cmd.setActiveFilter('group')
WPP.whatsapp.Cmd.setActiveFilter('non_contact')
WPP.whatsapp.Cmd.setActiveFilter('personal')
WPP.whatsapp.Cmd.setActiveFilter('unread')

@icleitoncosta
Copy link
Contributor

image

WPP.chat.list({onlyUsers:true, onlyWithUnreadMessage: true});

onlyWithUnreadMessage not working

Fixed by 3d3aff2

@icleitoncosta
Copy link
Contributor

@bracketsApps007 @icleitoncosta ,

I want to create a custome filters like "friends", "office colleagues", "leads", etc. How can i create one? Is there any method in WPP from which I can create a custome filters?

In WAJS, there is no method for such a task. I could try to create something to handle it, maybe by wrapping the function that processes the lists. Today, it’s possible to do this using tags, but only in the business version.

Please open a specific issue for this, and I will try to work on it during the week.

@icleitoncosta
Copy link
Contributor

Filtering chats is still not working with the patch for me. @icleitoncosta

How are you filtering the chats?

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

No branches or pull requests

9 participants