venomous0x / WhatsAPI

Interface to WhatsApp Messenger
2.59k stars 2.13k forks source link

I do not want to read the messages when sending a message or media #861

Open recoverjp opened 10 years ago

recoverjp commented 10 years ago

When I send a text message or media, it automatically reads the messages that were sent to the number. How do I do this it does not read the messages?

Amirjan commented 10 years ago

I think dont use pollMessages() when send a message!

recoverjp commented 10 years ago

Amirjan, did not work. When it connects, it reads the messages.

mgp25 commented 10 years ago

the login function contains pollmessages so it works correctly whatsapp.

mgp25 commented 10 years ago

Make pollMessages function to:

$autoReceipt = false

Also in processInboundDataNode

recoverjp commented 10 years ago

It worked, but now when I step on pollMessages(true) function, it does not read.

mgp25 commented 10 years ago

Fixed. Just change this:

Line 1784

    protected function processInboundData($data, $autoReceipt)

Line 1888

protected function processInboundDataNode(ProtocolNode $node, $autoReceipt) 

And you set if you want the autoreceipt here: Line 496

    public function pollMessage($autoReceipt = true)

Line 481

 public function pollMessages($autoReceipt = true)

If it works, tell me and ill make a pull request

recoverjp commented 10 years ago

It did not work. If I pass true as parameter ($w->pollMessages(true)), it is not marking as read (two ticks, just one).

mgp25 commented 10 years ago

But..., did you change both processInboundDataNode and processInboundData?

If not is not working, ill check it tonight and make a fix ;)

recoverjp commented 10 years ago

Yes, I made all the changes you suggested. If you get a result at night, let me know.

fm4tt0s commented 9 years ago

hello guys, any luck on this? I am also looking for a way to not pull messages every time I send one out.

mgp25 commented 9 years ago

@felipemattos check WhatsAPI Official, this repo is inactive: https://github.com/mgp25/WhatsAPI-Official

fm4tt0s commented 9 years ago

@mgp25 thank you. I am actually using this code, will migrate to WhatsAPI-Official then.