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

adapt to new saved-messages api #4596

Open
r10s opened this issue Feb 3, 2025 · 5 comments
Open

adapt to new saved-messages api #4596

r10s opened this issue Feb 3, 2025 · 5 comments
Assignees
Labels
enhancement New feature or request wait-for-core Waiting for an related core issue to be resolved

Comments

@r10s
Copy link
Member

r10s commented Feb 3, 2025

since PR deltachat/deltachat-core-rust#5606 we have a new saved-messages-api, allowing to save messages similar as known from whatsapp or telegram. see that PR for reasonings and discussions.

to benefit from the new saved-messages-api on desktop, the following steps are needed:

  • make dc_save_msgs(), dc_msg_get_original_msg_id() and dc_msg_get_saved_msg_id() available in jsonrpc

  • in self-chat, for incoming messages, show group avatar, sender name and correct left/right side bubbles and colors, see eg. deltachat/deltachat-android@75e9984 for how to change the condition.
    already now, the state is not that bad: messages from others saved eg. on android are shown on desktop on the left side using the correct color already today, only avatar and sender name is missing

  • when forwarding a message to "Saved Messages" that was not already saved use dc_save_msgs()
    edit: updated in discussion: keep forwarding as it is

  • for every message shown in a chat, check if it was saved 1. if so, show a little bookmark icon beside the date (screenshot). as the bookmark should also be shown in saved messages, you will draw it if original_msg_id() OR saved_msg_id() is true.

  • add a button to go to original beside each saved message in the self-chat (screenshot)

to get the idea, it makes sense to use iOS or Android 1.54

as the new core is already shipped, there is not a huge urgency to target this issue, no messages saved on iOS/android will be lost or so. but of course, it is a very nice to have adaption, and comparable simple for UI.

Footnotes

  1. at least for the first iteration, we do not want to show saved info messages and thelike in the "Saved Messages" chat; this turned out to be confusing and might also require adaptions on systems other than android (remember: saved messages are synced), cmp. https://github.com/deltachat/deltachat-ios/issues/2567

@r10s r10s added the enhancement New feature or request label Feb 3, 2025
@r10s
Copy link
Member Author

r10s commented Feb 7, 2025

closing this for a few days until android is done, a few things are still under discussion

@r10s r10s closed this as not planned Won't fix, can't repro, duplicate, stale Feb 7, 2025
@r10s r10s reopened this Feb 11, 2025
@r10s
Copy link
Member Author

r10s commented Feb 11, 2025

reopend and adapted. recent changes:

  • the icons should be a "bookmark icon", screenshot and reasoning
  • saving should be possible also by "Forward to saved" as before, to close this issue, this is sufficient. a shortcut, as eg. a "save" context menu entry or so can come in another PR

@nicodh nicodh self-assigned this Feb 15, 2025
@nicodh nicodh mentioned this issue Feb 18, 2025
5 tasks
@nicodh
Copy link
Member

nicodh commented Feb 18, 2025

Some questions:

  • how should the button to jump to original message be positioned for own messages (on the right side) (Screenshot?)
  • what should happen if the original message is deleted and someone clicks on the jump-to-original button?

@nicodh
Copy link
Member

nicodh commented Feb 18, 2025

In general: it says forward to saved messages should mark the message as "saved message". Isn't that something core should care about? Doesn't make sense to implement that on each client I would say.

I already implemented the "save" in context menu since that is easier than adding the logic into "Forward message", but of course we could do that also.

The possibility to "unsave" is only implemented by deleting for now. There is no core function to remove the saved_msg_id in the original message right now?

@nicodh nicodh added the wait-for-core Waiting for an related core issue to be resolved label Feb 18, 2025
nicodh added a commit to deltachat/deltachat-core-rust that referenced this issue Feb 18, 2025
@r10s
Copy link
Member Author

r10s commented Feb 18, 2025

how should the button to jump to original message be positioned for own messages (on the right side) (Screenshot?)

for android/iOS we positioned the button on the left for outgoing messages:

Image

what should happen if the original message is deleted and someone clicks on the jump-to-original button?

the jump-to-original button should only be shown if the actually is an original message, so if get_original_msg_id() != 0.

if the message is deleted between displaying and tapping, well, that's and error that should be handled the same way as eg. if a quote is tapped; probably this shows an error in a toast or so

In general: it says forward to saved messages should mark the message as "saved message". Isn't that something core should care about? Doesn't make sense to implement that on each client I would say.

it was considered, and in fact the first iteration was like that, but we left this up to the client at the end.

I already implemented the "save" in context menu since that is easier than adding the logic into "Forward message", but of course we could do that also.

yeah, this is probably sufficient, let's see. the "forward to saved" comes mainly from android

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wait-for-core Waiting for an related core issue to be resolved
Projects
None yet
Development

No branches or pull requests

2 participants