hoehermann / purple-gowhatsapp

Pidgin/libpurple plugin for WhatsApp Web.
GNU General Public License v3.0
277 stars 34 forks source link

See history of a chat #129

Open nabakolu opened 1 year ago

nabakolu commented 1 year ago

Is there a way to see a history of any messages, that were sent/received, when pidgin/purple-gowhatsapp was not running.

hoehermann commented 1 year ago

When Pidgin was not running, delayed messages should be delivered as soon as it connects. However, this may only be true for messages which have not already been read on the main device.

Update/Note: https://github.com/tulir/whatsmeow/issues/74 hints that one can request messages up to one year old.

reidsneo commented 1 year ago

Is there a way to see a history of any messages, that were sent/received, when pidgin/purple-gowhatsapp was not running.

in pidgin I use Tool > Plugins > check for History Plugin, the message is now logged either sending or receiving the message, previously if this not checked, everytime I close pidgin chat window, the message will be cleared

samtrek commented 1 year ago

Is there a way to see a history of any messages, that were sent/received, when pidgin/purple-gowhatsapp was not running.

in pidgin I use Tool > Plugins > check for History Plugin, the message is now logged either sending or receiving the message, previously if this not checked, everytime I close pidgin chat window, the message will be cleared

I use the same option, totally agree with. Still confused how the whatsapp plugin handle the call back history. Since when I have activated, yet to see any difference in the old version and the version with the call back history.

hoehermann commented 1 year ago

Currently, old messages are only fetched once – right after scanning the QR code. I want to make this more clear in the readme. There is no option to request another download of the history, yet.

Also, the plug-in only displays what WhatsApp servers send by default. I did not see any way to request the (complete) history of a specific conversation. Update: This is supported as of https://github.com/tulir/whatsmeow/commit/75b709cf81f8b170b137f0af11874adc3f6105de.

samtrek commented 1 year ago

Implementing history like whatsapp web may not be possible on Pidgin for now because, call back command like will be needed \historyand this call back mechanism will have to take note of the previous history if it has been used, if not it can call from the server the last 20 messages for example and place it before the last sent message (may be challenging) further calling on this command will also do the same but will always have to place the messages before the previous recalled history. This might make things very messy after several use of the said command. And this may also cause some sort of problem like conservation history plugin because it will likely keep multiple conversation history.

RobinBoers commented 6 months ago

Are there any plans to support something (like a command or option) to retrieve message history between the last sent message and now? (could also just be requesting the last x days and then diffing and showing the diff)

hoehermann commented 6 months ago

Hi @RobinBoers. Thank you for the suggestion.

The good news: Requesting the history of a specific conversation has recently been added to whatsmeow.

It comes with a problem, though: The request does not take days, but a number of messages. This happens relative to an existing message – which you need to know the ID of. Unfortunately, purple is not designed to handle anything but text, so message IDs are lost. I already put the IDs into a cache for displaying reactions in context. Based on this, I could probably add a command or action "request the n messages preceding the oldest currently known message". The message ID cache is rather small right now. I would need to come up with a reasonable default which works for requesting history, but also will not exhaust memory on a multi-user message bridge (bitlbee or spectrum).

Also, the cache ist not persisted. I do not want to persist the cache. It is awkward to handle in purple. That means, behaviour will be wonky when used across reconnects.

For these reasons, I am hesitant about implementing this feature. Contributions are welcome.

Side note: I do plan to add replies, which uses the cache, too. Maybe I'll add the conversation history then.

hoehermann commented 2 months ago

Setback: Due to changes in the WhatsApp protocol buffers in whatsmeow, fetching the history in this plug-in is no longer available at all. For details, see b8c8e2e.