The “Delete messages from device” option was inadvertently activated on my end device. As a result, some messages were deleted locally. However, they are still available on the server.
Is there a way to restore them locally?
The “Delete messages from device” option was inadvertently activated on my end device. As a result, some messages were deleted locally. However, they are still available on the server.
Is there a way to restore them locally?
You can move the messages to another folder on the server and then move them back into INBOX, they should be redownloaded.
Here is a thread that documents workaround with moving the messages between folders:
There is also a related feature request:
The reason there is no such function is that the result of downloading old messages is not very nice: Delta Chat generally places downloaded messages below the last read messages so you cannot miss them and everywhere we assume that messages are processed in the chronological order as they are received, e.g. when we receive “Member added”, “Member removed”, group avatar changes and so on.
If we want to do it properly, we should find the lowest message UID that we know and download batches of messages with this UID-100 to this UID, process them ignoring any group member changes and key changes and place them where they are expected to be according to the Date
header. This is a different way of processing the messages if we want to make it a nice user function rather than a workaround for an emergency situation.
As we don’t know which message belongs to which chat, we also cannot download only messages belonging to the chat when you scroll to the top of it and want to see more history of this particular chat. Best thing we can do is “download N more old messages” and sort them into the chats.
If you have another device which has history still saved such as your desktop, best thing to do is to transfer a backup from your desktop to the phone. Or you can restore your old backup, it will then download new messages in the correct order.
We can easily implement a button “download +100 older messages” that does something similar without even moving the messages back and forth between the folders. But the result is not always nice because these old messages will be added to the end of the chat and so on, this is why we can only recommend this to users as an emergency workaround. If we implement it as a messenger function, we have to implement it properly, placing the messages where they should be, ignoring group avatar, member list and key changes and so on.