deltachat / deltachat-core-rust

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

add option to re-send a message #3236

Closed r10s closed 2 years ago

r10s commented 2 years ago

this is currently mainly needed for adding users to a chat where already some games or other webxdc are in.

the added users should then get the same webxdc state - resender and other members should not see the message twice.

link2xt commented 2 years ago

Sending messages with non-unique Message-ID opens a can of worms wrt References: calculation done differently on different devices, middlewares like outlook rewriting Message-IDs or relying on them being unique etc. Quoting will not work properly, especially for someone who resent the application, because they will have two bubbles for this application, while everyone else (including secondary devices of the same user) will not download this message and have only one message bubble for this app.

IMO it's safer to have an unique Application-ID and resend the application with the same Application-ID but new Message-ID and explicitly display it as being a resent copy of a previous message containing the same app.

Simon-Laux commented 2 years ago

maybe let the application id be the zip's file hash + something random, so that it can not be abused/misused yet

r10s commented 2 years ago

Quoting will not work properly, especially for someone who resent the application, because they will have two bubbles for this application

i think, the idea is to have the "bubble" still only one time, also for the resender [1]
group members that already have the Message-ID ignore it already.

so, all Delta Chats still use the same Message-ID, and each Message-ID:bubble is still 1:1

however that works on the wire, for quoting etc. it seems to be needed that in the database the original and resend messages have the same Message-ID - to allow later quotes etc.

but yes, for outlook and maybe other MUA, this may cause problems :/ not sure, however, how much that adds to the already existing problems [2]

as resending is also useful for non-webxdc, we should maybe put that aspect aside a bit. also, i removed the "Message-ID" from the issue title, it is just one way to achieve resending. if we find a similar easy approach that is more compatible, the better :)


[1] that may still be complicated internally as currently a message-record is needed to create a mime-structure that can be sent

[2] there is also Supersedes: and Obsoletes: in https://datatracker.ietf.org/doc/html/rfc2076#section-3.6, however, i do not think there is much support for that in other MUA.

r10s commented 2 years ago

i created a pr for the Message-ID idea at https://github.com/deltachat/deltachat-core-rust/pull/3238 - it was amazingly simple, but sure, it may has some drawbacks (i tried to point them out there, please add your comments :)