Auties00 / Cobalt

Standalone unofficial fully-featured Whatsapp Web and Mobile API for Java and Kotlin
MIT License
634 stars 185 forks source link

Unable to get stuff from the store #295

Closed open-sudo closed 1 year ago

open-sudo commented 1 year ago

I star messages in whatsapp and I am not able to find them in the store. The way I do is this:

whatsapp.store().starredMessages().size()

No matter how many messages I star, this keeps giving me 0. I also tried to get messages that are reacted upon. I received the ReactionMessage but I am not able to find the message that the used is interacted on. Here is my code:

                   MessageKey key=((ReactionMessage)info.message().content()).key();
                    Optional<MessageInfo> message=whatsapp.store().findMessageByKey(key);
                    if(message.isPresent()){
                        System.out.println("Reacted message:"+message.get().toJson());
                    }else{
                        System.out.println("No reacted message:");
                    }

No matter what I do, I get "No reacted message". Please help.

open-sudo commented 1 year ago

It looks like starring a message is a local feature in whatsapp. User A does not normally sees the stars made by user B. So first item is a non-issue.

The issue that is still a challenge to me is how to find the content of the message that reacted upon. The key of that message is accessible like this:

 ReactionMessage reaction=(ReactionMessage)info.message().content();
 MessageKey key=reaction.key();

But not sure how to recover the content of that message as the store keeps returning nothing.

Auties00 commented 1 year ago

It looks like starring a message is a local feature in whatsapp. User A does not normally sees the stars made by user B. So first item is a non-issue.

The issue that is still a challenge to me is how to find the content of the message that reacted upon. The key of that message is accessible like this:

 ReactionMessage reaction=(ReactionMessage)info.message().content();
 MessageKey key=reaction.key();

But not sure how to recover the content of that message as the store keeps returning nothing.

I'll look into it when I'm home

Auties00 commented 1 year ago

Tracking in https://github.com/Auties00/Whatsapp4j/issues/303