-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
feat: add API to save messages #5606
Conversation
6ca3eb3
to
1440885
Compare
1440885
to
eb4a407
Compare
c4f89bb
to
8585e9c
Compare
8585e9c
to
cbd5394
Compare
166f387
to
93dc46c
Compare
- keep original metadata as far as possible (they are not sent out again) - add api to get original message; this allows the UI to add a corrsponding button - add tests
…let UI update saved indicator)
93dc46c
to
bf72686
Compare
eb147f0
to
33e1a9c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial review, I just commented some very small suggestions on tests
Co-authored-by: Hocuri <hocuri@gmx.de>
Co-authored-by: Hocuri <hocuri@gmx.de>
Co-authored-by: Hocuri <hocuri@gmx.de>
agree with @Hoccuri after thinking it over, the limited cornercase of deleted message but not deleted chat seems not to be worth additional effort and states - and may even worsen UX as it is unclear what happens when tapping the "goto original" button (or one need to use different icons or sth) if we want to do sth. about that, it might be better to go the way we went for quotes: so, eg. keep a copy of the chatname. but let's see if this is really needed and an issue at scale.
thanks a lot for the great, detailed review, @Hocuri ❤️ - i tried to target all comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Co-authored-by: Hocuri <hocuri@gmx.de>
Amazing! ❤️ |
this PR enables UI to improve "Saved messages" hugely, bringing it on WhatsApp's "Starred Messages" or Telegram's "Saved Messages" level. with this PR, UIs can add the following functionality with few effort (~100 loc on iOS):
these features were often requested, in the forum, but also in many one-to-one discussions, recently at the global gathering.
moreover, in contrast to the old method with "forward to saved", no traffic is wasted - the messages are saved locally, and only a small sync messages is sent around
this is how it looks out on iOS:
technically, still a copy is done from the original message (with already now deduplicated blobs), so that things work nicely with deletion modes; eg. you can save an important message and preserve it from deletion that way.
jsonrpc can be done in a subsequent PR, i was implementing the UI on iOS where that was not needed (and most API were part of message object that is not in use in jsonrpc atm)
@hpk42 the forward issue we discussed earller that day is already solved (first implementation did not had an explict save_msgs() but was using forward_msgs(SELF) as saving - with the disadvantage that forwarding to SELF is not working, eg. if one wants the old behaviour) acutally, that made the PR a lot nicer, as now very few existing code is changed
previous considerations and abandoned things
while working on this PR, there was also the idea to just set a flag “starred” in the message table and not copy anything. however, while tempting, that would result in more complexity, questions and drawbacks in UI:
whatsapp does this “starred”, btw, so when original is deleted, starred is deleted as well. Telegram does things similar to us, Signal does nothing. Whatsapp has a per-chat view for starred messages - if needed, we could do sth. like that as well, however, let’s first see how far the “all view” goes (in contrast to whatsapp, we have profiles for separation as well)
for the wording: “saving” is what we’re doing here, this is much more on point as “starring” - which is more the idea of a “bookmark”, and i think, whatsapp uses this wording to not raise false expectations (still, i know of ppl that were quite upset that a “starred” message was deleted when eg. the chat was cleared to save some memory)
wrt webxdc app updates: options that come into mind were: empty (as now), snapshot (copy all updates) or shortcut (always open original). i am not sure what the best solution is, the easiest was empty, so i went for that, as it is (a) obvious, and what is already done with forwarding and (b) the original is easy to open now (in contrast to forwarding).
so, might totally be that we need or want to tweak things here, but i would leave that outside the first iteration, things are not worsened in that area
wrt reactions: as things are detached, similar to webxdc updates, we do not not to show the original reactions - that way, one can use reactions for private markers (telegram is selling that feature :)
to the icon: a disk or a bookmark might be other options, but the star is nicer and also know from other apps - and anyways a but vague UX wise. so i think, it is fine
finally, known issue is that if a message was saved that does not exist on another device, it does not get there. i think, that issue is a weak one, and can be ignored mostly, most times, user will save messages soon after receiving, and if on some devices auto-deletion is done, it is maybe not even expected to have suddenly another copy there
EDIT: once this is merged, detailed issues about what to do should be filed for android/desktop (however, they do not have urgency to adapt, things will continue working as is)