deltachat / deltachat-core-rust

Delta Chat Rust Core library, used by Android/iOS/desktop apps, bindings and bots 📧
https://delta.chat/en/contribute
Other
638 stars 82 forks source link

Improve Draft creation api #2948

Closed Simon-Laux closed 2 years ago

Simon-Laux commented 2 years ago

as we now have the possibility to retain draft's message ids the next logical step would be to be able to reuse the draft message object in most cases. currently it is not possible to do the following without recreating the message object:

also the recreation of the message object means new id so the draft message preservation doesn't work, which will result in bugs like:

  1. draft webXdc app as answer to another message (webXdc draft with qoute)
  2. configure webXdc app
  3. remove the qoute
  4. You just LOST your configuration

This is likely needed for desktop to prevent those possible bugs.

r10s commented 2 years ago

changing quotes should be possible, agree.

although i am not sure in general how useful it is to answer to a message with an webxdc app, that could still streamline internal workflows.

for changing view types and files, i do not see why this is needed practically. at a first glance, eg. changing webxdc-file will raise issues as updates do no longer match. i would not go for that.

however, the adaptions should be quite simple as on updating drafts, param are updated and param contain quotes/files.

as a concrete action, i suggest to adaptmsg.set_quote() handle None (resp. dc_msg_set_quote() to handle NULL).